diff --git a/Data/Scripts/010_Data/002_PBS data/005_Move.rb b/Data/Scripts/010_Data/002_PBS data/005_Move.rb index a54d66ff2..a455b9825 100644 --- a/Data/Scripts/010_Data/002_PBS data/005_Move.rb +++ b/Data/Scripts/010_Data/002_PBS data/005_Move.rb @@ -442,7 +442,7 @@ module GameData when "131" then new_code = "StartShadowSkyWeather" when "132" then new_code = "RemoveAllScreens" when "133" then new_code = "DoesNothingFailsIfNoAlly" - when "134" then new_code = "DoesNothingCongratuations" + when "134" then new_code = "DoesNothingCongratulations" when "135" then new_code = "FreezeTargetSuperEffectiveAgainstWater" when "136" then new_code = "RaiseUserDefense2" when "137" then new_code = "RaisePlusMinusUserAndAlliesDefSpDef1" diff --git a/Data/Scripts/011_Battle/001_Battle/002_Battle.rb b/Data/Scripts/011_Battle/001_Battle/002_Battle.rb index dcf43d252..74555321e 100644 --- a/Data/Scripts/011_Battle/001_Battle/002_Battle.rb +++ b/Data/Scripts/011_Battle/001_Battle/002_Battle.rb @@ -683,7 +683,7 @@ class Battle end #============================================================================= - # Weather and terrain + # Weather #============================================================================= def defaultWeather=(value) @field.defaultWeather = value @@ -753,6 +753,23 @@ class Battle end end + def pbStartWeatherAbility(new_weather, battler, ignore_primal = false) + return if !ignore_primal && [:HarshSun, :HeavyRain, :StrongWinds].include?(@field.weather) + return if @field.weather == new_weather + battle.pbShowAbilitySplash(battler) + if !Scene::USE_ABILITY_SPLASH + pbDisplay(_INTL("{1}'s {2} activated!", battler.pbThis, battler.abilityName)) + end + fixed_duration = false + fixed_duration = true if Settings::FIXED_DURATION_WEATHER_FROM_ABILITY && + ![:HarshSun, :HeavyRain, :StrongWinds].include?(new_weather) + pbStartWeather(battler, new_weather, fixed_duration) + # NOTE: The ability splash is hidden again in def pbStartWeather. + end + + #============================================================================= + # Terrain + #============================================================================= def defaultTerrain=(value) @field.defaultTerrain = value @field.terrain = value diff --git a/Data/Scripts/011_Battle/002_Battler/006_Battler_AbilityAndItem.rb b/Data/Scripts/011_Battle/002_Battler/006_Battler_AbilityAndItem.rb index 0f6000aea..d0c06b027 100644 --- a/Data/Scripts/011_Battle/002_Battler/006_Battler_AbilityAndItem.rb +++ b/Data/Scripts/011_Battle/002_Battler/006_Battler_AbilityAndItem.rb @@ -1,6 +1,6 @@ class Battle::Battler #============================================================================= - # Ability effects + # Ability trigger checks #============================================================================= def pbAbilitiesOnSwitchOut if abilityActive? @@ -100,6 +100,69 @@ class Battle::Battler end end + #============================================================================= + # Ability effects + #============================================================================= + # For abilities that grant immunity to moves of a particular type, and raises + # one of the ability's bearer's stats instead. + def pbMoveImmunityStatRaisingAbility(user, move, moveType, immuneType, stat, increment, show_message) + return false if user.index == @index + return false if moveType != immuneType + # NOTE: If show_message is false (Dragon Darts only), the stat will not be + # raised. This is not how the official games work, but I'm considering + # that a bug because Dragon Darts won't be fired at self in the first + # place if it's immune, so why would this ability be triggered by them? + if show_message + @battle.pbShowAbilitySplash(self) + if pbCanRaiseStatStage?(stat, self) + if Battle::Scene::USE_ABILITY_SPLASH + pbRaiseStatStage(stat, increment, self) + else + pbRaiseStatStageByCause(stat, increment, self, abilityName) + end + else + if Battle::Scene::USE_ABILITY_SPLASH + @battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true))) + else + @battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!", + pbThis, abilityName, move.name)) + end + end + @battle.pbHideAbilitySplash(self) + end + return true + end + + # For abilities that grant immunity to moves of a particular type, and heals + # the ability's bearer by 1/4 of its total HP instead. + def pbMoveImmunityHealingAbility(user, move, moveType, immuneType, show_message) + return false if user.index == @index + return false if moveType != immuneType + # NOTE: If show_message is false (Dragon Darts only), HP will not be healed. + # This is not how the official games work, but I'm considering that a + # bug because Dragon Darts won't be fired at self in the first place + # if it's immune, so why would this ability be triggered by them? + if show_message + @battle.pbShowAbilitySplash(self) + if canHeal? && pbRecoverHP(@totalhp / 4) > 0 + if Battle::Scene::USE_ABILITY_SPLASH + @battle.pbDisplay(_INTL("{1}'s HP was restored.", pbThis)) + else + @battle.pbDisplay(_INTL("{1}'s {2} restored its HP.", pbThis, abilityName)) + end + else + if Battle::Scene::USE_ABILITY_SPLASH + @battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true))) + else + @battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!", + pbThis, abilityName, move.name)) + end + end + @battle.pbHideAbilitySplash(self) + end + return true + end + #============================================================================= # Ability change #============================================================================= @@ -325,4 +388,88 @@ class Battle::Battler b.pbHeldItemTriggerCheck if b.item && b.item.is_berry? end end + + #============================================================================= + # Item effects + #============================================================================= + def pbConfusionBerry(item_to_use, forced, flavor, confuse_msg) + return false if !forced && !canHeal? + return false if !forced && !canConsumePinchBerry?(Settings::MECHANICS_GENERATION >= 7) + used_item_name = GameData::Item.get(item_to_use).name + fraction_to_heal = 8 # Gens 6 and lower + if Settings::MECHANICS_GENERATION == 7 + fraction_to_heal = 2 + elsif Settings::MECHANICS_GENERATION >= 8 + fraction_to_heal = 3 + end + amt = @totalhp / fraction_to_heal + ripening = false + if hasActiveAbility?(:RIPEN) + @battle.pbShowAbilitySplash(self, forced) + amt *= 2 + ripening = true + end + @battle.pbCommonAnimation("EatBerry", self) if !forced + @battle.pbHideAbilitySplash(self) if ripening + amt = pbRecoverHP(amt) + if amt > 0 + if forced + PBDebug.log("[Item triggered] Forced consuming of #{used_item_name}") + @battle.pbDisplay(_INTL("{1}'s HP was restored.", pbThis)) + else + @battle.pbDisplay(_INTL("{1} restored its health using its {2}!", pbThis, used_item_name)) + end + end + flavor_stat = [:ATTACK, :DEFENSE, :SPEED, :SPECIAL_ATTACK, :SPECIAL_DEFENSE][flavor] + self.nature.stat_changes.each do |change| + next if change[1] > 0 || change[0] != flavor_stat + @battle.pbDisplay(confuse_msg) + pbConfuse if pbCanConfuseSelf?(false) + break + end + return true + end + + def pbStatIncreasingBerry(item_to_use, forced, stat, increment = 1) + return false if !forced && !canConsumePinchBerry? + return false if !pbCanRaiseStatStage?(stat, self) + used_item_name = GameData::Item.get(item_to_use).name + ripening = false + if hasActiveAbility?(:RIPEN) + @battle.pbShowAbilitySplash(self, forced) + increment *= 2 + ripening = true + end + @battle.pbCommonAnimation("EatBerry", self) if !forced + @battle.pbHideAbilitySplash(self) if ripening + return pbRaiseStatStageByCause(stat, increment, self, used_item_name) if !forced + PBDebug.log("[Item triggered] Forced consuming of #{used_item_name}") + return pbRaiseStatStage(stat, increment, self) + end + + def pbMoveTypeWeakeningBerry(berry_type, move_type, mults) + return if move_type != berry_type + return if !Effectiveness.super_effective?(@damageState.typeMod) && move_type != :NORMAL + mults[:final_damage_multiplier] /= 2 + @damageState.berryWeakened = true + ripening = false + if hasActiveAbility?(:RIPEN) + @battle.pbShowAbilitySplash(self) + mults[:final_damage_multiplier] /= 2 + ripening = true + end + @battle.pbCommonAnimation("EatBerry", self) + @battle.pbHideAbilitySplash(self) if ripening + end + + def pbMoveTypePoweringUpGem(gem_type, move, move_type, mults) + return if move.is_a?(Battle::Move::PledgeMove) # Pledge moves never consume Gems + return if move_type != gem_type + @effects[PBEffects::GemConsumed] = @item_id + if Settings::MECHANICS_GENERATION >= 6 + mults[:base_damage_multiplier] *= 1.3 + else + mults[:base_damage_multiplier] *= 1.5 + end + end end diff --git a/Data/Scripts/011_Battle/003_Move/004_Move_BaseEffects.rb b/Data/Scripts/011_Battle/003_Move/004_Move_BaseEffects.rb index fd1a15440..21d33f880 100644 --- a/Data/Scripts/011_Battle/003_Move/004_Move_BaseEffects.rb +++ b/Data/Scripts/011_Battle/003_Move/004_Move_BaseEffects.rb @@ -17,8 +17,6 @@ class Battle::Move::Unimplemented < Battle::Move end end - - #=============================================================================== # Pseudomove for confusion damage. #=============================================================================== @@ -48,10 +46,8 @@ class Battle::Move::Confusion < Battle::Move def pbCritialOverride(user,target); return -1; end end - - #=============================================================================== -# Implements the move Struggle. +# Struggle. #=============================================================================== class Battle::Move::Struggle < Battle::Move def initialize(battle,move) @@ -85,164 +81,8 @@ class Battle::Move::Struggle < Battle::Move end end - - #=============================================================================== -# Generic status problem-inflicting classes. -#=============================================================================== -class Battle::Move::SleepMove < Battle::Move - def canMagicCoat?; return true; end - - def pbFailsAgainstTarget?(user, target, show_message) - return false if damagingMove? - return !target.pbCanSleep?(user, show_message, self) - end - - def pbEffectAgainstTarget(user,target) - return if damagingMove? - target.pbSleep - end - - def pbAdditionalEffect(user,target) - return if target.damageState.substitute - target.pbSleep if target.pbCanSleep?(user,false,self) - end -end - - - -class Battle::Move::PoisonMove < Battle::Move - def canMagicCoat?; return true; end - - def initialize(battle,move) - super - @toxic = false - end - - def pbFailsAgainstTarget?(user, target, show_message) - return false if damagingMove? - return !target.pbCanPoison?(user, show_message, self) - end - - def pbEffectAgainstTarget(user,target) - return if damagingMove? - target.pbPoison(user,nil,@toxic) - end - - def pbAdditionalEffect(user,target) - return if target.damageState.substitute - target.pbPoison(user,nil,@toxic) if target.pbCanPoison?(user,false,self) - end -end - - - -class Battle::Move::ParalysisMove < Battle::Move - def canMagicCoat?; return true; end - - def pbFailsAgainstTarget?(user, target, show_message) - return false if damagingMove? - return !target.pbCanParalyze?(user, show_message, self) - end - - def pbEffectAgainstTarget(user,target) - return if damagingMove? - target.pbParalyze(user) - end - - def pbAdditionalEffect(user,target) - return if target.damageState.substitute - target.pbParalyze(user) if target.pbCanParalyze?(user,false,self) - end -end - - - -class Battle::Move::BurnMove < Battle::Move - def canMagicCoat?; return true; end - - def pbFailsAgainstTarget?(user, target, show_message) - return false if damagingMove? - return !target.pbCanBurn?(user, show_message, self) - end - - def pbEffectAgainstTarget(user,target) - return if damagingMove? - target.pbBurn(user) - end - - def pbAdditionalEffect(user,target) - return if target.damageState.substitute - target.pbBurn(user) if target.pbCanBurn?(user,false,self) - end -end - - - -class Battle::Move::FreezeMove < Battle::Move - def canMagicCoat?; return true; end - - def pbFailsAgainstTarget?(user, target, show_message) - return false if damagingMove? - return !target.pbCanFreeze?(user, show_message, self) - end - - def pbEffectAgainstTarget(user,target) - return if damagingMove? - target.pbFreeze - end - - def pbAdditionalEffect(user,target) - return if target.damageState.substitute - target.pbFreeze if target.pbCanFreeze?(user,false,self) - end -end - - - -#=============================================================================== -# Other problem-causing classes. -#=============================================================================== -class Battle::Move::FlinchMove < Battle::Move - def flinchingMove?; return true; end - - def pbEffectAgainstTarget(user,target) - return if damagingMove? - target.pbFlinch(user) - end - - def pbAdditionalEffect(user,target) - return if target.damageState.substitute - target.pbFlinch(user) - end -end - - - -class Battle::Move::ConfuseMove < Battle::Move - def canMagicCoat?; return true; end - - def pbFailsAgainstTarget?(user, target, show_message) - return false if damagingMove? - return !target.pbCanConfuse?(user, show_message, self) - end - - def pbEffectAgainstTarget(user,target) - return if damagingMove? - target.pbConfuse - end - - def pbAdditionalEffect(user,target) - return if target.damageState.substitute - return if !target.pbCanConfuse?(user,false,self) - target.pbConfuse - end -end - - - -#=============================================================================== -# Generic user's stat increase/decrease classes. +# Raise one of user's stats. #=============================================================================== class Battle::Move::StatUpMove < Battle::Move def canSnatch?; return true; end @@ -264,8 +104,9 @@ class Battle::Move::StatUpMove < Battle::Move end end - - +#=============================================================================== +# Raise multiple of user's stats. +#=============================================================================== class Battle::Move::MultiStatUpMove < Battle::Move def canSnatch?; return true; end @@ -306,8 +147,9 @@ class Battle::Move::MultiStatUpMove < Battle::Move end end - - +#=============================================================================== +# Lower multiple of user's stats. +#=============================================================================== class Battle::Move::StatDownMove < Battle::Move def pbEffectWhenDealingDamage(user,target) return if @battle.pbAllFainted?(target.idxOwnSide) @@ -321,10 +163,8 @@ class Battle::Move::StatDownMove < Battle::Move end end - - #=============================================================================== -# Generic target's stat increase/decrease classes. +# Lower one of target's stats. #=============================================================================== class Battle::Move::TargetStatDownMove < Battle::Move def canMagicCoat?; return true; end @@ -346,8 +186,9 @@ class Battle::Move::TargetStatDownMove < Battle::Move end end - - +#=============================================================================== +# Lower multiple of target's stats. +#=============================================================================== class Battle::Move::TargetMultiStatDownMove < Battle::Move def canMagicCoat?; return true; end @@ -432,8 +273,6 @@ class Battle::Move::TargetMultiStatDownMove < Battle::Move end end - - #=============================================================================== # Fixed damage-inflicting move. #=============================================================================== @@ -447,8 +286,6 @@ class Battle::Move::FixedDamageMove < Battle::Move end end - - #=============================================================================== # Two turn move. #=============================================================================== @@ -536,8 +373,6 @@ class Battle::Move::TwoTurnMove < Battle::Move end end - - #=============================================================================== # Healing move. #=============================================================================== @@ -561,8 +396,6 @@ class Battle::Move::HealingMove < Battle::Move end end - - #=============================================================================== # Recoil move. #=============================================================================== @@ -582,8 +415,6 @@ class Battle::Move::RecoilMove < Battle::Move end end - - #=============================================================================== # Protect move. #=============================================================================== @@ -644,8 +475,6 @@ class Battle::Move::ProtectMove < Battle::Move end end - - #=============================================================================== # Weather-inducing move. #=============================================================================== @@ -678,8 +507,6 @@ class Battle::Move::WeatherMove < Battle::Move end end - - #=============================================================================== # Pledge move. #=============================================================================== diff --git a/Data/Scripts/011_Battle/003_Move/005_MoveEffects_Misc.rb b/Data/Scripts/011_Battle/003_Move/005_MoveEffects_Misc.rb index 3834b0d48..a9a9c6a3d 100644 --- a/Data/Scripts/011_Battle/003_Move/005_MoveEffects_Misc.rb +++ b/Data/Scripts/011_Battle/003_Move/005_MoveEffects_Misc.rb @@ -7,7 +7,7 @@ end #=============================================================================== # Does absolutely nothing. Shows a special message. (Celebrate) #=============================================================================== -class Battle::Move::DoesNothingCongratuations < Battle::Move +class Battle::Move::DoesNothingCongratulations < Battle::Move def pbEffectGeneral(user) if user.wild? @battle.pbDisplay(_INTL("Congratulations from {1}!",user.pbThis(true))) diff --git a/Data/Scripts/011_Battle/003_Move/007_MoveEffects_BattlerOther.rb b/Data/Scripts/011_Battle/003_Move/007_MoveEffects_BattlerOther.rb index f09e802fd..7a8d85b73 100644 --- a/Data/Scripts/011_Battle/003_Move/007_MoveEffects_BattlerOther.rb +++ b/Data/Scripts/011_Battle/003_Move/007_MoveEffects_BattlerOther.rb @@ -1,13 +1,29 @@ #=============================================================================== # Puts the target to sleep. #=============================================================================== -class Battle::Move::SleepTarget < Battle::Move::SleepMove +class Battle::Move::SleepTarget < Battle::Move + def canMagicCoat?; return true; end + + def pbFailsAgainstTarget?(user, target, show_message) + return false if damagingMove? + return !target.pbCanSleep?(user, show_message, self) + end + + def pbEffectAgainstTarget(user,target) + return if damagingMove? + target.pbSleep + end + + def pbAdditionalEffect(user,target) + return if target.damageState.substitute + target.pbSleep if target.pbCanSleep?(user,false,self) + end end #=============================================================================== # Puts the target to sleep. Fails if user is not Darkrai. (Dark Void (Gen 7+)) #=============================================================================== -class Battle::Move::SleepTargetIfUserDarkrai < Battle::Move::SleepMove +class Battle::Move::SleepTargetIfUserDarkrai < Battle::Move::SleepTarget def pbMoveFailed?(user,targets) if !user.isSpecies?(:DARKRAI) && user.effects[PBEffects::TransformSpecies] != :DARKRAI @battle.pbDisplay(_INTL("But {1} can't use the move!",user.pbThis)) @@ -21,7 +37,7 @@ end # Puts the target to sleep. Changes the user's form if the user is Meloetta. # (Relic Song) #=============================================================================== -class Battle::Move::SleepTargetChangeUserMeloettaForm < Battle::Move::SleepMove +class Battle::Move::SleepTargetChangeUserMeloettaForm < Battle::Move::SleepTarget def pbEndOfMoveUsageEffect(user,targets,numHits,switchedBattlers) return if numHits==0 return if user.fainted? || user.effects[PBEffects::Transform] @@ -56,7 +72,28 @@ end #=============================================================================== # Poisons the target. #=============================================================================== -class Battle::Move::PoisonTarget < Battle::Move::PoisonMove +class Battle::Move::PoisonTarget < Battle::Move + def canMagicCoat?; return true; end + + def initialize(battle,move) + super + @toxic = false + end + + def pbFailsAgainstTarget?(user, target, show_message) + return false if damagingMove? + return !target.pbCanPoison?(user, show_message, self) + end + + def pbEffectAgainstTarget(user,target) + return if damagingMove? + target.pbPoison(user,nil,@toxic) + end + + def pbAdditionalEffect(user,target) + return if target.damageState.substitute + target.pbPoison(user,nil,@toxic) if target.pbCanPoison?(user,false,self) + end end #=============================================================================== @@ -85,7 +122,7 @@ end #=============================================================================== # Badly poisons the target. (Poison Fang, Toxic) #=============================================================================== -class Battle::Move::BadPoisonTarget < Battle::Move::PoisonMove +class Battle::Move::BadPoisonTarget < Battle::Move::PoisonTarget def initialize(battle,move) super @toxic = true @@ -99,14 +136,30 @@ end #=============================================================================== # Paralyzes the target. #=============================================================================== -class Battle::Move::ParalyzeTarget < Battle::Move::ParalysisMove +class Battle::Move::ParalyzeTarget < Battle::Move + def canMagicCoat?; return true; end + + def pbFailsAgainstTarget?(user, target, show_message) + return false if damagingMove? + return !target.pbCanParalyze?(user, show_message, self) + end + + def pbEffectAgainstTarget(user,target) + return if damagingMove? + target.pbParalyze(user) + end + + def pbAdditionalEffect(user,target) + return if target.damageState.substitute + target.pbParalyze(user) if target.pbCanParalyze?(user,false,self) + end end #=============================================================================== # Paralyzes the target. Doesn't affect target if move's type has no effect on # it. (Thunder Wave) #=============================================================================== -class Battle::Move::ParalyzeTargetIfNotTypeImmune < Battle::Move::ParalysisMove +class Battle::Move::ParalyzeTargetIfNotTypeImmune < Battle::Move::ParalyzeTarget def pbFailsAgainstTarget?(user, target, show_message) if Effectiveness.ineffective?(target.damageState.typeMod) @battle.pbDisplay(_INTL("It doesn't affect {1}...", target.pbThis(true))) if show_message @@ -120,7 +173,7 @@ end # Paralyzes the target. Does double damage and has perfect accuracy if target is # Minimized. (Body Slam (Gen 6+)) #=============================================================================== -class Battle::Move::ParalyzeTargetTrampleMinimize < Battle::Move::ParalysisMove +class Battle::Move::ParalyzeTargetTrampleMinimize < Battle::Move::ParalyzeTarget def tramplesMinimize?(param=1) return true if param==1 && Settings::MECHANICS_GENERATION >= 6 # Perfect accuracy return true if param==2 # Double damage @@ -132,7 +185,7 @@ end # Paralyzes the target. Accuracy perfect in rain, 50% in sunshine. Hits some # semi-invulnerable targets. (Thunder) #=============================================================================== -class Battle::Move::ParalyzeTargetAlwaysHitsInRainHitsTargetInSky < Battle::Move::ParalysisMove +class Battle::Move::ParalyzeTargetAlwaysHitsInRainHitsTargetInSky < Battle::Move::ParalyzeTarget def hitsFlyingTargets?; return true; end def pbBaseAccuracy(user,target) @@ -166,14 +219,30 @@ end #=============================================================================== # Burns the target. #=============================================================================== -class Battle::Move::BurnTarget < Battle::Move::BurnMove +class Battle::Move::BurnTarget < Battle::Move + def canMagicCoat?; return true; end + + def pbFailsAgainstTarget?(user, target, show_message) + return false if damagingMove? + return !target.pbCanBurn?(user, show_message, self) + end + + def pbEffectAgainstTarget(user,target) + return if damagingMove? + target.pbBurn(user) + end + + def pbAdditionalEffect(user,target) + return if target.damageState.substitute + target.pbBurn(user) if target.pbCanBurn?(user,false,self) + end end #=============================================================================== # Burns the target if any of its stats were increased this round. # (Burning Jealousy) #=============================================================================== -class Battle::Move::BurnTargetIfTargetStatsRaisedThisTurn < Battle::Move::BurnMove +class Battle::Move::BurnTargetIfTargetStatsRaisedThisTurn < Battle::Move::BurnTarget def pbAdditionalEffect(user, target) super if target.statsRaisedThisRound end @@ -199,13 +268,29 @@ end #=============================================================================== # Freezes the target. #=============================================================================== -class Battle::Move::FreezeTarget < Battle::Move::FreezeMove +class Battle::Move::FreezeTarget < Battle::Move + def canMagicCoat?; return true; end + + def pbFailsAgainstTarget?(user, target, show_message) + return false if damagingMove? + return !target.pbCanFreeze?(user, show_message, self) + end + + def pbEffectAgainstTarget(user,target) + return if damagingMove? + target.pbFreeze + end + + def pbAdditionalEffect(user,target) + return if target.damageState.substitute + target.pbFreeze if target.pbCanFreeze?(user,false,self) + end end #=============================================================================== # Freezes the target. Effectiveness against Water-type is 2x. (Freeze-Dry) #=============================================================================== -class Battle::Move::FreezeTargetSuperEffectiveAgainstWater < Battle::Move::FreezeMove +class Battle::Move::FreezeTargetSuperEffectiveAgainstWater < Battle::Move::FreezeTarget def pbCalcTypeModSingle(moveType,defType,user,target) return Effectiveness::SUPER_EFFECTIVE_ONE if defType == :WATER return super @@ -215,7 +300,7 @@ end #=============================================================================== # Freezes the target. Accuracy perfect in hail. (Blizzard) #=============================================================================== -class Battle::Move::FreezeTargetAlwaysHitsInHail < Battle::Move::FreezeMove +class Battle::Move::FreezeTargetAlwaysHitsInHail < Battle::Move::FreezeTarget def pbBaseAccuracy(user,target) return 0 if target.effectiveWeather == :Hail return super @@ -448,14 +533,25 @@ end #=============================================================================== # Causes the target to flinch. #=============================================================================== -class Battle::Move::FlinchTarget < Battle::Move::FlinchMove +class Battle::Move::FlinchTarget < Battle::Move + def flinchingMove?; return true; end + + def pbEffectAgainstTarget(user,target) + return if damagingMove? + target.pbFlinch(user) + end + + def pbAdditionalEffect(user,target) + return if target.damageState.substitute + target.pbFlinch(user) + end end #=============================================================================== # Causes the target to flinch. Does double damage and has perfect accuracy if # the target is Minimized. (Dragon Rush (Gen 6+), Steamroller, Stomp) #=============================================================================== -class Battle::Move::FlinchTargetTrampleMinimize < Battle::Move::FlinchMove +class Battle::Move::FlinchTargetTrampleMinimize < Battle::Move::FlinchTarget def tramplesMinimize?(param=1) return true if param==1 && Settings::MECHANICS_GENERATION >= 6 # Perfect accuracy return true if param==2 # Double damage @@ -466,7 +562,7 @@ end #=============================================================================== # Causes the target to flinch. Fails if the user is not asleep. (Snore) #=============================================================================== -class Battle::Move::FlinchTargetFailsIfUserNotAsleep < Battle::Move::FlinchMove +class Battle::Move::FlinchTargetFailsIfUserNotAsleep < Battle::Move::FlinchTarget def usableWhenAsleep?; return true; end def pbMoveFailed?(user,targets) @@ -482,7 +578,7 @@ end # Causes the target to flinch. Fails if this isn't the user's first turn. # (Fake Out) #=============================================================================== -class Battle::Move::FlinchTargetFailsIfNotUserFirstTurn < Battle::Move::FlinchMove +class Battle::Move::FlinchTargetFailsIfNotUserFirstTurn < Battle::Move::FlinchTarget def pbMoveFailed?(user,targets) if user.turnCount > 1 @battle.pbDisplay(_INTL("But it failed!")) @@ -496,7 +592,7 @@ end # Power is doubled if the target is using Bounce, Fly or Sky Drop. Hits some # semi-invulnerable targets. May make the target flinch. (Twister) #=============================================================================== -class Battle::Move::FlinchTargetDoublePowerIfTargetInSky < Battle::Move::FlinchMove +class Battle::Move::FlinchTargetDoublePowerIfTargetInSky < Battle::Move::FlinchTarget def hitsFlyingTargets?; return true; end def pbBaseDamage(baseDmg,user,target) @@ -511,14 +607,31 @@ end #=============================================================================== # Confuses the target. #=============================================================================== -class Battle::Move::ConfuseTarget < Battle::Move::ConfuseMove +class Battle::Move::ConfuseTarget < Battle::Move + def canMagicCoat?; return true; end + + def pbFailsAgainstTarget?(user, target, show_message) + return false if damagingMove? + return !target.pbCanConfuse?(user, show_message, self) + end + + def pbEffectAgainstTarget(user,target) + return if damagingMove? + target.pbConfuse + end + + def pbAdditionalEffect(user,target) + return if target.damageState.substitute + return if !target.pbCanConfuse?(user,false,self) + target.pbConfuse + end end #=============================================================================== # Confuses the target. Accuracy perfect in rain, 50% in sunshine. Hits some # semi-invulnerable targets. (Hurricane) #=============================================================================== -class Battle::Move::ConfuseTargetAlwaysHitsInRainHitsTargetInSky < Battle::Move::ConfuseMove +class Battle::Move::ConfuseTargetAlwaysHitsInRainHitsTargetInSky < Battle::Move::ConfuseTarget def hitsFlyingTargets?; return true; end def pbBaseAccuracy(user,target) diff --git a/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb b/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb index ce8b8fcbe..1e372eccc 100644 --- a/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb +++ b/Data/Scripts/011_Battle/003_Move/008_MoveEffects_MoveAttributes.rb @@ -1143,7 +1143,7 @@ end # if it is a physical move. Has a different animation depending on the move's # category. (Shell Side Arm) #=============================================================================== -class Battle::Move::CategoryDependsOnHigherDamagePoisonTarget < Battle::Move::PoisonMove +class Battle::Move::CategoryDependsOnHigherDamagePoisonTarget < Battle::Move::PoisonTarget def initialize(battle, move) super @calcCategory = 1 diff --git a/Data/Scripts/011_Battle/003_Move/009_MoveEffects_MultiHit.rb b/Data/Scripts/011_Battle/003_Move/009_MoveEffects_MultiHit.rb index f5c00053b..023d73414 100644 --- a/Data/Scripts/011_Battle/003_Move/009_MoveEffects_MultiHit.rb +++ b/Data/Scripts/011_Battle/003_Move/009_MoveEffects_MultiHit.rb @@ -9,7 +9,7 @@ end #=============================================================================== # Hits twice. May poison the target on each hit. (Twineedle) #=============================================================================== -class Battle::Move::HitTwoTimesPoisonTarget < Battle::Move::PoisonMove +class Battle::Move::HitTwoTimesPoisonTarget < Battle::Move::PoisonTarget def multiHitMove?; return true; end def pbNumHits(user,targets); return 2; end end @@ -18,7 +18,7 @@ end # Hits twice. Causes the target to flinch. Does double damage and has perfect # accuracy if the target is Minimized. (Double Iron Bash) #=============================================================================== -class Battle::Move::HitTwoTimesFlinchTarget < Battle::Move::FlinchMove +class Battle::Move::HitTwoTimesFlinchTarget < Battle::Move::FlinchTarget def multiHitMove?; return true; end def pbNumHits(user,targets); return 2; end def tramplesMinimize?(param=1); return Settings::MECHANICS_GENERATION <= 7; end diff --git a/Data/Scripts/011_Battle/003_Move/012_MoveEffects_ChangeMoveEffect.rb b/Data/Scripts/011_Battle/003_Move/012_MoveEffects_ChangeMoveEffect.rb index 7a496a4e8..a7e391f93 100644 --- a/Data/Scripts/011_Battle/003_Move/012_MoveEffects_ChangeMoveEffect.rb +++ b/Data/Scripts/011_Battle/003_Move/012_MoveEffects_ChangeMoveEffect.rb @@ -727,7 +727,7 @@ class Battle::Move::UseLastMoveUsed < Battle::Move "BurnAttackerBeforeUserActs", # Beak Blast # Event moves that do nothing "DoesNothingFailsIfNoAlly", # Hold Hands - "DoesNothingCongratuations" # Celebrate + "DoesNothingCongratulations" # Celebrate ] if Settings::MECHANICS_GENERATION >= 6 @moveBlacklist += [ @@ -951,7 +951,7 @@ class Battle::Move::UseRandomMove < Battle::Move "BurnAttackerBeforeUserActs", # Beak Blast # Event moves that do nothing "DoesNothingFailsIfNoAlly", # Hold Hands - "DoesNothingCongratuations" # Celebrate + "DoesNothingCongratulations" # Celebrate ] @moveBlacklistSignatures = [ :SNARL, @@ -1065,7 +1065,7 @@ class Battle::Move::UseRandomMoveFromUserParty < Battle::Move "BurnAttackerBeforeUserActs", # Beak Blast # Event moves that do nothing "DoesNothingFailsIfNoAlly", # Hold Hands - "DoesNothingCongratuations" # Celebrate + "DoesNothingCongratulations" # Celebrate ] if Settings::MECHANICS_GENERATION >= 6 @moveBlacklist += [ diff --git a/Data/Scripts/011_Battle/005_AI/005_AI_Move_EffectScores.rb b/Data/Scripts/011_Battle/005_AI/005_AI_Move_EffectScores.rb index 62574e933..d54fb9cd9 100644 --- a/Data/Scripts/011_Battle/005_AI/005_AI_Move_EffectScores.rb +++ b/Data/Scripts/011_Battle/005_AI/005_AI_Move_EffectScores.rb @@ -2500,7 +2500,7 @@ class Battle::AI score -= 110 end #--------------------------------------------------------------------------- - when "DoesNothingFailsIfNoAlly", "DoesNothingCongratuations" + when "DoesNothingFailsIfNoAlly", "DoesNothingCongratulations" score -= 95 score = 0 if skill>=PBTrainerAI.highSkill #--------------------------------------------------------------------------- diff --git a/Data/Scripts/011_Battle/006_Other battle code/007_BattleHandlers.rb b/Data/Scripts/011_Battle/006_Other battle code/007_BattleHandlers.rb index fe2fe489e..ca2ae9f7d 100644 --- a/Data/Scripts/011_Battle/006_Other battle code/007_BattleHandlers.rb +++ b/Data/Scripts/011_Battle/006_Other battle code/007_BattleHandlers.rb @@ -496,162 +496,3 @@ module BattleHandlers return (ret!=nil) ? ret : false end end - - - -def pbBattleConfusionBerry(battler,battle,item,forced,flavor,confuseMsg) - return false if !forced && !battler.canHeal? - return false if !forced && !battler.canConsumePinchBerry?(Settings::MECHANICS_GENERATION >= 7) - itemName = GameData::Item.get(item).name - fraction_to_heal = 8 # Gens 6 and lower - if Settings::MECHANICS_GENERATION == 7 - fraction_to_heal = 2 - elsif Settings::MECHANICS_GENERATION >= 8 - fraction_to_heal = 3 - end - amt = battler.totalhp / fraction_to_heal - ripening = false - if battler.hasActiveAbility?(:RIPEN) - battle.pbShowAbilitySplash(battler, forced) - amt *= 2 - ripening = true - end - battle.pbCommonAnimation("EatBerry", battler) if !forced - battle.pbHideAbilitySplash(battler) if ripening - amt = battler.pbRecoverHP(amt) - if amt>0 - if forced - PBDebug.log("[Item triggered] Forced consuming of #{itemName}") - battle.pbDisplay(_INTL("{1}'s HP was restored.",battler.pbThis)) - else - battle.pbDisplay(_INTL("{1} restored its health using its {2}!",battler.pbThis,itemName)) - end - end - flavor_stat = [:ATTACK, :DEFENSE, :SPEED, :SPECIAL_ATTACK, :SPECIAL_DEFENSE][flavor] - battler.nature.stat_changes.each do |change| - next if change[1] > 0 || change[0] != flavor_stat - battle.pbDisplay(confuseMsg) - battler.pbConfuse if battler.pbCanConfuseSelf?(false) - break - end - return true -end - -def pbBattleStatIncreasingBerry(battler,battle,item,forced,stat,increment=1) - return false if !forced && !battler.canConsumePinchBerry? - return false if !battler.pbCanRaiseStatStage?(stat,battler) - itemName = GameData::Item.get(item).name - ripening = false - if battler.hasActiveAbility?(:RIPEN) - battle.pbShowAbilitySplash(battler, forced) - increment *= 2 - ripening = true - end - battle.pbCommonAnimation("EatBerry", battler) if !forced - battle.pbHideAbilitySplash(battler) if ripening - return battler.pbRaiseStatStageByCause(stat, increment, battler, itemName) if !forced - PBDebug.log("[Item triggered] Forced consuming of #{itemName}") - return battler.pbRaiseStatStage(stat, increment, battler) -end - -# For abilities that grant immunity to moves of a particular type, and raises -# one of the ability's bearer's stats instead. -def pbBattleMoveImmunityStatAbility(user, target, move, moveType, immuneType, - stat, increment, battle, show_message) - return false if user.index==target.index - return false if moveType != immuneType - # NOTE: If show_message is false (Dragon Darts only), the stat will not be - # raised. This is not how the official games work, but I'm considering - # that a bug because Dragon Darts won't be fired at target in the first - # place if it's immune, so why would this ability be triggered by them? - if show_message - battle.pbShowAbilitySplash(target) - if target.pbCanRaiseStatStage?(stat, target) - if Battle::Scene::USE_ABILITY_SPLASH - target.pbRaiseStatStage(stat, increment, target) - else - target.pbRaiseStatStageByCause(stat, increment, target, target.abilityName) - end - else - if Battle::Scene::USE_ABILITY_SPLASH - battle.pbDisplay(_INTL("It doesn't affect {1}...", target.pbThis(true))) - else - battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!", - target.pbThis, target.abilityName, move.name)) - end - end - battle.pbHideAbilitySplash(target) - end - return true -end - -# For abilities that grant immunity to moves of a particular type, and heals the -# ability's bearer by 1/4 of its total HP instead. -def pbBattleMoveImmunityHealAbility(user, target, move, moveType, immuneType, battle, show_message) - return false if user.index==target.index - return false if moveType != immuneType - # NOTE: If show_message is false (Dragon Darts only), HP will not be healed. - # This is not how the official games work, but I'm considering that a - # bug because Dragon Darts won't be fired at target in the first place - # if it's immune, so why would this ability be triggered by them? - if show_message - battle.pbShowAbilitySplash(target) - if target.canHeal? && target.pbRecoverHP(target.totalhp / 4) > 0 - if Battle::Scene::USE_ABILITY_SPLASH - battle.pbDisplay(_INTL("{1}'s HP was restored.", target.pbThis)) - else - battle.pbDisplay(_INTL("{1}'s {2} restored its HP.", target.pbThis, target.abilityName)) - end - else - if Battle::Scene::USE_ABILITY_SPLASH - battle.pbDisplay(_INTL("It doesn't affect {1}...", target.pbThis(true))) - else - battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!", - target.pbThis, target.abilityName, move.name)) - end - end - battle.pbHideAbilitySplash(target) - end - return true -end - -def pbBattleGem(user,type,move,mults,moveType) - # Pledge moves never consume Gems - return if move.is_a?(Battle::Move::PledgeMove) - return if moveType != type - user.effects[PBEffects::GemConsumed] = user.item_id - if Settings::MECHANICS_GENERATION >= 6 - mults[:base_damage_multiplier] *= 1.3 - else - mults[:base_damage_multiplier] *= 1.5 - end -end - -def pbBattleTypeWeakingBerry(type,moveType,target,mults) - return if moveType != type - return if !Effectiveness.super_effective?(target.damageState.typeMod) && moveType != :NORMAL - mults[:final_damage_multiplier] /= 2 - target.damageState.berryWeakened = true - ripening = false - if target.hasActiveAbility?(:RIPEN) - target.battle.pbShowAbilitySplash(target) - mults[:final_damage_multiplier] /= 2 - ripening = true - end - target.battle.pbCommonAnimation("EatBerry",target) - target.battle.pbHideAbilitySplash(target) if ripening -end - -def pbBattleWeatherAbility(weather,battler,battle,ignorePrimal=false) - return if !ignorePrimal && [:HarshSun, :HeavyRain, :StrongWinds].include?(battle.field.weather) - return if battle.field.weather==weather - battle.pbShowAbilitySplash(battler) - if !Battle::Scene::USE_ABILITY_SPLASH - battle.pbDisplay(_INTL("{1}'s {2} activated!",battler.pbThis,battler.abilityName)) - end - fixedDuration = false - fixedDuration = true if Settings::FIXED_DURATION_WEATHER_FROM_ABILITY && - ![:HarshSun, :HeavyRain, :StrongWinds].include?(weather) - battle.pbStartWeather(battler,weather,fixedDuration) - # NOTE: The ability splash is hidden again in def pbStartWeather. -end diff --git a/Data/Scripts/011_Battle/006_Other battle code/008_BattleHandlers_Abilities.rb b/Data/Scripts/011_Battle/006_Other battle code/008_BattleHandlers_Abilities.rb index 39af304be..87ea2bf8e 100644 --- a/Data/Scripts/011_Battle/006_Other battle code/008_BattleHandlers_Abilities.rb +++ b/Data/Scripts/011_Battle/006_Other battle code/008_BattleHandlers_Abilities.rb @@ -647,19 +647,22 @@ BattleHandlers::MoveImmunityTargetAbility.add(:FLASHFIRE, BattleHandlers::MoveImmunityTargetAbility.add(:LIGHTNINGROD, proc { |ability, user, target, move, type, battle, show_message| - next pbBattleMoveImmunityStatAbility(user, target, move, type, :ELECTRIC, :SPECIAL_ATTACK, 1, battle, show_message) + next target.pbMoveImmunityStatRaisingAbility(user, move, type, + :ELECTRIC, :SPECIAL_ATTACK, 1, show_message) } ) BattleHandlers::MoveImmunityTargetAbility.add(:MOTORDRIVE, proc { |ability, user, target, move, type, battle, show_message| - next pbBattleMoveImmunityStatAbility(user, target, move, type, :ELECTRIC, :SPEED, 1, battle, show_message) + next target.pbMoveImmunityStatRaisingAbility(user, move, type, + :ELECTRIC, :SPEED, 1, show_message) } ) BattleHandlers::MoveImmunityTargetAbility.add(:SAPSIPPER, proc { |ability, user, target, move, type, battle, show_message| - next pbBattleMoveImmunityStatAbility(user, target, move, type, :GRASS, :ATTACK, 1, battle, show_message) + next target.pbMoveImmunityStatRaisingAbility(user, move, type, + :GRASS, :ATTACK, 1, show_message) } ) @@ -682,7 +685,8 @@ BattleHandlers::MoveImmunityTargetAbility.add(:SOUNDPROOF, BattleHandlers::MoveImmunityTargetAbility.add(:STORMDRAIN, proc { |ability, user, target, move, type, battle, show_message| - next pbBattleMoveImmunityStatAbility(user, target, move, type, :WATER, :SPECIAL_ATTACK, 1, battle, show_message) + next target.pbMoveImmunityStatRaisingAbility(user, move, type, + :WATER, :SPECIAL_ATTACK, 1, show_message) } ) @@ -706,13 +710,13 @@ BattleHandlers::MoveImmunityTargetAbility.add(:TELEPATHY, BattleHandlers::MoveImmunityTargetAbility.add(:VOLTABSORB, proc { |ability, user, target, move, type, battle, show_message| - next pbBattleMoveImmunityHealAbility(user, target, move, type, :ELECTRIC, battle, show_message) + next target.pbMoveImmunityHealingAbility(user, move, type, :ELECTRIC, show_message) } ) BattleHandlers::MoveImmunityTargetAbility.add(:WATERABSORB, proc { |ability, user, target, move, type, battle, show_message| - next pbBattleMoveImmunityHealAbility(user, target, move, type, :WATER, battle, show_message) + next target.pbMoveImmunityHealingAbility(user, move, type, :WATER, show_message) } ) @@ -1676,7 +1680,7 @@ BattleHandlers::TargetAbilityOnHit.add(:RATTLED, BattleHandlers::TargetAbilityOnHit.add(:SANDSPIT, proc { |ability, user, target, move, battle| - pbBattleWeatherAbility(:Sandstorm, battler, battle) + battle.pbStartWeatherAbility(:Sandstorm, battler) } ) @@ -2389,13 +2393,13 @@ BattleHandlers::AbilityOnSwitchIn.add(:DAUNTLESSSHIELD, BattleHandlers::AbilityOnSwitchIn.add(:DELTASTREAM, proc { |ability,battler,battle| - pbBattleWeatherAbility(:StrongWinds, battler, battle, true) + battle.pbStartWeatherAbility(:StrongWinds, battler, true) } ) BattleHandlers::AbilityOnSwitchIn.add(:DESOLATELAND, proc { |ability,battler,battle| - pbBattleWeatherAbility(:HarshSun, battler, battle, true) + battle.pbStartWeatherAbility(:HarshSun, battler, true) } ) @@ -2413,13 +2417,13 @@ BattleHandlers::AbilityOnSwitchIn.add(:DOWNLOAD, BattleHandlers::AbilityOnSwitchIn.add(:DRIZZLE, proc { |ability,battler,battle| - pbBattleWeatherAbility(:Rain, battler, battle) + battle.pbStartWeatherAbility(:Rain, battler) } ) BattleHandlers::AbilityOnSwitchIn.add(:DROUGHT, proc { |ability,battler,battle| - pbBattleWeatherAbility(:Sun, battler, battle) + battle.pbStartWeatherAbility(:Sun, battler) } ) @@ -2655,7 +2659,7 @@ BattleHandlers::AbilityOnSwitchIn.add(:PRESSURE, BattleHandlers::AbilityOnSwitchIn.add(:PRIMORDIALSEA, proc { |ability,battler,battle| - pbBattleWeatherAbility(:HeavyRain, battler, battle, true) + battle.pbStartWeatherAbility(:HeavyRain, battler, true) } ) @@ -2670,7 +2674,7 @@ BattleHandlers::AbilityOnSwitchIn.add(:PSYCHICSURGE, BattleHandlers::AbilityOnSwitchIn.add(:SANDSTREAM, proc { |ability,battler,battle| - pbBattleWeatherAbility(:Sandstorm, battler, battle) + battle.pbStartWeatherAbility(:Sandstorm, battler) } ) @@ -2727,7 +2731,7 @@ BattleHandlers::AbilityOnSwitchIn.add(:SLOWSTART, BattleHandlers::AbilityOnSwitchIn.add(:SNOWWARNING, proc { |ability,battler,battle| - pbBattleWeatherAbility(:Hail, battler, battle) + battle.pbStartWeatherAbility(:Hail, battler) } ) diff --git a/Data/Scripts/011_Battle/006_Other battle code/009_BattleHandlers_Items.rb b/Data/Scripts/011_Battle/006_Other battle code/009_BattleHandlers_Items.rb index 31c29f9d4..a3f62b510 100644 --- a/Data/Scripts/011_Battle/006_Other battle code/009_BattleHandlers_Items.rb +++ b/Data/Scripts/011_Battle/006_Other battle code/009_BattleHandlers_Items.rb @@ -47,14 +47,15 @@ BattleHandlers::WeightCalcItem.add(:FLOATSTONE, BattleHandlers::HPHealItem.add(:AGUAVBERRY, proc { |item,battler,battle,forced| - next pbBattleConfusionBerry(battler,battle,item,forced,4, - _INTL("For {1}, the {2} was too bitter!",battler.pbThis(true),GameData::Item.get(item).name)) + next battler.pbConfusionBerry(item, forced, 4, + _INTL("For {1}, the {2} was too bitter!", battler.pbThis(true), GameData::Item.get(item).name)) + ) } ) BattleHandlers::HPHealItem.add(:APICOTBERRY, proc { |item,battler,battle,forced| - next pbBattleStatIncreasingBerry(battler,battle,item,forced,:SPECIAL_DEFENSE) + next battler.pbStatIncreasingBerry(item, forced, :SPECIAL_DEFENSE) } ) @@ -77,21 +78,23 @@ BattleHandlers::HPHealItem.add(:BERRYJUICE, BattleHandlers::HPHealItem.add(:FIGYBERRY, proc { |item,battler,battle,forced| - next pbBattleConfusionBerry(battler,battle,item,forced,0, - _INTL("For {1}, the {2} was too spicy!",battler.pbThis(true),GameData::Item.get(item).name)) + next battler.pbConfusionBerry(item, forced, 0, + _INTL("For {1}, the {2} was too spicy!", battler.pbThis(true), GameData::Item.get(item).name) + ) } ) BattleHandlers::HPHealItem.add(:GANLONBERRY, proc { |item,battler,battle,forced| - next pbBattleStatIncreasingBerry(battler,battle,item,forced,:DEFENSE) + next battler.pbStatIncreasingBerry(item, forced, :DEFENSE) } ) BattleHandlers::HPHealItem.add(:IAPAPABERRY, proc { |item,battler,battle,forced| - next pbBattleConfusionBerry(battler,battle,item,forced,1, - _INTL("For {1}, the {2} was too sour!",battler.pbThis(true),GameData::Item.get(item).name)) + next battler.pbConfusionBerry(item, forced, 1, + _INTL("For {1}, the {2} was too sour!", battler.pbThis(true), GameData::Item.get(item).name) + ) } ) @@ -113,14 +116,15 @@ BattleHandlers::HPHealItem.add(:LANSATBERRY, BattleHandlers::HPHealItem.add(:LIECHIBERRY, proc { |item,battler,battle,forced| - next pbBattleStatIncreasingBerry(battler,battle,item,forced,:ATTACK) + next battler.pbStatIncreasingBerry(item, forced, :ATTACK) } ) BattleHandlers::HPHealItem.add(:MAGOBERRY, proc { |item,battler,battle,forced| - next pbBattleConfusionBerry(battler,battle,item,forced,2, - _INTL("For {1}, the {2} was too sweet!",battler.pbThis(true),GameData::Item.get(item).name)) + next battler.pbConfusionBerry(item, forced, 2, + _INTL("For {1}, the {2} was too sweet!", battler.pbThis(true), GameData::Item.get(item).name) + ) } ) @@ -169,13 +173,13 @@ BattleHandlers::HPHealItem.add(:ORANBERRY, BattleHandlers::HPHealItem.add(:PETAYABERRY, proc { |item,battler,battle,forced| - next pbBattleStatIncreasingBerry(battler,battle,item,forced,:SPECIAL_ATTACK) + next battler.pbStatIncreasingBerry(item, forced, :SPECIAL_ATTACK) } ) BattleHandlers::HPHealItem.add(:SALACBERRY, proc { |item,battler,battle,forced| - next pbBattleStatIncreasingBerry(battler,battle,item,forced,:SPEED) + next battler.pbStatIncreasingBerry(item, forced, :SPEED) } ) @@ -210,14 +214,15 @@ BattleHandlers::HPHealItem.add(:STARFBERRY, GameData::Stat.each_main_battle { |s| stats.push(s.id) if battler.pbCanRaiseStatStage?(s.id, battler) } next false if stats.length==0 stat = stats[battle.pbRandom(stats.length)] - next pbBattleStatIncreasingBerry(battler,battle,item,forced,stat,2) + next battler.pbStatIncreasingBerry(item, forced, stat, 2) } ) BattleHandlers::HPHealItem.add(:WIKIBERRY, proc { |item,battler,battle,forced| - next pbBattleConfusionBerry(battler,battle,item,forced,3, - _INTL("For {1}, the {2} was too dry!",battler.pbThis(true),GameData::Item.get(item).name)) + next battler.pbConfusionBerry(item, forced, 3, + _INTL("For {1}, the {2} was too dry!", battler.pbThis(true), GameData::Item.get(item).name) + ) } ) @@ -529,7 +534,7 @@ BattleHandlers::DamageCalcUserItem.copy(:BLACKGLASSES,:DREADPLATE) BattleHandlers::DamageCalcUserItem.add(:BUGGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:BUG,move,mults,type) + user.pbMoveTypePoweringUpGem(:BUG, move, type, mults) } ) @@ -555,7 +560,7 @@ BattleHandlers::DamageCalcUserItem.add(:CHOICESPECS, BattleHandlers::DamageCalcUserItem.add(:DARKGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:DARK,move,mults,type) + user.pbMoveTypePoweringUpGem(:DARK, move, type, mults) } ) @@ -577,13 +582,13 @@ BattleHandlers::DamageCalcUserItem.copy(:DRAGONFANG,:DRACOPLATE) BattleHandlers::DamageCalcUserItem.add(:DRAGONGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:DRAGON,move,mults,type) + user.pbMoveTypePoweringUpGem(:DRAGON, move, type, mults) } ) BattleHandlers::DamageCalcUserItem.add(:ELECTRICGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:ELECTRIC,move,mults,type) + user.pbMoveTypePoweringUpGem(:ELECTRIC, move, type, mults) } ) @@ -597,37 +602,37 @@ BattleHandlers::DamageCalcUserItem.add(:EXPERTBELT, BattleHandlers::DamageCalcUserItem.add(:FAIRYGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:FAIRY,move,mults,type) + user.pbMoveTypePoweringUpGem(:FAIRY, move, type, mults) } ) BattleHandlers::DamageCalcUserItem.add(:FIGHTINGGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:FIGHTING,move,mults,type) + user.pbMoveTypePoweringUpGem(:FIGHTING, move, type, mults) } ) BattleHandlers::DamageCalcUserItem.add(:FIREGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:FIRE,move,mults,type) + user.pbMoveTypePoweringUpGem(:FIRE, move, type, mults) } ) BattleHandlers::DamageCalcUserItem.add(:FLYINGGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:FLYING,move,mults,type) + user.pbMoveTypePoweringUpGem(:FLYING, move, type, mults) } ) BattleHandlers::DamageCalcUserItem.add(:GHOSTGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:GHOST,move,mults,type) + user.pbMoveTypePoweringUpGem(:GHOST, move, type, mults) } ) BattleHandlers::DamageCalcUserItem.add(:GRASSGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:GRASS,move,mults,type) + user.pbMoveTypePoweringUpGem(:GRASS, move, type, mults) } ) @@ -641,7 +646,7 @@ BattleHandlers::DamageCalcUserItem.add(:GRISEOUSORB, BattleHandlers::DamageCalcUserItem.add(:GROUNDGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:GROUND,move,mults,type) + user.pbMoveTypePoweringUpGem(:GROUND, move, type, mults) } ) @@ -655,7 +660,7 @@ BattleHandlers::DamageCalcUserItem.copy(:HARDSTONE,:STONEPLATE,:ROCKINCENSE) BattleHandlers::DamageCalcUserItem.add(:ICEGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:ICE,move,mults,type) + user.pbMoveTypePoweringUpGem(:ICE, move, type, mults) } ) @@ -738,7 +743,7 @@ BattleHandlers::DamageCalcUserItem.copy(:NEVERMELTICE,:ICICLEPLATE) BattleHandlers::DamageCalcUserItem.add(:NORMALGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:NORMAL,move,mults,type) + user.pbMoveTypePoweringUpGem(:NORMAL, move, type, mults) } ) @@ -758,19 +763,19 @@ BattleHandlers::DamageCalcUserItem.copy(:POISONBARB,:TOXICPLATE) BattleHandlers::DamageCalcUserItem.add(:POISONGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:POISON,move,mults,type) + user.pbMoveTypePoweringUpGem(:POISON, move, type, mults) } ) BattleHandlers::DamageCalcUserItem.add(:PSYCHICGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:PSYCHIC,move,mults,type) + user.pbMoveTypePoweringUpGem(:PSYCHIC, move, type, mults) } ) BattleHandlers::DamageCalcUserItem.add(:ROCKGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:ROCK,move,mults,type) + user.pbMoveTypePoweringUpGem(:ROCK, move, type, mults) } ) @@ -827,7 +832,7 @@ BattleHandlers::DamageCalcUserItem.copy(:SPELLTAG,:SPOOKYPLATE) BattleHandlers::DamageCalcUserItem.add(:STEELGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:STEEL,move,mults,type) + user.pbMoveTypePoweringUpGem(:STEEL, move, type, mults) } ) @@ -849,7 +854,7 @@ BattleHandlers::DamageCalcUserItem.copy(:TWISTEDSPOON,:MINDPLATE,:ODDINCENSE) BattleHandlers::DamageCalcUserItem.add(:WATERGEM, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleGem(user,:WATER,move,mults,type) + user.pbMoveTypePoweringUpGem(:WATER, move, type, mults) } ) @@ -874,37 +879,37 @@ BattleHandlers::DamageCalcTargetItem.add(:ASSAULTVEST, BattleHandlers::DamageCalcTargetItem.add(:BABIRIBERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:STEEL,type,target,mults) + target.pbMoveTypeWeakeningBerry(:STEEL, type, mults) } ) BattleHandlers::DamageCalcTargetItem.add(:CHARTIBERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:ROCK,type,target,mults) + target.pbMoveTypeWeakeningBerry(:ROCK, type, mults) } ) BattleHandlers::DamageCalcTargetItem.add(:CHILANBERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:NORMAL,type,target,mults) + target.pbMoveTypeWeakeningBerry(:NORMAL, type, mults) } ) BattleHandlers::DamageCalcTargetItem.add(:CHOPLEBERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:FIGHTING,type,target,mults) + target.pbMoveTypeWeakeningBerry(:FIGHTING, type, mults) } ) BattleHandlers::DamageCalcTargetItem.add(:COBABERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:FLYING,type,target,mults) + target.pbMoveTypeWeakeningBerry(:FLYING, type, mults) } ) BattleHandlers::DamageCalcTargetItem.add(:COLBURBERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:DARK,type,target,mults) + target.pbMoveTypeWeakeningBerry(:DARK, type, mults) } ) @@ -930,19 +935,19 @@ BattleHandlers::DamageCalcTargetItem.add(:EVIOLITE, BattleHandlers::DamageCalcTargetItem.add(:HABANBERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:DRAGON,type,target,mults) + target.pbMoveTypeWeakeningBerry(:DRAGON, type, mults) } ) BattleHandlers::DamageCalcTargetItem.add(:KASIBBERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:GHOST,type,target,mults) + target.pbMoveTypeWeakeningBerry(:GHOST, type, mults) } ) BattleHandlers::DamageCalcTargetItem.add(:KEBIABERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:POISON,type,target,mults) + target.pbMoveTypeWeakeningBerry(:POISON, type, mults) } ) @@ -956,37 +961,37 @@ BattleHandlers::DamageCalcTargetItem.add(:METALPOWDER, BattleHandlers::DamageCalcTargetItem.add(:OCCABERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:FIRE,type,target,mults) + target.pbMoveTypeWeakeningBerry(:FIRE, type, mults) } ) BattleHandlers::DamageCalcTargetItem.add(:PASSHOBERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:WATER,type,target,mults) + target.pbMoveTypeWeakeningBerry(:WATER, type, mults) } ) BattleHandlers::DamageCalcTargetItem.add(:PAYAPABERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:PSYCHIC,type,target,mults) + target.pbMoveTypeWeakeningBerry(:PSYCHIC, type, mults) } ) BattleHandlers::DamageCalcTargetItem.add(:RINDOBERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:GRASS,type,target,mults) + target.pbMoveTypeWeakeningBerry(:GRASS, type, mults) } ) BattleHandlers::DamageCalcTargetItem.add(:ROSELIBERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:FAIRY,type,target,mults) + target.pbMoveTypeWeakeningBerry(:FAIRY, type, mults) } ) BattleHandlers::DamageCalcTargetItem.add(:SHUCABERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:GROUND,type,target,mults) + target.pbMoveTypeWeakeningBerry(:GROUND, type, mults) } ) @@ -1002,19 +1007,19 @@ BattleHandlers::DamageCalcTargetItem.add(:SOULDEW, BattleHandlers::DamageCalcTargetItem.add(:TANGABERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:BUG,type,target,mults) + target.pbMoveTypeWeakeningBerry(:BUG, type, mults) } ) BattleHandlers::DamageCalcTargetItem.add(:WACANBERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:ELECTRIC,type,target,mults) + target.pbMoveTypeWeakeningBerry(:ELECTRIC, type, mults) } ) BattleHandlers::DamageCalcTargetItem.add(:YACHEBERRY, proc { |item,user,target,move,mults,baseDmg,type| - pbBattleTypeWeakingBerry(:ICE,type,target,mults) + target.pbMoveTypeWeakeningBerry(:ICE, type, mults) } ) diff --git a/PBS/Gen 7/moves.txt b/PBS/Gen 7/moves.txt index 51c1545cd..62679c386 100644 --- a/PBS/Gen 7/moves.txt +++ b/PBS/Gen 7/moves.txt @@ -5250,7 +5250,7 @@ Category = Status Accuracy = 0 TotalPP = 40 Target = User -FunctionCode = DoesNothingCongratuations +FunctionCode = DoesNothingCongratulations Description = The Pokémon congratulates you on your special day! #------------------------------- [CONFIDE] diff --git a/PBS/Gen 8/moves.txt b/PBS/Gen 8/moves.txt index 87f872b2d..916d771f7 100644 --- a/PBS/Gen 8/moves.txt +++ b/PBS/Gen 8/moves.txt @@ -5793,7 +5793,7 @@ Category = Status Accuracy = 0 TotalPP = 40 Target = User -FunctionCode = DoesNothingCongratuations +FunctionCode = DoesNothingCongratulations Description = The Pokémon congratulates you on your special day! #------------------------------- [CONFIDE] diff --git a/PBS/moves.txt b/PBS/moves.txt index 87f872b2d..916d771f7 100644 --- a/PBS/moves.txt +++ b/PBS/moves.txt @@ -5793,7 +5793,7 @@ Category = Status Accuracy = 0 TotalPP = 40 Target = User -FunctionCode = DoesNothingCongratuations +FunctionCode = DoesNothingCongratulations Description = The Pokémon congratulates you on your special day! #------------------------------- [CONFIDE]