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