- 220
- Posts
- 14
- Years
- Seen Nov 29, 2021
Uncompiling Moves
Okay, four moves that share similar code, all of which crash. Something is wrong with them but what?
Spoiler:
Solved.
So I implimented a new weather type, which compiles nicely. However, the inducing move causes an error an compile attempt. What am I doing wrong?
So I implimented a new weather type, which compiles nicely. However, the inducing move causes an error an compile attempt. What am I doing wrong?
Code:
class PokeBattle_Move_140 < PokeBattle_Move
def pbEffect(attacker,opponent)
if @battle.weather==PBWeather::DARKNESS
@battle.pbDisplay(_INTL("But it failed!"))
return -1
if @battle.weather==PBWeather::GENTLEBREEZE
@battle.pbDisplay(_INTL("{1} Does not want to disrupt the Gentle Breeze", attacker.pbThis))
return -1
else
@battle.weather=PBWeather::DARKNESS
@battle.weatherduration=5
@battle.pbDisplay(_INTL("Darkness descended upon the field!"))
return 0
end
end
end
Okay, four moves that share similar code, all of which crash. Something is wrong with them but what?
Code:
class PokeBattle_Move_135 < 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
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.pbCanParalyze?(false)
opponent.pbParalyze(attacker)
@battle.pbDisplay(_INTL("{1} is paralyzed! It may be unable to move!",opponent.pbThis))
return true
end
return false
end
Code:
class PokeBattle_Move_136 < 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
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.pbCanBurn?(false)
opponent.pbBurn(attacker)
@battle.pbDisplay(_INTL("{1} was burned!",opponent.pbThis))
return true
end
return false
end
Code:
class PokeBattle_Move_137 < 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
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.pbCanPoison?(false)
opponent.pbPosion(attacker)
@battle.pbDisplay(_INTL("{1} was poisoned!",opponent.pbThis))
return true
end
return false
end
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
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))
return true
end
return false
end
Last edited: