mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-21 15:42:53 +00:00
The wizard den is no longer pitch black. Fixes targeted spells using the wrong caster/source. Adds some missing checks using the caster source above. Re-logging should no longer cause a loss of spell UI icons. Mind transfer should no longer cause unintended spell loss.
25 lines
857 B
Plaintext
25 lines
857 B
Plaintext
/*
|
|
Aoe turf spells target a ring of tiles around the user
|
|
This ring has an outer radius (range) and an inner radius (inner_radius)
|
|
Aoe turf spells have two useful flags: IGNOREDENSE and IGNORESPACE. These are explained in setup.dm
|
|
*/
|
|
|
|
/spell/aoe_turf //affects all turfs in view or range (depends)
|
|
spell_flags = IGNOREDENSE
|
|
var/inner_radius = -1 //for all your ring spell needs
|
|
|
|
/spell/aoe_turf/choose_targets(mob/user = usr)
|
|
var/list/targets = list()
|
|
|
|
for(var/turf/target in view_or_range(range, holder, selection_type))
|
|
if(!(target in view_or_range(inner_radius, holder, selection_type)))
|
|
if(target.density && (spell_flags & IGNOREDENSE))
|
|
continue
|
|
if(istype(target, /turf/space) && (spell_flags & IGNORESPACE))
|
|
continue
|
|
targets += target
|
|
|
|
if(!targets.len) //doesn't waste the spell
|
|
return
|
|
|
|
return targets |