Skip to navigation

Gameplay: ApplyTactics (Part 1 of 8)

Name: ApplyTactics (Part 1 of 8) [Show more] Type: Subroutine Category: Gameplay Summary: Apply tactics to the Sentinel or a sentry
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * ApplyEnemyTactics calls ApplyTactics

Arguments: X The object number of the Sentinel or sentry to which we apply tactics (0 to 7) enemyObject Contains the same as X
.ApplyTactics LDA enemyTacticTimer,X \ If enemyTacticTimer >= 2 for this enemy, then jump to CMP #2 \ MoveOnToNextEnemy to jump to MoveOnToNextEnemy to BCS MoveOnToNextEnemy \ 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 \ If we get here then enemyTacticTimer for this enemy \ has counted down to be less than 2, so it's time to \ apply tactics to the enemy LDA #4 \ Set enemyTacticTimer for the enemy to 4 so by default STA enemyTacticTimer,X \ we wait for 4 * 0.06 = 0.6 seconds before applying \ tactics to the enemy again (though we may change this) LDA #20 \ Set enemyViewingArc = 20, so the enemy's gaze has a STA enemyViewingArc \ viewing arc that's the same width as the screen (as \ the screen is 20 yaw angles across) LDA enemyMeanieTree,X \ Fetch the value of enemyMeanieTree for the enemy we \ are processing, so A contains tells us whether the \ enemy has turned a tree into a meanie BPL tact1 \ If bit 7 of enemyMeanieTree is clear then the enemy \ has turned a tree into a meanie, so jump to part 2 to \ apply tactics to the meanie JMP tact6 \ Bit 7 of enemyMeanieTree is set so the enemy has not \ turned a tree into a meanie, so jump to part 3 to skip \ the meanie tactics routine