There were a bunch of boxes that had their own special code when they all do the same thing. So I've merged them into proper storage items.

Boxes affected:
- Donut boxes
- Egg cartons
- Candle packs
- Match boxes
- Snap pop boxes
- Monkey cube boxes

Items I didn't merge:
- Pizza boxes
- Cigarette packs

Pizza boxes are a whole new kind of 'special snowflake code' that is best left the way it is. Cigarette packs involve some stuff I'm unfamiliar with so that can wait until I learn what I need to learn.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4452 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
johnsonmt88@gmail.com
2012-08-17 00:35:01 +00:00
parent cac628a640
commit 852b838e4e
17 changed files with 459 additions and 855 deletions
+2 -2
View File
@@ -27,7 +27,7 @@
"/obj/item/weapon/reagent_containers/food/snacks/flour",
"/obj/item/weapon/reagent_containers/food/drinks/milk",
"/obj/item/weapon/reagent_containers/food/drinks/milk",
"/obj/item/kitchen/egg_box",
"/obj/item/weapon/storage/fancy/egg_box",
"/obj/item/weapon/reagent_containers/food/condiment/enzyme",
"/obj/item/weapon/reagent_containers/food/snacks/grown/banana",
"/obj/item/weapon/reagent_containers/food/snacks/grown/banana",
@@ -38,7 +38,7 @@
/datum/supply_packs/monkey
name = "Monkey crate"
contains = list ("/obj/item/weapon/monkeycube_box")
contains = list ("/obj/item/weapon/storage/monkeycube_box")
cost = 20
containertype = "/obj/structure/closet/crate/freezer"
containername = "Monkey crate"
+1 -25
View File
@@ -334,6 +334,7 @@
desc = "Wow!"
icon = 'icons/obj/toy.dmi'
icon_state = "snappop"
w_class = 1
throw_impact(atom/hit_atom)
..()
@@ -359,31 +360,6 @@
playsound(src, 'snap.ogg', 50, 1)
del(src)
/obj/item/toy/snappopbox
name = "snap pop box"
desc = "Eight wrappers of fun! Ages 8 and up. Not suitable for children."
icon = 'icons/obj/toy.dmi'
icon_state = "spbox"
var/amount = 8
attack_hand(mob/user as mob, unused, flag)
add_fingerprint(user)
if(user.r_hand == src || user.l_hand == src)
if(amount>0)
user.put_in_active_hand( new /obj/item/toy/snappop(src) )
user << "You take a snap pop out of the box."
amount--
else
user << "There are no snap pops left in the box."
else
..()
return
attack_paw(mob/user as mob)
return attack_hand(user)
/obj/item/toy/waterflower
name = "Water Flower"
desc = "A seemingly innocent sunflower...with a twist."
+2 -2
View File
@@ -139,7 +139,7 @@
name = "cigarette machine"
desc = "If you want to get cancer, might as well do it in style"
icon_state = "cigs"
product_paths = "/obj/item/weapon/cigpacket;/obj/item/weapon/matchbox;/obj/item/weapon/lighter/random"
product_paths = "/obj/item/weapon/cigpacket;/obj/item/weapon/storage/matchbox;/obj/item/weapon/lighter/random"
product_amounts = "10;10;4"
product_slogans = "Space cigs taste good like a cigarette should.;I'd rather toolbox than switch.;Smoke!;Don't believe the reports - smoke today!"
vend_delay = 34
@@ -205,7 +205,7 @@
req_access_txt = "1"
product_paths = "/obj/item/weapon/handcuffs;/obj/item/weapon/grenade/flashbang;/obj/item/device/flash;/obj/item/weapon/reagent_containers/food/snacks/donut/normal;/obj/item/weapon/storage/box/evidence"
product_amounts = "8;4;5;12;6"
product_hidden = "/obj/item/clothing/glasses/sunglasses;/obj/item/kitchen/donut_box"
product_hidden = "/obj/item/clothing/glasses/sunglasses;/obj/item/weapon/storage/fancy/donut_box"
product_hideamt = "2;2"
product_ads = "Crack capitalist skulls!;Beat some heads in!;Don't forget - harm is good!;Your weapons are right here.;Handcuffs!;Freeze, scumbag!;Don't tase me bro!;Tase them, bro.;Why not have a donut?"
+1 -1
View File
@@ -12,7 +12,7 @@
var/enemy_mp = 20
var/gameover = 0
var/blocked = 0 //Player cannot attack/heal while set
var/list/prizes = list( /obj/item/toy/snappopbox = 2,
var/list/prizes = list( /obj/item/weapon/storage/snappopbox = 2,
/obj/item/toy/blink = 2,
/obj/item/clothing/under/syndicate/tacticool = 2,
/obj/item/toy/sword = 2,
+1 -1
View File
@@ -55,7 +55,7 @@
for(var/i = 0, i < 5, i++)
new /obj/item/weapon/reagent_containers/food/drinks/soymilk(src)
for(var/i = 0, i < 2, i++)
new /obj/item/kitchen/egg_box(src)
new /obj/item/weapon/storage/fancy/egg_box(src)
return
+2 -5
View File
@@ -44,7 +44,6 @@
return
/obj/structure/closet/wardrobe/chaplain_black/New()
//new /obj/item/clothing/suit/imperium_monk(src) //No. -- Urist
new /obj/item/clothing/under/rank/chaplain(src)
new /obj/item/clothing/shoes/black(src)
new /obj/item/clothing/suit/nun(src)
@@ -52,11 +51,9 @@
new /obj/item/clothing/suit/chaplain_hoodie(src)
new /obj/item/clothing/head/chaplain_hood(src)
new /obj/item/clothing/suit/holidaypriest(src)
//new /obj/item/clothing/suit/hastur (src) //No. -- Urist
//new /obj/item/clothing/head/hasturhood (src) //No. -- Urist
new /obj/item/weapon/storage/backpack/cultpack (src)
new /obj/item/weapon/candlepack(src)
new /obj/item/weapon/candlepack(src)
new /obj/item/weapon/storage/fancy/candle_box(src)
new /obj/item/weapon/storage/fancy/candle_box(src)
return
/obj/structure/closet/wardrobe/green/New()
+1 -36
View File
@@ -8,6 +8,7 @@
icon = 'icons/obj/candle.dmi'
icon_state = "candle1"
item_state = "candle1"
w_class = 1
var/wax = 200
var/lit = 0
@@ -88,39 +89,3 @@
if(lit)
user.total_luminosity -= CANDLE_LUM
src.sd_SetLuminosity(CANDLE_LUM)
///////////////
//CANDLE PACK//
///////////////
/obj/item/weapon/candlepack
name = "Candle pack"
//desc = "The most popular brand of Space Cigarettes, sponsors of the Space Olympics."
icon = 'icons/obj/candle.dmi'
icon_state = "pack5"
item_state = "pack5"
w_class = 1
throwforce = 2
var/candlecount = 5
flags = TABLEPASS
slot_flags = SLOT_BELT
/obj/item/weapon/candlepack/update_icon()
src.icon_state = text("pack[]", src.candlecount)
src.desc = text("There are [] candles left!", src.candlecount)
return
/obj/item/weapon/candlepack/attack_hand(mob/user as mob)
if(user.r_hand == src || user.l_hand == src)
if(src.candlecount == 0)
//user << "\red You're out of cigs, shit! How you gonna get through the rest of the day..."
return
else
src.candlecount--
user.put_in_hands(new /obj/item/candle(user))
else
return ..()
src.update_icon()
return
-157
View File
@@ -1,157 +0,0 @@
/*
CONTAINS:
DONUT BOX
EGG BOX
MONKEY CUBE BOX
*/
/mob/living/carbon/var/last_eating = 0
/obj/item/kitchen/donut_box
var/const/max_amount = 6
var/list/obj/item/weapon/reagent_containers/food/snacks/donut/donuts = list()
icon = 'icons/obj/food.dmi'
icon_state = "donutbox6"
name = "donut box"
/obj/item/kitchen/egg_box
var/amount = 12
icon = 'icons/obj/food.dmi'
icon_state = "eggbox"
name = "egg box"
/obj/item/kitchen/donut_box/New()
for(var/i = 0; i < max_amount; i++)
donuts += new /obj/item/weapon/reagent_containers/food/snacks/donut/normal(src)
update()
..()
/obj/item/kitchen/donut_box/proc/update()
src.icon_state = text("donutbox[]", src.donuts.len)
return
/obj/item/kitchen/donut_box/attackby(obj/item/weapon/W as obj, mob/living/user as mob)
if (istype(W, /obj/item/weapon/reagent_containers/food/snacks/donut) && (donuts.len < max_amount))
user.drop_item()
W.loc = src
donuts += W
usr << "You place a donut back into the box."
src.update()
return
/obj/item/kitchen/donut_box/MouseDrop(mob/living/user as mob)
if ((user == usr && (!( usr.restrained() ) && (!( usr.stat ) && (usr.contents.Find(src) || in_range(src, usr))))))
if(!istype(user, /mob/living/carbon/metroid) && !istype(user, /mob/living/simple_animal))
if( !usr.get_active_hand() )
src.attack_hand(usr, usr.hand, 1)
return
/obj/item/kitchen/donut_box/attack_paw(mob/living/user as mob)
return src.attack_hand(user)
/obj/item/kitchen/donut_box/attack_hand(mob/living/user as mob, unused, flag)
if (flag)
return ..()
src.add_fingerprint(user)
var/last = donuts.len
if(last <= 0)
user << "Oh no! No donuts left!"
return
//world.log << last
var/obj/item/weapon/reagent_containers/food/snacks/donut/P = donuts[last] // Get the last donut.
if(P)
P.loc = user.loc
user.put_in_hands(P)
donuts -= P
user << "You take a donut out of the box."
src.update()
return
/obj/item/kitchen/donut_box/examine()
set src in oview(1)
var/n = src.donuts.len
if (n <= 0)
n = 0
usr << "There are no donuts left in the box."
else
if (n == 1)
usr << "There is one donut left in the box."
else
usr << text("There are [] donuts in the box.", n)
return
/obj/item/kitchen/egg_box/proc/update()
src.icon_state = text("eggbox[]", src.amount)
return
/obj/item/kitchen/egg_box/MouseDrop(mob/user as mob)
if ((user == usr && (!( usr.restrained() ) && (!( usr.stat ) && (usr.contents.Find(src) || in_range(src, usr))))))
if( !usr.get_active_hand() )
attack_hand(usr, usr.hand, 1)
return
return
/obj/item/kitchen/egg_box/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/item/kitchen/egg_box/attack_hand(mob/user as mob, unused, flag)
if (flag)
return ..()
src.add_fingerprint(user)
var/obj/item/weapon/reagent_containers/food/snacks/egg/P = locate() in src
if(!P && (amount >= 1))
P = new /obj/item/weapon/reagent_containers/food/snacks/egg( src )
if(P)
usr.put_in_hands(P)
usr << "You take an egg out of the box."
src.amount--
src.update()
return
/obj/item/kitchen/egg_box/examine()
set src in oview(1)
src.amount = round(src.amount)
var/n = src.amount
for(var/obj/item/weapon/reagent_containers/food/snacks/egg/P in src)
n++
if (n <= 0)
n = 0
usr << "There are no eggs left in the box."
else
if (n == 1)
usr << "There is one egg left in the box."
else
usr << text("There are [] eggs in the box.", n)
return
/obj/item/weapon/monkeycube_box
name = "monkey cube box"
desc = "Drymate brand monkey cubes. Just add water!"
icon = 'icons/obj/food.dmi'
icon_state = "monkeycubebox"
var/amount = 2
attack_hand(mob/user as mob, unused, flag)
add_fingerprint(user)
if(user.r_hand == src || user.l_hand == src)
if(amount)
user.put_in_hands(new /obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped(user))
user << "You take a monkey cube out of the box."
amount--
else
user << "There are no monkey cubes left in the box."
else
..()
return
attack_paw(mob/user as mob)
return attack_hand(user)
@@ -3,7 +3,6 @@
/*
CONTAINS:
MATCHES
MATCHBOXES
CIGARETTES
CIGARS
SMOKING PIPES
@@ -50,55 +49,6 @@ ZIPPO
return ..()
//////////////
//MATCHBOXES//
//////////////
/obj/item/weapon/matchbox
name = "Matchbox"
desc = "A small box of Almost But Not Quite Plasma Premium Matches."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "matchbox"
item_state = "zippo"
w_class = 1
flags = TABLEPASS
slot_flags = SLOT_BELT
var/matchcount = 10
w_class = 1.0
attack_hand(mob/user as mob)
if(user.r_hand == src || user.l_hand == src)
if(src.matchcount <= 0)
user << "\red You're out of matches. Shouldn't have wasted so many..."
return
else
src.matchcount--
user.put_in_active_hand(new /obj/item/weapon/match(user))
else
return ..()
if(src.matchcount <= 0)
src.icon_state = "matchbox_empty"
else if(src.matchcount <= 3)
src.icon_state = "matchbox_almostempty"
else if(src.matchcount <= 6)
src.icon_state = "matchbox_almostfull"
else
src.icon_state = "matchbox"
src.update_icon()
return
attackby(obj/item/weapon/match/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/match) && W.lit == 0)
W.lit = 1
W.icon_state = "match_lit"
processing_objects.Add(W)
W.update_icon()
return
///////////////////////
//CIGARETTES + CIGARS//
///////////////////////
+106
View File
@@ -0,0 +1,106 @@
/*
* The 'fancy' path is for objects like donut boxes that show how many items are in the storage item on the sprite itself
* .. Sorry for the shitty path name, I couldnt think of a better one.
*
* WARNING: var/icon_type is used for both examine text and sprite name. Please look at the procs below and adjust your sprite names accordingly
*
* Contains:
* Donut Box
* Egg Box
* Candle Box
*/
/obj/item/weapon/storage/fancy/
icon = 'icons/obj/food.dmi'
icon_state = "donutbox6"
name = "donut box"
var/icon_type = "donut"
/obj/item/weapon/storage/fancy/attack_hand(mob/user as mob)
..()
update_icon()
return
/obj/item/weapon/storage/fancy/attackby(obj/item/W as obj, mob/user as mob)
..()
update_icon()
return
/obj/item/weapon/storage/fancy/update_icon(var/itemremoved = 0)
var/total_contents = src.contents.len - itemremoved
src.icon_state = "[src.icon_type]box[total_contents]"
return
/obj/item/weapon/storage/fancy/examine()
set src in oview(1)
if(contents.len <= 0)
usr << "There are no [src.icon_type]s left in the box."
else if(contents.len == 1)
usr << "There is one [src.icon_type] left in the box."
else
usr << "There are [src.contents.len] [src.icon_type]s in the box."
return
/*
* Donut Box
*/
/obj/item/weapon/storage/fancy/donut_box
icon = 'icons/obj/food.dmi'
icon_state = "donutbox6"
icon_type = "donut"
name = "donut box"
storage_slots = 6
can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/donut")
/obj/item/weapon/storage/fancy/donut_box/New()
..()
for(var/i=1; i <= storage_slots; i++)
new /obj/item/weapon/reagent_containers/food/snacks/donut/normal(src)
return
/*
* Egg Box
*/
/obj/item/weapon/storage/fancy/egg_box
icon = 'icons/obj/food.dmi'
icon_state = "eggbox"
icon_type = "egg"
name = "egg box"
storage_slots = 12
can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/egg")
/obj/item/weapon/storage/fancy/egg_box/New()
..()
for(var/i=1; i <= storage_slots; i++)
new /obj/item/weapon/reagent_containers/food/snacks/egg(src)
return
/*
* Candle Box
*/
/obj/item/weapon/storage/fancy/candle_box
name = "Candle pack"
desc = "A pack of red candles."
icon = 'icons/obj/candle.dmi'
icon_state = "candlebox5"
icon_type = "candle"
item_state = "candlebox5"
storage_slots = 5
throwforce = 2
flags = TABLEPASS
slot_flags = SLOT_BELT
/obj/item/weapon/storage/fancy/candle_box/New()
..()
for(var/i=1; i <= storage_slots; i++)
new /obj/item/candle(src)
return
+72
View File
@@ -0,0 +1,72 @@
/*
* Contains:
* Monkey Cube Box
* Candle Packs
* Snap Pop Box
*/
/*
* Monkey Cube Box
*/
/obj/item/weapon/storage/monkeycube_box
name = "monkey cube box"
desc = "Drymate brand monkey cubes. Just add water!"
icon = 'icons/obj/food.dmi'
icon_state = "monkeycubebox"
storage_slots = 7
can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/monkeycube")
/obj/item/weapon/storage/monkeycube_box/New()
..()
new /obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped(src)
new /obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped(src)
return
/*
* Snap Pop Box
*/
/obj/item/weapon/storage/snappopbox
name = "snap pop box"
desc = "Eight wrappers of fun! Ages 8 and up. Not suitable for children."
icon = 'icons/obj/toy.dmi'
icon_state = "spbox"
storage_slots = 8
can_hold = list("/obj/item/toy/snappop")
/obj/item/weapon/storage/snappopbox/New()
..()
for(var/i=1; i <= storage_slots; i++)
new /obj/item/toy/snappop(src)
/*
* Match Box
*/
/obj/item/weapon/storage/matchbox
name = "Matchbox"
desc = "A small box of Almost But Not Quite Plasma Premium Matches."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "matchbox"
item_state = "zippo"
storage_slots = 10
w_class = 1
flags = TABLEPASS
slot_flags = SLOT_BELT
/obj/item/weapon/storage/matchbox/New()
..()
for(var/i=1; i <= storage_slots; i++)
new /obj/item/weapon/match(src)
return
/obj/item/weapon/storage/matchbox/attackby(obj/item/weapon/match/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/match) && W.lit == 0)
W.lit = 1
W.icon_state = "match_lit"
processing_objects.Add(W)
W.update_icon()
return
+5
View File
@@ -230,6 +230,11 @@
//Call this proc to handle the removal of an item from the storage item. The item will be moved to the atom sent as new_target
/obj/item/weapon/storage/proc/remove_from_storage(obj/item/W as obj, atom/new_location)
if(!istype(W)) return
if(istype(src, /obj/item/weapon/storage/fancy))
var/obj/item/weapon/storage/fancy/F = src
F.update_icon(1)
for(var/mob/M in range(1, src.loc))
if (M.s_active == src.loc)
if (M.client)
-313
View File
@@ -1,317 +1,4 @@
//BUG!!!: reactions on splashing etc cause errors because stuff gets deleted before it executes.
// Bandaid fix using spawn - very ugly, need to fix this.
///////////////////////////////Grenades
//Includes changes by Mord_Sith to allow for buildable cameras
/*/obj/item/weapon/chem_grenade //Commenting this out in case someone wants to revert the change or just doesn't like the move.
name = "Grenade Casing"
icon_state = "chemg"
icon = 'icons/obj/chemical.dmi'
item_state = "flashbang"
w_class = 2.0
force = 2.0
var/stage = 0
var/state = 0
var/path = 0
var/motion = 0
var/direct = "SOUTH"
var/obj/item/weapon/circuitboard/circuit = null
var/list/beakers = new/list()
var/list/allowed_containers = list("/obj/item/weapon/reagent_containers/glass/beaker", "/obj/item/weapon/reagent_containers/glass/dispenser", "/obj/item/weapon/reagent_containers/glass/bottle")
var/affected_area = 3
throw_speed = 4
throw_range = 20
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
slot_flags = SLOT_BELT
New()
var/datum/reagents/R = new/datum/reagents(1000)
reagents = R
R.my_atom = src
attackby(obj/item/weapon/W as obj, mob/user as mob)//TODO:Have grenades use the new assembly things
if(istype(W,/obj/item/device/assembly_holder) && !stage && path != 2)
path = 1
user << "\blue You add [W] to the metal casing."
playsound(src.loc, 'Screwdriver2.ogg', 25, -3)
del(W) //Okay so we're not really adding anything here. cheating.
icon_state = initial(icon_state) +"_ass"
name = "unsecured grenade"
stage = 1
else if(istype(W,/obj/item/weapon/screwdriver) && stage == 1 && path != 2)
path = 1
if(beakers.len)
user << "\blue You lock the assembly."
playsound(src.loc, 'Screwdriver.ogg', 25, -3)
name = "grenade"
icon_state = initial(icon_state) +"_locked"
stage = 2
else
user << "\red You need to add at least one beaker before locking the assembly."
else if ((istype(W,/obj/item/weapon/reagent_containers/glass/beaker)||istype(W,/obj/item/weapon/reagent_containers/glass/dispenser)||istype(W,/obj/item/weapon/reagent_containers/glass/bottle)) && stage == 1 && path != 2)
path = 1
if(beakers.len == 2)
user << "\red The grenade can not hold more containers."
return
else
if(W.reagents.total_volume)
user << "\blue You add \the [W] to the assembly."
user.drop_item()
W.loc = src
beakers += W
else
user << "\red \the [W] is empty."
else if(path != 1)
if(!istype(src.loc,/turf))
user << "\red You need to put the canister on the ground to do that!"
else
switch(state)
if(0)
if(istype(W, /obj/item/weapon/wrench))
playsound(src.loc, 'Ratchet.ogg', 50, 1)
if(do_after(user, 20))
user << "\blue You wrench the canister in place."
src.name = "Camera Assembly"
src.anchored = 1
src.state = 1
path = 2
if(1)
if(istype(W, /obj/item/weapon/wrench))
playsound(src.loc, 'Ratchet.ogg', 50, 1)
if(do_after(user, 20))
user << "\blue You unfasten the canister."
src.name = "Grenade Casing"
src.anchored = 0
src.state = 0
path = 0
if(istype(W, /obj/item/device/multitool))
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
user << "\blue You place the electronics inside the canister."
src.circuit = W
user.drop_item()
W.loc = src
if(istype(W, /obj/item/weapon/screwdriver) && circuit)
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
user << "\blue You screw the circuitry into place."
src.state = 2
if(istype(W, /obj/item/weapon/crowbar) && circuit)
playsound(src.loc, 'Crowbar.ogg', 50, 1)
user << "\blue You remove the circuitry."
src.state = 1
circuit.loc = src.loc
src.circuit = null
if(2)
if(istype(W, /obj/item/weapon/screwdriver) && circuit)
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
user << "\blue You unfasten the circuitry."
src.state = 1
if(istype(W, /obj/item/weapon/cable_coil))
if(W:amount >= 1)
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
if(do_after(user, 20))
W:amount -= 1
if(!W:amount) del(W)
user << "\blue You add cabling to the canister."
src.state = 3
if(3)
if(istype(W, /obj/item/weapon/wirecutters))
playsound(src.loc, 'wirecutter.ogg', 50, 1)
user << "\blue You remove the cabling."
src.state = 2
var/obj/item/weapon/cable_coil/A = new /obj/item/weapon/cable_coil( src.loc )
A.amount = 1
if(issignaler(W))
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
user << "\blue You attach the wireless signaller unit to the circutry."
user.drop_item()
W.loc = src
src.state = 4
if(4)
if(istype(W, /obj/item/weapon/crowbar) && !motion)
playsound(src.loc, 'Crowbar.ogg', 50, 1)
user << "\blue You remove the remote signalling device."
src.state = 3
new /obj/item/device/assembly/signaler( src.loc, 1 )
if(isprox(W) && motion == 0)
// if(W:amount >= 1)
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
// W:use(1)
user << "\blue You attach the proximity sensor."
motion = 1
if(istype(W, /obj/item/weapon/crowbar) && motion)
playsound(src.loc, 'Crowbar.ogg', 50, 1)
user << "\blue You remove the proximity sensor."
new /obj/item/device/assembly/prox_sensor( src.loc, 1 )
motion = 0
if(istype(W, /obj/item/stack/sheet/glass))
if(W:amount >= 1)
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
if(do_after(user, 20))
W:use(1)
user << "\blue You put in the glass lens."
src.state = 5
if(5)
if(istype(W, /obj/item/weapon/crowbar))
playsound(src.loc, 'Crowbar.ogg', 50, 1)
user << "\blue You remove the glass lens."
src.state = 4
new /obj/item/stack/sheet/glass( src.loc, 2 )
if(istype(W, /obj/item/weapon/screwdriver))
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
user << "\blue You connect the lense."
var/B
if(motion == 1)
B = new /obj/machinery/camera/motion( src.loc )
else
B = new /obj/machinery/camera( src.loc )
B:network = "SS13"
B:network = input(usr, "Which network would you like to connect this camera to?", "Set Network", "SS13")
direct = input(user, "Direction?", "Assembling Camera", null) in list( "NORTH", "EAST", "SOUTH", "WEST" )
B:dir = text2dir(direct)
del(src)
afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
if (istype(target, /obj/item/weapon/storage)) return ..()
if (istype(target, /obj/item/weapon/gun/grenadelauncher)) return ..()
if (!src.state && stage == 2 && !crit_fail && src.loc != target.loc)
user << "\red You prime the grenade! 3 seconds!"
message_admins("[key_name_admin(user)] used a chemistry grenade ([src.name]).")
log_game("[key_name_admin(user)] used a chemistry grenade ([src.name]).")
src.state = 1
src.icon_state = initial(icon_state)+"_armed"
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
spawn(30)
explode()
user.drop_item()
var/t = (isturf(target) ? target : target.loc)
walk_towards(src, t, 3)
else if(crit_fail)
user << "\red This grenade is a dud and unusable!"
attack_self(mob/user as mob)
if (!src.state && stage == 2 && !crit_fail)
user << "\red You prime the grenade! 3 seconds!"
message_admins("[key_name_admin(user)] used a chemistry grenade ([src.name]).")
log_game("[key_name_admin(user)] used a chemistry grenade ([src.name]).")
src.state = 1
src.icon_state = initial(icon_state)+"_armed"
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
spawn(30)
explode()
else if(crit_fail)
user << "\red This grenade is a dud and unusable!"
attack_hand()
walk(src,0)
return ..()
attack_paw()
return attack_hand()
proc
explode()
if(prob(reliability))
var/has_reagents = 0
for(var/obj/item/weapon/reagent_containers/glass/G in beakers)
if(G.reagents.total_volume) has_reagents = 1
if(!has_reagents)
playsound(src.loc, 'Screwdriver2.ogg', 50, 1)
state = 0
return
playsound(src.loc, 'bamf.ogg', 50, 1)
for(var/obj/item/weapon/reagent_containers/glass/G in beakers)
G.reagents.trans_to(src, G.reagents.total_volume)
if(src.reagents.total_volume) //The possible reactions didnt use up all reagents.
var/datum/effect/effect/system/steam_spread/steam = new /datum/effect/effect/system/steam_spread()
steam.set_up(10, 0, get_turf(src))
steam.attach(src)
steam.start()
for(var/atom/A in view(affected_area, src.loc))
if( A == src ) continue
src.reagents.reaction(A, 1, 10)
invisibility = INVISIBILITY_MAXIMUM //Why am i doing this?
spawn(50) //To make sure all reagents can work
del(src) //correctly before deleting the grenade.
else
icon_state = initial(icon_state) + "_locked"
crit_fail = 1
for(var/obj/item/weapon/reagent_containers/glass/G in beakers)
G.loc = get_turf(src.loc)
/obj/item/weapon/chem_grenade/large
name = "Large Chem Grenade"
desc = "An oversized grenade that affects a larger area."
icon_state = "large_grenade"
allowed_containers = list("/obj/item/weapon/reagent_containers/glass")
origin_tech = "combat=3;materials=3"
affected_area = 4
/obj/item/weapon/chem_grenade/metalfoam
name = "Metal-Foam Grenade"
desc = "Used for emergency sealing of air breaches."
path = 1
stage = 2
New()
..()
var/obj/item/weapon/reagent_containers/glass/beaker/B1 = new(src)
var/obj/item/weapon/reagent_containers/glass/beaker/B2 = new(src)
B1.reagents.add_reagent("aluminum", 30)
B2.reagents.add_reagent("foaming_agent", 10)
B2.reagents.add_reagent("pacid", 10)
beakers += B1
beakers += B2
icon_state = "chemg_locked"
/obj/item/weapon/chem_grenade/incendiary
name = "Incendiary Grenade"
desc = "Used for clearing rooms of living things."
path = 1
stage = 2
New()
..()
var/obj/item/weapon/reagent_containers/glass/beaker/B1 = new(src)
var/obj/item/weapon/reagent_containers/glass/beaker/B2 = new(src)
B1.reagents.add_reagent("aluminum", 25)
B2.reagents.add_reagent("plasma", 25)
B2.reagents.add_reagent("sacid", 25)
beakers += B1
beakers += B2
icon_state = "chemg_locked"
/obj/item/weapon/chem_grenade/cleaner
name = "Cleaner Grenade"
desc = "BLAM!-brand foaming space cleaner. In a special applicator for rapid cleaning of wide areas."
stage = 2
path = 1
New()
..()
var/obj/item/weapon/reagent_containers/glass/beaker/B1 = new(src)
var/obj/item/weapon/reagent_containers/glass/beaker/B2 = new(src)
B1.reagents.add_reagent("fluorosurfactant", 40)
B2.reagents.add_reagent("water", 40)
B2.reagents.add_reagent("cleaner", 10)
beakers += B1
beakers += B2
icon_state = "chemg_locked"*/
/obj/effect/syringe_gun_dummy
name = ""
desc = ""
@@ -1,3 +1,4 @@
/mob/living/carbon
var/silent = null //Can't talk. Value goes down every life proc.
var/last_eating = 0 //Not sure what this does... I found it hidden in food.dm