Merge pull request #11241 from Hubblenaut/light_replacer

Amendments to light replacer
This commit is contained in:
GinjaNinja32
2015-10-09 11:35:13 +01:00
4 changed files with 64 additions and 12 deletions

View File

@@ -194,13 +194,13 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
/datum/supply_packs/janitor /datum/supply_packs/janitor
name = "Janitorial supplies" name = "Janitorial supplies"
contains = list(/obj/item/weapon/reagent_containers/glass/bucket, contains = list(/obj/item/weapon/reagent_containers/glass/bucket,
/obj/item/weapon/reagent_containers/glass/bucket,
/obj/item/weapon/reagent_containers/glass/bucket,
/obj/item/weapon/mop, /obj/item/weapon/mop,
/obj/item/weapon/caution, /obj/item/weapon/caution,
/obj/item/weapon/caution, /obj/item/weapon/caution,
/obj/item/weapon/caution, /obj/item/weapon/caution,
/obj/item/weapon/caution,
/obj/item/weapon/storage/bag/trash, /obj/item/weapon/storage/bag/trash,
/obj/item/device/lightreplacer,
/obj/item/weapon/reagent_containers/spray/cleaner, /obj/item/weapon/reagent_containers/spray/cleaner,
/obj/item/weapon/reagent_containers/glass/rag, /obj/item/weapon/reagent_containers/glass/rag,
/obj/item/weapon/grenade/chem_grenade/cleaner, /obj/item/weapon/grenade/chem_grenade/cleaner,

View File

@@ -15,7 +15,7 @@
// //
// HOW TO REFILL THE DEVICE // HOW TO REFILL THE DEVICE
// //
// It will need to be manually refilled with lights. // It can be manually refilled or by clicking on a storage item containing lights.
// If it's part of a robot module, it will charge when the Robot is inside a Recharge Station. // If it's part of a robot module, it will charge when the Robot is inside a Recharge Station.
// //
// EMAGGED FEATURES // EMAGGED FEATURES
@@ -41,7 +41,7 @@
/obj/item/device/lightreplacer /obj/item/device/lightreplacer
name = "light replacer" name = "light replacer"
desc = "A device to automatically replace lights. Refill with working lightbulbs." desc = "A device to automatically replace lights. Refill with working lightbulbs or sheets of glass."
icon = 'icons/obj/janitor.dmi' icon = 'icons/obj/janitor.dmi'
icon_state = "lightreplacer0" icon_state = "lightreplacer0"
@@ -51,14 +51,13 @@
slot_flags = SLOT_BELT slot_flags = SLOT_BELT
origin_tech = list(TECH_MAGNET = 3, TECH_MATERIAL = 2) origin_tech = list(TECH_MAGNET = 3, TECH_MATERIAL = 2)
var/max_uses = 20 var/max_uses = 32
var/uses = 0 var/uses = 32
var/emagged = 0 var/emagged = 0
var/failmsg = "" var/failmsg = ""
var/charge = 0 var/charge = 0
/obj/item/device/lightreplacer/New() /obj/item/device/lightreplacer/New()
uses = max_uses / 2
failmsg = "The [name]'s refill light blinks red." failmsg = "The [name]'s refill light blinks red."
..() ..()
@@ -73,8 +72,8 @@
user << "<span class='warning'>[src.name] is full.</span>" user << "<span class='warning'>[src.name] is full.</span>"
return return
else if(G.use(1)) else if(G.use(1))
AddUses(5) AddUses(16) //Autolathe converts 1 sheet into 16 lights.
user << "<span class='notice'>You insert a piece of glass into the [src.name]. You have [uses] lights remaining.</span>" user << "<span class='notice'>You insert a piece of glass into \the [src.name]. You have [uses] light\s remaining.</span>"
return return
else else
user << "<span class='warning'>You need one sheet of glass to replace lights.</span>" user << "<span class='warning'>You need one sheet of glass to replace lights.</span>"
@@ -84,7 +83,7 @@
if(L.status == 0) // LIGHT OKAY if(L.status == 0) // LIGHT OKAY
if(uses < max_uses) if(uses < max_uses)
AddUses(1) AddUses(1)
user << "You insert the [L.name] into the [src.name]. You have [uses] lights remaining." user << "You insert \the [L.name] into \the [src.name]. You have [uses] light\s remaining."
user.drop_item() user.drop_item()
qdel(L) qdel(L)
return return
@@ -92,7 +91,6 @@
user << "You need a working light." user << "You need a working light."
return return
/obj/item/device/lightreplacer/attack_self(mob/user) /obj/item/device/lightreplacer/attack_self(mob/user)
/* // This would probably be a bit OP. If you want it though, uncomment the code. /* // This would probably be a bit OP. If you want it though, uncomment the code.
if(isrobot(user)) if(isrobot(user))

View File

@@ -224,7 +224,7 @@
//Set the stop_messages to stop it from printing messages //Set the stop_messages to stop it from printing messages
/obj/item/weapon/storage/proc/can_be_inserted(obj/item/W as obj, stop_messages = 0) /obj/item/weapon/storage/proc/can_be_inserted(obj/item/W as obj, stop_messages = 0)
if(!istype(W)) return //Not an item if(!istype(W)) return //Not an item
if(!usr.canUnEquip(W)) if(!usr.canUnEquip(W))
return 0 return 0
@@ -340,6 +340,21 @@
if(isrobot(user)) if(isrobot(user))
return //Robots can't interact with storage items. return //Robots can't interact with storage items.
if(istype(W, /obj/item/device/lightreplacer))
var/obj/item/device/lightreplacer/LP = W
var/amt_inserted = 0
var/turf/T = get_turf(user)
for(var/obj/item/weapon/light/L in src.contents)
if(L.status == 0)
if(LP.uses < LP.max_uses)
LP.AddUses(1)
amt_inserted++
remove_from_storage(L, T)
qdel(L)
if(amt_inserted)
user << "You inserted [amt_inserted] light\s into \the [LP.name]. You have [LP.uses] light\s remaining."
return
if(!can_be_inserted(W)) if(!can_be_inserted(W))
return return

View File

@@ -0,0 +1,39 @@
################################
# 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: Hubblenaut
# 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:
- rscadd: "Light replacers can be refilled by clicking on a storage item."
- tweak: "Light replacers now hold up to 32 light bulbs."
- tweak: "Light replacers can be obtained through janitorial supply crates."
- tweak: "A sheet of glass fills the light replacer by 16 bulbs."