Esempio n. 1
0
    new void Start()
    {
        base.Start();
        //BC
        bc  = GetComponent <BackgroundChatter>();
        col = Color.blue;
        //DIALOG
        Dialog = Dialogbox.Dialogsystem.gameObject;


        Dialogbox.Dialogstate Dend = new Dialogbox.Dialogstate {
            end = true, callback = talkedToFriend
        };
        Dialogbox.Dialogstate ds0 = new Dialogbox.Dialogstate {
            Avatar = Portrait, Title = "Rosie", Message = "You're here!! I'm so happy you made it. Have you seen Mew? Can you maybe check, if they are alright. They like you so much. ", optionA = "Sure, I wanted to find Miss Mister Mew anyway.", optionB = "Uhm, they were stressing out a bit, so I let them out of the flat.", oA_changeval = -10f, oB_changeval = 20f, end = false, callback = talkedToFriend
        };
        Dialogbox.Dialogtransition dt0 = new Dialogbox.Dialogtransition {
            origial = ds0, oA_followup = Dend, oB_followup = Dend
        };
        ds    = new Dialogbox.Dialogstate[2];
        ds[0] = ds0;
        ds[1] = Dend;
        dt    = new Dialogbox.Dialogtransition[1];
        dt[0] = dt0;

        annoy = GetComponent <Annoying>();

        //PATHFINDING
        pm = GetComponent <PersonMotor>();


        NextBehavior();
    }
Esempio n. 2
0
    new void Start()
    {
        base.Start();
        //BC
        bc  = GetComponent <BackgroundChatter>();
        col = Color.blue;
        //DIALOG
        Dialog = Dialogbox.Dialogsystem.gameObject;


        Dialogbox.Dialogstate Dend = new Dialogbox.Dialogstate {
            end = true, callback = talkedToFriend
        };
        Dialogbox.Dialogstate ds0 = new Dialogbox.Dialogstate {
            Avatar = Portrait, Title = "Jill", Message = "Did you see that? One of Rosie's housemates is actually keeping a bird in a cage. It didn't look very happy. And it has to share the flat with a cat, too.", optionA = "Yeah, that seems stressful for the bird. They probably keep the door to that room shut, normally.", optionB = "", oA_changeval = 0, oB_changeval = 0, end = false
        };
        Dialogbox.Dialogtransition dt0 = new Dialogbox.Dialogtransition {
            origial = ds0, oA_followup = Dend, oB_followup = Dend
        };
        ds    = new Dialogbox.Dialogstate[2];
        ds[0] = ds0;
        ds[1] = Dend;
        dt    = new Dialogbox.Dialogtransition[1];
        dt[0] = dt0;

        annoy = GetComponent <Annoying>();

        //PATHFINDING
        pm = GetComponent <PersonMotor>();



        NextBehavior();
    }
    private void CheckArea()
    {
        Collider2D[] areaPeople = Physics2D.OverlapCircleAll(transform.position, radius, people);
        foreach (Collider2D p in areaPeople)
        {
            Annoying a = p.GetComponent <Annoying>();
            if (a == null)
            {
                continue;
            }
            float change = ((radius - Mathf.Min(Vector2.Distance(p.transform.position, transform.position), radius)) * a.value / 2f);
            change *= change;
            ChangeAnnoyance(change);
        }

        float recovery = 1f;

        if (annoyance > 1)
        {
            if (calmSince + 4f < Time.time)
            {
                recovery = 1f;
            }
            else if (calmSince + 2f < Time.time)
            {
                recovery = .5f;
            }
            else if (calmSince + 1f < Time.time)
            {
                recovery = .25f;
            }

            if (annoyance < 230)
            {
                recovery *= .5f;
            }

            ChangeAnnoyance(-recovery * .5f);
        }

        Sannoyance.value = annoyance;
    }