- 6
- Posts
- 1
- Years
- Seen Nov 24, 2023
Hello
A few months ago, I tried making a Pollen Puff-like effect that hits everyone on the field at once. Turns out, the original Pollen Puff code doesn't work very well with hitting everyone on the field.
In an attempt to get this working, I instead looked at making a move that heals you ally when it does damage. However, I've tried using Flame Burst as a base, and I don't really know what I'm doing
Even though I doubt it can help, here's my latest attempt at getting the code to run:
Is there anyone here who might be able to help me with getting this to work?
Thanks
A few months ago, I tried making a Pollen Puff-like effect that hits everyone on the field at once. Turns out, the original Pollen Puff code doesn't work very well with hitting everyone on the field.
In an attempt to get this working, I instead looked at making a move that heals you ally when it does damage. However, I've tried using Flame Burst as a base, and I don't really know what I'm doing
Even though I doubt it can help, here's my latest attempt at getting the code to run:
Code:
class Battle::Move::HealAllyOrDamageFoeAndCureTargetBurn < Battle::Move
def pbEffectWhenDealingDamage(user, target)
hitAlly = []
battler.allAllies.each do |b|
next if !b.near?(battler.index)
hitAlly.push([b.index, b.hp])
b.hpGain = (target.totalhp / 2).round
end
if hitAlly.length == 2
@battle.pbDisplay(_INTL("The bursting flame hit {1} and {2}!",
@battle.battlers[hitAlly[0][0]].pbThis(true),
@battle.battlers[hitAlly[1][0]].pbThis(true)))
elsif hitAlly.length > 0
hitAlly.each do |b|
@battle.pbDisplay(_INTL("The bursting flame hit {1}!",
@battle.battlers[b[0]].pbThis(true)))
end
end
hitAlly.each { |b| @battle.battlers[b[0]].pbItemHPHealCheck }
end
end
Is there anyone here who might be able to help me with getting this to work?
Thanks