Fixed Heavy Ball's catch rate calculation being inaccurate, added Obstruct to some moves' blacklists

This commit is contained in:
Maruno17
2022-07-03 15:22:34 +01:00
parent 7e183a92aa
commit 94c6b6db0c
4 changed files with 35 additions and 39 deletions

View File

@@ -695,6 +695,7 @@ class Battle::Move::UseLastMoveUsed < Battle::Move
"ProtectUserSideFromDamagingMovesIfUserFirstTurn", # Mat Block "ProtectUserSideFromDamagingMovesIfUserFirstTurn", # Mat Block
"ProtectUserSideFromStatusMoves", # Crafty Shield # Not listed on Bulbapedia "ProtectUserSideFromStatusMoves", # Crafty Shield # Not listed on Bulbapedia
"ProtectUserFromDamagingMovesKingsShield", # King's Shield "ProtectUserFromDamagingMovesKingsShield", # King's Shield
"ProtectUserFromDamagingMovesObstruct", # Obstruct # Not listed on Bulbapedia
"ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield "ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield
"ProtectUserBanefulBunker", # Baneful Bunker "ProtectUserBanefulBunker", # Baneful Bunker
# Moves that call other moves # Moves that call other moves
@@ -1009,6 +1010,7 @@ class Battle::Move::UseRandomMoveFromUserParty < Battle::Move
"ProtectUserSideFromDamagingMovesIfUserFirstTurn", # Mat Block "ProtectUserSideFromDamagingMovesIfUserFirstTurn", # Mat Block
"ProtectUserSideFromStatusMoves", # Crafty Shield # Not listed on Bulbapedia "ProtectUserSideFromStatusMoves", # Crafty Shield # Not listed on Bulbapedia
"ProtectUserFromDamagingMovesKingsShield", # King's Shield "ProtectUserFromDamagingMovesKingsShield", # King's Shield
"ProtectUserFromDamagingMovesObstruct", # Obstruct # Not listed on Bulbapedia
"ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield "ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield
"ProtectUserBanefulBunker", # Baneful Bunker "ProtectUserBanefulBunker", # Baneful Bunker
# Moves that call other moves # Moves that call other moves

View File

@@ -545,44 +545,44 @@ class Battle::Move::TargetUsesItsLastUsedMoveAgain < Battle::Move
def initialize(battle, move) def initialize(battle, move)
super super
@moveBlacklist = [ @moveBlacklist = [
"MultiTurnAttackBideThenReturnDoubleDamage", # Bide "MultiTurnAttackBideThenReturnDoubleDamage", # Bide
"ProtectUserFromDamagingMovesKingsShield", # King's Shield "ProtectUserFromDamagingMovesKingsShield", # King's Shield
"TargetUsesItsLastUsedMoveAgain", # Instruct (this move) "TargetUsesItsLastUsedMoveAgain", # Instruct (this move)
# Struggle # Struggle
"Struggle", # Struggle "Struggle", # Struggle
# Moves that affect the moveset # Moves that affect the moveset
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic "ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
"ReplaceMoveWithTargetLastMoveUsed", # Sketch "ReplaceMoveWithTargetLastMoveUsed", # Sketch
"TransformUserIntoTarget", # Transform "TransformUserIntoTarget", # Transform
# Moves that call other moves # Moves that call other moves
"UseLastMoveUsedByTarget", # Mirror Move "UseLastMoveUsedByTarget", # Mirror Move
"UseLastMoveUsed", # Copycat "UseLastMoveUsed", # Copycat
"UseMoveTargetIsAboutToUse", # Me First "UseMoveTargetIsAboutToUse", # Me First
"UseMoveDependingOnEnvironment", # Nature Power "UseMoveDependingOnEnvironment", # Nature Power
"UseRandomUserMoveIfAsleep", # Sleep Talk "UseRandomUserMoveIfAsleep", # Sleep Talk
"UseRandomMoveFromUserParty", # Assist "UseRandomMoveFromUserParty", # Assist
"UseRandomMove", # Metronome "UseRandomMove", # Metronome
# Moves that require a recharge turn # Moves that require a recharge turn
"AttackAndSkipNextTurn", # Hyper Beam "AttackAndSkipNextTurn", # Hyper Beam
# Two-turn attacks # Two-turn attacks
"TwoTurnAttack", # Razor Wind "TwoTurnAttack", # Razor Wind
"TwoTurnAttackOneTurnInSun", # Solar Beam, Solar Blade "TwoTurnAttackOneTurnInSun", # Solar Beam, Solar Blade
"TwoTurnAttackParalyzeTarget", # Freeze Shock "TwoTurnAttackParalyzeTarget", # Freeze Shock
"TwoTurnAttackBurnTarget", # Ice Burn "TwoTurnAttackBurnTarget", # Ice Burn
"TwoTurnAttackFlinchTarget", # Sky Attack "TwoTurnAttackFlinchTarget", # Sky Attack
"TwoTurnAttackChargeRaiseUserDefense1", # Skull Bash "TwoTurnAttackChargeRaiseUserDefense1", # Skull Bash
"TwoTurnAttackInvulnerableInSky", # Fly "TwoTurnAttackInvulnerableInSky", # Fly
"TwoTurnAttackInvulnerableUnderground", # Dig "TwoTurnAttackInvulnerableUnderground", # Dig
"TwoTurnAttackInvulnerableUnderwater", # Dive "TwoTurnAttackInvulnerableUnderwater", # Dive
"TwoTurnAttackInvulnerableInSkyParalyzeTarget", # Bounce "TwoTurnAttackInvulnerableInSkyParalyzeTarget", # Bounce
"TwoTurnAttackInvulnerableRemoveProtections", # Shadow Force, Phantom Force "TwoTurnAttackInvulnerableRemoveProtections", # Shadow Force, Phantom Force
"TwoTurnAttackInvulnerableInSkyTargetCannotAct", # Sky Drop "TwoTurnAttackInvulnerableInSkyTargetCannotAct", # Sky Drop
"AllBattlersLoseHalfHPUserSkipsNextTurn", # Shadow Half "AllBattlersLoseHalfHPUserSkipsNextTurn", # Shadow Half
"TwoTurnAttackRaiseUserSpAtkSpDefSpd2", # Geomancy "TwoTurnAttackRaiseUserSpAtkSpDefSpd2", # Geomancy
# Moves that start focussing at the start of the round # Moves that start focussing at the start of the round
"FailsIfUserDamagedThisTurn", # Focus Punch "FailsIfUserDamagedThisTurn", # Focus Punch
"UsedAfterUserTakesPhysicalDamage", # Shell Trap "UsedAfterUserTakesPhysicalDamage", # Shell Trap
"BurnAttackerBeforeUserActs" # Beak Blast "BurnAttackerBeforeUserActs" # Beak Blast
] ]
end end

View File

@@ -121,7 +121,7 @@ Battle::PokeBallEffects::ModifyCatchRate.add(:LUREBALL, proc { |ball, catchRate,
Battle::PokeBallEffects::ModifyCatchRate.add(:HEAVYBALL, proc { |ball, catchRate, battle, battler| Battle::PokeBallEffects::ModifyCatchRate.add(:HEAVYBALL, proc { |ball, catchRate, battle, battler|
next 0 if catchRate == 0 next 0 if catchRate == 0
weight = battler.pokemon.species_data.base_stats[:SPEED] weight = battler.pbWeight
if Settings::NEW_POKE_BALL_CATCH_RATES if Settings::NEW_POKE_BALL_CATCH_RATES
if weight >= 3000 if weight >= 3000
catchRate += 30 catchRate += 30
@@ -141,8 +141,7 @@ Battle::PokeBallEffects::ModifyCatchRate.add(:HEAVYBALL, proc { |ball, catchRate
catchRate -= 20 catchRate -= 20
end end
end end
catchRate = [catchRate, 1].max next catchRate.clamp(1, 255)
next [catchRate, 255].min
}) })
Battle::PokeBallEffects::ModifyCatchRate.add(:LOVEBALL, proc { |ball, catchRate, battle, battler| Battle::PokeBallEffects::ModifyCatchRate.add(:LOVEBALL, proc { |ball, catchRate, battle, battler|

View File

@@ -986,19 +986,14 @@ module Compiler
list[index, 0] = new_events if new_events.length > 0 list[index, 0] = new_events if new_events.length > 0
changed = true changed = true
elsif script[/^\s*pbTrainerBattle\((.+)\)\s*$/] elsif script[/^\s*pbTrainerBattle\((.+)\)\s*$/]
echoln ""
echoln $1
battle_params = split_string_with_quotes($1) # Split on commas battle_params = split_string_with_quotes($1) # Split on commas
echoln battle_params
trainer1 = "#{battle_params[0]}, #{battle_params[1]}" trainer1 = "#{battle_params[0]}, #{battle_params[1]}"
trainer1 += ", #{battle_params[4]}" if battle_params[4] && battle_params[4] != "nil" trainer1 += ", #{battle_params[4]}" if battle_params[4] && battle_params[4] != "nil"
list[index].parameters[1] = "TrainerBattle.start(#{trainer1})" list[index].parameters[1] = "TrainerBattle.start(#{trainer1})"
old_indent = list[index].indent old_indent = list[index].indent
new_events = [] new_events = []
if battle_params[2] && !battle_params[2].empty? && battle_params[2] != "nil" if battle_params[2] && !battle_params[2].empty? && battle_params[2] != "nil"
echoln battle_params[2]
speech = battle_params[2].gsub(/^\s*_I\(\s*"\s*/, "").gsub(/\"\s*\)\s*$/, "") speech = battle_params[2].gsub(/^\s*_I\(\s*"\s*/, "").gsub(/\"\s*\)\s*$/, "")
echoln speech
push_comment(new_events, "EndSpeech: #{speech.strip}", old_indent) push_comment(new_events, "EndSpeech: #{speech.strip}", old_indent)
end end
if battle_params[3] && battle_params[3][/true/] if battle_params[3] && battle_params[3][/true/]