private void ActivateEffect(GenericDualUpgrade upgrade) { if (upgrade == HostUpgrade) { HostShip.State.AddPilotSkillModifier(this); } }
public void CallOnAfterDualUpgradeSideSelected(GenericDualUpgrade upgrade) { if (OnAfterDualCardSideSelected != null) { OnAfterDualCardSideSelected(upgrade); } }
private void FlipConfiguration(GenericShip ship, Action callback) { ship.Tokens.AssignToken ( typeof(Tokens.StrainToken), delegate { GenericDualUpgrade dualUpgrade = ship.UpgradeBar.GetInstalledUpgrade(UpgradeType.Configuration) as GenericDualUpgrade; if (dualUpgrade != null) { dualUpgrade.Flip(); ship.Tokens.AssignToken ( typeof(Tokens.CalculateToken), callback ); } else { Messages.ShowError("Error: No configuration to flip"); callback(); } } ); }
private void SelectSide(GenericDualUpgrade newUpgradeSide) { if (Upgrade.GetType() != newUpgradeSide.GetType()) { Upgrade.Flip(); } DecisionSubPhase.ConfirmDecision(); }
private void SelectSide(GenericDualUpgrade newUpgradeSide) { if (Upgrade.GetType() != newUpgradeSide.GetType()) { Upgrade.Flip((otherSide) => otherSide.Host.CallOnAfterDualUpgradeSideSelected(otherSide)); } else { Upgrade.Host.CallOnAfterDualUpgradeSideSelected(Upgrade); } DecisionSubPhase.ConfirmDecision(); }
public override void PrepareDecision(Action callBack) { InfoText = "Select side of Dual Card"; foreach (var type in UpgradeTypes) { GenericDualUpgrade upgradeSide = (GenericDualUpgrade)Activator.CreateInstance(type); AddDecision( upgradeSide.Name, delegate { SelectSide(upgradeSide); }, upgradeSide.ImageUrl ); } DefaultDecisionName = GetDecisions().First().Name; DecisionViewType = DecisionViewTypes.ImageButtons; DecisionOwner = Upgrade.Host.Owner; callBack(); }
public override void PrepareDecision(Action callBack) { DescriptionShort = "Select side of Dual Card"; foreach (var type in UpgradeTypes) { GenericDualUpgrade upgradeSide = (GenericDualUpgrade)Activator.CreateInstance(type); Edition.Current.AdaptUpgradeToRules(upgradeSide); AddDecision( upgradeSide.UpgradeInfo.Name, delegate { SelectSide(upgradeSide); }, upgradeSide.ImageUrl ); } DefaultDecisionName = GetDecisions().First().Name; DecisionViewType = DecisionViewTypes.ImagesUpgrade; DecisionOwner = Upgrade.HostShip.Owner; callBack(); }