Split PokeBattle_Trainer into PlayerTrainer and NPCTrainer

This commit is contained in:
Maruno17
2021-01-24 17:55:39 +00:00
parent 7de034957b
commit 4098b1cd11
60 changed files with 748 additions and 648 deletions

View File

@@ -465,7 +465,7 @@ def pbUseItem(bag,item,bagscene=nil)
itm = GameData::Item.get(item)
useType = itm.field_use
if itm.is_machine? # TM or HM
if $Trainer.pokemonCount==0
if $Trainer.pokemon_count == 0
pbMessage(_INTL("There is no Pokémon."))
return 0
end
@@ -481,7 +481,7 @@ def pbUseItem(bag,item,bagscene=nil)
end
return 0
elsif useType==1 || useType==5 # Item is usable on a Pokémon
if $Trainer.pokemonCount==0
if $Trainer.pokemon_count == 0
pbMessage(_INTL("There is no Pokémon."))
return 0
end

View File

@@ -187,12 +187,12 @@ ItemHandlers::UseInField.add(:ESCAPEROPE,proc { |item|
})
ItemHandlers::UseInField.add(:SACREDASH,proc { |item|
if $Trainer.pokemonCount==0
if $Trainer.pokemon_count == 0
pbMessage(_INTL("There is no Pokémon."))
next 0
end
canrevive = false
for i in $Trainer.pokemonParty
for i in $Trainer.pokemon_party
next if !i.fainted?
canrevive = true; break
end
@@ -978,7 +978,7 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene|
newForm = 2 if poke2.isSpecies?(:ZEKROM)
pkmn.setForm(newForm) {
pkmn.fused = poke2
pbRemovePokemonAt(chosen)
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
}
@@ -1027,7 +1027,7 @@ ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc { |item,pkmn,scene|
end
pkmn.setForm(1) {
pkmn.fused = poke2
pbRemovePokemonAt(chosen)
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
}
@@ -1076,7 +1076,7 @@ ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc { |item,pkmn,scene|
end
pkmn.setForm(2) {
pkmn.fused = poke2
pbRemovePokemonAt(chosen)
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
}