Advertiser Content

Vendily

Female
Seen 5 Hours Ago
Posted 4 Days Ago
886 posts
3.9 Years
I used 2 different function codes as a base. 044, which lowers speed by 1 level, and 005, which poisons.
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.
    # 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.

juliorain

Male
USA
Seen 1 Hour Ago
Posted 1 Hour Ago
1,608 posts
2.8 Years
I used 2 different function codes as a base. 044, which lowers speed by 1 level, and 005, which poisons.
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.
    # 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.

Vendily

Female
Seen 5 Hours Ago
Posted 4 Days Ago
886 posts
3.9 Years
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.

Alan Flygon

A new GUY!!!

Male
Kerala
Seen 1 Week Ago
Posted 1 Week Ago
75 posts
1.1 Years
Spoiler:

I used 2 different function codes as a base. 044, which lowers speed by 1 level, and 005, which poisons.
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.
    # 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


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:
################################################################################
# User attacks, and its Fire type is ignored for attacks used against it.
# (Burn Up)
################################################################################
class PokeBattle_Move_169 < PokeBattle_Move
  def pbEffectAfterHit(attacker,opponent,turneffects)
    if !opponent.isFainted? && opponent.damagestate.calcdamage>0 &&
       !opponent.damagestate.substitute
      attacker.effects[PBEffects::BurnUp]=true
    end
  end
end

Add the BurnUp effect first in PBEffects, then in PokeBattle_Battler, put "@effects[PBEffects::BurnUp] = false" under "@effects[PBEffects::Roost] = false"

In PokeBattle_Move, in the def pbTypeModifier put this code after the Roost effect.

    # Burn Up
    if isConst?(otype1,PBTypes,:FIRE) && opponent.effects[PBEffects::BurnUp]
      if isConst?(otype2,PBTypes,:FIRE) && isConst?(otype3,PBTypes,:FIRE)
        otype1=getConst(PBTypes,:QMARKS) || 0
      else
        otype1=otype2
      end
    end
    if isConst?(otype2,PBTypes,:FIRE) && opponent.effects[PBEffects::BurnUp]
      otype2=otype1
    end

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

Vendily

Female
Seen 5 Hours Ago
Posted 4 Days Ago
886 posts
3.9 Years
  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.

Alan Flygon

A new GUY!!!

Male
Kerala
Seen 1 Week Ago
Posted 1 Week Ago
75 posts
1.1 Years
  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

Alan Flygon

A new GUY!!!

Male
Kerala
Seen 1 Week Ago
Posted 1 Week Ago
75 posts
1.1 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:
################################################################################
# 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:
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:
@effects[PBEffects::BurnUp] = false
And this is it :D

WolfPP

Discord: Wolf#1235

Male
Brazil
Online now
Posted 6 Hours Ago
550 posts
299 Days
Spoiler:

Well, about Burn Up i have this code:
Spoiler:

About Roost move:
Bulbapedia:
 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.
Inside 'PokeBattle_Move' script, below Roost 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
      elsif opponent.effects[PBEffects::BurnUp]
        otype1=getConst(PBTypes,:QMARKS) || 0
      else
        otype1=otype2
      end
    end
    if isConst?(otype2,PBTypes,:FLYING) && opponent.effects[PBEffects::Roost]
      otype2=otype1
    end
    # Burn Up
    if isConst?(otype1,PBTypes,:FIRE) && opponent.effects[PBEffects::BurnUp]
      if isConst?(otype2,PBTypes,:FIRE) && isConst?(otype3,PBTypes,:FIRE)
        otype1=getConst(PBTypes,:QMARKS) || 0
      else
        otype1=otype2
      end
    end
    if isConst?(otype2,PBTypes,:FIRE) && opponent.effects[PBEffects::BurnUp]
      otype2=otype1
    end
About the frozen status:
Bulbapedia:
If used by a Fire-type Pokémon, Burn Up will thaw out the user if it is frozen, and then inflict damage to the target and cause the user to lose its Fire type.
Then, inside 'PokeBattle_MoveEffects' script (XXX= will be your code inside move.txt):
################################################################################
# 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_XXX < PokeBattle_Move
  def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
    if !isConst?(attacker.type1,PBTypes,:FIRE) && !isConst?(attacker.type2,PBTypes,:FIRE)
      @battle.pbDisplay(_INTL("But it failed!"))
      return -1 
    end
    attacker.status=0 if isConst?(attacker.status,PBStatuses,:FROZEN)
    pbShowAnimation(@id,attacker,opponent,1,alltargets,showanimation)
    return ret
  end
  
  def pbEffectAfterHit(attacker,opponent,turneffects)
    if !opponent.isFainted? && opponent.damagestate.calcdamage>0 &&
       !opponent.damagestate.substitute
      attacker.effects[PBEffects::BurnUp]=true
      @battle.pbDisplay(_INTL("{1} gave up all his fire!",attacker.pbThis))
    end
  end
end



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:

class PokeBattle_Move_XXX < 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
    @battle.pbDisplay(_INTL("{1} gave up all his fire!",attacker.pbThis))
    return ret
  end
  
  def pbMoveFailed(attacker,opponent)
    return attacker.effects[PBEffects::BurnUp] || !attacker.pbHasType?(@type)
  end
end
Now, in 'PokeBattle_Battler', looking for this code and add to Burn Up':
    if self.status==PBStatuses::FROZEN
      if thismove.canThawUser?
        if !@effects[PBEffects::BurnUp]#
          PBDebug.log("[Move effect triggered] #{pbThis} was defrosted by using #{thismove.name}")
          self.pbCureStatus(false)#
          @battle.pbDisplay(_INTL("{1} thawed out!",pbThis))#
          pbCheckForm
        else#
          PBDebug.log("[Move effect triggered] #{pbThis} was defrosted by using #{thismove.name}")
          self.pbCureStatus(false)
          @battle.pbDisplay(_INTL("{1} melted the ice!",pbThis))
          pbCheckForm
        end
      elsif @battle.pbRandom(10)<2 && !turneffects[PBEffects::SkipAccuracyCheck]
        self.pbCureStatus
        pbCheckForm
      elsif !thismove.canThawUser?
        self.pbContinueStatus
        PBDebug.log("[Status] #{pbThis} remained frozen and couldn't move")
        return false
      end
    end
Advertiser Content