Beispiel #1
0
    public int endReward(PlayerStats tmpPS, string str, bool winGame)
    {
        int   rewardValue = 0;
        float summary     = 0;

        if (monsterExist(str))
        {
            ms      = monster.GetComponent <MonsterStats>();
            summary = tmpPS.getCurrentHP() + ms.getHP();
        }
        else
        {
            summary = tmpPS.getCurrentHP();
        }
        if (winGame)
        {
            while (summary > 0)
            {
                rewardValue++;
                summary -= 10;
            }
        }
        else
        {
            while (summary > 0)
            {
                rewardValue--;
                summary -= 10;
            }
        }
        return(rewardValue);
    }