Moved some global metadata values to class Player, added battle points property

This commit is contained in:
Maruno17
2021-04-12 20:31:15 +01:00
parent e49ddde198
commit 9f70b29795
24 changed files with 283 additions and 94 deletions

View File

@@ -40,7 +40,7 @@ def pbPhoneDeleteContact(index)
end
def pbPhoneRegisterBattle(message,event,trainertype,trainername,maxbattles)
return if !$Trainer.pokegear # Can't register without a Pokégear
return if !$Trainer.has_pokegear # Can't register without a Pokégear
return false if !GameData::TrainerType.exists?(trainertype)
trainertype = GameData::TrainerType.get(trainertype)
contact = pbFindPhoneTrainer(trainertype,trainername)
@@ -133,7 +133,7 @@ end
# Phone-related counters
#===============================================================================
Events.onMapUpdate += proc { |_sender,_e|
next if !$Trainer || !$Trainer.pokegear
next if !$Trainer || !$Trainer.has_pokegear
# Reset time to next phone call if necessary
if !$PokemonGlobal.phoneTime || $PokemonGlobal.phoneTime<=0
$PokemonGlobal.phoneTime = 20*60*Graphics.frame_rate