private void PerfromBrTemplatePlanning(Direction direction) { BarrelRollAction stubAction = new BarrelRollAction { HostShip = TheShip }; BarrelRollPlanningSubPhase brPlanning = (BarrelRollPlanningSubPhase)Phases.StartTemporarySubPhaseNew( "Select position", typeof(BarrelRollPlanningSubPhase), delegate { FinishTractorBeamMovement(); } ); brPlanning.Name = "Select position"; brPlanning.TheShip = TheShip; brPlanning.IsTemporary = true; brPlanning.Controller = Assigner; brPlanning.HostAction = stubAction; brPlanning.IsTractorBeamBarrelRoll = true; brPlanning.SelectTemplate( new ManeuverTemplate( Movement.ManeuverBearing.Straight, Movement.ManeuverDirection.Forward, Movement.ManeuverSpeed.Speed1, isSideTemplate: TheShip.ShipInfo.BaseSize != BaseSize.Small ), direction ); Phases.UpdateHelpInfo(); brPlanning.PerfromTemplatePlanning(); }
private void PerfromBrTemplatePlanning(ActionsHolder.BarrelRollTemplateVariants template) { BarrelRollAction stubAction = new BarrelRollAction { HostShip = TheShip }; BarrelRollPlanningSubPhase brPlanning = (BarrelRollPlanningSubPhase)Phases.StartTemporarySubPhaseNew( "Select position", typeof(BarrelRollPlanningSubPhase), delegate { FinishTractorBeamMovement(stubAction); } ); brPlanning.Name = "Select position"; brPlanning.TheShip = TheShip; brPlanning.IsTemporary = true; brPlanning.Controller = Assigner; brPlanning.HostAction = stubAction; brPlanning.IsTractorBeamBarrelRoll = true; brPlanning.SelectTemplate(template); Phases.UpdateHelpInfo(); brPlanning.PerfromTemplatePlanning(); }
private void PerformBarrelRollNotAction(object sender, System.EventArgs e) { DecisionSubPhase.ConfirmDecisionNoCallback(); Sounds.PlayShipSound("Ill try spinning - thats a good trick!"); BarrelRollAction brAction = new BarrelRollAction { IsRealAction = false }; HostShip.State.SpendForce( 1, delegate { HostShip.AskPerformFreeAction( brAction, Triggers.FinishTrigger, HostShip.PilotInfo.PilotName, "You must perform Barrel Roll (this is not an action)", HostShip, isForced: true ); } ); }
public void CancelBarrelRoll(List <ActionFailReason> barrelRollProblems) { if (HostAction == null) { HostAction = new BarrelRollAction() { HostShip = TheShip } } ; Rules.Actions.ActionIsFailed(TheShip, HostAction, barrelRollProblems); }