Creep death: more than just a delete

@artch Excellent, I'm really glad you agree. Very excited to see it appear. The creepId field will be great. Eventually having a kill credit/actions leading to death will be a huge boon but this definitely helps as is.

@PostCrafter Thanks for picking this up! Go get them sub tokens
Mind linking your PR here when its ready?

@artch We should consider adding a .remove() for tombstones (and construction sites). It might be important to allow people to deny vision, and adding a .remove() for cosntruction sites would prevent the extractor site issues.

A thought I had, can I add creep name also? On my codebases I don't save creep IDs and instead use names, it would be easier to say, lookup the creep's memory with a name than it would with a non-existant ID.

Not sure if it should be possible to control (remove) tombstones in any way.

As for the visual it could be some icon that does not makes it possible to use it to hide stuff.
Maybe it could be a bit colored depending if it was a own or a hostile creep and look different depending if it's empty or not

Hiryus: Is it possible to add something like killerId for the creep/tower which did the last blow (or all creeps/tower having attacked it the tick it died) ? It is probably hard to do, but I'm asking :).

artch: No, it's out of scope of this functionality. Tracking actions is a whole another story.

@shedletsky Its outside the scope of this feature, tracking something like that in the server is almost as tricky too, maybe in the future though!

Would it be eventually possible to add a hook to the attack function wich returns for example KILL_DAMAGE instead of simply OK? Should be greater than Zero so you could change your code to >= 0 for any successful operation.

@ags131 Makes sense, let's instead make a tombstone.creep property as a Creep instance which is a stub created similarly to here but without adding to Game.creeps. In order to reconstruct this object, you have to store some creep's properties to the tombstone DB object when it gets killed.

@ags131 Makes sense, let's instead make a tombstone.creep property as a Creep instance which is a stub created similarly to here but without adding to Game.creeps. In order to reconstruct this object, you have to store some creep's properties to the tombstone DB object when it gets killed.

Added

If a creep dies on a spot with a container, then resources go to the container, and the tombstone is created with empty store.