Adds large cardboard boxes to the game, constructable from five sheets of cardboard.

Cardboard boxes are closets that:
*Can only carry a single person
*Are easy to destroy
*Are flammable
*Can't be welded shut

They can also can be used for more "tactical" purposes, at the same speed as walking.

Takes the opportunity to remove some object unfriendly coding.

If this is accepted they'll be a pull a little later to replace a few closets on the maps with boxes (or maybe code to have generic closets on the map to occasionally spawn as boxes instead).
This commit is contained in:
Incoming
2015-09-10 19:29:19 -04:00
parent ff5747602a
commit 3ef306fc4e
5 changed files with 42 additions and 18 deletions
+1
View File
@@ -39,6 +39,7 @@
var/tagged = 0 // so closet code knows to put the tag overlay back
density = 0
mob_storage_capacity = 2
open_sound = 'sound/items/zip.ogg'
/obj/structure/closet/body_bag/attackby(obj/item/I, mob/user, params)
@@ -140,6 +140,7 @@ var/global/list/datum/stack_recipe/cardboard_recipes = list ( \
new/datum/stack_recipe("cardborg helmet", /obj/item/clothing/head/cardborg), \
new/datum/stack_recipe("pizza box", /obj/item/pizzabox), \
new/datum/stack_recipe("folder", /obj/item/weapon/folder), \
new/datum/stack_recipe("large box", /obj/structure/closet/cardboard, 4), \
)
/obj/item/stack/sheet/cardboard //BubbleWrap
@@ -15,10 +15,14 @@
var/wall_mounted = 0 //never solid (You can always pass over it)
var/health = 100
var/lastbang
var/can_weld_shut = 1
var/max_mob_size = MOB_SIZE_HUMAN //Biggest mob_size accepted by the container
var/mob_storage_capacity = 3 // how many human sized mob/living can fit together inside a closet.
var/storage_capacity = 30 //This is so that someone can't pack hundreds of items in a locker/crate
//then open it in a populated area to crash clients.
var/storage_capacity = 30 //This is so that someone can't pack hundreds of items in a locker/crate then open it in a populated area to crash clients.
var/cutting_tool = /obj/item/weapon/weldingtool
var/open_sound = 'sound/machines/click.ogg'
var/cutting_sound = 'sound/items/Welder.ogg'
var/material_drop = /obj/item/stack/sheet/metal
/obj/structure/closet/New()
..()
@@ -107,10 +111,7 @@
if(!can_open())
return 0
opened = 1
if(istype(src, /obj/structure/closet/body_bag))
playsound(loc, 'sound/items/zip.ogg', 15, 1, -3)
else
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
playsound(loc, open_sound, 15, 1, -3)
density = 0
dump_contents()
update_icon()
@@ -151,10 +152,7 @@
take_contents()
opened = 0
if(istype(src, /obj/structure/closet/body_bag))
playsound(loc, 'sound/items/zip.ogg', 15, 1, -3)
else
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
playsound(loc, open_sound, 15, 1, -3)
density = 1
update_icon()
return 1
@@ -166,7 +164,7 @@
/obj/structure/closet/ex_act(severity, target)
contents_explosion(severity, target)
new /obj/item/stack/sheet/metal(loc)
new material_drop(loc)
dump_contents()
qdel(src)
..()
@@ -207,16 +205,18 @@
return
if(istype(W,/obj/item/tk_grab))
return 0
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(WT.remove_fuel(0,user))
if(istype(W, cutting_tool))
if(istype(cutting_tool, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(!WT.remove_fuel(0,user))
return
user << "<span class='notice'>You begin cutting \the [src] apart...</span>"
playsound(loc, 'sound/items/Welder.ogg', 40, 1)
playsound(loc, cutting_sound, 40, 1)
if(do_after(user,40,5,1, target = src))
if( !opened || !istype(src, /obj/structure/closet) || !user || !WT || !WT.isOn() || !user.loc )
return
playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
new /obj/item/stack/sheet/metal(loc)
playsound(loc, cutting_sound, 50, 1)
new material_drop(loc)
visible_message("[user] has cut \the [src] apart with \the [WT].", "<span class='italics'>You hear welding.</span>")
qdel(src)
return
@@ -227,7 +227,7 @@
else
if(istype(W, /obj/item/stack/packageWrap))
return
if(istype(W, /obj/item/weapon/weldingtool))
if(istype(W, /obj/item/weapon/weldingtool) && can_weld_shut)
var/obj/item/weapon/weldingtool/WT = W
if(WT.remove_fuel(0,user))
user << "<span class='notice'>You begin [welded ? "unwelding":"welding"] \the [src]...</span>"
@@ -0,0 +1,21 @@
/obj/structure/closet/cardboard
name = "large cardboard box"
desc = "Just a box..."
//icon_state = "cardboard" //NEEDS SPRITES
health = 10 //At the end of the day it's still just a box
mob_storage_capacity = 1
burntime = 20
can_weld_shut = 0
cutting_tool = /obj/item/weapon/wirecutters
open_sound = 'sound/effects/rustle2.ogg'
cutting_sound = 'sound/items/poster_ripped.ogg'
material_drop = /obj/item/stack/sheet/cardboard
var/move_delay = 0
/obj/structure/closet/cardboard/relaymove(mob/user, direction) //!
if(opened || move_delay || user.stat || user.stunned || user.weakened || user.paralysis || !isturf(loc) || !has_gravity(loc))
return
step(src, direction)
move_delay = 1
spawn(config.walk_speed) //Kept you waiting, huh?
move_delay = 0
+1
View File
@@ -758,6 +758,7 @@
#include "code\game\objects\structures\crates_lockers\closets.dm"
#include "code\game\objects\structures\crates_lockers\crates.dm"
#include "code\game\objects\structures\crates_lockers\largecrate.dm"
#include "code\game\objects\structures\crates_lockers\closets\cardboardbox.dm"
#include "code\game\objects\structures\crates_lockers\closets\crittercrate.dm"
#include "code\game\objects\structures\crates_lockers\closets\fitness.dm"
#include "code\game\objects\structures\crates_lockers\closets\gimmick.dm"