- 32
- Posts
- 7
- Years
- Far, far away
- Seen May 1, 2023
Hello! I hope this is the right thread to post.
Edit: 15.10.2020
The issues have now been solved, thanks to Turn20Negate.
Content:
With Turn20Negate's help, I've created an ability that works similarly to Leech Seed. So long as the user is in the battle, it will drain 1/8 HP of opposing Pokémon near to it.
Code in BattleHandlers_Abilities (below Bad Dreams):
Edit: 15.10.2020
The issues have now been solved, thanks to Turn20Negate.
Content:
With Turn20Negate's help, I've created an ability that works similarly to Leech Seed. So long as the user is in the battle, it will drain 1/8 HP of opposing Pokémon near to it.
Code in BattleHandlers_Abilities (below Bad Dreams):
Code:
BattleHandlers::EOREffectAbility.add(:SOULREAPER,
proc { |ability,battler,battle|
splashshown = false
battle.eachOtherSideBattler(battler.index) do |b|
next if !battler || battler.fainted?
next if !b.near?(battler) || !b.takesIndirectDamage?(PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
next if b.pbHasType?(:GHOST) || b.pbHasType?(:NORMAL)
if !splashshown
battle.pbShowAbilitySplash(battler)
splashshown = true
end
oldHP = b.hp;oldHPRecipient = battler.hp
hpLoss = b.totalhp/8
b.pbReduceHP(hpLoss)
battler.pbRecoverHPFromDrain(hpLoss,b,
_INTL("{1}'s health was drained!",b.pbThis))
battler.pbAbilitiesOnDamageTaken(oldHPRecipient);b.pbAbilitiesOnDamageTaken(oldHP)
b.pbItemHPHealCheck
b.pbFaint if b.fainted?
battler.pbFaint if battler.fainted?
end
battle.pbHideAbilitySplash(battler)
}
)
Last edited: