示例#1
0
    void InitAppraisalStatus()
    {
        //Hope to get into store
        appraisal.AddGoal("sales", 0.3f, AppDef.Pleased, AppDef.ConsequenceForSelf, AppDef.ProspectRelevant, AppDef.Unconfirmed);

        //Standard about other shoppers
        //     if (affectComponent.personality[(int)OCEAN.N] > 0f)  //if neurotic feel jealousy
        //       appraisal.AddStandard(0.3f, AppDef.Disapproving, AppDef.FocusingOnOther, transform.parent.gameObject);	//shoppers in general --no specific shopper
        //Attitude towards objects in the store
        appraisal.AddAttitude(null, 0.5f, AppDef.Liking); //General liking
    }
示例#2
0
    void InitAppraisalStatus()
    {
        //General distress
        appraisal.AddGoal("fight", 0.2f, AppDef.Displeased, AppDef.ConsequenceForSelf, AppDef.ProspectIrrelevant);

        //Fear of losing
        appraisal.AddGoal("fight", 0.1f, AppDef.Displeased, AppDef.ConsequenceForSelf, AppDef.ProspectRelevant, AppDef.Unconfirmed);

        //Hope to win
        appraisal.AddGoal("fight", 0.1f, AppDef.Pleased, AppDef.ConsequenceForSelf, AppDef.ProspectRelevant, AppDef.Unconfirmed);

        //about opponent
        appraisal.AddStandard(0.8f, AppDef.Disapproving, AppDef.FocusingOnOther, opponent);
    }
示例#3
0
    void InitAppraisalStatus()
    {
        //Distress
        appraisal.AddGoal("protest", 0.2f, AppDef.Displeased, AppDef.ConsequenceForSelf, AppDef.ProspectIrrelevant);
        //Standard about police
        if (affectComponent.personality[(int)OCEAN.C] < 0f)
        {
            PoliceBehavior[] policeComponents = FindObjectsOfType(typeof(PoliceBehavior)) as PoliceBehavior[];
            if (policeComponents.Length > 0)
            {
                appraisal.AddStandard(0.5f, AppDef.Disapproving, AppDef.FocusingOnOther, policeComponents[0].transform.parent.gameObject);              //police in general --no specific police
            }
        }

        //About other protesters in the same group as me
        appraisal.AddStandard(0.35f, AppDef.Approving, AppDef.FocusingOnOther, transform.parent.gameObject);

        //About myself
        appraisal.AddStandard(0.35f, AppDef.Approving, AppDef.FocusingOnSelf);
    }
示例#4
0
    void Update()
    {
        const float fearThreshold = 0.1f;

        if (agentComponent.IsDead())
        {
            Destroy(GetComponent <ExplosionBehavior>());
        }

        if (explosion)
        {
            dist = (transform.position - explosion.transform.position).magnitude;
            if (dist < 5f) //add even more damage
            {
                agentComponent.AddDamage(0.15f);
            }
            else if (dist < 10f) //add more damage
            {
                agentComponent.AddDamage(0.1f);
            }
            else if (dist < 15f)
            {
                agentComponent.AddDamage(0.05f);
            }

            //Wait until fear is above some threshold before reacting
            if (GetComponent <AffectComponent>().emotion[(int)EType.Fear] > fearThreshold)
            {
                agentComponent.DeactivateOtherBehaviors();
                agentComponent.CurrAction = "";
                if (GetComponent <AffectComponent>().IsMood((int)MoodType.Anxious) || GetComponent <AffectComponent>().personality[(int)OCEAN.N] > 0)
                {
                    agentComponent.IncreasePanic();
                }
                agentComponent.SteerFrom(explosion.transform.position);
                //  agentComponent.SteerTo(escapePos);
            }
        }
        //Explosion is over
        else
        {
            if (isOver == false)
            {
                isOver = true;
                if (agentComponent.IsWounded())
                {
                    //change fear to fearsconfirmed
                    appraisal.RemoveGoal("explosion", AppDef.Displeased, AppDef.ConsequenceForSelf, AppDef.ProspectRelevant);
                    appraisal.AddGoal("explosion", 1.0f, AppDef.Displeased, AppDef.ConsequenceForSelf, AppDef.ProspectRelevant, AppDef.Confirmed);
                }
                else
                {
                    //change fear to relief
                    appraisal.RemoveGoal("explosion", AppDef.Displeased, AppDef.ConsequenceForSelf, AppDef.ProspectRelevant);
                    appraisal.AddGoal("explosion", 0.7f, AppDef.Displeased, AppDef.ConsequenceForSelf, AppDef.ProspectRelevant, AppDef.Disconfirmed);
                }
            }
            agentComponent.DecreasePanic();

            //wait until fear is below some threshold
            if (GetComponent <AffectComponent>().emotion[(int)EType.Fear] < fearThreshold)
            {
                agentComponent.ReactivateOtherBehaviors();
                agentComponent.CalmDown();
                Destroy(this);
            }
        }
    }