uses mission-events.df

cyoa{

// : cyoa-exit-ladder-go mission{ walk-try-end-mission } ;

cyoa: cyoa-exit-ladder
	"The Way Out" cyoa-title!
	"You've found the ladder out of here!" cyoa-text!
	cyoa-add-choice
		"Climb out!" cyoa-choice-text!
		mission{ ' end-mission cyoa-choice-handler! }
		choice( "Stay for Now" )choice
;

: tutorial-ladder-end
	quit-to-title
	gstats{ ' tutorial-done ++ save }
;

cyoa: cyoa-exit-ladder-tutorial
	"The Way Out" cyoa-title!
	"You've found the ladder out of here!" cyoa-text!
	cyoa-add-choice
		"Climb out!" cyoa-choice-text!
		' tutorial-ladder-end cyoa-choice-handler!
		choice( "Stay for Now" )choice
;


}

: poswet? 16 / swap 16 / swap map{ tile@ .wet@ } ;

mission{
thing-event: ladder-glow-effect
	eventid THING_EVENT_TIMER <> if exit then
	particle{ new me .pos 7 + pos! 1 ticks! ticks@ fade_out!
//		1 madticks 120 * sin 0.025 * + scale! // shimmer
		1.25 scalex!
		particles_base_id 0x 51 + spriteid!
		0.75 clr.r! 0.5 clr.g! 0.125 clr.b!
		2 layer!
		glowy
		me .pos poswet? if
			madticks 5 * sin 0.05 * scalex@ + scalex!
			madticks 5 * cos 0.05 * scaley@ + scaley!
			madticks 13 * cos 0.025 * scale@ + scale!
		then
	}
	1 me .timer!
;
}

: exit-ladder-setup
	spawn special_objects32_base_id 0x 18 + lt .spriteid! immovable
	0 %flammability!
	0 lt .no_hit!

	map{ postify }
	// Make it squareish collision
 	4 lt .rad.x!
	4 lt .rad.y!

	mission{ ' ladder-glow-effect lt .events! }

	1 lt .timer!
;

: exit-ladder

	exit-ladder-setup
	cyoa{ ' cyoa-exit-ladder cyoa! }
;

: exit-ladder-tutorial

	exit-ladder-setup
	cyoa{ ' cyoa-exit-ladder-tutorial cyoa! }
;

: sewer-junktest
	spawn special_objects64_base_id 1 + lt .spriteid!
	0 %flammability! bbox immovable

;

cyoa{ road{

cyoa: sewer-test2
	cyoa-start
	"River of Death" cyoa-title!
	someicon
	($ Thegroup .. " arrives in a huge city, conquered by undead, and sees that " .. ghis .. " only chance is braving the sewer system.
	When opening the manhole, a cacaphony of groans spill out. This is not a good sign." $) cyoa-text! 3 500 tone
		1.3 18 20 rnd 2 3 rnd zforecast
		mission{ ' door-no-escape to main-event-mission-location-leave }
		"events/industrial/region/sewertest2.df" $load-region
		choice( "DIVE IN" )choice: premission
;

cyoa: sewer-test
	cyoa-start
	"River of Sludge" cyoa-title!
	someicon
	($ "This city is covered with hordes of undead and wreckage that has been touched by a previous fire. " .. Thegroup .. " gets surrounded, and " .. ghis .. " only chance is " .. "SPRINTING THROUGH" fbold .. " the sewers." $) cyoa-text! 3 500 tone
		0.8 20 24 rnd 2 3 rnd zforecast
		mission{ ' door-no-escape to main-event-mission-location-leave }
		"events/industrial/region/sewertest.df" $load-region
		choice( "DIVE IN" )choice: premission
;

cyoa: rescuesewer
	cyoa-start
	"Smelly Rescue" cyoa-title!
	someicon
	($ Thegroup .. " spots a desperate survivor flee from a horde by jumping into the sewer. Helping would involve having to find a safer way out." $) cyoa-text! 3 500 tone
		0.9 1.2 frnd 19 22 rnd 2 3 rnd zforecast
		mission{ ' door-no-escape to main-event-mission-location-leave }
		"events/industrial/region/rescuesewer.df" $load-region
		choice( "Attempt rescue!" )choice: premission
		gas-draw
;

} }



