I'm making a map, and in this map you start with 10 food (and can only get a maximum of 10 food), and every quarter day (120 seconds) you lose 5 food. When it reaches 0, your unit loses 20hp every 2 seconds and gets a spell effect until the unit gets his food past 0. You can gain 2 food be eating cooked meat, and 1 food for eating raw meat. I do this by using Chickens that count as 1 food (perm-invis, invulnerable, size 0, no selection, no minimap view of the unit, and no attack). I use 2 different variables for each player: RedFood (integer) and RedChicken (Unit-Group). RedFood keeps track of the actual Food count so I know when to take away food and when to start damaging the unit. At the start I spawn the 10 chickens for Red and add them to the food group and set RedFood to 10. Every 120 seconds I lower RedFood by 5 and kill 10 random units from RedChicken. The problem is that for some reason the food lowers by 4 every quarter day instead of 5, and the unit takes damage when it hits 3 instead of 0. I have 5 triggers for this:
Can somebody please tell me what I did wrong? I am really stumped here.
I appreciate the help! Thanks ahead of time to anybody who helps.
Can somebody please tell me what I did wrong? I am really stumped here.
I appreciate the help! Thanks ahead of time to anybody who helps.