FF6 Hacking
Disable Jump command if character has Dark status - Printable Version

+- FF6 Hacking (https://www.ff6hacking.com/forums)
+-- Forum: Discussion Forums (https://www.ff6hacking.com/forums/forum-5.html)
+--- Forum: Magitek Research Facility (https://www.ff6hacking.com/forums/forum-9.html)
+--- Thread: Disable Jump command if character has Dark status (/thread-3364.html)



Disable Jump command if character has Dark status - seibaby - 11-21-2016

@Kugawattan requested this, so here goes.


This code is easily extendable to check more commands. It likely conflicts with assassin's Brushless Sketch patch, since they muck with the same tables.

Use xkas 0.06 to assemble this patch.

Update 0.2
Dark sets Fight to spread aiming.
Release 0.1
Dark disables the Jump command.
Code:
;xkas 0.06
hirom ;don't change this
;header ;uncomment this if your ROM has a header
!freespace = $C2A65A ;change this to where you have free space in C2
!howmanycommands = #$0008

;****************************************************************
;Relocate and expand the command table and function pointer table
;****************************************************************

org !freespace
;(Data - commands that can potentially get grayed out on the menu in battle,
; or have a property like their aiming altered.)
table_Commands:
db $03    ;(Morph)
db $0B    ;(Runic)
db $07    ;(SwdTech)
db $0C    ;(Lore)
db $17    ;(X-Magic)
db $02    ;(Magic)
db $06    ;(Capture)
db $00    ;(Fight)
;Add commands here... don't forget to update !howmanycommands. For reference:
;00 = Fight     01 = Item       02 = Magic        03 = Morph      04 = Revert
;05 = Steal     06 = Capture    07 = SwdTech      08 = Throw      09 = Tools
;0A = Blitz     0B = Runic      0C = Lore         0D = Sketch     0E = Control
;0F = Slot      10 = Rage       11 = Leap         12 = Mimic      13 = Dance
;14 = Row       15 = Def        16 = Jump         17 = X Magic    18 = GP Rain
;19 = Summon    1A = Health     1B = Shock        1C = Possess    1D = Magitek
db $16    ;(Added command - Jump)


;(Data - addresses of functions to check whether above command should be
; enabled, disabled, or otherwise modified on battle menu)
table_Functions:
dw $5326   ;(Morph)
dw $5322   ;(Runic)
dw $531D   ;(SwdTech)
dw $5314   ;(Lore)
dw $5314   ;(X-Magic)
dw $5314   ;(Magic)
dw $5301   ;(Capture)
;dw $5301   ;(Fight)
dw function_Fight   ;(Fight)
;Add function pointers here...
dw function_Jump:


;****************************************************************
;Add functions here. If Carry is set, command is disabled.
;For examples, see C2/5301, C2/5314, C2/531D, C2/5322, and C2/5326.
;****************************************************************

;(New function - disable Jump if character has Dark status)
function_Jump:
macro checkDark()
LDA $3EE4,Y             ;(Status byte 1)
LSR                     ;(If Dark is set, disable command slot)
endmacro
%checkDark()
.exit
RTS


;(New function - make Fight spread-aim if character has Dark status) 
function_Fight:
%checkDark() ;(or JSR function_Jump if already using that)
BCC .noDark
JMP $5307 ;Skip to set Spread Aim
.noDark
JMP $5301 ;Check for Offering

;****************************************************************
;Modify some function calls to use the new tables' location
;****************************************************************

;Redirect the calling function's pointers to the new tables
org $C252C6
LDX !howmanycommands
CMP table_Commands,X    ;(Does our current command match one whose menu
                        ; availability or aiming can vary?)
org $C252D2
JSR (table_Functions,X)  ;(Call special function for command)


;****************************************************************
;Update command availability upon setting Dark
;****************************************************************

;Set status pointers ("side effects" to perform upon setting of a status):
org $C246B0
dw $4649 ;(Dark)        (Update command availability)

;Clear status pointers ("side effects" to perform upon clearing of a status):
org $C246F0
dw $4649 ;(Dark)        (Update command availability)



RE: Disable Jump command if character has Dark status - B-Run - 11-28-2016

This is a really cool concept. Great work!


RE: Disable Jump command if character has Dark status - seibaby - 11-30-2016

Yeah, a lot more can be done with this code than what was intended, I believe. The unmodified game only use functions to change targeting or enable/disable commands, but it should be possible to do a lot more.


RE: Disable Jump command if character has Dark status - B-Run - 12-01-2016

I like your structure. flexible code is the best.


RE: Disable Jump command if character has Dark status - seibaby - 12-04-2016

I've added some functionality to this to further showcase what can be done - Dark status now forces the Fight command to use Offering-style spread aiming. You still only get one attack though! Smile


RE: Disable Jump command if character has Dark status - SSJ Rick - 12-09-2016

very impressive