From 6ada64082b4a3344905047bb27ac95bf8fccb1b2 Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Wed, 31 May 2017 16:03:34 -0400 Subject: [PATCH] Adds Trash Piles Replaces some lockers and racks in maintenance with trash piles. They are presistent loot piles for people who just can't help but greytide. It allows people who join later in the shift to still get goodies. Each is searchable once per shift by each ckey. They have three loot lists: alpha, beta, and gamma. Alpha has the highest chance and just random maint stuff. All usable items (no random empty beer cans) but nothing you couldn't find elsewhere. Beta has a lower chance of spawning and is usually contraband, mechaically useful stuff. Radio jammers and the like. Gamma is dangerous or highly illegal contraband, and is unique. Guns (nonlethal!), teleporters, syndicate IDs, etc. Gamma items have special handling: all of the trash piles share a gamma list, and when an item is given out from the gamma list to someone, it's de-pooled so that another trash pile won't hand it out. The pile-collective maintains a reference to it as an 'allocated' gamma item though. Then, when the gamma list runs out, it reviews allocated gamma items to find any that it might be able to 're'-distribute. Namely ones that have been deleted, or are in cryopod computers because the user left with them. It can then hand that item out again. If it cannot hand out a new gamma item, it gives beta instead. You can also just manually put gamma-list items back into the piles if you're leaving. Or, if you find a translocator, but already made yourself one in R&D (or later make one), or you're the RD and find a bluespace harpoon, you can stuff the translocator/whatever back into any trash pile and it'll be re-pooled into all of them. You can only return gamma items this way, not beta/alpha. Additionally, if you find yourself playing a simple animal mob for an event (or you're a mouse), you can hide in trash piles by clicking them. There's a 50% chance you're revealed if the pile is searched. You can climb out by clicking the pile again. I dunno if that'll ever get used but it was easy to code, so eh. --- code/game/machinery/cryopod.dm | 2 +- code/game/objects/random/random_vr.dm | 22 +- code/game/objects/structures/trash_pile.dm | 238 ++++++++++++++++ .../projectiles/guns/projectile/dartgun.dm | 2 +- icons/obj/trash_piles.dmi | Bin 0 -> 1588 bytes maps/tether/tether-01-surface.dmm | 258 +++++++++--------- maps/tether/tether-03-station.dmm | 151 +++++----- vorestation.dme | 1 + 8 files changed, 451 insertions(+), 223 deletions(-) create mode 100644 code/game/objects/structures/trash_pile.dm create mode 100644 icons/obj/trash_piles.dmi diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index a11e94c451..6f9c37ef66 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -432,7 +432,7 @@ else if(control_computer && control_computer.allow_items) control_computer.frozen_items += W - W.loc = null + W.loc = control_computer //VOREStation Edit else W.forceMove(src.loc) diff --git a/code/game/objects/random/random_vr.dm b/code/game/objects/random/random_vr.dm index 072b853445..cad9efe36e 100644 --- a/code/game/objects/random/random_vr.dm +++ b/code/game/objects/random/random_vr.dm @@ -157,16 +157,12 @@ prob(2);/obj/item/weapon/reagent_containers/syringe/drugs, prob(1);/obj/item/weapon/reagent_containers/syringe/steroid) -/obj/random_multi/single_item/teleport - name = "Multi Point - Random Teleport Item" - id = "Single Teleporter" - item_path = null - - New() - item_path = pick(list(/obj/item/device/perfect_tele,/obj/item/weapon/bluespace_harpoon)) - ..() - -/obj/random_multi/single_item/netgun - name = "Multi Point - Random Hunter Netgun" - id = "Single Netgun" - item_path = /obj/item/weapon/gun/energy/netgun +//A random thing so that the spawn_nothing_percentage can be used w/o duplicating code. +/obj/random/trash_pile + name = "Random Trash Pile" + desc = "Hot Garbage." + icon = 'icons/obj/trash_piles.dmi' + icon_state = "randompile" + spawn_nothing_percentage = 0 +/obj/random/trash_pile/item_to_spawn() + return /obj/structure/trash_pile \ No newline at end of file diff --git a/code/game/objects/structures/trash_pile.dm b/code/game/objects/structures/trash_pile.dm new file mode 100644 index 0000000000..434b4cc852 --- /dev/null +++ b/code/game/objects/structures/trash_pile.dm @@ -0,0 +1,238 @@ +/obj/structure/trash_pile + name = "trash pile" + desc = "A heap of garbage, but maybe there's something interesting inside?" + icon = 'icons/obj/trash_piles.dmi' + icon_state = "randompile" + density = 1 + anchored = 1.0 + + var/list/searchedby = list()// Characters that have searched this trashpile, with values of searched time. + var/mob/living/hider // A simple animal that might be hiding in the pile + + var/chance_alpha = 79 // Alpha list is junk items and normal random stuff. + var/chance_beta = 20 // Beta list is actually maybe some useful illegal items. If it's not alpha or gamma, it's beta. + var/chance_gamma = 1 // Gamma list is unique items only, and will only spawn one of each. This is a sub-chance of beta chance. + + //These are types that can only spawn once, and then will be removed from this list. + //Alpha and beta lists are in their respective procs. + var/global/list/unique_gamma = list( + /obj/item/device/perfect_tele, + /obj/item/weapon/bluespace_harpoon, + /obj/item/weapon/gun/energy/netgun, + /obj/item/weapon/card/id/syndicate, + /obj/item/weapon/moneybag/vault, + /obj/item/weapon/permit, + /obj/item/weapon/gun/projectile/dartgun + ) + + var/global/list/allocated_gamma = list() + +/obj/structure/trash_pile/initialize() + ..() + icon_state = pick("pile1","pile2","pilechair","piletable","pilevending") + +/obj/structure/trash_pile/attackby(obj/item/W as obj, mob/user as mob) + var/w_type = W.type + if(w_type in allocated_gamma) + to_chat(user,"You feel \the [W] slip from your hand, and disappear into the trash pile.") + user.unEquip(W) + W.forceMove(src) + allocated_gamma -= w_type + unique_gamma += w_type + qdel(W) + + else + return ..() + +/obj/structure/trash_pile/attack_generic(mob/user) + //Simple Animal + if(isanimal(user)) + var/mob/living/L = user + //They're in it, and want to get out. + if(L.loc == src) + var/choice = alert("Do you want to exit \the [src]?","Un-Hide?","Exit","Stay") + if(choice == "Exit") + if(L == hider) + hider = null + L.forceMove(get_turf(src)) + else if(!hider) + var/choice = alert("Do you want to hide in \the [src]?","Un-Hide?","Hide","Stay") + if(choice == "Hide" && !hider) //Check again because PROMPT + L.forceMove(src) + hider = L + else + return ..() + +/obj/structure/trash_pile/attack_hand(mob/user) + //Human mob + if(ishuman(user)) + var/mob/living/carbon/human/H = user + H.visible_message("[user] searches through \the [src].","You search through \the [src].") + if(hider) + to_chat(hider,"[user] is searching the trash pile you're in!") + + //Do the searching + if(do_after(user,rand(4 SECONDS,6 SECONDS),src)) + + //If there was a hider, chance to reveal them + if(hider && prob(50)) + to_chat(hider,"You've been discovered!") + hider.forceMove(get_turf(src)) + hider = null + to_chat(user,"Some sort of creature leaps out of \the [src]!") + + //You already searched this one bruh + else if(user.ckey in searchedby) + to_chat(H,"There's nothing else for you in \the [src]!") + + //You found an item! + else + var/luck = rand(1,100) + var/obj/item/I + if(luck <= chance_alpha) + I = produce_alpha_item() + else if(luck <= chance_alpha+chance_beta) + I = produce_beta_item() + else if(luck <= chance_alpha+chance_beta+chance_gamma) + I = produce_gamma_item() + + //We either have an item to hand over or we don't, at this point! + if(I) + searchedby += user.ckey + I.forceMove(get_turf(src)) + to_chat(H,"You found \a [I]!") + + else + return ..() + +//Random lists +/obj/structure/trash_pile/proc/produce_alpha_item() + var/path = pick(prob(4);/obj/item/broken_device, + prob(2);/obj/item/weapon/contraband/poster, + prob(2);/obj/item/device/flashlight/flare, + prob(2);/obj/item/device/flashlight/glowstick, + prob(2);/obj/item/device/flashlight/glowstick/blue, + prob(1);/obj/item/device/flashlight/glowstick/orange, + prob(1);/obj/item/device/flashlight/glowstick/red, + prob(1);/obj/item/device/flashlight/glowstick/yellow, + prob(1);/obj/item/device/flashlight/pen, + prob(4);/obj/item/weapon/cell, + prob(4);/obj/item/weapon/cell/device, + prob(3);/obj/item/weapon/cell/high, + prob(2);/obj/item/weapon/cell/super, + prob(5);/obj/random/cigarettes, + prob(3);/obj/item/clothing/mask/gas, + prob(2);/obj/item/clothing/mask/gas/half, + prob(4);/obj/item/clothing/mask/breath, + prob(2);/obj/item/weapon/reagent_containers/glass/rag, + prob(4);/obj/item/weapon/reagent_containers/food/snacks/liquidfood, + prob(2);/obj/item/weapon/storage/secure/briefcase, + prob(4);/obj/item/weapon/storage/briefcase, + prob(5);/obj/item/weapon/storage/backpack, + prob(5);/obj/item/weapon/storage/backpack/satchel/norm, + prob(4);/obj/item/weapon/storage/backpack/satchel, + prob(3);/obj/item/weapon/storage/backpack/dufflebag, + prob(1);/obj/item/weapon/storage/backpack/dufflebag/syndie, + prob(5);/obj/item/weapon/storage/box, + prob(3);/obj/item/weapon/storage/box/donkpockets, + prob(2);/obj/item/weapon/storage/box/sinpockets, + prob(1);/obj/item/weapon/storage/box/cups, + prob(3);/obj/item/weapon/storage/box/mousetraps, + prob(3);/obj/item/weapon/storage/box/engineer, + prob(3);/obj/item/weapon/storage/wallet, + prob(1);/obj/item/device/paicard, + prob(2);/obj/item/clothing/shoes/galoshes, + prob(1);/obj/item/clothing/shoes/syndigaloshes, + prob(4);/obj/item/clothing/shoes/black, + prob(4);/obj/item/clothing/shoes/laceup, + prob(4);/obj/item/clothing/shoes/black, + prob(4);/obj/item/clothing/shoes/leather, + prob(1);/obj/item/clothing/gloves/yellow, + prob(3);/obj/item/clothing/gloves/botanic_leather, + prob(2);/obj/item/clothing/gloves/sterile/latex, + prob(5);/obj/item/clothing/gloves/white, + prob(5);/obj/item/clothing/gloves/rainbow, + prob(2);/obj/item/clothing/gloves/fyellow, + prob(1);/obj/item/clothing/glasses/sunglasses, + prob(3);/obj/item/clothing/glasses/meson, + prob(2);/obj/item/clothing/glasses/meson/prescription, + prob(1);/obj/item/clothing/glasses/welding, + prob(1);/obj/item/clothing/head/bio_hood/general, + prob(4);/obj/item/clothing/head/hardhat, + prob(3);/obj/item/clothing/head/hardhat/red, + prob(1);/obj/item/clothing/head/ushanka, + prob(2);/obj/item/clothing/head/welding, + prob(4);/obj/item/clothing/suit/storage/hazardvest, + prob(1);/obj/item/clothing/suit/space/emergency, + prob(3);/obj/item/clothing/suit/storage/toggle/bomber, + prob(1);/obj/item/clothing/suit/bio_suit/general, + prob(3);/obj/item/clothing/suit/storage/toggle/hoodie/black, + prob(3);/obj/item/clothing/suit/storage/toggle/hoodie/blue, + prob(3);/obj/item/clothing/suit/storage/toggle/hoodie/red, + prob(3);/obj/item/clothing/suit/storage/toggle/hoodie/yellow, + prob(3);/obj/item/clothing/suit/storage/toggle/brown_jacket, + prob(3);/obj/item/clothing/suit/storage/toggle/leather_jacket, + prob(1);/obj/item/clothing/suit/storage/vest/press, + prob(3);/obj/item/clothing/suit/storage/apron, + prob(4);/obj/item/clothing/under/color/grey, + prob(2);/obj/item/clothing/under/syndicate/tacticool, + prob(2);/obj/item/clothing/under/pants/camo, + prob(1);/obj/item/clothing/under/harness, + prob(1);/obj/item/clothing/under/tactical, + prob(3);/obj/item/clothing/accessory/storage/webbing, + prob(4);/obj/item/weapon/spacecash/c1, + prob(3);/obj/item/weapon/spacecash/c10, + prob(3);/obj/item/weapon/spacecash/c20, + prob(1);/obj/item/weapon/spacecash/c50, + prob(1);/obj/item/weapon/spacecash/c100, + prob(3);/obj/item/weapon/camera_assembly, + prob(4);/obj/item/weapon/caution, + prob(3);/obj/item/weapon/caution/cone, + prob(2);/obj/item/weapon/card/emag_broken, + prob(1);/obj/item/weapon/card/emag, + prob(2);/obj/item/device/camera, + prob(3);/obj/item/device/pda, + prob(3);/obj/item/device/radio/headset) + + var/obj/item/I = new path() + return I + +/obj/structure/trash_pile/proc/produce_beta_item() + var/path = pick(prob(6);/obj/item/weapon/storage/pill_bottle/tramadol, + prob(4);/obj/item/weapon/storage/pill_bottle/happy, + prob(4);/obj/item/weapon/storage/pill_bottle/zoom, + prob(4);/obj/item/weapon/material/butterfly, + prob(2);/obj/item/weapon/material/butterfly/switchblade, + prob(2);/obj/item/weapon/material/knuckledusters, + prob(1);/obj/item/weapon/material/hatchet/tacknife, + prob(1);/obj/item/clothing/suit/storage/vest/heavy/merc, + prob(1);/obj/item/weapon/beartrap, + prob(1);/obj/item/weapon/handcuffs/fuzzy, + prob(1);/obj/item/weapon/legcuffs, + prob(2);/obj/item/weapon/reagent_containers/syringe/drugs, + prob(1);/obj/item/weapon/reagent_containers/syringe/steroid, + prob(4);/obj/item/device/radio_jammer, + prob(2);/obj/item/weapon/storage/box/syndie_kit/spy, + prob(2);/obj/item/weapon/grenade/anti_photon, + prob(1);/obj/item/weapon/cell/hyper/empty) + + var/obj/item/I = new path() + return I + +/obj/structure/trash_pile/proc/produce_gamma_item() + var/path = pick_n_take(unique_gamma) + if(!path) //Tapped out, reallocate? + for(var/P in allocated_gamma) + var/obj/item/I = allocated_gamma[P] + if(!I || istype(I.loc,/obj/machinery/computer/cryopod) || I.gcDestroyed) + allocated_gamma -= P + path = P + break + + if(path) + var/obj/item/I = new path() + allocated_gamma[path] = I + return I + else + return produce_beta_item() + diff --git a/code/modules/projectiles/guns/projectile/dartgun.dm b/code/modules/projectiles/guns/projectile/dartgun.dm index 8c64b297d1..c998e152f1 100644 --- a/code/modules/projectiles/guns/projectile/dartgun.dm +++ b/code/modules/projectiles/guns/projectile/dartgun.dm @@ -62,7 +62,7 @@ var/container_type = /obj/item/weapon/reagent_containers/glass/beaker var/list/starting_chems = null -/obj/item/weapon/gun/projectile/dartgun/dartgun/New() +/obj/item/weapon/gun/projectile/dartgun/New() //VOREStation Edit - Think this was a typo ..() if(starting_chems) for(var/chem in starting_chems) diff --git a/icons/obj/trash_piles.dmi b/icons/obj/trash_piles.dmi new file mode 100644 index 0000000000000000000000000000000000000000..e1b3527c652892d3eb5ed84fc7771631a307b4ce GIT binary patch literal 1588 zcmV-42Fv-0P) zae#;b9C(bJGc*6}>)(%bWB&j%sE&YuaB3qQ7-j$z&&{vB$Ihp;zK@@+oRoubgqC}A zVq3(-qjF9&G)-JyiC$x-oSnRzj89%yN=P{|d2K#sFpGWw0004WQchCV=-0C=2JR&a84_w-Y6@%7{?OD!tS%+FJ>RWQ*r;NmRLOex6# za*U0*I5Sc+(=$pSoZ^zil2jm5sVFfoB|op^*4;psmy+=^+3kaQbcAHdZ(O+iOSw zfX3)hHwl1V2EhKL*47ibX(oacmDH*Ht%saOaa2`igCyKaMa{%in(H$?L z4S?mm036bVh6Y&T6(9uK3u;-TMo+Qh&zDh!4({+<05t>F;Xw$fW1PQuuXwUYe%Ilb zHUWTufb&E1FA4(G>+URz6m_zvsB@j&Ir^7?)0Y5-K{h)J;1s^Zei(*a@B5z3>Foue z4g|o_!$G!dGyszU>f<=Fez1B^aq=++i46c+j0hM<9IgN`8IX=ntb3~qKw~(c59jka zha>?ymqsr~xfg8jmGni)ysv zWtocq6cL&3*qqutoU>SS@Rdt|2>~uQ;2lo^sE>v2;~Fgi>Hgrc>eNBWpeF#1_txJ@ zhuJ?SV0156f*X$NOmRF8832GRVh;d(30QSk=UtI9{0|BGbcW$?Xoa5u z@AYIG!|lX4?kS(??xp+x@m~&j|CPUq_11!`km6qeKy>F#Q6Qf@^?eo~0JWzr^Ku#S zZ}39^&H$X+({`hPAL@+(^btTc`Z$H_b{K$DKp!J^`ok2ixBLBuuRJmWr7$M@UUy}) zyk7aU`|V~J^Gt*y1qEoMKL^Za{&S2H;4(nW!0Yj`sDBVp4a*26LV2Sfbge<0Y&RGg#zXAZ44Fc|S z1pHG1(A;C$ziIOLTEe3MM9*d1VCqL0;EGw1Hcd7afvEOo6H@M z`rj6x1Ykm%0RkwgT>uz@ z`FKs|GC2`qNfhvSJifm@oumZ-Xx=7(D*-V!u4Drkxe>8MxQwXjmw5MV