// Variables that are used everywhere and have dependency issues due to where they were defined

// TODO:
// - move dependencies to the correct files so that the order of usage make sense.

0 value need-save
0 value last-saved

// A way to schedule game saves
: need-to-save 1 to need-save ;

: try-to-save
	need-save not if then;
	madticks last-saved = if then;
	madticks to last-saved
	save-the-game 0 to need-save
;

// Road stuff
road{
	1 value diff-scalar
	15 value nearcanada-day
	0 value specialchar-mode
	0 value familiar-mode
	0 value easybandit-mode
	
	0 value road-countdown
	0 value road-event-turn
	0 value road-trip-days
	0 value calendar-days

	: calendar-day+ ' calendar-days +! ;

	: road-delay main-event-period! ;

	0 stack var road-stack

	: pause-scene 0.1 main-event-pause! ;

	: check-road-stack
		road-stack depths 0= if false then;
		road-stack pops execute
		road-stack depths 0= if 2 road-delay true then;

		pause-scene -1 road-delay

		true
	;
}


: stack-road-action road{
	road-stack swap shove drop
	pause-scene -1 road-delay
} ;

: char-gen char-gen args( chara )

	// Globally override char generation defaults here
	60 	<- chara .ai.threat_radius!					// Radius within which they check for zombies
	30 		<- chara .ai.threat_dist_base!				// Distance they think is getting dangerous
	5 		<- chara .ai.threat_count_base!				// Number of zombies before they start to really care

	0.9 	<- chara .ai.threat_threshold!				// THREAT LEVEL that is considered dangerous
	1		<- chara .ai.threat_respond_chance!			// Chance to go into THREAT MODE once threat level reached
	0.8		<- chara .ai.threat_relax_chance!			// Chance to go out of THREAT MODE once threat level reduced

	<- chara // return chara;
;

0 value recruitee

voc{ cyoa

}
