You are not logged in.
One of the bugs/glitches/errors in Red and Blue was the effectiveness display when a dual type pokémon was attacked. This confused me a lot as a kid. For instance, Grass-type moves do neutral damage to Gyarados, but if Gyarados is hit by a Grass-type move, the game erroneously states that the attack is "Not Very Effective". The damage itself is neutral, but the wrong text and sound effect are displayed.
display_effectiveness in pokered looks like this:
DisplayEffectiveness: ; 2fb7b (b:7b7b)
ld a, [wDamageMultipliers]
and a, $7F
cp a, $0A
ld hl, SuperEffectiveText
jr nc, .done
ld hl, NotVeryEffectiveText
Has anyone gotten around fixing this? I'm sure it's easy and could probably be fixed by shifting right/left at some point, but I'm not sure where to begin.
I know _Crystal has done it, but I was having trouble finding some of the routines he modified (it was more than just this one) to port the changes over since he has been redoing a lot of the engine. I'm planning to look into it again at some point but in the meantime, maybe he can help you.
I am no longer active on this forum. I only pop in from time to time.
The problem is that the effectiveness against the first type is lost, since wDamageMultipliers gets overwritten during the calculation of the second type matchup. I got around it by storing type matchups as flags instead of using the whole wDamageMultipliers byte to keep track of each type matchup. This way we can determine the effectiveness depending on which bits are set.
At a glance: https://github.com/xCrystal/pokered/com … a9384R1017
Neutral is now value 0 so we have to initialize wDamageMultipliers to 0 (instead of to $a). We also have to make sure to set the appropriate bit after each type matchup check if super effective or not very effective. If immune we just set al bits except bit 7 which is for STAB (we don't care about STAB anyway since it will do 0 damage): https://github.com/xCrystal/pokered/com … 131aaR1187
Then determine the result based on which bits are set.
Message: https://github.com/xCrystal/pokered/com … d49f0790R5
Sound: https://github.com/xCrystal/pokered/com … 4256dR2949
Last edited by Crystal_ (2015-11-22 16:08:48)
This is one fix I'm not planning on applying to my hack; it just makes the game more interesting for me, especially when I'm pitting a Weedle against a Weedle and we're attacking each other without any risk of Poison, with each attack punctuated by the usual "super effective" sound effect and the "It's super effective!" message, which only (in my opinion, at least) serves to make an otherwise dull early battle that much more awesome.
Thanks to you both, Mateo and Crystal_!
And Fotomac: Well, I guess that's one way of looking at it. :) Personally, I suffer from such a severe case of assburgerism where things "have to make sense" that the error really rubs me the wrong way, hah.
Last edited by Schattenjäger (2015-11-22 23:46:53)