public void UseAp(APUseType actionType) { switch (actionType) { case APUseType.Movement: ActiveTurnState[APUseType.Movement]--; ActiveTurnState[APUseType.TotalAp]--; break; case APUseType.Attack: ActiveTurnState[APUseType.Attack]--; ActiveTurnState[APUseType.TotalAp]--; break; case APUseType.Defend: ActiveTurnState[APUseType.Defend]--; ActiveTurnState[APUseType.TotalAp]--; break; case APUseType.Rotation: //maybe this should be moved since it works by different rules ActiveTurnState[APUseType.Rotation]--; break; default: //e.g. Idle ActiveTurnState[APUseType.TotalAp]--; break; } if (ActiveTurnState[APUseType.TotalAp] <= 0) { TurnState = ActorTurnState.TurnDone; } }
public void StartTurn() { ActiveTurnState[APUseType.TotalAp] = ActionPointAllotment[APUseType.TotalAp]; ActiveTurnState[APUseType.Movement] = ActionPointAllotment[APUseType.Movement]; ActiveTurnState[APUseType.Attack] = ActionPointAllotment[APUseType.Attack]; ActiveTurnState[APUseType.Defend] = ActionPointAllotment[APUseType.Defend]; ActiveTurnState[APUseType.Rotation] = ActionPointAllotment[APUseType.Rotation]; TurnState = ActorTurnState.OnTurn; }