Example #1
0
    protected override float CalculateFinalOpinion()
    {
        //if(GetComponent<Player>().Health <= 0)
        //{
        //  return 0;
        //}

        if (slainEnemies <= 0)
        {
            if (OutPutPairs.ContainsKey("Eliminated enemies"))
            {
                OutPutPairs.Remove("Eliminated enemies");
            }
            return(0);
        }

        actionValue = Mathf.Clamp(actionValue, 0, 1);
        OutPutPairs["Action value"] = actionValue;

        //float slainEnemyPercentage = slainEnemies / roomTotalEnemies;
        //OutPutPairs["Eliminated enemies"] = slainEnemyPercentage * 100 + "%";


        return(actionValue);
    }
Example #2
0
    protected override float CalculateFinalOpinion()
    {
        forcedCombat = Mathf.Clamp(forcedCombat, 0, 1);
        OutPutPairs["ForcedCombat"] = forcedCombat;

        forcedLoot = Mathf.Clamp(forcedLoot, 0, 1);
        OutPutPairs["ForcedLoot"] = forcedLoot;

        float currentHealth = GetComponent <Player>().Health;

        if (currentHealth < HpEnteringRoom)
        {
            hpChange = (1 - (currentHealth / HpEnteringRoom));
            OutPutPairs["HPChange"] = "\n" +
                                      " Enter: " + HpEnteringRoom + "\n" +
                                      " Exit: " + currentHealth + "\n" +
                                      " Change: " + hpChange * 100 + "%";
        }
        else
        {
            if (OutPutPairs.ContainsKey("HPChange"))
            {
                OutPutPairs.Remove("HPChange");
            }
        }

        return((forcedCombat + hpChange + forcedLoot) / 3);
    }