private void DoSecondAction(Ship.GenericShip ship) { Host.OnActionDecisionSubphaseEnd -= DoSecondAction; if (!ship.HasToken(typeof(Tokens.StressToken)) || ship.CanPerformActionsWhileStressed) { IsUsed = true; Triggers.RegisterTrigger( new Trigger() { Name = "Push The Limit Action", TriggerOwner = ship.Owner.PlayerNo, TriggerType = TriggerTypes.OnFreeAction, EventHandler = PerformPushAction } ); } }
public void RemoveToken(System.Type type, char letter = ' ', bool recursive = false) { Tokens.GenericToken assignedToken = GetToken(type, letter); if (assignedToken != null) { if (assignedToken.Count > 1) { assignedToken.Count--; if (AfterTokenIsRemoved != null) { AfterTokenIsRemoved(this, type); } if (recursive) { RemoveToken(type, letter, true); } } else { AssignedTokens.Remove(assignedToken); if (AfterTokenIsRemoved != null) { AfterTokenIsRemoved(this, type); } if (assignedToken.GetType().BaseType == typeof(Tokens.GenericTargetLockToken)) { GenericShip otherTokenOwner = (assignedToken as Tokens.GenericTargetLockToken).OtherTokenOwner; Actions.ReleaseTargetLockLetter((assignedToken as Tokens.GenericTargetLockToken).Letter); System.Type oppositeType = (assignedToken.GetType() == typeof(Tokens.BlueTargetLockToken)) ? typeof(Tokens.RedTargetLockToken) : typeof(Tokens.BlueTargetLockToken); if (otherTokenOwner.HasToken(oppositeType, letter)) { otherTokenOwner.RemoveToken(oppositeType, letter); } } } } }