示例#1
0
    public void AddRelic()
    {
        _amountOfRelics++;
        UIHandler.ShowNotification("You currently have <b>" + _amountOfRelics + "/" + Glob.AmountOfRelicsNeededToWin + "</b> relics in your museum.");
        if (_amountOfRelics <= Glob.AmountOfRelicsNeededToWin && _myManager is PlayerCityManager)
        {
            GameInitializer.AddExplorerScore(6);
        }
        if (_amountOfRelics >= Glob.AmountOfRelicsNeededToWin)
        {
            CustomTile targetTile = _tileMap[0, 0];
            foreach (CustomTile tile in _tileMap)
            {
                if (tile.GetBuildingOnTile() is Digsite)
                {
                    targetTile = tile;
                    break;
                }
            }
            GameInitializer.GetCameraManager().MoveCameraTo(targetTile.transform.position + Glob.CameraBuildingOffset, Glob.CameraBuildingZoomTime); //TODO: Zoom in on a digsite
            if (_myManager is PlayerCityManager)
            {
                UIHandler.ShowNotification("Your city is swarmed with tourists, thanks to the " + _amountOfRelics + " relics you found and put in your museum. AIton's city doesn't stand a chance against this massive economical advantage.");
            }
            else
            {
                UIHandler.ShowNotification("AIton's city is swarmed with tourists, thanks to the " + _amountOfRelics + " relics he found and put in his museum. Your city doesn't stand a chance against this massive economical advantage, and thus you are forced to surrender.");
            }

            GameInitializer.EndGame(false, this);
        }
    }
示例#2
0
    public void HandleChoice(int choice)
    {
        Choice chc = _currentEvent.choices[choice];

        effectBox.SetActive(true);
        string repercussionCostText = chc.repercussion.cost.ToString();

        if (chc.repercussion.cost < 0)
        {
            repercussionCostText = "+" + (-chc.repercussion.cost);
        }
        effectText.text = chc.repercussion.description + "\nCost: " + repercussionCostText;

        GameInitializer.GetBuildingHandler().GetCurrentCity().ReceiveCollection(-(chc.cost + chc.repercussion.cost));

        GameInitializer.AddAchieverScore(chc.achieverValue);
        GameInitializer.AddExplorerScore(chc.explorerValue);
        GameInitializer.AddKillerScore(chc.killerValue);
        GameInitializer.AddSocializerScore(chc.socializerValue);
    }