
uses events/car/walkdecks/carfind1.df

cyoa{ road{ 

: usedlot-carget ($ Thegroup .. " gets a new used car!" $) cyoa-text! goodfx ;
cyoa-choice: usedlot-SUV image-suv usedlot-carget carinfo-SUV CAR_SUV get-car ;
cyoa-choice: usedlot-muscle image-sports-car usedlot-carget carinfo-muscle CAR_MUSCLE2 get-car ;
cyoa-choice: usedlot-hybrid image-hybrid-battery usedlot-carget carinfo-hybrid CAR_HYBRID2 get-car ;

cyoa-choice: usedlot-van image-white-van usedlot-carget carinfo-van CAR_VAN get-car ;
cyoa-choice: usedlot-grandpa image-car-lot usedlot-carget carinfo-grandpa CAR_GRANDPA get-car ;
cyoa-choice: usedlot-little image-car-lot usedlot-carget carinfo-little CAR_BUG get-car ;

cyoa: car1-usedlot
	"Prices So Low They're Free" cyoa-title!
	($ Thegroup .. " finds a used car lot that seems untouched by time, or at least not touched by looters.
	" .. gThey .. " find" .. g1s .. " a supply of gasoline, and a few working cars!" $) cyoa-text!
		50 80 rnd trunk-gas+ image-car-lot
		// Choices in events/car/walkdecks/carfind1.df
		70 %chance if 		
			choice( "Swap to SUV" )choice: usedlot-SUV
		else
			choice( "Swap to Muscle Car" )choice: usedlot-muscle
		then
		70 %chance if 	
			choice( "Swap to Tiny Car" )choice: usedlot-little
		else
			choice( "Swap to Classic Car" )choice: usedlot-grandpa
		then
		30 %chance if 
			choice( "Swap to Electric Hybrid" )choice: usedlot-hybrid
		else
			choice( "Swap to Big Van" )choice: usedlot-van
		then
		choice( "Keep car, drive away" )choice
;	

: mechanic-armor?
	mechanic-silentrepair
	mechanic-diff 1 > if
		3 car-armor+ ($ "SUPER ARMOR UP!" fbold $)
	else
		mechanic-diff -1 > if
			2 car-armor+ ($ "ARMOR UP!" rbold $)
		else
			1 car-armor+ ($ "ARMOR sort of UP!" rbold $)
		then
	then
	+cr +text
;
: mech-diff-1-morale mechanic-diff -1 > if morale2+all else morale++all then goodfx ;
cyoa-choice: car1-garage-armor 
	($ cname .. " uses the scrap metal lying around to create some makeshift armor on the car. It takes a couple days." $) cyoa-text!
	mechanic-diff 1 > if
		($ cHe .. " does amazing work! The car is practically a tank now!" $)
	else
		mechanic-diff -1 > if
		($ cHe .. " works efficiently. The car looks formidable!" $)
		else
		"It looks like the armor is about to fall off the car at any time."
		then
	then 
	+cr +text mechanic-armor? team-count -4 * trunk-food+ mechanicREV mechanic++ 2 calendar-day+
	mech-diff-1-morale heal-event sleep
;

: nocar-garage
	30 50 rnd trunk-gas+ goodfx
	"There's not a lot to do here without a car!" +crtext
;

cyoa: car1-garage
	image-car-garage
	"Armored Garage" cyoa-title!
	($ Thegroup .. " finds a professional car garage. The sign says 'CAR PROZ'.
	" .. gThey .. " find" .. g1s .. " some gas and lots of scrap metal." $) cyoa-text!
		vehicle.which@ 0 = if nocar-garage then;
		 " Just need time to tinker." +text
		30 50 rnd trunk-gas+
		// garage-choices are in carlogic.df, and do the standard ones
		garage-choices
		// Every garage can have a different special choice
		trunk-food team-count 4 * 1 - > if
			choice( "Repair and armor the car for 2 days" )choice: car1-garage-armor 
		then
;	

: mechanic-megatune?
	mechanic-silentrepair
	mechanic-diff 1 > if
		10 car-megatune+ ($ "ULTRA TUNE UP!" fbold $)
	else
		mechanic-diff -1 > if
			6 car-megatune+ ($ "SUPER TUNE UP!" rbold $)
		else
			2 car-megatune+ ($ "TUNED UP?" rbold $)
		then
	then
	+cr +text
;

cyoa-choice: car1-garage-megatune 
	($ cname .. " spends a few days in the garage. " .. cHe .. " hopes on improving the car to its limits." $) cyoa-text!
	mechanic-diff 1 > if
		($ cHe .. " does amazing work! The car is running BETTER than new!" $)
	else
		mechanic-diff -1 > if
		($ cHe .. " works efficiently. The car's life is extended!" $)
		else
		"It's hard to tell if the car's changed at all. Maybe it's better?"
		then
	then 
	+cr +text mechanic-megatune? team-count -6 * trunk-food+ mechanicREV mechanic++ 3 calendar-day+
	mech-diff-1-morale heal-event sleep
;

cyoa: car1-tunegarage
	image-car-garage
	"Lonely Garage" cyoa-title!
	($ Thegroup .. " finds an isolated car garage. The sign says 'MASTER TUNERZ'.
	" .. gThey .. " find" .. g1s .. " some gas and lots of spare parts in good condition." $) cyoa-text!
		vehicle.which@ 0 = if nocar-garage then;
		30 50 rnd trunk-gas+
		garage-choices
		trunk-food team-count 6 * 1 - > if
			choice( "Repair and fine-tune the car for 3 days" )choice: car1-garage-megatune
		then
;	

: mechanic-megaspeed?
	mechanic-silentrepair
		mechanic-diff -1 > if
			1 ' car-speed +! ($ "SPEED INCREASED!" rbold $) +crtext
		then
;

cyoa-choice: car1-garage-megaspeed
	($ cname .. " spends a few days in the garage. " .. cHe .. " tries to figure out the weird parts." $) cyoa-text!
		mechanic-diff -1 > if
		($ cHe .. " installs them. It was a ROCKET BOOSTER!" $)
		else
		"The parts remain a mystery and are left behind. The car gets some repairs."
		then
	+cr +text mechanic-megaspeed? team-count -6 * trunk-food+ mechanicREV mechanic++ 3 calendar-day+
	mechanic-diff 1 > if morale3+all goodfx else mech-diff-1-morale then heal-event sleep
;

cyoa: car1-speedgarage
	image-car-garage
	"Shiny Garage" cyoa-title!
	($ Thegroup .. " finds a still shiny car garage. The sign says 'CARLZ CUSTOMZ'.
	" .. gThey .. " find" .. g1s .. " some gas and some mysterious car parts." $) cyoa-text!
		vehicle.which@ 0 = if nocar-garage then;
		30 50 rnd trunk-gas+
		garage-choices
		trunk-food team-count 6 * 1 - > if
			choice( "Repair and attempt mod for 3 days" )choice: car1-garage-megaspeed
		then
;	

cyoa-choice: car1-floodroad-plow
	($ Thegroup .. " decides to take a chance and plow the car through the flooded road." $) cyoa-text! car-plowthrough	
;
cyoa-choice: car1-floodroad-jump
	($ Thegroup .. " spots a makeshift ramp and has the spectacularly dangerous idea to try to jump the flooded part of the road." $) cyoa-text! car-jump
;
cyoa: car1-floodroad
	image-water-driving
	"Washed Out Road" cyoa-title!
	vehicle.which@ 0 = if 
		($ "The road ahead is flooded out. With no car, " .. thegroup .. " has to take a long detour on foot." $) text! 1 calendar-day+ +cr fullcamp
	then;
	($ "The road ahead has been flooded out, but it looks like the car could maybe still get through it.
	" .. Thegroup .. " decides to:" $) cyoa-text!
		// carlogic.df again
		choice( "Take a detour" )choice: car-detour
		choice( "Plow through" )choice: car1-floodroad-plow
		angriest choosechar chumany? if
			cchar charchoice( ": LET'S JUMP IT" )choice: car1-floodroad-jump
		then
;	

cyoa-choice: car1-fallentree-plow
	($ Thegroup .. " thinks that it's just a tree, and the car is made out of metal. How tough could it be to run it over?" $) cyoa-text! car-plowthrough	
;
cyoa-choice: car1-fallentree-shoot
	($ Thegroup .. " decides to whip out the guns and fire at the dead tree." $) cyoa-text!
	// car-shoot-check if
	// Retooling this a bit later
		"The plan somehow works! The tree is blown apart." +cr +text goodfx
	(* else
		($ "That didn't work at all. " .. Thegroup .. " then tries to ram the car through the bullet-riddled tree." $) +cr +text car-plowthrough
	then *)
	car-shoot
;
: car1-fallentree-pop dup .morale-- 50 %chance if dup .strength-- else dup team-attacked then ;
cyoa-choice: car1-fallentree-lift
	choosehuman
	($ Thegroup .. " decides to try to pick up the tree." $) cyoa-text!
	strength-total 10 > if
		($ Thegroup .. " moves the tree out of the road through pure strength!" $) +cr +text goodfx
	else
		strength-total 5 > if
			($ Thegroup .. " moves the tree out of the road through extreme effort. 
			" .. cname .. " has something in their body pop!" $) +cr +text 
				cchar team-attacked morale-- strength-- badfx
		else
			($ Thegroup .. " fails to move the tree at all, but manages to injure " .. ghim .. "self pretty bad. " .. gThey .. " decide" .. g1s .. " to try to ram the tree with the car."  $) +cr +text
			car-plowthrough ' car1-fallentree-pop foreach-team-char
		then
	then
;
cyoa: car1-fallentree
	image-tree-in-road
	"Tree in the Road" cyoa-title!
	"The way ahead has a big tree lying across it. It looks like someone cut it down to block the road." text!
	vehicle.which@ 0 = if 
		($ "With no car, " .. thegroup .. " just clambers over the downed tree." $) +crtext morale++all goodfx
	then;
	($ Thegroup .. " decides to:" $) +crtext
		// carlogic.df again
		choice( "Take a detour" )choice: car-detour
		choice( "Plow through" )choice: car1-fallentree-plow
		choice( "Lift the tree" )choice: car1-fallentree-lift
		// Add an event for having a chainsaw?
		car-shoot-check if
			choice( "SHOOT IT" )choice: car1-fallentree-shoot
		then
;	

cyoa-choice: car1-dashcode-mech
	($ cname .. " checks the car and finds the problem.
	It was just a loose gas cap. Easy to fix!" $) cyoa-text!
		cmechanic- if mechanic++ then
		mechanicREV goodfx 2 4 rnd car-tune+
;
cyoa-choice: car1-dashcode-punch
	cpet? if
		($ cname .. " bites the hell out of the car, big time." $)
	else
		($ cname .. " smashes the car with " .. chis .. " fists." $)
	then cyoa-text!	
	"It relieves some stress, and the error light turns off!" +crtext
		cchar .strength 4 < if strength++ then
		morale++ strengthREV goodfx -1 car-chassis+
;
cyoa-choice: car1-dashcode-kick
	($ cname .. " steps outside of the car and just wails on it with " .. chis .. " feet.
	What a workout! The error light stays on, though." $) cyoa-text!
		cchar .fitness 4 < if fitness++ then
		morale++ fitnessREV goodfx -1 car-chassis+
;

: car1-dashcode-dtext cpet? if "bites" else "punches" then ;

cyoa: car1-dashcode
	vehicle.which@ 0 = if 
		image-zombie-hoard-1
		"Hiking to Canada" cyoa-title!
		($ Thegroup .. " lacks the protection of a car as they get close to Canada. " .. gTheyare .. " attacked by a large horde out in the open. There is no place to hide and no time to fight." $) text! ouch--all bitefx
	then;
	image-check-engine
	"SERVICE ENGINE SOON" cyoa-title!
	($ "The car is running fine, but an error code shows up on the dashboard. " .. Thegroup .. " has no idea what's wrong, so " .. gthey .. " pull" .. g1s .. " over to see what is up." $) cyoa-text!
		choice( "Ignore it" )choice
		mechanicest charchoice( " carefully inspects it" )choice: car1-dashcode-mech
		strongest choosechar cchar charchoice( " " .. car1-dashcode-dtext .. " it real hard" )choice: car1-dashcode-punch
		fittest charchoice( " kicks it a lot" )choice: car1-dashcode-kick
;

} }
