Users browsing this thread: 1 Guest(s)
Monster Resistance and $3BE1

#1
Posts: 377
Threads: 34
Thanks Received: 10
Thanks Given: 7
Joined: Dec 2018
Reputation: 18
Status
Moog
So I was messing with the WallChange property and I tried changing the null element effect to resist element (by storing it in $3BE1,Y).

To my surprise, this worked on the monsters as well, who I assumed would be unable to have elemental resistance.

And now I'm confused.  Looking at monster data, the value after "Weak element" is used to determine the monster's attack graphic.  But...
Code:
(Load monster's special attack, elemental properties, statuses, status immunities,
 Metamorph info, special properties like Human/Undead/Dies at MP=0 , etc)

C2/2DC1: 08           PHP
C2/2DC2: BF 1F 00 CF  LDA $CF001F,X  (Special attack)
C2/2DC6: 99 2D 32     STA $322D,Y
C2/2DC9: BF 19 00 CF  LDA $CF0019,X  (elemental weaknesses)
C2/2DCD: 19 E0 3B     ORA $3BE0,Y
C2/2DD0: 99 E0 3B     STA $3BE0,Y    (add to existing weaknesses)
...
It appears here that both $3BE0,Y and $3BE1,Y get set here [as the command seems to be using the 16-bit accumulator].  I also come to this conclusion because a little down the way the exact same structure is used to set the nullify and absorb elements in the same fashion.

So now I have some questions...
(1) Does the monster's attack graphic also grant them elemental resistances, by virtue of the bits stored at CF001A?
(2) If I move the monster's attack graphic to another of the $20so monster data bytes, can I then use CF001A,X to set monster resistances? Or is more effort required?

Having learned monsters can have resistances correctly set, I'm interested in giving them some resistances for the purpose of varying combat and diversifying rage benefits (IE setting certain monsters to resist certain elements so that Gau gains that resistance by raging with them).
Is there something at C2/2DD0 that keeps the high byte from writing onto RAM address $3BE1?


EDIT: Just tried it with Dirk ($00) vs. Mythril ($01) on the first Lobo, and nope, the weapon graphic does not apply resistance to the enemy. Having Mythril as the attack graphic would otherwise make the Lobo halve fire damage. Now I'm more confused, because there doesn't seem to be anything in the C2 that resets $3BE1 for a monster.

EDIT 8/7/2020: Moved the True Knight enemy flag to $CF0012,Y bit 2, and purged Enemy Runic in favor of regular runic (looks a little weird, but works). That freed up $CF001E,Y for resistances, for which I added a subroutine to apply them to enemies. Yay, don't need to mess with the attack graphic pulldown!
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite