# Likelihood of a tribe sending raiders
# inputs:
# Size_Of_Tribe : The size of the tribe indicated by the number of creatures it has
# Time_Since_This_Script_Last_Ran : In milliseconds
# Relationship_Of_Tribe_Towards_Player : number in range from -10 to 10 
# Food_In_Player_City : the current amount of food the player has
# Food_In_Tribe : the current amount of food the tribe has
# outputs:
# Number_Of_Raiders_To_Send
# local variables:
# Time_Since_Last_Raid : In seconds

# time tracker, beginning of script
Time_Since_Last_Raid = Time_Since_Last_Raid + Time_Since_This_Script_Last_Ran/1000



raid_freq = 1500/Food_In_Player_City

if (Size_Of_Tribe > Food_In_Tribe/5)
  if (Relationship_Of_Tribe_Towards_Player < 20)
    if (Time_Since_Last_Raid > raid_freq)

Number_Of_Raiders_To_Send = 0.3 * Size_Of_Tribe

    endif
  endif
endif


# time tracker, end of script
if (Number_Of_Raiders_To_Send > 0)
	Time_Since_Last_Raid = 0
endif