Updating MoveDetailSerializer to change $effect_chance to actual number

This commit is contained in:
Robert Williams 2024-02-02 15:16:58 -06:00
parent 4c346c45d6
commit e0a877be9b
2 changed files with 7 additions and 4 deletions

View file

@ -153,9 +153,7 @@ This move cannot be copied by []{move:mimic} or []{move:mirror-move}, nor select
The user takes damage instead of being healed if the target has []{ability:liquid-ooze}.
[]{move:rapid-spin} will remove this effect.
This effect is passed on by []{move:baton-pass}."
86,9,Does nothing.,"Does nothing.
7,9,Has a $e.
This move cannot be used while []{move:gravity} is in effect."
87,9,Disables the target's last used move for 1-8 turns.,"Disables the target's last used move, preventing its use for 47 turns, selected at random, or until the target leaves the [field]{mechanic:field}. If the target hasn't used a move since entering the [field]{mechanic:field}, if it tried to use a move this turn and [failed]{mechanic:failed}, if its last used move has 0 PP remaining, or if it already has a move disabled, this move will fail."

1 move_effect_id local_language_id short_effect effect
153 169 170 9 Lowers the target's Attack and Special Attack by two stages. User faints. Power doubles if user is burned, paralyzed, or poisoned. Lowers the target's [Attack]{mechanic:attack} and [Special Attack]{mechanic:special-attack} by two [stages]{mechanic:stage}. User faints. Inflicts [regular damage]{mechanic:regular-damage}. If the user is [burned]{mechanic:burned}, [paralyzed]{mechanic:paralyzed}, or [poisoned]{mechanic:poisoned}, this move has double power.
154 170 171 9 Power doubles if user is burned, paralyzed, or poisoned. If the user takes damage before attacking, the attack is canceled. Inflicts [regular damage]{mechanic:regular-damage}. If the user is [burned]{mechanic:burned}, [paralyzed]{mechanic:paralyzed}, or [poisoned]{mechanic:poisoned}, this move has double power. Inflicts [regular damage]{mechanic:regular-damage}. If the user takes damage this turn before hitting, this move will [fail]{mechanic:fail}. This move cannot be copied by []{move:mirror-move}, nor selected by []{move:assist}, []{move:metronome}, or []{move:sleep-talk}.
155 171 172 9 If the user takes damage before attacking, the attack is canceled. If the target is paralyzed, inflicts double damage and cures the paralysis. Inflicts [regular damage]{mechanic:regular-damage}. If the user takes damage this turn before hitting, this move will [fail]{mechanic:fail}. This move cannot be copied by []{move:mirror-move}, nor selected by []{move:assist}, []{move:metronome}, or []{move:sleep-talk}. Inflicts [regular damage]{mechanic:regular-damage}. If the target is [paralyzed]{mechanic:paralyzed}, this move has double power, and the target is cured of its [paralysis]{mechanic:paralysis}.
156 172 173 9 If the target is paralyzed, inflicts double damage and cures the paralysis. Redirects the target's single-target effects to the user for this turn. Inflicts [regular damage]{mechanic:regular-damage}. If the target is [paralyzed]{mechanic:paralyzed}, this move has double power, and the target is cured of its [paralysis]{mechanic:paralysis}. Until the end of this turn, any moves that opposing Pokémon target solely at the user's ally will instead target the user. If both Pokémon on the same side of the [field]{mechanic:field} use this move on the same turn, the Pokémon that uses it last will become the target. This effect takes priority over []{ability:lightning-rod} and []{ability:storm-drain}. If the user's ally [switches out]{mechanic:switches-out}, opposing Pokémon may still hit it with []{move:pursuit}. This move cannot be selected by []{move:assist} or []{move:metronome}.
173 9 Redirects the target's single-target effects to the user for this turn. Until the end of this turn, any moves that opposing Pokémon target solely at the user's ally will instead target the user. If both Pokémon on the same side of the [field]{mechanic:field} use this move on the same turn, the Pokémon that uses it last will become the target. This effect takes priority over []{ability:lightning-rod} and []{ability:storm-drain}. If the user's ally [switches out]{mechanic:switches-out}, opposing Pokémon may still hit it with []{move:pursuit}. This move cannot be selected by []{move:assist} or []{move:metronome}.
174 9 Uses a move which depends upon the terrain. Uses another move chosen according to the terrain. Terrain | Selected move ------------------------- | ------------------ Building | []{move:tri-attack} Cave | []{move:rock-slide} Deep water | []{move:hydro-pump} Desert | []{move:earthquake} Grass | []{move:seed-bomb} Mountain | []{move:rock-slide} Road | []{move:earthquake} Shallow water | []{move:hydro-pump} Snow | []{move:blizzard} Tall grass | []{move:seed-bomb} []{move:electric-terrain} | []{move:thunderbolt} []{move:grassy-terrain} | []{move:energy-ball} []{move:misty-terrain} | []{move:moonblast} In Pokémon Battle Revolution: Terrain | Selected move -------------- | ------------------ Courtyard | []{move:tri-attack} Crystal | []{move:rock-slide} Gateway | []{move:hydro-pump} Magma | []{move:rock-slide} Main Street | []{move:tri-attack} Neon | []{move:tri-attack} Stargazer | []{move:rock-slide} Sunny Park | []{move:seed-bomb} Sunset | []{move:earthquake} Waterfall | []{move:seed-bomb} This move cannot be copied by []{move:mirror-move}.
157 175 174 9 Raises the user's Special Defense by one stage. User's Electric moves have doubled power next turn. Uses a move which depends upon the terrain. Raises the user's [Special Defense]{mechanic:special-defense} by one [stage]{mechanic:stage}. If the user uses an []{type:electric} move next turn, its power will be doubled. Uses another move chosen according to the terrain. Terrain | Selected move ------------------------- | ------------------ Building | []{move:tri-attack} Cave | []{move:rock-slide} Deep water | []{move:hydro-pump} Desert | []{move:earthquake} Grass | []{move:seed-bomb} Mountain | []{move:rock-slide} Road | []{move:earthquake} Shallow water | []{move:hydro-pump} Snow | []{move:blizzard} Tall grass | []{move:seed-bomb} []{move:electric-terrain} | []{move:thunderbolt} []{move:grassy-terrain} | []{move:energy-ball} []{move:misty-terrain} | []{move:moonblast} In Pokémon Battle Revolution: Terrain | Selected move -------------- | ------------------ Courtyard | []{move:tri-attack} Crystal | []{move:rock-slide} Gateway | []{move:hydro-pump} Magma | []{move:rock-slide} Main Street | []{move:tri-attack} Neon | []{move:tri-attack} Stargazer | []{move:rock-slide} Sunny Park | []{move:seed-bomb} Sunset | []{move:earthquake} Waterfall | []{move:seed-bomb} This move cannot be copied by []{move:mirror-move}.
158 176 175 9 For the next few turns, the target can only use damaging moves. Raises the user's Special Defense by one stage. User's Electric moves have doubled power next turn. Target is forced to only use damaging moves for the next 3–5 turns, selected at random. Moves that select other moves not known in advance do not count as damaging. []{move:assist}, []{move:copycat}, []{move:me-first}, []{move:metronome}, []{move:mirror-move}, and []{move:sleep-talk} do not directly inflict damage and thus may not be used. []{move:bide}, []{move:counter}, []{move:endeavor}, []{move:metal-burst}, and []{move:mirror-coat} are allowed. Raises the user's [Special Defense]{mechanic:special-defense} by one [stage]{mechanic:stage}. If the user uses an []{type:electric} move next turn, its power will be doubled.
159 177 176 9 Ally's next move inflicts half more damage. For the next few turns, the target can only use damaging moves. Boosts the power of the target's moves by 50% until the end of this turn. This move cannot be copied by []{move:mirror-move}, nor selected by []{move:assist} or []{move:metronome}. Target is forced to only use damaging moves for the next 3–5 turns, selected at random. Moves that select other moves not known in advance do not count as damaging. []{move:assist}, []{move:copycat}, []{move:me-first}, []{move:metronome}, []{move:mirror-move}, and []{move:sleep-talk} do not directly inflict damage and thus may not be used. []{move:bide}, []{move:counter}, []{move:endeavor}, []{move:metal-burst}, and []{move:mirror-coat} are allowed.

View file

@ -2343,7 +2343,12 @@ class MoveDetailSerializer(serializers.ModelSerializer):
data = MoveEffectEffectTextSerializer(
effect_texts, many=True, context=self.context
).data
effect_entries = data[0]
for i, k in enumerate(effect_entries):
print(i, k)
if '$effect_chance%' in effect_entries[k]:
data[0][k] = effect_entries[k].replace('$effect_chance', f'{obj.move_effect_chance}')
return data
def get_effect_change_text(self, obj):