22 #ifndef NUVIE_SCRIPT_SCRIPT_H 23 #define NUVIE_SCRIPT_SCRIPT_H 25 #include "common/lua/lua.h" 27 #include "ultima/shared/std/string.h" 28 #include "ultima/shared/std/containers.h" 29 #include "ultima/nuvie/gui/gui.h" 30 #include "ultima/nuvie/misc/u6_misc.h" 31 #include "ultima/nuvie/usecode/usecode.h" 44 #define NUVIE_SCRIPT_NOT_STARTED 255 45 #define NUVIE_SCRIPT_ERROR 0 46 #define NUVIE_SCRIPT_FINISHED 1 47 #define NUVIE_SCRIPT_GET_TARGET 2 48 #define NUVIE_SCRIPT_GET_DIRECTION 3 49 #define NUVIE_SCRIPT_GET_INV_OBJ 4 50 #define NUVIE_SCRIPT_ADVANCE_GAME_TIME 5 51 #define NUVIE_SCRIPT_ADVANCE_REAL_TIME 6 52 #define NUVIE_SCRIPT_TALK_TO_ACTOR 7 53 #define NUVIE_SCRIPT_GET_SPELL 8 54 #define NUVIE_SCRIPT_GET_OBJ 9 55 #define NUVIE_SCRIPT_GET_PLAYER_OBJ 10 //can get an object immediately surrounding the player or from their inventory. 57 #define NUVIE_SCRIPT_CB_ADV_GAME_TIME 1 71 state = NUVIE_SCRIPT_NOT_STARTED;
78 return resume(start_nargs);
80 uint8 resume_with_location(
const MapCoord &loc);
81 uint8 resume_with_direction(NuvieDir dir);
82 uint8 resume_with_spell_num(uint8 spell_num);
83 uint8 resume_with_obj(
Obj *obj);
84 uint8 resume_with_nil();
85 uint8 resume(
int narg = 0);
87 return lua_status(L) != LUA_YIELD ? true :
false;
101 #define SCRIPT_DISPLAY_HIT_MSG true 105 nuvie_game_t gametype;
117 static Script *get_script() {
127 bool run_script(
const char *script);
128 bool call_load_game(
NuvieIO *objlist);
129 bool call_save_game(
NuvieIO *objlist);
131 bool play_cutscene(
const char *script_file);
132 MovementStatus call_player_before_move_action(sint16 *rel_x, sint16 *rel_y);
133 bool call_player_post_move_action(
bool didMove);
134 bool call_player_pass();
135 bool call_actor_update_all();
136 bool call_actor_init(
Actor *actor, ActorAlignment alignment);
139 bool call_actor_tile_dmg(
Actor *actor, uint16 tile_num);
140 bool call_actor_hit(
Actor *actor, uint8 dmg,
bool display_hit_msg =
false);
141 uint8 call_actor_str_adj(
Actor *actor);
142 uint8 call_actor_dex_adj(
Actor *actor);
143 uint8 call_actor_int_adj(
Actor *actor);
144 bool call_look_obj(
Obj *obj);
145 int call_obj_get_readiable_location(
Obj *obj);
146 uint8 actor_get_max_magic_points(
const Actor *actor);
147 bool call_actor_get_obj(
Actor *actor,
Obj *obj,
Obj *container =
nullptr);
148 bool call_actor_subtract_movement_points(
Actor *actor, uint8 points);
149 bool call_actor_resurrect(
Actor *actor);
150 bool call_use_keg(
Obj *obj);
151 bool call_has_usecode(
Obj *obj, UseCodeEvent usecode_type);
153 bool call_ready_obj(
Obj *obj,
Actor *actor);
154 bool call_move_obj(
Obj *obj, sint16 rel_x, sint16 rel_y);
155 bool call_handle_alt_code(uint16 altcode);
157 bool call_magic_get_spell_list(
Spell **spell_list);
158 bool call_actor_use_effect(
Obj *effect_obj,
Actor *actor);
159 bool call_function(
const char *func_name,
int num_args,
int num_return,
bool print_stacktrace =
true)
const;
160 ScriptThread *call_function_in_thread(
const char *function_name);
161 bool run_lua_file(
const char *filename);
162 bool call_moonstone_set_loc(uint8 phase,
MapCoord location);
163 bool call_advance_time(uint16 minutes);
164 bool call_can_get_obj_override(
Obj *obj)
const;
165 bool call_out_of_ammo(
Actor *attacker,
Obj *weapon,
bool print_message);
166 bool call_is_avatar_dead();
167 bool call_is_ranged_select(UseCodeType operation);
168 bool call_set_g_show_stealing(
bool stealing);
169 uint8 call_get_combat_range(uint16 absx, uint16 absy);
170 uint8 call_get_weapon_range(uint16 obj_n);
172 MapCoord call_moonstone_get_loc(uint8 phase);
173 bool call_update_moongates(
bool visible);
175 uint8 call_play_midgame_sequence(uint16 seq_num);
176 bool call_talk_script(uint8 script_number);
177 bool call_talk_to_obj(
Obj *obj);
178 bool call_talk_to_actor(
Actor *actor);
179 bool call_is_container_obj(uint16 obj_n);
180 uint8 call_get_portrait_number(
Actor *actor);
181 bool call_player_attack();
183 uint16 call_get_tile_to_object_mapping(uint16 tile_n);
184 bool call_is_tile_object(uint16 obj_n);
187 ScriptThread *new_thread_from_string(
const char *script);
190 bool call_loadsave_game(
const char *
function,
NuvieIO *objlist);
Definition: configuration.h:61
Definition: detection.h:27
Definition: sound_manager.h:62
Definition: nuvie_io.h:32