Esempio n. 1
0
 private void ActivateEffect(GenericDualUpgrade upgrade)
 {
     if (upgrade == HostUpgrade)
     {
         HostShip.State.AddPilotSkillModifier(this);
     }
 }
Esempio n. 2
0
 public void CallOnAfterDualUpgradeSideSelected(GenericDualUpgrade upgrade)
 {
     if (OnAfterDualCardSideSelected != null)
     {
         OnAfterDualCardSideSelected(upgrade);
     }
 }
Esempio n. 3
0
 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();
         }
     }
     );
 }
Esempio n. 4
0
 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();
        }
Esempio n. 6
0
        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();
        }
Esempio n. 7
0
        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();
        }