A portable library for accurately simulating pokemon battles.
p1 := GeneratePokemon(PkmnPikachu,
WithLevel(20),
WithMoves(MoveThunderShock))
p2 := GeneratePokemon(PkmnBulbasaur,
WithLevel(20),
WithMoves(MoveTackle))
a1 := Agent(new(dumbAgent))
b := New1v1Battle(p1, &a1, p2, &a1)
b.Start()
transactions, _ := b.SimulateRound()
for _, t := range transactions {
switch tt := t.(type) {
case UseMoveTransaction:
fmt.Printf("%s used %s on %s\n", b.GetPokemon(tt.User), tt.Move, b.GetPokemon(tt.Target))
case DamageTransaction:
fmt.Printf("%s took %d damage\n", b.GetPokemon(tt.Target), tt.Damage)
case HealTransaction:
fmt.Printf("%s healed for %d HP\n", b.GetPokemon(tt.Target), tt.Amount)
case FaintTransaction:
fmt.Printf("%s fainted\n", b.GetPokemon(tt.Target))
case PPTransaction:
continue
default:
fmt.Printf("Transaction: %T - %v\n", t, t)
}
}
- Make sure that you at least have Go 1.15
- Clone this repo
git clone [email protected]:StevensSEC/pokemonbattlelib.git
- Make and commit your changes.
- Create a Pull Request with your changes.
Using the github cli:
gh pr create