Go to the documentation of this file.
48 sizeof(
who->contr->killer));
51 "Eck!...that was poisonous!");
55 "You begin to feel better.");
58 "Eck!...that was poisonous!");
65 "You are drained of mana!");
67 if (
who->stats.sp < 0)
71 "You feel a rush of magical energy!");
82 if (capacity_remaining < food->stats.food)
83 applier->
stats.
hp += capacity_remaining / 50;
90 const int wasted_food = food->
stats.
food - capacity_remaining;
91 if (wasted_food > 0) {
94 if (wasted_food > thresh) {
101 snprintf(
buf,
sizeof(
buf),
102 "%s the %s makes you %s full. You feel yourself moving %s "
105 wasted_food > thresh ?
"very" :
"rather",
106 wasted_food > thresh ?
"much" :
"somewhat");
148 snprintf(
buf,
sizeof(
buf),
"You have been dead for too long to taste %s, ", food->
name);
152 "and seem to have obtained a taste for living flesh.");
157 snprintf(
buf,
sizeof(
buf),
"You can no longer taste %s, and do not feel less hungry after %s it.", food->
name, food->
type ==
DRINK ?
"drinking" :
"eating");
166 snprintf(
buf,
sizeof(
buf),
"Ahhh...that %s tasted good.", food->
name);
168 snprintf(
buf,
sizeof(
buf),
"The %s tasted %s", food->
name, food->
type ==
FLESH ?
"terrible!" :
"good.");
171 snprintf(
buf,
sizeof(
buf),
"The %s tasted terrible!", food->
name);
220 if (food->
resist[i] > 0) {
263 double totalchance = 1;
283 if (skin == NULL || abil == NULL)
308 chance = (chance < -12) ? 0. : 1./pow(2., -chance);
311 chance *= ((double)(
MIN(meal->
resist[i], 50)))/50.;
315 chance =
MIN(100., chance*2.);
318 if (
RANDOM()%10000 < (
unsigned int)(chance*100)) {
319 atnr_winner[winners] = i;
324 totalchance *= 1-chance/100;
331 totalchance = 100-totalchance*100;
333 if (totalchance > 50.)
334 snprintf(
buf,
sizeof(
buf),
"Hmm! The %s tasted delicious!", meal->
name);
335 else if (totalchance > 10.)
336 snprintf(
buf,
sizeof(
buf),
"The %s tasted very good.", meal->
name);
337 else if (totalchance > 1.)
338 snprintf(
buf,
sizeof(
buf),
"The %s tasted good.", meal->
name);
339 else if (totalchance > 0.1)
340 snprintf(
buf,
sizeof(
buf),
"The %s tasted bland.", meal->
name);
341 else if (totalchance >= 0.01)
342 snprintf(
buf,
sizeof(
buf),
"The %s had a boring taste.", meal->
name);
344 snprintf(
buf,
sizeof(
buf),
"The %s tasted strange.", meal->
name);
346 snprintf(
buf,
sizeof(
buf),
"The %s had no taste.", meal->
name);
353 i = atnr_winner[
RANDOM()%winners];
355 if (i >= 0 && i < NROFATTACKS && skin->resist[i] < 95) {
361 "Your skin is now more resistant to %s!",
375 "Your metabolism prepares to focus on %s!",
378 "The change will happen at level %d",
382 "Your metabolism will continue to focus on %s.",
void init_type_food(void)
static void check_heal_and_mana(object *who, object *food)
object * object_find_by_type_and_arch_name(const object *who, int type, const char *name)
#define QUERY_FLAG(xyz, p)
#define MSG_TYPE_APPLY_CURSED
#define MSG_TYPE_ATTRIBUTE
void play_sound_map(int8_t sound_type, object *emitter, int dir, const char *action)
int is_old_wraith_pl(object *op)
int slow_living_by(object *op, const int speed_penalty)
#define object_decrease_nrof_by_one(xyz)
void link_player_skills(object *op)
#define MSG_TYPE_ATTRIBUTE_RACE
#define MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START
#define MSG_TYPE_APPLY_SUCCESS
#define MSG_TYPE_ATTRIBUTE_PROTECTION_GAIN
static void eat_special_food(object *who, object *food)
static void eat_common(object *applier, object *food)
void fix_object(object *op)
struct archt * other_arch
#define FLAG_CAN_USE_SKILL
int is_dragon_pl(const object *op)
object * create_archetype(const char *name)
static int dragon_eat_flesh(object *op, object *meal)
int is_wraith_pl(object *op)
void register_apply(int ob_type, apply_func method)
const EXTERN char *const change_resist_msg[NROFATTACKS]
void apply_handle_yield(object *tmp)
void LOG(LogLevel logLevel, const char *format,...)
int hit_player(object *op, int dam, object *hitter, uint32_t type, int full_hit)
void set_attr_value(living *stats, int attr, int8_t value)
object * object_insert_in_ob(object *op, object *where)
void object_update_speed(object *op)
object * arch_to_object(archetype *at)
#define MSG_TYPE_APPLY_FAILURE
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
int8_t get_attr_value(const living *stats, int attr)
void object_free_drop_inventory(object *ob)
int atnr_is_dragon_enabled(int attacknr)
static method_ret food_type_apply(object *food, object *applier, int aflags)
object * give_skill_by_name(object *op, const char *skill_name)
int change_abil(object *op, object *tmp)
static const float MOVE_PER_SECOND
int16_t resist[NROFATTACKS]
static const int32_t MAX_FOOD
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)