mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-03 22:13:24 +00:00
Merge pull request #192 from caelaislinn/master
Autolathe changes, new supply crates, slight cargo bay tweaks
This commit is contained in:
@@ -582,6 +582,7 @@
|
||||
#include "code\game\objects\closets\nuclear.dm"
|
||||
#include "code\game\objects\closets\syndicate.dm"
|
||||
#include "code\game\objects\closets\thunderdome.dm"
|
||||
#include "code\game\objects\closets\walllocker.dm"
|
||||
#include "code\game\objects\closets\wardrobe.dm"
|
||||
#include "code\game\objects\closets\secure\bar.dm"
|
||||
#include "code\game\objects\closets\secure\engineering.dm"
|
||||
|
||||
@@ -15,6 +15,71 @@
|
||||
containername = "Special Ops crate"
|
||||
hidden = 1
|
||||
|
||||
/datum/supply_packs/boxes
|
||||
name = "Empty Box supplies"
|
||||
contains = list("/obj/item/weapon/storage/box",
|
||||
"/obj/item/weapon/storage/box",
|
||||
"/obj/item/weapon/storage/box",
|
||||
"/obj/item/weapon/storage/box",
|
||||
"/obj/item/weapon/storage/box",
|
||||
"/obj/item/weapon/storage/box",
|
||||
"/obj/item/weapon/storage/box",
|
||||
"/obj/item/weapon/storage/box",
|
||||
"/obj/item/weapon/storage/box",
|
||||
"/obj/item/weapon/storage/box",)
|
||||
cost = 5
|
||||
containertype = "/obj/structure/closet/crate"
|
||||
containername = "Empty Box crate"
|
||||
|
||||
/datum/supply_packs/stationary
|
||||
name = "Stationary supplies"
|
||||
contains = list("/obj/item/device/taperecorder",
|
||||
"/obj/item/weapon/packageWrap",
|
||||
"/obj/item/weapon/clipboard",
|
||||
"/obj/item/weapon/clipboard",
|
||||
"/obj/item/weapon/hand_labeler",
|
||||
"/obj/item/weapon/paper_bin",
|
||||
"/obj/item/weapon/pen",
|
||||
"/obj/item/weapon/pen",
|
||||
"/obj/item/weapon/pen",
|
||||
"/obj/item/weapon/stamp",
|
||||
"/obj/item/weapon/stamp/denied",
|
||||
"/obj/item/weapon/storage/diskbox",
|
||||
"/obj/item/weapon/storage/recordsbox",
|
||||
)
|
||||
cost = 5
|
||||
containertype = "/obj/structure/closet/crate"
|
||||
containername = "Stationary crate"
|
||||
|
||||
/datum/supply_packs/artscrafts
|
||||
name = "Arts and Crafts supplies"
|
||||
contains = list("/obj/item/toy/crayonbox",
|
||||
"/obj/item/weapon/c_tube",
|
||||
"/obj/item/weapon/camera_test",
|
||||
"/obj/item/weapon/storage/photo_album",
|
||||
"/obj/item/weapon/packageWrap",
|
||||
"/obj/item/weapon/paint/red",
|
||||
"/obj/item/weapon/paint/green",
|
||||
"/obj/item/weapon/paint/blue",
|
||||
"/obj/item/weapon/paint/yellow",
|
||||
"/obj/item/weapon/paint/violet",
|
||||
"/obj/item/weapon/paint/black",
|
||||
"/obj/item/weapon/paint/white",
|
||||
"/obj/item/weapon/paint/paint_remover",
|
||||
"/obj/item/weapon/wrapping_paper",
|
||||
"/obj/item/weapon/wrapping_paper",
|
||||
"/obj/item/weapon/wrapping_paper")
|
||||
cost = 5
|
||||
containertype = "/obj/structure/closet/crate"
|
||||
containername = "Arts and Crafts crate"
|
||||
|
||||
/datum/supply_packs/empty
|
||||
name = "Empty crate"
|
||||
contains = list()
|
||||
cost = 5
|
||||
containertype = "/obj/structure/closet/crate"
|
||||
containername = "crate"
|
||||
|
||||
/datum/supply_packs/charge
|
||||
cost = 10
|
||||
containertype = "/obj/structure/closet/crate"
|
||||
|
||||
@@ -2,10 +2,17 @@
|
||||
var/busy = 0
|
||||
var/max_m_amount = 150000.0
|
||||
var/max_g_amount = 75000.0
|
||||
var/outputAmount = 1
|
||||
var/makeDir = 0
|
||||
|
||||
/obj/machinery/autolathe/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if (stat)
|
||||
return 1
|
||||
if(istype(O,/obj/item/weapon/storage/))
|
||||
usr.before_take_item(O)
|
||||
O.loc = src
|
||||
user << "\blue You insert the \icon[O] [O.name] into the autolathe!"
|
||||
return 0
|
||||
if (busy)
|
||||
user << "\red The autolathe is busy. Please wait for completion of previous operation."
|
||||
return 1
|
||||
@@ -110,6 +117,17 @@
|
||||
/obj/machinery/autolathe/proc/regular_win(mob/user as mob)
|
||||
var/dat as text
|
||||
dat = text("<B>Metal Amount:</B> [src.m_amount] cm<sup>3</sup> (MAX: [max_m_amount])<BR>\n<FONT color=blue><B>Glass Amount:</B></FONT> [src.g_amount] cm<sup>3</sup> (MAX: [max_g_amount])<HR>")
|
||||
dat += "<FONT color=green><B>Output Queue:</B></FONT> [outputAmount] (<A href='?src=\ref[src];modifyOutputAmount=1'>Modify</A>)"
|
||||
dat += "<HR>"
|
||||
var/list/heldContainers = list()
|
||||
for(var/obj/item/weapon/storage/container in src.contents)
|
||||
heldContainers += container
|
||||
if(heldContainers.len)
|
||||
for(var/obj/item/weapon/storage/container in heldContainers)
|
||||
dat += "<A href='?src=\ref[src];removeContainer=\ref[container]'>[container.name] (eject stored container)</A><br>"
|
||||
else
|
||||
dat += "No held storage containers"
|
||||
dat += "<HR>"
|
||||
var/list/objs = list()
|
||||
objs += src.L
|
||||
if (src.hacked)
|
||||
@@ -154,9 +172,19 @@
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["removeContainer"])
|
||||
var/obj/item/weapon/storage/container = locate(href_list["removeContainer"])
|
||||
container.loc = src.loc
|
||||
container.layer = initial(container.layer)
|
||||
if(href_list["modifyOutputAmount"])
|
||||
outputAmount = text2num(input(usr,"Amount:","Enter new quantity to create",""))
|
||||
if(outputAmount < 1)
|
||||
outputAmount = 1
|
||||
if (!busy)
|
||||
if(href_list["make"])
|
||||
var/turf/T = get_step(src.loc, get_dir(src,usr))
|
||||
makeDir = get_dir(src,usr)
|
||||
makeNew:
|
||||
var/turf/T = get_step(src.loc, makeDir)
|
||||
var/obj/template = locate(href_list["make"])
|
||||
var/multiplier = text2num(href_list["multiplier"])
|
||||
if (!multiplier) multiplier = 1
|
||||
@@ -177,12 +205,23 @@
|
||||
src.m_amount = 0
|
||||
if(src.g_amount < 0)
|
||||
src.g_amount = 0
|
||||
var/obj/new_item = new template.type(T)
|
||||
var/obj/new_item = new template.type(src)
|
||||
for(var/obj/item/weapon/storage/container in src.contents)
|
||||
container.attackby(new_item)
|
||||
if(new_item.loc == container)
|
||||
break
|
||||
if (multiplier>1)
|
||||
var/obj/item/stack/S = new_item
|
||||
S.amount = multiplier
|
||||
busy = 0
|
||||
if(new_item in src)
|
||||
new_item.loc = T
|
||||
src.updateUsrDialog()
|
||||
outputAmount -= 1
|
||||
if(outputAmount > 0)
|
||||
goto makeNew
|
||||
busy = 0
|
||||
else
|
||||
outputAmount = 1
|
||||
if(href_list["act"])
|
||||
var/temp_wire = href_list["wire"]
|
||||
if(href_list["act"] == "pulse")
|
||||
|
||||
299
code/game/objects/closets/walllocker.dm
Normal file
299
code/game/objects/closets/walllocker.dm
Normal file
@@ -0,0 +1,299 @@
|
||||
//added by cael from old bs12
|
||||
//not sure if there's an immediate place for secure wall lockers, but i'm sure the players will think of something
|
||||
|
||||
/obj/structure/closet/walllocker
|
||||
desc = "A wall mounted storage locker."
|
||||
name = "Wall Locker"
|
||||
icon = 'walllocker.dmi'
|
||||
icon_state = "wall-locker"
|
||||
density = 1
|
||||
flags = FPRINT
|
||||
var/list/spawnitems = list()
|
||||
var/amount = 3 // spawns each items X times.
|
||||
anchored = 1
|
||||
opened = 0
|
||||
var/locked = 1
|
||||
var/bang_time = 0
|
||||
var/broken = 0
|
||||
var/large = 1
|
||||
icon_closed = "wall-locker"
|
||||
var/icon_locked = "wall-locker1"
|
||||
icon_opened = "wall-lockeropen"
|
||||
var/icon_broken = "wall-lockerbroken"
|
||||
var/icon_off = "wall-lockeroff"
|
||||
|
||||
/obj/structure/closet/walllocker/attack_hand(mob/user as mob)
|
||||
if (istype(user, /mob/living/silicon/ai)) //Added by Strumpetplaya - AI shouldn't be able to
|
||||
return //activate emergency lockers. This fixes that. (Does this make sense, the AI can't call attack_hand, can it? --Mloc)
|
||||
if(!amount)
|
||||
usr << "It's empty.."
|
||||
return
|
||||
if(amount)
|
||||
for(var/path in spawnitems)
|
||||
new path(src.loc)
|
||||
amount--
|
||||
return
|
||||
|
||||
/obj/structure/closet/walllocker/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (src.opened)
|
||||
if (istype(W, /obj/item/weapon/grab))
|
||||
if (src.large)
|
||||
src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet
|
||||
else
|
||||
user << "The locker is too small to stuff [W] into!"
|
||||
user.drop_item()
|
||||
if (W)
|
||||
W.loc = src.loc
|
||||
else if(src.broken)
|
||||
user << "\red It appears to be broken."
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/card/emag) && !src.broken)
|
||||
src.broken = 1
|
||||
src.locked = 0
|
||||
src.icon_state = src.icon_broken
|
||||
for(var/mob/O in viewers(user, 3))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << text("\blue The locker has been broken by [user] with an electromagnetic card!")
|
||||
else if(src.allowed(user))
|
||||
src.locked = !src.locked
|
||||
for(var/mob/O in viewers(user, 3))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << text("\blue The locker has been []locked by [].", (src.locked ? null : "un"), user)
|
||||
if(src.locked)
|
||||
src.icon_state = src.icon_locked
|
||||
else
|
||||
src.icon_state = src.icon_closed
|
||||
|
||||
else
|
||||
user << "\red Access Denied"
|
||||
return
|
||||
|
||||
/obj/structure/closet/walllocker/security
|
||||
name = "wall locker"
|
||||
req_access = list(access_security)
|
||||
icon_state = "wall-locker1"
|
||||
density = 1
|
||||
|
||||
/obj/structure/closet/walllocker/New()
|
||||
spawn(10)
|
||||
for(var/obj/item/A in src.loc.contents)
|
||||
A.loc = src
|
||||
|
||||
/obj/structure/closet/walllocker/alter_health()
|
||||
return get_turf(src)
|
||||
|
||||
/obj/structure/closet/walllocker/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
|
||||
return src.opened
|
||||
|
||||
for(var/mob/M in src)
|
||||
M.loc = src.loc
|
||||
if (M.client)
|
||||
M.client.eye = M.client.mob
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
|
||||
if (!src.can_open())
|
||||
return 0
|
||||
|
||||
src.dump_contents()
|
||||
|
||||
src.icon_state = src.icon_opened
|
||||
src.opened = 1
|
||||
playsound(src.loc, 'click.ogg', 15, 1, -3)
|
||||
return 1
|
||||
|
||||
if (!src.can_close())
|
||||
return 0
|
||||
|
||||
for (var/obj/item/I in src.loc)
|
||||
if (!I.anchored)
|
||||
I.loc = src
|
||||
|
||||
/*for (var/obj/overlay/o in src.loc) //REMOVE THIS
|
||||
if (!o.anchored)
|
||||
o.loc = src*/
|
||||
|
||||
for (var/mob/M in src.loc)
|
||||
if (M.buckled)
|
||||
continue
|
||||
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
M.loc = src
|
||||
src.icon_state = src.icon_closed
|
||||
src.opened = 0
|
||||
playsound(src.loc, 'click.ogg', 15, 1, -3)
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/walllocker/ex_act(severity)
|
||||
switch(severity)
|
||||
if (1)
|
||||
for (var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
del(src)
|
||||
if (2)
|
||||
if (prob(50))
|
||||
for (var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
del(src)
|
||||
if (3)
|
||||
if (prob(5))
|
||||
for (var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
del(src)
|
||||
|
||||
/obj/structure/closet/walllocker/blob_act()
|
||||
if (prob(50))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
del(src)
|
||||
|
||||
/obj/structure/closet/walllocker/meteorhit(obj/O as obj)
|
||||
if (O.icon_state == "flaming")
|
||||
for(var/obj/item/I in src)
|
||||
I.loc = src.loc
|
||||
for(var/mob/M in src)
|
||||
M.loc = src.loc
|
||||
if (M.client)
|
||||
M.client.eye = M.client.mob
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
src.icon_state = src.icon_broken
|
||||
del(src)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/structure/closet/walllocker/bullet_act(flag)
|
||||
/* Just in case someone gives closets health
|
||||
if (flag == PROJECTILE_BULLET)
|
||||
src.health -= 1
|
||||
src.healthcheck()
|
||||
return
|
||||
if (flag != PROJECTILE_LASER)
|
||||
src.health -= 3
|
||||
src.healthcheck()
|
||||
return
|
||||
else
|
||||
src.health -= 5
|
||||
src.healthcheck()
|
||||
return
|
||||
*/
|
||||
if(prob(1.5))
|
||||
for (var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/structure/closet/walllocker/relaymove(mob/user as mob)
|
||||
if (user.stat)
|
||||
return
|
||||
if (!( src.locked ))
|
||||
for(var/obj/item/I in src)
|
||||
I.loc = src.loc
|
||||
for(var/mob/M in src)
|
||||
M.loc = src.loc
|
||||
if (M.client)
|
||||
M.client.eye = M.client.mob
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
src.icon_state = src.icon_opened
|
||||
src.opened = 1
|
||||
else if(src.locked && world.timeofday - bang_time >= 14)
|
||||
user << "\blue It's locked!"
|
||||
for(var/mob/M in hearers(src, null))
|
||||
if(!(M.disabilities & 32) && M.ear_deaf == 0)
|
||||
M << text("<FONT size=[]>BANG, bang!</FONT>", max(0, 5 - get_dist(src, M)))
|
||||
//user.unlock_medal("It's a trap!", 0, "Get locked or welded into a locker...", "easy")
|
||||
bang_time = world.timeofday
|
||||
return
|
||||
return
|
||||
|
||||
/obj/structure/closet/walllocker/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
|
||||
if ((user.restrained() || user.stat))
|
||||
return
|
||||
if ((!( istype(O, /atom/movable) ) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src)))
|
||||
return
|
||||
if(!src.opened)
|
||||
return
|
||||
if(istype(O, /obj/structure/closet/walllocker) || istype(O, /obj/structure/closet))
|
||||
return
|
||||
step_towards(O, src.loc)
|
||||
if (user != O)
|
||||
for(var/mob/B in viewers(user, 3))
|
||||
if ((B.client && !( B.blinded )))
|
||||
B << text("\red [] stuffs [] into []!", user, O, src)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
/*
|
||||
//obj/structure/closet/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
if (!src.opened && !src.locked)
|
||||
if(!src.can_open())
|
||||
return
|
||||
//open it
|
||||
for(var/obj/item/I in src)
|
||||
I.loc = src.loc
|
||||
for(var/mob/M in src)
|
||||
M.loc = src.loc
|
||||
if (M.client)
|
||||
M.client.eye = M.client.mob
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
src.icon_state = src.icon_opened
|
||||
playsound(src.loc, 'click.ogg', 15, 1, -3)
|
||||
src.opened = 1
|
||||
else if(src.opened)
|
||||
if(!src.can_close())
|
||||
return
|
||||
//close it
|
||||
for(var/obj/item/I in src.loc)
|
||||
if (!( I.anchored ))
|
||||
I.loc = src
|
||||
for(var/mob/M in src.loc)
|
||||
if (M.buckled)
|
||||
continue
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.loc = src
|
||||
src.icon_state = src.icon_closed
|
||||
playsound(src.loc, 'click.ogg', 15, 1, -3)
|
||||
src.opened = 0
|
||||
else
|
||||
return src.attackby(null, user)
|
||||
return*/
|
||||
|
||||
/obj/structure/closet/walllocker/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
|
||||
if (!src.toggle())
|
||||
return src.attackby(null, user)
|
||||
|
||||
/obj/structure/closet/walllocker/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
//spawns endless amounts of breathmask, emergency oxy tank and crowbar
|
||||
|
||||
/obj/structure/closet/walllocker/emerglocker
|
||||
name = "Emergency Locker"
|
||||
spawnitems = list(/obj/item/weapon/tank/emergency_oxygen,/obj/item/clothing/mask/breath,/obj/item/weapon/crowbar)
|
||||
icon_state = "emerg"
|
||||
|
||||
/obj/structure/closet/walllocker/emerglocker/north
|
||||
pixel_y = 32
|
||||
dir = SOUTH
|
||||
|
||||
/obj/structure/closet/walllocker/emerglocker/south
|
||||
pixel_y = -32
|
||||
dir = NORTH
|
||||
|
||||
/obj/structure/closet/walllocker/emerglocker/west
|
||||
pixel_x = -32
|
||||
dir = WEST
|
||||
|
||||
/obj/structure/closet/walllocker/emerglocker/east
|
||||
pixel_x = 32
|
||||
dir = EAST
|
||||
@@ -29,10 +29,10 @@ var/global/list/cached_icons = list()
|
||||
color = "FFFF00"
|
||||
icon_state = "paint_yellow"
|
||||
|
||||
/obj/item/weapon/paint/violet //no icon
|
||||
/obj/item/weapon/paint/violet
|
||||
name = "Violet paint"
|
||||
color = "FF00FF"
|
||||
icon_state = "paint_neutral"
|
||||
icon_state = "paint_violet"
|
||||
|
||||
/obj/item/weapon/paint/black
|
||||
name = "Black paint"
|
||||
@@ -44,7 +44,6 @@ var/global/list/cached_icons = list()
|
||||
color = "FFFFFF"
|
||||
icon_state = "paint_white"
|
||||
|
||||
|
||||
/obj/item/weapon/paint/anycolor
|
||||
name = "Any color"
|
||||
icon_state = "paint_neutral"
|
||||
|
||||
@@ -138,7 +138,6 @@
|
||||
user << "\red The tray won't fit in [src]."
|
||||
return
|
||||
else
|
||||
|
||||
W.loc = user.loc
|
||||
if ((user.client && user.s_active != src))
|
||||
user.client.screen -= W
|
||||
@@ -158,16 +157,20 @@
|
||||
user << "\red The [src] cannot hold [W] as it's a storage item of the same size."
|
||||
return //To prevent the stacking of the same sized items.
|
||||
|
||||
user.u_equip(W)
|
||||
W.loc = src
|
||||
if ((user.client && user.s_active != src))
|
||||
user.client.screen -= W
|
||||
src.orient2hud(user)
|
||||
W.dropped(user)
|
||||
add_fingerprint(user)
|
||||
if(user)
|
||||
user.u_equip(W)
|
||||
W.loc = src
|
||||
if ((user.client && user.s_active != src))
|
||||
user.client.screen -= W
|
||||
src.orient2hud(user)
|
||||
W.dropped(user)
|
||||
add_fingerprint(user)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("\blue [user] has added [W] to [src]!"))
|
||||
else
|
||||
W.loc = src
|
||||
orient_objs(5, 10, 4 + min(7, storage_slots), 10)
|
||||
if (istype(W, /obj/item/weapon/gun/energy/crossbow)) return //STEALTHY
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("\blue [user] has added [W] to [src]!"))
|
||||
//Foreach goto(139)
|
||||
return
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
BIN
icons/obj/walllocker.dmi
Normal file
BIN
icons/obj/walllocker.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user