Beispiel #1
0
    public virtual int SpendToken(GameProperties.Instrument instrument)
    {
        //cannot spend token on last increased instruments
        if (numTokens == 0)
        {
            return(1);
        }
        else if (skillSet[instrument] == GameProperties.configurableProperties.maximumSkillLevelPerInstrument)
        {
            return(2);
        }

        numTokens--;
        leveledUpInstrument = instrument;
        if (!unchangedSkillSetInstruments.ContainsKey(instrument))
        {
            unchangedSkillSetInstruments[instrument] = skillSet[instrument];
        }
        skillSet[instrument]++;

        GameGlobals.gameLogManager.WriteEventToLog(GameGlobals.currSessionId.ToString(), GameGlobals.currGameId.ToString(), GameGlobals.currGameRoundId.ToString(), this.id.ToString(), this.name, "SPENT_TOKEN", instrument.ToString(), "-");
        return(0);
    }
Beispiel #2
0
 public void SetAlbumContribution(GameProperties.Instrument instrument, int value)
 {
     this.albumContributions[instrument] = value;
     GameGlobals.gameLogManager.WriteEventToLog(GameGlobals.currSessionId.ToString(), GameGlobals.currGameId.ToString(), GameGlobals.currGameRoundId.ToString(), this.id.ToString(), this.name, "INSTRUMENT_VALUE_CHANGED", instrument.ToString(), value.ToString());
 }
Beispiel #3
0
    public int RollDicesForInstrument(Player currPlayer, GameProperties.Instrument instrument)
    {
        var skillSet = currPlayer.GetSkillSet();

        int newAlbumInstrumentValue = 0;
        int numTokensForInstrument  = skillSet[instrument];

        //UI stuff
        UIRollDiceForInstrumentOverlay.transform.Find("title/Text").GetComponent <Text>().text = currPlayer.GetName() + " rolling " + numTokensForInstrument + " dice for " + instrument.ToString() + " ...";

        int[] rolledDiceNumbers = new int[numTokensForInstrument]; //save each rolled dice number to display in the UI

        for (int i = 0; i < numTokensForInstrument; i++)
        {
            int randomIncrease = GameGlobals.gameDiceNG.RollTheDice(currPlayer, instrument, 6, i, numTokensForInstrument);
            rolledDiceNumbers[i]     = randomIncrease;
            newAlbumInstrumentValue += randomIncrease;
        }
        if (!GameProperties.configurableProperties.isSimulation)
        {
            string arrowText = "";
            if (instrument == GameProperties.Instrument.MARKETING)
            {
                arrowText = "+" + newAlbumInstrumentValue * GameProperties.configurableProperties.marketingPointValue + " $";
            }
            else
            {
                arrowText = "+ " + newAlbumInstrumentValue + " Album Value";
            }

            StartCoroutine(PlayDiceUIs(currPlayer, newAlbumInstrumentValue, rolledDiceNumbers, 6, dice6UI, "Animations/RollDiceForInstrumentOverlay/dice6/sprites_3/endingAlternatives/", Color.yellow, arrowText, diceRollDelay));
        }

        GameGlobals.gameLogManager.WriteEventToLog(GameGlobals.currSessionId.ToString(), GameGlobals.currGameId.ToString(), GameGlobals.currGameRoundId.ToString(), currPlayer.GetId().ToString(), currPlayer.GetName().ToString(), "ROLLED_INSTRUMENT_DICES", "-", newAlbumInstrumentValue.ToString());
        return(newAlbumInstrumentValue);
    }