Users browsing this thread: 1 Guest(s)
They can Dance if they want to!

Posts: 384
Threads: 35
Thanks Received: 11
Thanks Given: 14
Joined: Dec 2018
Reputation: 18
Did you know that monsters completely ignore the Dance status?  How can you use Dance as an attack spell if the monsters do not respect it!

...Well, hey, they can Dance if they want to!

2012D  {2012A in ReCast and probably C.V. Reynolds}
    5C A3 B2 C4        JML $C4B2A3
    EA EA EA EA        NOP #4
    EA EA              NOP #2
4B2A3  {Freespace}
    BD E5 3E           LDA $3EE5,X            [Current Status 2]
    89 30              BIT #$30               [Berserk or Muddled?]
    F0 04              BEQ $04                [Branch if neither]
    5C 34 01 C2        JML $C20134            [If one of them was in play, pick an appropriate action]
    BD F8 3E           LDA $3EF8,X            [Current Status 3]
    89 01              BIT #$01               [ogDance/Panicked?]
    D0 F5              BNE $F5                [Branch if so]
    5C 39 01 C2        JML $C20139            [Else, run normal routine]

    5C E2 B1 C4        JML $C4B1E2
   5A               PHY                      [We need to preserve Y to avoid randomly retargeting]
   A0 04           LDY #$04                 [All monsters share Dance RAM four, $32E5]
   20 9C 05           JSR $059C        [Random Dance, long access for monsters]
   7A               PLY                      [Restore the original Y value]
   6B               RTL                      [Exit]
   EA               NOP
4B1E2  {Freespace]}
    48                 PHA
    BD E5 3E           LDA $3EE5,X            [Status 2]
    89 10              BIT #$10               [Berserk?]
    F0 04              BEQ $04                [Branch if not]
    A9 EE              LDA #$EE               [Load Battle as spell ID]
    83 01              STA $01,S              [Replace the stack value with it]
    BD F8 3E           LDA $3EF8,X            [Status 3]
    89 01              BIT #$01               [Dance?]
    F0 06              BEQ $06                [Branch if not]
    22 69 06 C2        JSL $C20669            [Random Dance, long access]
    83 01              STA $01,S              [Replace the stack value with it.]
    68                 PLA                    [A is either the Muddle selected spell, Fight, or the Dance selected spell]
    5C 72 06 C2        JML $C20672            [Return to normal execution]

Yes, this is raw hex code.  No, I'm not going to set up an assembly file, you can do that with the commands to the right.  It's heavily annotated, you can do it!

This code hooks into the Muddle/Berserk check and adds another check for the Dance bit.  Dancing will supercede being Berserk for monsters; they will use dance attacks instead of fighting if both statuses are present.  This behavior appears consistent with what a player does when both berserk and dancing, though I don't know if other edits in my ROM are contributing to that.  *Shrug*

I have not tested if this makes monsters dance correctly when calling Dance from their battle scripts.  It might make them do more than cast Fire, or it might not.

EDIT: There was an oversight that was causing monsters to target and damage each other while dancing.  This has been corrected by pushing Y and forcing Y to be 4 before running the random dance routine.

Forum Jump:

Users browsing this thread: 1 Guest(s)

Theme by Madsiur2017Custom Graphics by JamesWhite