• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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] Coding Toucannon's Beak Blast

Uzagi

the bunny
  • 20
    Posts
    6
    Years
    So I tried to code it's Beak Blast ; but I'm not sure if it'll work... can you guys check this out?
    I have little knowledge of RGSS since I'm trying to learn since few days

    def pbTwoTurnAttack(attacker)
    @immediate=false;

    def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
    if @immediate || attacker.effects[PBEffects::TwoTurnAttack]>0
    pbShowAnimation(@id,attacker,opponent,1,alltargets,showanimation) # Charging anim
    @battle.pbDisplay(_INTL("{1} começou a esquentar!",attacker.pbThis))
    end
    def pbAdditionalEffect(attacker,opponent)
    return if opponent.damagestate.substitute
    if opponent.pbCanBurn?(attacker,false,self)
    opponent.pbBurn(attacker)
    end
    return 0 if attacker.effects[PBEffects::TwoTurnAttack]>0
    return super(attacker,opponent,hitnum,alltargets,showanimation)
    end
    end
     
    You don't want to put a def inside another def. So at the very least it should look more like this:

    Code:
    def pbTwoTurnAttack(attacker)
      @immediate=false;
    end
    
    def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
      if @immediate || attacker.effects[PBEffects::TwoTurnAttack]>0
        pbShowAnimation(@id,attacker,opponent,1,alltargets,showanimation) # Charging anim
        @battle.pbDisplay(_INTL("{1} começou a esquentar!",attacker.pbThis))
      end
      return 0 if attacker.effects[PBEffects::TwoTurnAttack]>0
      return super(attacker,opponent,hitnum,alltargets,showanimation)
    end
    
    def pbAdditionalEffect(attacker,opponent)
      return if opponent.damagestate.substitute
      if opponent.pbCanBurn?(attacker,false,self)
        opponent.pbBurn(attacker)
      end
    end

    (I also moved the super call and the line above it because they clearly belonged to pbEffect, not pbAdditionalEffect).

    All I did was rearrange things though, I've made no attempt to check that things make sense.
     
    Last edited:
    Spoiler:


    We are wrong because Beak Blast is not a TwoTurns. Also, i think i done:
    Into your move.txt:

    Code:
    623,BEAKBLAST,Beak Blast,[COLOR="red"]CF20[/COLOR],100,FLYING,Physical,100,15,0,00,-3,[COLOR="red"]bn[/COLOR],"The user first heat up its beak, and then it attacks the target."

    In 'PokeBattle_MoveEffects' add:
    Code:
    ################################################################################
    # If anyone makes contact with the Pokemon while they are  charging this move, 
    # they will be inflicted with a burn (Beak Blast)
    ################################################################################
    class PokeBattle_Move_CF20 < PokeBattle_Move
    end

    Then, in 'PokeBattle_Battler' add the red lines:
    Spoiler:


    Finally, search for 'if pbChoseMoveFunctionCode?(i.index,0x115) # Focus Punch' inside 'PokeBattle_Battle' and add:
    Spoiler:

    The move will charge in first (before U-Turn i.e) and if opponent inflict damage with a contact move, will burn it, and the Beak Blast will be use and inflict damage AND finally the opponent will take damage with burn. If pokemon are sleeping, will charge the attack in first time and burn the opponent (if inflicted a contact move).
    Credits goes to Rot8er_ConeX (https://www.pokecommunity.com/showthread.php?t=383035&page=2)
    Video than i watched: https://www.youtube.com/watch?v=fcBHkRqK3Hc
     
    Last edited:
    Back
    Top