Exemplo n.º 1
0
        private void ContinueUndocking(GenericShip hostShip, GenericShip dockedShip, bool isEmergencyDeploy)
        {
            Roster.UndockShip(dockedShip);
            hostShip.DockedShips.Remove(dockedShip);
            hostShip.ToggleDockedModel(dockedShip, false);
            dockedShip.Model.SetActive(true);

            dockedShip.CallUndocked(hostShip);
            hostShip.CallAnotherShipUndocked(dockedShip);

            if (Editions.Edition.Current is Editions.SecondEdition)
            {
                hostShip.OnSystemsAbilityActivation      -= RegisterAskUndockSE;
                hostShip.OnCheckSystemsAbilityActivation -= CheckUndockAvailability;
            }
            else
            {
                hostShip.OnMovementFinish -= RegisterAskUndockFE;
            }

            hostShip.OnShipIsDestroyed -= CheckForcedUndocking;

            if (!isEmergencyDeploy)
            {
                AskAssignManeuver(hostShip, dockedShip);
            }
            else
            {
                if (Editions.Edition.Current is Editions.FirstEdition)
                {
                    dockedShip.Tokens.AssignToken(typeof(WeaponsDisabledToken), delegate
                    {
                        DealFacedownDamageCard(dockedShip, delegate
                        {
                            AskAssignManeuver(hostShip, dockedShip, true);
                        });
                    });
                }
                else
                {
                    dockedShip.Damage.TryResolveDamage(
                        0,
                        new DamageSourceEventArgs()
                    {
                        Source     = null,
                        DamageType = DamageTypes.Rules
                    },
                        delegate
                    {
                        AskAssignManeuver(hostShip, dockedShip, true);
                    },
                        1
                        );
                }
            }
        }