- 32
- Posts
- 9
- Years
- Seen Jun 15, 2015
Okay, there are a couple move effects I wanted to get statted up but there's no uniform documentation on all the functions available in PE. That, and I'm not that great with Ruby syntax, so I was wondering if anyone could help me because I have quite a few quick questions and if anyone could help a little it would be much appreciated.
Okay, this first one is simple, it needs debugging:
For some reason, the commented lines always call "Normal", but the type actually works correctly. What variable should I be calling?
Also, I had a question about random functions. So I want to introduce a move that takes an unweighted, random type and uses that as it's type. How would I do this? Is there something that describes how to make a little table and randomly select from it? I tried, but I think I'm not loaning in right or something. I have two places I want to do this, one isn't in Move Effects.
Also, are there any moves that can conditionally check something about the target, like it's type? I want to make something that lowers the Defenses of Steel types.
Okay, this first one is simple, it needs debugging:
Code:
class PokeBattle_Move_162 < PokeBattle_Move
def pbType(type,attacker,opponent)
type=attacker.type1
return type
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
#type=attacker.type1
#typename=PBTypes.getName(type)
#@battle.pbDisplay(_INTL("The attack became {1} type!",typename))
return super(attacker,opponent,hitnum,alltargets,showanimation) if @basedamage>0
end
end
For some reason, the commented lines always call "Normal", but the type actually works correctly. What variable should I be calling?
Also, I had a question about random functions. So I want to introduce a move that takes an unweighted, random type and uses that as it's type. How would I do this? Is there something that describes how to make a little table and randomly select from it? I tried, but I think I'm not loaning in right or something. I have two places I want to do this, one isn't in Move Effects.
Also, are there any moves that can conditionally check something about the target, like it's type? I want to make something that lowers the Defenses of Steel types.