- 148
- Posts
- 11
- Years
- Upstate New York
- Seen Sep 5, 2023
Alright, so this turned out to be a bit over my head. Wanted to make a move based on the Infinity Gauntlet from Marvel Comics. Basically the effect of the move varies depending on which held item you have. I looked at Techno Blast/Judgment, but it was little help and are the only moves I could think of that make changes based on held item. I'm just not sure how to write it since the effects very from raising your own stat, to lowering your opponents, to switching out. These are all the function codes of the effects I'd like to use. I just have no idea on how to put them into one, if that makes sense. So if anyone could point me in the right direction to finishing this I would be very grateful.
Is it possible for an Item to just change which function code a move uses?
The move itself:
All the items and the effects they cause.
Time Gem = Lower opponents Speed
Space Gem = You switch out after attack.
Soul Gem = Absorb 50% of damage delt.
Reality Gem = "spdef = defense": Reverse of Psyshock. Physical attack use Special defense. Not sure how this one would work. Threw this in because it's all i figured out.
Power Gem = lowers opponents attack
Mind Gem = raise your special defense.
Is it possible for an Item to just change which function code a move uses?
The move itself:
Code:
625,KINGSGAUNTLET,King's Gauntlet,139,90,DARK,Physical,100,5,0,00,0,abef,Cool,The moves effects depend on the pokemon's held item.
All the items and the effects they cause.
Time Gem = Lower opponents Speed
Spoiler:
Code:
################################################################################
# Decreases the target's Speed by 1 stage.
################################################################################
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
return super(attacker,opponent,hitnum,alltargets,showanimation) if @basedamage>0
return -1 if !opponent.pbCanReduceStatStage?(PBStats::SPEED,true)
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
ret=opponent.pbReduceStat(PBStats::SPEED,1,false)
return ret ? 0 : -1
end
def pbAdditionalEffect(attacker,opponent)
if opponent.pbCanReduceStatStage?(PBStats::SPEED,false)
opponent.pbReduceStat(PBStats::SPEED,1,false)
end
return true
end
end
Space Gem = You switch out after attack.
Spoiler:
Code:
################################################################################
# After inflicting damage, user switches out. Ignores trapping moves.
################################################################################
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
ret=super(attacker,opponent,hitnum,alltargets,showanimation)
if attacker.hp>0 && @battle.pbCanChooseNonActive?(attacker.index) &&
[email protected]?(@battle.pbParty(opponent.index))
# TODO: Pursuit should go here, and negate this effect if it KO's attacker
@battle.pbDisplay(_INTL("{1} went back to {2}!",attacker.pbThis,@battle.pbGetOwner(attacker.index).name))
newpoke=0
[email protected](attacker.index,true,false)
@battle.pbMessagesOnReplace(attacker.index,newpoke)
attacker.pbResetForm
@battle.pbReplace(attacker.index,newpoke,true)
@battle.pbOnActiveOne(attacker)
attacker.pbAbilitiesOnSwitchIn(true)
end
return ret
end
end
Soul Gem = Absorb 50% of damage delt.
Spoiler:
Code:
################################################################################
# User gains half the HP it inflicts as damage.
################################################################################
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
ret=super(attacker,opponent,hitnum,alltargets,showanimation)
if opponent.damagestate.calcdamage>0
hpgain=((opponent.damagestate.hplost+1)/2).floor
if isConst?(opponent.ability,PBAbilities,:LIQUIDOOZE)
attacker.pbReduceHP(hpgain,true)
@battle.pbDisplay(_INTL("{1} sucked up the liquid ooze!",attacker.pbThis))
elsif attacker.effects[PBEffects::HealBlock]==0
hpgain=(hpgain*1.3).floor if isConst?(attacker.item,PBItems,:BIGROOT)
attacker.pbRecoverHP(hpgain,true)
@battle.pbDisplay(_INTL("{1} had its energy drained!",opponent.pbThis))
end
end
return ret
end
end
Reality Gem = "spdef = defense": Reverse of Psyshock. Physical attack use Special defense. Not sure how this one would work. Threw this in because it's all i figured out.
Spoiler:
Code:
#Damage formula
if type>=0 && pbIsPhysical?(type)
atk=spatk
defense=spdef if @function!=0x122 # Psyshock
spdef=defense if @function!=0x139 # King's Gauntlet
end
Power Gem = lowers opponents attack
Spoiler:
Code:
################################################################################
# Decreases the target's Attack by 1 stage.
################################################################################
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
return super(attacker,opponent,hitnum,alltargets,showanimation) if @basedamage>0
return -1 if !opponent.pbCanReduceStatStage?(PBStats::ATTACK,true)
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
ret=opponent.pbReduceStat(PBStats::ATTACK,1,false)
return ret ? 0 : -1
end
def pbAdditionalEffect(attacker,opponent)
if opponent.pbCanReduceStatStage?(PBStats::ATTACK,false)
opponent.pbReduceStat(PBStats::ATTACK,1,false)
end
return true
end
end
Mind Gem = raise your special defense.
Spoiler:
Code:
################################################################################
# Increases the user's Special Defense by 2 stages.
################################################################################
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
return super(attacker,opponent,hitnum,alltargets,showanimation) if @basedamage>0
return -1 if !attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,true)
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
ret=attacker.pbIncreaseStat(PBStats::SPDEF,1,false)
return ret ? 0 : -1
end
def pbAdditionalEffect(attacker,opponent)
if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,false)
attacker.pbIncreaseStat(PBStats::SPDEF,1,false)
end
return true
end
end
Last edited: