Example #1
0
static bool
revive(struct obj *obj)
{
	struct monst *mtmp = NULL;

	if(obj->olet == FOOD_SYM && obj->otyp > CORPSE) {
		/* do not (yet) revive shopkeepers */
		/* Note: this might conceivably produce two monsters
			at the same position - strange, but harmless */
		mtmp = mkmon_at(CORPSE_I_TO_C(obj->otyp),obj->ox,obj->oy);
		delobj(obj);
	}
	return(!!mtmp);		/* TRUE if some monster created */
}
Example #2
0
int poisonous(struct obj *otmp)
{
    return strchr(POISONOUS, CORPSE_I_TO_C(otmp->otyp)) != 0;
}
Example #3
0
// returns 1 if some text was printed
int eatcorpse(struct obj *otmp)
{
    char let = CORPSE_I_TO_C(otmp->otyp);
    int tp = 0;
    if (let != 'a' && _u.moves > otmp->age + 50 + rn2(100)) {
	++tp;
	pline("Ulch -- that meat was tainted!");
	pline("You get very sick.");
	Sick = 10 + rn2(10);
	_u.usick_cause = c_Objects[otmp->otyp].oc_name;
    } else if (strchr(POISONOUS, let) && rn2(5)) {
	++tp;
	pline("Ecch -- that must have been poisonous!");
	if (!Poison_resistance) {
	    losestr(rnd(4));
	    losehp(rnd(15), "poisonous corpse");
	} else
	    pline("You don't seem affected by the poison.");
    } else if (strchr("ELNOPQRUuxz", let) && rn2(5)) {
	++tp;
	pline("You feel sick.");
	losehp(rnd(8), "cadaver");
    }
    switch (let) {
	case 'L':
	case 'N':
	case 't':
	    Teleportation |= INTRINSIC;
	    break;
	case 'W':
	    pluslvl();
	    break;
	case 'n':
	    _u.uhp = _u.uhpmax;
	    _wflags.botl = 1;
	    // fallthrough
	case '@':
	    pline("You cannibal! You will be sorry for this!");
	    // not ++tp;
	    // fallthrough
	case 'd':
	    Aggravate_monster |= INTRINSIC;
	    break;
	case 'I':
	    if (!Invis) {
		Invis = 50 + rn2(100);
		if (!See_invisible)
		    newsym(_u.ux, _u.uy);
	    } else {
		Invis |= INTRINSIC;
		See_invisible |= INTRINSIC;
	    }
	    // fallthrough
	case 'y':
	case 'B':
	    Confusion = 50;
	    break;
	case 'D':
	    Fire_resistance |= INTRINSIC;
	    break;
	case 'E':
	    Telepat |= INTRINSIC;
	    break;
	case 'F':
	case 'Y':
	    Cold_resistance |= INTRINSIC;
	    break;
	case 'k':
	case 's':
	    Poison_resistance |= INTRINSIC;
	    break;
	case 'c':
	    pline("You turn to stone.");
	    killer = "dead cockatrice";
	    done("died");
	    // NOTREACHED
	case 'a':
	    if (Stoned) {
		pline("What a pity - you just destroyed a future piece of art!");
		++tp;
		Stoned = 0;
	    }
	    break;
    }
    return tp;
}
Example #4
0
/* returns 1 if some text was printed */
static int
eatcorpse(struct obj *otmp)
{
	char let = CORPSE_I_TO_C(otmp->otyp);
	int tp = 0;

	if (let != 'a' && moves > otmp->age + 50 + rn2(100)) {
		tp++;
		pline("Ulch -- that meat was tainted!");
		pline("You get very sick.");
		Sick = 10 + rn2(10);
		u.usick_cause = objects[otmp->otyp].oc_name;
	} else if (strchr(POISONOUS, let) && rn2(5)) {
		tp++;
		pline("Ecch -- that must have been poisonous!");
		if (!Poison_resistance) {
			losestr(rnd(4));
			losehp(rnd(15), "poisonous corpse");
		} else
			pline("You don't seem affected by the poison.");
	} else if (strchr("ELNOPQRUuxz", let) && rn2(5)) {
		tp++;
		pline("You feel sick.");
		losehp(rnd(8), "cadaver");
	}
	switch (let) {
	case 'L':
	case 'N':
	case 't':
		Teleportation |= INTRINSIC;
		break;
	case 'W':
		pluslvl();
		break;
	case 'n':
		u.uhp = u.uhpmax;
		flags.botl = 1;
	/* fall into next case */
	case '@':
		pline("You cannibal! You will be sorry for this!");
	/* not tp++; */
	/* fall into next case */
	case 'd':
		Aggravate_monster |= INTRINSIC;
		break;
	case 'I':
		if (!Invis) {
			Invis = 50 + rn2(100);
			if (!See_invisible)
				newsym(u.ux, u.uy);
		} else {
			Invis |= INTRINSIC;
			See_invisible |= INTRINSIC;
		}
	/* fall into next case */
	case 'y':
#ifdef QUEST
		u.uhorizon++;
#endif /* QUEST */
	/* fall into next case */
	case 'B':
		Confusion = 50;
		break;
	case 'D':
		Fire_resistance |= INTRINSIC;
		break;
	case 'E':
		Telepat |= INTRINSIC;
		break;
	case 'F':
	case 'Y':
		Cold_resistance |= INTRINSIC;
		break;
	case 'k':
	case 's':
		Poison_resistance |= INTRINSIC;
		break;
	case 'c':
		pline("You turn to stone.");
		killer = "dead cockatrice";
		done("died");
	/* NOTREACHED */
	case 'a':
		if (Stoned) {
			pline("What a pity - you just destroyed a future piece of art!");
			tp++;
			Stoned = 0;
		}
		break;
	case 'M':
		pline("You cannot resist the temptation to mimic a treasure chest.");
		tp++;
		nomul(-30);
		afternmv = Meatdone;
		nomovemsg = "You now again prefer mimicking a human.";
		u.usym = '$';
		prme();
		break;
	}
	return (tp);
}