• 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.

Need help making the Mega Launcher Ability

  • 3
    Posts
    9
    Years
    • Seen Feb 3, 2016
    I have been trying to script the ability "Mega Launcher", but I don't really know how.?
    And can you you please explain how it works?
    Thank's
    (I don't have alot of scripting knowledge, but I am willing to learn)
     
    In PokeBattle_MoveEffects, find this code and add the red:
    Code:
    ################################################################################
    # Heals target by 1/2 of its max HP.
    [COLOR="Red"]# If user has ability Mega Launcher, heals target by 3/4 of its max HP.[/COLOR]
    ################################################################################
    class PokeBattle_Move_0DF < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        if opponent.effects[PBEffects::Substitute]>0
          @battle.pbDisplay(_INTL("But it failed!"))  
          return -1
        end
        if opponent.effects[PBEffects::HealBlock]>0
          @battle.pbDisplay(_INTL("{1} was prevented from healing due to Heal Block!",opponent.pbThis))
          return -1
        end
        if opponent.hp==opponent.totalhp
          @battle.pbDisplay(_INTL("{1}'s HP is full!",opponent.pbThis))  
          return -1
        end
        pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
        hpgain=((opponent.totalhp+1)/2).floor
        [COLOR="red"]hpgain=(((opponent.totalhp+1)*3)/4).floor if attacker.hasWorkingAbility(:MEGALAUNCHER)
    [/COLOR]    opponent.pbRecoverHP(hpgain,true)
        @battle.pbDisplay(_INTL("{1}'s HP was restored.",opponent.pbThis))  
        return 0
      end
    end

    Adding the red adds Heal Pulse + Mega Launcher working.


    In PokeBattle_Move, find this code and add the red:
    Code:
        if opponent.hasWorkingAbility(:HEATPROOF) && isConst?(type,PBTypes,:FIRE) && !attacker.hasBypassingAbility 
          damagemult=(damagemult*0.5).round
        end
        [COLOR="red"]if attacker.hasWorkingAbility(:MEGALAUNCHER)
          if [getID(PBMoves,:AURASPHERE),getID(PBMoves,:DARKPULSE),getID(PBMoves,:DRAGONPULSE),
              getID(PBMoves,:ORIGINPULSE),getID(PBMoves,:WATERPULSE)].include?(@id)
            damagemult=(damagemult*1.5).floor
          end
        end[/COLOR]

    This makes it work with damaging moves.
     
    In PokeBattle_MoveEffects, find this code and add the red:
    Code:
    ################################################################################
    # Heals target by 1/2 of its max HP.
    [COLOR="Red"]# If user has ability Mega Launcher, heals target by 3/4 of its max HP.[/COLOR]
    ################################################################################
    class PokeBattle_Move_0DF < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        if opponent.effects[PBEffects::Substitute]>0
          @battle.pbDisplay(_INTL("But it failed!"))  
          return -1
        end
        if opponent.effects[PBEffects::HealBlock]>0
          @battle.pbDisplay(_INTL("{1} was prevented from healing due to Heal Block!",opponent.pbThis))
          return -1
        end
        if opponent.hp==opponent.totalhp
          @battle.pbDisplay(_INTL("{1}'s HP is full!",opponent.pbThis))  
          return -1
        end
        pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
        hpgain=((opponent.totalhp+1)/2).floor
        [COLOR="red"]hpgain=(((opponent.totalhp+1)*3)/4).floor if attacker.hasWorkingAbility(:MEGALAUNCHER)
    [/COLOR]    opponent.pbRecoverHP(hpgain,true)
        @battle.pbDisplay(_INTL("{1}'s HP was restored.",opponent.pbThis))  
        return 0
      end
    end

    Adding the red adds Heal Pulse + Mega Launcher working.


    In PokeBattle_Move, find this code and add the red:
    Code:
        if opponent.hasWorkingAbility(:HEATPROOF) && isConst?(type,PBTypes,:FIRE) && !attacker.hasBypassingAbility 
          damagemult=(damagemult*0.5).round
        end
        [COLOR="red"]if attacker.hasWorkingAbility(:MEGALAUNCHER)
          if [getID(PBMoves,:AURASPHERE),getID(PBMoves,:DARKPULSE),getID(PBMoves,:DRAGONPULSE),
              getID(PBMoves,:ORIGINPULSE),getID(PBMoves,:WATERPULSE)].include?(@id)
            damagemult=(damagemult*1.5).floor
          end
        end[/COLOR]

    This makes it work with damaging moves.

    Can I ask if I'm right in assuming that continuing the series in the list i.e. [getID(PBmoves,:FLASHCANNON),getID(PBmoves,:SLUDGEWAVE)]
    would add the damage boost to new moves.
     
    Can I ask if I'm right in assuming that continuing the series in the list i.e. [getID(PBmoves,:FLASHCANNON),getID(PBmoves,:SLUDGEWAVE)]
    would add the damage boost to new moves.

    That should work. Did you try testing in battle? You can pick which Pokémon you want to battle from the debug menu and see the damage before and after your change (remember that there's some amount of randomness though!).
     
    Last edited:
    Back
    Top