Refactored Day Care code

This commit is contained in:
Maruno17
2021-10-30 21:56:34 +01:00
parent 899d037255
commit 308937a9f4
6 changed files with 722 additions and 544 deletions

View File

@@ -430,11 +430,10 @@ Events.onStepTaken += proc {
if ($PokemonGlobal.purifyChamber rescue nil)
$PokemonGlobal.purifyChamber.update
end
for i in 0...2
pkmn = $PokemonGlobal.daycare[i][0]
next if !pkmn
stage = pkmn.heartStage
pkmn.adjustHeart(-1)
pkmn.update_shadow_moves if pkmn.heartStage != stage
$PokemonGlobal.day_care.slots.each do |slot|
next if !slot.filled? || !slot.pokemon.shadowPokemon?
old_stage = slot.pokemon.heartStage
slot.pokemon.adjustHeart(-1)
slot.pokemon.update_shadow_moves if slot.pokemon.heartStage != old_stage
end
}