- 22
- Posts
- 11
- Years
- Seen Jun 30, 2024
Hello, I'm back with another question.
I have created and item called Blast Shield. It's a held item that greatly reduces damage from Explosion/Self Destruct. So far I've got it to work wonderfully except it's not consumed after the Explosion/Self Destruct. While its incredible useful as is I would like to nerf it to its intended design. It's probably something simple but I can't for the life of me get it to work. Anyway if someone could take a look and let me know I would greatly appreciate it. And if we can figure it out you guys can use it too!
I have this bit in PokeBattle_Battler
And this is the little bit that I changed in the Explosion/Self Destruct in PokeBattle_MoveEffects
I have created and item called Blast Shield. It's a held item that greatly reduces damage from Explosion/Self Destruct. So far I've got it to work wonderfully except it's not consumed after the Explosion/Self Destruct. While its incredible useful as is I would like to nerf it to its intended design. It's probably something simple but I can't for the life of me get it to work. Anyway if someone could take a look and let me know I would greatly appreciate it. And if we can figure it out you guys can use it too!
I have this bit in PokeBattle_Battler
Spoiler:
if target.hasWorkingItem(:AIRBALLOON,true)
PBDebug.log("[Item triggered] #{target.pbThis}'s Air Balloon popped")
@battle.pbDisplay(_INTL("{1}'s Air Balloon popped!",target.pbThis))
target.pbConsumeItem(true,false)
elsif target.hasWorkingItem(:BLASTSHIELD,true)
if isConst?(thismove.id,PBMoves,:EXPLOSION) || isConst?(thismove.id,PBMoves,:SELFDESTRUCT)
PBDebug.log("[Item triggered] #{target.pbThis}'s Blast Shield broke!")
@battle.pbDisplay(_INTL("{1}'s Blast Shield broke!",target.pbThis))
target.pbConsumeItem(true,false)
end
elsif target.hasWorkingItem(:ABSORBBULB) && isConst?(movetype,PBTypes,:WATER)
if target.pbIncreaseStatWithCause(PBStats::SPATK,1,target,PBItems.getName(target.item))
PBDebug.log("[Item triggered] #{target.pbThis}'s #{PBItems.getName(target.item)}")
target.pbConsumeItem
end
PBDebug.log("[Item triggered] #{target.pbThis}'s Air Balloon popped")
@battle.pbDisplay(_INTL("{1}'s Air Balloon popped!",target.pbThis))
target.pbConsumeItem(true,false)
elsif target.hasWorkingItem(:BLASTSHIELD,true)
if isConst?(thismove.id,PBMoves,:EXPLOSION) || isConst?(thismove.id,PBMoves,:SELFDESTRUCT)
PBDebug.log("[Item triggered] #{target.pbThis}'s Blast Shield broke!")
@battle.pbDisplay(_INTL("{1}'s Blast Shield broke!",target.pbThis))
target.pbConsumeItem(true,false)
end
elsif target.hasWorkingItem(:ABSORBBULB) && isConst?(movetype,PBTypes,:WATER)
if target.pbIncreaseStatWithCause(PBStats::SPATK,1,target,PBItems.getName(target.item))
PBDebug.log("[Item triggered] #{target.pbThis}'s #{PBItems.getName(target.item)}")
target.pbConsumeItem
end
And this is the little bit that I changed in the Explosion/Self Destruct in PokeBattle_MoveEffects
Spoiler:
################################################################################
# User faints. (Explosion, Selfdestruct)
################################################################################
class PokeBattle_Move_0E0 < PokeBattle_Move
def pbOnStartUse(attacker)
if !attacker.hasMoldBreaker
[email protected](:DAMP)
if bearer!=nil
@battle.pbDisplay(_INTL("{1}'s {2} prevents {3} from using {4}!",
bearer.pbThis,PBAbilities.getName(bearer.ability),attacker.pbThis(true),@name))
return false
end
end
return true
end
def pbShowAnimation(id,attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
super(id,attacker,opponent,hitnum,alltargets,showanimation)
if attacker.hasWorkingItem(:BLASTSHIELD) && !attacker.fainted?
attacker.pbReduceHP((attacker.totalhp/4).floor)
@battle.pbDisplay(_INTL("{1} was saved by its Blast Shield!",attacker.pbThis))
elsif !attacker.fainted?
attacker.pbReduceHP(attacker.hp)
attacker.pbFaint if attacker.fainted?
end
end
end
# User faints. (Explosion, Selfdestruct)
################################################################################
class PokeBattle_Move_0E0 < PokeBattle_Move
def pbOnStartUse(attacker)
if !attacker.hasMoldBreaker
[email protected](:DAMP)
if bearer!=nil
@battle.pbDisplay(_INTL("{1}'s {2} prevents {3} from using {4}!",
bearer.pbThis,PBAbilities.getName(bearer.ability),attacker.pbThis(true),@name))
return false
end
end
return true
end
def pbShowAnimation(id,attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
super(id,attacker,opponent,hitnum,alltargets,showanimation)
if attacker.hasWorkingItem(:BLASTSHIELD) && !attacker.fainted?
attacker.pbReduceHP((attacker.totalhp/4).floor)
@battle.pbDisplay(_INTL("{1} was saved by its Blast Shield!",attacker.pbThis))
elsif !attacker.fainted?
attacker.pbReduceHP(attacker.hp)
attacker.pbFaint if attacker.fainted?
end
end
end