Pokémon Miscellaneous Utils
Just some handy utils for Pokémon statistical data (usually things that are annoying to calculate every time, or too expensive to do on the client-side).
Running
miscutils -h
# NAME:
# Pokémon Miscellaneous Utils - A bunch of random things for Pokémon data
# USAGE:
# Pokémon Miscellaneous Utils [global options] [command [command options]]
# COMMANDS:
# effectiveness, types, effect calculates type effectiveness
# help, h Shows a list of commands or help for one command
# GLOBAL OPTIONS:
# --help, -h show help
(You can also place --help on each command to show more information)
Commands
Type effectiveness
- Command:
effectiveness
- Aliases:
effect, types
Will calculate the Type Effectiveness (in a defensive manner) for one or two types.
miscutils effectiveness
# NAME:
# Pokémon Miscellaneous Utils effectiveness - calculates type effectiveness
# USAGE:
# Pokémon Miscellaneous Utils effectiveness [options] types [types ...]
# OPTIONS:
# --ability string, -a string possible ability that affects the type effectiveness
# --help, -h show help
Example:
miscutils type Dragon
miscutils effect Dragon Dark
You can also optionally provide an ability that affects damage output with the --ability flag (alias -a):
miscutils type Bug Dark --ability "Wonder Guard"
# You can also use a trimmed string if you prefer
miscutils type Normal Electric -a dryskin
Library usage
Besides the CLI, this module can be imported as a library:
go get github.com/Lakelimbo/pokemon-miscutils
import (
"github.com/Lakelimbo/pokemon-miscutils/info/ability"
"github.com/Lakelimbo/pokemon-miscutils/info/types"
)
func main() {
eff := types.CalculateEffectiveness(&ability.WonderGuard, types.Dragon)
// eff[types.Dragon] == 2
}
Public packages (so far):
info/types — Type enum, Effect data, CalculateEffectiveness
info/ability — Abilities enum and modifiers
info/colors — terminal color mapping per type
info/utils — small string helpers
Build
Requirements:
- Go v1.26 or higher
- golangci-lint
To build:
make build
# or if you don't wnat to use Makefile:
CGO_ENABLED=0 go build -ldflags="-s -w"
For a smaller binary size, I recommend disabling the s and w flags, as well as CGO, even though this app is not using it. But there should be no breaking change if those are not set.
Before commiting any changes, run the linter with golangci-lint:
make lint