• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Trying to make an all-targeting pollen puff like effect

  • 6
    Posts
    2
    Years
    • 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:
    Spoiler:
     
    You may want to delete the first class. You kind of defined it twice in your code.
     
    I deleted the first class, and for some reason, now it doesn't say "but it's failed"...

    ...but it now doesn't heal the partner. Ill post the new code, may I ask what I've done wrong please?

    The code:
    Spoiler:
     
    Here, I added the additional effect from Sparkling Aria to the Pollen Puff Code and defined as the move effect you provided. Certain abilities such as Sheer Force will negate the burn curing when coded like this.

    Code:
    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)
        return false 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
        return false
      end
    
      def pbDamagingMove?
        return false if @healing
        return super
      end
    
      def pbEffectAgainstTarget(user, target)
        return if !@healing
        target.pbRecoverHP(target.totalhp / 2)
        @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
    
      def pbAdditionalEffect(user, target)
        return if target.fainted? || target.damageState.substitute
        return if target.status != :BURN
        target.pbCureStatus
      end
    end
     
    Thank you for making Sheer Force boost the move, but unfortunately it doesn't fix the main issue
    The main issue I'm trying to solve is the fact that when using a move with pollen puffs effect but it targets all enemies at once, it either doesn't work on the enemies, or doesn't heal anyone, and damages the ally.
    What I'm trying to achieve is a move that hits all targets on the field at once in a double battle, but damages the enemy and heals and ally. Is there a way to make that work please?
     
    Back
    Top