22 #ifndef NUVIE_CORE_CONVERSE_H 23 #define NUVIE_CORE_CONVERSE_H 25 #include "ultima/shared/std/string.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;
52 ConverseGumpType get_converse_gump_type_from_config(
const Configuration *config);
54 typedef uint32 converse_value;
55 typedef unsigned char *convscript_buffer;
62 #define U6TALK_VAR_SEX 0x10 // sex of avatar: male=0 female=1 63 #define U6TALK_VAR_KARMA 0x14 // avatar's karma 64 #define U6TALK_VAR_GARGF 0x15 // 1=player knows Gargish 65 #define U6TALK_VAR_NPC_NAME 0x17 66 #define U6TALK_VAR_PARTYLIVE 0x17 // number of people (living) following avatar 67 #define U6TALK_VAR_PARTYALL 0x18 // number of people (total) following avatar 68 #define U6TALK_VAR_HP 0x19 // avatar's health 69 #define U6TALK_VAR_PLAYER_NAME 0x19 70 #define U6TALK_VAR_QUESTF 0x1A // 0="Thou art not upon a sacred quest!" 71 #define WOUTALK_VAR_ADD_TO_INVENTORY_FAILED 0x1D 72 #define U6TALK_VAR_WORKTYPE 0x20 // current activity of npc, from schedule 73 #define U6TALK_VAR_YSTRING 0x22 // value of $Y variable. 74 #define U6TALK_VAR_INPUT 0x23 // previous input from player ($Z) 75 #define U6TALK_VAR__LAST_ 0x25 // (all above 36 appear uninitialized) 97 nuvie_game_t gametype;
100 const char *src_name();
112 bool party_all_the_time;
119 struct converse_variables_s {
135 uint32 get_script_num(uint8 a);
137 uint32 load_conv(uint8 a);
145 bool start(
Actor *a) {
146 return start(a->get_actor_num());
149 void continue_script();
152 bool running()
const {
155 bool is_waiting_for_scroll() {
156 return scroll->get_page_break();
159 void poll_input(
const char *allowed =
nullptr,
bool nonblock =
true);
160 bool override_input();
161 void collect_input();
164 void print(
const char *s =
nullptr);
178 void set_party_all_the_time(
bool val) {
179 party_all_the_time = val;
181 const char *npc_name(uint8 num);
182 void show_portrait(uint8 n);
183 converse_value get_var(uint8 varnum)
const {
184 return (varnum <= U6TALK_VAR__LAST_ ? variables[varnum].cv : 0x00);
186 const char *get_svar(uint8 varnum);
187 void set_var(uint8 varnum, uint32 val) {
188 if (varnum <= U6TALK_VAR__LAST_) variables[varnum].cv = val;
190 void set_svar(uint8 varnum,
const char *
set);
191 void init_variables();
192 void delete_variables();
198 bool conversations_stop_music;
211 convscript_buffer buf;
213 convscript_buffer buf_pt;
228 bool loaded()
const {
229 return ((buf && buf_len));
233 converse_value read(uint32 advance = 1);
234 converse_value read2();
235 converse_value read4();
236 converse_value peek(uint32 displacement = 0) {
237 return ((converse_value) * (buf_pt + displacement));
241 void write2(converse_value val);
247 void skip(uint32 bytes = 1) {
250 void seek(uint32 offset = 0) {
258 bool overflow(uint32 ptadd = 0)
const {
259 return (((pos() + ptadd) >= buf_len));
261 convscript_buffer get_buffer(uint32 ptadd = 0) {
262 return ((!ptadd || (ptadd < buf_len)) ? buf + ptadd :
nullptr);
Definition: converse.h:57
Definition: converse_interpret.h:316
Definition: configuration.h:61
Definition: game_clock.h:49
Definition: actor_manager.h:42
Definition: detection.h:27
Definition: converse_speech.h:41
Definition: converse_interpret.h:310
Definition: u6_lib_n.h:46
Definition: obj_manager.h:75
Definition: converse_interpret.h:117
Definition: view_manager.h:57
Definition: converse_interpret.h:330
Definition: converse.h:81
Definition: converse_interpret.h:324
Definition: converse.h:208