ALCOHOL.C

LIB3/STD/EFFECTS/POISONS/ALCOHOL.C · 1.2 KB

From the archive nm4dos.zip

Download the archive   « Back to the archive contents

inherit "/std/effects/basic";

/* It's alcohol. It gets you drunk. */

create()
{
    set_boundaries( 
		       ({ -7, 2 }), ({ -2, 5 }) );
}

int     query_pass_through( int *coord )
{
    return 40;
}


query_coordinate()
{
    return({ -4, 3 });
}

action_drunk( ob, coord, quantity )
{
    int     total, effect;
    string  desc;
    int     old_vol;

    total = distance_within_region( coord ) * 100 / 6;

    effect = (400 + random( 300 )) * total * quantity / 100 / 100;
    old_vol = ob->query_volume( 0 );
    ob->adjust_volume( 0, effect );

    switch( effect )
    {
	case 0..100:
	    desc = "ever so slightly dizzy";
	    break;
	case 101..200:
	    desc = "slightly dizzy";
	    break;
	case 201..300:
	    desc = "noticeably drunk";
	    break;
	case 301..400:
	    desc = "significantly drunk";
	    break;
	case 401..600:
	    desc = "very drunk";
	    break;
	case 601..800:
	    desc = "a great deal drunk";
	    break;
	default:
/* this effect is not intended to effect > 800 drunk points */
	    desc = "so drunk your brain has turned to coffee";
	    break;
    }
    tell_object( ob, "You feel " + desc + ".\n" );
}

action_smell( ob, coord, quantity )
{
    tell_object( ob, "Your nose tingles pleasantly.\n" );
}

Site Stats

Snippets: 1791
Codebases: 571