uses base.df
uses charfilt.df
uses charstats.df
uses road.df

cyoa{ road{

0 value lnk-event
0 value lnk-bombbag

: lnk-chest
	($ cname .. " stumbles on a treasure chest. He opens it and lifts its contents high above his head.
		It contained the " $) cyoa-text!
;

: lnksword 1 6 rnd case
	1 of "M*ster" endof
	2 of "Mester" endof
	3 of "Mister" endof
	4 of "Moster" endof
	5 of "Muster" endof
	6 of "Myster" endof
endcase ;

cyoa-choice: lnk-heart
	($ cname .. " got the " .. "Heart Container!" pbold .. "
	Maximum Health has increased!" $) cyoa-text!
		STAT_VITALITY cchar .stat++ cchar .health++
;

: lnk-restock
	52 stpick choosechar
	WEAPON_LNKBOMB cchar .weaponb! 3 cchar .stackedb! 
	WEAPON_LNKBOMB cchar .weapon_nodropb!
;

cyoa-choice: lnk-bomb
	($ cname .. " got the " .. "Sack of Bombs!" pbold .. "
	He can now throw three bombs every mission!" $) cyoa-text!
		1 to lnk-bombbag
		lnk-restock
;

cyoa: lnk-timeup
	52 stpick choosechar cicon
	"DA NA NA NAAAAAAA!" cyoa-title!
	lnk-event 0 = if
		lnk-chest ($ "Wooden Boomerang!" pbold $) +text
			WEAPON_WOODBOOM cchar .weaponb! WEAPON_WOODBOOM cchar .weapon_nodropb!
	then
	lnk-event 1 = if
		lnk-chest ($ "White Sword!" pbold $) +text
			WEAPON_WHITESWORD cchar .weapona! WEAPON_WHITESWORD cchar .weapon_nodropa!
	then
	lnk-event 2 = if
		lnk-chest ($ "Metal Boomerang!" pbold $) +text
			WEAPON_METALBOOM cchar .weaponb! WEAPON_METALBOOM cchar .weapon_nodropb!
	then
	lnk-event 3 = if
		lnk-chest ($ "..." pbold .. "
		Choose One:" $) +text
			choice( "Heart Container" )choice: lnk-heart
			choice( "Sack of Bombs" )choice: lnk-bomb
	then
	lnk-event 4 = if
		lnk-chest ($ PURPLE .. lnksword .. " Sword!" .. WHITE $) +text
				WEAPON_HERO cchar .weapona! WEAPON_HERO cchar .weapon_nodropa!
	then	
	' lnk-event ++
//	lnk-event 5 < if 5 7 rnd else 0 then to lnk-countdown
	lnk-event 5 < if 1 else 0 then to lnk-countdown
;

: lnk-cut
	lnk-event 2 < if 50 else 80 then %chance if team-attacked then
	lnk-event 3 > if team-attacked then
;

cyoa: lnk-despair
	someone choosechar cicon
	"Spin Attack" cyoa-title!
	($ cname .. " holds his sword in front of him, and then spins around at high speeds.
	" .. "KYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!!!!" rbold .. "
	He ends up cutting everything near him, and also cuts himself up pretty bad." $) cyoa-text!
	morale++ lnk-event 1 > if despairbite else cchar team-attacked then
	cchar ' lnk-cut foreach-team-char-except badfx 
;

} }


