News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

[SM] Using door ASM to kill Croccomire.

Started by dewhi100, June 20, 2017, 01:57:35 PM

Previous topic - Next topic

dewhi100

Leaving Crocco's room before the battle is over will restart it, which is allowed in SM: Unambitious but is perhaps a little unfair. A gray shield would prevent this, but I have a different preference if possible. I know there is a "door ASM" pointer in the room mdb... Maybe this is only for setting scrolls, but using it to kill Croccomire would be cool if possible. Ideally, it would not end the fight completely but instead get the skeleton to jump out from the spoke wall. But just setting Crocco as defeated might be simpler/more feasible. I've never tried tinkering with door ASM... What do I do/how does it work?

Scyzer


LoROM

org $A48A76 : JSL CrocCheck
org $A4907C : JMP UpdatePosX
org $A49842 : JSR UpdatePosY
org $A4F6C0
CrocCheck:
LDA $0B1E : BEQ + : CMP #$0080 : BPL ++
LDA $0B1C : STA $0F7A
+ LDA $7ED828,X : RTL
++ LDA #$FFFF : RTL
UpdatePosX: LDA $0F7A : STA $0B1C : PLY : PLX : RTL
UpdatePosY: STA $0F7E : STA $0B1E : RTS


This makes it so Croc remembers where he is in the room even if you leave and return later. If you leave after he has fallen into the acid but before watching him break the spike wall, he'll be dead when you come back.

dewhi100

Cool sorcery. Can you explain how it works?

Scyzer

It just saves Croc's X and Y positions in the room, which is updated each time he takes a step. When the room loads, it checks the saved values and moves Croc accordingly. If the values are zero, then Croc hasn't moved at all, so it just loads in the normal position. If the Y value is over $0080, then it means Croc has fallen into acid, so it just jumps to the code that spawns croc already dead in the room.
Simple.