#Calculates distance of herds from the tribe hut

#Input variables
#tribe_size = size of the player's tribe
#herd_type = the type of herd: 1 = big game, 2 = runts, 3 = predators
#times_hunted_type = the number of times the player has hunted this type of herd

#Output variables
#number_of_herds = how many distinct groups of this type should exist
#herd_size = how many creatures should be in a newly created herd
#distance_from_hut = the distance from the hut to the herd as the herd is created
#roaming_radius = how far the herd deviates from it's focal point
#grazing_time = how many seconds the herd sits still after reaching its destination
#speed_normal = how fast the herd walks relative to creature speed (multiplicative factor)
#speed_max = how fast the herd sprints relative to creature speed (multiplicative factor)
#speed_water = how fast in water
#turn_rate = degress per second
#perception_field_of_vision = how far off straight ahead the herd can see, 0-180 degrees
#perception_hear_barely = radius at which the herd can start to hear moving creatures
#perception_hear_well = radius at which the herd fully hears moving creatures
#perception_behind_calm = radius at which the herd is aware of the creature even if facing the other way (when anxiety is low)
#perception_behind_alert = radius at which the herd is aware of the creature even if facing the other way (when anxiety is high)
#anxiety_threshold_flee = point at which the herd spooks, 0-1. 1 means don't flee.
#anxiety_threshold_calm = point at which the herd stops fleeing, 0-1.
#anxiety_half_life = seconds for anxiety to decrease by 50%
#awareness_threshold_attack = point at which the herd is aware enough to attack. 1 means don't attack
#sprint_distance = how far the herd flees when spooked
#sprint_fatigue = how many seconds the herd can flee before it needs to rest
#sprint_fatigue_recovery = how many seconds of flee time the herd recovers each second it rests

if (herd_type==1) #big game
   number_of_herds = 1
   herd_size = 2
   distance_from_hut = 50 + 5 * (times_hunted_type)
   roaming_radius = 40
   grazing_time = 20
   speed_normal = 0.5
   speed_water = 0.5
   speed_max = 2
   turn_rate = 75
   perception_field_of_vision = 135
   perception_hear_barely = 20
   perception_hear_well = 10
   perception_behind_calm = 0
   perception_behind_alert = 5
   anxiety_threshold_flee = 0.8
   anxiety_threshold_calm = 0.2
   anxiety_half_life = 4
   awareness_threshold_attack = 1
   sprint_distance = 10
   sprint_fatigue = 10
   sprint_fatigue_recovery = 1
endif

if (herd_type==2) #runts
   number_of_herds = 2
   herd_size = 5
   distance_from_hut = 10 + 3 * (times_hunted_type)
   roaming_radius = 30
   grazing_time = 20
   speed_normal = 0.5
   speed_water = 0.5
   speed_max = 2.5
   turn_rate = 90
   perception_field_of_vision = 135
   perception_hear_barely = 30
   perception_hear_well = 15
   perception_behind_calm = 0
   perception_behind_alert = 5
   anxiety_threshold_flee = 0.6
   anxiety_threshold_calm = 0.2
   anxiety_half_life = 4
   awareness_threshold_attack = 1
   sprint_distance = 10
   sprint_fatigue = 10
   sprint_fatigue_recovery = 1
endif

if (herd_type==3) #predators
   number_of_herds = 0
   herd_size = 5
   distance_from_hut = 50
   roaming_radius = 30
   grazing_time = 0
   speed_normal = 0.5
   speed_water = 0.5
   speed_max = 1.5
   turn_rate = 135
   perception_field_of_vision = 90
   perception_hear_barely = 30
   perception_hear_well = 20
   perception_behind_calm = 0
   perception_behind_alert = 5
   anxiety_threshold_flee = 1
   anxiety_threshold_calm = 0
   anxiety_half_life = 1
   awareness_threshold_attack = 0.5
   sprint_distance = 10
   sprint_fatigue = 20
   sprint_fatigue_recovery = 1
endif
