Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Battle::ItemEffects::OnBeingHit.add(:OIL,
- proc { |item, user, target, move, battle|
- next if move.calcType != :FIRE
- next if !target.pbCanRaiseStatStage?(:SPEED, target)
- battle.pbCommonAnimation("UseItem", target)
- target.pbRaiseStatStageByCause(:SPEED, 1, target, target.itemName)
- target.pbHeldItemTriggered(item)
- }
- )
- Battle::ItemEffects::OnBeingHit.add(:ESPSHARE,
- proc { |item, user, target, move, battle|
- next if move.calcType != :PSYCHIC
- next if !target.pbCanRaiseStatStage?(:SPECIAL_ATTACK, target)
- battle.pbCommonAnimation("UseItem", target)
- target.pbRaiseStatStageByCause(:SPECIAL_ATTACK, 1, target, target.itemName)
- target.pbHeldItemTriggered(item)
- }
- )
- #Beam Mirror - Reduces 3/4 damage from beam attacks, sends 1/4 damage back, consumes item
- #Glue Trap - on contact, holder and foe can't escape. (presumably on holder being contacted by move, and not holder attacking)
- #Wanna figure out an animation here
- #Should it be consumed?
- Battle::ItemEffects::OnBeingHit.add(:GLUETRAP,
- proc { |item, user, target, move, battle|
- next if !move.pbContactMove?(user) || !user.affectedByContactEffect?
- # battle.pbCommonAnimation("UseItem", target)
- target.effects[PBEffects::MeanLook] = user.index
- user.effects[PBEffects::MeanLook] = target.index
- battle.pbDisplay(_INTL("{1} and {2} were stuck together by the {3}!", user.pbThis, target.pbThis, target.itemName))
- }
- )
- #Reset Button - on attack, ability reactivated. (on send out, like intimidate, on hit, like gooey, or end of turn, like speed boost). consumed
- #Not sure of triggerEndOfRoundHealing/triggerEndOfRoundWeather
- #Maybe double-check how Symbiosis plays with this
- Battle::ItemEffects::AfterMoveUseFromTarget.add(:RESETBUTTON,
- proc { |item, battler, user, move, switched_battlers, battle|
- battle.pbCommonAnimation("UseItem", battler)
- battle.pbDisplay(_INTL("{1}'s {2} activated!", battler.pbThis, battler.itemName))
- battler.pbConsumeItem(true, false)
- Battle::AbilityEffects.triggerOnSwitchIn(battler.ability, battler, battle, false)
- Battle::AbilityEffects.triggerOnBeingHit(battler.ability, user, battler, move, battle)
- Battle::AbilityEffects.triggerEndOfRoundEffect(battler.ability, battler, battle)
- }
- )
- #Magic Balloon - Gives Psychic or Fairy type until holder is attacked, where it'll pop
- #Water Balloon - Gives Water type when pops
- #Not sure why Symbiosis works like this but that's how Air Balloon is set up
- #May revisit fling
- Battle::ItemEffects::OnBeingHit.add(:WATERBALLOON,
- proc { |item, user, target, move, battle|
- battle.pbDisplay(_INTL("{1}'s {2} burst! It's soaking wet!", target.pbThis, target.itemName))
- target.pbChangeTypes(:WATER)
- target.pbConsumeItem(false, true)
- target.pbSymbiosis
- }
- )
- #Dirty Balloon - POison
- #Fertilizer - Grass
- #Sand Bag - Ground
- #Party Hat - any move that would be cured by mental herb becomes random stat boost instead
- #Dunce Cap - Any status ailment (not clear if nonvolatile or not) becomes confusion
- #Rebreather - prevents secondary poison
- #Rubber Stamp - prevents secondary paralyze
- #Chill Patch - prevents secondary burn
- #Thaw Patch - prevents secondary freeze
- #Buzz Band - prevents secondary sleep
- #Starry Band - prevents confusion
- #Chastity Knot - prevents attraction
- #Hall Pass - prevents entrapment and pursuit
- #Harness - prevents "phasing"?
- #Chain Mail - immune to crits
- Battle::ItemEffects::CriticalCalcFromTarget.add(:CHAINMAIL,
- proc { |item, user, target, c|
- next -1
- }
- )
- #Talisman - prevents Destiny Bond, Perish Song, Curse
- #Siege Vest - halves damage from weakness (like Filter/Solid Rock), prevents switching and/or healing
- #Substitube likened this to Solid Rock/Filter, but said it would reduce by half? (Those abilities only reduce by 1/4)
- #If you want half, just change 0.75 to 0.5
- Battle::ItemEffects::DamageCalcFromTarget.add(:SIEGEVEST,
- proc { |item, user, target, move, mults, baseDmg, type|
- if Effectiveness.super_effective?(target.damageState.typeMod)
- mults[:final_damage_multiplier] *= 0.75
- end
- }
- )
- #To prevent healing:
- #Battle_Battler, this section:
- def canHeal?
- return false if fainted? || @hp >= @totalhp
- return false if @effects[PBEffects::HealBlock] > 0
- return true
- end
- #add condition to check for Siege Vest, like so:
- def canHeal?
- return false if fainted? || @hp >= @totalhp
- return false if @effects[PBEffects::HealBlock] > 0
- return false if hasActiveItem?(:SIEGEVEST)
- return true
- end
- #Tactical Vest - Min/max variance is always maxed
- #in Move_UsageCalculations
- # Random variance
- if !self.is_a?(Battle::Move::Confusion)
- random = 85 + @battle.pbRandom(16)
- multipliers[:final_damage_multiplier] *= random / 100.0
- end
- # Random variance
- if !self.is_a?(Battle::Move::Confusion)
- random = 85 + @battle.pbRandom(16)
- random = 100 if user.hasActiveItem?(:TACTICALVEST) || target.hasActiveItem?(:TACTICALVEST)
- multipliers[:final_damage_multiplier] *= random / 100.0
- end
- #Ammo Belt - extra hit on multistrike moves
- #I think the best way would be to go to Battler_UseMove, and under these lines:
- # Get the number of hits
- numHits = move.pbNumHits(user, targets)
- #add
- numHits += 1 if numHits>1 && user.hasActiveItem?(:AMMOBELT)
- #Blast Powder - boosts explosion and selfdestruct damage (doubled)
- Battle::ItemEffects::DamageCalcFromUser.add(:BLASTPOWDER,
- proc { |item, user, target, move, mults, baseDmg, type|
- next if !move.function == "UserFaintsExplosive"
- battle.pbDisplay(_INTL("The {1} strengthened the attack!", user.itemName))
- mults[:base_damage_multiplier] *= 2
- }
- )
- #Padded Helmet - item form of Rock Head
- #In Move_BaseEffects, find this line:
- return if user.hasActiveAbility?(:ROCKHEAD)
- #Change it to:
- return if user.hasActiveAbility?(:ROCKHEAD) || user.hasActiveItem?(:PADDEDHELMET)
- #Metal Grin - boosts biting moves
- Battle::ItemEffects::DamageCalcFromUser.add(:METALGRIN,
- proc { |item, user, target, move, mults, baseDmg, type|
- mults[:base_damage_multiplier] *= 1.5 if move.bitingMove?
- }
- )
- #Hidden Glyph - boosts Hidden Power (specific amt not mentioned)
- Battle::ItemEffects::DamageCalcFromUser.add(:HIDDENGLYPH,
- proc { |item, user, target, move, mults, baseDmg, type|
- next if !move.id == :HIDDENPOWER
- battle.pbDisplay(_INTL("The {1} strengthened the attack!", user.itemName))
- mults[:base_damage_multiplier] *= 2
- }
- )
- #Burden Glyph - boosts HM moves except for Surf and Waterfall, doubles stat effects of Flash/Defog
- #Still need double stat effects
- Battle::ItemEffects::DamageCalcFromUser.add(:BURDENGLYPH,
- proc { |item, user, target, move, mults, baseDmg, type|
- #battle.pbDisplay(_INTL("The {1} strengthened the attack!", user.itemName))
- mults[:base_damage_multiplier] *= 2 if HiddenMoveHandlers.hasHandler(move.id)
- }
- )
- #Jingle Bells - Deer Pokemon (should be flag added to swords of justice, Deerling line, Stantler line, Xerneas, Calyrex, Ting-Lu) levitate in Hail and aren't affected by Hail damage
- #Battle_Battler:
- def airborne?
- return false if hasActiveItem?(:IRONBALL)
- return false if @effects[PBEffects::Ingrain]
- return false if @effects[PBEffects::SmackDown]
- return false if @battle.field.effects[PBEffects::Gravity] > 0
- return true if pbHasType?(:FLYING)
- return true if hasActiveAbility?(:LEVITATE) && !@battle.moldBreaker
- return true if hasActiveItem?(:AIRBALLOON)
- return true if @effects[PBEffects::MagnetRise] > 0
- return true if @effects[PBEffects::Telekinesis] > 0
- return false
- end
- #Add check for Jingle Bells and Deer flag
- return true if hasActiveItem?(:JINGLEBELLS) && @pokemon.species_data.has_flag?("Deer")
- #Do the same for takesHailDamage?
- def takesHailDamage?
- return false if !takesIndirectDamage?
- return false if pbHasType?(:ICE)
- return false if inTwoTurnAttack?("TwoTurnAttackInvulnerableUnderground",
- "TwoTurnAttackInvulnerableUnderwater")
- return false if hasActiveAbility?([:OVERCOAT, :ICEBODY, :SNOWCLOAK])
- return false if hasActiveItem?(:SAFETYGOGGLES)
- return true
- end
- return false if hasActiveItem?(:JINGLEBELLS) && @pokemon.species_data.has_flag?("Deer")
- Battle::ItemEffects::OnSwitchIn.add(:JINGLEBELLS,
- proc { |item, battler, battle|
- next unless battler.pokemon.species_data.has_flag?("Deer")
- battle.pbDisplay(_INTL("{1} floats in the air with its {2}!",
- battler.pbThis, battler.itemName))
- }
- )
- #Neverstone - Ignores abilities
- #Handy Cap - increased rate of incoming crits
- Battle::ItemEffects::CriticalCalcFromTarget.add(:HANDYCAP,
- proc { |item, user, target, c|
- next c + 1
- }
- )
- #Singolite - raises all non-HP stats equally until BST is 530. Can't be part of evo line, can't have BST over 500.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement