Eye of the Nile Docs
Everything you need to know to get started!
Loading...
Searching...
No Matches
GebBossController Class Reference

Detailed Description

This script controls Geb's movement and will triggers Geb's attacks. This script mainly consists of:

  • 6 functions that get called only once when Geb enters a new phase, one for each phase (except for the first one).
  • 7 functions that get called every frame, one for each phase.
  • Other functions to initiate attacks/assist with actions.

Documentation updated 5/3/2025

Author
Alexander Art
Todo
Simplify/split up this script.

Public Member Functions

void GebOpeningCutsceneStarted ()
 Called by GebPhaseController once when the opening cutscene starts.
 
void GebPhase1Started ()
 Called by GebPhaseController once when the opening cutscene is over and the bossfight starts.
 
void GebPhase2Started ()
 Called by GebPhaseController once when phase 2 starts.
 
void GebPhase3Started ()
 Called by GebPhaseController once when phase 3 starts.
 
void GebClosingCutsceneStarted ()
 Called by GebPhaseController once when the closing cutscene starts.
 
void GebDefeated ()
 Called by GebPhaseController once when the closing cutscene finishes.
 
Vector2 GetMinInitialThrowVelocity (float deltaX, float deltaY, float gravity)
 Find the velocity vector with the minimum possible magnitude that can reach a given target location when launching a projectile.
 
Vector2 PredictLocation (Vector2 currentPos, Vector2 currentVel, float gravity, float time)
 Predicts where something will be in a given amount of time based on its current position, velocity, and gravity. Limits are placed that excludes positions out of bounds.
 
GebAction GetCurrentAction ()
 
float GetCurrentActionPercentage ()
 

Protected Attributes

Rigidbody2D rb
 Reference to Geb's Rigidbody 2D.
 
BoxCollider2D bc
 Reference to Geb's Box Collider 2D.
 
Animator animator
 Reference to Geb's animator.
 
PatrolZone bounds
 Reference to the bossroom's Bounds (PatrolZone), which has the left and right ends of the bossroom that Geb must stay in.
 
GebPhaseController phaseController
 Reference to Geb's phase controller.
 
GameObject player
 Reference to the player object.
 
GameObject throwableRock
 Reference to the rock prefab for the rocks that Geb throws and have a chance to turn into a rock golem.
 
GameObject chargeAttackHitbox
 The hitbox that Geb uses during a charge attack to damage the player and destroy walls.
 
GameObject protectiveWall
 Reference to the wall prefab for the walls that Geb summons in phase 2 and 3.
 
GameObject earthquakeZone
 Reference to Geb's earthquake zone object that Geb uses in phase 3.
 
GameObject rockTornado
 Reference to Geb's rock tornado object that Geb uses in phase 3.
 
double minPlayerHeight = 5.879
 Minimum y-position that Geb will attempt to throw rocks at.
 
float bossActivationRadius = 13f
 Radius around the boss that the player must be within for the bossfight to start.
 
int maxAttackChain = 3
 The maximum number of attack actions that can happen in a row.
 
int minAttackChain = -1
 The minimum number of attacks that can happen in a row whenever there has already been at least 1 attack. Values less than or equal to 1 do nothing.
 
int maxNonAttackChain = 3
 The maximum number of non-attack actions that can happen in a row.
 
int minNonAttackChain = 2
 The minimum number of non-attack actions that can happen in a row whenever there has already been at least 1 non-attack. Values less than or equal to 1 do nothing. This can get cut short if an attack is forced. For example, Geb gets stuck on one of his walls and must start a charge attack.
 
float flySpeedX = 15f
 (Phase 1) The speed at which Geb moves horizontally.
 
float walkSpeedX = 5f
 (Phase 2 and 3) The speed at which Geb moves horizontally.
 
float idleDuration = 1f
 (Phase 1, 2, and 3) Each time Geb stops moving (Idle), this is the duration it will last (in seconds).
 
float throwDuration = 1f
 (Phase 1, 2, and 3) The duration of the rock throw animation before the rock entity is spawned (in seconds).
 
float wallSummonDuration = 1f
 (Phase 2 and 3) The amount of time that Geb will spend raising a wall (in seconds).
 
float chargeDuration = 3f
 (Phase 2 and 3) The maximum amount of time that Geb will charge for (in seconds).
 
float windUpPercentage = 4f/9f
 (Phase 2 and 3) The percentage of the charge attack and earthquake durations that Geb will spend animated before the hitbox activates fully.
 
float earthquakeDuration = 5f
 (Phase 3) The amount of time that Geb will quake the ground (in seconds).
 
float tornadoDuration = 3f
 (Phase 3) The amount of time that Geb will surround himself in a protective rock tornado (in seconds).
 
float minPlayerDistanceX = 10f
 (Phase 1, 2, and 3) The minimum horizontal distance that Geb will try to keep from the player when moving.
 
float maxPlayerDistanceX = 20f
 (Phase 1, 2, and 3) The maximum horizontal distance that Geb will try to keep from the player when moving.
 
float chargeSpeed = 18f
 (Phase 2 and 3) The speed at which Geb moves during the charge attack.
 

Private Member Functions

void Awake ()
 Set references to the player's GameObject and Geb's Rigidbody 2D, Box Collider 2D, phase controller, and wall detector.
 
void Start ()
 Calculate the minimum and maximum x position for Geb using the bounds of the bossroom and his collider's width.
 
void Update ()
 Every frame, activate the logic for the current phase Geb is in.
 
void InactiveState ()
 Runs every frame when Geb is inactive.
 
void OpeningCutsceneState ()
 Runs every frame when the opening cutscene is playing.
 
void Phase1State ()
 Runs every frame when Geb is in phase 1. Steps:
 
void Phase2State ()
 Runs every frame when Geb is in phase 2. Steps:
 
void Phase3State ()
 Runs every frame when Geb is in phase 3. Steps:
 
void ClosingCutsceneState ()
 Runs every frame when Geb is defeated and the closing cutscene is playing.
 
void DefeatedState ()
 Runs every frame when the closing cutscene is over.
 
void Phase1StartIdle ()
 Used to initiate the Idle action in phase 1.
 
void Phase1StartMoving ()
 Used to initiate the Moving action in phase 1.
 
void Phase1StartRockThrowAttack ()
 Used to initiate the RockThrowAttack attack in phase 1.
 
void Phase2StartIdle ()
 Used to initiate the Idle action in phase 2.
 
void Phase2StartMoving ()
 Used to initiate the Moving action in phase 2.
 
void Phase2StartRockThrowAttack ()
 Used to initiate the RockThrowAttack attack in phase 2.
 
void Phase2StartWallSummon ()
 Used to initiate the WallSummon attack in phase 2.
 
void Phase2StartChargeAttack ()
 Used to initiate the ChargeAttack attack in phase 2.
 
void Phase3StartIdle ()
 Used to initiate the Idle action in phase 3.
 
void Phase3StartMoving ()
 Used to initiate the Moving action in phase 3.
 
void Phase3StartRockThrowAttack ()
 Used to initiate the RockThrowAttack attack in phase 3.
 
void Phase3StartWallSummon ()
 Used to initiate the WallSummon attack in phase 3.
 
void Phase3StartChargeAttack ()
 Used to initiate the ChargeAttack attack in phase 3.
 
void Phase3StartEarthquake ()
 Used to initiate the Earthquake attack in phase 3.
 
void Phase3StartRockTornado ()
 Used to initiate the RockTornado attack in phase 3.
 
void FacePlayer ()
 
void FlipToFacePlayer ()
 
void ChangeSide ()
 Flip the side variable.
 
void MoveGebInBounds ()
 When this function is called, Geb is moved in bounds if he was out of bounds.
 
void StartMoving ()
 Used to set Geb's current action to Moving and to calculate a new target position for Geb to move towards. Variable "side" is used to determine whether Geb will pick a target position to the left or to the right of the player. This function gets called by the phase-specific action-starting functions. Use those functions instead.
 
void ThrowRock ()
 Summons and launches a rock at Geb's location. The rock is thrown towards the player. This function gets called by the phase-specific action-starting functions. Use those functions instead.
 
void StartWallSummon ()
 Sets Geb's current action to WallSummon and instantiates a wall. This function gets called by the phase-specific action-starting functions. Use those functions instead.
 
void StartChargeAttack ()
 Used in phase 2 and 3 to set Geb's current action to ChargeAttack and pick a direction to move in. This function gets called by the phase-specific action-starting functions. Use those functions instead.
 
void StartRockTornado ()
 Used in phase 3 to start the RockTornado attack. This function gets called by the phase-specific action-starting functions. Use those functions instead.
 

Private Attributes

WallDetectorInfo wallDetector
 Reference to Geb's wall detector.
 
GebAction currentAction
 The current action that Geb is taking.
 
System.Random rng = new System.Random()
 Create random number generator.
 
int attackCount
 The number of times in a row Geb has attacked. Negative values count how many times in a row Geb doesn't attack.
 
float horizontalDirection = 0f
 The direction Geb moves in.
 
float currentActionTimer = 0.0f
 How long Geb has been doing his current action (in seconds).
 
float currentActionDuration
 How long the current action should last (in seconds).
 
float minPosX
 The minimum x position that Geb can have. Calculated using Geb's width and the bounds of the room.
 
float maxPosX
 The maximum x position that Geb can have. Calculated using Geb's width and the bounds of the room.
 
float targetPositionX
 The x position that Geb is moving towards.
 
string side
 Either "LEFT" or "RIGHT", Geb will try to stay on this side of the player in phase 1 when moving. This is done by always picking targetPositionX to be on this side of the player. This also determines which direction Geb faces. Geb always moves backwards in phase 1.
 
Vector3 positionOnDefeat
 Geb's initial position when defeated (when the closing cutscene starts).
 

Member Function Documentation

◆ Awake()

void GebBossController.Awake ( )
private

Set references to the player's GameObject and Geb's Rigidbody 2D, Box Collider 2D, phase controller, and wall detector.

◆ ChangeSide()

void GebBossController.ChangeSide ( )
private

Flip the side variable.

◆ ClosingCutsceneState()

void GebBossController.ClosingCutsceneState ( )
private

Runs every frame when Geb is defeated and the closing cutscene is playing.

◆ DefeatedState()

void GebBossController.DefeatedState ( )
private

Runs every frame when the closing cutscene is over.

◆ FacePlayer()

void GebBossController.FacePlayer ( )
private

◆ FlipToFacePlayer()

void GebBossController.FlipToFacePlayer ( )
private

◆ GebClosingCutsceneStarted()

void GebBossController.GebClosingCutsceneStarted ( )

Called by GebPhaseController once when the closing cutscene starts.

◆ GebDefeated()

void GebBossController.GebDefeated ( )

Called by GebPhaseController once when the closing cutscene finishes.

◆ GebOpeningCutsceneStarted()

void GebBossController.GebOpeningCutsceneStarted ( )

Called by GebPhaseController once when the opening cutscene starts.

◆ GebPhase1Started()

void GebBossController.GebPhase1Started ( )

Called by GebPhaseController once when the opening cutscene is over and the bossfight starts.

◆ GebPhase2Started()

void GebBossController.GebPhase2Started ( )

Called by GebPhaseController once when phase 2 starts.

◆ GebPhase3Started()

void GebBossController.GebPhase3Started ( )

Called by GebPhaseController once when phase 3 starts.

◆ GetCurrentAction()

GebAction GebBossController.GetCurrentAction ( )

◆ GetCurrentActionPercentage()

float GebBossController.GetCurrentActionPercentage ( )

◆ GetMinInitialThrowVelocity()

Vector2 GebBossController.GetMinInitialThrowVelocity ( float deltaX,
float deltaY,
float gravity )

Find the velocity vector with the minimum possible magnitude that can reach a given target location when launching a projectile.

Parameters
deltaXThe x distance to the target location.
deltaYThe y distance to the target location.
gravityThe magnitude of the gravity of the projectile (direction assumed downwards).
Returns
A vector2 that is to be used as the velocity of the projectile.

◆ InactiveState()

void GebBossController.InactiveState ( )
private

Runs every frame when Geb is inactive.

◆ MoveGebInBounds()

void GebBossController.MoveGebInBounds ( )
private

When this function is called, Geb is moved in bounds if he was out of bounds.

◆ OpeningCutsceneState()

void GebBossController.OpeningCutsceneState ( )
private

Runs every frame when the opening cutscene is playing.

◆ Phase1StartIdle()

void GebBossController.Phase1StartIdle ( )
private

Used to initiate the Idle action in phase 1.

◆ Phase1StartMoving()

void GebBossController.Phase1StartMoving ( )
private

Used to initiate the Moving action in phase 1.

Special behavior for when initiating the Moving action from Geb's Idle state.

Special behavior for when initiating the Moving action from Geb's Moving state (itself).

◆ Phase1StartRockThrowAttack()

void GebBossController.Phase1StartRockThrowAttack ( )
private

Used to initiate the RockThrowAttack attack in phase 1.

◆ Phase1State()

void GebBossController.Phase1State ( )
private

Runs every frame when Geb is in phase 1. Steps:

  • Update currentActionTimer.
  • Perform logic depending on Geb's current action.
    • Idle:
      • Don't move.
      • Wait for time to pass. Once the time passes:
        • Start a different action.
    • Moving:
      • Pick a location to move to.
        • This only occurs once, when the action is initiated.
      • Update Geb's x velocity.
      • Check if Geb is against a wall. If he is, then:
        • Cancel the current move action.
        • This functionality probably isn't necessary and can be removed. This is only useful when the player has access to Geb's defensive ability.
      • Check if Geb has gotten within 1 unit of the target position. If he has, then:
        • Check if the player has gotten close to being behind Geb. If so, then Geb has a chance to change direction.
        • Otherwise, start a different action.
    • RockThrowAttack:
      • Don't move.
      • Wait for the rock throwing animation to finish.
      • Once the animation finishes:
        • Instantiate and launch a rock projectile.
        • Start a new action, either idle or throw another rock projectile.
  • Flip Geb to match the "side" variable.
  • Make sure Geb is in bounds.

◆ Phase2StartChargeAttack()

void GebBossController.Phase2StartChargeAttack ( )
private

Used to initiate the ChargeAttack attack in phase 2.

◆ Phase2StartIdle()

void GebBossController.Phase2StartIdle ( )
private

Used to initiate the Idle action in phase 2.

◆ Phase2StartMoving()

void GebBossController.Phase2StartMoving ( )
private

Used to initiate the Moving action in phase 2.

Special behavior for when initiating the Moving action from Geb's Moving state (itself).

◆ Phase2StartRockThrowAttack()

void GebBossController.Phase2StartRockThrowAttack ( )
private

Used to initiate the RockThrowAttack attack in phase 2.

◆ Phase2StartWallSummon()

void GebBossController.Phase2StartWallSummon ( )
private

Used to initiate the WallSummon attack in phase 2.

◆ Phase2State()

void GebBossController.Phase2State ( )
private

Runs every frame when Geb is in phase 2. Steps:

  • Update currentActionTimer.
  • Perform logic depending on Geb's current action.
    • Idle:
      • Don't move.
      • Wait for time to pass. Once the time passes:
        • Start a different action.
    • Moving:
      • Pick a location to move to.
        • This only occurs once, when the action is initiated.
      • Update Geb's x velocity.
      • Check if Geb is against a wall. If he is, then:
        • Start a charge attack.
      • Check if Geb has gotten within 1 unit of the target position. If he has, then:
        • Check if the player has gotten close to being behind Geb. If so, then Geb has a chance to change direction.
        • Otherwise, start a different action.
    • RockThrowAttack:
      • Don't move.
      • Wait for the rock throwing animation to finish.
      • Once the animation finishes:
        • Instantiate and launch a rock projectile.
        • Start a new action, either idle or throw another rock projectile.
    • WallSummon:
      • Spawn a wall object.
        • This only occurs once, when the attack is initiated.
        • The wall itself has its own script.
          • The wall has a spawning animation.
          • For the duration of the wall's life, it has health and can get broken by Geb's charge attack.
            • When the wall breaks/takes damage, it instantiates debris objects that fall and deal damage.
      • Don't move.
      • Animate Geb.
      • Once the animation finishes:
        • Start a different action.
    • ChargeAttack:
      • Pick a direction to charge in.
        • This only occurs once, when the attack is initiated.
        • It is picked in the direction of the player.
      • Geb has a wind up animation before charging forward.
      • Activate a hitbox on Geb that both damages the player and destroys walls.
        • This activation only occurs after the wind up animation is finished.
      • Update Geb's x velocity (after the wind up animation is finished).
      • Check if Geb is close to out of bounds. If he is, then:
        • End the charge attack early.
      • Wait for the duration of the charge attack to finish. Once it does:
        • Disable the damaging hitbox.
        • Start a different action.
  • Flip Geb to match the "side" variable.
    • If a charge attack is active, then Geb will face the side.
    • Otherwise, Geb will face opposite of the side, which is usually inwards (towards the player).
  • Make sure Geb is in bounds.

◆ Phase3StartChargeAttack()

void GebBossController.Phase3StartChargeAttack ( )
private

Used to initiate the ChargeAttack attack in phase 3.

◆ Phase3StartEarthquake()

void GebBossController.Phase3StartEarthquake ( )
private

Used to initiate the Earthquake attack in phase 3.

◆ Phase3StartIdle()

void GebBossController.Phase3StartIdle ( )
private

Used to initiate the Idle action in phase 3.

Special behavior for when initiating the Idle action from Geb's RockTornado state.

◆ Phase3StartMoving()

void GebBossController.Phase3StartMoving ( )
private

Used to initiate the Moving action in phase 3.

Special behavior for when initiating the Moving action from Geb's Moving state (itself).

◆ Phase3StartRockThrowAttack()

void GebBossController.Phase3StartRockThrowAttack ( )
private

Used to initiate the RockThrowAttack attack in phase 3.

◆ Phase3StartRockTornado()

void GebBossController.Phase3StartRockTornado ( )
private

Used to initiate the RockTornado attack in phase 3.

◆ Phase3StartWallSummon()

void GebBossController.Phase3StartWallSummon ( )
private

Used to initiate the WallSummon attack in phase 3.

◆ Phase3State()

void GebBossController.Phase3State ( )
private

Runs every frame when Geb is in phase 3. Steps:

  • Update currentActionTimer.
  • Perform logic depending on Geb's current action.
    • Idle:
      • Don't move.
      • Wait for time to pass. Once the time passes:
        • Start a different action.
    • Moving:
      • Pick a location to move to.
        • This only occurs once, when the action is initiated.
      • Update Geb's x velocity.
      • Check if Geb is against a wall. If he is, then:
        • Start a charge attack or an earthquake attack.
      • Check if Geb has gotten within 1 unit of the target position. If he has, then:
        • Check if the player has gotten close to being behind Geb. If so, then Geb has a chance to change direction.
        • Otherwise, start a different action.
    • RockThrowAttack:
      • Don't move.
      • Wait for the rock throwing animation to finish.
      • Once the animation finishes:
        • Instantiate and launch a rock projectile.
        • Start a new action, either idle or throw another rock projectile.
    • WallSummon:
      • Spawn a wall object.
        • This only occurs once, when the attack is initiated.
        • The wall itself has its own script.
          • The wall has a spawning animation.
          • For the duration of the wall's life, it has health and can get broken by Geb's charge attack.
            • When the wall breaks/takes damage, it instantiates debris objects that fall and deal damage.
      • Don't move.
      • Animate Geb.
      • Once the animation finishes:
        • Start a different action.
    • ChargeAttack:
      • Pick a direction to charge in.
        • This only occurs once, when the attack is initiated.
        • It is picked in the direction of the player.
      • Geb has a wind up animation before charging forward.
      • Activate a hitbox on Geb that both damages the player and destroys walls.
        • This activation only occurs after the wind up animation is finished.
      • Update Geb's x velocity (after the wind up animation is finished).
      • Check if Geb is close to out of bounds. If he is, then:
        • End the charge attack early.
      • Wait for the duration of the charge attack to finish. Once it does:
        • Disable the damaging hitbox.
        • Start a different action.
    • Earthquake:
      • Don't move.
      • Animate Geb.
      • Activate a hitbox on the ground around Geb.
        • The hitbox slows the player down and damages them.
        • This activation only occurs after the wind up duration is over.
      • During this action, GebRoomController does:
        • Summons rocks in the sky that fall like meteors and can damage the player.
      • Wait for the duration of the earthquake attack to finish. Once it does:
        • Disable the earthquake zone hitbox.
        • Start a different action.
    • RockTornado:
      • Don't move.
      • Activate a tornado that surrounds Geb.
        • The tornado damages the player if they get too close.
        • The activation occurs only once, when the attack is initiated.
      • Make Geb invulnerable.
        • This is called only once, when the attack is initiated.
      • Check if the player has gotten behind Geb. If so, then:
        • Make Geb face the player.
      • Wait for the duration of the tornado attack to finish. Once it does:
        • Deactivate the tornado.
        • Reactivate Geb's vulnerability.
        • Start idle action.
  • Flip Geb to match the "side" variable.
    • If a charge attack is active, then Geb will face the side.
    • Otherwise, Geb will face opposite of the side, which is usually inwards (towards the player).
  • Make sure Geb is in bounds.

◆ PredictLocation()

Vector2 GebBossController.PredictLocation ( Vector2 currentPos,
Vector2 currentVel,
float gravity,
float time )

Predicts where something will be in a given amount of time based on its current position, velocity, and gravity. Limits are placed that excludes positions out of bounds.

Parameters
currentPosCurrent position of the entity.
currentVelCurrent velocity of the entity.
gravityMagnitude of gravity on the entity (assumed downwards).
timeNumber of seconds in the future this prediction will be made for.
Returns
A vector2 of the predicted position.

◆ Start()

void GebBossController.Start ( )
private

Calculate the minimum and maximum x position for Geb using the bounds of the bossroom and his collider's width.

◆ StartChargeAttack()

void GebBossController.StartChargeAttack ( )
private

Used in phase 2 and 3 to set Geb's current action to ChargeAttack and pick a direction to move in. This function gets called by the phase-specific action-starting functions. Use those functions instead.

◆ StartMoving()

void GebBossController.StartMoving ( )
private

Used to set Geb's current action to Moving and to calculate a new target position for Geb to move towards. Variable "side" is used to determine whether Geb will pick a target position to the left or to the right of the player. This function gets called by the phase-specific action-starting functions. Use those functions instead.

◆ StartRockTornado()

void GebBossController.StartRockTornado ( )
private

Used in phase 3 to start the RockTornado attack. This function gets called by the phase-specific action-starting functions. Use those functions instead.

◆ StartWallSummon()

void GebBossController.StartWallSummon ( )
private

Sets Geb's current action to WallSummon and instantiates a wall. This function gets called by the phase-specific action-starting functions. Use those functions instead.

◆ ThrowRock()

void GebBossController.ThrowRock ( )
private

Summons and launches a rock at Geb's location. The rock is thrown towards the player. This function gets called by the phase-specific action-starting functions. Use those functions instead.

◆ Update()

void GebBossController.Update ( )
private

Every frame, activate the logic for the current phase Geb is in.

Member Data Documentation

◆ animator

Animator GebBossController.animator
protected

Reference to Geb's animator.

◆ attackCount

int GebBossController.attackCount
private

The number of times in a row Geb has attacked. Negative values count how many times in a row Geb doesn't attack.

◆ bc

BoxCollider2D GebBossController.bc
protected

Reference to Geb's Box Collider 2D.

◆ bossActivationRadius

float GebBossController.bossActivationRadius = 13f
protected

Radius around the boss that the player must be within for the bossfight to start.

◆ bounds

PatrolZone GebBossController.bounds
protected

Reference to the bossroom's Bounds (PatrolZone), which has the left and right ends of the bossroom that Geb must stay in.

◆ chargeAttackHitbox

GameObject GebBossController.chargeAttackHitbox
protected

The hitbox that Geb uses during a charge attack to damage the player and destroy walls.

◆ chargeDuration

float GebBossController.chargeDuration = 3f
protected

(Phase 2 and 3) The maximum amount of time that Geb will charge for (in seconds).

◆ chargeSpeed

float GebBossController.chargeSpeed = 18f
protected

(Phase 2 and 3) The speed at which Geb moves during the charge attack.

◆ currentAction

GebAction GebBossController.currentAction
private

The current action that Geb is taking.

◆ currentActionDuration

float GebBossController.currentActionDuration
private

How long the current action should last (in seconds).

◆ currentActionTimer

float GebBossController.currentActionTimer = 0.0f
private

How long Geb has been doing his current action (in seconds).

◆ earthquakeDuration

float GebBossController.earthquakeDuration = 5f
protected

(Phase 3) The amount of time that Geb will quake the ground (in seconds).

◆ earthquakeZone

GameObject GebBossController.earthquakeZone
protected

Reference to Geb's earthquake zone object that Geb uses in phase 3.

◆ flySpeedX

float GebBossController.flySpeedX = 15f
protected

(Phase 1) The speed at which Geb moves horizontally.

◆ horizontalDirection

float GebBossController.horizontalDirection = 0f
private

The direction Geb moves in.

◆ idleDuration

float GebBossController.idleDuration = 1f
protected

(Phase 1, 2, and 3) Each time Geb stops moving (Idle), this is the duration it will last (in seconds).

◆ maxAttackChain

int GebBossController.maxAttackChain = 3
protected

The maximum number of attack actions that can happen in a row.

◆ maxNonAttackChain

int GebBossController.maxNonAttackChain = 3
protected

The maximum number of non-attack actions that can happen in a row.

◆ maxPlayerDistanceX

float GebBossController.maxPlayerDistanceX = 20f
protected

(Phase 1, 2, and 3) The maximum horizontal distance that Geb will try to keep from the player when moving.

◆ maxPosX

float GebBossController.maxPosX
private

The maximum x position that Geb can have. Calculated using Geb's width and the bounds of the room.

◆ minAttackChain

int GebBossController.minAttackChain = -1
protected

The minimum number of attacks that can happen in a row whenever there has already been at least 1 attack. Values less than or equal to 1 do nothing.

◆ minNonAttackChain

int GebBossController.minNonAttackChain = 2
protected

The minimum number of non-attack actions that can happen in a row whenever there has already been at least 1 non-attack. Values less than or equal to 1 do nothing. This can get cut short if an attack is forced. For example, Geb gets stuck on one of his walls and must start a charge attack.

◆ minPlayerDistanceX

float GebBossController.minPlayerDistanceX = 10f
protected

(Phase 1, 2, and 3) The minimum horizontal distance that Geb will try to keep from the player when moving.

◆ minPlayerHeight

double GebBossController.minPlayerHeight = 5.879
protected

Minimum y-position that Geb will attempt to throw rocks at.

◆ minPosX

float GebBossController.minPosX
private

The minimum x position that Geb can have. Calculated using Geb's width and the bounds of the room.

◆ phaseController

GebPhaseController GebBossController.phaseController
protected

Reference to Geb's phase controller.

◆ player

GameObject GebBossController.player
protected

Reference to the player object.

◆ positionOnDefeat

Vector3 GebBossController.positionOnDefeat
private

Geb's initial position when defeated (when the closing cutscene starts).

◆ protectiveWall

GameObject GebBossController.protectiveWall
protected

Reference to the wall prefab for the walls that Geb summons in phase 2 and 3.

◆ rb

Rigidbody2D GebBossController.rb
protected

Reference to Geb's Rigidbody 2D.

◆ rng

System.Random GebBossController.rng = new System.Random()
private

Create random number generator.

◆ rockTornado

GameObject GebBossController.rockTornado
protected

Reference to Geb's rock tornado object that Geb uses in phase 3.

◆ side

string GebBossController.side
private

Either "LEFT" or "RIGHT", Geb will try to stay on this side of the player in phase 1 when moving. This is done by always picking targetPositionX to be on this side of the player. This also determines which direction Geb faces. Geb always moves backwards in phase 1.

◆ targetPositionX

float GebBossController.targetPositionX
private

The x position that Geb is moving towards.

◆ throwableRock

GameObject GebBossController.throwableRock
protected

Reference to the rock prefab for the rocks that Geb throws and have a chance to turn into a rock golem.

◆ throwDuration

float GebBossController.throwDuration = 1f
protected

(Phase 1, 2, and 3) The duration of the rock throw animation before the rock entity is spawned (in seconds).

◆ tornadoDuration

float GebBossController.tornadoDuration = 3f
protected

(Phase 3) The amount of time that Geb will surround himself in a protective rock tornado (in seconds).

◆ walkSpeedX

float GebBossController.walkSpeedX = 5f
protected

(Phase 2 and 3) The speed at which Geb moves horizontally.

◆ wallDetector

WallDetectorInfo GebBossController.wallDetector
private

Reference to Geb's wall detector.

◆ wallSummonDuration

float GebBossController.wallSummonDuration = 1f
protected

(Phase 2 and 3) The amount of time that Geb will spend raising a wall (in seconds).

◆ windUpPercentage

float GebBossController.windUpPercentage = 4f/9f
protected

(Phase 2 and 3) The percentage of the charge attack and earthquake durations that Geb will spend animated before the hitbox activates fully.


The documentation for this class was generated from the following file: