84 assert(current >= 0 && current <
LEVELS);
86 if (previous_sp != -1) {
88 assert(previous >= 0 && previous <
LEVELS);
89 if (current == previous) {
103 (void)use_media_tags;
127 strncat(buf,
final, size);
161 if (available_power >= 0 && power_space > 0) {
162 power_grab =
MIN(power_space, 0.5*applier->
stats.
sp);
165 if (available_power < 0 && op->stats.sp > 0) {
166 power_grab = -
MIN(-available_power, op->
stats.
sp);
175 applier->
stats.
sp -= power_grab;
char * stringbuffer_finish(StringBuffer *sb)
Deallocate the string buffer instance and return the string.
void init_type_power_crystal(void)
Initializer for the POWER_CRYSTAL object type.
void register_describe(int ob_type, describe_func method)
Registers the describe method for the given type.
void esrv_update_item(int flags, object *pl, object *op)
Updates object *op for player *pl.
StringBuffer * stringbuffer_new(void)
Create a new string buffer.
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.
char method_ret
Define some standard return values for callbacks which don't need to return any other results...
static method_ret power_crystal_type_apply(object *op, object *applier, int aflags)
This function handles the application of power crystals.
static void power_crystal_describe(const object *op, const object *observer, int use_media_tags, char *buf, size_t size)
float speed
Frequency of object 'moves' relative to server tick rate.
void stringbuffer_append_printf(StringBuffer *sb, const char *format,...)
Append a formatted string to a string buffer instance.
void stringbuffer_append_string(StringBuffer *sb, const char *str)
Append a string to a string buffer instance.
void query_name(const object *op, char *buf, size_t size)
Describes an item.
living stats
Str, Con, Dex, etc.
#define MAX_BUF
Used for all kinds of things.
static const char * crystal_levels[LEVELS]
Existing levels, dot-terminated.
uint8_t type
PLAYER, BULLET, etc.
void object_update_speed(object *op)
Updates the speed of an object.
#define MSG_TYPE_APPLY_SUCCESS
Was able to apply object.
int16_t maxsp
Max spell points.
#define NDI_UNIQUE
Print immediately, don't buffer.
A buffer that will be expanded as content is added to it.
static int crystal_level(const object *op, int sp)
Return the level, [0..LEVELS[, of charge of the item.
static void add_capacity(const object *op, StringBuffer *buf, int previous_sp)
Add the capacity of the crystal to the buffer.
Object type functions and variables.
void register_apply(int ob_type, apply_func method)
Registers the apply method for the given type.