Users browsing this thread: 1 Guest(s)
changeing Health command
Yes, it's possible, and it should be quite easy.
There is a random number generator at C2/4B5A. You would first want to call that, then run some comparisons based on what you want the odds of each spell to be.
First you would need to interrupt the Health routine and jump to some free space, since this code will be longer than Health's. So your function might look something like this (using the free space at C2/A65A):
Hopefully this makes sense.
There is a random number generator at C2/4B5A. You would first want to call that, then run some comparisons based on what you want the odds of each spell to be.
First you would need to interrupt the Health routine and jump to some free space, since this code will be longer than Health's. So your function might look something like this (using the free space at C2/A65A):
Code:
C2/171E: A9 2D LDA #$2D (load Cure's spell ID instead of Cure 2's)
C2/1720: 85 B6 STA $B6 (store it into the skill to use; you'll see why shortly)
C2/1722: 4C 5A A6 JMP $A65A (jump to some free space, since we've used up all of Health's)
C2/1725: EA NOP
C2/A65A: 20 5A 4B JSR $4B5A (get a random number 0-255)
C2/A65D: C9 33 CMP #$33 (compare it to 51 (33 in hex; roughly 20% of 256))
C2/A65F: 90 08 BCC $A669 (if the random number is less than 51, use Cure)
C2/A661: C9 B3 CMP #$B3 (compare the random number to 179 (128 + 51; 50% chance))
C2/A663: 90 02 BCC $A667 (if the random number is less than 179 but greater than 51, use Cure 2)
C2/A665: E6 B6 INC $B6 (else, use Cure 3. Increment the spell ID we stored earlier twice to point to Cure 3)
C2/A667: E6 B6 INC $B6 (Cure 2 enters here, thus we will only increment the spell ID once so it points to Cure 2)
C2/A669: A9 05 LDA #$05 (this is left over from Health originally. Not sure what it's for; maybe the blue palette color. Cure also enters here, so we don't increment the spell ID at all)
C2/A66B: 4C 65 17 JMP $1765
Hopefully this makes sense.
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)