mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-01-27 08:46:00 +00:00
Double abilities
This commit is contained in:
@@ -22,6 +22,7 @@ class PokeBattle_Battler
|
||||
@hp = @totalhp = 0
|
||||
@type1 = @type2 = nil
|
||||
@ability_id = nil
|
||||
@ability2_id = nil
|
||||
@item_id = nil
|
||||
@gender = 0
|
||||
@attack = @defense = @spatk = @spdef = @speed = 0
|
||||
@@ -81,6 +82,7 @@ class PokeBattle_Battler
|
||||
@type1 = pkmn.type1
|
||||
@type2 = pkmn.type2
|
||||
@ability_id = pkmn.ability_id
|
||||
@ability2_id = pkmn.ability2_id
|
||||
@item_id = pkmn.item_id
|
||||
@gender = pkmn.gender
|
||||
@attack = pkmn.attack
|
||||
|
||||
@@ -283,6 +283,7 @@ class PokeBattle_Battler
|
||||
@effects[PBEffects::TransformSpecies] = target.species
|
||||
pbChangeTypes(target)
|
||||
self.ability = target.ability
|
||||
self.ability2 = target.ability2 if target.ability2
|
||||
@attack = target.attack
|
||||
@defense = target.defense
|
||||
@spatk = target.spatk
|
||||
|
||||
@@ -2,19 +2,25 @@ class PokeBattle_Battler
|
||||
#=============================================================================
|
||||
# Effect per hit
|
||||
#=============================================================================
|
||||
#
|
||||
|
||||
def triggerAbilityEffectsOnHit(move,user,target)
|
||||
# Target's ability
|
||||
if target.abilityActive?(true)
|
||||
oldHP = user.hp
|
||||
BattleHandlers.triggerTargetAbilityOnHit(target.ability,user,target,move,@battle)
|
||||
user.pbItemHPHealCheck if user.hp<oldHP
|
||||
end
|
||||
# User's ability
|
||||
if user.abilityActive?(true)
|
||||
BattleHandlers.triggerUserAbilityOnHit(user.ability,user,target,move,@battle)
|
||||
user.pbItemHPHealCheck
|
||||
end
|
||||
end
|
||||
|
||||
def pbEffectsOnMakingHit(move,user,target)
|
||||
if target.damageState.calcDamage>0 && !target.damageState.substitute
|
||||
# Target's ability
|
||||
if target.abilityActive?(true)
|
||||
oldHP = user.hp
|
||||
BattleHandlers.triggerTargetAbilityOnHit(target.ability,user,target,move,@battle)
|
||||
user.pbItemHPHealCheck if user.hp<oldHP
|
||||
end
|
||||
# User's ability
|
||||
if user.abilityActive?(true)
|
||||
BattleHandlers.triggerUserAbilityOnHit(user.ability,user,target,move,@battle)
|
||||
user.pbItemHPHealCheck
|
||||
end
|
||||
triggerAbilityEffectsOnHit(move,user,target)
|
||||
# Target's item
|
||||
if target.itemActive?(true)
|
||||
oldHP = user.hp
|
||||
@@ -92,6 +98,7 @@ class PokeBattle_Battler
|
||||
# User's ability
|
||||
if user.abilityActive?
|
||||
BattleHandlers.triggerUserAbilityEndOfMove(user.ability,user,targets,move,@battle)
|
||||
BattleHandlers.triggerUserAbilityEndOfMove(user.ability2,user,targets,move,@battle) if user.ability2
|
||||
end
|
||||
# Greninja - Battle Bond
|
||||
if !user.fainted? && !user.effects[PBEffects::Transform] &&
|
||||
@@ -161,6 +168,7 @@ class PokeBattle_Battler
|
||||
next if b.damageState.unaffected || switchedBattlers.include?(b.index)
|
||||
next if !b.abilityActive?
|
||||
BattleHandlers.triggerTargetAbilityAfterMoveUse(b.ability,b,user,move,switchedBattlers,@battle)
|
||||
BattleHandlers.triggerTargetAbilityAfterMoveUse(b.ability2,b,user,move,switchedBattlers,@battle) if b.ability2
|
||||
if !switchedBattlers.include?(b.index) && move.damagingMove?
|
||||
if b.pbAbilitiesOnDamageTaken(b.damageState.initialHP) # Emergency Exit, Wimp Out
|
||||
switchWimpOut.push(b.index)
|
||||
|
||||
Reference in New Issue
Block a user