public Node NPCBehavior_CasualConversation(NPCBehavior agentA, NPCBehavior agentB) { return(new Sequence( agentB.NPCBehavior_GoToAtDistance(agentA.transform, 1.5f, false), agentB.NPCBehavior_OrientTowards(agentA.transform), agentB.NPCBehavior_LookAt(agentA.transform, true), agentB.NPCBehavior_DoGesture(GESTURE_CODE.WAVE_HELLO), agentA.NPCBehavior_OrientTowards(agentB.transform), agentA.NPCBehavior_LookAt(agentB.transform, true), new DecoratorLoop( new SelectorParallel( new SequenceShuffle( agentA.NPCBehavior_DoGesture(GESTURE_CODE.TALK_SHORT), agentB.NPCBehavior_DoGesture(GESTURE_CODE.TALK_LONG), agentA.NPCBehavior_DoGesture(GESTURE_CODE.ACKNOWLEDGE), agentA.NPCBehavior_DoGesture(GESTURE_CODE.HURRAY), agentA.NPCBehavior_DoGesture(GESTURE_CODE.DRUNK) ), new SequenceShuffle( agentA.NPCBehavior_DoGesture(GESTURE_CODE.PHONEME_A), agentB.NPCBehavior_DoGesture(GESTURE_CODE.PHONEME_E), agentA.NPCBehavior_DoGesture(GESTURE_CODE.PHONEME_O), agentA.NPCBehavior_DoGesture(GESTURE_CODE.PHONEME_U), agentA.NPCBehavior_DoGesture(GESTURE_CODE.PHONEME_P) ) ) ), agentB.NPCBehavior_LookAt(null, false), agentA.NPCBehavior_LookAt(null, false), agentB.NPCBehavior_DoGesture(GESTURE_CODE.WAVE_HELLO) )); }
protected Node ChoosePartner() { if (UnityEngine.Random.Range(-1f, 1f) > 0) { AgentCUpset = true; return(new Sequence( AgentA.NPCBehavior_OrientTowards(AgentB.transform), AgentA.NPCBehavior_Talk("Hi Danny Bones! I like you better than Steve!", bubbleA), AgentB.NPCBehavior_Talk("Thanks Manny Bones!", bubbleB), AgentC.NPCBehavior_DoGesture(GESTURE_CODE.DISSAPOINTMENT) )); } else { AgentBUpset = true; return(new Sequence( AgentA.NPCBehavior_OrientTowards(AgentC.transform), AgentA.NPCBehavior_Talk("Hi Steve! I like you better than Danny Bones!", bubbleA), AgentC.NPCBehavior_Talk("Thanks Manny Bones!", bubbleC), AgentB.NPCBehavior_DoGesture(GESTURE_CODE.DISSAPOINTMENT) )); } }
protected Node WalkAway() { if (AgentBUpset) { return(new Sequence( new SequenceParallel( AgentA.NPCBehavior_GoTo(target, false), AgentC.NPCBehavior_GoTo(target, false) ), new SequenceParallel( AgentA.NPCBehavior_OrientTowards(AgentC.transform), AgentC.NPCBehavior_OrientTowards(AgentA.transform) ), AgentB.NPCBehavior_GoTo(gorgonfront, true), AgentB.NPCBehavior_OrientTowards(gorgon), AgentB.NPCBehavior_Talk("I am going to kill them!", bubbleB) )); } else if (AgentCUpset) { return(new Sequence( new SequenceParallel( AgentA.NPCBehavior_GoTo(target3, false), AgentB.NPCBehavior_GoTo(target3, false) ), new SequenceParallel( AgentA.NPCBehavior_OrientTowards(AgentB.transform), AgentB.NPCBehavior_OrientTowards(AgentA.transform) ), AgentC.NPCBehavior_GoTo(gorgonfront, true), AgentC.NPCBehavior_OrientTowards(gorgon), AgentC.NPCBehavior_Talk("I am going to kill them!", bubbleC) )); } return(null); }