Pokémon sent into battle now default to the Fight option, fixed bugs in Instruct, fixed some AI bugs, fixed parameter mixup for def pbMoveCanTarget?, renamed function to function_code everywhere, fixed black party Pokémon icons in storage, added some more AI testing code

This commit is contained in:
Maruno17
2023-06-18 20:12:36 +01:00
parent 9c2a9130a5
commit b5e37248b9
42 changed files with 305 additions and 174 deletions

View File

@@ -22,22 +22,22 @@ end
#===============================================================================
class Battle::Move::Confusion < Battle::Move
def initialize(battle, move)
@battle = battle
@realMove = move
@id = :CONFUSEDAMAGE
@name = ""
@function = "None"
@power = 40
@type = nil
@category = 0
@accuracy = 100
@pp = -1
@target = :User
@priority = 0
@flags = []
@addlEffect = 0
@powerBoost = false
@snatched = false
@battle = battle
@realMove = move
@id = :CONFUSEDAMAGE
@name = ""
@function_code = "None"
@power = 40
@type = nil
@category = 0
@accuracy = 100
@pp = -1
@target = :User
@priority = 0
@flags = []
@addlEffect = 0
@powerBoost = false
@snatched = false
end
def physicalMove?(thisType = nil); return true; end
@@ -50,22 +50,22 @@ end
#===============================================================================
class Battle::Move::Struggle < Battle::Move
def initialize(battle, move)
@battle = battle
@realMove = nil # Not associated with a move
@id = :STRUGGLE
@name = _INTL("Struggle")
@function = "Struggle"
@power = 50
@type = nil
@category = 0
@accuracy = 0
@pp = -1
@target = :RandomNearFoe
@priority = 0
@flags = ["Contact", "CanProtect"]
@addlEffect = 0
@powerBoost = false
@snatched = false
@battle = battle
@realMove = nil # Not associated with a move
@id = :STRUGGLE
@name = _INTL("Struggle")
@function_code = "Struggle"
@power = 50
@type = nil
@category = 0
@accuracy = 0
@pp = -1
@target = :RandomNearFoe
@priority = 0
@flags = ["Contact", "CanProtect"]
@addlEffect = 0
@powerBoost = false
@snatched = false
end
def physicalMove?(thisType = nil); return true; end
@@ -339,7 +339,7 @@ class Battle::Move::TwoTurnMove < Battle::Move
"TwoTurnAttackInvulnerableUnderwater",
"TwoTurnAttackInvulnerableInSkyParalyzeTarget",
"TwoTurnAttackInvulnerableRemoveProtections",
"TwoTurnAttackInvulnerableInSkyTargetCannotAct"].include?(@function)
"TwoTurnAttackInvulnerableInSkyTargetCannotAct"].include?(@function_code)
@battle.pbCommonAnimation("UseItem", user)
end
@battle.pbDisplay(_INTL("{1} became fully charged due to its Power Herb!", user.pbThis))
@@ -549,7 +549,7 @@ class Battle::Move::PledgeMove < Battle::Move
move = @battle.choices[b.index][2]
next if !move
@combos.each do |i|
next if i[0] != move.function
next if i[0] != move.function_code
@pledgeSetup = true
@pledgeOtherUser = b
break
@@ -584,7 +584,7 @@ class Battle::Move::PledgeMove < Battle::Move
return if !@pledgeSetup
@battle.pbDisplay(_INTL("{1} is waiting for {2}'s move...",
user.pbThis, @pledgeOtherUser.pbThis(true)))
@pledgeOtherUser.effects[PBEffects::FirstPledge] = @function
@pledgeOtherUser.effects[PBEffects::FirstPledge] = @function_code
@pledgeOtherUser.effects[PBEffects::MoveNext] = true
user.lastMoveFailed = true # Treated as a failure for Stomping Tantrum
end