The usual way to make a skill deal damage is not to subtract hit points but to spawn an invisible attacker and have it attack. Armour, upgrades and overkill then all go through the engine's own path - compute the damage yourself and you have to rebuild every one of them.
- 1Create an invisible attacker and an invisible target marker.
- 2Give the attacker's weapon splash, and the area damage is computed for you.
- 3Order the attack, and scale the damage by repeating it.
Give each projectile a hit cooldown. Without one, a projectile standing in a crowd deals its damage every trigger cycle. This is not optional.
A projectile that is a unit has to test for collisions itself, and there is a bug here that looks like physics. Single shots are accurate; rapid fire passes straight through.
The cause is not tunnelling, it is a cache. A per-projectile loop that moves a location onto the bullet and Brings it computes the count once and hands every later bullet the first one's answer, because editing a location's coordinates by EUD does not invalidate the Bring cache. So if the first bullet misses they all miss. One line inside the loop that invalidates the cache fixes it.
| AtLeast 1 대신 AtMost 0의 반대로 | Bring AtLeast 1 only sees completed units, so an egg or a building under construction is not a collision. |
|---|---|
| 히트박스는 손으로 쓰지 말 것 | There are helpers to put a location on a unit's centre and to grow it on each axis. Writing the four bounds by hand means remembering to clamp at 0, which most forget. |
| 새 유닛 루프의 인자를 올릴 것 | The new-unit iterator stops after a number of consecutive already-known units, defaulting to two. A projectile system creating several a cycle misses new ones unless you raise it. |
