22 #ifndef NUVIE_USECODE_U6_USECODE_H 23 #define NUVIE_USECODE_U6_USECODE_H 25 #include "ultima/nuvie/core/obj_manager.h" 26 #include "ultima/nuvie/core/timed_event.h" 27 #include "ultima/nuvie/usecode/usecode.h" 29 #include "ultima/nuvie/core/u6_objects.h" 34 #define U6_LORD_BRITISH_ACTOR_NUM 5 35 #define U6_SHERRY_ACTOR_NUM 9 36 #define U6_BEHLEM_ACTOR_NUM 164 38 #define U6_LORD_BRITISH_ORB_CHECK_FLAG 0x20 // this is set if the player has asked LB about the orb of moons 46 #define OBJTYPE_NONE 0x0000 47 #define OBJTYPE_FOOD 0x0001 48 #define OBJTYPE_CONTAINER 0x0002 49 #define OBJTYPE_BOOK 0x0004 51 #define TORCH_LIGHT_LEVEL 3 65 } U6UseCodeLatLonEnum;
73 bool use_obj(
Obj *obj,
Actor *actor)
override;
74 bool look_obj(
Obj *obj,
Actor *actor)
override;
75 bool pass_obj(
Obj *obj,
Actor *actor, uint16 x, uint16 y)
override;
76 bool search_obj(
Obj *obj,
Actor *actor)
override;
77 bool move_obj(
Obj *obj, sint16 rel_x, sint16 rel_y)
override;
78 bool load_obj(
Obj *obj)
override;
79 bool message_obj(
Obj *obj, CallbackMessage msg,
void *msg_data)
override;
80 bool ready_obj(
Obj *obj,
Actor *actor)
override;
81 bool get_obj(
Obj *obj,
Actor *actor)
override;
82 bool drop_obj(
Obj *obj,
Actor *actor, uint16 x, uint16 y, uint16 qty = 0)
override;
84 bool has_usecode(
Obj *obj, UseCodeEvent ev = USE_EVENT_USE)
override;
85 bool has_usecode(
Actor *actor, UseCodeEvent ev = USE_EVENT_USE)
override;
86 bool cannot_unready(
const Obj *obj)
const override;
88 bool is_door(
const Obj *obj)
const {
89 return (obj->obj_n >= 297 && obj->obj_n <= 300);
91 bool is_unlocked_door(
const Obj *obj)
const override {
92 return (is_door(obj) && obj->frame_n != 9 && obj->frame_n != 11);
94 bool is_locked_door(
const Obj *obj)
const override {
95 return (is_door(obj) && (obj->frame_n == 9 || obj->frame_n == 11));
97 bool is_magically_locked_door(
const Obj *obj)
const {
98 return (is_door(obj) && (obj->frame_n == 13 || obj->frame_n == 15));
100 bool is_closed_door(
const Obj *obj)
const override {
101 return (is_door(obj) && obj->frame_n > 3);
104 bool is_chest(
const Obj *obj)
const override {
105 return (obj->obj_n == OBJ_U6_CHEST);
107 bool is_closed_chest(
const Obj *obj)
const {
108 return (is_chest(obj) && obj->frame_n > 0);
110 bool is_locked_chest(
const Obj *obj)
const {
111 return (is_chest(obj) && obj->frame_n == 2);
113 bool is_magically_locked_chest(
const Obj *obj)
const {
114 return (is_chest(obj) && obj->frame_n == 3);
116 void unlock_chest(
Obj *obj) {
117 if (is_locked_chest(obj)) obj->frame_n = 1;
120 void lock_chest(
Obj *obj) {
121 if (is_chest(obj) && obj->frame_n == 1) obj->frame_n = 2;
125 bool is_locked(
const Obj *obj)
const {
126 return (is_locked_door(obj) || is_locked_chest(obj));
128 bool is_magically_locked(
const Obj *obj)
const {
129 return (is_magically_locked_door(obj) || is_magically_locked_chest(obj));
131 void unlock(
Obj *obj);
134 bool is_food(
const Obj *obj)
const override;
135 bool is_container(
const Obj *obj)
const override;
136 bool is_container(uint16 obj_n, uint8 frame_n)
const override;
137 bool is_readable(
const Obj *obj)
const override;
139 uint16 callback(uint16 msg,
CallBack *caller,
void *data =
nullptr)
override;
143 inline const U6ObjectType *get_object_type(uint16 n, uint8 f, UseCodeEvent ev = 0)
const;
147 bool use_orb(
Obj *obj, UseCodeEvent ev);
148 bool use_moonstone(
Obj *obj, UseCodeEvent ev);
149 bool use_door(
Obj *obj, UseCodeEvent ev);
150 bool use_secret_door(
Obj *obj, UseCodeEvent ev);
151 bool use_ladder(
Obj *obj, UseCodeEvent ev);
152 bool use_passthrough(
Obj *obj, UseCodeEvent ev);
153 bool use_switch(
Obj *obj, UseCodeEvent ev);
154 bool use_crank(
Obj *obj, UseCodeEvent ev);
155 bool use_food(
Obj *obj, UseCodeEvent ev);
156 bool use_firedevice(
Obj *obj, UseCodeEvent ev);
157 bool use_fan(
Obj *obj, UseCodeEvent ev);
158 bool use_sextant(
Obj *obj, UseCodeEvent ev);
159 bool use_staff(
Obj *obj, UseCodeEvent ev);
160 bool use_container(
Obj *obj, UseCodeEvent ev);
161 bool use_rune(
Obj *obj, UseCodeEvent ev);
162 bool use_vortex_cube(
Obj *obj, UseCodeEvent ev);
163 bool use_key(
Obj *obj, UseCodeEvent ev);
164 bool use_boat(
Obj *obj, UseCodeEvent ev);
165 inline Obj *use_boat_find_center(
Obj *obj);
166 inline bool use_boat_find_land(uint16 *x, uint16 *y, uint8 *z);
167 bool use_balloon_plans(
Obj *obj, UseCodeEvent ev);
168 bool use_balloon(
Obj *obj, UseCodeEvent ev);
169 bool use_cow(
Obj *obj, UseCodeEvent ev);
170 bool use_well(
Obj *obj, UseCodeEvent ev);
171 bool fill_bucket(uint16 filled_bucket_obj_n);
172 bool use_churn(
Obj *obj, UseCodeEvent ev);
173 bool use_beehive(
Obj *obj, UseCodeEvent ev);
174 bool use_horse(
Obj *obj, UseCodeEvent ev);
175 bool use_potion(
Obj *obj, UseCodeEvent ev);
176 bool use_bell(
Obj *obj, UseCodeEvent ev);
177 bool use_fishing_pole(
Obj *obj, UseCodeEvent ev);
178 bool use_shovel(
Obj *obj, UseCodeEvent ev);
179 bool use_fountain(
Obj *obj, UseCodeEvent ev);
180 bool use_rubber_ducky(
Obj *obj, UseCodeEvent ev);
181 bool use_crystal_ball(
Obj *obj, UseCodeEvent ev);
182 bool use_harpsichord(
Obj *obj, UseCodeEvent ev);
183 bool play_instrument(
Obj *obj, UseCodeEvent ev);
184 bool look_mirror(
Obj *obj, UseCodeEvent ev);
185 bool look_sign(
Obj *obj, UseCodeEvent ev);
186 bool look_clock(
Obj *obj, UseCodeEvent ev);
187 bool pass_quest_barrier(
Obj *obj, UseCodeEvent ev);
188 bool enter_dungeon(
Obj *obj, UseCodeEvent ev);
189 bool enter_moongate(
Obj *obj, UseCodeEvent ev);
191 bool use_powder_keg(
Obj *obj, UseCodeEvent ev);
192 bool use_cannon(
Obj *obj, UseCodeEvent ev);
193 bool use_egg(
Obj *obj, UseCodeEvent ev);
194 bool sundial(
Obj *obj, UseCodeEvent ev);
195 bool torch(
Obj *obj, UseCodeEvent ev);
196 bool use_spellbook(
Obj *obj, UseCodeEvent ev);
197 bool use_peer_gem(
Obj *obj, UseCodeEvent ev);
198 bool magic_ring(
Obj *obj, UseCodeEvent ev);
199 bool storm_cloak(
Obj *obj, UseCodeEvent ev);
200 bool amulet_of_submission(
Obj *obj, UseCodeEvent ev);
201 bool gargish_vocabulary(
Obj *obj, UseCodeEvent ev);
202 bool holy_flame(
Obj *obj, UseCodeEvent ev);
206 void remove_gargoyle_egg(uint16 x, uint16 y, uint8 z);
207 Obj *drawbridge_find(
Obj *crank_obj);
208 void drawbridge_open(uint16 x, uint16 y, uint8 level, uint16 b_width);
209 void drawbridge_close(uint16 x, uint16 y, uint8 level, uint16 b_width);
210 void drawbridge_remove(uint16 x, uint16 y, uint8 level, uint16 *bridge_width);
211 bool use_firedevice_message(
Obj *obj,
bool lit);
212 void lock_door(
Obj *obj);
213 void unlock_door(
Obj *obj);
214 Obj *bell_find(
Obj *chain_obj);
215 void sundial_set_shadow(
Obj *sundial, uint8 hour);
216 void extinguish_torch(
Obj *obj);
217 void light_torch(
Obj *obj);
218 bool process_effects(
Obj *container_obj,
Actor *actor)
override;
219 sint16 parseLatLongString(U6UseCodeLatLonEnum mode,
Std::string *input);
221 inline bool use_find_water(uint16 *x, uint16 *y, uint8 *z);
222 inline bool lock_pick_dex_check();
Definition: configuration.h:61
Definition: usecode.h:151
Definition: u6_usecode.h:53
Definition: detection.h:27
Definition: call_back.h:50
Definition: u6_usecode.h:67