1 #ifndef P_CONVERSATION_H
2 #define P_CONVERSATION_H 1
3 
4 #include <tarray.h>
5 
6 #include "s_sound.h"
7 #include "textures/textures.h"
8 
9 struct FStrifeDialogueReply;
10 class FTexture;
11 struct FBrokenLines;
12 struct PClass;
13 
14 struct FStrifeDialogueItemCheck
15 {
16 	const PClass *Item;
17 	int Amount;
18 };
19 
20 // FStrifeDialogueNode holds text an NPC says to the player
21 struct FStrifeDialogueNode
22 {
23 	~FStrifeDialogueNode ();
24 	const PClass *DropType;
25 	TArray<FStrifeDialogueItemCheck> ItemCheck;
26 	int ThisNodeNum;	// location of this node in StrifeDialogues
27 	int ItemCheckNode;	// index into StrifeDialogues
28 
29 	const PClass *SpeakerType;
30 	char *SpeakerName;
31 	FSoundID SpeakerVoice;
32 	FTextureID Backdrop;
33 	char *Dialogue;
34 
35 	FStrifeDialogueReply *Children;
36 };
37 
38 // FStrifeDialogueReply holds responses the player can give to the NPC
39 struct FStrifeDialogueReply
40 {
41 	~FStrifeDialogueReply ();
42 
43 	FStrifeDialogueReply *Next;
44 	const PClass *GiveType;
45 	int ActionSpecial;
46 	int Args[5];
47 	TArray<FStrifeDialogueItemCheck> ItemCheck;
48 	char *Reply;
49 	char *QuickYes;
50 	int NextNode;	// index into StrifeDialogues
51 	int LogNumber;
52 	char *LogString;
53 	char *QuickNo;
54 	bool NeedsGold;
55 };
56 
57 extern TArray<FStrifeDialogueNode *> StrifeDialogues;
58 
59 struct MapData;
60 
61 void SetStrifeType(int convid, const PClass *Class);
62 void SetConversation(int convid, const PClass *Class, int dlgindex);
63 const PClass *GetStrifeType (int typenum);
64 int GetConversation(int conv_id);
65 int GetConversation(FName classname);
66 
67 bool LoadScriptFile (const char *name, bool include, int type = 0);
68 
69 void P_LoadStrifeConversations (MapData *map, const char *mapname);
70 void P_FreeStrifeConversations ();
71 
72 void P_StartConversation (AActor *npc, AActor *pc, bool facetalker, bool saveangle);
73 void P_ResumeConversation ();
74 
75 void P_ConversationCommand (int netcode, int player, BYTE **stream);
76 
77 class FileReader;
78 bool P_ParseUSDF(int lumpnum, FileReader *lump, int lumplen);
79 
80 
81 #endif
82