From d76e4cd075b09565dc14a2f03801bb4f0cb0bb27 Mon Sep 17 00:00:00 2001 From: Anewbe Date: Sun, 16 Oct 2016 13:30:38 -0500 Subject: [PATCH 1/2] Flashlights use device cells --- code/game/objects/items/devices/flashlight.dm | 21 +++++++++++-------- code/game/objects/random/random.dm | 5 +++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 4277dcdc94..27ee923a1b 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -11,7 +11,7 @@ var/on = 0 var/brightness_on = 4 //luminosity when on var/obj/item/weapon/cell/cell - var/cell_type = /obj/item/weapon/cell/high + var/cell_type = /obj/item/weapon/cell/device var/list/brightness_levels var/brightness_level = "medium" var/power_usage @@ -27,7 +27,7 @@ if(cell_type) cell = new cell_type(src) - brightness_levels = list("low" = 5, "medium" = 10, "high" = 20) + brightness_levels = list("low" = 0.25, "medium" = 0.5, "high" = 1) power_usage = brightness_levels[brightness_level] else @@ -184,14 +184,17 @@ /obj/item/device/flashlight/attackby(obj/item/weapon/W, mob/user as mob) if(power_use) if(istype(W, /obj/item/weapon/cell)) - if(!cell) - user.drop_item() - W.loc = src - cell = W - user << "You install a cell in \the [src]." - update_icon() + if(istype(W, /obj/item/weapon/cell/device)) + if(!cell) + user.drop_item() + W.loc = src + cell = W + user << "You install a cell in \the [src]." + update_icon() + else + user << "\The [src] already has a cell." else - user << "\The [src] already has a cell." + user << "\The [src] cannot use that type of cell." else ..() diff --git a/code/game/objects/random/random.dm b/code/game/objects/random/random.dm index 531a359d83..0f996a6fb5 100644 --- a/code/game/objects/random/random.dm +++ b/code/game/objects/random/random.dm @@ -67,8 +67,9 @@ icon = 'icons/obj/power.dmi' icon_state = "cell" item_to_spawn() - return pick(prob(50);/obj/item/weapon/cell, - prob(40);/obj/item/weapon/cell/high, + return pick(prob(40);/obj/item/weapon/cell, + prob(25);/obj/item/weapon/cell/device, + prob(25);/obj/item/weapon/cell/high, prob(9);/obj/item/weapon/cell/super, prob(1);/obj/item/weapon/cell/hyper) From c79b86e4fc5519e9ad1467cf966ab5ea21c5bfb0 Mon Sep 17 00:00:00 2001 From: Anewbe Date: Sun, 16 Oct 2016 14:10:49 -0500 Subject: [PATCH 2/2] Changelog --- .../Anewbe - Flashlight Device Cells.yml | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 html/changelogs/Anewbe - Flashlight Device Cells.yml diff --git a/html/changelogs/Anewbe - Flashlight Device Cells.yml b/html/changelogs/Anewbe - Flashlight Device Cells.yml new file mode 100644 index 0000000000..369004d786 --- /dev/null +++ b/html/changelogs/Anewbe - Flashlight Device Cells.yml @@ -0,0 +1,37 @@ +################################ +# 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 +################################# + +# Your name. +author: Anewbe + +# 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: + - tweak: "Flashlights use device cells. Time of use should be roughly unchanged." + - rscadd: "Device cells have a chance to spawn where normal cells do."