- 2
- Posts
- 8
- Years
- Seen Aug 27, 2023
Hi, i am making a fan game and want to add a special attack for every starter.
I am already done with most of them, but now i encountered a problem.
As already stated above i want to make a new attack, called "Solar Whip".
It should work like this: Under sunshine or harsh sund the attack should hit the target twice. Without sun the attack hits once.
Unfortunately i don't seem to get it right. Now it works like this: without sunlight it hits once, when the sun is triggered it hits twice and then keeps hitting twice, until you close the game every time you use it.
Maybe the error is just so obvious, that i don't find it, but here's the code:
class PokeBattle_Move_507 < PokeBattle_Move
def pbIsMultiHit
if [email protected]==PBWeather::SUNNYDAY ||
[email protected]==PBWeather::HARSHSUN
def pbIsMultiHit
return false
end
end
if @battle.pbWeather==PBWeather::SUNNYDAY ||
@battle.pbWeather==PBWeather::HARSHSUN
def pbIsMultiHit
return true
end
def pbNumHits(attacker)
return 2
end
end
end
end
I am already done with most of them, but now i encountered a problem.
As already stated above i want to make a new attack, called "Solar Whip".
It should work like this: Under sunshine or harsh sund the attack should hit the target twice. Without sun the attack hits once.
Unfortunately i don't seem to get it right. Now it works like this: without sunlight it hits once, when the sun is triggered it hits twice and then keeps hitting twice, until you close the game every time you use it.
Maybe the error is just so obvious, that i don't find it, but here's the code:
class PokeBattle_Move_507 < PokeBattle_Move
def pbIsMultiHit
if [email protected]==PBWeather::SUNNYDAY ||
[email protected]==PBWeather::HARSHSUN
def pbIsMultiHit
return false
end
end
if @battle.pbWeather==PBWeather::SUNNYDAY ||
@battle.pbWeather==PBWeather::HARSHSUN
def pbIsMultiHit
return true
end
def pbNumHits(attacker)
return 2
end
end
end
end