Users browsing this thread: 1 Guest(s)
Turning Runic into Cover

#11
Posts: 763
Threads: 83
Thanks Received: 55
Thanks Given: 7
Joined: Apr 2015
Reputation: 22
Status
Obliviscence
Ok, I think I've got this where I like it. Required making a new ability effect. I used x05 and some free space in the C1 bank to write it. Here's the code if anyone is interested.

First, the actual menu action, which replaces Runic:
Code:
Cover (Replaces Runic)
C2/195B: BB           TYX
C2/195C: 20 8A 29     JSR $298A   (Clear special effect, magic power, etc.)
C2/195F: A9 0A        LDA #$0A    (2x05)
C2/1961: 8D A9 11     STA $11A9   (Stores Cover in special effect)
C2/1964: 4C 7B 31     JMP $317B
You see that JMP at the end? that's where I was having trouble with targetting. Runic uses $3167, which is used only for abilities that ignore targetting altogether. Kinda embarraced I missed that.

Next is the new ability effect to set up Covering an ally:
Code:
Cover effect 0x05 (0A)

C2/6473: A3 05        LDA $05,S
C2/6475: AA           TAX
C2/6476: 5A              PHY
C2/6477: A0 00          LDY #$00
C2/6479: 8A              TXA
C2/647A: D9 6C 33      CMP $336C,Y  (Is this character protected by attacker?)
C2/647D: D0 05          BNE $6484    (Branch if not)
C2/647F: A9 FF          LDA #$FF
C2/6481: 99 6C 33      STA $336C,Y  (Clear who takes damage for this person)
C2/6484: C8              INY
C2/6485: C8              INY
C2/6486: C0 12          CPY #$14     (Have we checked all characters)
C2/6488: 90 EF          BCC $6479    (Branch if not)
C2/648A: 7A              PLY
C2/648B: 98           TYA
C2/648C: 9D 6D 33     STA $336D,X  (Attacker data: save who they're taking damage for)
C2/648F: 8A           TXA
C2/6490: DD 6D 33     CMP $336D,X  (are these the same person?)
C2/6493: D0 06          BNE $649B       (Branch if not)
C2/6495: A9 FF          LDA #$FF
C2/6497: 9D 6D 33      STA $336D,X  (Attacker data: no longer takes damage for anyone)
C2/649A: 60              RTS
C2/649B: 99 6C 33      STA $336C,Y  (Target data: save who takes damage for them)
C2/649E: 60           RTS
Took me a while to get the logic right without making the code any longer than it needed to be. Essentially I need to clear the old effect before a new one can be applied. I couldn't directly compare A with X or Y so I had to store the new defendee in order to check to see if they were the same person, otherwise the cover effect would apply to himself/herself, causing the character to jump out of place to take their own blows. One little note here, since I am using the Love Token mechanic to make this work, Using cover clears any love token effect on the Cover user, not just ones set up by Cover.

And last, but not least... I had to put the new code in the pointer list for ability effects:
Code:
Table for special effects code pointers 1

C2/3DCD: 8C 38
C2/3DCF: 8C 38
C2/3DD1: 8C 38
C2/3DD3: 43 3D ($03)
C2/3DD5: F2 38 ($04)
C2/3DD7: 73 64 ($05) (Cover!)

So there it is. I'm trying to decide if I want Cover to last until pointed somewhere else, or if I want it to end after X number of turns... it just means more coding and finding an unused variable, which I don't much feel like doing, but we will see how it plays out in practical use.

Feel free to use this code, with how short the code for the menu ability is, you can replace anything you want (in the event you really want to keep Runic). Let me know what you think!
  Find
Quote  
[-] The following 2 users say Thank You to B-Run for this post:
  • C-Dude (09-12-2019), Timbo (04-21-2017)

#12
 
Status
None
Hrm... sounds pretty slick. Nice work, will be trying it as soon as I find my current bug.
 
Quote  

#13
Posts: 763
Threads: 83
Thanks Received: 55
Thanks Given: 7
Joined: Apr 2015
Reputation: 22
Status
Obliviscence
Oh, I forgot to mention. You might want to take a look at the targeting bits with FF3usME, since Runic didn't enter the targetting function, it didn't matter, but since Cover does, you need to make sure they are properly set.
  Find
Quote  

#14
 
Status
None
While I was looking at the code, trying to decide which skill I wouldn't miss... I started wondering, what stops you from just adding another new skill?

Well, didn't take long to figure what a pain that would be, so the next thought was: Could you consolodate two skills into one, and have a free slot to add a new skill?

This might not be that difficult. Say you go to Shock, and add a comparison check. If Leo, then continue the shock code, if not, jump to the possess code.

With my very basic (or lower) understanding of how abilities work right now I figured why not try it. Go to start of runic, and drop in a

Code:
CMP 04  (Which should have been Edgar, I thought)
BEQ 03    
JMP 1A 17 (location for shock in C2)
JMP 1E 17 (location for health in C2)
Done similar in C1 as well. Gave him runic, run out and recruited him for the first time. Selected Runic from the menu and he cast shock... on himself... (yeah still had runic targeting but the purpose was to see if the compare and branch would work). So, perfect test, not really, but it does tell me it didn't branch.

So, other than having two abilities with the same name (hence two temporary abilities combine) and a not working if/then statement... any reason why this couldn't be done to effectively add a whole new command without rewriting the whole page?
 
Quote  

#15
Posts: 763
Threads: 83
Thanks Received: 55
Thanks Given: 7
Joined: Apr 2015
Reputation: 22
Status
Obliviscence
I had a similar idea involving reusing menus like the magitek and lore menus for multiple abilities the same way magitek already differentiates between who's using it. Only instead of judging by character, I would have it look at what menu ability called it in the first place and populate the menu from there. I need to take another long look at all the pointers involved to see where I can save space. I'm sure I will have to move the pointer lists elsewhere to extend them, depending on how many extra abilities I plan to make.
  Find
Quote  

#16
 
Status
None
Ah... I had forgot about Magitek giving Terra a special menu.

In the end though, all that would only buy you a free ability slot or two. Probably would be cleaner and simpler to move the whole list, setting your own limit, in the long run. Course, by cleaner and simpler I mean compared to trying to make all the original commands check, choose, and split. Least it sounds easier when I think it, but as you said, depends on just how many you want to make.

Regardless, keep up with the good news, always nice to hear about success.
 
Quote  

#17
Posts: 81
Threads: 12
Thanks Received: 0
Thanks Given: 0
Joined: Feb 2017
Reputation: 3
Status
Brave
Okay so, if I want to create Cover Spell. I could use these two parts of the code, right?

Code:
Cover effect 0x05 (0A)

C2/6473: A3 05        LDA $05,S
C2/6475: AA           TAX
C2/6476: 5A              PHY
C2/6477: A0 00          LDY #$00
C2/6479: 8A              TXA
C2/647A: D9 6C 33      CMP $336C,Y  (Is this character protected by attacker?)
C2/647D: D0 05          BNE $6484    (Branch if not)
C2/647F: A9 FF          LDA #$FF
C2/6481: 99 6C 33      STA $336C,Y  (Clear who takes damage for this person)
C2/6484: C8              INY
C2/6485: C8              INY
C2/6486: C0 12          CPY #$14     (Have we checked all characters)
C2/6488: 90 EF          BCC $6479    (Branch if not)
C2/648A: 7A              PLY
C2/648B: 98           TYA
C2/648C: 9D 6D 33     STA $336D,X  (Attacker data: save who they're taking damage for)
C2/648F: 8A           TXA
C2/6490: DD 6D 33     CMP $336D,X  (are these the same person?)
C2/6493: D0 06          BNE $649B       (Branch if not)
C2/6495: A9 FF          LDA #$FF
C2/6497: 9D 6D 33      STA $336D,X  (Attacker data: no longer takes damage for anyone)
C2/649A: 60              RTS
C2/649B: 99 6C 33      STA $336C,Y  (Target data: save who takes damage for them)
C2/649E: 60           RTS
Code:
Table for special effects code pointers 1

C2/3DCD: 8C 38
C2/3DCF: 8C 38
C2/3DD1: 8C 38
C2/3DD3: 43 3D ($03)
C2/3DD5: F2 38 ($04)
C2/3DD7: 73 64 ($05) (Cover!)
 
I could then flag Heartburn with not reflectable, cursor moveable, one side only, manual party select, and can't be dodged. Then I'd just need to set it  0 MP Cost, 0 Power, 255 Success rate%, and special effect 05 and rename it "Cover". Then I'd get a spell that lets me target one party member or the whole party. Would this work right?

If I wanted a quick and dirty Command I could change Health to:
Code:
Health

C2/171E: A9 D9        LDA #$D9       (Heart Burn)
C2/1720: 85 B6        STA $B6        (Set spell/animation)
C2/1722: A9 05        LDA #$05
C2/1724: 80 3F        BRA $1765
It would target the whole party but I'm okay with that. Other than changing the animation, am I missing anything?
  Find
Quote  

#18
Posts: 763
Threads: 83
Thanks Received: 55
Thanks Given: 7
Joined: Apr 2015
Reputation: 22
Status
Obliviscence
Maybe? I have to go back and look.

Although, I need to point out I discovered the "Table for special effects code pointers 1" shares its index with "Table for special effects code pointers 2" and there actually are no totally blank effects. Essentially it uses the same index for each list because one is special effect for the whole attack, and the other is a special effect per-hit (or something like that, again, I'd have to refresh). So you need to either replace an effect you don't like, or expand the special effects pointer lists to ensure you aren't screwing with something. I forget what I copied over with Cover, but it was something relatively small. Dig into the disassembly to figure it out.

I apologize for not being more help, considering this is my code, just don't have the time to dig it up ATM.
  Find
Quote  
[-] The following 1 user says Thank You to B-Run for this post:
  • Timbo (04-24-2017)

#19
Posts: 81
Threads: 12
Thanks Received: 0
Thanks Given: 0
Joined: Feb 2017
Reputation: 3
Status
Brave
(04-24-2017, 07:30 AM)B-Run Wrote: Maybe? I have to go back and look.

Although, I need to point out I discovered the "Table for special effects code pointers 1" shares its index with "Table for special effects code pointers 2" and there actually are no totally blank effects. Essentially it uses the same index for each list because one is special effect for the whole attack, and the other is a special effect per-hit (or something like that, again, I'd have to refresh). So you need to either replace an effect you don't like, or expand the special effects pointer lists to ensure you aren't screwing with something. I forget what I copied over with Cover, but it was something relatively small. Dig into the disassembly to figure it out.

I apologize for not being more help, considering this is my code, just don't have the time to dig it up ATM.

05 is Drainer, so that should probably stay. It's easy enough to change it to 0E (Ogre Nix). Now that I've thought about it more, I would prefer to just copy your command exactly rather than waste a precious spell slot on and totally invalidate the use of True Knight. Conceptionally, playing body guard to a single character is better than randomly eating attacks for everyone.  Since I finally just figured out how to properly jump to free space (I know, I suck at this), I no longer need to come up with a weird work around. Thanks for the information B-Run.
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite