Snake's Pit of ASM (and Other Stuff)

Stairs
This is another custom location event that allows you to take a staircase to a connecting end.
I suppose you could change the text and make it something like “Teleport” but sshhhhh.

Features:

After taking the stairs, units may finish their turn.
Units have as much movement after taking the stairs as they would to finish their turn
This is reset with any action taken to end the turn or when using the "End" turn button.
Units may not use this command twice in one turn.
A unit may not use the staircase if a unit is on the connecting end.
Staircase ends are definded in location events.

How to: Teach units how to not be befuddled by staircases.

Firstly, add the “Stairs” folder to your project and #include "Stairs/Stairs.event".
Find it all in my master dropbox folder at the top of the thread.
If you are using the Skill System, just uncomment the installer in _MasterHackInstaller.event, and the addition to the unit menu will be handled automatically.

Great. Also, be sure in your text assembler that you have this somewhere:

## StairsNameText
Stairs[X]

## StairsDescText
Take this staircase to[NL]
the connecting end.[X]

## StairsBlockedText
The staircase is blocked[NL]
from the other side.[X]

(Feel free to change these as you wish.)

Lastly, you need to know how to use them in events. They’re not linked to the stair tiles, they’re location events.

#define Stairs(StairID,X1,Y1,X2,Y2) "LOCA StairID [X1,Y1] 0x22 ; LOCA StairID [X2,Y2] 0x22"

Just use the Stairs macro under LocationBasedEvents where (X1,Y1) are the coordinates of one end of the staircase and where (X2,Y2) are the coordinates of the other end. StairID is the ID of this staircase. Never reuse IDs between multiple staircases!

That’s it!

Have a nice day, and please report any bugs you find!

Wizard's Warning

This uses byte 0x3A of the character struct to hold the temporary movement debuff after the stairs are used. This will interfere with other patches that use byte.
EDIT: This can now be changed in the Stairs.event installer. Feel free to change that byte to any other free byte of the character struct.

11 Likes