Introduce BaseMove class, which behaves like move .json config but has functions associated with it. Also, adds following classes for their respective moves.
OHKOMove
SecondaryEffectMove
BoostingMove
VolatileStatusMove
Moves application of boosts, secondary effects, and volatile status to the classes (as opposed to the pokemon_engine). This should make adding the more complex effects of moves much simpler (such as weather, terrain, etc) and make the pokemon_engine code a bit less cluttered.
Test Cases
tests/misc_tests/moves_test.py
Initializing from an empty dictionary has no results.
Bracket operators, as well as in works on the BaseMove class
An univested level 100 Exploud ttacking an uninvested level 100 Floatzel with Tackle does 78 damage maximum.
For damage modifiers
Exploud using Tackle on Gengar gets a modifier of 0 (1.5 for STAB * 0 for Type Effectiveness = 0)
Exploud using Tackle on Floatzel gets a modifier of 1.5 (1.5 for STAB = 1.5)
Floatzel using Tackle on Regirock gets a modifier of 0.5 (0.5 for Type Effectiveness = 0.5)
Exploud using Tackle on Regirock gets a modifier of 0.75 (1.5 for STAB * 0.5 for Type Effectiveness = 0.75)
For move accuracy
Hydro Pump misses sometimes (80% accuracy)
Aerial Ace never misses (True accuracy)
Fire Punch also never misses (100% accuracy)
Sheer Cold misses more than Hydro Pump (30% accuracy)
An Exploud using Sheer Cold on a full HP floatzel should do 100% of the floatzel's HP as damage.
For Secondary Status Stat Changes for Opponents
Spinda using Low Sweep on Scyther should result in Scyther being at -1 Speed
No matter how many times Spinda uses Low Sweep, Scyther's speed modifier should not drop below -6
Spinda using Low Sweep on Gengar should result in no changes to Gengar's speed modifier, as Low Sweep (Fighting-type move) does not affect Gengar (Ghost-type)
For Secondary Status Stat changes on Self
Spinda using Power-Up Punch on Scyther should result in Spinda being at +1 Attack
No matter how many times Spinda uses Power-Up Punch, its attack modifier should not go above +6
Spinda using Power-Up Punch on Gengar should result in no changes to Gengar's speed modifier, as Power-Up Punch (Fighting-type move) does not affect Gengar (Ghost-type)
For Secondary Effects as Status
Spinda using Nuzzle on Charizard should result in Charizard being Paralyzed
If Charizard is Poisoned and Spinda uses Nuzzle, Charizard should remain Poisoned
Spinda using Inferno on a Charizard should result in no Status being applied (fire-types cannot be burned)
Spinda using Nuzzle on a Trapinch should result in no status being applied, as Nuzzle does no damage to ground-types.
For Boosting Moves
Swords Dance boosts Spinda's attack two stages
No matter how many times Spinda uses Swords Dance, its attack cannot go higher than +6
Leer lowers Charizard's defense one stage
No matter how many times Leer is used, Charizard's defense does not drop lower than -6
For moves that apply volatile status
Moves that apply Volatile Statuses (confusion, uproar) as their primary effect apply that effect
Substitute drains its target of 25% of its maximum HP, and applies the status properly
A move with the lockedmove volatile status stores the move it locks the user into
The generate_move function properly assigns moves their respective classes
Addresses Issue #82
Updates
Introduce
BaseMove
class, which behaves like move.json
config but has functions associated with it. Also, adds following classes for their respective moves.Moves application of boosts, secondary effects, and volatile status to the classes (as opposed to the
pokemon_engine
). This should make adding the more complex effects of moves much simpler (such as weather, terrain, etc) and make thepokemon_engine
code a bit less cluttered.Test Cases
tests/misc_tests/moves_test.py
in
works on the BaseMove classlockedmove
volatile status stores the move it locks the user intogenerate_move
function properly assigns moves their respective classes