cyoa{ 

// placeholder here for now
: rewardevent-random
	0 stack
		' .fitness++ shove
		' .strength++ shove
		' .shooting++ shove
		' .mechanic++ shove
		' .medical++ shove
	shuffles pops nip execute
;
cyoa-choice: rewardevent-morale
	"Every day is a great teacher, as long as you don't get eaten." cyoa-text!
	morale++all ' rewardevent-random foreach-team-char goodfx
;
cyoa-choice: rewardevent-heal
	"Time heals all wounds, especially zombie bites." cyoa-text!
	morale++all ' .health++ foreach-team-char goodfx
;
cyoa-choice: rewardevent-strength
	"Even in the post apocalypse, it's still possible to get swole." cyoa-text!
	' .strengthREV foreach-team-char ' .strength++ foreach-team-char goodfx
;
cyoa-choice: rewardevent-fitness
	"Running from zombies all day is a great form of exercise." cyoa-text!
	' .fitnessREV foreach-team-char ' .fitness++ foreach-team-char goodfx
;
cyoa-choice: rewardevent-shooting
	"Getting used to these zombies makes for steadier aiming." cyoa-text!
	' .shootingREV foreach-team-char ' .shooting++ foreach-team-char goodfx
;
cyoa-choice: rewardevent-mechanical
	"All these cars aren't getting any less broken." cyoa-text!
	' .mechanicREV foreach-team-char ' .mechanic++ foreach-team-char goodfx
;
cyoa-choice: rewardevent-medical
	"When it comes to zombie first aid, practice makes perfect." cyoa-text!
	' .medicalREV foreach-team-char ' .medical++ foreach-team-char goodfx
;

: hazreward1 choice( "Strength" )choice: rewardevent-strength ;
: hazreward2 choice( "Fitness" )choice: rewardevent-fitness ;
: hazreward3 choice( "Shooting" )choice: rewardevent-shooting ;
: hazreward4 choice( "Mechanical" )choice: rewardevent-mechanical ;
: hazreward5 choice( "Medical" )choice: rewardevent-medical ;
: hazreward6 choice( "Morale and one health healed" )choice: rewardevent-heal ;

0 var hazard-reward-deck
	deck-new
	card: hazreward1
	card: hazreward2
	card: hazreward3
	card: hazreward4
	card: hazreward5
	card: hazreward6
constant HAZARD-REWARD
HAZARD-REWARD shuffles to hazard-reward-deck

: hazard-reward-draw hazard-reward-deck drawcard ;
: hazard-reward-shuffle
	hazard-reward-deck depths 0= if HAZARD-REWARD shuffles to hazard-reward-deck then
	hazard-reward-draw
;

// Special rewards

cyoa-choice: rewardevent-haz1
	($ cname .. " feels a huge surge in strength!" $) cyoa-text!
	strengthREV strength++ strength++ morale++ goodfx
;
cyoa-choice: rewardevent-haz2
	($ cname .. " is getting used to all this exercise!" $) cyoa-text!
	fitnessREV fitness++ fitness++ morale++ goodfx
;
cyoa-choice: rewardevent-haz3
	($ cname .. " feels like a gunslinger!" $) cyoa-text!
	shootingREV shooting++ shooting++ morale++ goodfx
;
cyoa-choice: rewardevent-haz4
	($ cname .. " is becoming a zombie master!" $) cyoa-text!
	// strengthREV shootingREV fitnessREV mechanicREV medicalREV
	strength++ fitness++ shooting++ mechanic++ medical++ morale++ goodfx
;
cyoa-choice: rewardevent-haz5
	($ cname .. " is getting toughened up!
	" .. cname .. " gains an extra point of maximum health!" rbold $) cyoa-text!
	vitality++ health++ morale++ goodfx
;
cyoa-choice: rewardevent-haz6
	($ cname .. " gets really good at running!
	" .. cname .. " now permanently runs faster!" rbold $) cyoa-text!
	dexterity++ morale++ goodfx
;
cyoa-choice: rewardevent-haz7
	($ cname .. " gets in tune with the car spirits!" $) cyoa-text!
	mechanicREV mechanic++ mechanic++ morale++ goodfx
;
cyoa-choice: rewardevent-haz8
	($ cname .. " invents a breakthrough in zombie health care!" $) cyoa-text!
	medicalREV medical++ medical++ morale++ goodfx
;
cyoa-choice: rewardevent-haz9
	($ cname .. " feels completely revitalized!
	" .. cname .. "'s health is full!" rbold $) cyoa-text!
		cchar .fullheal morale3+ morale3+ cchar statmod{ .untired } goodfx
;

: hazspecial1 cchar charchoice( ": +2 Strength" )choice: rewardevent-haz1 ;
: hazspecial2 cchar charchoice( ": +2 Fitness" )choice: rewardevent-haz2 ;
: hazspecial3 cchar charchoice( ": +2 Shooting" )choice: rewardevent-haz3 ;
: hazspecial4 cchar charchoice( ": +1 All Skills" )choice: rewardevent-haz4 ;
: hazspecial5 cchar charchoice( ": +1 to Max Health" )choice: rewardevent-haz5 ;
: hazspecial6 cchar charchoice( ": Faster Run Speed" )choice: rewardevent-haz6 ;
: hazspecial7 cchar charchoice( ": +2 Mechanical" )choice: rewardevent-haz7 ;
: hazspecial8 cchar charchoice( ": +2 Medical" )choice: rewardevent-haz8 ;
: hazspecial9 cchar charchoice( ": Full Heal" )choice: rewardevent-haz9 ;

0 var hazard-special-deck
	deck-new
	card: hazspecial9
	card: hazspecial1
	card: hazspecial2
	card: hazspecial3
	card: hazspecial4
	card: hazspecial5
	card: hazspecial6
	card: hazspecial7
	card: hazspecial8
constant HAZARD-SPECIAL
HAZARD-SPECIAL shuffles to hazard-special-deck

: hazard-special-draw hazard-special-deck drawcard ;
: hazard-specialreward
	hazard-special-deck depths 0= if HAZARD-SPECIAL shuffles to hazard-special-deck then
	hazard-special-draw
;

0 value wyk-reward

: wyk-newrecord
	($ wyk-name .. " got further on the Death Road than he ever did before!
	" .. "Here's a code to celebrate: " rainbold $) +crtext
	gstats{ ' wyk-highscore ++ }
;

cyoa: rewardevent
	"Glimmer of Hope on the Death Road" cyoa-title!
	($ Thegroup .. " feels inspired after managing to survive that situation!
	" .. gThey .. " feel" .. g1s .. " like " .. gtheyare .. " getting the hang of this..." $) cyoa-text!
	
	// STREAM RACE wyk stuff
	wyk? if
		' wyk-reward ++
		wyk-reward 1 = if
			gstats{ wyk-highscore } 1 < if wyk-newrecord wyk-key1 +text then
		then
		wyk-reward 2 = if
			gstats{ wyk-highscore } 2 < if wyk-newrecord wyk-key2 +text then
		then
		wyk-reward 3 = if
			gstats{ wyk-highscore } 3 < if wyk-newrecord wyk-key3 +text then
		then
		wyk-reward 4 = if
			gstats{ wyk-highscore } 4 < if wyk-newrecord wyk-key4 +text then
		then
	then
	
	someicon goodfx
	solo if
		"Choose a reward for the survivor:"
	else
		"Choose a reward for the group:"
	then +crtext
		choice( "Morale and random skill gain" )choice: rewardevent-morale
		hazard-reward-shuffle
		hazard-reward-draw
		team-count 3 < if
			hazard-reward-draw // Maybe get rid of this later, change to over 2 people = extra card
		else
			hazard-specialreward
			// hazard-special-draw
		then
;

}

events{
road{

: rewardevent 
	cyoa{ rewardevent }
;

// Location events that can happen more rarely

	deck-new
	//	card: santa-test
		card: TLB-test
		card: alvis-test		
		card: debutante-test
		card: fencer-test
		card: wrestler-test
		card: lnk-test
		card: ramb-test
		card: valk-test
		card: sumo-test
	//	card: madsci-test
		card: boxer-test
		card: octodad-test
		card: mason-test
		card: dogman-test
		card: jerk-test
		card: roller-test
		card: clown-test
	//	card: turkey-test
		card: ninja-test
	//	card: catlady-test
		card: grf-test
		card: anime-test
		card: billy-test
		card: dsyp-test
		card: cleaner-test
		card: horse-test
		card: gnomey-test 
		card: knight-test
	constant SPECIALCHAR-DECK
	SPECIALCHAR-DECK var specialchar-deck	

: scevent 
	specialchar-deck depths 0= if SPECIALCHAR-DECK shuffles to specialchar-deck then
	specialchar-deck drawcard ;
	
	deck-new
		card: recruit1
		card: recruit2
		card: recruit3
		card: recruit-mechanical
		card: recruit-medical
		card: recruit-shooting
		card: recruit-fitness
		card: recruit-strength
		card: recruit-dog
		3 cards: scevent
	constant RECRUIT-DECK
	RECRUIT-DECK var recruit-deck	
	
	deck-new
		card: sewer-test
		card: siege1-dirtroadeasy
		card: siege1-openhouseeasy
		card: siege1-cabineasy
	constant EASYHAZARDRAID-DECK
	EASYHAZARDRAID-DECK var easyhazardraid-deck	
	
	EASYHAZARDRAID-DECK shuffles to easyhazardraid-deck	
	
: easyhazardevent
	easyhazardraid-deck depths 0= if EASYHAZARDRAID-DECK shuffles to easyhazardraid-deck then
	easyhazardraid-deck drawcard ;	
	
: siege1-cabinorhouse
	50 %chance if siege1-openhouse else siege1-cabin then
;
	
	deck-new
		card: sewer-test2
		card: indust-test
		// card: siege1-openhouse
		// card: siege1-cabin
		card: siege1-cabinorhouse
		card: siege2-mall
		card: siege2-yall
		card: siege2-tunnel
		card: siege2-road
		card: siege2-block
		card: siege2-houses
		// card: easyhazardevent // Keeping this in here as lucky single card as more are added
	constant HAZARDRAID-DECK
	HAZARDRAID-DECK var hazardraid-deck	
	
	HAZARDRAID-DECK shuffles to hazardraid-deck	
	
	deck-new
		card: siege1-openhouse
		card: siege1-cabin
	constant CANADAHAZARD-DECK
	CANADAHAZARD-DECK var canadahazard-deck	
	
	CANADAHAZARD-DECK shuffles to canadahazard-deck	
	
	deck-new
		card: easycity1
		card: easycity2
		card: easycity3
		card: easycity4
		card: easycity5
	constant EASYCITYRAID-DECK
	EASYCITYRAID-DECK var easycityraid-deck	
	
: easycityevent 
	easycityraid-deck depths 0= if EASYCITYRAID-DECK shuffles to easycityraid-deck then
	easycityraid-deck drawcard ;	
	
	deck-new
		card: normcity1
		card: normcity2
		card: normcity3
		card: normcity4
		card: normcity5
		card: normcity6
		card: normcity7
		card: normcity8
		card: normcity9
	constant CITYRAID-DECK
	CITYRAID-DECK var cityraid-deck	

	deck-new
		card: inner3-cyoa 
		card: inner5-cyoa	
		card: rest-easy
		card: yallmart-easy
		card: indust-easy
	constant EASYINNERRAID-DECK
	EASYINNERRAID-DECK var easyinnerraid-deck
	
: easyinnerevent 
	easyinnerraid-deck depths 0= if EASYINNERRAID-DECK shuffles to easyinnerraid-deck then
	easyinnerraid-deck drawcard ;
	
	deck-new
		card: grocery-death
		card: cabin1-huntlodge		
		card: rare1-hazmat
		card: rare1-rangers
		card: rare1-bruce
		card: rare1-ufo
		card: rare1-hermit
		card: rare1-hotdog
		card: rare1-altar
		card: rare1-factory
		card: rare1-museum
		card: rare1-fish
		card: rare1-junk
		card: rare1-bunker
		card: rare1-lab
	constant RAREINNERRAID-DECK
	RAREINNERRAID-DECK var rareinnerraid-deck	
	
: rareinnerevent 
	rareinnerraid-deck depths 0= if RAREINNERRAID-DECK shuffles to rareinnerraid-deck then
	rareinnerraid-deck drawcard ;	
	
	deck-new
		card: inner7-cyoa
		card: inner8-cyoa
		card: cabin1-stash
		card: cabin1-night
		card: inner4-cyoa	
		card: inner6-cyoa
		card: card4-cyoa
		card: roadloot-gravel
		card: roadloot-city
		card: roadloot-country
		card: roadloot-dirt
		card: roadloot-tunnel
		card: siege1-gas
		card: policeHQ-cyoa
		card: hospital-cyoa
		card: doubleoffice-cyoa
		card: safeoffice-cyoa
		card: safeinhouse-cyoa
		card: maginhouse-cyoa
		card: maginapt-cyoa
		card: gymapt-cyoa
		card: bigarcade-cyoa
		card: grocery1
		card: grocery2
		card: grocery3
		card: hardware
		card: yallmart-mid
		card: yallmart-hard
		card: bookstore
		card: sporting
		card: indust-safe
		// 2 cards: easyinnerevent
		card: 4commercial-cyoa
		card: 4suburb-cyoa
		card: 4apartment-cyoa
		card: rescueapt-cyoa
		card: rescuehouse-cyoa
		card: rescuegrocery
		card: rescueindust
		card: rescuesewer
		card: siege1-rescuerest
		card: siege1-rescuecabin
		card: siege1-rescuegas
		card: rescuemall
		card: siege1-rescuegas
		card: malltest
		// rest stop siege rescue
		// graveyard siege
		card: swarmgym-cyoa
		card: swarmarcade-cyoa
		card: rest-stop
		card: rest-death
		card: rest-car
		card: junk-car
		card: junk-loot
		card: junk-safe
		card: cabin1-car
		card: houserow-car
		3 cards: rareinnerevent

	constant INNERRAID-DECK
	INNERRAID-DECK var innerraid-deck	
	
// Use commondeck for just drawing common cards, normdaily for drawing good/bad/common
: normdaily 
	fate-deck depths 0= if FATE-DECK shuffles to fate-deck then
	fate-deck drawcard ;

: recruit-deck-draw
	recruit-deck depths 0= if RECRUIT-DECK shuffles to recruit-deck then
	recruit-deck drawcard
;
	
: recruitevent
	gstats{ total-kills } 1000 >= if
		dogpal? 70 %chance and if
			recruit-dogpal
		then;
	then
	gstats{ total-kills } 300 >= if
		dogpal? 35 %chance and if
			recruit-dogpal
		then;
	then
	specialchar-mode 1 = if
		scevent
	then;
	familiar-mode 1 = if
		 familiar-stack depths 0= if recruit-deck-draw else famevent then
	then;
	recruit-deck-draw ;
	
: innerevent 
	innerraid-deck depths 0= if INNERRAID-DECK shuffles to innerraid-deck then
	innerraid-deck drawcard ;
		
: cityevent 
	cityraid-deck depths 0= if CITYRAID-DECK shuffles to cityraid-deck then
	cityraid-deck drawcard ;
	
: hazardevent 
	hazardraid-deck depths 0= if HAZARDRAID-DECK shuffles to hazardraid-deck then
	hazardraid-deck drawcard ;
	
// POSSIBLY DELETE THIS and also delete it in game-save-state, as it's unused right now
// May use it later to track what buildings are used in Canada, to add variety there
: canadahazardevent 
	canadahazard-deck depths 0= if CANADAHAZARD-DECK shuffles to canadahazard-deck then
	canadahazard-deck drawcard ;
				
: campevent
	camp-deck depths 0= if CAMP-DECK shuffles to camp-deck then
	camp-deck drawcard
;
		
// Daily event decks, temporary sorting decks used to figure out the possibilities for that day. Starting with first day tutorial deck in unshuffled order.

	deck-new
		card: noobevent
		card: commondeck
		card: campevent
		card: easyinnerevent
		card: noobstart
	constant NOOB-DECK
	NOOB-DECK var daily-deck

	// Standard content decks

	deck-new
		2 cards: normdaily
		card: innerevent
	constant 3CYOA-DECK
	// 3CYOA-DECK var daily-deck - Commented out because it's shuffled to daily-deck every day in dayplan.df, anyway
	
	deck-new
		2 cards: normdaily
		card: innerevent
		card: famevent
	constant 3CYOA-FAM-DECK	

	deck-new
		card: normdaily
		// card: innerevent
		card: cityevent
	constant CITYDAY-DECK
	
	deck-new
		card: normdaily
		card: innerevent
	constant INNERDAY-DECK
	
	deck-new
		card: normdaily
		card: innerevent
		card: famevent
	constant INNERDAY-FAM-DECK
	
	deck-new
		card: innerevent
		card: normdaily
		card: tradeevent
	constant TRADEDAY-DECK
		
	deck-new
		card: normdaily
		card: innerevent
		card: recruitevent
	constant RECRUITDAY-DECK
	
	// Easy and short days for the earlier game
	
	deck-new
		card: commondeck
		// card: easyinnerevent
		card: easycityevent
	constant EASYCITYDAY-DECK
	
	// Probably deprecated due to being rolled in with newbday but keeping it for now
	deck-new
		card: commondeck
		card: easyinnerevent
	constant EASYINNERDAY-DECK
		
	// Hazard days

	deck-new
		card: rewardevent
		card: easyhazardevent
		card: recruitevent // Probably make this a chance between this and friendevent
		card: tradeevent
		card: normdaily // maybe change to commondeck later
	constant EASYHAZARDDAY-DECK	
	
	deck-new
		card: rewardevent
		card: hazardevent
		card: tradeevent
		card: normdaily
		// card: innerevent
	constant HAZARDDAY-DECK	
				
	deck-new
		card: rewardevent
		card: precanada-siege
		card: tradeevent
		card: commondeck
	constant PRECANADA-DECK	
// Below is debug, the tutorial is edited out right now	
//	PRECANADA-DECK var daily-deck
			
	deck-new
		card: canada-siege2
		card: canada-city
		card: canada-siege1
	constant CANADADAY-DECK		

	deck-new
		card: normdaily
	constant DAILY-DECK
	// DAILY-DECK isn't actually used, just here as a failsafe
	// 	DAY-PICK-DECK var day-pick-deck - Not needed because of the START DAY deck
	

	
	
	
} }
	

