Skip to navigation

Gameplay: FinishEnemyTactics

Name: FinishEnemyTactics [Show more] Type: Subroutine Category: Gameplay Summary: Stop applying tactics to the current enemy and return to the ProcessGameplay routine to continue with the gameplay loop
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * DrainObjectEnergy calls FinishEnemyTactics * ExpendEnemyEnergy calls FinishEnemyTactics * ScanForMeanieTree calls FinishEnemyTactics
.FinishEnemyTactics LDX gameplayStack \ Restore the stack pointer to the position it was in TXS \ when we called ApplyEnemyTactics from ProcessGameplay, \ so that executing an RTS instruction will now take us \ back to the ProcessGameplay routine, just after the \ JSR ApplyEnemyTactics instruction at play2 JMP MoveOnToNextEnemy \ Jump to MoveOnToNextEnemy to stop applying tactics to \ this enemy and set things up so we move on to the next \ enemy in the next iteration of the gameplay loop