 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
35 static void lamp_type_describe(
const object *op,
const object *observer,
int use_media_tags,
char *
buf,
size_t size);
56 static void do_turn(
object *op,
object *who,
int aflags,
const char *onoff) {
61 "You turn %s your %s.",
83 "Oops, it feels deadly cold!");
112 "You must get it first!\n");
127 do_turn(lamp, applier, aflags,
"off");
132 "Your %s is out of fuel!",
136 do_turn(lamp, applier, aflags,
"on");
147 static void lamp_type_describe(
const object *op,
const object *observer,
int use_media_tags,
char *
buf,
size_t size) {
151 (void)use_media_tags;
164 }
else if (fill == 0) {
166 }
else if (fill > 1) {
169 }
else if (fill > 0.9) {
171 }
else if (fill > 0.6) {
173 }
else if (fill > 0.4) {
175 }
else if (fill > 0.2) {
177 }
else if (fill > 0.1) {
184 strncat(
buf,
final, size);
#define QUERY_FLAG(xyz, p)
void stringbuffer_append_printf(StringBuffer *sb, const char *format,...)
Append a formatted string to a string buffer instance.
void update_position(mapstruct *m, int x, int y)
This function updates various attributes about a specific space on the map (what it looks like,...
StringBuffer * stringbuffer_new(void)
Create a new string buffer.
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 MSG_TYPE_APPLY_CURSED
Applied a cursed object (BAD)
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 fix_object(object *op)
Updates all abilities given by applied objects in the inventory of the given object.
#define FLAG_INV_LOCKED
Item will not be dropped from inventory.
#define FLAG_APPLIED
Object is ready for use by living.
object * object_insert_in_ob(object *op, object *where)
This function inserts the object op in the linked list inside the object environment.
int16_t y
Position in the map for this object.
char * stringbuffer_finish(StringBuffer *sb)
Deallocate the string buffer instance and return the string.
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects,...
static method_ret lamp_type_apply(object *lighter, object *applier, int aflags)
Applies a lamp.
#define MSG_TYPE_APPLY_SUCCESS
Was able to apply object.
void query_name(const object *op, char *buf, size_t size)
Describes an item.
#define FLAG_KNOWN_CURSED
The object is known to be cursed.
#define FLAG_BLIND
If set, object cannot see (visually)
void init_type_lamp(void)
Initializer for the LAMP object type.
uint8_t type
PLAYER, BULLET, etc.
#define FLAG_DAMNED
The object is very cursed.
#define SET_MAP_FLAGS(M, X, Y, C)
Sets map flags.
int32_t food
How much food in stomach.
struct archetype * other_arch
Pointer used for various things - mostly used for what this objects turns into or what this object cr...
A buffer that will be expanded as content is added to it.
char method_ret
Define some standard return values for callbacks which don't need to return any other results.
#define NDI_UNIQUE
Print immediately, don't buffer.
sstring name
The name of the object, obviously...
int16_t maxsp
Max spell points.
#define P_NEED_UPDATE
This space is out of date.
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 CLEAR_FLAG(xyz, p)
#define AP_NOPRINT
Don't print messages - caller will do that may be some that still print.
object * arch_to_object(archetype *at)
Creates and returns a new object which is a copy of the given archetype.
#define MSG_TYPE_APPLY_FAILURE
Apply OK, but no/bad result.
static void lamp_type_describe(const object *op, const object *observer, int use_media_tags, char *buf, size_t size)
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to.
void update_all_los(const mapstruct *map, int x, int y)
This function makes sure that update_los() will be called for all players on the given map within the...
uint32_t nrof
Number of objects.
living stats
Str, Con, Dex, etc.
#define MSG_TYPE_APPLY
Applying objects.
#define FLAG_CURSED
The object is cursed.
#define MSG_TYPE_APPLY_ERROR
object * object_get_player_container(object *op)
Finds the player carrying an object.
void register_describe(int ob_type, describe_func method)
Registers the describe method for the given type.
static void do_turn(object *op, object *who, int aflags, const char *onoff)
Turn on/off the lamp, based on op's APPLIED status.