示例#1
0
        public static void CreateAskBombDropSubPhase(GenericShip ship)
        {
            Selection.ChangeActiveShip("ShipId:" + ship.ShipId);

            BombDecisionSubPhase selectBombToDrop = (BombDecisionSubPhase)Phases.StartTemporarySubPhaseNew(
                "Select bomb to drop",
                typeof(BombDecisionSubPhase),
                CheckSelectedBomb
                );

            foreach (var timedBombInstalled in GetBombsToDrop(Selection.ThisShip))
            {
                selectBombToDrop.AddDecision(
                    timedBombInstalled.UpgradeInfo.Name,
                    delegate { SelectBomb(timedBombInstalled); }
                    );
            }

            selectBombToDrop.AddDecision(
                "None",
                delegate { SelectBomb(null); }
                );

            selectBombToDrop.InfoText = "Select bomb to drop";

            selectBombToDrop.DefaultDecisionName = "None";

            selectBombToDrop.RequiredPlayer = Selection.ThisShip.Owner.PlayerNo;

            selectBombToDrop.Start();
        }
示例#2
0
文件: Bombs.cs 项目: xNyer/FlyCasual
        private static void AskWhatBombToDrop(object sender, EventArgs e)
        {
            Selection.ChangeActiveShip("ShipId:" + (sender as GenericShip).ShipId);

            BombDecisionSubPhase selectBombToDrop = (BombDecisionSubPhase)Phases.StartTemporarySubPhaseNew(
                "Select bomb to drop",
                typeof(BombDecisionSubPhase),
                CheckSelectedBomb
                );

            foreach (var timedBombInstalled in GetTimedBombsInstalled(Selection.ThisShip))
            {
                selectBombToDrop.AddDecision(
                    timedBombInstalled.Name,
                    delegate { SelectBomb(timedBombInstalled); }
                    );
            }

            selectBombToDrop.AddDecision(
                "None",
                delegate { SelectBomb(null); }
                );

            selectBombToDrop.InfoText = "Select bomb to drop";

            selectBombToDrop.DefaultDecisionName = "None";

            selectBombToDrop.RequiredPlayer = Selection.ThisShip.Owner.PlayerNo;

            selectBombToDrop.Start();
        }
示例#3
0
        public static void CreateAskBombDropSubPhase(GenericShip ship, UpgradeSubType subType = UpgradeSubType.None, Type type = null, bool onlyDrop = false)
        {
            Selection.ChangeActiveShip("ShipId:" + ship.ShipId);

            BombDecisionSubPhase selectBombToDrop = (BombDecisionSubPhase)Phases.StartTemporarySubPhaseNew(
                "Select a device to drop",
                typeof(BombDecisionSubPhase),
                delegate { DropSelectedDevice(onlyDrop); }
                );

            selectBombToDrop.DefaultDecisionName = "None";

            foreach (GenericUpgrade deviceInstalled in GetBombsToDrop(Selection.ThisShip, subType, type))
            {
                selectBombToDrop.AddDecision(
                    deviceInstalled.UpgradeInfo.Name,
                    delegate { SelectBomb(deviceInstalled); }
                    );

                if (type != null && deviceInstalled.GetType() == type)
                {
                    selectBombToDrop.DefaultDecisionName = deviceInstalled.UpgradeInfo.Name;
                }
            }

            selectBombToDrop.IsForced = selectBombToDrop.DefaultDecisionName != "None";

            if (CheckBombDropCanBeSkipped())
            {
                selectBombToDrop.AddDecision(
                    "None",
                    delegate { SelectBomb(null); }
                    );
            }

            selectBombToDrop.DescriptionShort = "Select a device to drop";

            selectBombToDrop.RequiredPlayer = Selection.ThisShip.Owner.PlayerNo;

            selectBombToDrop.Start();
        }