Пример #1
0
int
dosit()
{
	static const char sit_message[] = "VERB_SITZEN auf OBJECT KASUS_DATIV ARTIKEL_BESTIMMTER %s."; /* EN static const char sit_message[] = "sit on the %s."; */
	register struct trap *trap;
	register int typ = levl[u.ux][u.uy].typ;


#ifdef STEED
	if (u.usteed) {
	    You("VERB_SITZEN bereits auf KASUS_DATIV %s.", mon_nam(u.usteed)); /* EN You("are already sitting on %s.", mon_nam(u.usteed)); */
	    return (0);
	}
#endif

	if(!can_reach_floor())	{
	    if (Levitation)
		You("VERB_SCHLAGEN Purzelbäume."); /* EN You("tumble in place."); */
	    else
		You("VERB_SITZEN auf Luft."); /* EN You("are sitting on air."); */
	    return 0;
	} else if (is_pool(u.ux, u.uy) && !Underwater) {  /* water walking */
	    goto in_water;
	}

	if(OBJ_AT(u.ux, u.uy)) {
	    register struct obj *obj;

	    obj = level.objects[u.ux][u.uy];
	    You("VERB_SITZEN auf OBJECT KASUS_DATIV %s.", the(xname(obj))); /* EN You("sit on %s.", the(xname(obj))); */
	    if (!(Is_box(obj) || objects[obj->otyp].oc_material == CLOTH))
		pline("Das ist nicht sehr bequem ..."); /* EN pline("It's not very comfortable..."); */

	} else if ((trap = t_at(u.ux, u.uy)) != 0 ||
		   (u.utrap && (u.utraptype >= TT_LAVA))) {

	    if (u.utrap) {
		exercise(A_WIS, FALSE);	/* you're getting stuck longer */
		if(u.utraptype == TT_BEARTRAP) {
		    pline("Mit KASUS_DATIV PRONOMEN_POSSESSIV %s in KASUS_DATIV ARTIKEL_BESTIMMTER NOUN_BEARTRAP SUBJECT_IM_SATZ VERB_KOENNEN PRONOMEN_PERSONAL OBJECT PRONOMEN_PERSONAL nicht hinsetzen.", body_part(FOOT)); /* EN You_cant("sit down with your %s in the bear trap.", body_part(FOOT)); */
		    u.utrap++;
	        } else if(u.utraptype == TT_PIT) {
		    if(trap->ttyp == SPIKED_PIT) {
			You("VERB_SETZEN OBJECT PRONOMEN_PERSONAL auf einen Stachel.  Aua!"); /* EN You("sit down on a spike.  Ouch!"); */
			losehp(1, "durch Sitzen auf einen Eisenstachel", KILLED_WITHOUT_PREPOSITION); /* EN losehp(1, "sitting on an iron spike", KILLED_BY); */
			exercise(A_STR, FALSE);
		    } else
			You("VERB_SETZEN OBJECT PRONOMEN_PERSONAL in die Grube."); /* EN You("sit down in the pit."); */
		    u.utrap += rn2(5);
		} else if(u.utraptype == TT_WEB) {
		    You("VERB_SETZEN OBJECT PRONOMEN_PERSONAL ins Spinnenetz und VERB_VERHEDDERN OBJECT PRONOMEN_PERSONAL noch mehr!"); /* EN You("sit in the spider web and get entangled further!"); */
		    u.utrap += rn1(10, 5);
		} else if(u.utraptype == TT_LAVA) {
		    /* Must have fire resistance or they'd be dead already */
		    You("VERB_SETZEN OBJECT PRONOMEN_PERSONAL in die Lava!"); /* EN You("sit in the lava!"); */
		    u.utrap += rnd(4);
		    losehp(d(2,10), "durch Sitzen in Lava", KILLED_WITHOUT_PREPOSITION); /* EN losehp(d(2,10), "sitting in lava", KILLED_BY); */
		} else if(u.utraptype == TT_INFLOOR) {
		    You("VERB_CAN OBJECT PRONOMEN_PERSONAL nicht richtig hinsetzen!"); /* EN You_cant("maneuver to sit!"); */
		    u.utrap++;
		}
	    } else {
	        You("VERB_SETZEN OBJECT PRONOMEN_PERSONAL hin."); /* EN You("sit down."); */
		dotrap(trap, 0);
	    }
	} else if(Underwater || Is_waterlevel(&u.uz)) {
	    if (Is_waterlevel(&u.uz))
		pline("Hier gibt es keine Sitzkissen."); /* EN There("are no cushions floating nearby."); */
	    else
		You("VERB_SETZEN OBJECT PRONOMEN_PERSONAL auf den schlammigen Untergrund."); /* EN You("sit down on the muddy bottom."); */
	} else if(is_pool(u.ux, u.uy)) {
 in_water:
	    You("VERB_SITZEN im Wasser."); /* EN You("sit in the water."); */
	    if (!rn2(10) && uarm)
		(void) rust_dmg(uarm, "NOUN_ARMOR", 1, TRUE, &youmonst); /* EN (void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst); */
	    if (!rn2(10) && uarmf && uarmf->otyp != WATER_WALKING_BOOTS)
		(void) rust_dmg(uarm, "NOUN_ARMOR", 1, TRUE, &youmonst); /* EN (void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst); */
#ifdef SINKS
	} else if(IS_SINK(typ)) {

	    You(sit_message, defsyms[S_sink].explanation);
	    Your("%s VERB_WERDEN nass.", humanoid(youmonst.data) ? "NOUN_HINTERTEIL" : "NOUN_UNTERSEITE"); /* EN Your("%s gets wet.", humanoid(youmonst.data) ? "rump" : "underside"); */
#endif
	} else if(IS_ALTAR(typ)) {

	    You(sit_message, defsyms[S_altar].explanation);
	    altar_wrath(u.ux, u.uy);

	} else if(IS_GRAVE(typ)) {

	    You(sit_message, defsyms[S_grave].explanation);

	} else if(typ == STAIRS) {

	    You(sit_message, "NOUN_STUFEs"); /* EN You(sit_message, "stairs"); */

	} else if(typ == LADDER) {

	    You(sit_message, "NOUN_LADDER"); /* EN You(sit_message, "ladder"); */

	} else if (is_lava(u.ux, u.uy)) {

	    /* must be WWalking */
	    You(sit_message, "NOUN_LAVA"); /* EN You(sit_message, "lava"); */
	    burn_away_slime();
	    if (likes_lava(youmonst.data)) {
		pline_The("NOUN_LAVA fühlt sich warm an."); /* EN pline_The("lava feels warm."); */
		return 1;
	    }
	    pline_The("NOUN_LAVA VERB_VERBRENNEN OBJECT PRONOMEN_PERSONAL!"); /* EN pline_The("lava burns you!"); */
	    losehp(d((Fire_resistance ? 2 : 10), 10),
		   "durch Sitzen auf Lava", KILLED_WITHOUT_PREPOSITION); /* EN "sitting on lava", KILLED_BY); */

	} else if (is_ice(u.ux, u.uy)) {

	    You(sit_message, defsyms[S_ice].explanation);
	    if (!Cold_resistance) pline_The("NOUN_ICE fühlt sich kalt an."); /* EN if (!Cold_resistance) pline_The("ice feels cold."); */

	} else if (typ == DRAWBRIDGE_DOWN) {

	    You(sit_message, "NOUN_DRAWBRIDGE"); /* EN You(sit_message, "drawbridge"); */

	} else if(IS_THRONE(typ)) {

	    You(sit_message, defsyms[S_throne].explanation);
	    if (rnd(6) > 4)  {
		switch (rnd(13))  {
		    case 1:
			(void) adjattrib(rn2(A_MAX), -rn1(4,3), FALSE);
			losehp(rnd(10), "ADJEKTIV_CURSED NOUN_THRON", KILLED_BY_AN); /* EN losehp(rnd(10), "cursed throne", KILLED_BY_AN); */
			break;
		    case 2:
			(void) adjattrib(rn2(A_MAX), 1, FALSE);
			break;
		    case 3:
			pline("SUBJECT ARTIKEL_UNBESTIMMTER%s elektrischer NOUN_SCHLAG VERB_SCHIESSEN OBJECT durch PRONOMEN_POSSESSIV NOUN_BODY!", /* EN pline("A%s electric shock shoots through your body!", */
			      (Shock_resistance) ? "" : " massiver"); /* EN (Shock_resistance) ? "n" : " massive"); */
			losehp(Shock_resistance ? rnd(6) : rnd(30),
			       "ADJEKTIV_ELEKTRISCH NOUN_STUHL", KILLED_BY_AN); /* EN "electric chair", KILLED_BY_AN); */
			exercise(A_CON, FALSE);
			break;
		    case 4:
			Du_fuehlst_dich("viel, viel besser!"); /* EN You_feel("much, much better!"); */
			if (Upolyd) {
			    if (u.mh >= (u.mhmax - 5))  u.mhmax += 4;
			    u.mh = u.mhmax;
			}
			if(u.uhp >= (u.uhpmax - 5))  u.uhpmax += 4;
			u.uhp = u.uhpmax;
			make_blinded(0L,TRUE);
			make_sick(0L, (char *) 0, FALSE, SICK_ALL);
			heal_legs();
			flags.botl = 1;
			break;
		    case 5:
			take_gold();
			break;
		    case 6:
			if(u.uluck + rn2(5) < 0) {
			    You("VERB_FUEHLEN, NEUER_SATZ SUBJECT_IM_SATZ wie PRONOMEN_POSSESSIV NOUN_LUCK sich ändert."); /* EN You_feel("your luck is changing."); */
			    change_luck(1);
			} else	    makewish();
			break;
		    case 7:
			{
			register int cnt = rnd(10);

			pline("Eine Stimme ertönt:"); /* EN pline("A voice echoes:"); */
			verbalize("Euer Auditorium erwartet Euch bereits, %s!", /* EN verbalize("Thy audience hath been summoned, %s!", */
				  flags.female ? "Gebieterin" : "Gebieter"); /* EN flags.female ? "Dame" : "Sire"); */
			while(cnt--)
			    (void) makemon(courtmon(), u.ux, u.uy, NO_MM_FLAGS);
			break;
			}
		    case 8:
			pline("Eine Stimme ertönt:"); /* EN pline("A voice echoes:"); */
			verbalize("Wie es Euch beliebt, %s...", /* EN verbalize("By thy Imperious order, %s...", */
				  flags.female ? "Gebieterin" : "Gebieter"); /* EN flags.female ? "Dame" : "Sire"); */
			do_genocide(5);	/* REALLY|ONTHRONE, see do_genocide() */
			break;
		    case 9:
			pline("Eine Stimme ertönt:"); /* EN pline("A voice echoes:"); */
	verbalize("SATZBEGINN MODIFIER_VERB_IMPERATIV VERB_SEIN verflucht dafür, NEUER_SATZ dass SUBJECT_IM_SATZ PRONOMEN_PERSONAL OBJECT PRONOMEN_PERSONAL auf diesem allerheiligsten Thron niedergelassen VERB_HABEN!"); /* EN verbalize("A curse upon thee for sitting upon this most holy throne!"); */
			if (Luck > 0)  {
			    make_blinded(Blinded + rn1(100,250),TRUE);
			} else	    rndcurse();
			break;
		    case 10:
			if (Luck < 0 || (HSee_invisible & INTRINSIC))  {
				if (level.flags.nommap) {
					pline(
					"Ein schreckliches Dröhnen erfüllt KASUS_AKKUSATIV PRONOMEN_POSSESSIV NOUN_KOPF!"); /* EN "A terrible drone fills your head!"); */
					make_confused(HConfusion + rnd(30),
									FALSE);
				} else {
					pline("Ein Bild formt sich in KASUS_DATIV PRONOMEN_POSSESSIV NOUN_GEDANKEs."); /* EN pline("An image forms in your mind."); */
					do_mapping();
				}
			} else  {
				Your("NOUN_BLICK klärt sich."); /* EN Your("vision becomes clear."); */
				HSee_invisible |= FROMOUTSIDE;
				newsym(u.ux, u.uy);
			}
			break;
		    case 11:
			if (Luck < 0)  {
			    Du_fuehlst_dich("bedroht."); /* EN You_feel("threatened."); */
			    aggravate();
			} else  {
			    Du_spuerst("einen reißenden Schmerz."); /* EN You_feel("a wrenching sensation."); */
			    tele();		/* teleport him */
			}
			break;
		    case 12:
			Dir_wird("eine Einsicht gewährt!"); /* EN You("are granted an insight!"); */
			if (invent) {
			    /* rn2(5) agrees w/seffects() */
			    identify_pack(rn2(5));
			}
			break;
		    case 13:
			Your("NOUN_VERSTAND verknotet sich zu einer Bretzel!"); /* EN Your("mind turns into a pretzel!"); */
			make_confused(HConfusion + rn1(7,16),FALSE);
			break;
		    default:	impossible("throne effect");
				break;
		}
	    } else {
		if (is_prince(youmonst.data))
		    Du_fuehlst_dich("hier sehr wohl."); /* EN You_feel("very comfortable here."); */
		else
		    Du_fuehlst_dich("irgendwie fehl am Platz ..."); /* EN You_feel("somehow out of place..."); */
	    }

	    if (!rn2(3) && IS_THRONE(levl[u.ux][u.uy].typ)) {
		/* may have teleported */
		levl[u.ux][u.uy].typ = ROOM;
		pline_The("NOUN_THRON VERB_AUFLOESEN sich in ein Logikwölkchen SATZKLAMMER."); /* EN pline_The("throne vanishes in a puff of logic."); */
		newsym(u.ux,u.uy);
	    }

	} else if (lays_eggs(youmonst.data)) {
		struct obj *uegg;

		if (!flags.female) {
			pline("Männchen können keine Eier legen!"); /* EN pline("Males can't lay eggs!"); */
			return 0;
		}

		if (u.uhunger < (int)objects[EGG].oc_nutrition) {
			You("VERB_HAVE nicht genug Energie um ein Ei zu legen."); /* EN You("don't have enough energy to lay an egg."); */
			return 0;
		}

		uegg = mksobj(EGG, FALSE, FALSE);
		uegg->spe = 1;
		uegg->quan = 1;
		uegg->owt = weight(uegg);
		uegg->corpsenm = egg_type_from_parent(u.umonnum, FALSE);
		uegg->known = uegg->dknown = 1;
		attach_egg_hatch_timeout(uegg);
		You("VERB_LEGEN ein Ei."); /* EN You("lay an egg."); */
		dropy(uegg);
		stackobj(uegg);
		morehungry((int)objects[EGG].oc_nutrition);
	} else if (u.uswallow)
		pline("Hier gibt es keine Sitzmöglichkeiten!"); /* EN There("are no seats in here!"); */
	else
		pline("Spaß daran, %s zu sitzen?", auf_dem_Boden(u.ux,u.uy)); /* EN pline("Having fun sitting on the %s?", surface(u.ux,u.uy)); */
	return(1);
}
Пример #2
0
int
dosit()
{
	static const char *sit_message = "sit on the %s.";
	register struct trap *trap;
	register int typ = levl[u.ux][u.uy].typ;

	if(Levitation)  {
	    pline("You're sitting on air.");
	    return 0;
	} 

	if(OBJ_AT(u.ux, u.uy)) { 
	    register struct obj *obj;

	    obj = level.objects[u.ux][u.uy];
	    You("sit on %s.", the(xname(obj)));
	    if(!Is_box(obj)) pline("It's not very comfortable...");

	} else if ((trap = t_at(u.ux, u.uy)) != 0) {

	    if (u.utrap) {
		exercise(A_WIS, FALSE);	/* you're getting stuck longer */
		if(u.utraptype == TT_BEARTRAP) {
		    You("can't sit down with your %s in the bear trap.", body_part(FOOT));
		    u.utrap++;
	        } else if(u.utraptype == TT_PIT) {
		    if(trap->ttyp == SPIKED_PIT) {
			You("sit down on a spike.  Ouch!");
			losehp(1, "sitting on an iron spike", KILLED_BY);
			exercise(A_STR, FALSE);
		    } else
			You("sit down in the pit.");
		    u.utrap += rn2(5);
		} else if(u.utraptype == TT_WEB) {
		    You("sit in the spider web and get entangled further!");
		    u.utrap += rn1(10, 5);
		} else if(u.utraptype == TT_LAVA) {
		    /* Must have fire resistance or they'd be dead already */
		    You("sit in the lava!");
		    u.utrap += rnd(4);
		    losehp(d(2,10), "sitting in lava", KILLED_BY);
		} else if(u.utraptype == TT_INFLOOR) {
		    You("can't maneuver to sit!");
		    u.utrap++;
		}
	    } else {
	        You("sit down.");
		dotrap(trap);
	    }
	} else if(Underwater || Is_waterlevel(&u.uz)) {
	    if (Is_waterlevel(&u.uz))
		pline("There are no cushions floating nearby.");
	    else
		You("sit down in the muddy bottom.");
	} else if(is_pool(u.ux, u.uy)) {

	    You("sit in the water.");
	    if (!rn2(10) && uarm)
		(void) rust_dmg(uarm, "armor", 1, TRUE);
#ifdef POLYSELF
	    /* Note: without POLYSELF, this can't _happen_ without */
	    /* water walking boots.... */
	    if (!rn2(10) && uarmf && uarmf->otyp != WATER_WALKING_BOOTS)
		(void) rust_dmg(uarm, "armor", 1, TRUE);
#endif
#ifdef SINKS
	} else if(IS_SINK(typ)) {

	    You(sit_message, defsyms[S_sink].explanation);
	    Your("%s gets wet.", humanoid(uasmon) ? "rump" : "underside");
#endif
	} else if(IS_ALTAR(typ)) {

	    You(sit_message, defsyms[S_altar].explanation);
	    altar_wrath(u.ux, u.uy);

	} else if(typ == STAIRS) {

	    You(sit_message, "stairs");

	} else if(typ == LADDER) {

	    You(sit_message, "ladder");

	} else if (is_lava(u.ux, u.uy)) {

	    /* must be WWalking */
	    You(sit_message, "lava");
	    pline("The lava burns you!");
	    losehp(d((Fire_resistance ? 2 : 10), 10),
		   "sitting on lava", KILLED_BY);

	} else if (is_ice(u.ux, u.uy)) {

	    You(sit_message, defsyms[S_ice].explanation);
	    if (!Cold_resistance) pline("The ice feels cold.");

	} else if (typ == DRAWBRIDGE_DOWN) {

	    You(sit_message, "drawbridge");

	} else if(IS_THRONE(typ)) {

	    You(sit_message, defsyms[S_throne].explanation);
	    if (rnd(6) > 4)  {
		switch (rnd(13))  {
		    case 1:
			(void) adjattrib(rn2(A_MAX), -rn1(4,3), FALSE);
			losehp(rnd(10), "cursed throne", KILLED_BY_AN);
			break;
		    case 2:
			(void) adjattrib(rn2(A_MAX), 1, FALSE);
			break;
		    case 3:
			pline("A%s electric shock shoots through your body!",
			      (Shock_resistance) ? "" : " massive");
			losehp(Shock_resistance ? rnd(6) : rnd(30),
			       "electric chair", KILLED_BY_AN);
			exercise(A_CON, FALSE);
			break;
		    case 4:
			You("feel much, much better!");
			if(u.uhp >= (u.uhpmax - 5))  u.uhpmax += 4;
			u.uhp = u.uhpmax;
			make_blinded(0L,TRUE);
			make_sick(0L,FALSE);
			heal_legs();
			flags.botl = 1;
			break;
		    case 5:
			take_gold();
			break;
		    case 6:
			if(u.uluck + rn2(5) < 0) {
			    You("feel your luck is changing.");
			    change_luck(1);
			} else	    makewish();
			break;
		    case 7:
			{
			register int cnt = rnd(10);

			pline("A voice echoes:");
			verbalize("Thy audience hath been summoned, %s!",
				  flags.female ? "Dame" : "Sire");
			while(cnt--)
			    (void) makemon(courtmon(), u.ux, u.uy);
			break;
			}
		    case 8:
			pline("A voice echoes:");
			verbalize("By thy Imperious order, %s...",
				  flags.female ? "Dame" : "Sire");
			do_genocide(1);
			break;
		    case 9:
			pline("A voice echoes:");
	verbalize("A curse upon thee for sitting upon this most holy throne!");
			if (Luck > 0)  {
			    make_blinded(Blinded + rn1(100,250),TRUE);
			} else	    rndcurse();
			break;
		    case 10:
			if (Luck < 0 || (HSee_invisible & INTRINSIC))  {
				if (level.flags.nommap) {
					pline(
					"A terrible drone fills your head!");
					make_confused(HConfusion + rnd(30),
									FALSE);
				} else {
					pline("An image forms in your mind.");
					do_mapping();
				}
			} else  {
				Your("vision becomes clear.");
				HSee_invisible |= FROMOUTSIDE;
				newsym(u.ux, u.uy);
			}
			break;
		    case 11:
			if (Luck < 0)  {
			    You("feel threatened.");
			    aggravate();
			} else  {

			    You("feel a wrenching sensation.");
			    tele();		/* teleport him */
			}
			break;
		    case 12:
			You("are granted an insight!");
			if (invent) {
			    int ret, cval = rn2(5); /* agrees w/seffects() */
			    /* use up `cval' "charges"; 0 is special case */
			    do {
				ret = ggetobj("identify", identify, cval);
				if (ret < 0) break;	/* quit */
			    } while (ret == 0 || (cval -= ret) > 0);
			}
			break;
		    case 13:
			Your("mind turns into a pretzel!");
			make_confused(HConfusion + rn1(7,16),FALSE);
			break;
		    default:	impossible("throne effect");
				break;
		}
	    } else	You("feel somehow out of place...");

	    if (!rn2(3) && IS_THRONE(levl[u.ux][u.uy].typ)) {
		/* may have teleported */
		pline("The throne vanishes in a puff of logic.");
		levl[u.ux][u.uy].typ = ROOM;
		if(Invisible) newsym(u.ux,u.uy);
	    }

#ifdef POLYSELF
	} else if (lays_eggs(uasmon) || u.umonnum == PM_QUEEN_BEE) {
		struct obj *uegg;

		if (!flags.female) {
			pline("Males can't lay eggs!");
			return 0;
		}

		if (u.uhunger < (int)objects[EGG].oc_nutrition) {
			You("don't have enough energy to lay an egg.");
			return 0;
		}

		uegg = mksobj(EGG, FALSE, FALSE);
		uegg->spe = 1;
		uegg->quan = 1;
		uegg->owt = weight(uegg);
		uegg->corpsenm =
		    (u.umonnum==PM_QUEEN_BEE ? PM_KILLER_BEE : monsndx(uasmon));
		uegg->known = uegg->dknown = 1;
		You("lay an egg.");
		dropy(uegg);
		stackobj(uegg);
		morehungry((int)objects[EGG].oc_nutrition);
#endif
	} else if (u.uswallow)
		pline("There are no seats in here!");
	else
		pline("Having fun sitting on the %s?", surface(u.ux,u.uy));
	return(1);
}
Пример #3
0
int
dosit()
{
	static const char sit_message[] = "sit on the %s.";
	register struct trap *trap;
	register int typ = levl[u.ux][u.uy].typ;


#ifdef STEED
	if (u.usteed) {
	    You("are already sitting on %s.", mon_nam(u.usteed));
	    return (0);
	}
#endif

	if(!can_reach_floor())	{
	    if (Levitation)
		You("tumble in place.");
	    else
		You("are sitting on air.");
	    return 0;
	} else if (is_pool(u.ux, u.uy) && !Underwater) {  /* water walking */
	    goto in_water;
	}

	if(OBJ_AT(u.ux, u.uy)) {
	    register struct obj *obj;

	    obj = level.objects[u.ux][u.uy];
	    You("sit on %s.", the(xname(obj)));
	    if (!(Is_box(obj) || objects[obj->otyp].oc_material == CLOTH))
		pline("It's not very comfortable...");

	} else if ((trap = t_at(u.ux, u.uy)) != 0 ||
		   (u.utrap && (u.utraptype >= TT_LAVA))) {

	    if (u.utrap) {
		exercise(A_WIS, FALSE);	/* you're getting stuck longer */
		if(u.utraptype == TT_BEARTRAP) {
		    You_cant("sit down with your %s in the bear trap.", body_part(FOOT));
		    u.utrap++;
	        } else if(u.utraptype == TT_PIT) {
		    if(trap->ttyp == SPIKED_PIT) {
			You("sit down on a spike.  Ouch!");
			losehp(1, "sitting on an iron spike", KILLED_BY);
			exercise(A_STR, FALSE);
		    } else
			You("sit down in the pit.");
		    u.utrap += rn2(5);
		} else if(u.utraptype == TT_WEB) {
		    You("sit in the spider web and get entangled further!");
		    u.utrap += rn1(10, 5);
		} else if(u.utraptype == TT_LAVA) {
		    /* Must have fire resistance or they'd be dead already */
		    You("sit in the lava!");
		    u.utrap += rnd(4);
		    losehp(d(2,10), "sitting in lava", KILLED_BY);
		} else if(u.utraptype == TT_INFLOOR) {
		    You_cant("maneuver to sit!");
		    u.utrap++;
		}
	    } else {
	        You("sit down.");
		dotrap(trap, 0);
	    }
	} else if(Underwater || Is_waterlevel(&u.uz)) {
	    if (Is_waterlevel(&u.uz))
		There("are no cushions floating nearby.");
	    else
		You("sit down on the muddy bottom.");
	} else if(is_pool(u.ux, u.uy)) {
 in_water:
	    You("sit in the water.");
	    if (!rn2(10) && uarm)
		(void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst);
	    if (!rn2(10) && uarmf && uarmf->otyp != WATER_WALKING_BOOTS)
		(void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst);
#ifdef SINKS
	} else if(IS_SINK(typ)) {

	    You(sit_message, defsyms[S_sink].explanation);
	    Your("%s gets wet.", humanoid(youmonst.data) ? "rump" : "underside");
#endif
	} else if(IS_ALTAR(typ)) {

	    You(sit_message, defsyms[S_altar].explanation);
	    altar_wrath(u.ux, u.uy);

	} else if(IS_GRAVE(typ)) {

	    You(sit_message, defsyms[S_grave].explanation);

	} else if(typ == STAIRS) {

	    You(sit_message, "stairs");

	} else if(typ == LADDER) {

	    You(sit_message, "ladder");

	} else if (is_lava(u.ux, u.uy)) {

	    /* must be WWalking */
	    You(sit_message, "lava");
	    burn_away_slime();
	    if (likes_lava(youmonst.data)) {
		pline_The("lava feels warm.");
		return 1;
	    }
	    pline_The("lava burns you!");
	    losehp(d((Fire_resistance ? 2 : 10), 10),
		   "sitting on lava", KILLED_BY);

	} else if (is_ice(u.ux, u.uy)) {

	    You(sit_message, defsyms[S_ice].explanation);
	    if (!Cold_resistance) pline_The("ice feels cold.");

	} else if (typ == DRAWBRIDGE_DOWN) {

	    You(sit_message, "drawbridge");

	} else if(IS_THRONE(typ)) {

	    You(sit_message, defsyms[S_throne].explanation);
	    if (rnd(6) > 4)  {
		switch (rnd(13))  {
		    case 1:
			(void) adjattrib(rn2(A_MAX), -rn1(4,3), FALSE);
			losehp(rnd(10), "cursed throne", KILLED_BY_AN);
			break;
		    case 2:
			(void) adjattrib(rn2(A_MAX), 1, FALSE);
			break;
		    case 3:
			pline("A%s electric shock shoots through your body!",
			      (Shock_resistance) ? "n" : " massive");
			losehp(Shock_resistance ? rnd(6) : rnd(30),
			       "electric chair", KILLED_BY_AN);
			exercise(A_CON, FALSE);
			break;
		    case 4:
			You_feel("much, much better!");
			if (Upolyd) {
			    if (u.mh >= (u.mhmax - 5))  u.mhmax += 4;
			    u.mh = u.mhmax;
			}
			if(u.uhp >= (u.uhpmax - 5))  u.uhpmax += 4;
			u.uhp = u.uhpmax;
			make_blinded(0L,TRUE);
			make_sick(0L, (char *) 0, FALSE, SICK_ALL);
			heal_legs();
			flags.botl = 1;
			break;
		    case 5:
			take_gold();
			break;
		    case 6:
			if(u.uluck + rn2(5) < 0) {
			    You_feel("your luck is changing.");
			    change_luck(1);
			} else	    makewish();
			break;
		    case 7:
			{
			register int cnt = rnd(10);

			pline("A voice echoes:");
			verbalize("Thy audience hath been summoned, %s!",
				  flags.female ? "Dame" : "Sire");
			while(cnt--)
			    (void) makemon(courtmon(), u.ux, u.uy, NO_MM_FLAGS);
			break;
			}
		    case 8:
			pline("A voice echoes:");
			verbalize("By thy Imperious order, %s...",
				  flags.female ? "Dame" : "Sire");
			do_genocide(5);	/* REALLY|ONTHRONE, see do_genocide() */
			break;
		    case 9:
			pline("A voice echoes:");
	verbalize("A curse upon thee for sitting upon this most holy throne!");
			if (Luck > 0)  {
			    make_blinded(Blinded + rn1(100,250),TRUE);
			} else	    rndcurse();
			break;
		    case 10:
			if (Luck < 0 || (HSee_invisible & INTRINSIC))  {
				if (level.flags.nommap) {
					pline(
					"A terrible drone fills your head!");
					make_confused(HConfusion + rnd(30),
									FALSE);
				} else {
					pline("An image forms in your mind.");
					do_mapping();
				}
			} else  {
				Your("vision becomes clear.");
				HSee_invisible |= FROMOUTSIDE;
				newsym(u.ux, u.uy);
			}
			break;
		    case 11:
			if (Luck < 0)  {
			    You_feel("threatened.");
			    aggravate();
			} else  {

			    You_feel("a wrenching sensation.");
			    tele();		/* teleport him */
			}
			break;
		    case 12:
			You("are granted an insight!");
			if (invent) {
			    /* rn2(5) agrees w/seffects() */
			    identify_pack(rn2(5));
			}
			break;
		    case 13:
			Your("mind turns into a pretzel!");
			make_confused(HConfusion + rn1(7,16),FALSE);
			break;
		    default:	impossible("throne effect");
				break;
		}
	    } else {
		if (is_prince(youmonst.data))
		    You_feel("very comfortable here.");
		else
		    You_feel("somehow out of place...");
	    }

	    if (!rn2(3) && IS_THRONE(levl[u.ux][u.uy].typ)) {
		/* may have teleported */
		levl[u.ux][u.uy].typ = ROOM;
		pline_The("throne vanishes in a puff of logic.");
		newsym(u.ux,u.uy);
	    }

	} else if (lays_eggs(youmonst.data)) {
		struct obj *uegg;

		if (!flags.female) {
			pline("Males can't lay eggs!");
			return 0;
		}

		if (u.uhunger < (int)objects[EGG].oc_nutrition) {
			You("don't have enough energy to lay an egg.");
			return 0;
		}

		uegg = mksobj(EGG, FALSE, FALSE);
		uegg->spe = 1;
		uegg->quan = 1;
		uegg->owt = weight(uegg);
		uegg->corpsenm = egg_type_from_parent(u.umonnum, FALSE);
		uegg->known = uegg->dknown = 1;
		attach_egg_hatch_timeout(uegg);
		You("lay an egg.");
		dropy(uegg);
		stackobj(uegg);
		morehungry((int)objects[EGG].oc_nutrition);
	} else if (u.uswallow)
		There("are no seats in here!");
	else
		pline("Having fun sitting on the %s?", surface(u.ux,u.uy));
	return(1);
}
Пример #4
0
int
dosit() {
#ifdef THRONES
	register int cnt;
#endif

	if(Levitation)  {
	    pline("There's nothing to sit on up here.");
#ifdef THRONES
	} else  if(IS_THRONE(levl[u.ux][u.uy].typ)) {

	    if (rnd(6) > 4)  {
		switch (rnd(13))  {
		    case 1:
			adjattrib(rn2(A_MAX), -rn1(4,3), FALSE);
			losehp(rnd(10), "cursed throne", KILLED_BY_AN);
			break;
		    case 2:
			adjattrib(rn2(A_MAX), 1, FALSE);
			break;
		    case 3:
		pline("A%s charge of electricity shoots through your body!",
			      (Shock_resistance) ? "" : " massive");
			if(Shock_resistance)
				losehp(rnd(6), "electric chair", KILLED_BY_AN);
			else	losehp(rnd(30), "electric chair", KILLED_BY_AN);
			break;
		    case 4:
			You("feel much, much better!");
			if(u.uhp >= (u.uhpmax - 5))  u.uhpmax += 4;
			u.uhp = u.uhpmax;
			make_blinded(0L,TRUE);
			make_sick(0L,FALSE);
			heal_legs();
			flags.botl = 1;
			break;
		    case 5:
			take_gold();
			break;
		    case 6:
			if(u.uluck + rn2(5) < 0) {
			    You("feel your luck is changing.");
			    change_luck(1);
			} else	    makewish();
			break;
		    case 7:
			cnt = rnd(10);
			You("hear a voice echo:");
			pline("\"Thy audience hath been summoned, Sire!\"");
			while(cnt--)
			    (void) makemon(courtmon(), u.ux, u.uy);
			break;
		    case 8:
			You("hear a voice echo:");
			pline("\"By thy Imperious order, Sire...\"");
			do_genocide(1);
			break;
		    case 9:
			You("hear a voice echo:");
	pline("\"A curse upon thee for sitting upon this most holy throne!\"");
			if (Luck > 0)  {
			    make_blinded(Blinded + rn1(100,250),TRUE);
			} else	    rndcurse();
			break;
		    case 10:
			if (Luck < 0 || (HSee_invisible & INTRINSIC))  {
				pline("An image forms in your mind.");
				do_mapping();
			} else  {
				Your("vision clarifies.");
				HSee_invisible |= INTRINSIC;
			}
			break;
		    case 11:
			if (Luck < 0)  {
			    You("feel threatened.");
			    aggravate();
			} else  {

			    You("feel a wrenching sensation.");
			    tele();		/* teleport him */
			}
			break;
		    case 12:
			You("are granted a gift of insight!");
			while (!ggetobj("identify", identify, rn2(5))
				&& invent);
			break;
		    case 13:
			Your("mind turns into a pretzel!");
			make_confused(HConfusion + rn1(7,16),FALSE);
			break;
		    default:	impossible("throne effect");
				break;
		}
	    } else	You("feel somehow out of place...");

	    if (!rn2(3) && IS_THRONE(levl[u.ux][u.uy].typ))	{
		pline("The throne vanishes in a puff of logic.");
/*		levl[u.ux][u.uy].scrsym = ROOM_SYM; */
		levl[u.ux][u.uy].typ = ROOM;
		if(Invisible) newsym(u.ux,u.uy);
	    }
#endif
#ifdef POLYSELF
	} else if (lays_eggs(uasmon) || u.umonnum == PM_QUEEN_BEE) {
		struct obj *uegg;

		if (u.uhunger < objects[EGG].nutrition) {
			You("are too weak to lay an egg.");
			return 0;
		}

		uegg = mksobj(EGG, 0);
		uegg->spe = 1;
		uegg->quan = 1;
		uegg->owt = weight(uegg);
		uegg->corpsenm =
		    (u.umonnum==PM_QUEEN_BEE ? PM_KILLER_BEE : monsndx(uasmon));
		uegg->known = uegg->dknown = 1;
		You("lay an egg.");
		dropy(uegg);
		stackobj(uegg);
		morehungry(objects[EGG].nutrition);
#endif
	} else
		pline("Having fun sitting on the floor?");
	return(1);
}
Пример #5
0
/* #sit command */
int
dosit()
{
/*JP
    static const char sit_message[] = "sit on the %s.";
*/
    static const char sit_message[] = "%sに座った.";
    register struct trap *trap = t_at(u.ux, u.uy);
    register int typ = levl[u.ux][u.uy].typ;

    if (u.usteed) {
/*JP
        You("are already sitting on %s.", mon_nam(u.usteed));
*/
        You("もう%sに座っている.", mon_nam(u.usteed));
        return 0;
    }
    if (u.uundetected && is_hider(youmonst.data) && u.umonnum != PM_TRAPPER)
        u.uundetected = 0; /* no longer on the ceiling */

    if (!can_reach_floor(FALSE)) {
        if (u.uswallow)
/*JP
            There("are no seats in here!");
*/
            pline("ここには椅子がない!");
        else if (Levitation)
/*JP
            You("tumble in place.");
*/
            You("その場で宙返りした.");
        else
/*JP
            You("are sitting on air.");
*/
            You("空中に座った.");
        return 0;
    } else if (u.ustuck && !sticks(youmonst.data)) {
        /* holding monster is next to hero rather than beneath, but
           hero is in no condition to actually sit at has/her own spot */
        if (humanoid(u.ustuck->data))
/*JP
            pline("%s won't offer %s lap.", Monnam(u.ustuck), mhis(u.ustuck));
*/
            pline("%sはひざを出さなかった.", Monnam(u.ustuck));
        else
/*JP
            pline("%s has no lap.", Monnam(u.ustuck));
*/
            pline("%sにはひざがない.", Monnam(u.ustuck));
        return 0;
    } else if (is_pool(u.ux, u.uy) && !Underwater) { /* water walking */
        goto in_water;
    }

    if (OBJ_AT(u.ux, u.uy)
        /* ensure we're not standing on the precipice */
        && !uteetering_at_seen_pit(trap)) {
        register struct obj *obj;

        obj = level.objects[u.ux][u.uy];
        if (youmonst.data->mlet == S_DRAGON && obj->oclass == COIN_CLASS) {
#if 0 /*JP*/
            You("coil up around your %shoard.",
                (obj->quan + money_cnt(invent) < u.ulevel * 1000) ? "meager "
                                                                  : "");
#else
            You("%sお宝のまわりでとぐろを巻いた.",
                (obj->quan + money_cnt(invent) < u.ulevel * 1000) ? "わずかな"
                                                                  : "");
#endif
        } else {
/*JP
            You("sit on %s.", the(xname(obj)));
*/
            You("%sに座った.", the(xname(obj)));
            if (!(Is_box(obj) || objects[obj->otyp].oc_material == CLOTH))
/*JP
                pline("It's not very comfortable...");
*/
                pline("あまり座りごこちがよくない...");
        }
    } else if (trap != 0 || (u.utrap && (u.utraptype >= TT_LAVA))) {
        if (u.utrap) {
            exercise(A_WIS, FALSE); /* you're getting stuck longer */
            if (u.utraptype == TT_BEARTRAP) {
/*JP
                You_cant("sit down with your %s in the bear trap.",
*/
                pline("%sが熊の罠にはさまっているので座れない.",
                         body_part(FOOT));
                u.utrap++;
            } else if (u.utraptype == TT_PIT) {
                if (trap && trap->ttyp == SPIKED_PIT) {
/*JP
                    You("sit down on a spike.  Ouch!");
*/
                    You("トゲの上に座った.いてっ!");
                    losehp(Half_physical_damage ? rn2(2) : 1,
/*JP
                           "sitting on an iron spike", KILLED_BY);
*/
                           "鉄のトゲの上に座って", KILLED_BY);
                    exercise(A_STR, FALSE);
                } else
/*JP
                    You("sit down in the pit.");
*/
                    You("落し穴の中で座った.");
                u.utrap += rn2(5);
            } else if (u.utraptype == TT_WEB) {
/*JP
                You("sit in the spider web and get entangled further!");
*/
                You("くもの巣の中で座ったら,ますます絡まった!");
                u.utrap += rn1(10, 5);
            } else if (u.utraptype == TT_LAVA) {
                /* Must have fire resistance or they'd be dead already */
/*JP
                You("sit in the lava!");
*/
                You("溶岩の中に座った!");
                if (Slimed)
                    burn_away_slime();
                u.utrap += rnd(4);
/*JP
                losehp(d(2, 10), "sitting in lava",
*/
                losehp(d(2, 10), "溶岩の中に座って",
                       KILLED_BY); /* lava damage */
            } else if (u.utraptype == TT_INFLOOR
                       || u.utraptype == TT_BURIEDBALL) {
/*JP
                You_cant("maneuver to sit!");
*/
                You("座るような動作ができない!");
                u.utrap++;
            }
        } else {
/*JP
            You("sit down.");
*/
            You("座った.");
            dotrap(trap, 0);
        }
    } else if (Underwater || Is_waterlevel(&u.uz)) {
        if (Is_waterlevel(&u.uz))
/*JP
            There("are no cushions floating nearby.");
*/
            pline("近くに浮いているクッションはない.");
        else
/*JP
            You("sit down on the muddy bottom.");
*/
            You("どろどろした底に座った.");
    } else if (is_pool(u.ux, u.uy)) {
    in_water:
/*JP
        You("sit in the water.");
*/
        You("水の中で座った.");
        if (!rn2(10) && uarm)
/*JP
            (void) water_damage(uarm, "armor", TRUE);
*/
            (void) water_damage(uarm, "鎧", TRUE);
        if (!rn2(10) && uarmf && uarmf->otyp != WATER_WALKING_BOOTS)
/*JP
            (void) water_damage(uarm, "armor", TRUE);
*/
            (void) water_damage(uarm, "鎧", TRUE);
    } else if (IS_SINK(typ)) {
        You(sit_message, defsyms[S_sink].explanation);
/*JP
        Your("%s gets wet.", humanoid(youmonst.data) ? "rump" : "underside");
*/
        Your("%sは濡れた.", humanoid(youmonst.data) ? "尻" : "下部");
    } else if (IS_ALTAR(typ)) {
        You(sit_message, defsyms[S_altar].explanation);
        altar_wrath(u.ux, u.uy);
    } else if (IS_GRAVE(typ)) {
        You(sit_message, defsyms[S_grave].explanation);
    } else if (typ == STAIRS) {
/*JP
        You(sit_message, "stairs");
*/
        You(sit_message, "階段");
    } else if (typ == LADDER) {
/*JP
        You(sit_message, "ladder");
*/
        You(sit_message, "はしご");
    } else if (is_lava(u.ux, u.uy)) {
        /* must be WWalking */
/*JP
        You(sit_message, "lava");
*/
        You(sit_message, "溶岩");
        burn_away_slime();
        if (likes_lava(youmonst.data)) {
/*JP
            pline_The("lava feels warm.");
*/
            pline("溶岩は暖かい.");
            return 1;
        }
/*JP
        pline_The("lava burns you!");
*/
        You("溶岩で燃えた!");
        losehp(d((Fire_resistance ? 2 : 10), 10), /* lava damage */
/*JP
               "sitting on lava", KILLED_BY);
*/
               "溶岩に座って", KILLED_BY);
    } else if (is_ice(u.ux, u.uy)) {
        You(sit_message, defsyms[S_ice].explanation);
        if (!Cold_resistance)
/*JP
            pline_The("ice feels cold.");
*/
            pline("氷は冷たく感じた.");
    } else if (typ == DRAWBRIDGE_DOWN) {
/*JP
        You(sit_message, "drawbridge");
*/
        You(sit_message, "跳ね橋");
    } else if (IS_THRONE(typ)) {
        You(sit_message, defsyms[S_throne].explanation);
        if (rnd(6) > 4) {
            switch (rnd(13)) {
            case 1:
                (void) adjattrib(rn2(A_MAX), -rn1(4, 3), FALSE);
/*JP
                losehp(rnd(10), "cursed throne", KILLED_BY_AN);
*/
                losehp(rnd(10), "呪われた玉座で", KILLED_BY_AN);
                break;
            case 2:
                (void) adjattrib(rn2(A_MAX), 1, FALSE);
                break;
            case 3:
#if 0 /*JP*/
                pline("A%s electric shock shoots through your body!",
                      (Shock_resistance) ? "n" : " massive");
#else
                pline("%s電気があなたの体を走り抜けた!",
                      (Shock_resistance) ? "" : "激しい");
#endif
/*JP
                losehp(Shock_resistance ? rnd(6) : rnd(30), "electric chair",
*/
                losehp(Shock_resistance ? rnd(6) : rnd(30), "電気椅子で",
                       KILLED_BY_AN);
                exercise(A_CON, FALSE);
                break;
            case 4:
/*JP
                You_feel("much, much better!");
*/
                You_feel("とても,とても元気になったような気がした!");
                if (Upolyd) {
                    if (u.mh >= (u.mhmax - 5))
                        u.mhmax += 4;
                    u.mh = u.mhmax;
                }
                if (u.uhp >= (u.uhpmax - 5))
                    u.uhpmax += 4;
                u.uhp = u.uhpmax;
                make_blinded(0L, TRUE);
                make_sick(0L, (char *) 0, FALSE, SICK_ALL);
                heal_legs();
                context.botl = 1;
                break;
            case 5:
                take_gold();
                break;
            case 6:
                if (u.uluck + rn2(5) < 0) {
/*JP
                    You_feel("your luck is changing.");
*/
                    pline("運が向いてきた気がする.");
                    change_luck(1);
                } else
                    makewish();
                break;
            case 7:
              {
                int cnt = rnd(10);

                /* Magical voice not affected by deafness */
/*JP
                pline("A voice echoes:");
*/
                pline("声が響いた:");
#if 0 /*JP*/
                verbalize("Thy audience hath been summoned, %s!",
                          flags.female ? "Dame" : "Sire");
#else
                verbalize("%sよ!汝の聴衆召喚されし.",
                          flags.female ? "女" : "男");
#endif
                while (cnt--)
                    (void) makemon(courtmon(), u.ux, u.uy, NO_MM_FLAGS);
                break;
              }
            case 8:
                /* Magical voice not affected by deafness */
/*JP
                pline("A voice echoes:");
*/
                pline("声が響いた:");
#if 0 /*JP*/
                verbalize("By thine Imperious order, %s...",
                          flags.female ? "Dame" : "Sire");
#else
                verbalize("%sよ!汝の傲慢聞きいれようぞ.",
                          flags.female ? "女" : "男");
#endif
                do_genocide(5); /* REALLY|ONTHRONE, see do_genocide() */
                break;
            case 9:
                /* Magical voice not affected by deafness */
/*JP
                pline("A voice echoes:");
*/
                pline("声が響いた:");
                verbalize(
/*JP
                 "A curse upon thee for sitting upon this most holy throne!");
*/
                 "聖なる玉座に座りし汝に呪いあれ!");
                if (Luck > 0) {
                    make_blinded(Blinded + rn1(100, 250), TRUE);
                } else
                    rndcurse();
                break;
            case 10:
                if (Luck < 0 || (HSee_invisible & INTRINSIC)) {
                    if (level.flags.nommap) {
/*JP
                        pline("A terrible drone fills your head!");
*/
                        pline("恐しいブンブンという音が頭に響いた!");
                        make_confused((HConfusion & TIMEOUT) + (long) rnd(30),
                                      FALSE);
                    } else {
/*JP
                        pline("An image forms in your mind.");
*/
                        pline("あるイメージが頭に浮んだ.");
                        do_mapping();
                    }
                } else {
/*JP
                    Your("vision becomes clear.");
*/
                    Your("視界は冴え渡った.");
                    HSee_invisible |= FROMOUTSIDE;
                    newsym(u.ux, u.uy);
                }
                break;
            case 11:
                if (Luck < 0) {
/*JP
                    You_feel("threatened.");
*/
                    You("脅迫されているような気がした.");
                    aggravate();
                } else {
/*JP
                    You_feel("a wrenching sensation.");
*/
                    You("ねじられたような感覚を感じた.");
                    tele(); /* teleport him */
                }
                break;
            case 12:
/*JP
                You("are granted an insight!");
*/
                You("洞察力を得た!");
                if (invent) {
                    /* rn2(5) agrees w/seffects() */
                    identify_pack(rn2(5), FALSE);
                }
                break;
            case 13:
/*JP
                Your("mind turns into a pretzel!");
*/
                Your("心はクネクネになった!");
                make_confused((HConfusion & TIMEOUT) + (long) rn1(7, 16),
                              FALSE);
                break;
            default:
                impossible("throne effect");
                break;
            }
        } else {
            if (is_prince(youmonst.data))
/*JP
                You_feel("very comfortable here.");
*/
                You("ここはとても落ち着く.");
            else
/*JP
                You_feel("somehow out of place...");
*/
                You("何か場違いの気がした...");
        }

        if (!rn2(3) && IS_THRONE(levl[u.ux][u.uy].typ)) {
            /* may have teleported */
            levl[u.ux][u.uy].typ = ROOM;
/*JP
            pline_The("throne vanishes in a puff of logic.");
*/
            pline("玉座はふっと消えた.");
            newsym(u.ux, u.uy);
        }
    } else if (lays_eggs(youmonst.data)) {
        struct obj *uegg;

        if (!flags.female) {
#if 0 /*JP*/
            pline("%s can't lay eggs!",
                  Hallucination
                      ? "You may think you are a platypus, but a male still"
                      : "Males");
#else
            pline("%s雄は卵を産めない!",
                  Hallucination
                      ? "あなたは自分がカモノハシだと思っているかもしれないが,やっぱり"
                      : "");
#endif
            return 0;
        } else if (u.uhunger < (int) objects[EGG].oc_nutrition) {
/*JP
            You("don't have enough energy to lay an egg.");
*/
            You("卵を産むだけのエネルギーがない.");
            return 0;
        }

        uegg = mksobj(EGG, FALSE, FALSE);
        uegg->spe = 1;
        uegg->quan = 1L;
        uegg->owt = weight(uegg);
        /* this sets hatch timers if appropriate */
        set_corpsenm(uegg, egg_type_from_parent(u.umonnum, FALSE));
        uegg->known = uegg->dknown = 1;
/*JP
        You("lay an egg.");
*/
        You("卵を産んだ.");
        dropy(uegg);
        stackobj(uegg);
        morehungry((int) objects[EGG].oc_nutrition);
    } else {
/*JP
        pline("Having fun sitting on the %s?", surface(u.ux, u.uy));
*/
        pline("%sに座って楽しいかい?", surface(u.ux,u.uy));
    }
    return 1;
}
Пример #6
0
/* TRUE: book should be destroyed by caller */
static boolean
cursed_book(struct obj *bp)
{
    int lev = objects[bp->otyp].oc_level;
    boolean was_inuse;

    switch (rn2(lev)) {
    case 0:
        pline("You feel a wrenching sensation.");
        tele(); /* teleport him */
        break;
    case 1:
        pline("You feel threatened.");
        aggravate();
        break;
    case 2:
        make_blinded(Blinded + rn1(100, 250), TRUE);
        break;
    case 3:
        take_gold();
        break;
    case 4:
        pline("These runes were just too much to comprehend.");
        make_confused(HConfusion + rn1(7, 16), FALSE);
        break;
    case 5:
        pline("The book was coated with contact poison!");
        if (uarmg) {
            erode_obj(uarmg, "gloves", ERODE_CORRODE, TRUE, TRUE);
            break;
        }
        /* Temporarily disable in_use; death should not destroy the book.

           Paranoia: ensure that we don't turn /on/ in_use, that causes a
           desync. (That used to be able to happen via an old codepath, but that
           codepath has since been removed. I don't think there are others, but
           someone might unintentionally add one.) */
        was_inuse = bp->in_use;
        bp->in_use = FALSE;
        losestr(Poison_resistance ? rn1(2, 1) : rn1(4, 3), DIED,
                killer_msg(DIED, "a contact-poisoned spellbook"), NULL);
        losehp(rnd(Poison_resistance ? 6 : 10),
               killer_msg(DIED, "a contact-poisoned spellbook"));
        bp->in_use = was_inuse;
        break;
    case 6:
        if (Antimagic) {
            shieldeff(u.ux, u.uy);
            pline("The book %s, but you are unharmed!", explodes);
        } else {
            pline("As you read the book, it %s in your %s!", explodes,
                  body_part(FACE));
            losehp(2 * rnd(10) + 5, killer_msg(DIED, "an exploding rune"));
        }
        return TRUE;
    default:
        rndcurse();
        break;
    }
    return FALSE;
}
void cScreenGirlDetails::check_events()
{
	// no events means we can go home
	if (g_InterfaceEvents.GetNumEvents() == 0) return;

	// if it's the back button, pop the window off the stack and we're done
	if (g_InterfaceEvents.CheckButton(back_id))
	{
		g_InitWin = true;
		g_WinManager.Pop();
		return;
	}
	if (g_InterfaceEvents.CheckSlider(houseperc_id))
	{
		g_Girls.SetStat(selected_girl, STAT_HOUSE, SliderValue(houseperc_id));
		ss.str("");
		ss << gettext("House Percentage: ") << SliderValue(houseperc_id) << gettext("%");
		EditTextItem(ss.str(), housepercval_id);
		// Rebelliousness might have changed, so update details
		if (DetailLevel == 0)
		{
			string detail = g_Girls.GetDetailsString(selected_girl);
			EditTextItem(detail, girldesc_id);
		}
		return;
	}
	if (g_InterfaceEvents.CheckButton(more_id))
	{
		if (DetailLevel == 0)		{ DetailLevel = 1; EditTextItem(g_Girls.GetMoreDetailsString(selected_girl), girldesc_id); }
		else if (DetailLevel == 1)	{ DetailLevel = 2; EditTextItem(g_Girls.GetThirdDetailsString(selected_girl), girldesc_id); }
		else						{ DetailLevel = 0; EditTextItem(g_Girls.GetDetailsString(selected_girl), girldesc_id); }
	}
	if (g_InterfaceEvents.CheckButton(day_id))
	{
		DisableButton(day_id, true);
		DisableButton(night_id, false);
		g_InitWin = true;
		Day0Night1 = SHIFT_DAY;
	}
	if (g_InterfaceEvents.CheckButton(night_id))
	{
		DisableButton(day_id, false);
		DisableButton(night_id, true);
		g_InitWin = true;
		Day0Night1 = SHIFT_NIGHT;
	}
	if (g_InterfaceEvents.CheckCheckbox(antipreg_id))
	{
		selected_girl->m_UseAntiPreg = (IsCheckboxOn(antipreg_id));
	}
	if (g_InterfaceEvents.CheckListbox(traitlist_id))
	{
		int selection = GetLastSelectedItemFromList(traitlist_id);
		if (selection != -1)
			EditTextItem(selected_girl->m_Traits[selection]->m_Desc, traitdesc_id);
		else
			EditTextItem("", traitdesc_id);
	}
	if (g_InterfaceEvents.CheckListbox(jobtypelist_id))
	{
		SetJob = true;
		RefreshJobList();
	}
	if (g_InterfaceEvents.CheckListbox(joblist_id))
	{
		bool fulltime = g_CTRLDown;

		int selection = GetSelectedItemFromList(joblist_id);
		if (selection != -1)
		{
			int old_job = (Day0Night1 ? selected_girl->m_NightJob : selected_girl->m_DayJob);
			// handle special job requirements and assign - if HandleSpecialJobs returns true, the job assignment was modified or cancelled
			if (g_Brothels.m_JobManager.HandleSpecialJobs(g_CurrBrothel, selected_girl, selection, old_job, Day0Night1, fulltime))
			{
				selection = (Day0Night1 ? selected_girl->m_NightJob : selected_girl->m_DayJob);
				SetSelectedItemInList(joblist_id, selection, false);
			}
			// refresh job worker counts for former job and current job
			if (old_job != selection)
			{
				SetSelectedItemText(joblist_id, old_job, g_Brothels.m_JobManager.JobDescriptionCount(old_job, g_CurrBrothel, Day0Night1));
				SetSelectedItemText(joblist_id, selection, g_Brothels.m_JobManager.JobDescriptionCount(selection, g_CurrBrothel, Day0Night1));
			}
			RefreshJobList();
		}
	}
	if (g_InterfaceEvents.CheckButton(inventory_id))
	{
		if (selected_girl)
		{
			if (GirlDead(selected_girl)) return;
			g_InitWin = true;
			g_AllTogle = true;
			g_WinManager.push("Item Management");
			return;
		}
	}
	if (g_InterfaceEvents.CheckButton(gallery_id))
	{
		g_WinManager.push("Gallery");
		g_InitWin = true;
		return;
	}


	if (g_InterfaceEvents.CheckSlider(accom_id))
	{
		selected_girl->m_AccLevel = SliderValue(accom_id);
		SliderRange(accom_id, 0, 9, selected_girl->m_AccLevel, 1);
		if (accomval_id != -1)
		{
			stringstream acc;
			acc << "Accommodation: " << g_Girls.Accommodation(SliderValue(accom_id));
			if (cfg.debug.log_extradetails())
			{
				int val = SliderValue(accom_id) - g_Girls.PreferredAccom(selected_girl);
				if (val != 0) acc << "  ( " << (val > 0 ? "+" : "") << val << " )";
			}
			EditTextItem(acc.str(), accomval_id);
		}
		g_InitWin = true;
		return;
	}
	if (g_InterfaceEvents.CheckButton(accomup_id))
	{
		if (selected_girl->m_AccLevel + 1 > 9)
			selected_girl->m_AccLevel = 9;
		else
			selected_girl->m_AccLevel++;
		if (accomval_id != -1) EditTextItem("Accommodation: " + g_Girls.Accommodation(selected_girl->m_AccLevel), accomval_id);

		g_InitWin = true;
		return;
	}
	if (g_InterfaceEvents.CheckButton(accomdown_id))
	{
		if (selected_girl->m_AccLevel - 1 < 0)	selected_girl->m_AccLevel = 0;
		else									selected_girl->m_AccLevel--;
		if (accomval_id != -1) EditTextItem("Accommodation: " + g_Girls.Accommodation(selected_girl->m_AccLevel), accomval_id);

		g_InitWin = true;
		return;
	}
	if (g_InterfaceEvents.CheckButton(takegold_id))
	{
		take_gold(selected_girl);
	}
	if (g_InterfaceEvents.CheckButton(reldungeon_id))
	{
		g_Brothels.GetDungeon()->GetDungeonPos(selected_girl);
		if ((g_Brothels.GetBrothel(g_CurrBrothel)->m_NumRooms - g_Brothels.GetBrothel(g_CurrBrothel)->m_NumGirls) == 0)
		{
			g_MessageQue.AddToQue(gettext("The current brothel has no more room.\nBuy a new one, get rid of some girls, or change the brothel you are currently managing."), 0);
		}
		else
		{
			sGirl* nextGirl = remove_selected_girl();
			sGirl* tempGirl = g_Brothels.GetDungeon()->RemoveGirl(g_Brothels.GetDungeon()->GetGirl(g_Brothels.GetDungeon()->GetGirlPos(selected_girl)));
			g_Brothels.AddGirl(g_CurrBrothel, tempGirl);

			if (g_Brothels.GetDungeon()->GetNumGirls() == 0)
			{
				selected_girl = 0;
				g_WinManager.Pop();
			}
			else
				selected_girl = nextGirl;
		}
		g_InitWin = true;
		return;
	}
	if (g_InterfaceEvents.CheckButton(senddungeon_id))
	{
		ss.str("");
		g_Brothels.GetGirlPos(g_CurrBrothel, selected_girl);

		// does she decide to fight back
		if (g_Brothels.FightsBack(selected_girl))
		{
			bool win = true;
			sGang* gang = g_Gangs.GetGangOnMission(MISS_GUARDING);
			int count = 8;
			while (gang && win && count >= 0)
			{
				win = (g_Gangs.GangCombat(selected_girl, gang));
				if (gang->m_Num == 0) gang = g_Gangs.GetGangOnMission(MISS_GUARDING);
				count--;
				if (count<0) win = true;
			}
			// Calculate combat between goons and girl if she decides to fight back
			if (win)
			{
				ss << gettext("She puts up a fight");
				if (gang && gang->m_Num == 0) ss << gettext(", and the gang is completely wiped out");
				ss << ". ";

				if (g_Brothels.PlayerCombat(selected_girl))				// fight with the player
				{
					// If girl wins she escapes and leaves the brothel
					ss << gettext("After defeating you as well, she escapes to the outside.\n");
					ss << gettext("She will escape for good in 6 weeks if you don't send someone after her.");

					sGirl* nextGirl = remove_selected_girl();
					sGirl* temp = selected_girl;
					if (selected_girl->m_DayJob == JOB_INDUNGEON)	temp = g_Brothels.GetDungeon()->RemoveGirl(selected_girl);
					else if (selected_girl->m_InHouse)	g_House.RemoveGirl(0, selected_girl, false);
					else if (selected_girl->m_InFarm)	g_Farm.RemoveGirl(0, selected_girl, false);
					else if (selected_girl->m_InClinic)	g_Clinic.RemoveGirl(0, selected_girl, false);
					else if (selected_girl->m_InCentre)	g_Centre.RemoveGirl(0, selected_girl, false);
					else if (selected_girl->m_InArena)	g_Arena.RemoveGirl(0, selected_girl, false);
					else if (selected_girl->m_InStudio)	g_Studios.RemoveGirl(0, selected_girl, false);
					else g_Brothels.RemoveGirl(selected_girl->where_is_she, selected_girl, false);

					temp->m_RunAway = 6;
					temp->m_NightJob = temp->m_DayJob = JOB_RUNAWAY;
					g_Brothels.AddGirlToRunaways(temp);

					stringstream smess;
					smess << temp->m_Realname << gettext(" has run away");
					g_MessageQue.AddToQue(smess.str(), 1);

					selected_girl = nextGirl;
					if (selected_girl == 0) g_WinManager.Pop();
				}
				else	// otherwise put her in the dungeon
				{
					int reason = (selected_girl->m_Spotted ? DUNGEON_GIRLSTEAL : DUNGEON_GIRLWHIM);
					sGirl* nextGirl = remove_selected_girl();
					selected_girl->m_DayJob = selected_girl->m_NightJob = JOB_INDUNGEON;

					/* */if (selected_girl->m_InHouse)	g_House.RemoveGirl(0, selected_girl, false);
					else if (selected_girl->m_InFarm)	g_Farm.RemoveGirl(0, selected_girl, false);
					else if (selected_girl->m_InClinic)	g_Clinic.RemoveGirl(0, selected_girl, false);
					else if (selected_girl->m_InCentre)	g_Centre.RemoveGirl(0, selected_girl, false);
					else if (selected_girl->m_InArena)	g_Arena.RemoveGirl(0, selected_girl, false);
					else if (selected_girl->m_InStudio)	g_Studios.RemoveGirl(0, selected_girl, false);
					else g_Brothels.RemoveGirl(selected_girl->where_is_she, selected_girl, false);

					g_Brothels.GetDungeon()->AddGirl(selected_girl, reason);
					ss << gettext("However, you manage to defeat her yourself and place her unconscious body in the dungeon.");

					bool pop = false;
					/* */if (selected_girl->m_InHouse)	if (g_House.GetNumGirls(0) == 0)	pop = true;
					else if (selected_girl->m_InFarm)	if (g_Farm.GetNumGirls(0) == 0)		pop = true;
					else if (selected_girl->m_InClinic)	if (g_Clinic.GetNumGirls(0) == 0)	pop = true;
					else if (selected_girl->m_InCentre)	if (g_Centre.GetNumGirls(0) == 0)	pop = true;
					else if (selected_girl->m_InArena)	if (g_Arena.GetNumGirls(0) == 0)	pop = true;
					else if (selected_girl->m_InStudio)	if (g_Studios.GetNumGirls(0) == 0)	pop = true;
					else if (g_Brothels.GetNumGirls(selected_girl->where_is_she) == 0)		pop = true;

					if (pop)	{ selected_girl = 0; g_WinManager.Pop(); }
					else		selected_girl = nextGirl;
				}
			}
			else	// otherwise put her in the dungeon
			{
				ss << gettext("She puts up a fight ");
				if (gang && gang->m_Num == 0)	ss << gettext("and the gang is wiped out, ");

				ss << gettext("but your goons manage to drag her unconscious to the dungeon.");
				int reason = (selected_girl->m_Spotted ? DUNGEON_GIRLSTEAL : DUNGEON_GIRLWHIM);
				sGirl* nextGirl = remove_selected_girl();

				/* */if (selected_girl->m_InHouse)	g_House.RemoveGirl(0, selected_girl, false);
				else if (selected_girl->m_InFarm)	g_Farm.RemoveGirl(0, selected_girl, false);
				else if (selected_girl->m_InClinic)	g_Clinic.RemoveGirl(0, selected_girl, false);
				else if (selected_girl->m_InCentre)	g_Centre.RemoveGirl(0, selected_girl, false);
				else if (selected_girl->m_InArena)	g_Arena.RemoveGirl(0, selected_girl, false);
				else if (selected_girl->m_InStudio)	g_Studios.RemoveGirl(0, selected_girl, false);
				else g_Brothels.RemoveGirl(selected_girl->where_is_she, selected_girl, false);
				g_Brothels.GetDungeon()->AddGirl(selected_girl, reason);

				bool pop = false;
				/* */if (selected_girl->m_InHouse)	if (g_House.GetNumGirls(0) == 0)	pop = true;
				else if (selected_girl->m_InFarm)	if (g_Farm.GetNumGirls(0) == 0)		pop = true;
				else if (selected_girl->m_InClinic)	if (g_Clinic.GetNumGirls(0) == 0)	pop = true;
				else if (selected_girl->m_InCentre)	if (g_Centre.GetNumGirls(0) == 0)	pop = true;
				else if (selected_girl->m_InArena)	if (g_Arena.GetNumGirls(0) == 0)	pop = true;
				else if (selected_girl->m_InStudio)	if (g_Studios.GetNumGirls(0) == 0)	pop = true;
				else if (g_Brothels.GetNumGirls(selected_girl->where_is_she) == 0)		pop = true;

				if (pop)	{ selected_girl = 0; g_WinManager.Pop(); }
				else		selected_girl = nextGirl;
			}
		}
		else
		{
			int reason = (selected_girl->m_Spotted ? DUNGEON_GIRLSTEAL : DUNGEON_GIRLWHIM);
			sGirl* nextGirl = remove_selected_girl();

			/* */if (selected_girl->m_InHouse)	g_House.RemoveGirl(0, selected_girl, false);
			else if (selected_girl->m_InFarm)	g_Farm.RemoveGirl(0, selected_girl, false);
			else if (selected_girl->m_InClinic)	g_Clinic.RemoveGirl(0, selected_girl, false);
			else if (selected_girl->m_InCentre)	g_Centre.RemoveGirl(0, selected_girl, false);
			else if (selected_girl->m_InArena)	g_Arena.RemoveGirl(0, selected_girl, false);
			else if (selected_girl->m_InStudio)	g_Studios.RemoveGirl(0, selected_girl, false);
			else g_Brothels.RemoveGirl(selected_girl->where_is_she, selected_girl, false);

			g_Brothels.GetDungeon()->AddGirl(selected_girl, reason);
			ss << gettext("She goes quietly with a sullen look on her face.");

			bool pop = false;
			/* */if (selected_girl->m_InHouse)	if (g_House.GetNumGirls(0) == 0)	pop = true;
			else if (selected_girl->m_InFarm)	if (g_Farm.GetNumGirls(0) == 0)		pop = true;
			else if (selected_girl->m_InClinic)	if (g_Clinic.GetNumGirls(0) == 0)	pop = true;
			else if (selected_girl->m_InCentre)	if (g_Centre.GetNumGirls(0) == 0)	pop = true;
			else if (selected_girl->m_InArena)	if (g_Arena.GetNumGirls(0) == 0)	pop = true;
			else if (selected_girl->m_InStudio)	if (g_Studios.GetNumGirls(0) == 0)	pop = true;
			else if (g_Brothels.GetNumGirls(g_CurrBrothel) == 0) /*              */	pop = true;

			if (pop)	{ selected_girl = 0; g_WinManager.Pop(); }
			else		selected_girl = nextGirl;
		}
		g_InitWin = true;
		g_MessageQue.AddToQue(ss.str(), 0);
		return;
	}
	if (g_InterfaceEvents.CheckButton(interact_id))
	{
		if (g_TalkCount > 0)
		{
			DirPath dp;
			eventrunning = true;
			if (selected_girl->m_DayJob != JOB_INDUNGEON)
			{
				int v[2] = { 1, -1 };
				cTrigger* trig = 0;
				if (!(trig = selected_girl->m_Triggers.CheckForScript(TRIGGER_TALK, false, v)))	// trigger any girl specific talk script
				{
					// no, so trigger the default one
					dp = dp << "Resources" << "Scripts" << "DefaultInteractDetails.script";
				}
				else
				{
					// yes, so use that instead
					dp = DirPath(cfg.folders.characters().c_str()) << selected_girl->m_Name << trig->m_Script;
				}
			}
			else
			{
				int v[2] = { 0, -1 };
				cTrigger* trig = 0;
				if (!(trig = selected_girl->m_Triggers.CheckForScript(TRIGGER_TALK, false, v)))	// trigger any girl specific talk script
				{
					// no, so trigger the default one
					dp = dp << "Resources" << "Scripts" << "DefaultInteractDungeon.script";
				}
				else
				{
						dp = DirPath(cfg.folders.characters().c_str()) << selected_girl->m_Name << trig->m_Script;
				}
			}
			cScriptManager script_manager;
			script_manager.Load(dp, selected_girl);
			if (!g_Cheats)
				g_TalkCount--;
		}
		g_InitWin = true;
		return;
	}
	if (g_InterfaceEvents.CheckButton(next_id))
	{
		NextGirl();
	}
	if (g_InterfaceEvents.CheckButton(prev_id))
	{
		PrevGirl();
	}
}