private void CheckDieResult(DiceRollCheckSubPhase subphase) { GenericToken tokenToAssign = null; if (subphase.CurrentDiceRoll.HasResult(DieSide.Crit) || subphase.CurrentDiceRoll.HasResult(DieSide.Success)) { tokenToAssign = new CalculateToken(HostShip); } else { tokenToAssign = new JamToken(HostShip, HostShip.Owner); } Messages.ShowInfo($"Agent Terex (Cyborg): {HostShip.PilotInfo.PilotName} gains {tokenToAssign.Name}"); HostShip.Tokens.AssignToken( tokenToAssign, delegate { (Phases.CurrentSubPhase as DiceRollCheckSubPhase).HideDiceResultMenu(); Phases.FinishSubPhase(Phases.CurrentSubPhase.GetType()); Triggers.FinishTrigger(); } ); }
private void RegisterJammedDecisionTrigger(GenericShip ship) { JamToken jamToken = (JamToken)ship.Tokens.GetToken(typeof(JamToken)); SubPhases.JammedDecisionSubPhase newPhase = (SubPhases.JammedDecisionSubPhase)Phases.StartTemporarySubPhaseNew( "Jammed", typeof(SubPhases.JammedDecisionSubPhase), Triggers.FinishTrigger ); newPhase.Assigner = jamToken.Assigner; Triggers.RegisterTrigger(new Trigger() { Name = "Jammed!", TriggerType = TriggerTypes.OnTokenIsAssigned, TriggerOwner = (Edition.Current is SecondEdition) ? jamToken.Assigner.PlayerNo: ship.Owner.PlayerNo, EventHandler = delegate { Selection.ActiveShip = ship; newPhase.Start(); } }); }