private void Mimicked(GenericShip targetShip) { bool abilityIsFound = false; foreach (var ability in targetShip.PilotAbilities) { if (!ability.IsAppliesConditionCard) { Messages.ShowInfo("Ability of " + targetShip.PilotName + " is mimicked"); HostShip.PilotAbilities.Add((GenericAbility)Activator.CreateInstance(ability.GetType())); HostShip.PilotAbilities[1].Initialize(HostShip); abilityIsFound = true; break; } } if (!abilityIsFound) { Messages.ShowError(targetShip.PilotName + " doesn't have abilities to be mimicked"); } targetShip.AssignToken(new Conditions.Mimicked(), delegate { }); SubPhases.DecisionSubPhase.ConfirmDecision(); }
private void Shadowed(GenericShip targetShip) { Messages.ShowInfo("Pilot skill of " + targetShip.PilotName + " is shadowed"); new ThweekPilotSkillModifier(HostShip, targetShip.PilotSkill); targetShip.AssignToken(new Conditions.Shadowed(), delegate { }); SubPhases.DecisionSubPhase.ConfirmDecision(); }
private void AssignStressTokenRecursive() { if (shipsToAssignStress.Count > 0) { GenericShip shipToAssignStress = shipsToAssignStress[0]; shipsToAssignStress.Remove(shipToAssignStress); Messages.ShowErrorToHuman(shipToAssignStress.PilotName + " is bumped into \"Chopper\" and gets Stress"); shipToAssignStress.AssignToken(new Tokens.StressToken(), AssignStressTokenRecursive); } else { Triggers.FinishTrigger(); } }
public static void AssignTargetLockToPair(GenericShip thisShip, GenericShip targetShip, Action successCallback, Action failureCallback) { if (Letters.Count == 0) { InitializeTargetLockLetters(); } ShipDistanceInformation distanceInfo = new ShipDistanceInformation(thisShip, targetShip); if (distanceInfo.Range >= thisShip.TargetLockMinRange && distanceInfo.Range <= thisShip.TargetLockMaxRange) { Tokens.GenericToken existingBlueToken = thisShip.GetToken(typeof(Tokens.BlueTargetLockToken), '*'); if (existingBlueToken != null) { thisShip.RemoveToken(typeof(Tokens.BlueTargetLockToken), (existingBlueToken as Tokens.BlueTargetLockToken).Letter); } Tokens.BlueTargetLockToken tokenBlue = new Tokens.BlueTargetLockToken(); Tokens.RedTargetLockToken tokenRed = new Tokens.RedTargetLockToken(); char letter = GetFreeTargetLockLetter(); tokenBlue.Letter = letter; tokenBlue.OtherTokenOwner = targetShip; tokenRed.Letter = letter; tokenRed.OtherTokenOwner = Selection.ThisShip; TakeTargetLockLetter(letter); targetShip.AssignToken( tokenRed, delegate { thisShip.AssignToken(tokenBlue, successCallback); }); } else { Messages.ShowErrorToHuman("Target is out of range of Target Lock"); failureCallback(); } }
public override void ExplosionEffect(GenericShip ship, Action callBack) { ship.AssignedDamageDiceroll.AddDice(DieSide.Success); Triggers.RegisterTrigger(new Trigger() { Name = "Suffer damage from bomb", TriggerType = TriggerTypes.OnDamageIsDealt, TriggerOwner = ship.Owner.PlayerNo, EventHandler = ship.SufferDamage, EventArgs = new DamageSourceEventArgs() { Source = this, DamageType = DamageTypes.BombDetonation } }); Triggers.ResolveTriggers( TriggerTypes.OnDamageIsDealt, delegate { ship.AssignToken(new Tokens.StressToken(), callBack); } ); }