Class FightState
It allows teams to play against each other, and obtain a winner based on a victory condition.
Inherited Members
Namespace: AutoBattleFramework.BattleBehaviour.States
Assembly: cs.temp.dll.dll
Syntax
public class FightState : BattleState
Fields
currencyPerWin
If the Team wins, the player obtains one unit of currency.
Declaration
public int currencyPerWin
Field Value
Type | Description |
---|---|
Int32 |
HideCells
Hide the grid cells during the fight.
Declaration
public bool HideCells
Field Value
Type | Description |
---|---|
Boolean |
loseCondition
The lose condition of the fight.
Declaration
public FightState.LoseCondition loseCondition
Field Value
Type | Description |
---|---|
FightState.LoseCondition |
stageFinished
Declaration
protected bool stageFinished
Field Value
Type | Description |
---|---|
Boolean |
winCondition
The win condition of the fight.
Declaration
public FightState.WinCondition winCondition
Field Value
Type | Description |
---|---|
FightState.WinCondition |
Methods
AllowFieldDrag(GameActor)
Do not allow any character drag. Item drag is allowed, so items can be equipped while fighting.
Declaration
public override bool AllowFieldDrag(GameActor actor)
Parameters
Type | Name | Description |
---|---|---|
GameActor | actor | Actor to be dragged. |
Returns
Type | Description |
---|---|
Boolean | True if the actor is an Item. |
Overrides
CharacterAIUpdate(GameCharacter)
Moves the character and allows the attack on an enemy.
Declaration
public override void CharacterAIUpdate(GameCharacter character)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter | character |
Overrides
CheckLoseCondition()
Checks if the lose condition has been fullfiled.
Declaration
public bool CheckLoseCondition()
Returns
Type | Description |
---|---|
Boolean | True if the player loses. |
CheckWinCondition()
Checks if the win condition has been fullfiled.
Declaration
public bool CheckWinCondition()
Returns
Type | Description |
---|---|
Boolean | True if the player wins. |
OnStageStart()
Saves the starting position of all characters.
Declaration
public override void OnStageStart()
Overrides
OnTimerFinish()
When the battle ends, check for the win or lose condition.
Declaration
public override void OnTimerFinish()
Overrides
Update()
Check for win and lose conditions. If one condition is fullfiled, change state.
Declaration
public override void Update()