public void DisPlayDice100Result()
    {
        OutPutResult.text = RandomTimes + "D100 Result : ";
        int DicesResult = 0;

        for (int i = 0; i < RandomTimes; i++)
        {
            int Dice = DiceMath.Dice100();
            DicesResult       += Dice;
            OutPutResult.text += Dice + "  ";
        }

        OutPutResult.text += " = " + DicesResult;
    }
Exemple #2
0
    public void OutputResult_6th()
    {
        int OurSideVal   = int.Parse(OurSideInputField.text);
        int OpposSideVal = int.Parse(OpposSideInputField.text);

        int PassVal = (((OurSideVal - OpposSideVal) * 5) + 50);

        if (PassVal >= 100)
        {
            ResultText.text = "100% Pass, No need to roll dice";
            return;
        }
        else if (PassVal <= 0)
        {
            ResultText.text = "100% fail pass, No need to roll dice";
            return;
        }

        int randomDice = DiceMath.Dice100();

        ResultText.text = "Request Below " + PassVal + "% , Dice Result :  = " + randomDice + "% :" + (randomDice <= PassVal ? "Passed !" : "Not Passed !");
    }
Exemple #3
0
    public void OutputResult()
    {
        string MEReason    = "";
        string THEIRReason = "";


        int OurSideVal   = int.Parse(OurSideInputField.text);
        int OpposSideVal = int.Parse(OpposSideInputField.text);

        int OurRandomResult = 0;

        int METype    = GetDiceType(MEtoggles);
        int THEIRType = GetDiceType(THEIRtoggles);

        if (METype == 0)
        {
            OurRandomResult = DiceMath.Dice100();
        }
        else if (METype == 1)
        {
            int ExtraDice = int.Parse(MEinputField.text == "" ? "0" : MEinputField.text);
            OurRandomResult = DiceRewardResult(ExtraDice, ref MEReason);
        }
        else
        {
            int ExtraDice = int.Parse(MEinputField.text == "" ? "0" : MEinputField.text);
            OurRandomResult = DicePunishmentResult(ExtraDice, ref MEReason);
        }

        int OpposRandomResult = 0;

        if (THEIRType == 0)
        {
            OpposRandomResult = DiceMath.Dice100();
        }
        else if (THEIRType == 1)
        {
            int ExtraDice = int.Parse(THEIRinputField.text == "" ? "0" : THEIRinputField.text);
            OpposRandomResult = DiceRewardResult(ExtraDice, ref THEIRReason);
        }
        else
        {
            int ExtraDice = int.Parse(THEIRinputField.text == "" ? "0" : THEIRinputField.text);
            OpposRandomResult = DicePunishmentResult(ExtraDice, ref THEIRReason);
        }



        DiceMath.DiceLevelEnum OurJudge   = DiceMath.JudgeDice(OurSideVal, OurRandomResult);
        DiceMath.DiceLevelEnum OpposJudge = DiceMath.JudgeDice(OpposSideVal, OpposRandomResult);

        if (OurJudge < OpposJudge)
        {
            ResultText.text = "Dice Result : = " + MEReason + OurJudge + " " + OurRandomResult + " VS " + THEIRReason + OpposJudge + " " + OpposRandomResult + "" + ", Passed !";
            return;
        }
        else if (OurJudge > OpposJudge)
        {
            ResultText.text = "Dice Result : = " + MEReason + OurJudge + " " + OurRandomResult + " VS " + THEIRReason + OpposJudge + " " + OpposRandomResult + ", Not Passed !";

            return;
        }
        else
        {
            if (OurSideVal > OpposSideVal)
            {
                ResultText.text = "Dice Result : = Same DiceLevel, " + MEReason + ": " + OurRandomResult + " VS " + THEIRReason + ": " + OpposRandomResult + ", Passed !";
                return;
            }
            else if (OurSideVal < OpposSideVal)
            {
                ResultText.text = "Dice Result : = Same DiceLevel, " + MEReason + ": " + OurRandomResult + " VS " + THEIRReason + ": " + OpposRandomResult + ", Not Passed !";
                return;
            }
            else
            {
                OutputResult();
            }
        }
    }