- 13
- Posts
- 11
- Years
- Seen Jul 11, 2014
I've spent the last hour or so desperately trying to implement an ability that changes the types of all moves a pokemon uses to a certain type (in the same vein as the Normalize ability). Here is my script (situated in PokeBattleMove):
def pbType(type,attacker,opponent)
if type>=0 && if isConst?(attacker.ability,PBAbilities,:BUZZINESS)
type=getConst(PBTypes,:BUG)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:PRAGMATIST)
type=getConst(PBTypes,:DARK)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:DRACONIC)
type=getConst(PBTypes,:DRAGON)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:FULLYCHARGED)
type=getConst(PBTypes,:ELECTRIC)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:FAIRPLAY)
type=getConst(PBTypes,:FIGHTING)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:INCANDESCENT)
type=getConst(PBTypes,:FIRE)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:UPABOVE)
type=getConst(PBTypes,:FLYING)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:IMMATERIAL)
type=getConst(PBTypes,:GHOST)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:POLLENPOWER)
type=getConst(PBTypes,:GRASS)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:ATTACKDUST)
type=getConst(PBTypes,:GROUND)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:REFRIGERATE)
type=getConst(PBTypes,:ICE)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:VILEMEMBRANE)
type=getConst(PBTypes,:POISON)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:METAPHYSICAL)
type=getConst(PBTypes,:PSYCHIC)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:GEMCOAT)
type=getConst(PBTypes,:ROCK)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:MECHANIZE)
type=getConst(PBTypes,:STEEL)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:AQUIFY)
type=getConst(PBTypes,:WATER)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:SPACETECH)
type=getConst(PBTypes,:STELLAR)
end
if type>=0 && isConst?(attacker.ability,PBAbilities,:PIXILATE)
type=getConst(PBTypes,:FAIRY)
end
if type>=0 && isConst?(attacker.ability,PBAbilities,:NORMALIZE)
type=getConst(PBTypes,:NORMAL) || 0
end
return type
end
Now whenever I try to actually playtest the game in debug mode, the game tells me that there is a syntax error in the last line of PokeBattleMove.
Does anybody know why that's the case? Help would be appreciated :)
def pbType(type,attacker,opponent)
if type>=0 && if isConst?(attacker.ability,PBAbilities,:BUZZINESS)
type=getConst(PBTypes,:BUG)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:PRAGMATIST)
type=getConst(PBTypes,:DARK)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:DRACONIC)
type=getConst(PBTypes,:DRAGON)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:FULLYCHARGED)
type=getConst(PBTypes,:ELECTRIC)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:FAIRPLAY)
type=getConst(PBTypes,:FIGHTING)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:INCANDESCENT)
type=getConst(PBTypes,:FIRE)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:UPABOVE)
type=getConst(PBTypes,:FLYING)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:IMMATERIAL)
type=getConst(PBTypes,:GHOST)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:POLLENPOWER)
type=getConst(PBTypes,:GRASS)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:ATTACKDUST)
type=getConst(PBTypes,:GROUND)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:REFRIGERATE)
type=getConst(PBTypes,:ICE)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:VILEMEMBRANE)
type=getConst(PBTypes,:POISON)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:METAPHYSICAL)
type=getConst(PBTypes,:PSYCHIC)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:GEMCOAT)
type=getConst(PBTypes,:ROCK)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:MECHANIZE)
type=getConst(PBTypes,:STEEL)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:AQUIFY)
type=getConst(PBTypes,:WATER)
end
if type>=0 && if isConst?(attacker.ability,PBAbilities,:SPACETECH)
type=getConst(PBTypes,:STELLAR)
end
if type>=0 && isConst?(attacker.ability,PBAbilities,:PIXILATE)
type=getConst(PBTypes,:FAIRY)
end
if type>=0 && isConst?(attacker.ability,PBAbilities,:NORMALIZE)
type=getConst(PBTypes,:NORMAL) || 0
end
return type
end
Now whenever I try to actually playtest the game in debug mode, the game tells me that there is a syntax error in the last line of PokeBattleMove.
Does anybody know why that's the case? Help would be appreciated :)