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 21:49:01 +00:00
committed by GitHub
co-authored by Cody Brittain
parent c7d9d475c0
commit dde3e66019
6 changed files with 68 additions and 18 deletions
+1 -1
View File
@@ -17,7 +17,7 @@
/obj/machinery/floodlight/Initialize()
. = ..()
cell = new /obj/item/cell/device(src) // 41minutes @ 200W
cell = new /obj/item/cell(src)
/obj/machinery/floodlight/examine(mob/user)
. = ..()
+6 -5
View File
@@ -65,7 +65,7 @@
charging = null
update_icon()
else
to_chat(user, "<span class='danger'>Your gripper cannot hold \the [charging].</span>")
to_chat(user, SPAN_DANGER("Your gripper cannot hold \the [charging]."))
return TRUE
if(!G.dropsafety())
@@ -74,14 +74,14 @@
if(is_type_in_list(G, allowed_devices))
if (G.get_cell() == DEVICE_NO_CELL)
if (G.charge_failure_message)
to_chat(user, "<span class='warning'>\The [G][G.charge_failure_message]</span>")
to_chat(user, SPAN_WARNING("\The [G][G.charge_failure_message]"))
return TRUE
if(charging)
to_chat(user, "<span class='warning'>\A [charging] is already charging here.</span>")
to_chat(user, SPAN_WARNING("\A [charging] is already charging here."))
return TRUE
// Checks to make sure he's not in space doing it, and that the area got proper power.
if(!powered())
to_chat(user, "<span class='warning'>\The [name] blinks red as you try to insert the item!</span>")
to_chat(user, SPAN_WARNING("\The [name] blinks red as you try to insert the item!"))
return TRUE
user.drop_from_inventory(G,src)
@@ -179,7 +179,8 @@
active_power_usage = 75 KILOWATTS
allowed_devices = list(
/obj/item/gun/energy,
/obj/item/melee/baton
/obj/item/melee/baton,
/obj/item/device/flashlight
)
icon_state_charged = "wrecharger100"
icon_state_charging = "wrecharger"
@@ -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."))