mirror of
https://github.com/goonstation/goonstation-2016.git
synced 2026-08-22 05:26:12 +01:00
43 lines
1.2 KiB
Plaintext
43 lines
1.2 KiB
Plaintext
// --------------------------------------------------
|
|
// Fire elemental ability - shoot flames in direction
|
|
// --------------------------------------------------
|
|
/datum/targetable/critter/flamethrower
|
|
name = "Flamethrower"
|
|
desc = "Throw flames towards a target location up to three squares away."
|
|
cooldown = 150
|
|
targeted = 1
|
|
target_anything = 1
|
|
|
|
cast(atom/target)
|
|
if (..())
|
|
return 1
|
|
if (target && !isturf(target))
|
|
target = get_turf(target)
|
|
if (!target)
|
|
return 1
|
|
var/turf/OT = get_turf(holder.owner)
|
|
var/it = 7
|
|
while (get_dist(OT, target) > 3)
|
|
target = get_step(target, get_dir(target, OT))
|
|
it--
|
|
if (it <= 0)
|
|
return 1
|
|
while (get_dist(OT, target) < 3)
|
|
target = get_step(target, get_dir(OT, target))
|
|
it--
|
|
if (it <= 0)
|
|
return 1
|
|
if (target == holder.owner || target == OT)
|
|
return 1
|
|
playsound(target, "sound/effects/spray.ogg", 50, 1, -1)
|
|
var/list/L = getline(OT, target)
|
|
for (var/turf/T in L)
|
|
if (T == OT)
|
|
continue
|
|
fireflash_sm(T, 0, 3000, 0)
|
|
for (var/mob/living/M in T)
|
|
if (!M.is_heat_resistant())
|
|
M.TakeDamage("All", 0, 15, 0, DAMAGE_BURN)
|
|
M.stunned += 2
|
|
M.emote("scream")
|
|
return 0 |