Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Is there anything wrong?```
- .checkstat
- ; Checks if Evasion is greater than 0
- ld a, [wEnemyEvaLevel]
- cp BASE_STAT_LEVEL
- ret c
- ; Checks if Accuracy is below -1
- ld a, [wEnemyAccLevel]
- cp BASE_STAT_LEVEL - 1
- jr c, .rollswitch
- ld hl, wPlayerStatLevels
- ld c, NUM_LEVEL_STATS - 1
- ld b, 0
- ; Check player's stat buffs
- .checkstatbuff
- ld a, [hli]
- sub BASE_STAT_LEVEL
- inc d
- ld e, a
- ; b holds the stat buffs
- ld a, [hl]
- cp BASE_STAT_LEVEL
- jr nc, .checkstatbuff
- ld a, b
- add e
- ld b, a
- dec c
- jr z, .checkplayerbuff
- jr .checkstatbuff
- ; Check AI's stat buffs
- ld hl, wEnemyStatLevels
- .checkplayerbuff
- ld a, [hli]
- sub BASE_STAT_LEVEL
- inc d
- ld e, a
- ; subtract from b the AI's stat buffs
- ld a, [hl]
- cp BASE_STAT_LEVEL
- jr nc, .cont_check
- ld a, b
- sub e
- ld b, a
- dec c
- jr z, .cont_check
- jr .checkplayerbuff
- .cont_check
- ; If player's buffs - AI's buffs > 1
- ; AI won't switch
- ld a, b
- cp 1
- jr c, .checkperish```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement