Пример #1
0
/*
    Code to perform the action of drinking at a fountian.  Assumes that
    cursors() has already been called, and that a check has been made that
    the player is actually standing at a live fountain.
*/
void act_drink_fountain(void)
{
    int x ;

    if (rnd(1501)<2)
        {
        lprcat("\nOops!  You seem to have caught the dreadful sleep!");
        lflush();  
        nap(3000);  
        died(280); 
        return;
        }

    x = rnd(100);
    if (x<7)
        {
        c[HALFDAM] += 200 + rnd(200);
        lprcat("\nYou feel a sickness coming on");
        }

    else if (x < 13)
        quaffpotion(23, FALSE ); /* see invisible,but don't know the potion */

    else if (x < 45)
        lprcat("\nnothing seems to have happened");

    else if (rnd(3) != 2)
        fntchange(1);   /*  change char levels upward   */

    else
        fntchange(-1);  /*  change char levels downward */

    if (rnd(12)<3)
        {
        lprcat("\nThe fountains bubbling slowly quiets");
        item[playerx][playery]=ODEADFOUNTAIN; /* dead fountain */
        know[playerx][playery]=0;
        }
    return;
}
Пример #2
0
/*
 *	*********
 *	OFOUNTAIN
 *	*********
 */
void ofountain()
{
	int x;

	cursors();
	lprcat("\nDo you (d) drink, (w) wash yourself"); 
	iopts();
	while (1) switch(getcharacter()) {
	case 'd':	
		lprcat("drink");
		if (rnd(1501)<4) {
		lprcat("\nOH MY GOD!! You have caught the *dreadful sleep*!");
			beep(); 
			lflush();  
			sleep(3);  
			died(280); 
			return;
		}
		x = rnd(100);
		if (x==1) raiselevel();
		else if (x < 11) { 	
			x=rnd((level<<2)+2);
			lprintf("\nBleah! The water tasted like stale gatorade!  "
					"You lose %d hit point%s!", (long)x, x==1?"":"s");
			lastnum=273; 
			losehp(x); 
			bottomline();  
			cursors();
		}
		else if (x<14) { 	
			c[HALFDAM] += 200+rnd(200);
			lprcat("\nThe water makes you vomit.");
		}
		else if (x<17) 
			quaffpotion(17); /* giant strength */
		else if (x < 45)
			lprcat("\nNothing seems to have happened.");
		else if (rnd(3) != 2)
			fntchange(1);	/*change char levels upward*/
		else
			fntchange(-1);	/*change char levels downward*/
		if (rnd(12)<3) {      
			lprcat("\nThe fountains bubbling slowly quietens.");
			/* dead fountain */
			item[playerx][playery]=ODEADFOUNTAIN; 
			know[playerx][playery]=0;
		}
		return;

	case 'i':	
	case ESC:
		ignore();  
		return;
	case 'w':	
		lprcat("wash yourself.");
		if (rnd(100) < 11) { 	
			x=rnd((level<<2)+2);
			lprintf("\nThe water burns like acid!  You lose %d hit point%s!",
					(long)x, x==1?"":"s");
			lastnum=273; 
			losehp(x); 
			bottomline();  
			cursors();
		}
		else if (rnd(100) < 29)
			lprcat("\nYou are now clean.");
		else if (rnd(100) < 31)
		  lprcat("\nThis water needs soap -- the dirt didn't come off.");
		else if (rnd(100) < 34)
			createmonster(WATERLORD); 
		else lprcat("\nNothing seems to have happened.");
		return;
	}
}