Prev: 53587 Up: Map Next: 53693
53676: Script Routine: (64) Vat shift right when clear above
Probe above with Test_EntityAbove. On a clear miss (carry set) jump to ScriptRoutine_VatIncXIfClearAbove_IncX to shift the vat right, then drop Y at ScriptRoutine_VatDecY. On a hit, if the distance in A is still under 50 continue into that same nudge; otherwise jump straight to ScriptRoutine_VatDecY to drop Y only.
Input
IX Address of complex state data for an entity
Probe above; carry set = miss (path clear).
ScriptRoutine_VatIncXIfClearAbove 53676 CALL Test_EntityAbove Call Test_EntityAbove to test whether a solid entity sits above this vat.
53679 JR C,ScriptRoutine_VatIncXIfClearAbove_IncX Was the space above clear (carry set)? If so, jump to ScriptRoutine_VatIncXIfClearAbove_IncX to shift right.
53681 CP 50 On a hit: is the distance in A still under 50? If not, jump to ScriptRoutine_VatDecY to drop Y only (skip the nudge).
53683 JR NC,ScriptRoutine_VatDecY
Shift right (reached by jump on miss, or when A<50 on a hit), then drop Y.
ScriptRoutine_VatIncXIfClearAbove_IncX 53685 INC (IX+7) Move the vat one character right.
53688 INC (IX+8)
53691 JR ScriptRoutine_VatDecY Jump to ScriptRoutine_VatDecY to decrease y / y-extent.
Prev: 53587 Up: Map Next: 53693