Users browsing this thread: 1 Guest(s)
Rebalance mod for Freeze, need help squashing a bug

#1
Posts: 281
Threads: 18
Thanks Received: 13
Thanks Given: 8
Joined: Mar 2014
Reputation: 8
Status
None
I made a mod for Freeze. An unintentional side effect of this mod is that Muddle is now dispelled by both physical and magical attacks, even attacks that do no damage such as Slow or Dischord. It only affects Muddle, not Sleep or Control. It's weird, I can't think of anything in this code that would cause that.

Symptoms:
It causes Muddle to be removed by any attack, either physical or magical, healing or damaging (or non-damaging)
Muddle is NOT removed by Debilitator, but it is removed by items such as Potion or Antidote
it does NOT cause Sleep to be removed by magical attacks (but it is removed by physical attacks)
it does NOT cause Control to be removed by magical attacks (also removed by physical attacks)
it DOES cause Control to not cause the enemy sprite to become mirrored [edit: sometimes]
when muddled, they DO become mirrored
UNLESS they were Controlled, then became Muddled, in which case they stay un-mirrored

Code:
; This changes the behaviour of Freeze:
;  Fire-elemental attacks will always remove Freeze
;  Other damaging attacks have a 50% chance of removing it
;  Physical attacks that don't do damage, or that do zero damage, have a 50% of removing it
;  Non-damaging spells will never remove it, unless they are Fire-elemental
;  Healing spells/attacks will never remove it, unless they are Fire-elemental

hirom ; (don't change this)
; header ; (uncomment this if your ROM has a header)

; (Initialize intermediate "status to set" bytes in $F4 - $F7 and
;  "status to clear" bytes in $FC - $FF.
;  Mark Clear / Freeze to be removed if necessary.)
org $C24490
PHX
SEP #$20     ; (Set 8-bit Accumulator)
LDA $11A4    ; (Special Byte 2)
AND #$0C
LSR
TAX          ;(X = 0 if set status, 2 = lift status,
             ;                      4 = toggle status)
REP #$20
jsr moved    ; had to make room for the new checks; 15 bytes moved to free space
LSR
BCS freeze   ; (branch if physical attack)
LDA #$10
BIT $F8
BEQ freeze   ; (branch if target not vanished)
BIT $11AA
BNE freeze   ; (branch if attack causes Clear)
TSB $F4      ; (mark Clear status to be cleared)
freeze:
LDA $11A1
LSR
BCS remove   ; (Remove Freeze if element Fire)
lda $11A4
lsr
bcs exit     ; (Exit if Healing)
lda $11B0
beq exit     ; (Exit if no damage)
JSR $4B53    ; (Random Number Generator; carry set or clear)
BCC exit     ; (50% chance of Exit)
remove:
LDA #$0200
BIT $FA
BEQ exit     ; (Exit if target not Frozen)
TSB $F6      ; (mark Freeze status to be cleared)
exit:
PLX
NOP
RTS

org $C2A65A  ; (change this to where there's 15 bytes of free space)
moved:
STZ $FC      ; (Clear status to clear and set bytes)
STZ $FE
STZ $F4
STZ $F6
JSR ($44D1,X)
LDA $11A2  
RTS
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite