Go to the documentation of this file.
57 int i = (sp*10) /
op->stats.maxsp;
68 else if (sp ==
op->stats.maxsp)
86 if (previous_sp != -1) {
103 (
void)use_media_tags;
111 if (
op->stats.maxsp == 0) {
115 if (
op->stats.maxsp > 1000) {
116 i = (
op->stats.maxsp%1000)/100;
127 strncat(
buf,
final, size);
158 power_space =
op->stats.maxsp-
op->stats.sp;
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);
173 int sp =
op->stats.sp;
175 applier->
stats.
sp -= power_grab;
176 op->stats.sp += power_grab;
177 op->speed = (float)
op->stats.sp/(
float)
op->stats.maxsp;
static method_ret power_crystal_type_apply(object *op, object *applier, int aflags)
StringBuffer * stringbuffer_new(void)
static int crystal_level(const object *op, int sp)
static const char * crystal_levels[LEVELS]
static void add_capacity(const object *op, StringBuffer *buf, int previous_sp)
#define MSG_TYPE_APPLY_SUCCESS
void query_name(const object *op, char *buf, size_t size)
void stringbuffer_append_string(StringBuffer *sb, const char *str)
static void power_crystal_describe(const object *op, const object *observer, int use_media_tags, char *buf, size_t size)
char * stringbuffer_finish(StringBuffer *sb)
void init_type_power_crystal(void)
void register_describe(int ob_type, describe_func method)
void register_apply(int ob_type, apply_func method)
void esrv_update_item(int flags, object *pl, object *op)
void stringbuffer_append_printf(StringBuffer *sb, const char *format,...)
void object_update_speed(object *op)
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)