0 var familiar-stack

: draw-familiar familiar-stack depths if pops else 0 then nip ;

: .applyperk args( chara )
	<- chara .perk@ dup "APPLYING PERK: " type print perk-find dup if <- chara swap execute then
;

: .applytrait args( chara )
	<- chara .trait@ dup "APPLYING TRAIT: " type print trait-find dup if <- chara swap execute then
;

cyoa{ road{

: fam-text
	0 stack
		($ rHe .. " hasn't seen " .. thegroup .. " yet, and is real busy picking " .. rhis .. " nose." $) shove
		($ rHe .. " is sleeping on a picnic table, right out in the open." $) shove
		($ rHe .. " was found trying to pull open a door that said PUSH on it." $) shove
		($ rHe .. " is humming a little song, and hasn't noticed " .. thegroup .. " yet." $) shove
		($ rHe .. " is being thrown out by " .. rhis .. " former group. They seem pretty angry. " .. rname .. " shrugs." $) shove
		($ rHe .. " was sleeping in an abandoned house. " .. rHe .. " is slightly irritated to have been woken up." $) shove
		($ rHe .. " is sitting in a park, reading a book." $) shove
		($ rHe .. " was making tons of noise, playing a portable game console at full blast." $) shove
		($ rHe .. " is eating a candy bar. Those things still haven't gone bad." $) shove
		($ rHe .. " stretches. Then " .. rhe .. " stretches some more. It's an elaborate stretching routine." $) shove
		($ rHe .. " pokes the dirt with a stick. Maybe " .. rhe .. " is drawing plans, maybe just poking the dirt with a stick." $) shove
		($ rHe .. " is staring at a map, with an expression of total confusion." $) shove
		($ rHe .. " is yelling at some survivors, because they made fun of " .. rhis .. " hair." $) shove
		($ rHe .. " is kicking a car in frustration. The car is emitting plumes of smoke." $) shove
		($ rHe .. " is fighting a single zombie, then suddenly trips and falls down in an awkward mistake. " .. rHe .. " gets really embarassed when " .. rhe .. " notices " .. thegroup .. "." $) shove
		// ($ rHe .. " " $) shove
	shuffles pops nip
;

cyoa-choice: recruit-familiarreplace
	ricon
	($ cname .. " gets booted out of the group to make room for " .. rname .. "." $) cyoa-text!
	TEAM_STATUS_BAD_LEFT cchar .decruit 0.5 600 tone
	recruitee .applyperk recruitee .applytrait recruited
;

: recruit-familiarreplace?
	' recruit-replace 3 #cyoa-team-choice
	choice( "Leave " .. rname .. " behind" )choice
;

cyoa: recruit-familiaryes
	team-count 3 > if
		($ "The group is full.
		Who would you like to replace to make room for " .. rname .. "?" $) cyoa-text!
			recruit-familiarreplace?
	then;
	ricon
	($ Thegroup .. " accepts " .. rname .. " to the team!" $) cyoa-text! 2 300 tone
		recruitee .applyperk recruitee .applytrait recruited
;

cyoa: famevent

	draw-familiar dup not if drop "NO MORE PEOPLE!" text! then;
	#savechar-clone #character to recruitee ricon
	"Familiar Faces" cyoa-title!
	($ "Whoa, it's " .. rname .. "! It's nice to see a familiar face! " .. fam-text $) text! 
		($ "TRAIT: " pbold .. recruitee .trait@ $) +crtext 
		($ "  PERK: " pbold .. recruitee .perk@ $) +text 
			choice( "Recruit " .. rname .. " to team" )choice: recruit-familiaryes
			choice( "Leave " .. rname .. " behind" )choice
;

} }


