22 #ifndef NUVIE_CORE_CONVERSE_H 23 #define NUVIE_CORE_CONVERSE_H 25 #include "common/str.h" 26 #include "ultima/nuvie/actors/actor.h" 27 #include "ultima/nuvie/gui/widgets/msg_scroll.h" 28 #include "ultima/nuvie/files/u6_lib_n.h" 29 #include "ultima/nuvie/views/view.h" 45 class ConverseInterpret;
49 ConverseGumpType get_converse_gump_type_from_config(
const Configuration *config);
51 typedef uint32 converse_value;
52 typedef unsigned char *convscript_buffer;
59 #define U6TALK_VAR_SEX 0x10 // sex of avatar: male=0 female=1 60 #define U6TALK_VAR_KARMA 0x14 // avatar's karma 61 #define U6TALK_VAR_GARGF 0x15 // 1=player knows Gargish 62 #define U6TALK_VAR_NPC_NAME 0x17 63 #define U6TALK_VAR_PARTYLIVE 0x17 // number of people (living) following avatar 64 #define U6TALK_VAR_PARTYALL 0x18 // number of people (total) following avatar 65 #define U6TALK_VAR_HP 0x19 // avatar's health 66 #define U6TALK_VAR_PLAYER_NAME 0x19 67 #define U6TALK_VAR_QUESTF 0x1A // 0="Thou art not upon a sacred quest!" 68 #define WOUTALK_VAR_ADD_TO_INVENTORY_FAILED 0x1D 69 #define U6TALK_VAR_WORKTYPE 0x20 // current activity of npc, from schedule 70 #define U6TALK_VAR_YSTRING 0x22 // value of $Y variable. 71 #define U6TALK_VAR_INPUT 0x23 // previous input from player ($Z) 72 #define U6TALK_VAR__LAST_ 0x25 // (all above 36 appear uninitialized) 94 nuvie_game_t gametype;
97 const char *src_name();
109 bool party_all_the_time;
116 struct converse_variables_s {
132 uint32 get_script_num(uint8 a);
134 uint32 load_conv(uint8 a);
142 bool start(
Actor *a) {
143 return start(a->get_actor_num());
146 void continue_script();
149 bool running()
const {
152 bool is_waiting_for_scroll() {
153 return scroll->get_page_break();
156 void poll_input(
const char *allowed =
nullptr,
bool nonblock =
true);
157 bool override_input();
158 void collect_input();
161 void print(
const char *s =
nullptr);
175 void set_party_all_the_time(
bool val) {
176 party_all_the_time = val;
178 const char *npc_name(uint8 num);
179 void show_portrait(uint8 n);
180 converse_value get_var(uint8 varnum)
const {
181 return (varnum <= U6TALK_VAR__LAST_ ? variables[varnum].cv : 0x00);
183 const char *get_svar(uint8 varnum);
184 void set_var(uint8 varnum, uint32 val) {
185 if (varnum <= U6TALK_VAR__LAST_) variables[varnum].cv = val;
187 void set_svar(uint8 varnum,
const char *
set);
188 void init_variables();
189 void delete_variables();
195 bool conversations_stop_music;
208 convscript_buffer buf;
210 convscript_buffer buf_pt;
225 bool loaded()
const {
226 return ((buf && buf_len));
230 converse_value read(uint32 advance = 1);
231 converse_value read2();
232 converse_value read4();
233 converse_value peek(uint32 displacement = 0) {
234 return ((converse_value) * (buf_pt + displacement));
238 void write2(converse_value val);
244 void skip(uint32 bytes = 1) {
247 void seek(uint32 offset = 0) {
255 bool overflow(uint32 ptadd = 0)
const {
256 return (((pos() + ptadd) >= buf_len));
258 convscript_buffer get_buffer(uint32 ptadd = 0) {
259 return ((!ptadd || (ptadd < buf_len)) ? buf + ptadd :
nullptr);
Definition: converse.h:54
Definition: converse_interpret.h:314
Definition: configuration.h:60
Definition: game_clock.h:45
Definition: actor_manager.h:42
Definition: detection.h:27
Definition: converse_speech.h:40
Definition: converse_interpret.h:308
Definition: u6_lib_n.h:42
Definition: obj_manager.h:74
Definition: converse_interpret.h:115
Definition: view_manager.h:55
Definition: converse_interpret.h:328
Definition: converse.h:78
Definition: converse_interpret.h:322
Definition: converse.h:205