• 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] Toxic thread and Burn up move Script Request

Lazy Catalyst

What you do, the way you think, makes you differen
91
Posts
6
Years
  • Hi guys
    Has anyone done the Toxic thread and Burn up move scripts?
    I found other scripts in the community but they don't seem to work properly
     
    Last edited:
    1,682
    Posts
    8
    Years
    • Seen today
    I used 2 different function codes as a base. 044, which lowers speed by 1 level, and 005, which poisons.
    Code:
    class PokeBattle_Move_159 < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        return super(attacker,opponent,hitnum,alltargets,showanimation) if pbIsDamaging?
        speed=opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
        poison=opponent.pbCanPoison?(attacker,false,self)
        pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation) if speed || poison
        ret=false
        ret=opponent.pbReduceStat(PBStats::SPEED,1,attacker,true,self) if speed
        ret|=poison
        opponent.pbPoison(attacker) if poison
        @battle.pbDisplay(_INTL("But it failed!")) if !ret
        return ret ? 0 : -1
      end
    
      def pbAdditionalEffect(attacker,opponent)
        return if opponent.damagestate.substitute
        if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
          opponent.pbReduceStat(PBStats::SPEED,1,attacker,false,self)
        end
        if opponent.pbCanPoison?(attacker,false,self)
          opponent.pbPoison(attacker)
        end
      end
    end

    Burn up seems to be similar to Roost when it comes to the whole type switching, so that's a good place to start.
    This bit in def pbTypeModifier in PokeBattle_Move does the type switching.
    Code:
        # Roost
        if isConst?(otype1,PBTypes,:FLYING) && opponent.effects[PBEffects::Roost]
          if isConst?(otype2,PBTypes,:FLYING) && isConst?(otype3,PBTypes,:FLYING)
            otype1=getConst(PBTypes,:NORMAL) || 0
          else
            otype1=otype2
          end
        end
        if isConst?(otype2,PBTypes,:FLYING) && opponent.effects[PBEffects::Roost]
          otype2=otype1
        end
    I don't entirely understand how Burn Up is supposed to work though, so I can't help too much there. sorry...
    I do know that you don't want to remove the effect on the end of round in pbEndOfRoundPhase, so don't copy how Roost works in that method, because Roost does reset on end of turn while Burn up only does on switch.
     
    1,805
    Posts
    7
    Years
  • I used 2 different function codes as a base. 044, which lowers speed by 1 level, and 005, which poisons.
    Code:
    class PokeBattle_Move_159 < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        return super(attacker,opponent,hitnum,alltargets,showanimation) if pbIsDamaging?
        speed=opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
        poison=opponent.pbCanPoison?(attacker,false,self)
        pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation) if speed || poison
        ret=false
        ret=opponent.pbReduceStat(PBStats::SPEED,1,attacker,true,self) if speed
        ret|=poison
        opponent.pbPoison(attacker) if poison
        @battle.pbDisplay(_INTL("But it failed!")) if !ret
        return ret ? 0 : -1
      end
    
      def pbAdditionalEffect(attacker,opponent)
        return if opponent.damagestate.substitute
        if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
          opponent.pbReduceStat(PBStats::SPEED,1,attacker,false,self)
        end
        if opponent.pbCanPoison?(attacker,false,self)
          opponent.pbPoison(attacker)
        end
      end
    end

    Burn up seems to be similar to Roost when it comes to the whole type switching, so that's a good place to start.
    This bit in def pbTypeModifier in PokeBattle_Move does the type switching.
    Code:
        # Roost
        if isConst?(otype1,PBTypes,:FLYING) && opponent.effects[PBEffects::Roost]
          if isConst?(otype2,PBTypes,:FLYING) && isConst?(otype3,PBTypes,:FLYING)
            otype1=getConst(PBTypes,:NORMAL) || 0
          else
            otype1=otype2
          end
        end
        if isConst?(otype2,PBTypes,:FLYING) && opponent.effects[PBEffects::Roost]
          otype2=otype1
        end
    I don't entirely understand how Burn Up is supposed to work though, so I can't help too much there. sorry...
    I do know that you don't want to remove the effect on the end of round in pbEndOfRoundPhase, so don't copy how Roost works in that method, because Roost does reset on end of turn while Burn up only does on switch.

    oh that's wrong! They type needs to be QMARKS and not NORMAL! Birds loose their flying typing and not turn normal! They only become NORMAL type if they were single typed as flying except if they used burnup beforehand (which they'll be QMARKS)


    from bulba

    If a pure Flying-type Pokémon successfully uses Roost, it will become Normal-type until the end of the turn.[1] If a Pokémon is a Fire/Flying type that lost its Fire type due to Burn Up, using Roost causes it to become typeless until the end of the turn.
    If a Pokémon with another type besides Flying uses Roost, it will lose its Flying type until the end of the turn (but will not have it replaced with the Normal type).
    If a pure Flying-type Pokémon that has been affected by Forest's Curse/Trick-or-Treat successfully uses Roost, its Flying type will be replaced by Normal, in addition to retaining its Grass or Ghost type addition.
     
    1,682
    Posts
    8
    Years
    • Seen today
    oh that's wrong! They type needs to be QMARKS and not NORMAL! Birds loose their flying typing and not turn normal! They only become NORMAL type if they were single typed as flying except if they used burnup beforehand (which they'll be QMARKS)


    from bulba

    Honestly I don't know, I just copied that bit straight out of vanilla v17.2. If that's not how it works, make a bug report I guess.
     

    Lazy Catalyst

    What you do, the way you think, makes you differen
    91
    Posts
    6
    Years
  • Spoiler:


    Thanks Vendily, for the Toxic Thread it works perfectly and for the move Burn Up as juliorain said it should be QMARKS
    This is the code and instructions I found on the community.
    Spoiler:

    I tested it out but the move doesn't seem to change the Fire type to QMARKS after used and another issue is that Bulbapedia says that "The move will fail if used by a non fire type Pokemon" I tested it out on a Pikachu and he uses the move and deals damage
    So Vendily and Juliorain can you tell me how to modify the code and make it work
    Thanks in Advance
     
    1,682
    Posts
    8
    Years
    • Seen today
    Code:
      def pbMoveFailed(attacker,opponent)
        return attacker.effects[PBEffects::BurnUp] || !attacker.pbHasType?(:FIRE)
      end
    should fail if the move has been used or it doesn't have a fire type.
    Disclaimer, I typed this out on my phone, so it's possible I mistyped something.
     

    Lazy Catalyst

    What you do, the way you think, makes you differen
    91
    Posts
    6
    Years
  • Code:
      def pbMoveFailed(attacker,opponent)
        return attacker.effects[PBEffects::BurnUp] || !attacker.pbHasType?(:FIRE)
      end
    should fail if the move has been used or it doesn't have a fire type.
    Disclaimer, I typed this out on my phone, so it's possible I mistyped something.

    Thanks Vendily
    I will check and see if it functions well
     

    Lazy Catalyst

    What you do, the way you think, makes you differen
    91
    Posts
    6
    Years
  • Hi Guys
    With the help from Vendily, we finally solved the Burn Up Move Script
    So here it is

    Add this in PokeBattle_MoveEffects:
    Code:
    ################################################################################
    # After attacking, the user removes this move's type from their own typing
    # This move cannot be used for a Pokemon for which the move isn't STAB.(Burn Up)
    ################################################################################
    class PokeBattle_Move_1B9 < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        type=@type
        return -1 if !attacker.pbHasType?(type)
        return -1 if attacker.effects[PBEffects::BurnUp]
        ret=super(attacker,opponent,hitnum,alltargets,showanimation)
        if attacker.effects[PBEffects::Type3]==type
          attacker.effects[PBEffects::Type3]=-1
        end
        if attacker.type1==type && attacker.type2==type
          attacker.type1=getConst(PBTypes,:QMARKS)
          attacker.type2=getConst(PBTypes,:QMARKS)
        elsif attacker.type1==type  
          attacker.type1=attacker.type2
        elsif attacker.type2==type
          attacker.type2=attacker.type1
        end
        attacker.effects[PBEffects::BurnUp]=true
        return ret
      end
      def pbMoveFailed(attacker,opponent)
        return attacker.effects[PBEffects::BurnUp] || !attacker.pbHasType?(@type)
      end
    end

    In PBEffects add this:
    Code:
    BurnUp             = 110
    (Note: Change this number to the lowest number you have)

    In Pokebattle_Battler, find def pbInitEffects and add this between the @effects group:
    Code:
    @effects[PBEffects::BurnUp] = false

    And this is it :D
     
    Last edited:

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • Spoiler:


    EDIT: Here the code with Frozen stats and phrase (XXX is your code into move.txt. Also you need to put 'g' flag for this move, to thaw the ice):
    Spoiler:
     
    Last edited:
    Back
    Top