From dde3e66019f7bc419d7aeadcce453ee0c5a15bb2 Mon Sep 17 00:00:00 2001 From: Llywelwyn <82828093+Llywelwyn@users.noreply.github.com> Date: Tue, 6 Jun 2023 22:49:01 +0100 Subject: [PATCH] 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 --- code/game/machinery/floodlight.dm | 2 +- code/game/machinery/recharger.dm | 11 +++-- .../items/devices/lighting/flashlight.dm | 15 +++--- .../objects/items/devices/suit_cooling.dm | 6 +-- code/modules/clothing/gloves/stungloves.dm | 6 +-- html/changelogs/llywelwyn-flashlights.yml | 46 +++++++++++++++++++ 6 files changed, 68 insertions(+), 18 deletions(-) create mode 100644 html/changelogs/llywelwyn-flashlights.yml diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm index 6479003e60f..a13f7d4c6e9 100644 --- a/code/game/machinery/floodlight.dm +++ b/code/game/machinery/floodlight.dm @@ -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) . = ..() diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 1d5758e50ce..1da580a56d7 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -65,7 +65,7 @@ charging = null update_icon() else - to_chat(user, "Your gripper cannot hold \the [charging].") + 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, "\The [G][G.charge_failure_message]") + to_chat(user, SPAN_WARNING("\The [G][G.charge_failure_message]")) return TRUE if(charging) - to_chat(user, "\A [charging] is already charging here.") + 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, "\The [name] blinks red as you try to insert the item!") + 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" diff --git a/code/game/objects/items/devices/lighting/flashlight.dm b/code/game/objects/items/devices/lighting/flashlight.dm index 4ebf911aecd..d653b752b4b 100644 --- a/code/game/objects/items/devices/lighting/flashlight.dm +++ b/code/game/objects/items/devices/lighting/flashlight.dm @@ -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 diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm index abdd94afb49..1a7a3b83da3 100644 --- a/code/game/objects/items/devices/suit_cooling.dm +++ b/code/game/objects/items/devices/suit_cooling.dm @@ -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.")) diff --git a/code/modules/clothing/gloves/stungloves.dm b/code/modules/clothing/gloves/stungloves.dm index 489f6dbc3ef..c2b1018a66d 100644 --- a/code/modules/clothing/gloves/stungloves.dm +++ b/code/modules/clothing/gloves/stungloves.dm @@ -33,12 +33,12 @@ //add cell else if(wired && istype(W, /obj/item/cell)) if(cell) - to_chat(user, "A [cell] is already attached to the [src].") + to_chat(user, "\A [cell] is already attached to the [src].") return user.drop_from_inventory(W,src) cell = W w_class = ITEMSIZE_NORMAL - to_chat(user, "You attach the [cell] to the [src].") + to_chat(user, "You attach \the [cell] to the [src].") update_icon() return @@ -47,7 +47,7 @@ //stunglove stuff if(cell) cell.update_icon() - to_chat(user, "You cut the [cell] away from the [src].") + to_chat(user, "You cut \the [cell] away from the [src].") cell.forceMove(get_turf(src.loc)) cell = null w_class = ITEMSIZE_SMALL diff --git a/html/changelogs/llywelwyn-flashlights.yml b/html/changelogs/llywelwyn-flashlights.yml new file mode 100644 index 00000000000..abed9210003 --- /dev/null +++ b/html/changelogs/llywelwyn-flashlights.yml @@ -0,0 +1,46 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: Llywelwyn + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Flashlights now use much less power across the board. Most flashlights last ~26 minutes, with lanterns the exception at ~133 minutes, as they contain a larger cell." + - tweak: "Flashlights now default to high brightness, and their charge is displayed on examine." + - tweak: "Flashlight brightness can now be selected with alt-click - try turning it down if you need to conserve power!" + - tweak: "Flashlights can now be placed into wall rechargers." + - tweak: "Lanterns are now back to being small items, but have had their force reduced to compensate." + - spellcheck: "Fixed various cell-related typos."