mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 06:04:59 +00:00
Merged Events and EncounterModifier into module EventHandlers
This commit is contained in:
@@ -217,18 +217,20 @@ def pbHatch(pokemon)
|
||||
end
|
||||
end
|
||||
|
||||
Events.onStepTaken += proc { |_sender, _e|
|
||||
$player.party.each do |egg|
|
||||
next if egg.steps_to_hatch <= 0
|
||||
egg.steps_to_hatch -= 1
|
||||
$player.pokemon_party.each do |pkmn|
|
||||
next if !pkmn.ability&.has_flag?("FasterEggHatching")
|
||||
EventHandlers.add(:on_player_step_taken, :hatch_eggs,
|
||||
proc {
|
||||
$player.party.each do |egg|
|
||||
next if egg.steps_to_hatch <= 0
|
||||
egg.steps_to_hatch -= 1
|
||||
break
|
||||
$player.pokemon_party.each do |pkmn|
|
||||
next if !pkmn.ability&.has_flag?("FasterEggHatching")
|
||||
egg.steps_to_hatch -= 1
|
||||
break
|
||||
end
|
||||
if egg.steps_to_hatch <= 0
|
||||
egg.steps_to_hatch = 0
|
||||
pbHatch(egg)
|
||||
end
|
||||
end
|
||||
if egg.steps_to_hatch <= 0
|
||||
egg.steps_to_hatch = 0
|
||||
pbHatch(egg)
|
||||
end
|
||||
end
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user