[MIRROR] Adds Alloy Materials (#1228)

* Adds Alloy Materials (#53623)

Adds and implements alloy materials

Takes several materials that were mostly fluff and converts them into actual usable materials.
Messes with material code a bit to make alloys recycle back into their component materials.
Adds the alloy materials to their in-game stacks.

Materials added:
    Plasteel
    Plastitanium
    Plasmaglass
    Titaniumglass
    Plastitanium Glass
    Alien Alloy

Makes plasteel/plastitanium/plasmaglass and the rest able to have separate properties from their component materials. It doesn't make much sense that the materials used to seal off the supermatter chamber from the rest of the station would be prone to exploding when heated.

Allows for further expansion of materials, possibly including actual functional metallurgy and smelting at some point in the very distant future.

(Lemons note: Adds a regeneration component, used for alien alloy)

* Adds Alloy Materials

Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
This commit is contained in:
SkyratBot
2020-10-10 00:29:56 +01:00
committed by GitHub
co-authored by TemporalOroboros
parent 6ee36d46e6
commit cae0e4cb5c
27 changed files with 397 additions and 59 deletions
+3 -3
View File
@@ -133,7 +133,7 @@
/obj/machinery/mineral/processing_unit/Initialize()
. = ..()
proximity_monitor = new(src, 1)
AddComponent(/datum/component/material_container, list(/datum/material/iron, /datum/material/glass, /datum/material/silver, /datum/material/gold, /datum/material/diamond, /datum/material/plasma, /datum/material/uranium, /datum/material/bananium, /datum/material/titanium, /datum/material/bluespace), INFINITY, TRUE, /obj/item/stack)
AddComponent(/datum/component/material_container, list(/datum/material/iron, /datum/material/glass, /datum/material/silver, /datum/material/gold, /datum/material/diamond, /datum/material/plasma, /datum/material/uranium, /datum/material/bananium, /datum/material/titanium, /datum/material/bluespace), INFINITY, TRUE, /obj/item/stack, _breakdown_flags=BREAKDOWN_FLAGS_ORE_PROCESSOR)
stored_research = new /datum/techweb/specialized/autounlocking/smelter
selected_material = SSmaterials.GetMaterialRef(/datum/material/iron)
@@ -146,11 +146,11 @@
if(QDELETED(O))
return
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
var/material_amount = materials.get_item_material_amount(O)
var/material_amount = materials.get_item_material_amount(O, BREAKDOWN_FLAGS_ORE_PROCESSOR)
if(!materials.has_space(material_amount))
unload_mineral(O)
else
materials.insert_item(O)
materials.insert_item(O, breakdown_flags=BREAKDOWN_FLAGS_ORE_PROCESSOR)
qdel(O)
if(CONSOLE)
CONSOLE.updateUsrDialog()
+5 -4
View File
@@ -28,7 +28,7 @@
/obj/machinery/mineral/ore_redemption/Initialize(mapload)
. = ..()
stored_research = new /datum/techweb/specialized/autounlocking/smelter
materials = AddComponent(/datum/component/remote_materials, "orm", mapload)
materials = AddComponent(/datum/component/remote_materials, "orm", mapload, breakdown_flags=BREAKDOWN_FLAGS_ORM)
/obj/machinery/mineral/ore_redemption/Destroy()
QDEL_NULL(stored_research)
@@ -55,7 +55,7 @@
if(O && O.refined_type)
points += O.points * point_upgrade * O.amount
var/material_amount = mat_container.get_item_material_amount(O)
var/material_amount = mat_container.get_item_material_amount(O, BREAKDOWN_FLAGS_ORM)
if(!material_amount)
qdel(O) //no materials, incinerate it
@@ -64,9 +64,10 @@
unload_mineral(O)
else
var/mats = O.custom_materials & mat_container.materials
var/list/stack_mats = O.get_material_composition(BREAKDOWN_FLAGS_ORM)
var/mats = stack_mats & mat_container.materials
var/amount = O.amount
mat_container.insert_item(O, ore_multiplier) //insert it
mat_container.insert_item(O, ore_multiplier, breakdown_flags=BREAKDOWN_FLAGS_ORM) //insert it
materials.silo_log(src, "smelted", amount, "someone", mats)
qdel(O)
+3 -3
View File
@@ -47,7 +47,7 @@ GLOBAL_LIST_EMPTY(silo_access_logs)
return ..()
/obj/machinery/ore_silo/proc/remote_attackby(obj/machinery/M, mob/user, obj/item/stack/I)
/obj/machinery/ore_silo/proc/remote_attackby(obj/machinery/M, mob/user, obj/item/stack/I, breakdown_flags=NONE)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
// stolen from /datum/component/material_container/proc/OnAttackBy
if(user.a_intent != INTENT_HELP)
@@ -57,13 +57,13 @@ GLOBAL_LIST_EMPTY(silo_access_logs)
if(!istype(I) || (I.flags_1 & HOLOGRAM_1) || (I.item_flags & NO_MAT_REDEMPTION))
to_chat(user, "<span class='warning'>[M] won't accept [I]!</span>")
return
var/item_mats = I.custom_materials & materials.materials
var/item_mats = I.get_material_composition(breakdown_flags) & materials.materials
if(!length(item_mats))
to_chat(user, "<span class='warning'>[I] does not contain sufficient materials to be accepted by [M].</span>")
return
// assumes unlimited space...
var/amount = I.amount
materials.user_insert(I, user)
materials.user_insert(I, user, breakdown_flags)
silo_log(M, "deposited", amount, "sheets", item_mats)
return TRUE