Kills off /obj/item/device (#6561)

This commit is contained in:
kevinz000
2018-04-30 00:06:58 -05:00
committed by Poojawa
parent ab3035a4ea
commit 3369c804b2
538 changed files with 6728 additions and 6707 deletions
+50 -50
View File
@@ -1,4 +1,4 @@
/obj/item/device/flashlight
/obj/item/flashlight
name = "flashlight"
desc = "A hand-held emergency light."
icon = 'icons/obj/lighting.dmi'
@@ -15,11 +15,11 @@
var/brightness_on = 4 //range of light when on
var/flashlight_power = 1 //strength of the light when on
/obj/item/device/flashlight/Initialize()
/obj/item/flashlight/Initialize()
. = ..()
update_brightness()
/obj/item/device/flashlight/proc/update_brightness(mob/user = null)
/obj/item/flashlight/proc/update_brightness(mob/user = null)
if(on)
icon_state = "[initial(icon_state)]-on"
if(flashlight_power)
@@ -30,7 +30,7 @@
icon_state = initial(icon_state)
set_light(0)
/obj/item/device/flashlight/attack_self(mob/user)
/obj/item/flashlight/attack_self(mob/user)
on = !on
update_brightness(user)
for(var/X in actions)
@@ -38,14 +38,14 @@
A.UpdateButtonIcon()
return 1
/obj/item/device/flashlight/suicide_act(mob/living/carbon/human/user)
/obj/item/flashlight/suicide_act(mob/living/carbon/human/user)
if (user.eye_blind)
user.visible_message("<span class='suicide'>[user] is putting [src] close to [user.p_their()] eyes and turning it on ... but [user.p_theyre()] blind!</span>")
return SHAME
user.visible_message("<span class='suicide'>[user] is putting [src] close to [user.p_their()] eyes and turning it on! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (FIRELOSS)
/obj/item/device/flashlight/attack(mob/living/carbon/M, mob/living/carbon/human/user)
/obj/item/flashlight/attack(mob/living/carbon/M, mob/living/carbon/human/user)
add_fingerprint(user)
if(istype(M) && on && user.zone_selected in list(BODY_ZONE_PRECISE_EYES, BODY_ZONE_PRECISE_MOUTH))
@@ -158,7 +158,7 @@
else
return ..()
/obj/item/device/flashlight/pen
/obj/item/flashlight/pen
name = "penlight"
desc = "A pen-sized light, used by medical staff. It can also be used to create a hologram to alert people of incoming medical assistance."
icon_state = "penlight"
@@ -167,7 +167,7 @@
brightness_on = 2
var/holo_cooldown = 0
/obj/item/device/flashlight/pen/afterattack(atom/target, mob/user, proximity_flag)
/obj/item/flashlight/pen/afterattack(atom/target, mob/user, proximity_flag)
if(!proximity_flag)
if(holo_cooldown > world.time)
to_chat(user, "<span class='warning'>[src] is not ready yet!</span>")
@@ -192,7 +192,7 @@
visible_message("<span class='danger'>[creator] created a medical hologram!</span>")
/obj/item/device/flashlight/seclite
/obj/item/flashlight/seclite
name = "seclite"
desc = "A robust flashlight used by security."
icon_state = "seclite"
@@ -204,7 +204,7 @@
hitsound = 'sound/weapons/genhit1.ogg'
// the desk lamps are a bit special
/obj/item/device/flashlight/lamp
/obj/item/flashlight/lamp
name = "desk lamp"
desc = "A desk lamp with an adjustable mount."
icon_state = "lamp"
@@ -220,14 +220,14 @@
// green-shaded desk lamp
/obj/item/device/flashlight/lamp/green
/obj/item/flashlight/lamp/green
desc = "A classic green-shaded desk lamp."
icon_state = "lampgreen"
item_state = "lampgreen"
/obj/item/device/flashlight/lamp/verb/toggle_light()
/obj/item/flashlight/lamp/verb/toggle_light()
set name = "Toggle light"
set category = "Object"
set src in oview(1)
@@ -236,7 +236,7 @@
attack_self(usr)
//Bananalamp
/obj/item/device/flashlight/lamp/bananalamp
/obj/item/flashlight/lamp/bananalamp
name = "banana lamp"
desc = "Only a clown would think to make a ghetto banana-shaped lamp. Even has a goofy pullstring."
icon_state = "bananalamp"
@@ -244,7 +244,7 @@
// FLARES
/obj/item/device/flashlight/flare
/obj/item/flashlight/flare
name = "flare"
desc = "A red Nanotrasen issued flare. There are instructions on the side, it reads 'pull cord, make light'."
w_class = WEIGHT_CLASS_SMALL
@@ -259,11 +259,11 @@
light_color = LIGHT_COLOR_FLARE
grind_results = list("sulfur" = 15)
/obj/item/device/flashlight/flare/New()
/obj/item/flashlight/flare/New()
fuel = rand(800, 1000) // Sorry for changing this so much but I keep under-estimating how long X number of ticks last in seconds.
..()
/obj/item/device/flashlight/flare/process()
/obj/item/flashlight/flare/process()
open_flame(heat)
fuel = max(fuel - 1, 0)
if(!fuel || !on)
@@ -272,14 +272,14 @@
icon_state = "[initial(icon_state)]-empty"
STOP_PROCESSING(SSobj, src)
/obj/item/device/flashlight/flare/ignition_effect(atom/A, mob/user)
/obj/item/flashlight/flare/ignition_effect(atom/A, mob/user)
if(fuel && on)
. = "<span class='notice'>[user] lights [A] with [src] like a real \
badass.</span>"
else
. = ""
/obj/item/device/flashlight/flare/proc/turn_off()
/obj/item/flashlight/flare/proc/turn_off()
on = FALSE
force = initial(src.force)
damtype = initial(src.damtype)
@@ -289,14 +289,14 @@
else
update_brightness(null)
/obj/item/device/flashlight/flare/update_brightness(mob/user = null)
/obj/item/flashlight/flare/update_brightness(mob/user = null)
..()
if(on)
item_state = "[initial(item_state)]-on"
else
item_state = "[initial(item_state)]"
/obj/item/device/flashlight/flare/attack_self(mob/user)
/obj/item/flashlight/flare/attack_self(mob/user)
// Usual checks
if(!fuel)
@@ -314,10 +314,10 @@
damtype = "fire"
START_PROCESSING(SSobj, src)
/obj/item/device/flashlight/flare/is_hot()
/obj/item/flashlight/flare/is_hot()
return on * heat
/obj/item/device/flashlight/flare/torch
/obj/item/flashlight/flare/torch
name = "torch"
desc = "A torch fashioned from some leaves and a log."
w_class = WEIGHT_CLASS_BULKY
@@ -330,7 +330,7 @@
on_damage = 10
slot_flags = null
/obj/item/device/flashlight/lantern
/obj/item/flashlight/lantern
name = "lantern"
icon_state = "lantern"
item_state = "lantern"
@@ -340,7 +340,7 @@
brightness_on = 6 // luminosity when on
/obj/item/device/flashlight/slime
/obj/item/flashlight/slime
gender = PLURAL
name = "glowing slime extract"
desc = "Extract from a yellow slime. It emits a strong light when squeezed."
@@ -352,21 +352,21 @@
materials = list()
brightness_on = 6 //luminosity when on
/obj/item/device/flashlight/emp
/obj/item/flashlight/emp
var/emp_max_charges = 4
var/emp_cur_charges = 4
var/charge_tick = 0
/obj/item/device/flashlight/emp/New()
/obj/item/flashlight/emp/New()
..()
START_PROCESSING(SSobj, src)
/obj/item/device/flashlight/emp/Destroy()
/obj/item/flashlight/emp/Destroy()
STOP_PROCESSING(SSobj, src)
. = ..()
/obj/item/device/flashlight/emp/process()
/obj/item/flashlight/emp/process()
charge_tick++
if(charge_tick < 10)
return FALSE
@@ -374,12 +374,12 @@
emp_cur_charges = min(emp_cur_charges+1, emp_max_charges)
return TRUE
/obj/item/device/flashlight/emp/attack(mob/living/M, mob/living/user)
/obj/item/flashlight/emp/attack(mob/living/M, mob/living/user)
if(on && user.zone_selected in list(BODY_ZONE_PRECISE_EYES, BODY_ZONE_PRECISE_MOUTH)) // call original attack when examining organs
..()
return
/obj/item/device/flashlight/emp/afterattack(atom/movable/A, mob/user, proximity)
/obj/item/flashlight/emp/afterattack(atom/movable/A, mob/user, proximity)
if(!proximity)
return
@@ -401,7 +401,7 @@
// Glowsticks, in the uncomfortable range of similar to flares,
// but not similar enough to make it worth a refactor
/obj/item/device/flashlight/glowstick
/obj/item/flashlight/glowstick
name = "glowstick"
desc = "A military-grade glowstick."
w_class = WEIGHT_CLASS_SMALL
@@ -412,27 +412,27 @@
grind_results = list("phenol" = 15, "hydrogen" = 10, "oxygen" = 5) //Meth-in-a-stick
var/fuel = 0
/obj/item/device/flashlight/glowstick/Initialize()
/obj/item/flashlight/glowstick/Initialize()
fuel = rand(1600, 2000)
light_color = color
. = ..()
/obj/item/device/flashlight/glowstick/Destroy()
/obj/item/flashlight/glowstick/Destroy()
STOP_PROCESSING(SSobj, src)
. = ..()
/obj/item/device/flashlight/glowstick/process()
/obj/item/flashlight/glowstick/process()
fuel = max(fuel - 1, 0)
if(!fuel)
turn_off()
STOP_PROCESSING(SSobj, src)
update_icon()
/obj/item/device/flashlight/glowstick/proc/turn_off()
/obj/item/flashlight/glowstick/proc/turn_off()
on = FALSE
update_icon()
/obj/item/device/flashlight/glowstick/update_icon()
/obj/item/flashlight/glowstick/update_icon()
item_state = "glowstick"
cut_overlays()
if(!fuel)
@@ -449,7 +449,7 @@
icon_state = "glowstick"
cut_overlays()
/obj/item/device/flashlight/glowstick/attack_self(mob/user)
/obj/item/flashlight/glowstick/attack_self(mob/user)
if(!fuel)
to_chat(user, "<span class='notice'>[src] is spent.</span>")
return
@@ -462,47 +462,47 @@
user.visible_message("<span class='notice'>[user] cracks and shakes [src].</span>", "<span class='notice'>You crack and shake [src], turning it on!</span>")
activate()
/obj/item/device/flashlight/glowstick/proc/activate()
/obj/item/flashlight/glowstick/proc/activate()
if(!on)
on = TRUE
START_PROCESSING(SSobj, src)
/obj/item/device/flashlight/glowstick/red
/obj/item/flashlight/glowstick/red
name = "red glowstick"
color = LIGHT_COLOR_RED
/obj/item/device/flashlight/glowstick/blue
/obj/item/flashlight/glowstick/blue
name = "blue glowstick"
color = LIGHT_COLOR_BLUE
/obj/item/device/flashlight/glowstick/cyan
/obj/item/flashlight/glowstick/cyan
name = "cyan glowstick"
color = LIGHT_COLOR_CYAN
/obj/item/device/flashlight/glowstick/orange
/obj/item/flashlight/glowstick/orange
name = "orange glowstick"
color = LIGHT_COLOR_ORANGE
/obj/item/device/flashlight/glowstick/yellow
/obj/item/flashlight/glowstick/yellow
name = "yellow glowstick"
color = LIGHT_COLOR_YELLOW
/obj/item/device/flashlight/glowstick/pink
/obj/item/flashlight/glowstick/pink
name = "pink glowstick"
color = LIGHT_COLOR_PINK
/obj/item/device/flashlight/glowstick/random
/obj/item/flashlight/glowstick/random
name = "random colored glowstick"
icon_state = "random_glowstick"
color = null
/obj/item/device/flashlight/glowstick/random/Initialize()
/obj/item/flashlight/glowstick/random/Initialize()
..()
var/T = pick(typesof(/obj/item/device/flashlight/glowstick) - /obj/item/device/flashlight/glowstick/random)
var/T = pick(typesof(/obj/item/flashlight/glowstick) - /obj/item/flashlight/glowstick/random)
new T(loc)
return INITIALIZE_HINT_QDEL
/obj/item/device/flashlight/spotlight //invisible lighting source
/obj/item/flashlight/spotlight //invisible lighting source
name = "disco light"
desc = "Groovy..."
icon_state = null
@@ -517,7 +517,7 @@
var/range = null
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
/obj/item/device/flashlight/flashdark
/obj/item/flashlight/flashdark
name = "flashdark"
desc = "A strange device manufactured with mysterious elements that somehow emits darkness. Or maybe it just sucks in light? Nobody knows for sure."
icon_state = "flashdark"
@@ -525,7 +525,7 @@
brightness_on = 2.5
flashlight_power = -3
/obj/item/device/flashlight/eyelight
/obj/item/flashlight/eyelight
name = "eyelight"
desc = "This shouldn't exist outside of someone's head, how are you seeing this?"
brightness_on = 15