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(""); }
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; }
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)); } }
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; }
//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()); } }
public void StartResponse(string response, intent i) { StartCoroutine(Respond(response, i)); }
public Query(intent i) { _intent = i; }