Esempio n. 1
0
    private string PickResponse(intent i)
    {
        int ran = Random.Range(0, 4);

        if (i.Equals(intent.sympathize))
        {
            return(SympathizePlayer[ran]);
        }

        if (i.Equals(intent.rationalize))
        {
            return(RationalizePlayer[ran]);
        }

        if (i.Equals(intent.confront))
        {
            return(ConfrontPlayer[ran]);
        }

        if (i.Equals(intent.engage))
        {
            return(EngagePlayer[ran]);
        }
        return("");
    }
Esempio n. 2
0
 public Entry(string n, string[] c, intent i, string[] r, string[] rm, string[] t)
 {
     name     = n;
     criteria = c;
     intent   = i;
     response = r;
     remember = rm;
     trigger  = t;
 }
Esempio n. 3
0
    IEnumerator Assert(intent i)
    {
        string outcome = PickResponse(i);

        string[] words          = outcome.Split(' ');
        string   currentOutcome = "";

        foreach (string word in words)
        {
            currentOutcome = currentOutcome + " " + word;
            playerText.SetText(currentOutcome);
            yield return(new WaitForSeconds(.1f));
        }
    }
Esempio n. 4
0
    IEnumerator Respond(string response, intent i)
    {
        responding = true;

        StartCoroutine(Assert(i));

        yield return(new WaitForSeconds(timeBetweenWords * 5));

        string[] words = response.Split(' ');
        string   currentResponseText = "";

        foreach (string word in words)
        {
            currentResponseText = currentResponseText + " " + word;
            suspectText.SetText(currentResponseText);
            yield return(new WaitForSeconds(timeBetweenWords));
        }

        responding = false;
    }
Esempio n. 5
0
    //creates a Query object then uses it to find response, then starts the response on the UI manager
    void Query(intent _intent)
    {
        if (!end && !lost && !UIManager.responding)
        {
            Query q = new Query(_intent);

            q.setSuspect(currentSuspect);

            UIManager.StartResponse(q.FindMatch(), _intent);
        }

        if (currentSuspect.firstConfession && !end)
        {
            StartCoroutine(delayEnd());
        }

        if (currentSuspect.demandedLayer && !lost)
        {
            StartCoroutine(delayLose());
        }
    }
Esempio n. 6
0
 public void StartResponse(string response, intent i)
 {
     StartCoroutine(Respond(response, i));
 }
Esempio n. 7
0
 public Query(intent i)
 {
     _intent = i;
 }