mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Added effect of Blunder Policy
This commit is contained in:
@@ -602,6 +602,9 @@ class PokeBattle_Battler
|
||||
targets.each do |b|
|
||||
next if !b.damageState.missed || b.damageState.magicCoat
|
||||
pbMissMessage(move,user,b)
|
||||
if user.itemActive?
|
||||
BattleHandlers.triggerUserItemOnMissing(user.item, user, b, move, hitNum, @battle)
|
||||
end
|
||||
break if move.pbRepeatHit? # Dragon Darts only shows one failure message
|
||||
end
|
||||
move.pbCrashDamage(user)
|
||||
@@ -642,7 +645,13 @@ class PokeBattle_Battler
|
||||
end
|
||||
# Messages about missed target(s) (relevant for multi-target moves only)
|
||||
if !move.pbRepeatHit?
|
||||
targets.each { |b| pbMissMessage(move, user, b) if b.damageState.missed }
|
||||
targets.each do |b|
|
||||
next if !b.damageState.missed
|
||||
pbMissMessage(move, user, b)
|
||||
if user.itemActive?
|
||||
BattleHandlers.triggerUserItemOnMissing(user.item, user, b, move, hitNum, @battle)
|
||||
end
|
||||
end
|
||||
end
|
||||
# Deal the damage (to all allies first simultaneously, then all foes
|
||||
# simultaneously)
|
||||
|
||||
@@ -556,6 +556,7 @@ class PokeBattle_Battler
|
||||
miss = true if !move.hitsFlyingTargets?
|
||||
end
|
||||
end
|
||||
target.damageState.invulnerable = true if miss
|
||||
if !miss
|
||||
# Called by another move
|
||||
return true if skipAccuracyCheck
|
||||
|
||||
@@ -32,6 +32,7 @@ module BattleHandlers
|
||||
AbilityOnFlinch = AbilityHandlerHash.new # Steadfast
|
||||
MoveBlockingAbility = AbilityHandlerHash.new
|
||||
MoveImmunityTargetAbility = AbilityHandlerHash.new
|
||||
UserItemOnMissing = ItemHandlerHash.new # Blunder Policy
|
||||
# Move usage
|
||||
MoveBaseTypeModifierAbility = AbilityHandlerHash.new
|
||||
# Accuracy calculation
|
||||
@@ -234,6 +235,10 @@ module BattleHandlers
|
||||
return (ret!=nil) ? ret : false
|
||||
end
|
||||
|
||||
def self.triggerUserItemOnMissing(item, user, target, move, hit_num, battle)
|
||||
UserItemOnMissing.trigger(item, user, target, move, hit_num, battle)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
|
||||
def self.triggerMoveBaseTypeModifierAbility(ability,user,move,type)
|
||||
|
||||
@@ -422,6 +422,22 @@ BattleHandlers::PriorityBracketUseItem.add(:QUICKCLAW,
|
||||
}
|
||||
)
|
||||
|
||||
#===============================================================================
|
||||
# UserItemOnMissing handlers
|
||||
#===============================================================================
|
||||
|
||||
BattleHandlers::PriorityBracketUseItem.add(:BLUNDERPOLICY,
|
||||
proc { |item, user, target, move, hit_num, battle|
|
||||
next if hit_num > 0 || target.damageState.invulnerable
|
||||
next if ["OHKO", "OHKOIce", "OHKOHitsUndergroundTarget"].include?(move.function)
|
||||
next if !user.pbCanRaiseStatStage?(:SPEED, user)
|
||||
battle.pbCommonAnimation("UseItem", user)
|
||||
user.pbRaiseStatStageByCause(:SPEED, 2, user, user.itemName)
|
||||
battle.pbDisplay(_INTL("The {1} was used up...", user.itemName))
|
||||
user.pbHeldItemTriggered(item)
|
||||
}
|
||||
)
|
||||
|
||||
#===============================================================================
|
||||
# AccuracyCalcUserItem handlers
|
||||
#===============================================================================
|
||||
|
||||
@@ -9,6 +9,7 @@ class PokeBattle_DamageState
|
||||
attr_accessor :fainted # Whether battler was knocked out by the move
|
||||
|
||||
attr_accessor :missed # Whether the move failed the accuracy check
|
||||
attr_accessor :invulnerable # If the move missed due to two turn move invulnerability
|
||||
attr_accessor :calcDamage # Calculated damage
|
||||
attr_accessor :hpLost # HP lost by opponent, inc. HP lost by a substitute
|
||||
attr_accessor :critical # Critical hit flag
|
||||
@@ -29,6 +30,7 @@ class PokeBattle_DamageState
|
||||
@unaffected = false
|
||||
@protected = false
|
||||
@missed = false
|
||||
@invulnerable = false
|
||||
@magicCoat = false
|
||||
@magicBounce = false
|
||||
@totalHPLost = 0
|
||||
|
||||
@@ -388,11 +388,6 @@ When holder's stat(s) is lowered, consume item and holder switches out. Not
|
||||
triggered by Parting Shot, or if a faster mon's Eject Button/Eject Pack
|
||||
triggers.
|
||||
|
||||
Blunder Policy
|
||||
If holder's move fails its accuracy check, consume item and holder gets +2
|
||||
Speed. Doesn't trigger if move was an OHKO move, or Triple Kick that hit at
|
||||
least once.
|
||||
|
||||
Pokémon Box Link
|
||||
Key item, unusable. Enables pressing a button while in the party screen to open
|
||||
the "Organise Boxes" mode of Pokémon storage. This is disabled at certain times,
|
||||
|
||||
Reference in New Issue
Block a user