Open kipyin opened 5 years ago
If we take the first choice, we would have at least 3 stat-related properties in Pokemon
: Pokemon.stats
, Pokemon.battle_stats
, and Pokemon.stages
(and even Pokemon.stage_logs
).
If we take the second choice, then we will end up with deeply stored properties.
We can also set BattleStats.attack
etc. as a named tuple: BattleStats.attack = Stat(value=100, stage=-2)
Issue #15 suggested the implementation of in-battle stats, but none of the then-existing codes actually used it, hence there is a few things that I was missing when I wrote
BattleStats
:The stage multipliers needs to be tracked, because some moves (e.g. Punishment) need to use this info.
The stage multipliers actually also include the critical-hit rate, which was not included when implementing
BattleStats
.Hence, to implement above mechanisms, we have two choices:
Make a new class,
StatStages
, and put the stage info into this new class.Make a
_Stat
class, which represent a single stat, such as hp or attack, which contains the value of its permanent stats, effective stats, stage, and stage change history. RemoveBattleStats
class. Access all stat-related data likePokemon().stats.hp.permanent
,Pokemon().stats.evasion.effective
,Pokemon().stats.critical_hit.stage_log
, etc. Of course,Pokemon().stats.critical_hit.permanent
will be a non-sense, and will probably be0
.