#Determines whether the specified tribe should launch an attack against the player.
#script gets called about once a second.

#Input variables
#npc_tribe_size = The size of the current npc tribe
#player_tribe_size = The size of the player tribe
#time_since_attack = The time in seconds since the last attack against the player
#distance_to_hut = How far the tribe's hut is from the player's hut
#number_of_raids = How many times the player has raided this tribe

#Output variables
#attackers = the number of creatures that attack the tribe.  0 means no attack

target_time_between_attacks = 350 - (5 * player_tribe_size) - (15 * number_of_raids)

attackers = 0
if (time_since_attack > target_time_between_attacks)
   attackers = 0.5 * npc_tribe_size
endif

