Open Loobinex opened 2 years ago
so a code wise, a new function/option to function like count_creatures_in_dungeon that also takes creation_turn into account?
Hero units could exist without a dungeon, we'd still want to count those.
It could be a simple as adding a field to units that determines if the creatures have been placed by level script.
yeah might've mischecked but tough that was the function currently used to count them if you use creation_turn you don't need an extra field right?
if there is a creation turn for spawned units and not for preplaced units or units that came through a portal or joined the enemy, then sure.
Mapmakers often want players to not just destroy hearts, but also to kill the heroes on the map. This is to make sure the player does not simply avoid the heroes meant to defend it, and kill the heart without a fight. However, as a downside, this means that the player also has to find and kill all heroes hidden on the map, which is not always obvious and usually no fun for the player. It appears like the entire map is won, everything defeated and then he has to play hide and seek to trigger the victory condition.
A way around this trade-off would be to offer the map-maker a script variable to check how many of the creatures spawned by the script are still alive. This way he can have the player win the map when he kills the heart and all defenders, but not the hero pockets defending hidden areas.
Example: