C# Class EnemyBase, Corsair

Inheritance: MonoBehaviour
Show file Open project: Final-Parsec/Corsair Class Usage Examples

Public Properties

Property Type Description
baseHealth int
baseMoneyValue int
damageValue int
healthBarSize Vector2

Protected Properties

Property Type Description
animator Animator
debuffs List
health int

Public Methods

Method Description
ApplyDebuffs ( ) : void

Applies the debuffs to the EnemyBase

Damage ( int damage ) : void

Reduces the damage the enemy takes by it's armor.

DamageOverTime ( int damage, float duration, float interval, StatusEffects status ) : void

Damages the enemy over time. Updates a coroutine that flashes a color over the EnemyBase sprite.

DestroyThis ( ) : IEnumerator

Called when this objects time has come to an end. Spawns a death int with the money the user get, returns enemy to pool, and cleans up references.

DirectDamage ( int damage ) : void

Doesn't take armor into acount.

OnEnable ( ) : void

Called when object is enabled.

ReduceArmor ( int amount, float duration ) : void

Reduces the armor.

ReverseDirection ( float duration ) : void

Makes the enemy move backwards along it's path.

Slow ( float percentage, float duration ) : void

Slows the EnemyBase by a percentage.

Percentage is 0-1 not 0-100

Update ( ) : void

Called once per frame.

Protected Methods

Method Description
AgentChangedNodes ( ) : void

Is called when the Agnet changes Nodes.

AgentReachedDestination ( ) : void

Is called when the Agnet reaches the destination.

InitAttributes ( ) : void

Initializes the attributes.

Private Methods

Method Description
StartOrUpdateCoroutine ( StatusEffects enemyState, float duration ) : void

A helper method that updates or starts the Flash coroutine.

Method Details

AgentChangedNodes() protected method

Is called when the Agnet changes Nodes.
protected AgentChangedNodes ( ) : void
return void

AgentReachedDestination() protected method

Is called when the Agnet reaches the destination.
protected AgentReachedDestination ( ) : void
return void

ApplyDebuffs() public method

Applies the debuffs to the EnemyBase
public ApplyDebuffs ( ) : void
return void

Damage() public method

Reduces the damage the enemy takes by it's armor.
public Damage ( int damage ) : void
damage int Damage inflicted before armor reduction.
return void

DamageOverTime() public method

Damages the enemy over time. Updates a coroutine that flashes a color over the EnemyBase sprite.
public DamageOverTime ( int damage, float duration, float interval, StatusEffects status ) : void
damage int The total damage.
duration float Duration of effect.
interval float The interval to inflict damage.
status StatusEffects The status of the enemy.
return void

DestroyThis() public method

Called when this objects time has come to an end. Spawns a death int with the money the user get, returns enemy to pool, and cleans up references.
public DestroyThis ( ) : IEnumerator
return IEnumerator

DirectDamage() public method

Doesn't take armor into acount.
public DirectDamage ( int damage ) : void
damage int Damage to inclict.
return void

InitAttributes() protected method

Initializes the attributes.
protected InitAttributes ( ) : void
return void

OnEnable() public method

Called when object is enabled.
public OnEnable ( ) : void
return void

ReduceArmor() public method

Reduces the armor.
public ReduceArmor ( int amount, float duration ) : void
amount int Amount to reduce.
duration float Duration of effect.
return void

ReverseDirection() public method

Makes the enemy move backwards along it's path.
public ReverseDirection ( float duration ) : void
duration float Duration of effect.
return void

Slow() public method

Slows the EnemyBase by a percentage.
Percentage is 0-1 not 0-100
public Slow ( float percentage, float duration ) : void
percentage float Percent to slow.
duration float Duration of effect.
return void

Update() public method

Called once per frame.
public Update ( ) : void
return void

Property Details

animator protected property

A reference to the Animator component.
protected Animator animator
return Animator

baseHealth public property

The max posible health of the EnemyBase.
public int baseHealth
return int

baseMoneyValue public property

The money gained by the player before adjusting for wave count and difficulty.
public int baseMoneyValue
return int

damageValue public property

The damage done to the player.
public int damageValue
return int

debuffs protected property

A list of Debuffs that are effecting the EnemyBase.
protected List debuffs
return List

health protected property

The current health of the EnemyBase.
protected int health
return int

healthBarSize public property

The size of the healthbar.
public Vector2 healthBarSize
return Vector2