Refactored phone/rematches code, added Phone.rematches_enabled/Phone.rematch_variant/map metadata flag "NoPhoneSignal", changed event layout, trainer contacts can use Common Events for their calls, etc.

This commit is contained in:
Maruno17
2022-08-13 16:52:42 +01:00
parent c79b970d6b
commit aa9b1a9e23
9 changed files with 851 additions and 412 deletions

View File

@@ -391,13 +391,13 @@ MenuHandlers.add(:debug_menu, :ready_rematches, {
"parent" => :battle_menu,
"description" => _INTL("Make all trainers in the phone ready for rematches."),
"effect" => proc {
if !$PokemonGlobal.phoneNumbers || $PokemonGlobal.phoneNumbers.length == 0
if !$PokemonGlobal.phone || $PokemonGlobal.phone.contacts.length == 0
pbMessage(_INTL("There are no trainers in the Phone."))
else
$PokemonGlobal.phoneNumbers.each do |i|
next if i.length != 8 # Isn't a trainer with an event
i[4] = 2
pbSetReadyToBattle(i)
$PokemonGlobal.phone.contacts.each do |contact|
next if !contact.trainer?
contact.rematch_flag = 1
contact.set_trainer_event_ready_for_rematch
end
pbMessage(_INTL("All trainers in the Phone are now ready to rebattle."))
end