chessmasterhong / WaterEmblem

https://chessmasterhong.bitbucket.io/projects/WaterEmblem/
118 stars 27 forks source link

Injecting turn counters into entities #159

Closed DrkSephy closed 9 years ago

DrkSephy commented 9 years ago

Since encounter zones might be a bit of a challenge, here is an alternative. When enemies are spawned, it would be great to pass in a turn property. Here is how this would affect movement:

Out of the above two, implementing the first point would suffice. With proper placement of units, it would work out nicely (since the player can only cover a computable finite distance per turn/average of turns).

chessmasterhong commented 9 years ago

To use this new functionality, add a new property to each Enemy Spawner in Weltmeister called waitUntilTurn with the value being the turn in which the enemies spawned by the spawner has to wait until they can perform their action. If no such property is assigned in Weltmeister, the spawner will use its default value of 0 (i.e., spawned units will proceed to perform their action as soon as it is their turn).

The turn waiting behavior will cancel if there is an attackable unit within movement range. Once cancelled, or until the turn passes this waiting value, the enemy will not return to their turn skipping behavior until set again manually by code.

DrkSephy commented 9 years ago

Excellent work, @chessmasterhong.