22 #ifndef NUVIE_ACTORS_U6_ACTOR_H 23 #define NUVIE_ACTORS_U6_ACTOR_H 25 #include "ultima/nuvie/actors/actor.h" 26 #include "ultima/nuvie/misc/actor_list.h" 27 #include "ultima/nuvie/core/u6_objects.h" 35 MOVETYPE_U6_WATER_LOW = 2,
36 MOVETYPE_U6_WATER_HIGH = 3,
37 MOVETYPE_U6_AIR_LOW = 4,
38 MOVETYPE_U6_AIR_HIGH = 5,
39 MOVETYPE_U6_ETHEREAL = 6,
42 #define REMOVE_SURROUNDING_OBJS true 44 #define ACTOR_MOVEMENT_FLAGS_CORPSER 0x10 48 uint8 frames_per_direction;
49 uint8 tiles_per_direction;
50 uint8 tiles_per_frame;
51 uint8 tile_start_offset;
56 ActorTileType tile_type;
57 ActorMovetype movetype;
59 uint8 body_armor_class;
67 ActorMovetype current_movetype;
76 bool init(uint8 obj_status = NO_OBJ_STATUS)
override;
77 uint16 get_downward_facing_tile_num()
const override;
78 bool updateSchedule(uint8 hour,
bool teleport =
false)
override;
79 void set_worktype(uint8 new_worktype,
bool init =
false)
override;
80 void revert_worktype()
override;
81 void change_base_obj_n(uint16 val)
override;
82 void set_direction(NuvieDir d)
override;
83 void face_location(uint16 lx, uint16 ly)
override;
84 void clear()
override;
85 bool move(uint16 new_x, uint16 new_y, uint8 new_z, ActorMoveFlags flags = 0)
override;
86 bool check_move(uint16 new_x, uint16 new_y, uint8 new_z, ActorMoveFlags flags = 0)
override;
87 void twitch()
override;
89 void die(
bool create_body =
true)
override;
90 void set_paralyzed(
bool paralyzed)
override;
91 void set_protected(
bool val)
override;
92 void set_charmed(
bool val)
override;
93 void set_corpser_flag(
bool val)
override;
94 void set_cursed(
bool val)
override;
95 void set_asleep(
bool val)
override;
96 void set_ethereal(
bool val)
override {
97 current_movetype = val ? MOVETYPE_U6_ETHEREAL : actor_type->movetype;
101 uint8 get_object_readiable_location(
Obj *obj)
override;
102 const CombatType *get_object_combat_type(uint16 objN)
override;
103 ActorTileType get_tile_type()
const override {
104 return (actor_type->tile_type);
106 Obj *inventory_get_food(
Obj *container = 0)
override;
107 uint8 get_maxhp()
const override {
108 return (((level * 30) <= 255) ? (level * 30) : 255);
110 uint8 get_maxmagic()
const override;
112 bool weapon_can_hit(
const CombatType *weapon,
Actor *target, uint16 *hit_x, uint16 *hit_y)
override;
114 bool is_immobile()
const override;
117 bool get_corpser_flag()
const override {
118 return (movement_flags & ACTOR_MOVEMENT_FLAGS_CORPSER);
120 bool can_be_passed(
const Actor *other,
bool ignoreParty)
const override;
121 bool will_not_talk()
const override;
123 void set_actor_obj_n(uint16 new_obj_n);
124 void pathfind_to(
const MapCoord &d)
override;
125 void handle_lightsource(uint8 hour)
override;
127 uint8 get_hp_text_color()
const override;
128 uint8 get_str_text_color()
const override {
131 uint8 get_dex_text_color()
const override {
134 bool isFlying()
const override {
137 const uint16 flyingObjs[] = {
138 OBJ_U6_INSECTS, OBJ_U6_GIANT_BAT, OBJ_U6_GAZER, OBJ_U6_BIRD,
139 OBJ_U6_WINGED_GARGOYLE, OBJ_U6_DAEMON, OBJ_U6_DRAKE,
140 OBJ_U6_MONGBAT, OBJ_U6_DRAGON, OBJ_U6_INFLATED_BALLOON };
142 for (
const auto flyingObj : flyingObjs)
143 if (obj_n == flyingObj)
147 bool isNonBlocking()
const override {
149 const uint16 u6NonBlockingObjs[] = {
150 OBJ_U6_INSECTS, OBJ_U6_MOUSE, OBJ_U6_BIRD, OBJ_U6_CORPSER,
153 for (
const auto nonBlockingObj : u6NonBlockingObjs)
154 if (obj_n == nonBlockingObj)
161 bool init_splitactor(uint8 obj_status);
164 bool init_silver_serpent();
165 void init_new_silver_serpent();
166 void gather_snake_objs_from_map(
Obj *start_obj, uint16 ax, uint16 ay, uint16 az);
167 inline bool check_move_silver_serpent(uint16 x, uint16 y);
168 bool sit_on_chair(
Obj *obj);
170 inline void discover_direction();
171 void setup_walk_to_location();
172 void wt_sleep(
bool init =
false);
175 inline const U6ActorType *get_actor_type(uint16 new_obj_n);
177 inline bool has_surrounding_objs();
178 inline void remove_surrounding_objs_from_map();
179 inline void add_surrounding_objs_to_map();
180 inline void move_surrounding_objs_relative(sint16 rel_x, sint16 rel_y);
181 inline void move_silver_serpent_objs_relative(sint16 rel_x, sint16 rel_y);
182 inline void set_direction_of_surrounding_objs(NuvieDir new_direction);
183 inline void set_direction_of_surrounding_ship_objs(NuvieDir new_direction);
184 inline void set_direction_of_surrounding_splitactor_objs(NuvieDir new_direction);
185 inline void set_direction_of_surrounding_dragon_objs(NuvieDir new_direction);
187 inline void twitch_surrounding_objs();
188 inline void twitch_surrounding_dragon_objs();
189 inline void twitch_surrounding_hydra_objs();
190 inline void twitch_obj(
Obj *obj);
192 inline void clear_surrounding_objs_list(
bool delete_objs =
false);
193 inline void init_surrounding_obj(uint16 x, uint16 y, uint8 z, uint16 actor_obj_n, uint16 obj_frame_n);
195 const CombatType *get_hand_combat_type()
const override;
197 void print()
override;
198 const char *get_worktype_string(uint32 wt)
const override;
199 void inventory_make_all_objs_ok_to_take();
Definition: u6_actor.h:62
Definition: game_clock.h:49
Definition: detection.h:27
Definition: u6_actor.h:46
Definition: obj_manager.h:75