Users browsing this thread: 1 Guest(s)
Gau's Rage 75%
If you have no idea how to do it you can test this code with xkas 0.06. Note that you'll need to change the org $C26469 to actual free space in bank $C2 if that space is occupied by patches. This code is untested.
Code:
hirom
;header
org $C20600
jsr sub_rage ; get good index
tax ; transfer rage/attack index to X
sep #$20 ; 8-bit accumulator
lda $CF4600,X ; load rage/attack
plp
plx
rts
org $C26469 ; change to free space in bank $C2
sub_rage:
pha ; save monster index
jsr $4B5A ; random number between 0 and 255
cmp #$40 ; compare to 64
bcc is_attack ; branch if smaller than 64
; rage (75%)
pla ; restore monster index
rep #$30 ; 16-bit accumulator/index
asl a ; multiply by 2
inc a ; increment by 1
bra exit
is_attack:
; attack (25%)
pla ; restore monster index
rep #$30 ; 16-bit accumulator/index
asl a ; multiply by 2
exit:
rts
« Next Oldest | Next Newest »
|
||||
Users browsing this thread: 1 Guest(s)