Disable Jump command if character has Dark status
#1
@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)
Reply
#2
This is a really cool concept. Great work!
Reply
#3
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.
Reply
#4
I like your structure. flexible code is the best.
Reply
#5
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
Reply
#6
very impressive
"Sometimes ninjas do wrong to each other, and in dat way the force of tha earf' comes around da moon - and at that presence, da dirt, it overshadows the grass, so you're like, I can't cut dis grass, there's no sun comin' through. So in order to enable each other the two fruits have to look each other in da eye and understand we can only be right, as da ripe is wrong, you know what I mean?"

-HNIC
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Gauntlet Jump doofenH 4 4,224 05-11-2022, 11:32 AM
Last Post: doofenH
  Disable magic while still allowing Esper equip boxedj 1 2,436 04-24-2020, 04:21 PM
Last Post: C-Dude
  Enable/Disable Auto-optimize Lightning 13 12,501 05-28-2019, 12:13 PM
Last Post: Lightning
  Dragon Horn max jump of 3 Lightning 15 11,092 07-20-2018, 12:55 AM
Last Post: GrayShadows
  Newbie Question - Granting Playable Character Status Immunity Turbotastic 2 3,625 04-04-2017, 07:28 PM
Last Post: Turbotastic
  2 Jump Commands Cyprus 0 1,904 05-07-2016, 10:13 AM
Last Post: Cyprus
  Making two different Jump commands Cyprus 4 5,313 10-26-2015, 02:44 AM
Last Post: Synchysi
  What makes Spears do double damage on Jump? Kugawattan 3 4,526 07-09-2015, 02:21 PM
Last Post: Drakkhen
  Gogo's Status Screen Command List Fenrir 4 5,430 02-06-2015, 06:04 AM
Last Post: Catone
  Character Names and Dark World Theme? Royaken 6 8,267 03-26-2014, 02:23 PM
Last Post: Royaken

Forum Jump:


Users browsing this thread: 1 Guest(s)