mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 05:34:58 +00:00
Fixed typos in def pbCalcTypeModPokemon, fixed party screen navigation errors when there are no Pokémon, advanced battle Debug functions now trigger modifiers, can now always change a Pokémon's form to 0
This commit is contained in:
@@ -83,12 +83,12 @@ class Battle::AI
|
|||||||
|
|
||||||
# For switching. Determines the effectiveness of a potential switch-in against
|
# For switching. Determines the effectiveness of a potential switch-in against
|
||||||
# an opposing battler.
|
# an opposing battler.
|
||||||
def pbCalcTypeModPokemon(battlerThis, _battlerOther)
|
def pbCalcTypeModPokemon(battlerThis, battlerOther)
|
||||||
mod1 = Effectiveness.calculate(battlerThis.types[0], target.types[0], target.types[1])
|
mod1 = Effectiveness.calculate(battlerThis.types[0], battlerOther.types[0], battlerOther.types[1])
|
||||||
mod2 = Effectiveness::NORMAL_EFFECTIVE
|
mod2 = Effectiveness::NORMAL_EFFECTIVE
|
||||||
if battlerThis.types.length > 1
|
if battlerThis.types.length > 1
|
||||||
mod2 = Effectiveness.calculate(battlerThis.types[1], target.types[0], target.types[1])
|
mod2 = Effectiveness.calculate(battlerThis.types[1], battlerOther.types[0], battlerOther.types[1])
|
||||||
mod2 = mod2.to_f / Effectivenesss::NORMAL_EFFECTIVE
|
mod2 = mod2.to_f / Effectiveness::NORMAL_EFFECTIVE
|
||||||
end
|
end
|
||||||
return mod1 * mod2
|
return mod1 * mod2
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -811,6 +811,7 @@ class PokemonParty_Scene
|
|||||||
currentsel = Settings::MAX_PARTY_SIZE
|
currentsel = Settings::MAX_PARTY_SIZE
|
||||||
elsif currentsel == numsprites
|
elsif currentsel == numsprites
|
||||||
currentsel = 0
|
currentsel = 0
|
||||||
|
currentsel = numsprites - 1 if currentsel >= @party.length
|
||||||
end
|
end
|
||||||
when Input::UP
|
when Input::UP
|
||||||
if currentsel >= Settings::MAX_PARTY_SIZE
|
if currentsel >= Settings::MAX_PARTY_SIZE
|
||||||
@@ -818,6 +819,7 @@ class PokemonParty_Scene
|
|||||||
while currentsel > 0 && currentsel < Settings::MAX_PARTY_SIZE && !@party[currentsel]
|
while currentsel > 0 && currentsel < Settings::MAX_PARTY_SIZE && !@party[currentsel]
|
||||||
currentsel -= 1
|
currentsel -= 1
|
||||||
end
|
end
|
||||||
|
currentsel = numsprites - 1 if currentsel >= @party.length
|
||||||
else
|
else
|
||||||
loop do
|
loop do
|
||||||
currentsel -= 2
|
currentsel -= 2
|
||||||
@@ -839,6 +841,7 @@ class PokemonParty_Scene
|
|||||||
currentsel = Settings::MAX_PARTY_SIZE
|
currentsel = Settings::MAX_PARTY_SIZE
|
||||||
elsif currentsel >= numsprites
|
elsif currentsel >= numsprites
|
||||||
currentsel = 0
|
currentsel = 0
|
||||||
|
currentsel = numsprites - 1 if currentsel >= @party.length
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return currentsel
|
return currentsel
|
||||||
@@ -853,7 +856,7 @@ class PokemonParty_Scene
|
|||||||
@sprites["pokemon#{i}"].dispose
|
@sprites["pokemon#{i}"].dispose
|
||||||
end
|
end
|
||||||
lastselected = @party.length - 1 if lastselected >= @party.length
|
lastselected = @party.length - 1 if lastselected >= @party.length
|
||||||
lastselected = 0 if lastselected < 0
|
lastselected = Settings::MAX_PARTY_SIZE if lastselected < 0
|
||||||
Settings::MAX_PARTY_SIZE.times do |i|
|
Settings::MAX_PARTY_SIZE.times do |i|
|
||||||
if @party[i]
|
if @party[i]
|
||||||
@sprites["pokemon#{i}"] = PokemonPartyPanel.new(@party[i], i, @viewport)
|
@sprites["pokemon#{i}"] = PokemonPartyPanel.new(@party[i], i, @viewport)
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ MenuHandlers.add(:debug_menu, :test_wild_battle_advanced, {
|
|||||||
params.setCancelValue(0)
|
params.setCancelValue(0)
|
||||||
level = pbMessageChooseNumber(_INTL("Set the wild {1}'s level.",
|
level = pbMessageChooseNumber(_INTL("Set the wild {1}'s level.",
|
||||||
GameData::Species.get(species).name), params)
|
GameData::Species.get(species).name), params)
|
||||||
pkmn.push(Pokemon.new(species, level)) if level > 0
|
pkmn.push(pbGenerateWildPokemon(species, level)) if level > 0
|
||||||
end
|
end
|
||||||
else # Edit a Pokémon
|
else # Edit a Pokémon
|
||||||
if pbConfirmMessage(_INTL("Change this Pokémon?"))
|
if pbConfirmMessage(_INTL("Change this Pokémon?"))
|
||||||
@@ -336,6 +336,7 @@ MenuHandlers.add(:debug_menu, :test_trainer_battle_advanced, {
|
|||||||
trainerdata = pbListScreen(_INTL("CHOOSE A TRAINER"), TrainerBattleLister.new(0, false))
|
trainerdata = pbListScreen(_INTL("CHOOSE A TRAINER"), TrainerBattleLister.new(0, false))
|
||||||
if trainerdata
|
if trainerdata
|
||||||
tr = pbLoadTrainer(trainerdata[0], trainerdata[1], trainerdata[2])
|
tr = pbLoadTrainer(trainerdata[0], trainerdata[1], trainerdata[2])
|
||||||
|
EventHandlers.trigger(:on_trainer_load, tr)
|
||||||
trainers.push([0, tr])
|
trainers.push([0, tr])
|
||||||
end
|
end
|
||||||
else # Edit a trainer
|
else # Edit a trainer
|
||||||
@@ -344,6 +345,7 @@ MenuHandlers.add(:debug_menu, :test_trainer_battle_advanced, {
|
|||||||
TrainerBattleLister.new(trainers[trainerCmd][0], false))
|
TrainerBattleLister.new(trainers[trainerCmd][0], false))
|
||||||
if trainerdata
|
if trainerdata
|
||||||
tr = pbLoadTrainer(trainerdata[0], trainerdata[1], trainerdata[2])
|
tr = pbLoadTrainer(trainerdata[0], trainerdata[1], trainerdata[2])
|
||||||
|
EventHandlers.trigger(:on_trainer_load, tr)
|
||||||
trainers[trainerCmd] = [0, tr]
|
trainers[trainerCmd] = [0, tr]
|
||||||
end
|
end
|
||||||
elsif pbConfirmMessage(_INTL("Delete this trainer?"))
|
elsif pbConfirmMessage(_INTL("Delete this trainer?"))
|
||||||
|
|||||||
@@ -773,6 +773,11 @@ MenuHandlers.add(:pokemon_debug_menu, :species_and_form, {
|
|||||||
end
|
end
|
||||||
if formcmds[0].length <= 1
|
if formcmds[0].length <= 1
|
||||||
screen.pbDisplay(_INTL("Species {1} only has one form.", pkmn.speciesName))
|
screen.pbDisplay(_INTL("Species {1} only has one form.", pkmn.speciesName))
|
||||||
|
if pkmn.form != 0 && screen.pbConfirm(_INTL("Do you want to reset the form to 0?"))
|
||||||
|
pkmn.form = 0
|
||||||
|
$player.pokedex.register(pkmn) if !settingUpBattle && !pkmn.egg?
|
||||||
|
screen.pbRefreshSingle(pkmnid)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
cmd2 = screen.pbShowCommands(_INTL("Set the Pokémon's form."), formcmds[1], cmd2)
|
cmd2 = screen.pbShowCommands(_INTL("Set the Pokémon's form."), formcmds[1], cmd2)
|
||||||
next if cmd2 < 0
|
next if cmd2 < 0
|
||||||
|
|||||||
Reference in New Issue
Block a user