mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Adds force to a pair of items that were lacking for some reason, and standardizes light replacer file. (#4280)
* Adds force to lamps. * Standardization. * Standardizes a few things. * Grammar that I missed. * Some more missed grammar.
This commit is contained in:
@@ -290,6 +290,7 @@
|
||||
name = "desk lamp"
|
||||
desc = "A desk lamp with an adjustable mount."
|
||||
icon_state = "lamp"
|
||||
force = 10
|
||||
brightness_on = 5
|
||||
w_class = ITEMSIZE_LARGE
|
||||
flags = CONDUCT
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
name = "light replacer"
|
||||
desc = "A device to automatically replace lights. Refill with working lightbulbs or sheets of glass."
|
||||
|
||||
force = 8
|
||||
icon = 'icons/obj/janitor.dmi'
|
||||
icon_state = "lightreplacer0"
|
||||
flags = CONDUCT
|
||||
@@ -61,32 +61,32 @@
|
||||
|
||||
/obj/item/device/lightreplacer/examine(mob/user)
|
||||
if(..(user, 2))
|
||||
user << "It has [uses] lights remaining."
|
||||
to_chat(user, "It has [uses] lights remaining.")
|
||||
|
||||
/obj/item/device/lightreplacer/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/stack/material) && W.get_material_name() == "glass")
|
||||
var/obj/item/stack/G = W
|
||||
if(uses >= max_uses)
|
||||
user << "<span class='warning'>[src.name] is full.</span>"
|
||||
to_chat(user, "<span class='warning'>[src.name] is full.</span>")
|
||||
return
|
||||
else if(G.use(1))
|
||||
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] light\s remaining.</span>"
|
||||
add_uses(16) //Autolathe converts 1 sheet into 16 lights.
|
||||
to_chat(user, "<span class='notice'>You insert a piece of glass into \the [src.name]. You have [uses] light\s remaining.</span>")
|
||||
return
|
||||
else
|
||||
user << "<span class='warning'>You need one sheet of glass to replace lights.</span>"
|
||||
to_chat(user, "<span class='warning'>You need one sheet of glass to replace lights.</span>")
|
||||
|
||||
if(istype(W, /obj/item/weapon/light))
|
||||
var/obj/item/weapon/light/L = W
|
||||
if(L.status == 0) // LIGHT OKAY
|
||||
if(uses < max_uses)
|
||||
AddUses(1)
|
||||
user << "You insert \the [L.name] into \the [src.name]. You have [uses] light\s remaining."
|
||||
add_uses(1)
|
||||
to_chat(user, "You insert \the [L.name] into \the [src.name]. You have [uses] light\s remaining.")
|
||||
user.drop_item()
|
||||
qdel(L)
|
||||
return
|
||||
else
|
||||
user << "You need a working light."
|
||||
to_chat(user, "You need a working light.")
|
||||
return
|
||||
|
||||
/obj/item/device/lightreplacer/attack_self(mob/user)
|
||||
@@ -95,10 +95,10 @@
|
||||
var/mob/living/silicon/robot/R = user
|
||||
if(R.emagged)
|
||||
src.Emag()
|
||||
usr << "You shortcircuit the [src]."
|
||||
to_chat(usr, You short circuit the [src].")
|
||||
return
|
||||
*/
|
||||
usr << "It has [uses] lights remaining."
|
||||
to_chat(usr, "It has [uses] lights remaining.")
|
||||
|
||||
/obj/item/device/lightreplacer/update_icon()
|
||||
icon_state = "lightreplacer[emagged]"
|
||||
@@ -107,17 +107,17 @@
|
||||
/obj/item/device/lightreplacer/proc/Use(var/mob/user)
|
||||
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
|
||||
AddUses(-1)
|
||||
add_uses(-1)
|
||||
return 1
|
||||
|
||||
// Negative numbers will subtract
|
||||
/obj/item/device/lightreplacer/proc/AddUses(var/amount = 1)
|
||||
/obj/item/device/lightreplacer/proc/add_uses(var/amount = 1)
|
||||
uses = min(max(uses + amount, 0), max_uses)
|
||||
|
||||
/obj/item/device/lightreplacer/proc/Charge(var/mob/user, var/amount = 1)
|
||||
charge += amount
|
||||
if(charge > 6)
|
||||
AddUses(1)
|
||||
add_uses(1)
|
||||
charge = 0
|
||||
|
||||
/obj/item/device/lightreplacer/proc/ReplaceLight(var/obj/machinery/light/target, var/mob/living/U)
|
||||
|
||||
@@ -426,12 +426,12 @@
|
||||
for(var/obj/item/weapon/light/L in src.contents)
|
||||
if(L.status == 0)
|
||||
if(LP.uses < LP.max_uses)
|
||||
LP.AddUses(1)
|
||||
LP.add_uses(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."
|
||||
to_chat(user, "You inserted [amt_inserted] light\s into \the [LP.name]. You have [LP.uses] light\s remaining.")
|
||||
return
|
||||
|
||||
if(!can_be_inserted(W))
|
||||
@@ -441,14 +441,14 @@
|
||||
var/obj/item/weapon/tray/T = W
|
||||
if(T.calc_carry() > 0)
|
||||
if(prob(85))
|
||||
user << "<span class='warning'>The tray won't fit in [src].</span>"
|
||||
to_chat(user, "<span class='warning'>The tray won't fit in [src].</span>")
|
||||
return
|
||||
else
|
||||
W.forceMove(get_turf(user))
|
||||
if ((user.client && user.s_active != src))
|
||||
user.client.screen -= W
|
||||
W.dropped(user)
|
||||
user << "<span class='warning'>God damnit!</span>"
|
||||
to_chat(user, "<span class='warning'>God damn it!</span>")
|
||||
|
||||
W.add_fingerprint(user)
|
||||
return handle_item_insertion(W)
|
||||
@@ -506,9 +506,9 @@
|
||||
collection_mode = !collection_mode
|
||||
switch (collection_mode)
|
||||
if(1)
|
||||
usr << "[src] now picks up all items in a tile at once."
|
||||
to_chat(usr, "[src] now picks up all items on a tile at once.")
|
||||
if(0)
|
||||
usr << "[src] now picks up one item at a time."
|
||||
to_chat(usr, "[src] now picks up one item at a time.")
|
||||
|
||||
|
||||
/obj/item/weapon/storage/verb/quick_empty()
|
||||
@@ -539,7 +539,7 @@
|
||||
var/total_storage_space = 0
|
||||
for(var/obj/item/I in contents)
|
||||
total_storage_space += I.get_storage_cost()
|
||||
max_storage_space = max(total_storage_space,max_storage_space) //prevents spawned containers from being too small for their contents
|
||||
max_storage_space = max(total_storage_space,max_storage_space) //Prevents spawned containers from being too small for their contents.
|
||||
|
||||
src.boxes = new /obj/screen/storage( )
|
||||
src.boxes.name = "storage"
|
||||
|
||||
Reference in New Issue
Block a user