cyoa{

: coffeed pchar statmod{ dup .coffee .untired } ;
: coffeed? pchar statmod{ .coffee? } ;

cyoa-choice: coffee-get2
	($ cname .. " uses all " .. chis .. " mechanical skills to figure out what the many, many buttons on the coffee brewer do.
	" .. cHe .. " makes the perfect cup of coffee! It's delicious!
	The coffee machine sparks, emits smoke, and dies." $) cyoa-text!
		coffeed	pchar statmod{ .unsick }
		morale2+ dexterity++ goodfx clear-cyoa mechanicREV
;

cyoa-choice: coffee-get1
	pchar statmod{ .sick? } if
		($ cname .. " is feeling too sick to enjoy coffee that's been sitting in a machine for what might be years." $) cyoa-text! badfx 50 %chance if ouch-- then
	then;
	coffeed? if
		($ cname .. " drinks EVEN MORE coffee and then feels pretty sick afterwards. 
		It's hard to say if it was the massive amount of caffeine, the filthy cups, or how the coffee has been rotting for an unknown amount of time." $) cyoa-text! badfx pchar statmod{ dup .sick .uncoffee }
	else
		($ cname .. " sprays some coffee into an old cup lying around and then drinks it.
		" .. cHe .. " feels all COFFEE'D UP." $) cyoa-text!
			goodfx coffeed
	then
;

cyoa: coffee-get
	"Apocalyptic Coffee" cyoa-title!
	picon
	"This enormous and complex coffee machine was built to survive a few different kinds of end of the world scenarios. This was a big part of this coffee shop's marketing campaign.
	Truth in advertising, it still works!" cyoa-text!
	chumany? not if
		($ pname .. "doesn't have the first idea as to how to operate this thing. And really, " .. cdogcat .. "s shouldn't drink coffee anyway." $) +crtext	
	then;
		pchar charchoice( " gets some COFFEE" )choice: coffee-get1
		cmechanic+ if
			pchar charchoice( " messes with the settings" )choice: coffee-get2
		then
	choice( "Leave it alone" )choice
;

}
		
map{ roomgen{

: coffeemachine
	spawn special_objects48_base_id 0x 6 + lt .spriteid!
	rndflip bbox immovable as-metal
	cyoa{ ' coffee-get cyoa! }
;
} }

locdef{
	
location: coffee
		max-rooms: 2
		entry-tags: coffee
		script: set-theme-restaurant

		room-choice: coffee
			room-weight: 10
			room-count: 1
			room-script: 
			room-post-script: 10diff %zombs map{ room-garbage }
			filter-only		

		room-choice: restroom
			room-weight: 10
			room-count: 1
			room-script: floor-bath
			
}