コード例 #1
0
        public void EndTurn()
        {
            Debug.Log("Ending Turn");

            TileGrid.RemoveFadeTiles();

            var income = TileGrid.GetIncome();

            People += income.People;
            Money += income.Money;
            Not += income.Not;
            Inf += income.Inf;

            PreviousIncome = income;

            if (CurrentTurnNumber == PaymentTurn)
            {
                Debug.Log(Souls + " of " + SoulsRequired + " Souls");
                if (Souls >= SoulsRequired)
                {
                    Souls -= SoulsRequired;
                    SoulsRequired *= 2;
                    PaymentTurn += 10;
                }
                else
                {
                    EndOfGameObject.SetActive(true);
                }
            }

            CurrentTurnNumber++;
            Debug.Log("Turn " + CurrentTurnNumber + " of " + PaymentTurn);

            var tiles = GetPurchasableTileInformation();

            // Call all of the OnStartTurn on all of the tiles.
            foreach (var tile in TileGrid.TileList)
            {
                if (tile.TileInformation.OnTurnStart != null)
                {
                    tile.TileInformation.OnTurnStart.Action(this, TileGrid, tile.TileInformation);
                }
            }

            PurchasableTile1.TileInformation = tiles[0];
            PurchasableTile2.TileInformation = tiles[1];
            PurchasableTile3.TileInformation = tiles[2];

            PurchasableTile1.TileInformation.CanPurchase = true;
            PurchasableTile2.TileInformation.CanPurchase = true;
            PurchasableTile3.TileInformation.CanPurchase = true;

            PurchasableTile1.gameObject.SetActive(true);
            PurchasableTile2.gameObject.SetActive(true);
            PurchasableTile3.gameObject.SetActive(true);

            TileGrid.NextTurn();
        }
コード例 #2
0
ファイル: Income.cs プロジェクト: ThomasHEaton/RitualJam
        public static Income operator -(Income i1, Income i2)
        {
            var finalIncome = new Income
            {
                Soul = i1.Soul - i2.Soul,

                People = i1.People - i2.People,
                Money = i1.Money - i2.Money,
                Not = i1.Not - i2.Not,
                Inf = i1.Inf - i2.Inf
            };

            return finalIncome;
        }
コード例 #3
0
        public void OnTileAdded(TileInformation tileInformation)
        {
            CanEndTurn = true;

            PurchasableTile1.gameObject.SetActive(false);
            PurchasableTile2.gameObject.SetActive(false);
            PurchasableTile3.gameObject.SetActive(false);

            foreach (var tile in TileGrid.TileList)
            {
                if (tile.TileInformation.OnPlacement != null)
                {
                    tile.TileInformation.OnPlacement.Action(this, TileGrid, tileInformation);
                }
                
            }

            var income = TileGrid.GetIncome();
            PreviousIncome = income;
        }