diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 0600c2db919..369a0153b4c 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -136,4 +136,62 @@ set src in oview(1) if(!usr.stat) - attack_self(usr) \ No newline at end of file + attack_self(usr) + +// FLARES + +/obj/item/device/flashlight/flare + name = "flare" + desc = "A red Nanotrasen issued flare. There are instructions on the side, it reads 'pull cord, make light'." + w_class = 2.0 + brightness_on = 7 // Pretty bright. + icon_state = "flare" + item_state = "flare" + var/fuel = 0 + var/on_damage = 7 + var/produce_heat = 1500 + +/obj/item/device/flashlight/flare/New() + fuel = rand(6000, 9000) // Last 10 to 15 minutes. + ..() + +/obj/item/device/flashlight/flare/attack(mob/living/M as mob, mob/living/user as mob) + ..(M, user, 0) + +/obj/item/device/flashlight/flare/process() + var/turf/pos = get_turf(src) + pos.hotspot_expose(produce_heat, 5) + fuel = max(fuel - 1, 0) + if(!fuel || !on) + turn_off() + if(!fuel) + src.icon_state = "[initial(icon_state)]-empty" + processing_objects -= src + +/obj/item/device/flashlight/flare/proc/turn_off() + on = 0 + src.force = initial(src.force) + src.damtype = initial(src.damtype) + if(ismob(loc)) + var/mob/U = loc + update_brightness(U) + else + update_brightness(null) + +/obj/item/device/flashlight/flare/attack_self(mob/user) + // Usual checks + if(loc != usr) + return + if(!fuel) + user << "It's out of fuel." + return + if(!on) + user.visible_message("[user] activates the flare.", "You pull the cord on the flare, activating it!") + else + return + // All good, turn it on. + on = 1 + update_brightness(user) + src.force = on_damage + src.damtype = "fire" + processing_objects += src \ No newline at end of file diff --git a/code/game/objects/items/weapons/storage/toolbox.dm b/code/game/objects/items/weapons/storage/toolbox.dm index c09391151cf..6db3b4dc691 100644 --- a/code/game/objects/items/weapons/storage/toolbox.dm +++ b/code/game/objects/items/weapons/storage/toolbox.dm @@ -10,6 +10,8 @@ new /obj/item/weapon/extinguisher/mini(src) if(prob(50)) new /obj/item/device/flashlight(src) + else + new /obj/item/device/flashlight/flare(src) new /obj/item/device/radio(src) /obj/item/weapon/storage/toolbox/mechanical/New() diff --git a/html/changelog.html b/html/changelog.html index fc9a9a58f15..8e79b6567ce 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -56,6 +56,8 @@ should be listed in the changelog upon commit tho. Thanks. -->