 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
66 int sack_can_hold(
const object *pl,
const object *sack,
const object *op, uint32_t nrof) {
72 "The %s is not active.",
78 "You can't put the %s into itself.",
85 "You can put only %s into the %s.",
91 "You can't put the key into %s.",
98 new_weight = sack->
carrying+(nrof ? nrof : 1)
107 "That won't fit in the %s!",
136 if (newface && op->
face != newface) {
156 const Face *newface = NULL;
157 object *head = op->
head ? op->
head : op;
173 if (newface && op->
face != newface) {
211 LOG(
llevError,
"apply_container: '%s' tried to apply %s, which is not a container\n", op->
name, sack ? sack->
name :
"(null)");
222 if ( sack->
env != op ) {
224 "Not in your inventory: %s",
233 if (op->
contr != NULL)
250 "Already readied %s.",
262 "Already opened %s.",
284 "Already closed %s.",
323 if (op->
contr != NULL)
349 "You unlock %s with %s.",
350 name_sack, name_tmp);
354 "You don't have the key to unlock %s.",
372 if (sack->
env != op) {
385 if (sack->
nrof > 1) {
395 object *part = sack->
head ? sack->
head : sack;
408 if (op->
contr != NULL)
424 if (op->
contr != NULL)
469 strncat(
buf,
" (open)", size);
473 if (op->
race != NULL) {
475 snprintf(
buf, size,
"It can hold only %s and its weight limit is %.1f kg.", op->
race, op->
weight_limit/(10.0*(100-op->
stats.
Str)));
477 snprintf(
buf, size,
"It can hold only %s.", op->
race);
#define object_was_destroyed(op, old_tag)
Checks if an object still exists.
sstring name
Face name, as used by archetypes and such.
New face structure - this enforces the notion that data is face by face only - you can not change the...
method_ret close_container_apply(object *op, object *applier, int aflags)
bool sack_race_can_contain(const object *sack, const object *ob)
@ CLOSE_CON
Eneq((at)csd.uu.se): Id for close_container archetype.
@ llevError
Error, serious thing.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
uint16_t container_position
Start of container contents to send to client.
void register_examine(int ob_type, examine_func method)
Registers the examine method for the given type.
#define QUERY_FLAG(xyz, p)
#define AP_APPLY
Item is to be applied.
void esrv_send_inventory(object *pl, object *op)
Sends inventory of a container.
struct archetype * arch
Pointer to archetype.
method_ret container_apply(object *op, object *applier, int aflags)
int apply_container(object *op, object *sack, int aflags)
Handle apply on containers.
void register_apply(int ob_type, apply_func method)
Registers the apply method for the given type.
struct mapstruct * map
Pointer to the map in which this object is present.
#define AP_UNAPPLY
Item is to be remvoed.
void register_move_on(int ob_type, move_on_func method)
Registers the move_on method for the given type.
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
tag_t count
Unique object number for this object.
bool csv_contains(std::string list, std::string item, std::string delim=",")
Split list by comma, then see if item matches anything in the list.
void legacy_ob_describe(const object *op, const object *observer, int use_media_tags, char *buf, size_t size)
Describes an object, seen by a given observer.
#define MSG_TYPE_COMMAND_ERROR
Bad syntax/can't use command.
int events_execute_object_event(object *op, int eventcode, object *activator, object *third, const char *message, int fix)
Execute an event on the specified object.
object * object_insert_in_ob(object *op, object *where)
This function inserts the object op in the linked list inside the object environment.
#define MSG_TYPE_COMMAND
Responses to commands, eg, who.
Plugin animator file specs[Config] name
void esrv_send_item(object *pl, object *op)
Sends item's info to player.
void container_describe(const object *op, const object *observer, int use_media_tags, char *buf, size_t size)
int32_t carrying
How much weight this object contains.
int16_t y
Position in the map for this object.
static int set_object_face_other(object *op)
Makes an object's face the other_arch face, supposed to be the "opened" one.
#define MOVE_ALL
Mask of all movement types.
struct player * contr
Pointer to the player which control this object.
#define AP_NULL
Nothing specific.
#define MSG_TYPE_APPLY_SUCCESS
Was able to apply object.
void query_name(const object *op, char *buf, size_t size)
Describes an item.
object clone
An object from which to do object_copy()
int32_t weight_limit
Weight-limit of object.
method_ret common_pre_ob_move_on(object *trap, object *victim, object *originator)
method_ret container_examine(const object *op, const object *, int, char *buf, size_t size)
const Face * face
Face with colors.
uint8_t type
PLAYER, BULLET, etc.
#define EVENT_CLOSE
Container closed.
#define AP_OPEN
Item is a container to be fully opened.
int32_t food
How much food in stomach.
uint32_t tag_t
Object tag, unique during the whole game.
object * find_key(object *pl, object *container, object *door)
We try to find a key for the door as passed.
sstring race
Human, goblin, dragon, etc.
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...
struct archetype * other_arch
Pointer used for various things - mostly used for what this objects turns into or what this object cr...
#define MAX_BUF
Used for all kinds of things.
object * head
Points to the main object of a large body.
int32_t weight
Attributes of the object.
int set_object_face_main(object *op)
Makes an object's face the main face, which is supposed to be the "closed" one.
char method_ret
Define some standard return values for callbacks which don't need to return any other results.
static method_ret container_type_move_on(object *trap, object *victim, object *originator)
Move on this Container object.
#define NDI_UNIQUE
Print immediately, don't buffer.
sstring slaying
Which race to do double damage to.
sstring name
The name of the object, obviously...
object * env
Pointer to the object which is the environment.
const typedef char * sstring
object * object_split(object *orig_ob, uint32_t nr, char *err, size_t size)
object_split(ob,nr) splits up ob into two parts.
#define FLAG_APPLIED
Object is ready for use by living.
void esrv_update_item(int flags, object *pl, object *op)
Updates object *op for player *pl.
sstring object_get_value(const object *op, const char *const key)
Get an extra value by key.
#define CLEAR_FLAG(xyz, p)
#define INS_NO_MERGE
Don't try to merge with other items.
object * container
Current container being used.
MoveType move_off
Move types affected moving off this space.
const Face * try_find_face(const char *name, const Face *error)
uint32_t nrof
Number of objects.
socket_struct * socket
Socket information for this player.
living stats
Str, Con, Dex, etc.
int object_set_value(object *op, const char *key, const char *value, int add_key)
Updates the key in op to value.
object * more
Pointer to the rest of a large body of objects.
int sack_can_hold(const object *pl, const object *sack, const object *op, uint32_t nrof)
Check if an item op can be put into a sack.
void init_type_container(void)
Initializer for the CONTAINER object type.
#define MSG_TYPE_APPLY
Applying objects.
void common_post_ob_move_on(object *trap, object *victim, object *originator)
#define MSG_TYPE_APPLY_ERROR
void register_describe(int ob_type, describe_func method)
Registers the describe method for the given type.
#define MSG_TYPE_APPLY_UNAPPLY
Unapply an object.