Merge pull request #3154 from CHOMPStationBot/upstream-merge-11665

[MIRROR] the part printing buff nobody asked for
This commit is contained in:
Nadyr
2021-10-27 21:18:25 -04:00
committed by GitHub
8 changed files with 187 additions and 22 deletions

View File

@@ -298,8 +298,10 @@
/obj/item/weapon/storage/part_replacer
name = "rapid part exchange device"
desc = "A special mechanical module made to store, sort, and apply standard machine parts."
icon = 'icons/obj/storage_vr.dmi'
icon_state = "RPED"
item_icons = list(slot_l_hand_str = 'icons/vore/custom_items_left_hand_yw.dmi', slot_r_hand_str = 'icons/vore/custom_items_right_hand_yw.dmi') //YW add - RPED sprite
item_state = "RPED"
w_class = ITEMSIZE_HUGE
can_hold = list(/obj/item/weapon/stock_parts)
storage_slots = 50
@@ -313,34 +315,69 @@
drop_sound = 'sound/items/drop/device.ogg'
pickup_sound = 'sound/items/pickup/device.ogg'
var/panel_req = TRUE
var/pshoom_or_beepboopblorpzingshadashwoosh = 'sound/items/rped.ogg'
var/reskin_ran = FALSE
var/unique_reskin = list("Soulless" = "RPED",
"Soulful" = "RPED_old")
/obj/item/weapon/storage/part_replacer/proc/play_rped_sound()
//Plays the sound for RPED exhanging or installing parts.
/* if(alt_sound && prob(1))
playsound(src, alt_sound, 40, 1)
else
*/
playsound(src, pshoom_or_beepboopblorpzingshadashwoosh, 40, 1)
/obj/item/weapon/storage/part_replacer/adv
name = "advanced rapid part exchange device"
desc = "A special mechanical module made to store, sort, and apply standard machine parts. This one has a greatly upgraded storage capacity."
icon_state = "RPED"
w_class = ITEMSIZE_HUGE
//YAWN Changes
can_hold = list(
/obj/item/weapon/cell,
/obj/item/weapon/stock_parts,
/obj/item/weapon/reagent_containers/glass/beaker)
//End of YAWN Changes
desc = "A special mechanical module made to store, sort, and apply standard machine parts. This one has a greatly upgraded storage capacity, \
and the ability to hold beakers."
can_hold = list(/obj/item/weapon/stock_parts, /obj/item/weapon/reagent_containers/glass/beaker)
storage_slots = 200
use_to_pickup = TRUE
allow_quick_gather = 1
allow_quick_empty = 1
collection_mode = 1
display_contents_with_number = 1
max_w_class = ITEMSIZE_NORMAL
max_storage_space = 400
/obj/item/weapon/storage/part_replacer/adv/discount_bluespace
name = "discount bluespace rapid part exchange device"
desc = "A special mechanical module made to store, sort, and apply standard machine parts. This one has a further increased storage capacity, \
name = "prototype bluespace rapid part exchange device"
icon_state = "DBRPED"
item_state = "DBRPED"
desc = "A special mechanical module made to store, sort, and apply standard machine parts. This one has a further increased storage capacity, \
and the ability to work on machines with closed maintenance panels."
storage_slots = 400
max_storage_space = 800
panel_req = FALSE
pshoom_or_beepboopblorpzingshadashwoosh = 'sound/items/pshoom.ogg'
unique_reskin = list("Soulless" = "DBRPED",
"Soulful" = "DBRPED_old")
/obj/item/weapon/storage/part_replacer/examine(mob/user)
. = ..()
if(!reskin_ran)
. += "<span class='notice'>[src]'s external casing can be modified via alt-click.</span>"
/obj/item/weapon/storage/part_replacer/AltClick(mob/user)
. = ..()
if(!reskin_ran)
reskin_radial(user)
/obj/item/weapon/storage/part_replacer/proc/reskin_radial(mob/M)
if(!LAZYLEN(unique_reskin))
return
var/list/items = list()
for(var/reskin_option in unique_reskin)
var/image/item_image = image(icon = src.icon, icon_state = unique_reskin[reskin_option])
items += list("[reskin_option]" = item_image)
sortList(items)
var/pick = show_radial_menu(M, src, items, radius = 38, require_near = TRUE)
if(!pick)
return
if(!unique_reskin[pick])
return
icon_state = unique_reskin[pick]
item_state = unique_reskin[pick]
reskin_ran = TRUE
to_chat(M, "[src] is now '[pick].'")
/obj/item/weapon/storage/part_replacer/drop_contents() // hacky-feeling tier-based drop system
hide_from(usr)
@@ -350,6 +387,7 @@
* Why not just use the stock part's rating variable?
* Future-proofing for a potential future where stock parts aren't the only thing that can fit in an RPED.
* see: /tg/ and /vg/'s RPEDs fitting power cells, beakers, etc.
* 10/8/21 edit - It's Time.
*/
for(var/obj/item/B in contents)
if(B.rped_rating() < lowest_rating)
@@ -358,7 +396,7 @@
if(B.rped_rating() > lowest_rating)
continue
remove_from_storage(B, T)
/obj/item/weapon/stock_parts
name = "stock part"
desc = "What?"
@@ -384,6 +422,7 @@
desc = "Used in the construction of computers and other devices with a interactive console."
icon_state = "screen"
origin_tech = list(TECH_MATERIAL = 1)
rating = 5 // these are actually Really Important for some things??
matter = list(MAT_GLASS = 200)
/obj/item/weapon/stock_parts/capacitor
@@ -698,3 +737,72 @@
icon_state = "spring"
origin_tech = list(TECH_ENGINEERING = 1)
matter = list(MAT_STEEL = 40)
/obj/effect/spawner/parts
name = "nondescript parts bundle that shouldn't exist"
desc = "this qdels itself lol! if you're reading this you're codediving or Someone fucked up"
var/list/items
/obj/effect/spawner/parts/Initialize(mapload)
..()
if(items && items.len)
var/turf/T = get_turf(src)
for(var/path in items)
for(var/i in 1 to 5)
new path(T)
return INITIALIZE_HINT_QDEL
/obj/effect/spawner/parts/t1
name = "basic parts bundle"
desc = "5 of each T1 part, no more and no less."
items = list(
/obj/item/weapon/stock_parts/matter_bin,
/obj/item/weapon/stock_parts/manipulator,
/obj/item/weapon/stock_parts/capacitor,
/obj/item/weapon/stock_parts/scanning_module,
/obj/item/weapon/stock_parts/micro_laser
)
/obj/effect/spawner/parts/t2
name = "advanced parts bundle"
desc = "5 of each T2 part, no more and no less."
items = list(
/obj/item/weapon/stock_parts/matter_bin/adv,
/obj/item/weapon/stock_parts/manipulator/nano,
/obj/item/weapon/stock_parts/capacitor/adv,
/obj/item/weapon/stock_parts/scanning_module/adv,
/obj/item/weapon/stock_parts/micro_laser/high
)
/obj/effect/spawner/parts/t3
name = "super parts bundle"
desc = "5 of each T3 part, no more and no less."
items = list(
/obj/item/weapon/stock_parts/matter_bin/super,
/obj/item/weapon/stock_parts/manipulator/pico,
/obj/item/weapon/stock_parts/capacitor/super,
/obj/item/weapon/stock_parts/scanning_module/phasic,
/obj/item/weapon/stock_parts/micro_laser/ultra
)
/obj/effect/spawner/parts/t4
name = "hyper parts bundle"
desc = "5 of each T4 part, no more and no less."
items = list(
/obj/item/weapon/stock_parts/matter_bin/hyper,
/obj/item/weapon/stock_parts/manipulator/hyper,
/obj/item/weapon/stock_parts/capacitor/hyper,
/obj/item/weapon/stock_parts/scanning_module/hyper,
/obj/item/weapon/stock_parts/micro_laser/hyper
)
/obj/effect/spawner/parts/t5
name = "omni parts bundle"
desc = "5 of each T5 part, no more and no less."
items = list(
/obj/item/weapon/stock_parts/matter_bin/omni,
/obj/item/weapon/stock_parts/manipulator/omni,
/obj/item/weapon/stock_parts/capacitor/omni,
/obj/item/weapon/stock_parts/scanning_module/omni,
/obj/item/weapon/stock_parts/micro_laser/omni
)

View File

@@ -330,6 +330,7 @@ Class Procs:
return C
/obj/machinery/proc/default_part_replacement(var/mob/user, var/obj/item/weapon/storage/part_replacer/R)
var/parts_replaced = FALSE
if(!istype(R))
return 0
if(!component_parts)
@@ -340,23 +341,26 @@ Class Procs:
if(panel_open || !R.panel_req)
var/obj/item/weapon/circuitboard/CB = circuit
var/P
for(var/obj/item/weapon/stock_parts/A in component_parts)
for(var/obj/item/A in component_parts)
for(var/T in CB.req_components)
if(ispath(A.type, T))
P = T
break
for(var/obj/item/weapon/stock_parts/B in R.contents)
for(var/obj/item/B in R.contents)
if(istype(B, P) && istype(A, P))
if(B.rating > A.rating)
if(B.get_rating() > A.get_rating())
R.remove_from_storage(B, src)
R.handle_item_insertion(A, 1)
component_parts -= A
component_parts += B
B.loc = null
to_chat(user, "<span class='notice'>[A.name] replaced with [B.name].</span>")
parts_replaced = TRUE
break
update_icon()
RefreshParts()
if(parts_replaced)
R.play_rped_sound()
return 1
// Default behavior for wrenching down machines. Supports both delay and instant modes.

View File

@@ -162,6 +162,10 @@
matter = list(MAT_GLASS = 500)
drop_sound = 'sound/items/drop/glass.ogg'
pickup_sound = 'sound/items/pickup/glass.ogg'
var/rating = 1
/obj/item/weapon/reagent_containers/glass/beaker/get_rating()
return rating
/obj/item/weapon/reagent_containers/glass/beaker/Initialize()
. = ..()
@@ -216,6 +220,7 @@
amount_per_transfer_from_this = 10
possible_transfer_amounts = list(5,10,15,25,30,60,120)
flags = OPENCONTAINER
rating = 3
/obj/item/weapon/reagent_containers/glass/beaker/noreact
name = "cryostasis beaker"
@@ -237,6 +242,7 @@
amount_per_transfer_from_this = 10
possible_transfer_amounts = list(5,10,15,25,30,60,120,300)
flags = OPENCONTAINER
rating = 5
/obj/item/weapon/reagent_containers/glass/beaker/vial
name = "vial"

View File

@@ -200,6 +200,42 @@
sort_string = "AAAEE"
// part bundles, because i HATE queues and i don't want to rewrite it for stack-printing
/datum/design/item/stock_part/bundle/t1
id = "parts_bundle_t1"
req_tech = list(TECH_MATERIAL = 1, TECH_DATA = 1, TECH_POWER = 1, TECH_MAGNET = 1)
materials = list(MAT_STEEL = 1100, MAT_GLASS = 450)
build_path = /obj/effect/spawner/parts/t1
sort_string = "AAAFA"
/datum/design/item/stock_part/bundle/t2
id = "parts_bundle_t2"
req_tech = list(TECH_MATERIAL = 3, TECH_DATA = 2, TECH_POWER = 3, TECH_MAGNET = 3)
materials = list(MAT_STEEL = 1100, MAT_GLASS = 450)
build_path = /obj/effect/spawner/parts/t2
sort_string = "AAAFB"
/datum/design/item/stock_part/bundle/t3
id = "parts_bundle_t3"
req_tech = list(TECH_MATERIAL = 5, TECH_DATA = 2, TECH_POWER = 5, TECH_MAGNET = 5)
materials = list(MAT_STEEL = 1100, MAT_GLASS = 450, MAT_SILVER = 50, MAT_GOLD = 100, MAT_URANIUM = 50)
build_path = /obj/effect/spawner/parts/t3
sort_string = "AAAFC"
/datum/design/item/stock_part/bundle/t4
id = "parts_bundle_t4"
req_tech = list(TECH_MATERIAL = 6, TECH_DATA = 3, TECH_POWER = 6, TECH_MAGNET = 6, TECH_ARCANE = 2)
materials = list(MAT_STEEL = 4250, MAT_GLASS = 700, MAT_SILVER = 250, MAT_URANIUM = 150, MAT_DURASTEEL = 1450, MAT_VERDANTIUM = 900)
build_path = /obj/effect/spawner/parts/t4
sort_string = "AAAFD"
/datum/design/item/stock_part/bundle/t5
id = "parts_bundle_t5"
req_tech = list(TECH_MATERIAL = 7, TECH_DATA = 4, TECH_POWER = 7, TECH_MAGNET = 7, TECH_PRECURSOR = 2)
materials = list(MAT_STEEL = 45000, MAT_PLASTEEL = 5500, MAT_GLASS = 11250, MAT_SILVER = 2500, MAT_URANIUM = 10000, MAT_DIAMOND = 5000, MAT_DURASTEEL = 2500, MAT_MORPHIUM = 2050)
build_path = /obj/effect/spawner/parts/t5
sort_string = "AAAFE"
// RPEDs
/datum/design/item/stock_part/RPED
@@ -213,9 +249,20 @@
/datum/design/item/stock_part/ARPED
name = "Advanced Rapid Part Exchange Device"
desc = "Special mechanical module made to store, sort, and apply standard machine parts. This one has a greatly upgraded storage capacity."
desc = "Special mechanical module made to store, sort, and apply standard machine parts. This one has a greatly upgraded storage capacity, \
and the ability to manipulate beakers."
id = "arped"
req_tech = list(TECH_ENGINEERING = 5, TECH_MATERIAL = 5)
materials = list(MAT_STEEL = 30000, MAT_GLASS = 10000)
build_path = /obj/item/weapon/storage/part_replacer/adv
sort_string = "ABAAB"
/datum/design/item/stock_part/PBRPED
name = "Prototype Bluespace Rapid Part Exchange Device"
desc = "Special mechanical module made to store, sort, and apply standard machine parts. This one has a remarkably upgraded storage capacity, \
and the ability to manipulate beakers."
id = "pbrped"
req_tech = list(TECH_ENGINEERING = 7, TECH_MATERIAL = 7, TECH_BLUESPACE = 5)
materials = list(MAT_STEEL = 30000, MAT_GLASS = 10000, MAT_SILVER = 5000, MAT_GOLD = 5000, MAT_DIAMOND = 1000)
build_path = /obj/item/weapon/storage/part_replacer/adv/discount_bluespace
sort_string = "ABAAB"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 27 KiB

BIN
sound/items/rped.ogg Normal file

Binary file not shown.