ScummVM API documentation
person.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ULTIMA4_GAME_PERSON_H
23 #define ULTIMA4_GAME_PERSON_H
24 
25 #include "ultima/ultima4/game/creature.h"
26 #include "ultima/ultima4/core/types.h"
27 
28 namespace Ultima {
29 namespace Ultima4 {
30 
31 class Conversation;
32 class Dialogue;
33 class Response;
34 class ResponsePart;
35 
36 typedef enum {
37  NPC_EMPTY,
38  NPC_TALKER,
39  NPC_TALKER_BEGGAR,
40  NPC_TALKER_GUARD,
41  NPC_TALKER_COMPANION,
42  NPC_VENDOR_WEAPONS,
43  NPC_VENDOR_ARMOR,
44  NPC_VENDOR_FOOD,
45  NPC_VENDOR_TAVERN,
46  NPC_VENDOR_REAGENTS,
47  NPC_VENDOR_HEALER,
48  NPC_VENDOR_INN,
49  NPC_VENDOR_GUILD,
50  NPC_VENDOR_STABLE,
51  NPC_LORD_BRITISH,
52  NPC_HAWKWIND,
53  NPC_MAX
54 } PersonNpcType;
55 
56 class Person : public Creature {
57 public:
58  Person(MapTile tile);
59  Person(const Person *p);
60 
61  bool canConverse() const;
62  bool isVendor() const;
63  Common::String getName() const override;
64  void goToStartLocation();
65  void setDialogue(Dialogue *d);
66  MapCoords &getStart() {
67  return _start;
68  }
69  PersonNpcType getNpcType() const {
70  return _npcType;
71  }
72  void setNpcType(PersonNpcType t);
73 
74  Common::List<Common::String> getConversationText(Conversation *cnv, const char *inquiry);
75 
80 
84  const char *getChoices(Conversation *cnv);
85 
86  Common::String getIntro(Conversation *cnv);
87  Common::String processResponse(Conversation *cnv, Response *response);
88  void runCommand(Conversation *cnv, const ResponsePart &command);
89  Common::String getResponse(Conversation *cnv, const char *inquiry);
90  Common::String talkerGetQuestionResponse(Conversation *cnv, const char *inquiry);
91  Common::String beggarGetQuantityResponse(Conversation *cnv, const char *response);
92  Common::String lordBritishGetQuestionResponse(Conversation *cnv, const char *answer);
93  Common::String getQuestion(Conversation *cnv);
94 
95 private:
96  Dialogue *_dialogue;
97  MapCoords _start;
98  PersonNpcType _npcType;
99 };
100 
101 bool isPerson(Object *punknown);
102 
103 Common::List<Common::String> replySplit(const Common::String &text);
104 int linecount(const Common::String &s, int columnmax);
105 
106 } // End of namespace Ultima4
107 } // End of namespace Ultima
108 
109 #endif
Definition: str.h:59
const char * getChoices(Conversation *cnv)
Definition: detection.h:27
Common::String getPrompt(Conversation *cnv)
Definition: conversation.h:39
Definition: map_tile.h:34
Definition: creature.h:159
Definition: object.h:42
Definition: person.h:56
Definition: conversation.h:80
Definition: conversation.h:265
Definition: map.h:64
Definition: conversation.h:127