22 #ifndef NUVIE_CORE_CONVERSE_H 23 #define NUVIE_CORE_CONVERSE_H 25 #include "common/str.h" 26 #include "ultima/shared/std/containers.h" 27 #include "ultima/nuvie/actors/actor.h" 28 #include "ultima/nuvie/gui/widgets/msg_scroll.h" 29 #include "ultima/nuvie/files/u6_lib_n.h" 30 #include "ultima/nuvie/views/view.h" 46 class ConverseInterpret;
50 ConverseGumpType get_converse_gump_type_from_config(
const Configuration *config);
52 typedef uint32 converse_value;
53 typedef unsigned char *convscript_buffer;
60 #define U6TALK_VAR_SEX 0x10 // sex of avatar: male=0 female=1 61 #define U6TALK_VAR_KARMA 0x14 // avatar's karma 62 #define U6TALK_VAR_GARGF 0x15 // 1=player knows Gargish 63 #define U6TALK_VAR_NPC_NAME 0x17 64 #define U6TALK_VAR_PARTYLIVE 0x17 // number of people (living) following avatar 65 #define U6TALK_VAR_PARTYALL 0x18 // number of people (total) following avatar 66 #define U6TALK_VAR_HP 0x19 // avatar's health 67 #define U6TALK_VAR_PLAYER_NAME 0x19 68 #define U6TALK_VAR_QUESTF 0x1A // 0="Thou art not upon a sacred quest!" 69 #define WOUTALK_VAR_ADD_TO_INVENTORY_FAILED 0x1D 70 #define U6TALK_VAR_WORKTYPE 0x20 // current activity of npc, from schedule 71 #define U6TALK_VAR_YSTRING 0x22 // value of $Y variable. 72 #define U6TALK_VAR_INPUT 0x23 // previous input from player ($Z) 73 #define U6TALK_VAR__LAST_ 0x25 // (all above 36 appear uninitialized) 95 nuvie_game_t gametype;
98 const char *src_name();
110 bool party_all_the_time;
117 struct converse_variables_s {
133 uint32 get_script_num(uint8 a);
135 uint32 load_conv(uint8 a);
143 bool start(
Actor *a) {
144 return start(a->get_actor_num());
147 void continue_script();
150 bool running()
const {
153 bool is_waiting_for_scroll() {
154 return scroll->get_page_break();
157 void poll_input(
const char *allowed =
nullptr,
bool nonblock =
true);
158 bool override_input();
159 void collect_input();
162 void print(
const char *s =
nullptr);
176 void set_party_all_the_time(
bool val) {
177 party_all_the_time = val;
179 const char *npc_name(uint8 num);
180 void show_portrait(uint8 n);
181 converse_value get_var(uint8 varnum)
const {
182 return (varnum <= U6TALK_VAR__LAST_ ? variables[varnum].cv : 0x00);
184 const char *get_svar(uint8 varnum);
185 void set_var(uint8 varnum, uint32 val) {
186 if (varnum <= U6TALK_VAR__LAST_) variables[varnum].cv = val;
188 void set_svar(uint8 varnum,
const char *
set);
189 void init_variables();
190 void delete_variables();
196 bool conversations_stop_music;
209 convscript_buffer buf;
211 convscript_buffer buf_pt;
226 bool loaded()
const {
227 return ((buf && buf_len));
231 converse_value read(uint32 advance = 1);
232 converse_value read2();
233 converse_value read4();
234 converse_value peek(uint32 displacement = 0) {
235 return ((converse_value) * (buf_pt + displacement));
239 void write2(converse_value val);
245 void skip(uint32 bytes = 1) {
248 void seek(uint32 offset = 0) {
256 bool overflow(uint32 ptadd = 0)
const {
257 return (((pos() + ptadd) >= buf_len));
259 convscript_buffer get_buffer(uint32 ptadd = 0) {
260 return ((!ptadd || (ptadd < buf_len)) ? buf + ptadd :
nullptr);
Definition: converse.h:55
Definition: converse_interpret.h:313
Definition: configuration.h:61
Definition: game_clock.h:47
Definition: actor_manager.h:42
Definition: detection.h:27
Definition: converse_speech.h:41
Definition: converse_interpret.h:307
Definition: u6_lib_n.h:43
Definition: obj_manager.h:75
Definition: converse_interpret.h:114
Definition: view_manager.h:55
Definition: converse_interpret.h:327
Definition: converse.h:79
Definition: converse_interpret.h:321
Definition: converse.h:206