- 53
- Posts
- 5
- Years
- Seen Feb 6, 2025
Harsh Burn is just the fire version of toxic
How to access Harsh Burn for public use
Step 1: In PokeBattle_BattlerEffects under
#===============================================================================
# Burn
#===============================================================================
Completely replace all original code with this new one:
(Molten Rock is the fire type Toxic Spikes)
Step 2: In PokeBattle_MoveEffects, Move these fire moves to this to promote the effect:
Step 3: In PokeBattle_Battle, alter the #Burn line with this before else it should look like this:
Step 4: In PokeBattle_AI paste this above elsif attacker.status==PBStatuses::POISON:
after that go to:
and paste this under it:
Step 5: Go to PokeBattle_Battler and paste this under toxic's attr_reader :status, above toxic
attr_reader :statusCount
then go to the @effects and paste this under toxic:
Step 6 *Must do before play testing*: initialize the constant in PBEffects:
How to access Harsh Burn for public use
Step 1: In PokeBattle_BattlerEffects under
#===============================================================================
# Burn
#===============================================================================
Completely replace all original code with this new one:
Spoiler:
Code:
def pbCanBurn?(attacker,showMessages,move=nil)
return false if isFainted?
if status==PBStatuses::BURN
@battle.pbDisplay(_INTL("{1} already has a burn.",pbThis)) if showMessages
return false
end
if self.status!=0 ||
(@effects[PBEffects::Substitute]>0 && (!move || !move.ignoresSubstitute?(attacker)))
@battle.pbDisplay(_INTL("But it failed!")) if showMessages
return false
end
if @battle.field.effects[PBEffects::MistyTerrain]>0 &&
!self.isAirborne?(attacker && attacker.hasMoldBreaker)
@battle.pbDisplay(_INTL("The Misty Terrain prevented {1} from being burned!",pbThis(true))) if showMessages
return false
end
if !attacker || !attacker.hasMoldBreaker
if hasWorkingAbility(:WATERVEIL) ||
(hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
(hasWorkingAbility(:LEAFGUARD) && (@battle.pbWeather==PBWeather::SUNNYDAY ||
@battle.pbWeather==PBWeather::HARSHSUN))
@battle.pbDisplay(_INTL("{1}'s {2} prevents burns!",pbThis,PBAbilities.getName(self.ability))) if showMessages
return false
end
if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)
abilityname=PBAbilities.getName(pbPartner.ability)
@battle.pbDisplay(_INTL("{1}'s partner's {2} prevents burns!",pbThis,abilityname)) if showMessages
return false
end
end
if pbOwnSide.effects[PBEffects::Safeguard]>0 &&
(!attacker || !attacker.hasWorkingAbility(:INFILTRATOR))
@battle.pbDisplay(_INTL("{1}'s team is protected by Safeguard!",pbThis)) if showMessages
return false
end
return true
end
def pbCanBurnSynchronize?(opponent)
return false if self.status!=0
if hasWorkingAbility(:WATERVEIL) ||
(hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
(hasWorkingAbility(:LEAFGUARD) && (@battle.pbWeather==PBWeather::SUNNYDAY ||
@battle.pbWeather==PBWeather::HARSHSUN))
@battle.pbDisplay(_INTL("{1}'s {2} prevents {3}'s {4} from working!",
pbThis,PBAbilities.getName(self.ability),
opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
return false
end
if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)
@battle.pbDisplay(_INTL("{1}'s {2} prevents {3}'s {4} from working!",
pbPartner.pbThis,PBAbilities.getName(pbPartner.ability),
opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
return false
end
return true
end
def pbCanMoltenRock?(moldbreaker=false)
return false if isFainted?
return false if self.status!=0
return false if pbHasType?(:FIRE)
if !moldbreaker
return false if hasWorkingAbility(:WATERVEIL) ||
(hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
(pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS))
return false if hasWorkingAbility(:LEAFGUARD) &&
(@battle.pbWeather==PBWeather::SUNNYDAY ||
@battle.pbWeather==PBWeather::HARSHSUN)
end
return false if pbOwnSide.effects[PBEffects::Safeguard]>0
return true
end
def pbCanBurnSynchronize?(opponent)
return false if self.status!=0
if hasWorkingAbility(:WATERVEIL) ||
(hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
(hasWorkingAbility(:LEAFGUARD) && (@battle.pbWeather==PBWeather::SUNNYDAY ||
@battle.pbWeather==PBWeather::HARSHSUN))
@battle.pbDisplay(_INTL("{1}'s {2} prevents {3}'s {4} from working!",
pbThis,PBAbilities.getName(self.ability),
opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
return false
end
if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)
@battle.pbDisplay(_INTL("{1}'s {2} prevents {3}'s {4} from working!",
pbPartner.pbThis,PBAbilities.getName(pbPartner.ability),
opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
return false
end
return true
end
def pbBurn(attacker,msg=nil,harshburn=false)
self.status=PBStatuses::BURN
self.statusCount=(harshburn) ? 1 : 0
self.effects[PBEffects::HarshBurn]=0
@battle.pbCommonAnimation("Burn",self,nil)
if msg && msg!=""
@battle.pbDisplay(msg)
else
if harshburn
@battle.pbDisplay(_INTL("{1} was harshly burned!",pbThis))
else
@battle.pbDisplay(_INTL("{1} was burned!",pbThis))
end
end
if harshburn
PBDebug.log("[Status change] #{pbThis} was harshly burned]")
else
PBDebug.log("[Status change] #{pbThis} was burned")
end
if attacker && self.index!=attacker.index &&
self.hasWorkingAbility(:SYNCHRONIZE)
if attacker.pbCanBurnSynchronize?(self)
PBDebug.log("[Ability triggered] #{self.pbThis}'s Synchronize")
attacker.pbBurn(nil,_INTL("{1}'s {2} burned {3}!",self.pbThis,
PBAbilities.getName(self.ability),attacker.pbThis(true)),harshburn)
end
end
end
Step 2: In PokeBattle_MoveEffects, Move these fire moves to this to promote the effect:
Spoiler:
Code:
################################################################################
# Severely burns the target. (Inferno,Fire Blast,Sacred Fire,Searing Shot)
# (Handled in Battler's pbSuccessCheck): Hits semi-invulnerable targets if user
# is Fire-type and move is status move.
################################################################################
class PokeBattle_Move_162 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
return super(attacker,opponent,hitnum,alltargets,showanimation) if pbIsDamaging?
return -1 if !opponent.pbCanBurn?(attacker,true,self)
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
opponent.pbBurn(attacker,nil,true)
return 0
end
def pbAdditionalEffect(attacker,opponent)
return if opponent.damagestate.substitute
if opponent.pbCanBurn?(attacker,false,self)
opponent.pbBurn(attacker,nil,true)
end
end
end
Step 3: In PokeBattle_Battle, alter the #Burn line with this before else it should look like this:
Spoiler:
Code:
# Burn/Harsh Burn
if i.status==PBStatuses::BURN
if i.statusCount>0
i.effects[PBEffects::HarshBurn]+=1
i.effects[PBEffects::HarshBurn]=[15,i.effects[PBEffects::HarshBurn]].min
end
if i.hasWorkingAbility(:FLAMEHEAL)
pbCommonAnimation("Burn",i,nil)
if i.effects[PBEffects::HealBlock]==0 && i.hp<i.totalhp
PBDebug.log("[Ability triggered] #{i.pbThis}'s Flame Heal")
i.pbRecoverHP((i.totalhp/8).floor,true)
pbDisplay(_INTL("{1} is healed by burn!",i.pbThis))
end
else
if !i.hasWorkingAbility(:MAGICGUARD)
PBDebug.log("[Status damage] #{i.pbThis} took damage from burn/harsh burn")
if i.statusCount==0
i.pbReduceHP((i.totalhp/8).floor)
else
i.pbReduceHP(((i.totalhp*i.effects[PBEffects::HarshBurn])/16).floor)
end
i.pbContinueStatus
end
end
end
Step 4: In PokeBattle_AI paste this above elsif attacker.status==PBStatuses::POISON:
Spoiler:
Code:
if attacker.status==PBStatuses::BURN
score+=40
if skill>=PBTrainerAI.mediumSkill
if attacker.hp<attacker.totalhp/8
score+=60
elsif skill>=PBTrainerAI.highSkill &&
attacker.hp<(attacker.effects[PBEffects::HarshBurn]+1)*attacker.totalhp/16
score+=60
end
end
after that go to:
Spoiler:
Code:
if skill>=PBTrainerAI.highSkill
if @battlers[index].status==PBStatuses::POISON &&
@battlers[index].statusCount>0
toxicHP=(@battlers[index].totalhp/16)
nextToxicHP=toxicHP*(@battlers[index].effects[PBEffects::Toxic]+1)
if nextToxicHP>=@battlers[index].hp &&
toxicHP<@battlers[index].hp && pbAIRandom(100)<80
shouldswitch=true
end
end
end
Spoiler:
Code:
if skill>=PBTrainerAI.highSkill
if @battlers[index].status==PBStatuses::BURN &&
@battlers[index].statusCount>0
harshburnHP=(@battlers[index].totalhp/16)
nextHarshBurnHP=harshburnHP*(@battlers[index].effects[PBEffects::HarshBurn]+1)
if nextHarshBurnHP>=@battlers[index].hp &&
harshburnHP<@battlers[index].hp && pbAIRandom(100)<80
shouldswitch=true
end
end
end
Step 5: Go to PokeBattle_Battler and paste this under toxic's attr_reader :status, above toxic
Spoiler:
Code:
def status=(value)
if @status==PBStatuses::SLEEP && value==0
@effects[PBEffects::Truant]=false
end
@status=value
@pokemon.status=value if @pokemon
if value!=PBStatuses::BURN
@effects[PBEffects::HarshBurn]=0
end
if value!=PBStatuses::BURN && value!=PBStatuses::SLEEP
@statusCount=0
@pokemon.statusCount=0 if @pokemon
end
end
attr_reader :statusCount
then go to the @effects and paste this under toxic:
Spoiler:
Code:
@effects[PBEffects::HarshBurn] = 0
then go to toxic's override lines and paste these under them:
override=true if USENEWBATTLEMECHANICS && thismove.function==0xC6 && # HarshBurn
thismove.basedamage==0 && user.pbHasType?(:FIRE)
Step 6 *Must do before play testing*: initialize the constant in PBEffects:
Spoiler:
Code:
HarshBurn = ___