mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
Added flares! One time activation item that stays on until it runs out of fuel.
You can randomly get them from emergency toolboxes, instead of a flash light. Icon by Ausops! git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4892 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -136,4 +136,62 @@
|
||||
set src in oview(1)
|
||||
|
||||
if(!usr.stat)
|
||||
attack_self(usr)
|
||||
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 << "<span class='notice'>It's out of fuel.</span>"
|
||||
return
|
||||
if(!on)
|
||||
user.visible_message("<span class='notice'>[user] activates the flare.</span>", "<span class='notice'>You pull the cord on the flare, activating it!</span>")
|
||||
else
|
||||
return
|
||||
// All good, turn it on.
|
||||
on = 1
|
||||
update_brightness(user)
|
||||
src.force = on_damage
|
||||
src.damtype = "fire"
|
||||
processing_objects += src
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user