Ejemplo n.º 1
0
        /// <summary>
        ///     Adds $100 to treasury.
        /// </summary>
        //[Command]
        public void CMDCollectMoney(int teamID)
        {
            moneyAudioSource.PlayOneShot(moneyBagClip);


            myTeamID = teamID;
            //*Debug.Log($"CMDCollectMoney has been invoked by {teamID}");
            var updateTeam = (Teams)teamID;

            //*Debug.Log($"{updateTeam.ToString()} I'm {teamID} attempting to CMDCollectMoney");
            switch (updateTeam)
            {
            case Teams.ROBBERS:
                robberMoneyCount.money += IncrementValue;
                Debug.Log($"Increased Robbers Money {robberMoneyCount.money}");
                MoneyDisplay.Instance().UpdateCopsView(robberMoneyCount.money);
                break;

            case Teams.COPS:

                copsMoneyCount.money += IncrementValue;
                Debug.Log($"Increased Cops Money {copsMoneyCount.money}");
                MoneyDisplay.Instance().UpdateRobbersView(copsMoneyCount.money);
                break;
            }
        }
Ejemplo n.º 2
0
    private void Awake()
    {
        maxHealth = INITAL_MAX_HEALTH;
        health    = INITAL_MAX_HEALTH;
        bombCount = INITIAL_BOMBS;
        scanCount = INITIAL_SCANS;

        healthDisplay = GameObject.Find("HUD/PlayerAttributesSection/HealthSection").GetComponent <HealthDisplay>();
        moneyDisplay  = FindObjectOfType <MoneyDisplay>();
        depthDisplay  = FindObjectOfType <DepthDisplay>();
    }
Ejemplo n.º 3
0
    private void Start()
    {
        healthDisplay = FindObjectOfType <HealthDisplay>();
        moneyDisplay  = FindObjectOfType <MoneyDisplay>();
        tm            = FindObjectOfType <TimerManager>();

        hearts = maxHearts;
        LoadDogNames();

        Cursor.visible   = false;
        Cursor.lockState = CursorLockMode.Locked;

        pauseMenu.gameObject.SetActive(false);
        gameOverMenu.gameObject.SetActive(false);
    }
Ejemplo n.º 4
0
        public SpellShopScreen(Game game) : base("Spell Shop")
        {
            this.game      = game;
            Title.Position = new CPos(0, -4096, 0);

            Add(new Button("Resume", "wooden", () => game.ShowScreen(ScreenType.DEFAULT, false))
            {
                Position = new CPos(0, 6144, 0)
            });

            Add(new Panel(new MPos(8 * 1024, 3 * 1024), "wooden")
            {
                Position = new CPos(0, 256, 0)
            });

            money = new MoneyDisplay(game)
            {
                Position = new CPos(Left + 2048, Bottom - 1024, 0)
            };

            var active   = UISpriteManager.Get("UI_activeConnection");
            var inactive = UISpriteManager.Get("UI_inactiveConnection");

            tree = new SpellNode[SpellCasterCache.Types.Count];
            for (int i = 0; i < tree.Length; i++)
            {
                var origin = SpellCasterCache.Types[i];
                var spell  = new SpellNode(origin, game, this)
                {
                    Position = origin.VisualPosition
                };
                spell.CheckAvailability();
                tree[i] = spell;
                foreach (var connection in origin.Before)
                {
                    if (connection == "")
                    {
                        continue;
                    }

                    var target = SpellCasterCache.Types.Find(s => s.InnerName == connection);
                    var line   = new SpellConnection(game, origin, target, active, inactive, 10);
                    lines.Add(line);
                }
            }
        }
Ejemplo n.º 5
0
    public override void OnPointerClick(PointerEventData data)
    {
        Debug.Log($"OnPointerClick called: {gameObject.name}");
        if (gameState.isPickingFirstSuitcase)
        {
            // Select Initial Suitcase Event
            // initialize chosen suitcase with valid number and money amount
            chosenSuitcase.SuitcaseData = suitcaseDisplay.suitcase;
            suitcaseDisplay.gameObject.SetActive(false);
            gameState.isPickingFirstSuitcase = false;
            instructionPanel.GetComponent <InstructionalTextDisplay>().UpdateText();
        }
        else
        {
            // Open Suitcase Event
            if (!gameState.isBankerPresentingAnOffer && !gameState.isGameOver && suitcaseDisplay.transform.Find("Closed").gameObject.activeInHierarchy)
            {
                banker.DecrementSuitcaseCount();
                banker.ReduceTotalMoneyAmount(suitcaseDisplay.suitcase.moneyAmount);
                // reveal money amount suitcase contained
                suitcaseDisplay.transform.Find("Closed").gameObject.SetActive(false);
                ++gameState.currentSuitcasesOpenedCount;
                ++gameState.totalSuitcasesOpened;

                MoneyDisplay scoreDisplay = scoreboardPanel.GetComponent <Scoreboard>().Displays
                                            .FirstOrDefault(display => display.moneyAmount == suitcaseDisplay.suitcase.moneyAmount);
                scoreDisplay.FadeoutDisplay();
            }

            if (!gameState.isBankerPresentingAnOffer && !gameState.isGameOver && GameConstants.casesToOpenPerRound[gameState.currentRoundNumber] <= gameState.currentSuitcasesOpenedCount)
            {
                // Present Banker Offer Event
                gameState.currentBankerOffer        = banker.CalculateOffer(GameConstants.bankerOfferPercentagesPerRound[gameState.currentRoundNumber]);
                gameState.isBankerPresentingAnOffer = true;
                bankerOfferPanel.SetActive(true);
                bankerOfferPanel.GetComponent <BankerOffer>().SetOfferValueText();
                instructionPanel.SetActive(false);
            }
        }
    }
Ejemplo n.º 6
0
        /// <summary>
        ///     Removes $100 from the treasury when a player is respawned
        /// </summary>
        /// <param name="teamID"></param>
        public void SubtractMoney(int teamID)
        {
            //*Debug.Log($"CMDCollectMoney has been invoked by {teamID}");
            var updateTeam = (Teams)teamID;

            //*Debug.Log($"{updateTeam.ToString()} I'm {teamID} attempting to CMDCollectMoney");
            switch (updateTeam)
            {
            case Teams.ROBBERS:
                robberMoneyCount.money -= IncrementValue / 2;
                Debug.Log($"Decreased Robbers Money {robberMoneyCount.money}");
                MoneyDisplay.Instance().UpdateCopsView(robberMoneyCount.money);
                break;

            case Teams.COPS:

                copsMoneyCount.money -= IncrementValue / 2;
                Debug.Log($"Decreased Cops Money {copsMoneyCount.money}");
                MoneyDisplay.Instance().UpdateRobbersView(copsMoneyCount.money);
                break;
            }
        }
 // Use this for initialization
 void Awake()
 {
     Instance = this;
     Money    = GetComponent <Text>();
     UpdateMoney();
 }
Ejemplo n.º 8
0
 private void Awake()
 {
     Instance = this;
 }
Ejemplo n.º 9
0
 private void Start()
 {
     moneyDisplay = FindObjectOfType <MoneyDisplay>();
 }
Ejemplo n.º 10
0
 private void Start()
 {
     CreateDefenderParent();
     moneyDisplay = FindObjectOfType <MoneyDisplay>();
 }