Flashlight changes and fixes (#16437)

* Flashlight Fixes

* lantern small + grammar fix

also did other cases of missing \the or whatever whilst at it

* numbers

* cl

this sucked to write

* cl but better

* use SPAN_WHATEVER whilst we're here

* if i didnt link my github to employers i would write a bad word here

i missed a bracket

---------

Co-authored-by: Cody Brittain <cbrittain10@yahoo.com>
This commit is contained in:
Llywelwyn
2023-06-06 22:49:01 +01:00
committed by GitHub
parent c7d9d475c0
commit dde3e66019
6 changed files with 68 additions and 18 deletions
@@ -32,7 +32,7 @@
var/obj/item/cell/cell
var/cell_type = /obj/item/cell/device
var/list/brightness_levels
var/brightness_level = "medium"
var/brightness_level = "high"
var/power_usage
/// Does the light use power?
var/power_use = TRUE
@@ -52,7 +52,7 @@
if(power_use && cell_type)
if(starts_with_cell)
cell = new cell_type(src)
brightness_levels = list("low" = 0.25, "medium" = 0.5, "high" = 1)
brightness_levels = list("low" = 1/32, "medium" = 1/16, "high" = 1/8) // ~26 minutes at high power with a device cell.
power_usage = (brightness_levels[brightness_level] / efficiency_modifier)
else
verbs -= /obj/item/device/flashlight/verb/toggle_brightness
@@ -129,7 +129,7 @@
if(power_use && brightness_level)
to_chat(user, SPAN_NOTICE("\The [src] is set to [brightness_level]."))
if(cell)
to_chat(user, SPAN_NOTICE("\The [src] has a \the [cell] attached."))
to_chat(user, SPAN_NOTICE("\The [src] has \a [cell] attached. It has [round(cell.percent())]% charge remaining."))
/obj/item/device/flashlight/attack_self(mob/user)
if(always_on)
@@ -143,7 +143,7 @@
return 0
if(!isturf(user.loc))
to_chat(user, SPAN_NOTICE("You cannot turn the light on while in this [user.loc].")) //To prevent some lighting anomalities.
to_chat(user, SPAN_NOTICE("You cannot turn the light on while in this [user.loc].")) //To prevent some lighting anomalies.
return 0
playsound(src.loc, toggle_sound, 60, 1)
@@ -258,6 +258,9 @@
else
return ..()
/obj/item/device/flashlight/AltClick()
toggle_brightness()
/obj/item/device/flashlight/proc/inspect_vision(obj/item/organ/vision, mob/living/user)
var/mob/living/carbon/human/H = vision.owner
@@ -317,6 +320,7 @@
item_state = ""
flags = CONDUCT
brightness_on = 2
efficiency_modifier = 2
w_class = ITEMSIZE_TINY
/obj/item/device/flashlight/heavy
@@ -337,6 +341,7 @@
item_state = "maglight"
force = 10
brightness_on = 5
efficiency_modifier = 0.8
w_class = ITEMSIZE_NORMAL
uv_intensity = 70
attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed")
@@ -391,9 +396,7 @@
slot_l_hand_str = 'icons/mob/items/lefthand_mining.dmi',
slot_r_hand_str = 'icons/mob/items/righthand_mining.dmi',
)
force = 10
attack_verb = list("bludgeoned, bashed, whacked")
w_class = ITEMSIZE_NORMAL
matter = list(MATERIAL_STEEL = 200,MATERIAL_GLASS = 100)
flashlight_power = 1
brightness_on = 4
@@ -164,11 +164,11 @@
if(istype(W, /obj/item/cell))
if(cover_open)
if(cell)
to_chat(user, SPAN_WARNING("There is a [cell] already installed here."))
to_chat(user, SPAN_WARNING("There is \a [cell] already installed here."))
else
user.drop_from_inventory(W,src)
cell = W
to_chat(user, SPAN_NOTICE("You insert the [cell]."))
to_chat(user, SPAN_NOTICE("You insert \the [cell]."))
update_icon()
return
@@ -228,7 +228,7 @@
if(cover_open)
if(cell)
to_chat(user, SPAN_NOTICE("The panel is open, exposing the [cell]."))
to_chat(user, SPAN_NOTICE("The panel is open, exposing \the [cell]."))
else
to_chat(user, SPAN_NOTICE("The panel is open."))