public override List <EncounterAction> _DecideNextAction(EncounterState state, Entity parent) { var unit = state.GetUnit(parent.GetComponent <UnitComponent>().UnitId); var unitComponent = parent.GetComponent <UnitComponent>(); if (unit.StandingOrder == UnitOrder.REFORM) { if (state.CurrentTurn < EncounterStateBuilder.ADVANCE_AT_TURN) { if (state.EncounterRand.Next(750) == 0) { parent.GetComponent <PositionComponent>().PlaySpeechBubble(Quips[state.EncounterRand.Next(Quips.Length)]); } } return(AIUtils.ActionsForUnitReform(state, parent, unitComponent.FormationNumber, unit)); } else if (unit.StandingOrder == UnitOrder.ADVANCE) { return(AIUtils.ActionsForUnitAdvanceInLine(state, parent, unit)); } else if (unit.StandingOrder == UnitOrder.ROUT) { return(AIUtils.ActionsForUnitRetreat(state, parent, unit)); } else { throw new NotImplementedException(); } }
public override List <EncounterAction> _DecideNextAction(EncounterState state, Entity parent) { var unit = state.GetUnit(parent.GetComponent <UnitComponent>().UnitId); var unitComponent = parent.GetComponent <UnitComponent>(); if (unit.StandingOrder == UnitOrder.REFORM) { return(AIUtils.ActionsForUnitReform(state, parent, unitComponent.FormationNumber, unit)); } else if (unit.StandingOrder == UnitOrder.ADVANCE) { return(AIUtils.ActionsForUnitAdvanceInLine(state, parent, unit)); } else if (unit.StandingOrder == UnitOrder.ROUT) { return(AIUtils.ActionsForUnitRetreat(state, parent, unit)); } else { throw new NotImplementedException(); } }