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) {
363 double totalchance = 1;
383 if (skin == NULL || abil == NULL)
408 chance = (chance < -12) ? 0. : 1./pow(2., -chance);
411 chance *= ((double)(
MIN(meal->
resist[i], 50)))/50.;
415 chance =
MIN(100., chance*2.);
418 if (
RANDOM()%10000 < (
unsigned int)(chance*100)) {
419 atnr_winner[winners] = i;
424 totalchance *= 1-chance/100;
431 totalchance = 100-totalchance*100;
433 if (totalchance > 50.)
434 snprintf(
buf,
sizeof(
buf),
"Hmm! The %s tasted delicious!", meal->
name);
435 else if (totalchance > 10.)
436 snprintf(
buf,
sizeof(
buf),
"The %s tasted very good.", meal->
name);
437 else if (totalchance > 1.)
438 snprintf(
buf,
sizeof(
buf),
"The %s tasted good.", meal->
name);
439 else if (totalchance > 0.1)
440 snprintf(
buf,
sizeof(
buf),
"The %s tasted bland.", meal->
name);
441 else if (totalchance >= 0.01)
442 snprintf(
buf,
sizeof(
buf),
"The %s had a boring taste.", meal->
name);
444 snprintf(
buf,
sizeof(
buf),
"The %s tasted strange.", meal->
name);
446 snprintf(
buf,
sizeof(
buf),
"The %s had no taste.", meal->
name);
453 i = atnr_winner[
RANDOM()%winners];
455 if (i >= 0 && i < NROFATTACKS && skin->resist[i] < 95) {
461 "Your skin is now more resistant to %s!",
475 "Your metabolism prepares to focus on %s!",
478 "The change will happen at level %d",
482 "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)
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