poke-env
poke-env copied to clipboard
Query About SideConditions
Hi!
I was wondering if there was any specific reason for having a different value returned in battle.side_conditions
and battle.opponent_side_conditions
for SPIKES
and TOXIC_SPIKES
alone. I understand that they are stackable conditions, but would it perhaps make more sense to use something like SPIKES1
, SPIKES2
, SPIKES3
instead like how PERISH_SONG
is handled in environment.effect.Effect
?
I ask this because having the `side_conditions_ return different values with entirely different meanings depending on what they're returning is a little weird. Especially since I have to handle these conditions separately while using them in a state.
Hey @akashsara,
Thanks for bringing that up. This organization is an artifact of the way showdown messages are sent and parsed, but it could be overrun if there was a clear benefit to it.
It like your idea of having distinct values for SPIKE
states, in the same spirit as PERISH_SONG
. I will think about it.
So I definitely do think that there is a clear benefit here since the number of instances of each side condition makes a significant impact on the result (12.5% damage for 1 stack of spikes to 25% for 3 and Poisoned vs Toxic Poisoned for toxic spikes). So I think in any case where someone is going to be using the side conditions in a state, this would have use.
But mostly, it's the function returning two different values (start turn and stacks) with no indication of it being a different value (apart from checking the documentation and realizing this) that is a problem. An alternative solution that's a little bit more annoying to parse would be if the function returned both the start turn and the number of stacks but I still think removing the idea of two different values entirely works better.