
"../deathforth/rooms/cabin.txt" $load-rooms
"../deathforth/rooms/city.txt" $add-rooms

cyoa{

cyoa-choice: cabin1-hermitchat-recruit
	ricon
	($ "Of course I'm not going to join you! I was doing fine before you brought the horde with you!" pbold .. "
	The hermit isn't swayed by " .. pname .. "'s charms." $) cyoa-text! badfx
;

cyoa-choice: cabin1-hermitchat-coolit
	ricon
	cool-it-7 if
		($ "The hermit cools it immediately, and welcomes you with open arms. He shares is secret stash of shotgun shells with you!
		" .. pname .. " was really surprised and happy that this worked!" $) cyoa-text!
		pchar .morale2+ goodfx cooled-it 40 LOOT_SHOTGUN_SHELL addloot
	else cool-it++
		($ "The hermit does not cool it. Instead, he lets loose a tirade of swears.
		" .. pname .. "'s sensibilities are offended!" $) cyoa-text!
		pchar .morale-- badfx
	then
;

cyoa: cabin1-hermitchat
	char-gen to recruitee ricon
	"Hermit" recruitee .name!
	2 recruitee .specialtype!
	image-angry-hermit
	"The Angriest Hermit" cyoa-title!
	($ "The hermit is already infuriated." .. "
	YOU BROUGHT ALL THESE ZOMBIES, DIDN'T YOU?
	GET OUT OF MY HOUSE!" pbold $) cyoa-text! clear-cyoa
		choice( "Ask him to join you" )choice: cabin1-hermitchat-recruit
		choice( "Tell Hermit to 'Cool it'" fcoolit )choice: cabin1-hermitchat-coolit
;

}

: .hermitify
	2 over .specialtype!
	6 over .shooting!
	WEAPON_SHOTGUN over .weapona!
	WEAPON_FIRE over .weaponb!
	60 LOOT_SHOTGUN_SHELL 2 pick .lootamt!
	dup cyoa{ ' cabin1-hermitchat cyoa! }
;

: hermit
	new-npc lt .character@ .hermitify
;

: cabinloot 
	looseloot
	30 %chance if 30 60 rnd sgas chainsaw .scatter then
;

location
		tags: cabin-hermit
		max-rooms: 2
		entry-tags: entry
		script: set-theme-cabin 
		pre-script: set-theme-cabin
		post-script: 0 %zombs

		room-choice: entry
			room-script: ndx 
			room-post-script: 
			room-weight: 1
			room-count: 1
			filter-only
		
		room-choice: randcabin
			room-weight: 80
			room-count: 1
			room-script: nad
			room-post-script: hermit cabinloot

regiondef{

	 region: forest cabin
		w: 35
		h: 35
		script: timeofday o'clock

		no-prefab // Don't build that default city

		: make-a-cabin map{
			"cabin-hermit" $picklocid // Pick a cabin location definition if it exists ( tags -- locdefid )
			addloc // Add a location using the resulting location definition  ( locdefid -- locid )
			prefab{ 10 cabin } // Create a cabin of 5 width using the new location ( locid w -- <build cabin centered in upper part of map> )
			}
		;

		: setup-cabin-forest
			map{ grass make-a-cabin 40 pines }
		;

		post-script: setup-cabin-forest 2diff %zombs
}
