Example #1
0
        public void Test_TalkToDelwyn()
        {
            World world = new World(SaveDirectory);
            List <NonPlayerCharacterReference> minocNpcRef =
                world.NpcRef.GetNonPlayerCharactersByLocation(SmallMapReferences.SingleMapReference.Location.Minoc);

            NonPlayerCharacterReference delwynRef = minocNpcRef[9];

            Conversation convo = world.CreateConversationAndBegin(delwynRef,
                                                                  new Conversation.EnqueuedScriptItem(OnUpdateOfEnqueuedScriptItemHandleDelwyn));

            convo.BeginConversation();
            convo.AddUserResponse("yes");
            convo.AddUserResponse("yes");
            convo.AddUserResponse("yes");
            convo.AddUserResponse("bye");

            //convo.EnqueuedScriptItemCallback -= OnUpdateOfEnqueuedScriptItemHandleDelwyn;

            Conversation convo2 = world.CreateConversationAndBegin(delwynRef,
                                                                   new Conversation.EnqueuedScriptItem(OnUpdateOfEnqueuedScriptItemHandleDelwyn));

            convo2.BeginConversation();
            convo2.AddUserResponse("yes");
            convo2.AddUserResponse("yes");
            convo2.AddUserResponse("yes");
            convo2.AddUserResponse("bye");
        }
Example #2
0
 /// <summary>
 /// Construction a conversation
 /// </summary>
 /// <param name="npc">NPC you will have a conversation with</param>
 /// <param name="state">The games current State</param>
 /// <param name="dataOvlRef">Data.OVL for reference</param>
 public Conversation(NonPlayerCharacterReference npc, GameState state, DataOvlReference dataOvlRef)
 {
     this.Npc           = npc;
     _script            = npc.Script;
     this._gameStateRef = state;
     this._dataOvlRef   = dataOvlRef;
 }
Example #3
0
 public TalkScript GetTalkScript(SmallMapReferences.SingleMapReference.SmallMapMasterFiles smallMapRef, int nNPC)
 {
     if (NonPlayerCharacterReference.IsSpecialDialogType((NonPlayerCharacterReference.NPCDialogTypeEnum)nNPC))
     {
         return(null);
     }
     return(_talkScriptRefs[smallMapRef][nNPC]);
 }
Example #4
0
        public void Test_TalkToSmith()
        {
            World world = new World(SaveDirectory);
            List <NonPlayerCharacterReference> iolosHutRefs =
                world.NpcRef.GetNonPlayerCharactersByLocation(SmallMapReferences.SingleMapReference.Location.Iolos_Hut);

            NonPlayerCharacterReference smithTheHorseRef = iolosHutRefs[4];

            world.CreateConversationAndBegin(smithTheHorseRef,
                                             new Conversation.EnqueuedScriptItem(OnUpdateOfEnqueuedScriptItem));
        }
Example #5
0
 public PlayerCharacterRecord GetCharacterRecordByNPC(NonPlayerCharacterReference npc)
 {
     foreach (PlayerCharacterRecord record in Records)
     {
         if (record.Name == npc.Name)
         {
             return(record);
         }
     }
     return(null);
     //throw new Ultima5ReduxException("Was unable to match CharacterRecord with NPC: " + npc.Name);
 }