Users browsing this thread: 3 Guest(s)
Shock Ability
07-20-2018, 12:53 AM
(This post was last modified: 07-20-2018, 01:04 AM by GrayShadows.)
Per the other thread, TA DA. Shock usable once (PER CHARACTER!) per battle.
I can't imagine you're giving Shock to more than one character, but it makes the patch a little more versatile/extensible for other people's use. Uses the upper nibble of $3F2E in battle; the lower nibble tracks whether or not a character has used an esper. $3F2F could also have been used, as it uses the low nibble to track whether or not a character has used a Desperation Attack.
Like all my code lately, it seems, it's not SUPER heavily tested, but so far it works the way it's supposed to. I haven't actually checked the code that reallows Shock for successive tiers of the final battle, but I can't see why it WOULDN'T work as written.
ETA: Oh, and yeah, the original patch would definitely conflict with all three of those, Gi Nattak, some of them game-breakingly.
I can't imagine you're giving Shock to more than one character, but it makes the patch a little more versatile/extensible for other people's use. Uses the upper nibble of $3F2E in battle; the lower nibble tracks whether or not a character has used an esper. $3F2F could also have been used, as it uses the low nibble to track whether or not a character has used a Desperation Attack.
Code:
hirom
; header
; Allow Shock only once per battle
; Defines
!Freespace_1 = $C2A65A ; 26 bytes, or 68 total
!Shock_ID = $1B
org $C2171A
orgShock: JMP newShock
NOP
org $C24A62
JSR finalShock ; Adding a jump for an extra TRB so Shock is usable
; on each tier of the final battle
org $C252C6
LDX #$0008
CMP.l c2_table1,X ; Moved table to free space because it's being expanded
org $C252D2
JSR (c2_table2,X) ; Moved table to free space because it's being expanded
org $C2531B
C2531B: ; Setting label for branch below to Magic/Lore code
org $C252E9
; Using space cleared by moving two expanded tables
dis_Shock: LDA $3018,Y ; Get character bit
ASL #4 ; And shuffle it into the high nibble
BIT $3F2E ; Check if this character has used Shock
BNE C2531B ; Branch and set carry if so
RTS ;
org !Freespace_1
; New function adds bit check on Shock ; 15 Bytes
newShock: LDA $3018,Y ; Get character bit
ASL #4 ; and shuffle it into the high nibble
TSB $3F2E ; Set bit 7 of $3F2F to show that Shock has been used
PHX : TYX
INC $2F30,X ; Set character's menu to be redrawn
PLX
LDA #$82 ; ("Megahit" spell, which is what has Shock's data)
JMP $1720 ; (go set that as spell/animation)
finalShock: TRB $3F2F ; Make eligible for a Desperation attack
ASL #4 ; Shuffle bit into high nibble
TRB $2F2E ; And make eligible for another Shock
RTS
; Two tables moved to make room to expand them
c2_table1: db $03, $0B, $07, $0C ; 9 Bytes
db $17, $02, $06, $00
db !Shock_ID
c2_table2: dw $5326, $5322, $531D, $5314 ; 18 Bytes
dw $5314, $5314, $5310, $5310
dw dis_Shock
Like all my code lately, it seems, it's not SUPER heavily tested, but so far it works the way it's supposed to. I haven't actually checked the code that reallows Shock for successive tiers of the final battle, but I can't see why it WOULDN'T work as written.
ETA: Oh, and yeah, the original patch would definitely conflict with all three of those, Gi Nattak, some of them game-breakingly.
The following 3 users say Thank You to GrayShadows for this post:
• madsiur (07-20-2018), PowerPanda (07-20-2018), Warrax (07-20-2018)
• madsiur (07-20-2018), PowerPanda (07-20-2018), Warrax (07-20-2018)
« Next Oldest | Next Newest »
|
||||
Users browsing this thread: 3 Guest(s)