Added script to make two random AI trainers battle, tweaked battle messages when logged, fixed typos

This commit is contained in:
Maruno17
2022-09-06 22:57:51 +01:00
parent b8c61a6038
commit eecb7a1453
27 changed files with 335 additions and 154 deletions

View File

@@ -248,10 +248,9 @@ class Battle::Move
oldHP = b.hp
if b.damageState.substitute
old_sub_hp = b.effects[PBEffects::Substitute] + b.damageState.hpLost
PBDebug.log("[Move damage] #{b.pbThis}'s substitute lost #{b.damageState.hpLost} HP (#{old_sub_hp}=>#{b.effects[PBEffects::Substitute]})")
PBDebug.log("[Substitute HP change] #{b.pbThis}'s substitute lost #{b.damageState.hpLost} HP (#{old_sub_hp} -> #{b.effects[PBEffects::Substitute]})")
else
oldHP += b.damageState.hpLost
PBDebug.log("[Move damage] #{b.pbThis} lost #{b.damageState.hpLost} HP (#{oldHP}=>#{b.hp})")
end
effectiveness = 0
if Effectiveness.resistant?(b.damageState.typeMod)

View File

@@ -23,10 +23,17 @@ end
# (Fell Stinger (Gen 6-))
#===============================================================================
class Battle::Move::RaiseUserAttack2IfTargetFaints < Battle::Move
attr_reader :statUp
def initialize(battle, move)
super
@statUp = [:ATTACK, 2]
end
def pbEffectAfterAllHits(user, target)
return if !target.damageState.fainted
return if !user.pbCanRaiseStatStage?(:ATTACK, user, self)
user.pbRaiseStatStage(:ATTACK, 2, user)
return if !user.pbCanRaiseStatStage?(@statUp[0], user, self)
user.pbRaiseStatStage(@statUp[0], @statUp[1], user)
end
end
@@ -45,10 +52,17 @@ end
# (Fell Stinger (Gen 7+))
#===============================================================================
class Battle::Move::RaiseUserAttack3IfTargetFaints < Battle::Move
attr_reader :statUp
def initialize(battle, move)
super
@statUp = [:ATTACK, 3]
end
def pbEffectAfterAllHits(user, target)
return if !target.damageState.fainted
return if !user.pbCanRaiseStatStage?(:ATTACK, user, self)
user.pbRaiseStatStage(:ATTACK, 3, user)
return if !user.pbCanRaiseStatStage?(@statUp[0], user, self)
user.pbRaiseStatStage(@statUp[0], @statUp[1], user)
end
end