- 220
- Posts
- 14
- Years
- Seen Nov 29, 2021
The code is for a move that, when known alongside three other moves, has its base power and effect chance doubled. Now I'm very new to this (started this morning :S ) and couldn't see an obvious answer so I tried this rather hacky method whereby the effect is determined by the function itself. But would it work?
Code:
class PokeBattle_Move_138 < PokeBattle_Move
def pbBaseDamage(basedmg,attacker,opponent)
multiplier = 1
moveIDs = Array.new
moveIDs << attacker.moves[0].id
moveIDs << attacker.moves[1].id
moveIDs << attacker.moves[2].id
moveIDs << attacker.moves[3].id
if (moveIDs.include? 561&&564&&576&&591)
multiplier = 2
end
return basedmg*multiplier
end
end
def pbAdditionalEffect(attacker,opponent)
multiplier = 1
moveIDs = Array.new
moveIDs << attacker.moves[0].id
moveIDs << attacker.moves[1].id
moveIDs << attacker.moves[2].id
moveIDs << attacker.moves[3].id
if (moveIDs.include? 561&&564&&576&&591)
multiplier = 2
end
[email protected](10/multiplier)
case rnd
when 0
return false if !opponent.pbCanConfuse?(false)
opponent.effects[PBEffects::Confusion][email protected](4)
@battle.pbCommonAnimation("Confusion",attacker,opponent)
@battle.pbDisplay(_INTL("{1} became confused!",opponent.pbThis))
end
return true
end
end