49 return val ? val :
"0";
93 char anim_name_buf[128];
94 int anim_name_len = strlen(op->
face->
name);
95 strncpy(anim_name_buf, op->
face->
name, 128);
97 anim_name_buf[anim_name_len-4] =
'\0';
98 strncat(anim_name_buf,
"_mimic", 128-anim_name_len+4);
void init_type_mimic(void)
Initializer for MIMIC type.
#define FABS(x)
Decstations have trouble with fabs()...
#define MSG_TYPE_APPLY_FAILURE
Apply OK, but no/bad result.
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to...
static const char * object_try_get_value(object *op, const char *key)
int object_find_free_spot(const object *ob, mapstruct *m, int x, int y, int start, int stop)
object_find_free_spot(object, map, x, y, start, stop) will search for a spot at the given map and coo...
int16_t y
Position in the map for this object.
Animations * find_animation(const char *name)
Global type definitions and header inclusions.
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
Sends message to player(s).
#define MSG_TYPE_APPLY
Applying objects.
static method_ret mimic_type_apply(object *op, object *applier, int aflags)
Implementation of mimics This should be usable for any item masquerading as a container (or other ite...
static std::shared_ptr< inja::Environment > env
Rendering environment.
char method_ret
Define some standard return values for callbacks which don't need to return any other results...
int16_t level
Level of creature or object.
#define FLAG_ALIVE
Object can fight (or be fought)
float speed
Frequency of object 'moves' relative to server tick rate.
object * env
Pointer to the object which is the environment.
void query_name(const object *op, char *buf, size_t size)
Describes an item.
short freearr_x[SIZEOFFREE]
X offset when searching around a spot.
const Animations * animation
Animation of this item, NULL if not animated.
sstring object_get_value(const object *op, const char *const key)
Get an extra value by key.
const Face * face
Face with colors.
int16_t dam
How much damage this object does when hitting.
living stats
Str, Con, Dex, etc.
#define MAX_BUF
Used for all kinds of things.
struct mapstruct * map
Pointer to the map in which this object is present.
short freearr_y[SIZEOFFREE]
Y offset when searching around a spot.
#define FLAG_ANIMATE
The object looks at archetype for faces.
#define FREE_AND_COPY(sv, nv)
Release the shared string if not NULL, and make it a reference to nv.
sstring name
The name of the object, obviously...
uint8_t type
PLAYER, BULLET, etc.
int8_t ac
Armor Class, lower AC increases probability of not getting hit.
#define MSG_TYPE_APPLY_SUCCESS
Was able to apply object.
#define FLAG_MONSTER
Will attack players.
#define NDI_UNIQUE
Print immediately, don't buffer.
int16_t maxhp
Max hit points.
uint16_t difficulty
What level the player should be to play here.
object * object_insert_in_ob(object *op, object *where)
This function inserts the object op in the linked list inside the object environment.
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
Same as object_insert_in_map() except it handle separate coordinates and do a clean job preparing mul...
int8_t wc
Weapon Class, lower WC increases probability of hitting.
Object type functions and variables.
sstring name
Face name, as used by archetypes and such.
object * enemy
Monster/player to follow even if not closest.
void register_apply(int ob_type, apply_func method)
Registers the apply method for the given type.