예제 #1
0
 public void addTestimony(EventTestimony testimony, Event e)
 {
     testimonies.Add(e, testimony);
     testimoniesReversed.Add(testimony, e);
 }
예제 #2
0
        public void removeTestimony(EventTestimony testimony = null, Event e = null)
        {
            if (testimony != null) testimoniesReversed.TryGetValue(testimony, out e);
            if (e != null) testimonies.TryGetValue(e, out testimony);

            testimonies.Remove(e);
            testimoniesReversed.Remove(testimony);
        }
        void revealTruth(Testimony lie)
        {
            if (lie is EventTestimony) {
                EventTestimony eventLie = lie as EventTestimony;
                Event ev = eventLie.e;
                Event truth;
                speakingNPC.testimoniesReversed.TryGetValue(eventLie, out truth);

                if (ev is SwitchRooms) {
                    SwitchRooms e = ev as SwitchRooms;
                    SwitchRooms convertedTruth = truth as SwitchRooms;
                    if (e.time != truth.time) {
                        dialogueQueue.Enqueue(string.Format("{0} actually moved to the {1} at {2}, not {3}", Grammar.getSubjectPronoun(e.npc, speakingNPC), e.newRoom.roomName,Timeline.convertTime(truth.time), Timeline.convertTime(e.time)));
                    }
                    else if (e.newRoom != convertedTruth.newRoom) {
                        dialogueQueue.Enqueue(string.Format("{0} actually moved to the {1}, not the {3}", Grammar.getSubjectPronoun(e.npc, speakingNPC), e.newRoom.roomName, convertedTruth.newRoom, e.newRoom));
                    }
                }

                EventTestimony trueTestimony = new EventTestimony(truth, speakingNPC, true, false);
                speakingNPC.removeTestimony(eventLie, truth);
                speakingNPC.addTestimony(trueTestimony, truth);
            }
        }