Initial commit

This commit is contained in:
2026-02-02 04:50:13 +01:00
commit 5b11698731
22592 changed files with 7677434 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,743 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef NUVIE_ACTORS_ACTOR_H
#define NUVIE_ACTORS_ACTOR_H
#include "ultima/shared/std/containers.h"
#include "ultima/shared/std/string.h"
#include "ultima/nuvie/misc/actor_list.h"
#include "ultima/nuvie/core/map.h"
#include "ultima/nuvie/core/obj_manager.h"
namespace Ultima {
namespace Nuvie {
using Std::list;
using Std::string;
using Std::vector;
#define ACTOR_NO_READIABLE_LOCATION -1
#define ACTOR_HEAD 0
#define ACTOR_NECK 1
#define ACTOR_BODY 2
#define ACTOR_ARM 3
#define ACTOR_ARM_2 4
#define ACTOR_HAND 5
#define ACTOR_HAND_2 6
#define ACTOR_FOOT 7
#define ACTOR_NOT_READIABLE 8
// actor alignment
enum ActorAlignment {
ACTOR_ALIGNMENT_DEFAULT = 0,
ACTOR_ALIGNMENT_NEUTRAL = 1,
ACTOR_ALIGNMENT_EVIL = 2,
ACTOR_ALIGNMENT_GOOD = 3,
ACTOR_ALIGNMENT_CHAOTIC = 4,
};
// move-flags
#define ACTOR_FORCE_MOVE 1
#define ACTOR_IGNORE_OTHERS 2
#define ACTOR_OPEN_DOORS 4
#define ACTOR_IGNORE_DANGER 8
#define ACTOR_IGNORE_MOVES 0x10
#define ACTOR_IGNORE_PARTY_MEMBERS 0x20 // only used in Actor::check_move. In U6, player diagonal movement
// between two blocked tiles isn't allowed (non-party actors block)
// push-flags (exclusive)
#define ACTOR_PUSH_ANYWHERE 0
#define ACTOR_PUSH_HERE 1
#define ACTOR_PUSH_FORWARD 2
#define ACTOR_SHOW_BLOOD true
#define ACTOR_FORCE_HIT true
#define ACTOR_STATUS_PROTECTED 0x1
#define ACTOR_STATUS_PARALYZED 0x2
#define ACTOR_STATUS_ASLEEP 0x4
#define ACTOR_STATUS_POISONED 0x8
#define ACTOR_STATUS_DEAD 0x10
#define ACTOR_STATUS_ATTACK_EVIL 0x20
#define ACTOR_STATUS_ATTACK_GOOD 0x40
#define ACTOR_STATUS_IN_PARTY 0x80
#define ACTOR_STATUS_ALIGNMENT_MASK 0x60
#define ACTOR_MOVEMENT_HIT_FLAG 0x8
#define ACTOR_MOVEMENT_FLAGS_OLD_ALIGNMENT_MASK 0x60
#define ACTOR_OBJ_FLAG_
#define ACTOR_NO_ERROR 0
#define ACTOR_OUT_OF_MOVES 1
#define ACTOR_BLOCKED 2
#define ACTOR_BLOCKED_BY_OBJECT 3
#define ACTOR_BLOCKED_BY_ACTOR 4
#define ACTOR_MAX_READIED_OBJECTS 8
#define ACTOR_WT_FOLLOW 1
#define ACTOR_WT_PLAYER 2
#define ACTOR_WT_RANGED 4
#define ACTOR_WT_RETREAT 7
#define ACTOR_WT_ASSAULT 8
#define ACTOR_CHANGE_BASE_OBJ_N true
#define ACTOR_VEHICLE_ID_N 0
#define ACTOR_AVATAR_ID_N 1
#define INV_EXCLUDE_READIED_OBJECTS false
#define INV_INCLUDE_READIED_OBJECTS true
#define ACTOR_MD_OBJ_FLAG_HYPOXIA 6
#define ACTOR_MD_OBJ_FLAG_FRENZY 7
#define ACTOR_MD_STATUS_FLAG_COLD 0
class Map;
class MapCoord;
class UseCode;
class ActorPathFinder;
class U6LList;
class GameClock;
class Path;
typedef struct {
uint16 x;
uint16 y;
uint8 z;
uint8 hour;
uint8 day_of_week; // 0 = any day 1..7
uint8 worktype;
} Schedule;
typedef enum { ATTACK_TYPE_NONE, ATTACK_TYPE_HAND, ATTACK_TYPE_THROWN, ATTACK_TYPE_MISSLE } AttackType;
typedef struct {
uint16 obj_n;
union {
uint8 defence;
uint8 defense;
};
union {
uint8 attack;
uint8 damage;
};
uint16 hit_range;
AttackType attack_type;
uint16 missle_tile_num;
uint16 thrown_obj_n;
bool breaks_on_contact;
} CombatType;
typedef struct {
Obj *obj;
const CombatType *combat_type;
bool double_handed;
} ReadiedObj;
typedef uint8 ActorErrorCode;
typedef struct {
ActorErrorCode err;
Obj *blocking_obj;
Actor *blocking_actor;
} ActorError;
typedef uint8 ActorMoveFlags;
typedef enum {
ACTOR_ST, // single tile
ACTOR_DT, // double tile
ACTOR_QT, // quad tile
ACTOR_MT // multi tile
} ActorTileType;
class Actor {
friend class ActorManager;
friend class MapWindow;
friend class Party;
friend class Player;
friend class U6UseCode;
public:
struct cmp_level {
bool operator()(Actor *a1, Actor *a2) const {
return (a1->level > a2->level);
}
};
struct cmp_dex {
bool operator()(Actor *a1, Actor *a2) const {
return (a1->dex > a2->dex);
}
};
struct cmp_moves {
bool operator()(Actor *a1, Actor *a2) const {
return (a1->moves > a2->moves);
}
};
struct cmp_move_fraction {
bool operator()(Actor *a1, Actor *a2) const {
if (a1->dex == 0) {
a1->dex = 1;
DEBUG(0, LEVEL_WARNING, "%s (%d) has 0 dex!\n", a1->get_name(), a1->id_n);
}
if (a2->dex == 0) {
a2->dex = 1;
DEBUG(0, LEVEL_WARNING, "%s (%d) has 0 dex!\n", a2->get_name(), a2->id_n);
}
return (a1->moves / a1->dex > a2->moves / a2->dex);
}
};
struct cmp_distance_to_loc {
MapCoord cmp_loc;
void operator()(const MapCoord &cmp_loc2) {
cmp_loc = cmp_loc2;
}
bool operator()(Actor *a1, Actor *a2) {
MapCoord loc1(a1->x, a1->y, a1->z);
MapCoord loc2(a2->x, a2->y, a2->z);
return (loc1.distance(cmp_loc) < loc2.distance(cmp_loc));
}
};
protected:
uint8 id_n;
Map *map;
ObjManager *obj_manager;
GameClock *_clock;
UseCode *usecode;
ActorPathFinder *pathfinder;
uint16 x;
uint16 y;
uint16 z;
uint8 worktype;
MapCoord work_location;
uint32 move_time; // time (in clock ticks) of last update() (for display)
// FIXME: replace with animation
uint16 obj_n;
uint16 frame_n;
uint16 base_obj_n;
uint16 old_frame_n;
NuvieDir direction;
uint8 walk_frame;
uint8 obj_flags;
uint8 status_flags;
uint8 talk_flags;
uint8 movement_flags; //0x19f1
bool ethereal;
bool can_move;
bool temp_actor;
bool met_player;
bool visible_flag;
// bool active; // "cached in"
sint8 moves; // number of moves actor has this turn
uint8 light; // level of light around actor (normally 0)
vector<uint8> light_source;
ActorError error_struct; // error/status; result of previous action
uint8 strength;
uint8 dex;
uint8 intelligence;
uint8 hp;
uint8 level;
uint16 exp;
uint8 magic;
uint8 combat_mode;
ActorAlignment alignment;
uint8 body_armor_class;
uint8 readied_armor_class;
string name;
ReadiedObj *readied_objects[ACTOR_MAX_READIED_OBJECTS];
Schedule **sched;
int num_schedules;
U6LList *obj_inventory;
//current schedule pos;
uint16 sched_pos;
list<Obj *> surrounding_objects; //used for multi-tile actors.
Common::HashMap<uint16, uint16> *custom_tile_tbl;
public:
Actor(Map *m, ObjManager *om, GameClock *c);
virtual ~Actor();
virtual bool init(uint8 obj_status = NO_OBJ_STATUS);
void init_from_obj(Obj *obj, bool change_base_obj = false);
bool is_avatar() const {
return id_n == ACTOR_AVATAR_ID_N;
}
bool is_onscreen() const {
return MapCoord(x, y, z).is_visible();
}
bool is_in_party() const {
return ((status_flags & ACTOR_STATUS_IN_PARTY) == ACTOR_STATUS_IN_PARTY);
}
bool is_in_vehicle() const;
bool is_visible() const {
return visible_flag;
}
bool is_alive() const {
return (status_flags & ACTOR_STATUS_DEAD) ? false : true;
}
bool is_nearby(const Actor *other) const;
bool is_nearby(uint8 actor_num) const;
bool is_nearby(const MapCoord &where, uint8 thresh = 5) const;
bool is_at_position(const Obj *obj) const;
virtual bool is_passable() const;
bool is_temp() const {
return temp_actor;
}
virtual bool isFlying() const {
return false;
}
virtual bool isNonBlocking() const {
return false;
}
/**
* @brief Does any tile of this actor occupy the given world location?
* @param lx world coordinate
* @param ly world coordinate
* @param lz level
* @param incDoubleTile include all tiles of double width/height actors
* @param incSurroundingObjs include surrounding actor objects
* @return true if actor occupies location, false otherwise
*/
virtual bool doesOccupyLocation(uint16 lx, uint16 ly, uint8 lz, bool incDoubleTile = true, bool incSurroundingObjs = true) const;
//for lack of a better name:
bool is_met() const {
return talk_flags & 0x01;
}
bool is_poisoned() const {
return status_flags & ACTOR_STATUS_POISONED;
}
bool is_invisible() const {
return obj_flags & OBJ_STATUS_INVISIBLE;
}
virtual bool is_immobile() const; // frozen by worktype or status
virtual bool is_sleeping() const {
return status_flags & ACTOR_STATUS_ASLEEP;
}
virtual bool is_paralyzed() const {
return status_flags & ACTOR_STATUS_PARALYZED;
}
virtual bool is_protected() const {
return status_flags & ACTOR_STATUS_PROTECTED;
}
virtual bool is_charmed() const {
return obj_flags & OBJ_STATUS_CHARMED;
}
virtual bool is_cursed() const {
return obj_flags & OBJ_STATUS_CURSED;
}
virtual bool get_corpser_flag() const {
return false;
}
bool is_hit() const {
return movement_flags & ACTOR_MOVEMENT_HIT_FLAG;
}
void set_name(const char *actor_name) {
name = actor_name;
}
const char *get_name(bool force_real_name = false);
void get_location(uint16 *ret_x, uint16 *ret_y, uint8 *ret_level) const;
MapCoord get_location() const;
uint16 get_tile_num() const;
Tile *get_tile() const;
virtual uint16 get_downward_facing_tile_num() const;
uint8 get_actor_num() const {
return id_n;
}
uint8 get_talk_flags() const {
return talk_flags;
}
virtual ActorTileType get_tile_type() const {
return ACTOR_ST;
}
uint16 get_frame_n() const {
return frame_n;
}
uint16 get_old_frame_n() const {
return old_frame_n;
}
uint16 get_x() const {
return x;
}
uint16 get_y() const {
return y;
}
uint8 get_z() const {
return z;
}
uint8 get_strength() const {
return strength;
}
uint8 get_dexterity() const {
return dex;
}
uint8 get_intelligence() const {
return intelligence;
}
uint8 get_hp() const {
return hp;
}
virtual uint8 get_hp_text_color() const {
return 0;
}
virtual uint8 get_str_text_color() const {
return 0;
}
virtual uint8 get_dex_text_color() const {
return 0;
}
uint8 get_level() const {
return level;
}
uint16 get_exp() const {
return exp;
}
uint8 get_magic() const {
return magic;
}
ActorAlignment get_alignment() const {
return alignment;
}
uint8 get_old_alignment() const {
return ((movement_flags & ACTOR_MOVEMENT_FLAGS_OLD_ALIGNMENT_MASK) >> 5) + 1;
}
sint8 get_moves_left() const {
return moves;
}
virtual uint8 get_maxhp() const {
return 0;
}
virtual uint8 get_maxmagic() const {
return 0;
}
bool get_obj_flag(uint8 bitFlag) const {
return bitFlag < 8 ? (obj_flags & (1 << bitFlag)) : false;
}
bool get_status_flag(uint8 bitFlag) const {
return bitFlag < 8 ? (status_flags & (1 << bitFlag)) : false;
}
uint16 get_base_obj_n() const {
return base_obj_n;
}
virtual void change_base_obj_n(uint16 val) {
base_obj_n = obj_n = val;
frame_n = 0;
}
void set_obj_n(uint16 val) {
obj_n = val;
}
void set_frame_n(uint16 val) {
frame_n = val;
}
void set_strength(uint8 val) {
strength = val;
}
void set_dexterity(uint8 val) {
dex = val;
}
void set_intelligence(uint8 val) {
intelligence = val;
}
void set_hp(uint8 val);
void set_level(uint8 val) {
level = val;
}
void set_exp(uint16 val) {
exp = clamp_max(val, 9999);
}
void set_magic(uint8 val) {
magic = val;
}
void set_alignment(ActorAlignment a) {
alignment = a;
}
void set_old_alignment(ActorAlignment a) {
if (a > 0 && a < 5) {
movement_flags |= (a - 1) << 5;
}
}
uint8 get_light_level() const;
void add_light(uint8 val);
void subtract_light(uint8 val);
void heal() {
set_hp(get_maxhp());
}
void cure();
void set_moves_left(sint8 val);
void set_dead_flag(bool value);
virtual void update_time() {
set_moves_left(get_moves_left() + get_dexterity());
}
void set_poisoned(bool poisoned);
virtual void set_paralyzed(bool paralyzed) {
return;
}
virtual void set_protected(bool val) {
return;
}
virtual void set_charmed(bool val) {
return;
}
virtual void set_corpser_flag(bool val) {
return;
}
virtual void set_cursed(bool val) {
return;
}
virtual void set_asleep(bool val) {
return;
}
void set_obj_flag(uint8 bitFlag, bool value);
void set_status_flag(uint8 bitFlag, bool value);
void set_hit_flag(bool val);
void set_invisible(bool invisible);
void set_custom_tile_num(uint16 obj_num, uint16 tile_num);
uint8 get_worktype();
uint8 get_sched_worktype();
virtual void set_worktype(uint8 new_worktype, bool init = false);
uint8 get_combat_mode() const {
return combat_mode;
}
void set_combat_mode(uint8 new_mode);
virtual void revert_worktype() { }
NuvieDir get_direction() const {
return direction;
}
void set_direction(sint16 rel_x, sint16 rel_y);
virtual void set_direction(NuvieDir d);
void face_location(const MapCoord &loc);
virtual void face_location(uint16 lx, uint16 ly);
void face_actor(Actor *a);
void set_talk_flags(uint8 newflags) {
talk_flags = newflags;
}
uint8 get_flag(uint8 bitflag);
void set_flag(uint8 bitflag);
void clear_flag(uint8 bitflag);
void show();
void hide();
void set_error(ActorErrorCode err);
void clear_error();
ActorError *get_error();
const list<Obj *> &get_surrounding_obj_list() const {
return surrounding_objects;
}
void add_surrounding_obj(Obj *obj);
void unlink_surrounding_objects(bool make_objects_temporary = false);
bool moveRelative(sint16 rel_x, sint16 rel_y, ActorMoveFlags flags = 0);
virtual bool move(uint16 new_x, uint16 new_y, uint8 new_z, ActorMoveFlags flags = 0);
virtual bool check_move(uint16 new_x, uint16 new_y, uint8 new_z, ActorMoveFlags flags = 0);
bool check_moveRelative(sint16 rel_x, sint16 rel_y, ActorMoveFlags flags = 0);
virtual bool can_be_moved();
virtual bool can_be_passed(const Actor *other, bool ignoreParty = false) const;
virtual void update();
void set_in_party(bool state);
void set_pathfinder(ActorPathFinder *new_pf, Path *path_type = 0);
ActorPathFinder *get_pathfinder() {
return pathfinder;
}
void delete_pathfinder();
virtual void pathfind_to(const MapCoord &d);
void pathfind_to(uint16 gx, uint16 gy, uint8 gz = 255);
bool walk_path();
virtual void preform_worktype() {
return;
}
// combat methods
//void attack(const MapCoord &pos); // attack at a given map location
Obj *get_weapon_obj(sint8 readied_obj_location);
void attack(sint8 readied_obj_location, MapCoord target, Actor *foe = nullptr);
const CombatType *get_weapon(sint8 readied_obj_location);
void attract_to(Actor *target);
void repel_from(Actor *target);
void hit(uint8 dmg, bool force_hit = false);
void reduce_hp(uint8 amount);
virtual void die(bool create_body = true);
void resurrect(const MapCoord &new_position, Obj *body_obj = nullptr);
uint8 get_range(uint16 target_x, uint16 target_y);
bool weapon_can_hit(const CombatType *weapon, uint16 target_x, uint16 target_y);
virtual bool weapon_can_hit(const CombatType *weapon, Actor *target, uint16 *hit_x, uint16 *hit_y) {
*hit_x = target->get_x();
*hit_y = target->get_y();
return true;
}
void display_condition();
ActorList *find_enemies(); // returns list or 0 if no enemies nearby
U6LList *get_inventory_list();
const U6LList *get_inventory_list() const;
bool inventory_has_object(uint16 obj_n, uint8 qual = 0, bool match_quality = OBJ_MATCH_QUALITY, uint8 frame_n = 0, bool match_frame_n = OBJ_NOMATCH_FRAME_N);
uint32 inventory_count_objects(bool inc_readied_objects) const;
uint32 inventory_count_object(uint16 obj_n);
Obj *inventory_get_object(uint16 obj_n, uint8 qual = 0, bool match_quality = OBJ_MATCH_QUALITY, uint8 frame_n = 0, bool match_frame_n = OBJ_NOMATCH_FRAME_N);
bool is_double_handed_obj_readied();
Obj *inventory_get_readied_object(uint8 location);
sint16 inventory_get_readied_obj_n(uint8 location) {
return (inventory_get_readied_object(location) == nullptr ? -1 : inventory_get_readied_object(location)->obj_n);
}
virtual Obj *inventory_get_food(Obj *container = 0) {
return 0;
}
const CombatType *inventory_get_readied_object_combat_type(uint8 location);
bool inventory_add_object(Obj *obj, Obj *container = 0, bool stack = true);
bool inventory_add_object_nostack(Obj *obj, Obj *container = 0) {
return inventory_add_object(obj, container, false);
}
void inventory_del_all_objs();
bool inventory_remove_obj(Obj *obj, bool run_usecode = true);
Obj *inventory_new_object(uint16 obj_n, uint32 qty, uint8 quality = 0);
uint32 inventory_del_object(uint16 obj_n, uint32 qty, uint8 quality);
float inventory_get_max_weight() const {
return strength * 2;
}
float get_inventory_weight() const;
float get_inventory_equip_weight();
void inventory_drop_all();
void all_items_to_container(Obj *container_obj, bool stack);
bool can_carry_weight(Obj *obj) const;
bool can_carry_weight(float obj_weight) const; // return from get_obj_weight()
virtual bool can_carry_object(uint16 obj_n, uint32 qty = 0) const;
virtual bool can_carry_object(Obj *obj) const;
virtual uint8 get_object_readiable_location(Obj *obj);
virtual const CombatType *get_object_combat_type(uint16 objN) {
return nullptr;
}
bool can_ready_obj(Obj *obj);
bool add_readied_object(Obj *obj);
void remove_readied_object(Obj *obj, bool run_usecode = true); // run_usecode to stop from running usecode twice or an infinite loop
void remove_readied_object(uint8 location, bool run_usecode = true);
void remove_all_readied_objects();
bool has_readied_objects();
sint8 count_readied_objects(sint32 obj_n = -1, sint16 frame_n = -1, sint16 quality = -1);
virtual void twitch() {
return;
}
bool push(Actor *pusher, uint8 where = ACTOR_PUSH_ANYWHERE);
Obj *make_obj();
uint16 get_obj_n() const {
return obj_n;
}
virtual void clear();
virtual bool morph(uint16 obj_n); // change actor type
bool get_schedule_location(MapCoord *loc) const;
bool is_at_scheduled_location() const;
int get_number_of_schedules() const {
return num_schedules;
}
Schedule *get_schedule(uint8 index);
virtual bool will_not_talk() const {
return false;
}
uint16 get_custom_tile_num(uint16 obj_num) const;
protected:
void loadSchedule(const unsigned char *schedule_data, uint16 num);
virtual bool updateSchedule(uint8 hour, bool teleport = false);
uint16 getSchedulePos(uint8 hour);
// uint16 getSchedulePos(uint8 hour, uint8 day_of_week);
// inline uint16 Actor::getSchedulePos(uint8 hour);
void inventory_parse_readied_objects(); //this is used to initialise the readied_objects array on load.
virtual const CombatType *get_hand_combat_type() const {
return nullptr;
}
virtual void set_ethereal(bool val) {
ethereal = val;
}
virtual void print();
virtual void handle_lightsource(uint8 hour) {
return;
}
virtual const char *get_worktype_string(uint32 wt) const {
return nullptr;
}
Obj *find_body();
uint16 get_tile_num(uint16 obj_num) const;
uint8 get_num_light_sources() const {
return light_source.size();
}
private:
};
const char *get_actor_alignment_str(ActorAlignment alignment);
} // End of namespace Nuvie
} // End of namespace Ultima
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,173 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef NUVIE_ACTORS_ACTOR_MANAGER_H
#define NUVIE_ACTORS_ACTOR_MANAGER_H
#include "ultima/shared/std/string.h"
#include "ultima/nuvie/core/obj_manager.h"
#include "ultima/nuvie/misc/actor_list.h"
#include "ultima/nuvie/actors/actor.h"
namespace Ultima {
namespace Nuvie {
class Configuration;
class Map;
class TileManager;
class GameClock;
class MapCoord;
#define ACTORMANAGER_MAX_ACTORS 256
class ActorManager {
const Configuration *config;
TileManager *tile_manager;
ObjManager *obj_manager;
bool update; // ActorManager is not paused
bool wait_for_player; // Player's turn; wait until updateActors() is called
bool combat_movement; // Defines actor movement type (individual/party)
bool should_clean_temp_actors; // If set, temp actors are cleaned when > 19 tiles from player.
Map *map;
Actor *actors[ACTORMANAGER_MAX_ACTORS];
uint8 player_actor;
uint8 temp_actor_offset;
GameClock *_clock;
uint16 last_obj_blk_x, last_obj_blk_y;
uint8 last_obj_blk_z;
uint16 cur_x, cur_y;
uint8 cur_z;
MapCoord *cmp_actor_loc; // data for sort_distance() & cmp_distance_to_loc()
public:
ActorManager(const Configuration *cfg, Map *m, TileManager *tm, ObjManager *om, GameClock *c);
~ActorManager();
void init();
void clean();
bool load(NuvieIO *objlist);
bool save(NuvieIO *objlist);
// ActorList
ActorList *get_actor_list(); // *returns a NEW list*
ActorList *sort_nearest(ActorList *list, uint16 x, uint16 y, uint8 z); // ascending distance
ActorList *filter_distance(ActorList *list, uint16 x, uint16 y, uint8 z, uint16 dist);
ActorList *filter_alignment(ActorList *list, ActorAlignment align);
ActorList *filter_party(ActorList *list);
Actor *get_actor(uint8 actor_num) const;
Actor *get_actor(uint16 x, uint16 y, uint8 z, bool inc_surrounding_objs = true, Actor *excluded_actor = nullptr);
Actor *get_actor_holding_obj(Obj *obj);
private:
Actor *findActorAtImpl(uint16 x, uint16 y, uint8 z, bool(*predicateWrapper)(void *, const Actor *), bool incDoubleTile, bool incSurroundingObjs, void *predicate) const;
public:
/**
* @brief Find first actor at location for which predicate function returns true
* @param x world coordinate
* @param y world coordinate
* @param z level
* @param predicate predicate function/lambda of the form: bool f(const Actor*)
* @param incDoubleTile include all tiles of double width/height actors
* @param incSurroundingObjs include surrounding actor objects
* @return pointer to actor or nullptr
*/
template<typename F>
Actor *findActorAt(uint16 x, uint16 y, uint8 z, F predicate, bool incDoubleTile = true, bool incSurroundingObjs = true) {
// This is a template so it can take lambdas.
// To keep the implementation out of the header, the type of the passed lambda/function
// is hidden inside a wrapping lambda, which is then passed as a function pointer.
// TODO: Use a class for this.
auto predicateWrapper = +[](void *wrappedPredicate, const Actor *a) -> bool {
return (*(F*)wrappedPredicate)(a);
};
return findActorAtImpl(x, y, z, predicateWrapper, incDoubleTile, incSurroundingObjs, &predicate);
}
Actor *get_avatar();
Actor *get_player();
void set_player(Actor *a);
const char *look_actor(const Actor *a, bool show_prefix = true);
void set_update(bool u) {
update = u;
}
bool get_update() const {
return update;
}
void set_combat_movement(bool c);
void updateActors(uint16 x, uint16 y, uint8 z);
void twitchActors();
void moveActors();
void startActors();
void updateSchedules(bool teleport = false);
void clear_actor(Actor *actor);
bool resurrect_actor(Obj *actor_obj, MapCoord new_position);
bool is_temp_actor(Actor *actor);
bool is_temp_actor(uint8 id_n);
bool create_temp_actor(uint16 obj_n, uint8 obj_status, uint16 x, uint16 y, uint8 z, ActorAlignment alignment, uint8 worktype, Actor **new_actor = nullptr);
bool clone_actor(Actor *actor, Actor **new_actor, MapCoord new_location);
bool toss_actor(Actor *actor, uint16 xrange, uint16 yrange);
bool toss_actor_get_location(uint16 start_x, uint16 start_y, uint8 start_z, uint16 xrange, uint16 yrange, MapCoord *location);
void print_actor(Actor *actor);
bool can_put_actor(const MapCoord &location);
void enable_temp_actor_cleaning(bool value) {
should_clean_temp_actors = value;
}
protected:
Actor *get_multi_tile_actor(uint16 x, uint16 y, uint8 z);
bool loadActorSchedules();
inline Actor *find_free_temp_actor();
inline ActorList *filter_active_actors(ActorList *list, uint16 x, uint16 y, uint8 z);
void update_temp_actors(uint16 x, uint16 y, uint8 z);
void clean_temp_actors_from_level(uint8 level);
void clean_temp_actors_from_area(uint16 x, uint16 y);
inline void clean_temp_actor(Actor *actor);
private:
bool loadCustomTiles(nuvie_game_t game_type);
void loadNPCTiles(const Common::Path &datadir);
void loadAvatarTiles(const Common::Path &datadir);
void loadCustomBaseTiles();
Std::vector<Std::string> getCustomTileFilenames(const Common::Path &datadir, const Std::string &filenamePrefix);
};
} // End of namespace Nuvie
} // End of namespace Ultima
#endif

View File

@@ -0,0 +1,150 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "ultima/nuvie/actors/md_actor.h"
#include "ultima/nuvie/core/game.h"
#include "ultima/nuvie/core/game_clock.h"
#include "ultima/nuvie/pathfinder/dir_finder.h"
namespace Ultima {
namespace Nuvie {
#define MD_DOWNWARD_FACING_FRAME_N 9
extern const uint8 walk_frame_tbl[4];
MDActor::MDActor(Map *m, ObjManager *om, GameClock *c) : WOUActor(m, om, c) {
}
MDActor::~MDActor() {
}
bool MDActor::init(uint8) {
Actor::init();
return true;
}
bool MDActor::will_not_talk() const {
if (worktype == 0xa0)
return true;
return false;
}
bool MDActor::is_immobile() const {
return (obj_n == 294 || obj_n == 295 || obj_n == 318 || obj_n == 319); //avatar wall walking objects
}
bool MDActor::check_move(uint16 new_x, uint16 new_y, uint8 new_z, ActorMoveFlags flags) {
if (ethereal)
return true;
if (Actor::check_move(new_x, new_y, new_z, flags) == false)
return false;
if (z == new_z) { //FIXME check if new pos is adjacent to current position
NuvieDir movement_dir = DirFinder::get_nuvie_dir(x, y, new_x, new_y, z);
// printf("%d (%d,%d) -> (%d,%d) move = %d %s\n", id_n, x, y, new_x, new_y, movement_dir, get_direction_name(movement_dir));
return map->is_passable(new_x, new_y, new_z, movement_dir);
}
return map->is_passable(new_x, new_y, new_z);
}
uint16 MDActor::get_downward_facing_tile_num() const {
return get_tile_num(base_obj_n) + (uint16) MD_DOWNWARD_FACING_FRAME_N;
}
uint8 MDActor::get_hp_text_color() const {
if (is_poisoned())
return 4;
if (get_status_flag(ACTOR_MD_STATUS_FLAG_COLD))
return 0xf;
if (get_hp() <= 10)
return 0xc;
if (get_obj_flag(ACTOR_MD_OBJ_FLAG_HYPOXIA))
return 9;
if (get_obj_flag(ACTOR_MD_OBJ_FLAG_FRENZY) && id_n != 1)
return 1;
return 0;
}
uint8 MDActor::get_str_text_color() const {
uint8 color = 0;
if (get_obj_flag(ACTOR_MD_OBJ_FLAG_HYPOXIA))
color = 9;
if (id_n <= 0xf && Game::get_game()->get_clock()->get_purple_berry_counter(id_n) > 0) {
color = 0xd;
} else if (get_obj_flag(ACTOR_MD_OBJ_FLAG_FRENZY)) { //battle frenzy
color = 1;
}
return color;
}
uint8 MDActor::get_dex_text_color() const {
uint8 color = 0;
if (get_obj_flag(ACTOR_MD_OBJ_FLAG_HYPOXIA))
color = 9;
else if (get_obj_flag(ACTOR_MD_OBJ_FLAG_FRENZY)) {
color = 1;
}
return color;
}
void MDActor::set_direction(NuvieDir d) {
if (!is_alive() || is_immobile())
return;
if (d < 4)
direction = d;
if (obj_n == 391) { //mother only has two (downward facing) tiles
frame_n = (uint16)(frame_n ? 0 : 1);
return;
}
uint8 num_walk_frames = 2;
if (obj_n >= 342 && obj_n <= 358) {
num_walk_frames = 4;
}
walk_frame = (uint8)((walk_frame + 1) % num_walk_frames);
frame_n = direction * num_walk_frames + walk_frame_tbl[walk_frame];
}
bool MDActor::is_passable() const {
if (obj_n == 391) { //FIXME hack for mother.
return false;
}
return Actor::is_passable();
}
} // End of namespace Nuvie
} // End of namespace Ultima

View File

@@ -0,0 +1,56 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef NUVIE_ACTORS_MD_ACTOR_H
#define NUVIE_ACTORS_MD_ACTOR_H
#include "ultima/nuvie/actors/wou_actor.h"
namespace Ultima {
namespace Nuvie {
class MDActor: public WOUActor {
public:
MDActor(Map *m, ObjManager *om, GameClock *c);
~MDActor() override;
bool init(uint8 unused = 0) override;
bool will_not_talk() const override;
uint8 get_maxhp() const override {
return (((level * 24 + strength * 2) < 255) ? (level * 24 + strength * 2) : 255);
}
uint8 get_hp_text_color() const override;
uint8 get_str_text_color() const override;
uint8 get_dex_text_color() const override;
bool is_immobile() const override;
bool check_move(uint16 new_x, uint16 new_y, uint8 new_z, ActorMoveFlags flags = 0) override;
uint16 get_downward_facing_tile_num() const override;
void set_direction(NuvieDir d) override;
bool is_passable() const override;
};
} // End of namespace Nuvie
} // End of namespace Ultima
#endif

View File

@@ -0,0 +1,45 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "ultima/nuvie/actors/se_actor.h"
namespace Ultima {
namespace Nuvie {
SEActor::SEActor(Map *m, ObjManager *om, GameClock *c): WOUActor(m, om, c) {
}
SEActor::~SEActor() {
}
bool SEActor::init(uint8) {
Actor::init();
return true;
}
bool SEActor::will_not_talk() const {
if (worktype == 0x07 || worktype == 0x8 || worktype == 0x9b)
return true;
return false;
}
} // End of namespace Nuvie
} // End of namespace Ultima

View File

@@ -0,0 +1,47 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef NUVIE_ACTORS_SE_ACTOR_H
#define NUVIE_ACTORS_SE_ACTOR_H
#include "ultima/nuvie/actors/wou_actor.h"
#include "ultima/nuvie/misc/actor_list.h"
namespace Ultima {
namespace Nuvie {
class SEActor: public WOUActor {
public:
SEActor(Map *m, ObjManager *om, GameClock *c);
~SEActor() override;
bool init(uint8 unused = 0) override;
bool will_not_talk() const override;
uint8 get_maxhp() const override {
return (((level * 4 + strength * 2) < 255) ? (level * 4 + strength * 2) : 255);
}
};
} // End of namespace Nuvie
} // End of namespace Ultima
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,205 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef NUVIE_ACTORS_U6_ACTOR_H
#define NUVIE_ACTORS_U6_ACTOR_H
#include "ultima/nuvie/actors/actor.h"
#include "ultima/nuvie/misc/actor_list.h"
#include "ultima/nuvie/core/u6_objects.h"
namespace Ultima {
namespace Nuvie {
enum ActorMovetype {
MOVETYPE_U6_NONE = 0,
MOVETYPE_U6_LAND = 1,
MOVETYPE_U6_WATER_LOW = 2, // skiffs, rafts
MOVETYPE_U6_WATER_HIGH = 3, // ships
MOVETYPE_U6_AIR_LOW = 4, // balloon, birds... this movetype cannot cross mountain tops.
MOVETYPE_U6_AIR_HIGH = 5, // dragons
MOVETYPE_U6_ETHEREAL = 6,
};
#define REMOVE_SURROUNDING_OBJS true
#define ACTOR_MOVEMENT_FLAGS_CORPSER 0x10
typedef struct {
uint16 base_obj_n;
uint8 frames_per_direction;
uint8 tiles_per_direction;
uint8 tiles_per_frame;
uint8 tile_start_offset; //used for ships where the frame_n starts at 8
uint16 dead_obj_n;
uint8 dead_frame_n;
bool can_laydown;
bool can_sit;
ActorTileType tile_type;
ActorMovetype movetype;
uint16 twitch_rand; //used to control how frequently an actor twitches, lower numbers twitch more
uint8 body_armor_class;
} U6ActorType;
class U6Actor: public Actor {
protected:
const U6ActorType *actor_type;
const U6ActorType *base_actor_type;
ActorMovetype current_movetype;
sint8 walk_frame_inc; // added to walk_frame each step
public:
U6Actor(Map *m, ObjManager *om, GameClock *c);
~U6Actor() override;
bool init(uint8 obj_status = NO_OBJ_STATUS) override;
uint16 get_downward_facing_tile_num() const override;
bool updateSchedule(uint8 hour, bool teleport = false) override;
void set_worktype(uint8 new_worktype, bool init = false) override;
void revert_worktype() override;
void change_base_obj_n(uint16 val) override;
void set_direction(NuvieDir d) override;
void face_location(uint16 lx, uint16 ly) override;
void clear() override;
bool move(uint16 new_x, uint16 new_y, uint8 new_z, ActorMoveFlags flags = 0) override;
bool check_move(uint16 new_x, uint16 new_y, uint8 new_z, ActorMoveFlags flags = 0) override;
void twitch() override;
void do_twitch();
void die(bool create_body = true) override;
void set_paralyzed(bool paralyzed) override;
void set_protected(bool val) override;
void set_charmed(bool val) override;
void set_corpser_flag(bool val) override;
void set_cursed(bool val) override;
void set_asleep(bool val) override;
void set_ethereal(bool val) override {
current_movetype = val ? MOVETYPE_U6_ETHEREAL : actor_type->movetype;
ethereal = val;
}
uint8 get_object_readiable_location(Obj *obj) override;
const CombatType *get_object_combat_type(uint16 objN) override;
ActorTileType get_tile_type() const override {
return (actor_type->tile_type);
}
Obj *inventory_get_food(Obj *container = 0) override;
uint8 get_maxhp() const override {
return (((level * 30) <= 255) ? (level * 30) : 255); // U6
}
uint8 get_maxmagic() const override;
bool weapon_can_hit(const CombatType *weapon, Actor *target, uint16 *hit_x, uint16 *hit_y) override;
bool is_immobile() const override; // frozen by worktype or status
bool can_twitch();
bool get_corpser_flag() const override {
return (movement_flags & ACTOR_MOVEMENT_FLAGS_CORPSER);
}
bool can_be_passed(const Actor *other, bool ignoreParty) const override;
bool will_not_talk() const override;
void set_actor_obj_n(uint16 new_obj_n);
void pathfind_to(const MapCoord &d) override;
void handle_lightsource(uint8 hour) override;
uint8 get_hp_text_color() const override;
uint8 get_str_text_color() const override {
return 0x48;
}
uint8 get_dex_text_color() const override {
return 0x48;
}
bool isFlying() const override {
// FIXME: Get flying flag from lua actor_tbl
// in devtools/create_ultima/files/ultima6/scripts/u6/actor.lua
const uint16 flyingObjs[] = {
OBJ_U6_INSECTS, OBJ_U6_GIANT_BAT, OBJ_U6_GAZER, OBJ_U6_BIRD,
OBJ_U6_WINGED_GARGOYLE, OBJ_U6_DAEMON, OBJ_U6_DRAKE,
OBJ_U6_MONGBAT, OBJ_U6_DRAGON, OBJ_U6_INFLATED_BALLOON };
for (const auto flyingObj : flyingObjs)
if (obj_n == flyingObj)
return true;
return false;
}
bool isNonBlocking() const override {
// These are hard-coded in original U6
const uint16 u6NonBlockingObjs[] = {
OBJ_U6_INSECTS, OBJ_U6_MOUSE, OBJ_U6_BIRD, OBJ_U6_CORPSER,
OBJ_U6_RABBIT };
for (const auto nonBlockingObj : u6NonBlockingObjs)
if (obj_n == nonBlockingObj)
return true;
return false;
}
protected:
bool init_ship();
bool init_splitactor(uint8 obj_status); //cows, horses etc.
bool init_dragon();
bool init_hydra();
bool init_silver_serpent();
void init_new_silver_serpent();
void gather_snake_objs_from_map(Obj *start_obj, uint16 ax, uint16 ay, uint16 az);
inline bool check_move_silver_serpent(uint16 x, uint16 y);
bool sit_on_chair(Obj *obj);
inline void discover_direction();
void setup_walk_to_location();
void wt_sleep(bool init = false);
void wt_play_lute();
inline const U6ActorType *get_actor_type(uint16 new_obj_n);
inline bool has_surrounding_objs();
inline void remove_surrounding_objs_from_map();
inline void add_surrounding_objs_to_map();
inline void move_surrounding_objs_relative(sint16 rel_x, sint16 rel_y);
inline void move_silver_serpent_objs_relative(sint16 rel_x, sint16 rel_y);
inline void set_direction_of_surrounding_objs(NuvieDir new_direction);
inline void set_direction_of_surrounding_ship_objs(NuvieDir new_direction);
inline void set_direction_of_surrounding_splitactor_objs(NuvieDir new_direction);
inline void set_direction_of_surrounding_dragon_objs(NuvieDir new_direction);
inline void twitch_surrounding_objs();
inline void twitch_surrounding_dragon_objs();
inline void twitch_surrounding_hydra_objs();
inline void twitch_obj(Obj *obj);
inline void clear_surrounding_objs_list(bool delete_objs = false);
inline void init_surrounding_obj(uint16 x, uint16 y, uint8 z, uint16 actor_obj_n, uint16 obj_frame_n);
const CombatType *get_hand_combat_type() const override;
void print() override;
const char *get_worktype_string(uint32 wt) const override;
void inventory_make_all_objs_ok_to_take();
};
} // End of namespace Nuvie
} // End of namespace Ultima
#endif

View File

@@ -0,0 +1,307 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ULTIMA_ULTIMA6_ACTORS_U6_ACTOR_TYPES_H
#define ULTIMA_ULTIMA6_ACTORS_U6_ACTOR_TYPES_H
#include "ultima/nuvie/actors/u6_actor.h"
namespace Ultima {
namespace Nuvie {
/*
base_obj_n
frames_per_direction
tiles_per_direction
tiles_per_frame
tile_start_offset
dead_obj_n
dead_frame_n // 255 means same frame as they died
can_laydown
can_sit
tile_type
movetype
twitch_rand
body_armor_class
*/
const U6ActorType u6ActorTypes[] = {
// 4x1 tile actors AC
{OBJ_U6_INSECTS, 0, 0, 1, 0, OBJ_U6_NOTHING, 0, false, false, ACTOR_ST, MOVETYPE_U6_AIR_LOW, 2, 0},
{OBJ_U6_GIANT_SQUID, 0, 0, 1, 0, OBJ_U6_NOTHING, 0, false, false, ACTOR_ST, MOVETYPE_U6_WATER_HIGH, 50, 0},
{OBJ_U6_GHOST, 0, 0, 1, 0, OBJ_U6_NOTHING, 0, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 45, 0},
{OBJ_U6_ACID_SLUG, 0, 0, 1, 0, OBJ_U6_NOTHING, 0, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 50, 0},
{OBJ_U6_WISP, 0, 0, 1, 0, OBJ_U6_NOTHING, 0, false, false, ACTOR_ST, MOVETYPE_U6_AIR_LOW, 50, 0},
{OBJ_U6_GIANT_BAT, 0, 0, 1, 0, OBJ_U6_BLOOD, 0, false, false, ACTOR_ST, MOVETYPE_U6_AIR_LOW, 30, 0},
{OBJ_U6_REAPER, 0, 0, 1, 0, OBJ_U6_REAPER, 255, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 40, 4},
{OBJ_U6_GREMLIN, 0, 0, 1, 0, OBJ_U6_BLOOD, 0, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 20, 0},
{OBJ_U6_GAZER, 0, 0, 1, 0, OBJ_U6_BLOOD, 0, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 30, 0},
{OBJ_U6_BIRD, 0, 0, 1, 0, OBJ_U6_BLOOD, 0, false, false, ACTOR_ST, MOVETYPE_U6_AIR_LOW, 20, 0},
{OBJ_U6_CORPSER, 0, 0, 1, 0, OBJ_U6_BLOOD, 0, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 50, 0},
{OBJ_U6_RABBIT, 0, 0, 1, 0, OBJ_U6_BLOOD, 0, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 25, 0},
{OBJ_U6_ROT_WORMS, 0, 0, 1, 0, OBJ_U6_BLOOD, 0, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 50, 0},
{OBJ_U6_HYDRA, 0, 0, 1, 0, OBJ_U6_BLOOD, 0, false, false, ACTOR_MT, MOVETYPE_U6_LAND, 5, 0},
{OBJ_U6_MOUSE, 1, 1, 1, 0, OBJ_U6_MOUSE, 255, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 0, 0},
{OBJ_U6_CAT, 1, 1, 1, 0, OBJ_U6_CAT, 255, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 40, 0},
{OBJ_U6_TANGLE_VINE, 1, 1, 1, 0, OBJ_U6_TANGLE_VINE, 255, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 0, 4},
// 4x2
{OBJ_U6_SEA_SERPENT, 2, 2, 1, 0, OBJ_U6_NOTHING, 0, false, false, ACTOR_ST, MOVETYPE_U6_WATER_HIGH, 60, 2},
{OBJ_U6_GIANT_RAT, 2, 2, 1, 0, OBJ_U6_BLOOD, 0, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 40, 0},
{OBJ_U6_SHEEP, 2, 2, 1, 0, OBJ_U6_BLOOD, 0, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 35, 0},
{OBJ_U6_DOG, 2, 2, 1, 0, OBJ_U6_DOG, 255, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 35, 0},
{OBJ_U6_DEER, 2, 2, 1, 0, OBJ_U6_DEER, 255, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 20, 0},
{OBJ_U6_WOLF, 2, 2, 1, 0, OBJ_U6_WOLF, 255, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 20, 0},
{OBJ_U6_SNAKE, 2, 2, 1, 0, OBJ_U6_BLOOD, 0, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 20, 1},
{OBJ_U6_GIANT_SPIDER, 2, 2, 1, 0, OBJ_U6_BLOOD, 0, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 20, 0},
{OBJ_U6_DRAKE, 2, 2, 1, 0, OBJ_U6_DRAKE, 255, false, false, ACTOR_ST, MOVETYPE_U6_AIR_LOW, 15, 4},
{OBJ_U6_MONGBAT, 2, 2, 1, 0, OBJ_U6_MONGBAT, 255, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 15, 4},
{OBJ_U6_DAEMON, 2, 2, 1, 0, OBJ_U6_DEAD_BODY, 0, true, false, ACTOR_ST, MOVETYPE_U6_LAND, 30, 10},
{OBJ_U6_SKELETON, 2, 2, 1, 0, OBJ_U6_DEAD_BODY, 9, true, false, ACTOR_ST, MOVETYPE_U6_LAND, 30, 0},
{OBJ_U6_HEADLESS, 2, 2, 1, 0, OBJ_U6_DEAD_BODY, 1, true, false, ACTOR_ST, MOVETYPE_U6_LAND, 30, 2},
{OBJ_U6_TROLL, 2, 2, 1, 0, OBJ_U6_DEAD_BODY, 0, true, false, ACTOR_ST, MOVETYPE_U6_LAND, 40, 4},
{OBJ_U6_CYCLOPS, 2, 8, 4, 0, OBJ_U6_DEAD_CYCLOPS, 3, true, false, ACTOR_QT, MOVETYPE_U6_LAND, 45, 4},
// 4x3 fix dead frame
{OBJ_U6_WINGED_GARGOYLE, 3, 12, 4, 0, OBJ_U6_DEAD_GARGOYLE, 3, true, false, ACTOR_QT, MOVETYPE_U6_LAND, 60, 10},
{OBJ_U6_GARGOYLE, 3, 3, 1, 0, OBJ_U6_DEAD_BODY, 0, true, false, ACTOR_ST, MOVETYPE_U6_LAND, 50, 5},
// 4x5
{OBJ_U6_FIGHTER, 3, 4, 1, 0, OBJ_U6_DEAD_BODY, 6, true, true, ACTOR_ST, MOVETYPE_U6_LAND, 50, 0},
{OBJ_U6_SWASHBUCKLER, 3, 4, 1, 0, OBJ_U6_DEAD_BODY, 5, true, true, ACTOR_ST, MOVETYPE_U6_LAND, 50, 0},
{OBJ_U6_MAGE, 3, 4, 1, 0, OBJ_U6_DEAD_BODY, 3, true, true, ACTOR_ST, MOVETYPE_U6_LAND, 50, 0},
{OBJ_U6_VILLAGER, 3, 4, 1, 0, OBJ_U6_DEAD_BODY, 2, true, true, ACTOR_ST, MOVETYPE_U6_LAND, 50, 0},
{OBJ_U6_MERCHANT, 3, 4, 1, 0, OBJ_U6_DEAD_BODY, 2, true, true, ACTOR_ST, MOVETYPE_U6_LAND, 50, 0},
{OBJ_U6_CHILD, 3, 4, 1, 0, OBJ_U6_DEAD_BODY, 8, true, true, ACTOR_ST, MOVETYPE_U6_LAND, 30, 0},
{OBJ_U6_GUARD, 3, 4, 1, 0, OBJ_U6_DEAD_BODY, 4, true, true, ACTOR_ST, MOVETYPE_U6_LAND, 35, 0},
{OBJ_U6_JESTER, 3, 4, 1, 0, OBJ_U6_DEAD_BODY, 8, true, true, ACTOR_ST, MOVETYPE_U6_LAND, 5, 0},
{OBJ_U6_PEASANT, 3, 4, 1, 0, OBJ_U6_DEAD_BODY, 5, true, true, ACTOR_ST, MOVETYPE_U6_LAND, 50, 0}, //not sure of stats here
{OBJ_U6_FARMER, 3, 4, 1, 0, OBJ_U6_DEAD_BODY, 8, true, true, ACTOR_ST, MOVETYPE_U6_LAND, 40, 0},
{OBJ_U6_MUSICIAN, 3, 4, 1, 0, OBJ_U6_DEAD_BODY, 7, true, true, ACTOR_ST, MOVETYPE_U6_LAND, 50, 0},
{OBJ_U6_WOMAN, 3, 4, 1, 0, OBJ_U6_DEAD_BODY, 3, true, true, ACTOR_ST, MOVETYPE_U6_LAND, 50, 0},
{OBJ_U6_LORD_BRITISH, 3, 4, 1, 0, OBJ_U6_DEAD_BODY, 2, true, true, ACTOR_ST, MOVETYPE_U6_LAND, 60, 30}, //does LB have a dead frame!? ;)
{OBJ_U6_AVATAR, 3, 4, 1, 0, OBJ_U6_DEAD_BODY, 7, true, true, ACTOR_ST, MOVETYPE_U6_LAND, 50, 0},
{OBJ_U6_MUSICIAN_PLAYING, 2, 2, 1, 0, OBJ_U6_NOTHING, 0, false, true, ACTOR_ST, MOVETYPE_U6_LAND, 3, 0},
{OBJ_U6_SHIP, 1, 2, 2, 8, OBJ_U6_NOTHING, 0, false, false, ACTOR_MT, MOVETYPE_U6_WATER_HIGH, 0, 30},
{OBJ_U6_SKIFF, 1, 1, 1, 0, OBJ_U6_NOTHING, 0, false, false, ACTOR_ST, MOVETYPE_U6_WATER_LOW, 0, 0},
{OBJ_U6_INFLATED_BALLOON, 0, 0, 0, 4, OBJ_U6_NOTHING, 0, false, false, ACTOR_ST, MOVETYPE_U6_AIR_LOW, 0, 0},
{OBJ_U6_GIANT_SCORPION, 2, 2, 1, 0, OBJ_U6_BLOOD, 0, false, false, ACTOR_DT, MOVETYPE_U6_LAND, 30, 3},
{OBJ_U6_GIANT_ANT, 2, 2, 1, 0, OBJ_U6_BLOOD, 0, false, false, ACTOR_DT, MOVETYPE_U6_LAND, 30, 3},
{OBJ_U6_COW, 2, 2, 1, 0, OBJ_U6_BLOOD, 0, false, false, ACTOR_DT, MOVETYPE_U6_LAND, 40, 0},
{OBJ_U6_ALLIGATOR, 2, 2, 1, 0, OBJ_U6_BLOOD, 0, false, false, ACTOR_DT, MOVETYPE_U6_LAND, 30, 6},
{OBJ_U6_HORSE, 2, 2, 1, 0, OBJ_U6_HORSE_CARCASS, 1, false, false, ACTOR_DT, MOVETYPE_U6_LAND, 20, 0},
{OBJ_U6_HORSE_WITH_RIDER, 2, 2, 1, 0, OBJ_U6_BLOOD, 0, false, false, ACTOR_DT, MOVETYPE_U6_LAND, 20, 0},
{OBJ_U6_DRAGON, 2, 2, 1, 0, OBJ_U6_NOTHING, 0, false, false, ACTOR_MT, MOVETYPE_U6_AIR_LOW, 10, 12},
{OBJ_U6_SILVER_SERPENT, 1, 2, 1, 0, OBJ_U6_NOTHING, 0, false, false, ACTOR_MT, MOVETYPE_U6_LAND, 0, 15},
// 2x1 FIXME
{OBJ_U6_RAFT, 0, 0, 0, 1, OBJ_U6_NOTHING, 0, false, false, ACTOR_ST, MOVETYPE_U6_WATER_LOW, 0, 0}, // FIX might need to fix this
{OBJ_U6_TANGLE_VINE_POD, 2, 2, 1, 0, OBJ_U6_TANGLE_VINE_POD, 255, false, false, ACTOR_ST, MOVETYPE_U6_NONE, 20, 4}, // Movement type is probably a temp fix
{OBJ_U6_SLIME, 0, 0, 0, 0, OBJ_U6_NOTHING, 0, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 0, 0},
// 1x1
{OBJ_U6_CHEST, 0, 0, 0, 1, OBJ_U6_CHEST, 0, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 5, 0},
{OBJ_U6_NOTHING, 0, 0, 0, 1, OBJ_U6_NOTHING, 0, false, false, ACTOR_ST, MOVETYPE_U6_LAND, 0, 0} //end indicator
};
// A list of readiable objects and their readied location.
static const struct {
uint16 obj_n;
uint8 readiable_location;
uint8 defence;
uint8 attack;
}
readiable_objects[] = {
{OBJ_U6_LEATHER_HELM, ACTOR_HEAD, 1, 0 },
{OBJ_U6_CHAIN_COIF, ACTOR_HEAD, 2, 0 },
{OBJ_U6_IRON_HELM, ACTOR_HEAD, 3, 0 },
{OBJ_U6_SPIKED_HELM, ACTOR_HEAD, 3, 4 },
{OBJ_U6_WINGED_HELM, ACTOR_HEAD, 2, 0 },
{OBJ_U6_BRASS_HELM, ACTOR_HEAD, 2, 0 },
{OBJ_U6_GARGOYLE_HELM, ACTOR_HEAD, 3, 0 },
{OBJ_U6_MAGIC_HELM, ACTOR_HEAD, 5, 0 },
{OBJ_U6_WOODEN_SHIELD, ACTOR_ARM, 2, 0 },
{OBJ_U6_CURVED_HEATER, ACTOR_ARM, 3, 0 },
{OBJ_U6_WINGED_SHIELD, ACTOR_ARM, 3, 0 },
{OBJ_U6_KITE_SHIELD, ACTOR_ARM, 3, 0 },
{OBJ_U6_SPIKED_SHIELD, ACTOR_ARM, 2, 4 },
{OBJ_U6_BLACK_SHIELD, ACTOR_ARM, 2, 0 },
{OBJ_U6_DOOR_SHIELD, ACTOR_ARM, 4, 0 },
{OBJ_U6_MAGIC_SHIELD, ACTOR_ARM, 5, 0 },
{OBJ_U6_CLOTH_ARMOUR, ACTOR_BODY, 1, 0 },
{OBJ_U6_LEATHER_ARMOR, ACTOR_BODY, 2, 0 },
{OBJ_U6_RING_MAIL, ACTOR_BODY, 3, 0 },
{OBJ_U6_SCALE_MAIL, ACTOR_BODY, 4, 0 },
{OBJ_U6_CHAIN_MAIL, ACTOR_BODY, 5, 0 },
{OBJ_U6_PLATE_MAIL, ACTOR_BODY, 7, 0 },
{OBJ_U6_MAGIC_ARMOUR, ACTOR_BODY, 10, 0 },
{OBJ_U6_SPIKED_COLLAR, ACTOR_NECK, 2, 0 },
{OBJ_U6_GUILD_BELT, ACTOR_BODY, 0, 0 },
{OBJ_U6_GARGOYLE_BELT, ACTOR_BODY, 0, 0 },
{OBJ_U6_LEATHER_BOOTS, ACTOR_FOOT, 0, 0 },
{OBJ_U6_SWAMP_BOOTS, ACTOR_FOOT, 0, 0 },
{OBJ_U6_SLING, ACTOR_ARM, 0, 6 },
{OBJ_U6_CLUB, ACTOR_ARM, 0, 8 },
{OBJ_U6_MAIN_GAUCHE, ACTOR_ARM, 1, 8 },
{OBJ_U6_SPEAR, ACTOR_ARM, 0, 10 },
{OBJ_U6_THROWING_AXE, ACTOR_ARM, 0, 10 },
{OBJ_U6_DAGGER, ACTOR_ARM, 0, 6 },
{OBJ_U6_MACE, ACTOR_ARM, 0, 15 },
{OBJ_U6_MORNING_STAR, ACTOR_ARM, 0, 15 },
{OBJ_U6_BOW, ACTOR_ARM_2, 0, 10 },
{OBJ_U6_CROSSBOW, ACTOR_ARM_2, 0, 12 },
{OBJ_U6_SWORD, ACTOR_ARM, 0, 15 },
{OBJ_U6_TWO_HANDED_HAMMER, ACTOR_ARM_2, 0, 20 },
{OBJ_U6_TWO_HANDED_AXE, ACTOR_ARM_2, 0, 20 },
{OBJ_U6_TWO_HANDED_SWORD, ACTOR_ARM_2, 0, 20 },
{OBJ_U6_HALBERD, ACTOR_ARM_2, 0, 30 },
{OBJ_U6_GLASS_SWORD, ACTOR_ARM, 0, 255 },
{OBJ_U6_BOOMERANG, ACTOR_ARM, 0, 8 },
{OBJ_U6_TRIPLE_CROSSBOW, ACTOR_ARM_2, 0, 12 * 3 }, // ?? how to handle this
{OBJ_U6_MAGIC_BOW, ACTOR_ARM_2, 0, 20 },
{OBJ_U6_SPELLBOOK, ACTOR_ARM, 0, 0 },
{OBJ_U6_ANKH_AMULET, ACTOR_NECK, 0, 0 },
{OBJ_U6_SNAKE_AMULET, ACTOR_NECK, 0, 0 },
{OBJ_U6_AMULET_OF_SUBMISSION, ACTOR_NECK, 0, 0 },
{OBJ_U6_STAFF, ACTOR_ARM, 0, 4 },
{OBJ_U6_LIGHTNING_WAND, ACTOR_ARM, 0, 30 },
{OBJ_U6_FIRE_WAND, ACTOR_ARM, 0, 20 },
{OBJ_U6_STORM_CLOAK, ACTOR_BODY, 0, 0 },
{OBJ_U6_RING, ACTOR_HAND, 0, 0 },
{OBJ_U6_FLASK_OF_OIL, ACTOR_ARM, 0, 4 },
{OBJ_U6_TORCH, ACTOR_ARM, 0, 0 },
{OBJ_U6_SCYTHE, ACTOR_ARM, 0, 0 },
{OBJ_U6_PITCHFORK, ACTOR_ARM, 0, 0 },
{OBJ_U6_RAKE, ACTOR_ARM, 0, 0 },
{OBJ_U6_PICK, ACTOR_ARM, 0, 0 },
{OBJ_U6_SHOVEL, ACTOR_ARM, 0, 0 },
{OBJ_U6_HOE, ACTOR_ARM, 0, 0 },
{OBJ_U6_ROLLING_PIN, ACTOR_ARM, 0, 2 },
{OBJ_U6_CLEAVER, ACTOR_ARM, 0, 4 },
{OBJ_U6_KNIFE, ACTOR_ARM, 0, 4 },
{OBJ_U6_TUNIC, ACTOR_BODY, 0, 0 },
{OBJ_U6_DRESS, ACTOR_BODY, 0, 0 },
{OBJ_U6_PANTS, ACTOR_BODY, 0, 0 },
{OBJ_U6_LUTE, ACTOR_ARM, 0, 0 },
{OBJ_U6_PLIERS, ACTOR_ARM, 0, 0 },
{OBJ_U6_HAMMER, ACTOR_ARM, 0, 0 },
{OBJ_U6_PROTECTION_RING, ACTOR_HAND, 0, 0 },
{OBJ_U6_REGENERATION_RING, ACTOR_HAND, 0, 0 },
{OBJ_U6_INVISIBILITY_RING, ACTOR_HAND, 0, 0 },
{OBJ_U6_ZU_YLEM, ACTOR_ARM, 0, 0},
{OBJ_U6_NOTHING, ACTOR_NOT_READIABLE, 0, 0 }
}; // this last element terminates the array.
// obj_n, defence, attack, hit_range, attack_type, missle_tile_num, thrown_obj_n, breaks_on_contact
const CombatType u6combat_hand = {OBJ_U6_NOTHING, {0}, {4}, 1, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, false};
const CombatType u6combat_ship_cannon = {OBJ_U6_SHIP, {0}, {30}, 4, ATTACK_TYPE_MISSLE, TILE_U6_LIGHTNING, OBJ_U6_NOTHING, false };
const CombatType u6combat_objects[] = {
{OBJ_U6_LEATHER_HELM, {1}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_CHAIN_COIF, {2}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_IRON_HELM, {3}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_SPIKED_HELM, {3}, {4}, 1, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_WINGED_HELM, {2}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_BRASS_HELM, {2}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_GARGOYLE_HELM, {3}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_MAGIC_HELM, {5}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_WOODEN_SHIELD, {2}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_CURVED_HEATER, {3}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_WINGED_SHIELD, {3}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_KITE_SHIELD, {3}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_SPIKED_SHIELD, {2}, {4}, 1, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_BLACK_SHIELD, {2}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_DOOR_SHIELD, {4}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_MAGIC_SHIELD, {5}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_CLOTH_ARMOUR, {1}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_LEATHER_ARMOR, {2}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_RING_MAIL, {3}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_SCALE_MAIL, {4}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_CHAIN_MAIL, {5}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_PLATE_MAIL, {7}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_MAGIC_ARMOUR, {10}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_SPIKED_COLLAR, {2}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_SLING, {0}, {6}, 3, ATTACK_TYPE_MISSLE, TILE_U6_SLING_STONE, OBJ_U6_NOTHING, false },
{OBJ_U6_CLUB, {0}, {8}, 1, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_MAIN_GAUCHE, {1}, {8}, 1, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_SPEAR, {0}, {10}, 4, ATTACK_TYPE_THROWN, 0, OBJ_U6_SPEAR, false },
{OBJ_U6_THROWING_AXE, {0}, {10}, 3, ATTACK_TYPE_THROWN, 0, OBJ_U6_THROWING_AXE, false },
{OBJ_U6_DAGGER, {0}, {6}, 2, ATTACK_TYPE_THROWN, 0, OBJ_U6_DAGGER, false }, //melee weapon if at range 1
{OBJ_U6_MACE, {0}, {15}, 1, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_MORNING_STAR, {0}, {15}, 2, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_BOW, {0}, {10}, 5, ATTACK_TYPE_MISSLE, TILE_U6_ARROW, OBJ_U6_ARROW, false },
{OBJ_U6_CROSSBOW, {0}, {12}, 0, ATTACK_TYPE_MISSLE, TILE_U6_BOLT, OBJ_U6_BOLT, false },
{OBJ_U6_SWORD, {0}, {15}, 1, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_TWO_HANDED_HAMMER, {0}, {20}, 1, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_TWO_HANDED_AXE, {0}, {20}, 1, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_TWO_HANDED_SWORD, {0}, {20}, 1, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_HALBERD, {0}, {30}, 2, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_GLASS_SWORD, {0}, {255}, 1, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, true },
{OBJ_U6_BOOMERANG, {0}, {8}, 0, ATTACK_TYPE_THROWN, 0, OBJ_U6_BOOMERANG, false },
{OBJ_U6_TRIPLE_CROSSBOW, {0}, {12 * 3}, 0, ATTACK_TYPE_MISSLE, TILE_U6_BOLT, OBJ_U6_NOTHING, false }, // ?? how to handle this
{OBJ_U6_MAGIC_BOW, {0}, {20}, 0, ATTACK_TYPE_MISSLE, TILE_U6_ARROW, OBJ_U6_NOTHING, false },
{OBJ_U6_STAFF, {0}, {4}, 0, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_LIGHTNING_WAND, {0}, {30}, 0, ATTACK_TYPE_MISSLE, TILE_U6_LIGHTNING, OBJ_U6_NOTHING, false },
{OBJ_U6_FIRE_WAND, {0}, {20}, 0, ATTACK_TYPE_MISSLE, TILE_U6_FIREBALL, OBJ_U6_NOTHING, false },
{OBJ_U6_FLASK_OF_OIL, {0}, {4}, 0, ATTACK_TYPE_THROWN, 0, OBJ_U6_FLASK_OF_OIL, false },
{OBJ_U6_ROLLING_PIN, {0}, {2}, 1, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_CLEAVER, {0}, {4}, 1, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_KNIFE, {0}, {4}, 1, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_PROTECTION_RING, {5}, {0}, 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_ZU_YLEM, {0}, {1}, 0, ATTACK_TYPE_HAND, 0, OBJ_U6_NOTHING, false },
{OBJ_U6_NOTHING, {0}, {0} , 0, ATTACK_TYPE_NONE, 0, OBJ_U6_NOTHING, false} // this last element terminates the array.
};
} // End of namespace Nuvie
} // End of namespace Ultima
#endif

View File

@@ -0,0 +1,66 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ULTIMA_ULTIMA6_ACTORS_U6_WORK_TYPES_H
#define ULTIMA_ULTIMA6_ACTORS_U6_WORK_TYPES_H
// Worktype codes
#define WORKTYPE_U6_MOTIONLESS 0x0
#define WORKTYPE_U6_IN_PARTY 0x1
#define WORKTYPE_U6_PLAYER 0x2
#define WORKTYPE_U6_COMBAT_COMMAND 0x2
#define WORKTYPE_U6_COMBAT_FRONT 0x3
#define WORKTYPE_U6_COMBAT_REAR 0x4
#define WORKTYPE_U6_COMBAT_FLANK 0x5
#define WORKTYPE_U6_COMBAT_BERSERK 0x6
#define WORKTYPE_U6_COMBAT_RETREAT 0x7
#define WORKTYPE_U6_COMBAT_ASSAULT 0x8
#define WORKTYPE_U6_COMBAT_WILD 0x8
#define WORKTYPE_U6_COMBAT_SHY 0x9
#define WORKTYPE_U6_COMBAT_LIKE 0xa
#define WORKTYPE_U6_COMBAT_UNFRIENDLY 0xb
#define WORKTYPE_U6_ANIMAL_WANDER 0xc
#define WORKTYPE_U6_TANGLE 0xd
#define WORKTYPE_U6_IMMOBILE 0xe
#define WORKTYPE_U6_GUARD_WALK_EAST_WEST 0xf
#define WORKTYPE_U6_GUARD_WALK_NORTH_SOUTH 0x10
#define WORKTYPE_U6_LOOKOUT 0x11 // just a guess
#define WORKTYPE_U6_WALK_TO_LOCATION 0x86
#define WORKTYPE_U6_FACE_NORTH 0x87
#define WORKTYPE_U6_FACE_EAST 0x88
#define WORKTYPE_U6_FACE_SOUTH 0x89
#define WORKTYPE_U6_FACE_WEST 0x8a
#define WORKTYPE_U6_WALK_NORTH_SOUTH 0x8b
#define WORKTYPE_U6_WALK_EAST_WEST 0x8c
#define WORKTYPE_U6_WANDER_AROUND 0x8f
#define WORKTYPE_U6_WORK 0x90
#define WORKTYPE_U6_SLEEP 0x91
#define WORKTYPE_U6_PLAY_LUTE 0x95
#define WORKTYPE_U6_BEG 0x96
#define WORKTYPE_U6_ATTACK_PARTY 0x9b
#endif

View File

@@ -0,0 +1,44 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "ultima/nuvie/actors/wou_actor.h"
namespace Ultima {
namespace Nuvie {
bool WOUActor::can_carry_object(Obj *obj) const {
if (inventory_count_objects(INV_EXCLUDE_READIED_OBJECTS) >= 16) {
return false;
}
return Actor::can_carry_object(obj);
}
bool WOUActor::can_carry_object(uint16 objN, uint32 qty) const {
if (inventory_count_objects(INV_EXCLUDE_READIED_OBJECTS) >= 16) {
return false;
}
return Actor::can_carry_object(objN, qty);
}
} // End of namespace Nuvie
} // End of namespace Ultima

View File

@@ -0,0 +1,44 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef NUVIE_ACTORS_WOU_ACTOR_H
#define NUVIE_ACTORS_WOU_ACTOR_H
#include "ultima/nuvie/actors/actor.h"
namespace Ultima {
namespace Nuvie {
class WOUActor: public Actor {
public:
WOUActor(Map *m, ObjManager *om, GameClock *c) : Actor(m, om, c) { }
~WOUActor() override { }
bool can_carry_object(uint16 obj_n, uint32 qty = 0) const override;
bool can_carry_object(Obj *obj) const override;
};
} // End of namespace Nuvie
} // End of namespace Ultima
#endif