Scavenging element.
This commit is contained in:
@@ -483,7 +483,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/landmark/start/new_player)
|
||||
if(!SSmapping.station_room_templates[t])
|
||||
log_world("Station room spawner placed at ([T.x], [T.y], [T.z]) has invalid ruin name of \"[t]\" in its list")
|
||||
templates -= t
|
||||
template_name = pickweightAllowZero(templates)
|
||||
template_name = pickweight(templates, 0)
|
||||
if(!template_name)
|
||||
GLOB.stationroom_landmarks -= src
|
||||
qdel(src)
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Loot piles structures, somewhat inspired from Polaris 13 ones but without the one search per pile ckey/mind restriction
|
||||
* because the actual code is located its own element and has enough variables already. the piles themselves merely cosmetical.
|
||||
*/
|
||||
/obj/structure/loot_pile
|
||||
name = "pile of junk"
|
||||
desc = "Lots of junk lying around. They say one man's trash is another man's treasure."
|
||||
icon = 'icons/obj/loot_piles.dmi'
|
||||
density = FALSE
|
||||
anchored = TRUE
|
||||
var/loot_amount = 5
|
||||
var/delete_on_depletion = FALSE
|
||||
var/can_use_hands = TRUE
|
||||
var/scavenge_time = 12 SECONDS
|
||||
var/allowed_tools = list(TOOL_SHOVEL = 0.6) //list of tool_behaviours with associated speed multipliers (lower is better)
|
||||
var/icon_states_to_use = list("junk_pile1", "junk_pile2", "junk_pile3", "junk_pile4", "junk_pile5")
|
||||
var/list/loot = list(
|
||||
SCAVENGING_FOUND_NOTHING = 50,
|
||||
SCAVENGING_SPAWN_MOUSE = 10,
|
||||
SCAVENGING_SPAWN_MICE = 5,
|
||||
SCAVENGING_SPAWN_TOM = 1,
|
||||
/obj/item/flashlight/flare = 10,
|
||||
/obj/item/flashlight/glowstick = 10,
|
||||
/obj/item/flashlight/glowstick/blue = 10,
|
||||
/obj/item/flashlight/glowstick/orange = 10,
|
||||
/obj/item/flashlight/glowstick/red = 10,
|
||||
/obj/item/flashlight/glowstick/yellow = 10,
|
||||
/obj/item/clothing/mask/gas = 5,
|
||||
/obj/item/clothing/mask/breath = 10,
|
||||
/obj/item/storage/box = 10,
|
||||
/obj/item/clothing/shoes/galoshes = 2,
|
||||
/obj/item/clothing/shoes/sneakers/black = 10,
|
||||
/obj/item/clothing/gloves/color/fyellow = 5,
|
||||
/obj/item/clothing/gloves/color/yellow = 2,
|
||||
/obj/item/clothing/glasses/sunglasses = 3,
|
||||
/obj/item/clothing/glasses/meson = 3,
|
||||
/obj/item/clothing/glasses/welding = 3,
|
||||
/obj/item/clothing/head/hardhat = 10,
|
||||
/obj/item/clothing/head/ushanka = 10,
|
||||
/obj/item/clothing/head/welding = 5,
|
||||
/obj/item/clothing/suit/hazardvest = 10,
|
||||
/obj/item/clothing/under/syndicate/tacticool = 5,
|
||||
/obj/item/clothing/under/pants/camo = 10,
|
||||
/obj/item/stack/spacecash/c10 = 20,
|
||||
/obj/item/stack/spacecash/c20 = 20,
|
||||
/obj/item/stack/spacecash/c50 = 20,
|
||||
/obj/item/radio/headset = 10)
|
||||
|
||||
/*
|
||||
* Associated values in this list are not weights but numbers of times the kery can be rolled
|
||||
* before being removed from ALL piles with same kind. This is why I wanted 'scavenging' to be an element and not a component.
|
||||
*/
|
||||
var/list/unique_loot = list(/obj/item/clothing/gloves/color/yellow = 2, SCAVENGING_SPAWN_TOM = 1)
|
||||
|
||||
/obj/structure/loot_pile/Initialize()
|
||||
. = ..()
|
||||
icon_state = pick(icon_states_to_use)
|
||||
|
||||
/obj/structure/loot_pile/ComponentInitialize()
|
||||
. = ..()
|
||||
AddElement(/datum/element/scavenging, loot_amount, loot, unique_loot, scavenge_time, can_use_hands, allowed_tools, null, delete_on_depletion)
|
||||
|
||||
/obj/structure/loot_pile/infinite
|
||||
name = "endless pile of junk."
|
||||
desc = "Lots of awful code lying around. They don't say one coder's trash is another coder's treasure though..."
|
||||
loot_amount = INFINITY
|
||||
Reference in New Issue
Block a user