Example #1
0
    private void SetRollButtonText()
    {
        Investigator active  = App.Model.testModel.testingInvestigator;
        int          val     = active.CheckStat(App.Model.testModel.activeTestStat) + active.CheckMod(App.Model.testModel.activeTestStat);
        int          charMod = App.Model.testModel.currentBonus + App.Model.testModel.currentAdditionalDie;
        int          testMod = App.Model.testModel.activeTestMod;
        int          total   = App.Model.testModel.currentNumRolls;

        string buttonText;

        if (charMod == 0 && testMod == 0)
        {
            buttonText = "Test " + App.Model.testModel.activeTestStat + ": " + total;
        }
        else if (charMod == 0)
        {
            buttonText = "Test " + App.Model.testModel.activeTestStat + ": " + total + " (" + val + " + " + testMod + ")";
        }
        else if (testMod == 0)
        {
            buttonText = "Test " + App.Model.testModel.activeTestStat + ": " + total + " (" + val + " + " + charMod + ")";
        }
        else
        {
            buttonText = "Test " + App.Model.testModel.activeTestStat + ": " + total + " (" + val + " + " + charMod + " + " + testMod + ")";
        }

        rollDiceButtonText.text = buttonText;
    }
Example #2
0
    public void FinishPreTestEvent()
    {
        currentNumRolls  = testingInvestigator.CheckStat(activeTestStat) + testingInvestigator.CheckMod(activeTestStat);
        currentNumRolls += currentBonus;
        currentNumRolls += currentAdditionalDie;
        currentNumRolls += activeTestMod;
        if (currentNumRolls < 1)
        {
            currentNumRolls = 1;
        }

        App.View.testView.StartTest();
    }