Beispiel #1
0
        private void RegisterDealFaceupCrit(int shipId, Type critType)
        {
            GenericShip ship = Roster.AllShips.FirstOrDefault(n => n.Key == "ShipId:" + shipId).Value;

            if (ship != null)
            {
                GenericDamageCard critCard = (GenericDamageCard)System.Activator.CreateInstance(critType);
                DamageDecks.GetDamageDeck(ship.Owner.PlayerNo).PutOnTop(critCard);

                Triggers.RegisterTrigger(new Trigger()
                {
                    Name         = "Console: dead faceup crit card",
                    TriggerType  = TriggerTypes.OnAbilityDirect,
                    TriggerOwner = ship.Owner.PlayerNo,
                    EventHandler = delegate
                    {
                        ship.SufferHullDamage(
                            true,
                            new DamageSourceEventArgs
                        {
                            Source     = "Console",
                            DamageType = DamageTypes.Console
                        }
                            );
                    },
                });

                Triggers.ResolveTriggers(TriggerTypes.OnAbilityDirect, ShowMessage);
            }
            else
            {
                ShowHelp();
            }
        }
Beispiel #2
0
        private void ShowPilotCrits()
        {
            SelectPilotCritDecision selectPilotCritSubphase = (SelectPilotCritDecision)Phases.StartTemporarySubPhaseNew(
                "Select Damage Card",
                typeof(SelectPilotCritDecision),
                Triggers.FinishTrigger
                );

            List <GenericDamageCard> opponentDeck = DamageDecks.GetDamageDeck(Roster.AnotherPlayer(HostShip.Owner.PlayerNo)).Deck;

            foreach (var card in opponentDeck.Where(n => n.Type == CriticalCardType.Pilot))
            {
                Decision existingDecision = selectPilotCritSubphase.GetDecisions().Find(n => n.Name == card.Name);
                if (existingDecision == null)
                {
                    selectPilotCritSubphase.AddDecision(card.Name, delegate { SelectDamageCard(card); }, card.ImageUrl, 1);
                }
                else
                {
                    existingDecision.SetCount(existingDecision.Count + 1);
                }
            }

            selectPilotCritSubphase.DecisionViewType = DecisionViewTypes.ImageButtons;

            selectPilotCritSubphase.DefaultDecisionName = selectPilotCritSubphase.GetDecisions().First().Name;

            selectPilotCritSubphase.InfoText = "Kylo Ren: Select Damage Card";

            selectPilotCritSubphase.RequiredPlayer = HostShip.Owner.PlayerNo;

            selectPilotCritSubphase.Start();
        }
Beispiel #3
0
    private IEnumerator StartGameCoroutine()
    {
        Instance = this;

        SetApplicationParameters();
        InitializeScripts();

        //Global.Initialize();

        Phases.Initialize();
        Rules.Initialize();
        Board.Initialize();
        yield return(Roster.Initialize());

        Selection.Initialize();
        BombsManager.Initialize();
        ActionsHolder.Initialize();
        Combat.Initialize();
        Triggers.Initialize();
        yield return(DamageDecks.Initialize());

        CheckRemoteSettings();

        GameMode.CurrentGameMode.StartBattle();
    }
Beispiel #4
0
        protected void ShowShipCrits()
        {
            SelectShipCritDecision subphase = (SelectShipCritDecision)Phases.StartTemporarySubPhaseNew(
                "Select Damage Card",
                typeof(SelectShipCritDecision),
                Triggers.FinishTrigger
                );

            List <GenericDamageCard> ownDeck = DamageDecks.GetDamageDeck(HostShip.Owner.PlayerNo).Deck;

            foreach (var card in ownDeck.Where(n => n.Type == CriticalCardType.Ship))
            {
                Decision existingDecision = subphase.GetDecisions().Find(n => n.Name == card.Name);
                if (existingDecision == null)
                {
                    subphase.AddDecision(card.Name, delegate { SelectDamageCard(card); }, card.ImageUrl, 1);
                }
                else
                {
                    existingDecision.SetCount(existingDecision.Count + 1);
                }
            }

            subphase.DecisionViewType = DecisionViewTypes.ImagesDamageCard;

            subphase.DefaultDecisionName = subphase.GetDecisions().First().Name;

            subphase.DescriptionShort = "Kaz's Fireball: Select Damage Card";

            subphase.RequiredPlayer = HostShip.Owner.PlayerNo;

            subphase.Start();
        }
Beispiel #5
0
    void Start()
    {
        Instance = this;

        SetApplicationParameters();
        InitializeScripts();

        //Global.Initialize();

        Phases.Initialize();
        Rules.Initialize();
        Board.Initialize();
        Roster.Initialize();
        Selection.Initialize();
        BombsManager.Initialize();
        ActionsHolder.Initialize();
        Combat.Initialize();
        Triggers.Initialize();
        DamageDecks.Initialize();

        AI.Aggressor.NavigationSubSystem.Initialize();

        CheckRemoteSettings();

        GameMode.CurrentGameMode.StartBattle();
    }
Beispiel #6
0
        public override void Execute()
        {
            int      seed     = int.Parse(GetString("seed"));
            PlayerNo playerNo = (PlayerNo)Enum.Parse(typeof(PlayerNo), GetString("player"));

            Console.Write($"Damage deck of Player {Tools.PlayerToInt(playerNo)} is shuffled (Seed: {seed})");

            DamageDecks.GetDamageDeck(playerNo).ShuffleDeck(seed);
        }
        public void SufferHullDamage(bool isFaceup, EventArgs e)
        {
            if (DebugManager.DebugAllDamageIsCrits)
            {
                isFaceup = true;
            }

            DamageDecks.DrawDamageCard(Owner.PlayerNo, isFaceup, ProcessDrawnDamageCard, e);
        }
Beispiel #8
0
 public static void SyncDecks(PlayerNo playerNo, int seed)
 {
     if (IsServer)
     {
         CurrentPlayer.CmdSendCommand
         (
             DamageDecks.GenerateDeckShuffleCommand(playerNo, seed).ToString()
         );
     }
 }
Beispiel #9
0
        protected void SelectDamageCard(GenericDamageCard damageCard)
        {
            Messages.ShowInfo(damageCard.Name + " has been selected");

            DamageDeck ownDeck = DamageDecks.GetDamageDeck(HostShip.Owner.PlayerNo);

            ownDeck.RemoveFromDamageDeck(damageCard);
            ownDeck.ReShuffleDeck();

            Combat.CurrentCriticalHitCard = damageCard;
            HostShip.Damage.DealDrawnCard(DecisionSubPhase.ConfirmDecision);
        }
Beispiel #10
0
        // TODO: Create "Deal facedown card method in ship.Damage"

        private void DealFacedownDamageCard(GenericShip dockedShip, Action callback)
        {
            DamageDecks.GetDamageDeck(dockedShip.Owner.PlayerNo).DrawDamageCard(
                false,
                delegate { DealDrawnCard(dockedShip, callback); },
                new DamageSourceEventArgs
            {
                DamageType = DamageTypes.Rules,
                Source     = null
            }
                );
        }
Beispiel #11
0
 private void DecksContent()
 {
     Console.Write("Player1 Deck:", LogTypes.Everything, true, "green");
     foreach (var card in DamageDecks.GetDamageDeck(Players.PlayerNo.Player1).Deck)
     {
         Console.Write(card.Name, LogTypes.Everything, false, "green");
     }
     Console.Write("Player2 Deck:", LogTypes.Everything, true, "green");
     foreach (var card in DamageDecks.GetDamageDeck(Players.PlayerNo.Player2).Deck)
     {
         Console.Write(card.Name, LogTypes.Everything, false, "green");
     }
 }
Beispiel #12
0
        private void SelectDamageCard(GenericDamageCard damageCard)
        {
            Messages.ShowInfo("Card selected: " + damageCard.Name);

            AssignedDamageCard          = damageCard;
            AssignedDamageCard.IsFaceup = true;
            DamageDeck opponentDamageDeck = DamageDecks.GetDamageDeck(TargetShip.Owner.PlayerNo);

            opponentDamageDeck.RemoveFromDamageDeck(damageCard);
            opponentDamageDeck.ReShuffleDeck();
            AssignConditions(TargetShip);

            DecisionSubPhase.ConfirmDecision();
        }
Beispiel #13
0
        private void AdditionalDamageOnItself()
        {
            Combat.Defender.Tokens.RemoveCondition(typeof(Conditions.Harpooned));
            UnsubscribeFromHarpoonedConditionEffects(Combat.Defender);

            DamageDecks.GetDamageDeck(Combat.Defender.Owner.PlayerNo).DrawDamageCard(
                false,
                DealDrawnCard,
                new DamageSourceEventArgs {
                DamageType = DamageTypes.Rules,
                Source     = null
            }
                );
        }
Beispiel #14
0
        protected void SelectDamageCard(GenericDamageCard damageCard)
        {
            Messages.ShowInfo(damageCard.Name + " has been selected");

            AssignedDamageCard          = damageCard;
            AssignedDamageCard.IsFaceup = true;
            DamageDeck opponentDamageDeck = DamageDecks.GetDamageDeck(Combat.Attacker.Owner.PlayerNo);

            opponentDamageDeck.RemoveFromDamageDeck(damageCard);
            opponentDamageDeck.ReShuffleDeck();
            AssignConditions(Combat.Attacker);

            DecisionSubPhase.ConfirmDecision();
        }
Beispiel #15
0
        private void ShowDecks()
        {
            Console.Write("\nPlayer1 Deck:", true, "green");
            foreach (var card in DamageDecks.GetDamageDeck(Players.PlayerNo.Player1).Deck)
            {
                Console.Write(card.Name, false, "green");
            }

            Console.Write("\nPlayer2 Deck:", true, "green");
            foreach (var card in DamageDecks.GetDamageDeck(Players.PlayerNo.Player2).Deck)
            {
                Console.Write(card.Name, false, "green");
            }
        }
Beispiel #16
0
        private void AdditionalDamageOnItself()
        {
            Host.Tokens.RemoveCondition(this);

            DamageDecks.GetDamageDeck(Host.Owner.PlayerNo).DrawDamageCard(
                false,
                DealDrawnCard,
                new DamageSourceEventArgs
            {
                DamageType = DamageTypes.Rules,
                Source     = null
            }
                );
        }
Beispiel #17
0
        private void SyncDamageDeckSeed(PlayerNo playerNo, int seed)
        {
            // TODO: Move to player types

            if (ReplaysManager.Mode == ReplaysMode.Write)
            {
                GameController.SendCommand
                (
                    DamageDecks.GenerateDeckShuffleCommand(playerNo, seed)
                );
            }
            else if (ReplaysManager.Mode == ReplaysMode.Read)
            {
                // GameController.WaitForCommand();
            }
        }
Beispiel #18
0
        private void SelectDamageCard(GenericDamageCard damageCard)
        {
            DecisionSubPhase.ConfirmDecisionNoCallback();

            Messages.ShowInfo("Kylo Ren selected  " + damageCard.Name);

            AssignedDamageCard          = damageCard;
            AssignedDamageCard.IsFaceup = true;
            DamageDeck opponentDamageDeck = DamageDecks.GetDamageDeck(TargetShip.Owner.PlayerNo);

            opponentDamageDeck.RemoveFromDamageDeck(damageCard);
            opponentDamageDeck.ReShuffleDeck();
            AssignConditions(TargetShip);

            SpendExtra(Triggers.FinishTrigger);
        }
    void Start()
    {
        SetApplicationParameters();
        InitializeScripts();

        //Global.Initialize();

        Board.BoardManager.Initialize();
        Roster.Initialize();
        Roster.Start();
        Selection.Initialize();
        Bombs.BombsManager.Initialize();
        Actions.Initialize();
        Combat.Initialize();
        Triggers.Initialize();
        DamageDecks.Initialize();

        CheckRemoteSettings();

        GameMode.CurrentGameMode.StartBattle();
    }
Beispiel #20
0
        public override void PrepareDecision(Action callBack)
        {
            DescriptionLong = "Select Critical Hit card to deal";

            criticalHitCardsToChoose.Add(Combat.CurrentCriticalHitCard);
            for (int i = 0; i < 2; i++)
            {
                DamageDecks.GetDamageDeck(Combat.Attacker.Owner.PlayerNo).DrawDamageCard(
                    true,
                    AddToCriticalHitCardsToChoose,
                    new DamageSourceEventArgs()
                {
                    Source     = Combat.Attacker,
                    DamageType = DamageTypes.ShipAttack
                },
                    delegate { }
                    );
            }

            foreach (var critCard in criticalHitCardsToChoose)
            {
                AddDecision(
                    critCard.Name,
                    delegate { DealCard(critCard); }
                    );
                AddTooltip(
                    critCard.Name,
                    critCard.ImageUrl
                    );
            }

            DefaultDecisionName = Combat.CurrentCriticalHitCard.Name;

            DecisionViewType = DecisionViewTypes.ImagesDamageCard;

            callBack();
        }
Beispiel #21
0
 public override void Execute()
 {
     GameController.ConfirmCommand();
     DamageDecks.GetDamageDeck((PlayerNo)Enum.Parse(typeof(PlayerNo), GetString("player"))).ShuffleDeck(int.Parse(GetString("seed")));
 }
 private void RpcSyncDecks(int playerNo, int seed)
 {
     DamageDecks.GetDamageDeck(Tools.IntToPlayer(playerNo)).ShuffleDeck(seed);
 }
Beispiel #23
0
 public override void Execute()
 {
     DamageDecks.GetDamageDeck((PlayerNo)Enum.Parse(typeof(PlayerNo), GetString("player"))).ShuffleDeck(int.Parse(GetString("seed")));
 }
Beispiel #24
0
 public override void GenerateDamageDeck(PlayerNo playerNo, int seed)
 {
     DamageDecks.GetDamageDeck(playerNo).ShuffleDeck(seed);
 }