ToME has a few Aura type effects already. Ice Storm is a good example of a map effect style aura. Conversely Gloom is a good example of an entity based aura.
What I'd like to see out of an engine function is a blend between the two. Auras should be tied to the entity but should update map effects each turn. To take just lite as an example. Right now we have a lite flag on an entity but all it's really doing is checking our Line of Sight radius. Lite is never really applied to the map, shading is instead applied to make the map appear to be lit (via applyLite).
In order to tell if a grid an actor is standing in is lit, you need to find the difference between it and every actor on the map with the lite attribute. If the lite attribute is greater then the distance then you know that the actor is in a lit tile. What I'd like is a function that simply tells the map grid that it is lit, that the source of that effect is Foo, and that Foo needs to update the map grid every time it moves, dies, or whatever. Then, to tell if the grid is lit all we'd need to do is ask it.
Of course the above is just a simple example. Ultimately the grid would need to work much like current map effects. When an actor steps into the grid the actor should ask the grid if there's any active auras and apply them to itself as needed. Some things would be fairly simple, others more complex. But I think with these building blocks we could do something like this.
Code: Select all
if game.level.map:hasAura("icestorm") then
local src = game.level.map.icestorm_aura.src
local t = src:getTalentFromId(src.T_ICE_STORM)
t.doIceStorm(src, self)
end
Anyway, that's just my thoughts on how it could behave and how it could possibly be implemented.