- 6
- Posts
- 343
- Days
- Seen Nov 24, 2023
I've been trying to buff certain moves and pokemon, and I thought a cool buff would be to give pollen puffs effect to sparkling aria, now hitting every pokemon on the field and healing your allies and hurting the enemies
I used Pollen Puffs code, but for some reason it fails when it hits the enemy. Heals the partner in a double battle though
I'm not the best coder, can someone please help? Thanks
The code:
#===============================================================================
# Cures the target's burn, and does damage
# but heals the partner for 1/4 in doubles. (Sparkling Aria)
#===============================================================================
class Battle::Move::HealAllyOrDamageFoeAndCureTargetBurn < Battle::Move
def pbTarget(user)
return GameData::Target.get(:AllNearOthers) if user.effects[PBEffects::HealBlock] > 0
return super
end
end
class Battle::Move::HealAllyOrDamageFoeAndCureTargetBurn < Battle::Move
def pbTarget(user)
return GameData::Target.get(:AllNearOthers) if user.effects[PBEffects::HealBlock] > 0
return super
end
def pbOnStartUse(user, targets)
@healing = false
@healing = !user.opposes?(targets[0]) if targets.length > 0
end
def pbFailsAgainstTarget?(user, target, show_message)
if @healing
if target.effects[PBEffects::Substitute] > 0 && !ignoresSubstitute?(user)
@battle.pbDisplay(_INTL("But it failed!")) if show_message
return true
end
if !target.canHeal?
@battle.pbDisplay(_INTL("But it failed!")) if show_message
return true
end
end
return false
end
def pbDamagingMove?
return false if @healing
return super
end
def pbEffectAgainstTarget(user, target)
return if !@healing
target.pbRecoverHP(target.totalhp / 4)
@battle.pbDisplay(_INTL("{1}'s HP was restored.", target.pbThis))
end
def pbShowAnimation(id, user, targets, hitNum = 0, showAnimation = true)
hitNum = 1 if @healing # Healing anim
super
end
end
I used Pollen Puffs code, but for some reason it fails when it hits the enemy. Heals the partner in a double battle though
I'm not the best coder, can someone please help? Thanks
The code:
Spoiler:
#===============================================================================
# Cures the target's burn, and does damage
# but heals the partner for 1/4 in doubles. (Sparkling Aria)
#===============================================================================
class Battle::Move::HealAllyOrDamageFoeAndCureTargetBurn < Battle::Move
def pbTarget(user)
return GameData::Target.get(:AllNearOthers) if user.effects[PBEffects::HealBlock] > 0
return super
end
end
class Battle::Move::HealAllyOrDamageFoeAndCureTargetBurn < Battle::Move
def pbTarget(user)
return GameData::Target.get(:AllNearOthers) if user.effects[PBEffects::HealBlock] > 0
return super
end
def pbOnStartUse(user, targets)
@healing = false
@healing = !user.opposes?(targets[0]) if targets.length > 0
end
def pbFailsAgainstTarget?(user, target, show_message)
if @healing
if target.effects[PBEffects::Substitute] > 0 && !ignoresSubstitute?(user)
@battle.pbDisplay(_INTL("But it failed!")) if show_message
return true
end
if !target.canHeal?
@battle.pbDisplay(_INTL("But it failed!")) if show_message
return true
end
end
return false
end
def pbDamagingMove?
return false if @healing
return super
end
def pbEffectAgainstTarget(user, target)
return if !@healing
target.pbRecoverHP(target.totalhp / 4)
@battle.pbDisplay(_INTL("{1}'s HP was restored.", target.pbThis))
end
def pbShowAnimation(id, user, targets, hitNum = 0, showAnimation = true)
hitNum = 1 if @healing # Healing anim
super
end
end