Updated happiness values (assuming Timburr/Stunfisk not changing are mistakes), added new type of evolution that triggers after any battle, added code to let Galarian Farfetch'd evolve after dealing 3 critical hits

This commit is contained in:
Maruno17
2021-07-09 21:44:58 +01:00
parent ae7661edc5
commit 33f0403945
9 changed files with 1405 additions and 1367 deletions

View File

@@ -7,6 +7,7 @@ module GameData
attr_reader :level_up_proc
attr_reader :use_item_proc
attr_reader :on_trade_proc
attr_reader :after_battle_proc
attr_reader :event_proc
attr_reader :after_evolution_proc
@@ -26,6 +27,7 @@ module GameData
@level_up_proc = hash[:level_up_proc]
@use_item_proc = hash[:use_item_proc]
@on_trade_proc = hash[:on_trade_proc]
@after_battle_proc = hash[:after_battle_proc]
@event_proc = hash[:event_proc]
@after_evolution_proc = hash[:after_evolution_proc]
end
@@ -42,6 +44,10 @@ module GameData
return (@on_trade_proc) ? @on_trade_proc.call(*args) : nil
end
def call_after_battle(*args)
return (@after_battle_proc) ? @after_battle_proc.call(*args) : nil
end
def call_event(*args)
return (@event_proc) ? @event_proc.call(*args) : nil
end
@@ -604,6 +610,19 @@ GameData::Evolution.register({
}
})
#===============================================================================
# Evolution methods that are triggered after any battle
#===============================================================================
GameData::Evolution.register({
:id => :BattleDealCriticalHit,
:parameter => Integer,
:after_battle_proc => proc { |pkmn, party_index, parameter|
next $PokemonTemp.party_critical_hits_dealt &&
$PokemonTemp.party_critical_hits_dealt[party_index] &&
$PokemonTemp.party_critical_hits_dealt[party_index] >= parameter
}
})
#===============================================================================
# Evolution methods that are triggered by an event
#===============================================================================