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)
72 "You feel a rush of magical energy!");
75 "You are drained of mana!");
86 if (capacity_remaining < food->stats.food)
87 applier->
stats.
hp += capacity_remaining / 50;
94 const int wasted_food = food->
stats.
food - capacity_remaining;
95 if (wasted_food > 0) {
98 if (wasted_food > thresh) {
105 snprintf(
buf,
sizeof(
buf),
106 "%s the %s makes you %s full. You feel yourself moving %s "
109 wasted_food > thresh ?
"very" :
"rather",
110 wasted_food > thresh ?
"much" :
"somewhat");
152 snprintf(
buf,
sizeof(
buf),
"You have been dead for too long to taste %s, ", food->
name);
156 "and seem to have obtained a taste for living flesh.");
161 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");
170 snprintf(
buf,
sizeof(
buf),
"Ahhh...that %s tasted good.", food->
name);
172 snprintf(
buf,
sizeof(
buf),
"The %s tasted %s", food->
name, food->
type ==
FLESH ?
"terrible!" :
"good.");
175 snprintf(
buf,
sizeof(
buf),
"The %s tasted terrible!", food->
name);
224 if (food->
resist[i] > 0) {
367 double totalchance = 1;
387 if (skin == NULL || abil == NULL)
423 atnr_winner[winners] = i;
428 totalchance *= 1-
chance/100;
435 totalchance = 100-totalchance*100;
437 if (totalchance > 50.)
438 snprintf(
buf,
sizeof(
buf),
"Hmm! The %s tasted delicious!", meal->
name);
439 else if (totalchance > 10.)
440 snprintf(
buf,
sizeof(
buf),
"The %s tasted very good.", meal->
name);
441 else if (totalchance > 1.)
442 snprintf(
buf,
sizeof(
buf),
"The %s tasted good.", meal->
name);
443 else if (totalchance > 0.1)
444 snprintf(
buf,
sizeof(
buf),
"The %s tasted bland.", meal->
name);
445 else if (totalchance >= 0.01)
446 snprintf(
buf,
sizeof(
buf),
"The %s had a boring taste.", meal->
name);
448 snprintf(
buf,
sizeof(
buf),
"The %s tasted strange.", meal->
name);
450 snprintf(
buf,
sizeof(
buf),
"The %s had no taste.", meal->
name);
457 i = atnr_winner[
RANDOM()%winners];
459 if (i >= 0 && i < NROFATTACKS && skin->resist[i] < 95) {
465 "Your skin is now more resistant to %s!",
479 "Your metabolism prepares to focus on %s!",
482 "The change will happen at level %d",
486 "Your metabolism will continue to focus on %s.",
void init_type_food(void)
void LOG(LogLevel logLevel, const char *format,...)
#define QUERY_FLAG(xyz, p)
#define FLAG_REFL_MISSILE
static int dragon_eat_flesh(object *op, object *meal)
void register_apply(int ob_type, apply_func method)
object * give_skill_by_name(object *op, const char *skill_name)
#define MSG_TYPE_APPLY_CURSED
#define MSG_TYPE_ATTRIBUTE
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 play_sound_map(int8_t sound_type, object *emitter, int dir, const char *action)
void fix_object(object *op)
object * object_insert_in_ob(object *op, object *where)
static void eat_special_food(object *who, object *food)
int16_t resist[NROFATTACKS]
static method_ret food_type_apply(object *food, object *applier, int aflags)
void object_free_drop_inventory(object *ob)
int slow_living_by(object *op, const int speed_penalty)
#define object_decrease_nrof_by_one(xyz)
#define MSG_TYPE_ATTRIBUTE_RACE
#define MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START
#define MSG_TYPE_APPLY_SUCCESS
#define MSG_TYPE_ATTRIBUTE_PROTECTION_GAIN
void set_attr_value(living *stats, int attr, int8_t value)
const char *const change_resist_msg[NROFATTACKS]
void object_update_speed(object *op)
static void eat_common(object *applier, object *food)
#define FLAG_CAN_USE_SKILL
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
struct archetype * other_arch
int is_wraith_pl(object *op)
object * create_archetype(const char *name)
int change_abil(object *op, object *tmp)
void apply_handle_yield(object *tmp)
int is_dragon_pl(const object *op)
int hit_player(object *op, int dam, object *hitter, uint32_t type, int full_hit)
int atnr_is_dragon_enabled(int attacknr)
object * object_find_by_type_and_arch_name(const object *who, int type, const char *name)
object * arch_to_object(archetype *at)
#define MSG_TYPE_APPLY_FAILURE
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
static void check_heal_and_mana(object *who, object *food)
int is_old_wraith_pl(object *op)
bool chance(int a, int b)
int8_t get_attr_value(const living *stats, int attr)
void link_player_skills(object *op)
static const float MOVE_PER_SECOND
static const int32_t MAX_FOOD