Fixed crash when soft resetting, fixed crash when Struggle and confusion pseudo-moves are used, fix broken AI, fixed crash after evolution, fixed crash when editing weather map metadata.

This commit is contained in:
Maruno17
2021-04-28 23:24:17 +01:00
parent f3048abd86
commit 17d1344e74
5 changed files with 7 additions and 8 deletions

View File

@@ -8,7 +8,7 @@ def pbSetWindowText(string)
end
class Bitmap
alias mkxp_draw_text draw_text
alias mkxp_draw_text draw_text unless method_defined?(:mkxp_draw_text)
def draw_text(x, y, width, height, text, align = 0)
height = text_size(text).height

View File

@@ -26,7 +26,7 @@ class PokeBattle_Confusion < PokeBattle_Move
@name = ""
@function = "000"
@baseDamage = 40
@type = -1
@type = nil
@category = 0
@accuracy = 100
@pp = -1
@@ -58,7 +58,7 @@ class PokeBattle_Struggle < PokeBattle_Move
@name = (move) ? move.name : _INTL("Struggle")
@function = "002"
@baseDamage = 50
@type = -1
@type = nil
@category = 0
@accuracy = 0
@pp = -1

View File

@@ -350,7 +350,7 @@ class PokeBattle_AI
if skill>=PBTrainerAI.bestSkill && target.itemActive?
# NOTE: Type-weakening berries aren't suitable for checking at the start
# of the round.
if !target.item.is_berry?
if target.item && !target.item.is_berry?
BattleHandlers.triggerDamageCalcTargetItem(target.item,
user,target,move,multipliers,baseDmg,type)
end

View File

@@ -917,9 +917,8 @@ class Pokemon
# required it to have a held item) or duplicate this Pokémon (Shedinja only).
# @param new_species [Pokemon] the species that this Pokémon evolved into
def action_after_evolution(new_species)
species_data.get_evolutions(true).each do |evo| # [new_species, method, parameter, boolean]
next if evo[3] # Prevolution
break if GameData::Evolution.get(method).call_after_evolution(self, evo[0], evo[2], new_species)
species_data.get_evolutions(true).each do |evo| # [new_species, method, parameter]
break if GameData::Evolution.get(evo[1]).call_after_evolution(self, evo[0], evo[2], new_species)
end
end

View File

@@ -757,7 +757,7 @@ module WeatherEffectProperty
options.push(w.real_name)
ids.push(w.id)
end
cmd = pbMessage(_INTL("Choose a weather effect."), options, -1, default)
cmd = pbMessage(_INTL("Choose a weather effect."), options, -1, nil, default)
return nil if cmd < 0 || ids[cmd] == :None
params = ChooseNumberParams.new
params.setRange(0, 100)