Some bug fixes

This commit is contained in:
Maruno17
2021-02-03 20:33:46 +00:00
parent e1e9706cd9
commit e9ed260277
4 changed files with 17 additions and 16 deletions

View File

@@ -56,7 +56,7 @@ class PokeBattle_AI
end end
def pbCalcTypeMod(moveType,user,target) def pbCalcTypeMod(moveType,user,target)
return PBTypeEffectiveness::NORMAL_EFFECTIVE if moveType<0 return PBTypeEffectiveness::NORMAL_EFFECTIVE if !moveType
return PBTypeEffectiveness::NORMAL_EFFECTIVE if moveType == :GROUND && return PBTypeEffectiveness::NORMAL_EFFECTIVE if moveType == :GROUND &&
target.pbHasType?(:FLYING) && target.hasActiveItem?(:IRONBALL) target.pbHasType?(:FLYING) && target.hasActiveItem?(:IRONBALL)
# Determine types # Determine types
@@ -93,7 +93,7 @@ class PokeBattle_AI
return true if PBTypeEffectiveness.ineffective?(typeMod) || score<=0 return true if PBTypeEffectiveness.ineffective?(typeMod) || score<=0
# Immunity due to ability/item/other effects # Immunity due to ability/item/other effects
if skill>=PBTrainerAI.mediumSkill if skill>=PBTrainerAI.mediumSkill
case move.type case type
when :GROUND when :GROUND
return true if target.airborne? && !move.hitsFlyingTargets? return true if target.airborne? && !move.hitsFlyingTargets?
when :FIRE when :FIRE

View File

@@ -350,7 +350,7 @@ class FightMenuDisplay < BattleMenuBase
x = button.x-self.x+button.src_rect.width/2 x = button.x-self.x+button.src_rect.width/2
y = button.y-self.y+8 y = button.y-self.y+8
moveNameBase = TEXT_BASE_COLOR moveNameBase = TEXT_BASE_COLOR
if moves[i].type>=0 if moves[i].type
# NOTE: This takes a colour from a particular pixel in the button # NOTE: This takes a colour from a particular pixel in the button
# graphic and makes the move name's base colour that same colour. # graphic and makes the move name's base colour that same colour.
# The pixel is at coordinates 10,34 in the button box. If you # The pixel is at coordinates 10,34 in the button box. If you
@@ -374,7 +374,7 @@ class FightMenuDisplay < BattleMenuBase
end end
@visibility["button_#{i}"] = true @visibility["button_#{i}"] = true
button.src_rect.x = (i==@index) ? @buttonBitmap.width/2 : 0 button.src_rect.x = (i==@index) ? @buttonBitmap.width/2 : 0
button.src_rect.y = moves[i].type*BUTTON_HEIGHT button.src_rect.y = GameData::Type.get(moves[i].type).id_number * BUTTON_HEIGHT
button.z = self.z + ((i==@index) ? 4 : 3) button.z = self.z + ((i==@index) ? 4 : 3)
end end
end end

View File

@@ -183,7 +183,7 @@ class NPCTrainer < Trainer
def initialize(name, trainer_type) def initialize(name, trainer_type)
super super
@items = [] @items = []
@lose_text = GameData::TrainerType.get(@trainer_type).lose_text @lose_text = nil
end end
end end

View File

@@ -205,6 +205,7 @@ DebugMenuCommands.register("testwildbattle", {
pbWildBattle(species, level) pbWildBattle(species, level)
end end
end end
next false
} }
}) })
@@ -268,6 +269,7 @@ DebugMenuCommands.register("testwildbattleadvanced", {
end end
end end
end end
next false
} }
}) })
@@ -276,11 +278,11 @@ DebugMenuCommands.register("testtrainerbattle", {
"name" => _INTL("Test Trainer Battle"), "name" => _INTL("Test Trainer Battle"),
"description" => _INTL("Start a single battle against a trainer of your choice."), "description" => _INTL("Start a single battle against a trainer of your choice."),
"effect" => proc { "effect" => proc {
battle = pbListScreen(_INTL("SINGLE TRAINER"), TrainerBattleLister.new(0, false)) trainerdata = pbListScreen(_INTL("SINGLE TRAINER"), TrainerBattleLister.new(0, false))
if battle if trainerdata
trainerdata = battle[1]
pbTrainerBattle(trainerdata[0], trainerdata[1], nil, false, trainerdata[2], true) pbTrainerBattle(trainerdata[0], trainerdata[1], nil, false, trainerdata[2], true)
end end
next false
} }
}) })
@@ -350,20 +352,18 @@ DebugMenuCommands.register("testtrainerbattleadvanced", {
_INTL("Choose the number of battlers on the player's side (max. {1}).", maxVal), params) _INTL("Choose the number of battlers on the player's side (max. {1}).", maxVal), params)
size0 = newSize if newSize > 0 size0 = newSize if newSize > 0
elsif trainerCmd == trainerCmds.length - 4 # Add trainer elsif trainerCmd == trainerCmds.length - 4 # Add trainer
battle = pbListScreen(_INTL("CHOOSE A TRAINER"), TrainerBattleLister.new(0, false)) trainerdata = pbListScreen(_INTL("CHOOSE A TRAINER"), TrainerBattleLister.new(0, false))
if battle if trainerdata
trainerdata = battle[1]
tr = pbLoadTrainer(trainerdata[0], trainerdata[1], trainerdata[2]) tr = pbLoadTrainer(trainerdata[0], trainerdata[1], trainerdata[2])
trainers.push([battle[0], tr]) trainers.push([0, tr])
end end
else # Edit a trainer else # Edit a trainer
if pbConfirmMessage(_INTL("Change this trainer?")) if pbConfirmMessage(_INTL("Change this trainer?"))
battle = pbListScreen(_INTL("CHOOSE A TRAINER"), trainerdata = pbListScreen(_INTL("CHOOSE A TRAINER"),
TrainerBattleLister.new(trainers[trainerCmd][0], false)) TrainerBattleLister.new(trainers[trainerCmd][0], false))
if battle if trainerdata
trainerdata = battle[1]
tr = pbLoadTrainer(trainerdata[0], trainerdata[1], trainerdata[2]) tr = pbLoadTrainer(trainerdata[0], trainerdata[1], trainerdata[2])
trainers[trainerCmd] = [battle[0], tr] trainers[trainerCmd] = [0, tr]
end end
elsif pbConfirmMessage(_INTL("Delete this trainer?")) elsif pbConfirmMessage(_INTL("Delete this trainer?"))
trainers[trainerCmd] = nil trainers[trainerCmd] = nil
@@ -371,6 +371,7 @@ DebugMenuCommands.register("testtrainerbattleadvanced", {
end end
end end
end end
next false
} }
}) })