Third Person Cover Shooter  1.6
CoverShooter.CharacterStamina Class Reference

Maintains character health. More...

Inheritance diagram for CoverShooter.CharacterStamina:
CoverShooter.ICharacterWalkListener CoverShooter.ICharacterHealthListener

Public Member Functions

void OnStop ()
 Character stops. More...
 
void OnWalk ()
 Character is no longer running, stop stamina consumption. More...
 
void OnRun ()
 Character is running, set frame by frame stamina consumption to RunCost. More...
 
void OnSprint ()
 Character is sprinting, set frame by frame stamina consumption to SprintCost. More...
 
void OnDead ()
 Catch the death event and stop stamina regeneration. More...
 
void OnResurrect ()
 Catch the resurrection and set the state as 'not dead', enabling stamina regeneration. More...
 
bool Take (float amount)
 Reduce stamina by the given amount. More...
 

Public Attributes

float Stamina = 100f
 Current health of the character. More...
 
float MaxStamina = 100f
 Max health to regenerate to. More...
 
float Regeneration = 30f
 Amount of health regenerated per second. More...
 
float RunCost = 20
 Stamina consumed per second while running. More...
 
float RunTrigger = 20
 Stamina that has to be regenerated before the ability to run returns. More...
 
float SprintCost = 50
 Stamina consumed per second while running. More...
 
float SprintTrigger = 50
 Stamina that has to be regenerated before the ability to sprint returns. More...
 

Detailed Description

Maintains character health.

Member Function Documentation

◆ OnDead()

void CoverShooter.CharacterStamina.OnDead ( )

Catch the death event and stop stamina regeneration.

Implements CoverShooter.ICharacterHealthListener.

◆ OnResurrect()

void CoverShooter.CharacterStamina.OnResurrect ( )

Catch the resurrection and set the state as 'not dead', enabling stamina regeneration.

Implements CoverShooter.ICharacterHealthListener.

◆ OnRun()

void CoverShooter.CharacterStamina.OnRun ( )

Character is running, set frame by frame stamina consumption to RunCost.

Implements CoverShooter.ICharacterWalkListener.

◆ OnSprint()

void CoverShooter.CharacterStamina.OnSprint ( )

Character is sprinting, set frame by frame stamina consumption to SprintCost.

Implements CoverShooter.ICharacterWalkListener.

◆ OnStop()

void CoverShooter.CharacterStamina.OnStop ( )

◆ OnWalk()

void CoverShooter.CharacterStamina.OnWalk ( )

Character is no longer running, stop stamina consumption.

Implements CoverShooter.ICharacterWalkListener.

◆ Take()

bool CoverShooter.CharacterStamina.Take ( float  amount)

Reduce stamina by the given amount.

If the reduction was possible, return true, signaling that an action can be performed.

Member Data Documentation

◆ MaxStamina

float CoverShooter.CharacterStamina.MaxStamina = 100f

Max health to regenerate to.

◆ Regeneration

float CoverShooter.CharacterStamina.Regeneration = 30f

Amount of health regenerated per second.

◆ RunCost

float CoverShooter.CharacterStamina.RunCost = 20

Stamina consumed per second while running.

◆ RunTrigger

float CoverShooter.CharacterStamina.RunTrigger = 20

Stamina that has to be regenerated before the ability to run returns.

◆ SprintCost

float CoverShooter.CharacterStamina.SprintCost = 50

Stamina consumed per second while running.

◆ SprintTrigger

float CoverShooter.CharacterStamina.SprintTrigger = 50

Stamina that has to be regenerated before the ability to sprint returns.

◆ Stamina

float CoverShooter.CharacterStamina.Stamina = 100f

Current health of the character.


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