• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
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:
    Spoiler:
     
    188
    Posts
    9
    Years
    • Seen May 16, 2024
    You may want to delete the first class. You kind of defined it twice in your code.
     
    6
    Posts
    343
    Days
    • Seen Nov 24, 2023
    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:
     
    188
    Posts
    9
    Years
    • Seen May 16, 2024
    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
     
    6
    Posts
    343
    Days
    • Seen Nov 24, 2023
    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