示例#1
0
void eat()
{
  int index;
  struct object *obj;

  clearmsg();

  print1("Eat --");
  index = getitem(FOOD);
  if (index == ABORT)
    setgamestatus(SKIP_MONSTERS);
  else {
    obj = Player.possessions[index];
    if ((obj->objchar != FOOD)&&(obj->objchar != CORPSE)) {
      print3("You can't eat ");
      nprint3(itemid(obj));
    }
    else {
      if (obj->usef == I_FOOD) Player.food = max(0,Player.food+obj->aux);
      item_use(obj);
      dispose_lost_objects(1,obj);
      if (Current_Dungeon == E_COUNTRYSIDE) {
	Time += 100;
	hourly_check();
      }
    }
  }
  foodcheck();
}
示例#2
0
void s_nutrition(void)
{
	if (random_range(3)) {
		mprint("Magically Delicious!");
	} else {
		mprint("Scrumptious!");
	}

    Player.food = 44;
    foodcheck();
}
示例#3
0
void i_corpse(pob o)
{
    /* WDT HACK: there are some comments in this function which need
     * to be backed up with assert(). */
    /* DAG reply: I don't like to use assert() for minor things like this
       as the game can safely play on, yet an assert() will cause the game
       to exit if it fails.  Not friendly.  Now an error message or error
       log of some sort would make sense. */
    /* WDT discussion: there's no law which demands that an assert has to
     * kill the program -- well, okay, not the standard assert, but I seldom
     * use that one.  And anyhow, we shouldn't distribute a version with the
     * asserts compiled in; that's against the purpose. */
    /* object's charge holds the former monster id */
    switch (o->charge) {
    case MEND_PRIEST:
    case ITIN_MERCH:
    case GUARD:
    case NPC:
    case MERCHANT:
    case ZERO_NPC:
    case HISCORE_NPC:
    case APPR_NINJA:
    case SNEAK_THIEF:
    case BRIGAND:
    case GENIN:
    case MAST_THIEF:
    case CHUNIN:
    case JONIN: /* cannibalism */
        mprint("Yechh! How could you! You didn't even cook him first!");
        if (Player.alignment > 0) Player.food = 25;
        else mprint("You'd eat your own grandmother.");
        if (Player.alignment < 0) mprint("...without salt.");
        Player.food += 8;
        Player.alignment -=10;
        foodcheck();
        break;
    case FNORD: /* fnord */
        mprint("You feel illuminated!");
        Player.iq++;
        break;
    case DENEBIAN: /* denebian slime devil */
        mprint("I don't believe this. You ate Denebian Slime?");
        mprint("You deserve a horrible wasting death, uncurable by any means!");
        break;
    case DRAGONETTE:  /* can't get here... i_usef changed to I_FOOD */
        mprint("Those dragon-steaks were fantastic!");
        Player.food=24;
        foodcheck();
        break;
    case BEHEMOTH:
        mprint("You feel infinitely more virile now.");
        Player.str = max(Player.str,Player.maxstr+10);
        Player.food = 24;
        foodcheck();
        break;
    case INVIS_SLAY:
        mprint("Guess what? You're invisible.");
        if (Player.status[INVISIBLE] < 1000) Player.status[INVISIBLE] = 666;
        Player.food+=6;
        foodcheck();
        break;
    case UNICORN:
        mprint("You ATE a unicorn's horn?!?!?");
        Player.immunity[POISON]=1000;
        break;
    case HORNET: /* can't get here... i_usef changed to I_POISON_FOOD */
    case GRUNT:
    case TSETSE:  /* can't get here... i_usef changed to I_SLEEP_SELF */
    case AGGRAVATOR:
    case BLIPPER: /* can't get here... i_usef changed to I_TELEPORT */
    case GOBLIN:
    case GEEK:
    case NIGHT_GAUNT: /* can't get here... i_usef changed to I_POISON_FOOD */
    case TOVE:
    case TASMANIAN:
    case JUBJUB:  /* can't get here... i_usef changed to I_FOOD */
    case CATEAGLE:
        mprint("Well, you forced it down. Not much nutrition, though.");
        Player.food++;
        foodcheck();
        break;
    case SEWER_RAT:
    case PHANTASTICON: /* can't get here... i_usef changed to I_POISON_FOOD */
    case EYE:  /* can't get here... i_usef changed to I_CLAIRVOYANCE */
    case NASTY:  /* can't get here... i_usef changed to I_INVISIBLE */
    case CATOBLEPAS:
    case HAUNT: /* can't get here... i_usef changed to I_POISON_FOOD */
    case ROUS:
    case DEATHSTAR: /* can't get here... i_usef changed to I_POISON_FOOD */
    case EATER:
        mprint("Oh, yuck. The 'food' seems to be tainted.");
        mprint("You feel very sick. You throw up.");
        Player.food = min(Player.food, 4);
    default:
        mprint("It proved completely inedible, but you tried anyhow.");
    }
}