Rival Alioth
The Stargazer
- 1
- Posts
- 5
- Years
- Seen Feb 19, 2025
Hello. I'm somewhat new to this place, and a complete novice at coding. However, I'm trying my hand at creating a fangame anyway. I think I've been doing fairly well so far, however, I've encountered a little "issue". I created a new move for the game, using the combined move effect codes for Blizzard and Flying Press:
I've tested it and the move actually seems to work just fine, albeit with one small little issue I have. This "issue" occurs when I use the attack on a Fairy Type Pokemon. Now, in theory, it works fine. The attack plays the attack animation, and due to it technically being considered a Dragon-Type Move it does no damage, as to be expected. My problem isn't really with the move itself, but with the attack animation. It's just kind of strange for a giant snowball to be hurled at the target only for it to do zero damage. I've tried and tried to implement the "it doesn't affect the foe..." line in every way I could think of, and I got it to pop up using:
However, it would still just end up playing the attack animation right after, and once again doing zero damage. Can someone point me in the right direction to accomplish this? I really do apologize if this is an asinine request and something that I could have easily fixed through further research, I'm just not too sure where to look anymore for the proper solution.
Code:
class PokeBattle_Move_178 < PokeBattle_Move
def pbModifyDamage(damagemult,attacker,opponent)
type=getConst(PBTypes,:DRAGON) || -1
if type>=0
mult=PBTypes.getCombinedEffectiveness(type,
opponent.type1,opponent.type2,opponent.effects[PBEffects::Type3])
return ((damagemult*mult)/8).round
end
return damagemult
end
def pbModifyBaseAccuracy(baseaccuracy,attacker,opponent)
if @battle.pbWeather==PBWeather::HAIL
return 0
end
return baseaccuracy
end
end
I've tested it and the move actually seems to work just fine, albeit with one small little issue I have. This "issue" occurs when I use the attack on a Fairy Type Pokemon. Now, in theory, it works fine. The attack plays the attack animation, and due to it technically being considered a Dragon-Type Move it does no damage, as to be expected. My problem isn't really with the move itself, but with the attack animation. It's just kind of strange for a giant snowball to be hurled at the target only for it to do zero damage. I've tried and tried to implement the "it doesn't affect the foe..." line in every way I could think of, and I got it to pop up using:
Code:
if opponent.pbHasType?(:FAIRY)
@battle.pbDisplay(_INTL("It doesn't affect {1}...",opponent.pbThis(true)))
return -1
end
However, it would still just end up playing the attack animation right after, and once again doing zero damage. Can someone point me in the right direction to accomplish this? I really do apologize if this is an asinine request and something that I could have easily fixed through further research, I'm just not too sure where to look anymore for the proper solution.