[MIRROR] no infinite materials (#11025)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-06-07 18:59:45 +02:00
committed by GitHub
co-authored by Kashargul
parent 5632b52433
commit 22c8ec20b7
13 changed files with 75 additions and 67 deletions
+1
View File
@@ -103,6 +103,7 @@
#define MATERIAL_UNMELTABLE 0x1
#define MATERIAL_BRITTLE 0x2
#define MATERIAL_PADDING 0x4
#define MATERIAL_NO_SYNTH 0x8
#define TABLE_BRITTLE_MATERIAL_MULTIPLIER 4 // Amount table damage is multiplied by if it is made of a brittle material (e.g. glass)
+1 -1
View File
@@ -123,7 +123,7 @@
if(!istype(S))
return 0
if(!(S.material.name in materials))
to_chat(user, span_warning("The [src] doesn't accept [S.material]!"))
to_chat(user, span_warning("The [src] doesn't accept [material_display_name(S.material)]!"))
return 1
if(S.get_amount() < 1)
return 1 // Does this even happen? Sanity check I guess.
+4 -9
View File
@@ -51,7 +51,9 @@
MAT_VERDANTIUM = 0,
MAT_MORPHIUM = 0,
MAT_METALHYDROGEN = 0,
MAT_SUPERMATTER = 0)
MAT_SUPERMATTER = 0,
MAT_TITANIUM = 0)
var/res_max_amount = 200000
var/datum/research/files
@@ -87,13 +89,6 @@
/obj/machinery/mecha_part_fabricator/Initialize(mapload)
. = ..()
// Go through all materials, and add them to the possible storage, but hide them unless we contain them.
for(var/Name in name_to_material)
if(Name in materials)
continue
materials[Name] = 0
default_apply_parts()
files = new /datum/research(src) //Setup the research data holder.
@@ -643,7 +638,7 @@
if(istype(I,/obj/item/stack/material))
var/obj/item/stack/material/S = I
if(!(S.material.name in materials))
to_chat(user, span_warning("The [src] doesn't accept [S.material]!"))
to_chat(user, span_warning("The [src] doesn't accept [material_display_name(S.material)]!"))
return
var/sname = "[S.name]"
+5 -1
View File
@@ -191,11 +191,15 @@ var/list/RMS_random_malfunction = list(/obj/item/fbp_backup_cell,
/obj/item/stack/material/morphium
// Include if you enable in the .dme /obj/item/stack/material/debug
)
possible_object_paths -= banned_sheet_materials
var/obj/item/stack/new_metal = /obj/item/stack/material/supermatter
for(var/x=1;x<=10;x++) //You got 10 chances to hit a metal that is NOT banned.
var/picked_metal = pick(possible_object_paths) //We select
var/obj/item/stack/material/picked_metal = pick(possible_object_paths) //We select
if(picked_metal in banned_sheet_materials)
continue
var/datum/material/M = get_material_by_name(initial(picked_metal.default_type))
if(M.flags & MATERIAL_NO_SYNTH)
continue
else
new_metal = picked_metal
break
@@ -96,7 +96,10 @@ var/list/name_to_material
return name_to_material[name]
/proc/material_display_name(name)
var/datum/material/material = get_material_by_name(name)
if(istype(name, /datum/material)) //We were fed a datum.
var/datum/material/M = name
return M.display_name
var/datum/material/material = get_material_by_name(name) //If not a datum, we were fed a name.
if(material)
return material.display_name
return null
@@ -7,7 +7,7 @@
table_icon_base = "stone"
icon_reinf = "reinf_mesh"
icon_colour = "#666677"
flags = MATERIAL_UNMELTABLE
flags = MATERIAL_UNMELTABLE | MATERIAL_NO_SYNTH
composite_material = list(MAT_STEEL = SHEET_MATERIAL_AMOUNT)
/datum/material/steel/hull/place_sheet(var/turf/target) //Deconstructed into normal steel sheets.
@@ -22,7 +22,7 @@
icon_reinf = "reinf_mesh"
icon_colour = "#777788"
explosion_resistance = 40
flags = MATERIAL_UNMELTABLE
flags = MATERIAL_UNMELTABLE | MATERIAL_NO_SYNTH
composite_material = list(MAT_PLASTEEL = SHEET_MATERIAL_AMOUNT)
/datum/material/plasteel/hull/place_sheet(var/turf/target) //Deconstructed into normal plasteel sheets.
@@ -37,7 +37,7 @@
icon_colour = "#45829a"
explosion_resistance = 90
reflectivity = 0.9
flags = MATERIAL_UNMELTABLE
flags = MATERIAL_UNMELTABLE | MATERIAL_NO_SYNTH
composite_material = list(MAT_DURASTEEL = SHEET_MATERIAL_AMOUNT)
/datum/material/durasteel/hull/place_sheet(var/turf/target) //Deconstructed into normal durasteel sheets.
@@ -49,7 +49,7 @@
icon_base = "hull"
table_icon_base = "stone"
icon_reinf = "reinf_mesh"
flags = MATERIAL_UNMELTABLE
flags = MATERIAL_UNMELTABLE | MATERIAL_NO_SYNTH
composite_material = list(MAT_TITANIUM = SHEET_MATERIAL_AMOUNT)
/datum/material/titanium/hull/place_sheet(var/turf/target) //Deconstructed into normal titanium sheets.
@@ -61,8 +61,35 @@
icon_base = "hull"
table_icon_base = "stone"
icon_reinf = "reinf_mesh"
flags = MATERIAL_UNMELTABLE
flags = MATERIAL_UNMELTABLE | MATERIAL_NO_SYNTH
composite_material = list(MAT_MORPHIUM = SHEET_MATERIAL_AMOUNT)
/datum/material/morphium/hull/place_sheet(var/turf/target)
new /obj/item/stack/material/morphium(target)
/datum/material/plastitanium/hull
name = MAT_PLASTITANIUMHULL
stack_type = /obj/item/stack/material/plastitanium/hull
icon_base = "hull"
table_icon_base = "stone"
icon_reinf = "reinf_mesh"
icon_colour = "#585658"
explosion_resistance = 50
flags = MATERIAL_NO_SYNTH
composite_material = list(MAT_PLASTITANIUM = SHEET_MATERIAL_AMOUNT)
/datum/material/plastitanium/hull/place_sheet(var/turf/target) //Deconstructed into normal plasteel sheets.
new /obj/item/stack/material/plastitanium(target)
/datum/material/gold/hull
name = MAT_GOLDHULL
stack_type = /obj/item/stack/material/gold/hull
icon_base = "hull"
table_icon_base = "stone"
icon_reinf = "reinf_mesh"
explosion_resistance = 50
flags = MATERIAL_NO_SYNTH
composite_material = list(MAT_GOLD = SHEET_MATERIAL_AMOUNT)
/datum/material/gold/hull/place_sheet(var/turf/target) //Deconstructed into normal gold sheets.
new /obj/item/stack/material/gold(target)
@@ -1,24 +0,0 @@
/datum/material/plastitanium/hull
name = MAT_PLASTITANIUMHULL
stack_type = /obj/item/stack/material/plastitanium/hull
icon_base = "hull"
table_icon_base = "stone"
icon_reinf = "reinf_mesh"
icon_colour = "#585658"
explosion_resistance = 50
composite_material = list(MAT_PLASTITANIUM = SHEET_MATERIAL_AMOUNT)
/datum/material/plastitanium/hull/place_sheet(var/turf/target) //Deconstructed into normal plasteel sheets.
new /obj/item/stack/material/plastitanium(target)
/datum/material/gold/hull
name = MAT_GOLDHULL
stack_type = /obj/item/stack/material/gold/hull
icon_base = "hull"
table_icon_base = "stone"
icon_reinf = "reinf_mesh"
explosion_resistance = 50
composite_material = list(MAT_GOLD = SHEET_MATERIAL_AMOUNT)
/datum/material/gold/hull/place_sheet(var/turf/target) //Deconstructed into normal gold sheets.
new /obj/item/stack/material/gold(target)
+19 -11
View File
@@ -18,7 +18,24 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid).
var/list/LockedDesigns = list() //CHOMPADDITION: FOR VR mainly.
materials = list(MAT_STEEL = 0, MAT_GLASS = 0, MAT_PLASTEEL = 0, MAT_PLASTIC = 0, MAT_GRAPHITE = 0, MAT_GOLD = 0, MAT_SILVER = 0, MAT_OSMIUM = 0, MAT_LEAD = 0, MAT_PHORON = 0, MAT_URANIUM = 0, MAT_DIAMOND = 0, MAT_DURASTEEL = 0, MAT_VERDANTIUM = 0, MAT_MORPHIUM = 0, MAT_METALHYDROGEN = 0, MAT_SUPERMATTER = 0)
materials = list(
MAT_STEEL = 0,
MAT_GLASS = 0,
MAT_PLASTEEL = 0,
MAT_PLASTIC = 0,
MAT_GRAPHITE = 0,
MAT_GOLD = 0,
MAT_SILVER = 0,
MAT_OSMIUM = 0,
MAT_LEAD = 0,
MAT_PHORON = 0,
MAT_URANIUM = 0,
MAT_DIAMOND = 0,
MAT_DURASTEEL = 0,
MAT_VERDANTIUM = 0,
MAT_MORPHIUM = 0,
MAT_METALHYDROGEN = 0,
MAT_SUPERMATTER = 0)
hidden_materials = list(MAT_PLASTEEL, MAT_DURASTEEL, MAT_GRAPHITE, MAT_VERDANTIUM, MAT_MORPHIUM, MAT_METALHYDROGEN, MAT_SUPERMATTER)
@@ -29,15 +46,6 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid).
/obj/machinery/r_n_d/circuit_imprinter/Initialize(mapload)
. = ..()
spawn() // Go through all materials, and add them to the possible storage, but hide them unless we contain them.
for(var/Name in name_to_material)
if(Name in materials)
continue
hidden_materials |= Name
materials[Name] = 0
default_apply_parts()
/obj/machinery/r_n_d/circuit_imprinter/process()
@@ -143,7 +151,7 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid).
var/obj/item/stack/material/S = O
if(!(S.material.name in materials))
to_chat(user, span_warning("The [src] doesn't accept [S.material]!"))
to_chat(user, span_warning("The [src] doesn't accept [material_display_name(S.material)]!"))
return
busy = 1
+1 -10
View File
@@ -44,15 +44,6 @@
/obj/machinery/r_n_d/protolathe/Initialize(mapload)
. = ..()
// Go through all materials, and add them to the possible storage, but hide them unless we contain them.
for(var/Name in name_to_material)
if(Name in materials)
continue
hidden_materials |= Name
materials[Name] = 0
default_apply_parts()
if(dep_overlay) // CHOMPAdd
@@ -162,7 +153,7 @@
var/obj/item/stack/material/S = O
if(!(S.material.name in materials))
to_chat(user, span_warning("The [src] doesn't accept [S.material]!"))
to_chat(user, span_warning("The [src] doesn't accept [material_display_name(S.material)]!"))
return
busy = 1
+1 -1
View File
@@ -430,7 +430,7 @@
var/obj/item/stack/material/S = W
if(!(S.material.name in stored_material))
to_chat(user, span_warning("\The [src] doesn't accept [S.material]!"))
to_chat(user, span_warning("\The [src] doesn't accept [material_display_name(S.material)]!"))
return
var/amnt = S.perunit
@@ -9,7 +9,6 @@
/datum/artifact_effect/electric_field/DoEffectTouch(var/mob/user)
var/atom/holder = get_master_holder()
var/weakness = GetAnomalySusceptibility(user)
if(last_used >= world.time + use_delay)
return
else
@@ -32,6 +31,9 @@
light.flicker()
for(var/mob/living/L in nearby_mobs)
var/weakness = GetAnomalySusceptibility(L)
if(!weakness) //We have protection on!
continue
if(L.isSynthetic())
to_chat(L, span_danger("ERROR: Electrical fault detected!"))
L.stuttering += 3
@@ -39,12 +41,12 @@
if(ishuman(L))
var/mob/living/carbon/human/H = L
var/obj/item/organ/external/affected = H.get_organ(check_zone(BP_TORSO))
H.electrocute_act(rand(25, 40), holder, H.get_siemens_coefficient_organ(affected), affected)
H.electrocute_act(rand(25, 40) * weakness, holder, H.get_siemens_coefficient_organ(affected), affected)
var/turf/T = get_turf(H)
if(istype(T))
lightning_strike(T, TRUE)
else
L.electrocute_act(rand(25, 40), holder, 0.75, BP_TORSO)
L.electrocute_act(rand(25, 40) * weakness, holder, 0.75, BP_TORSO)
var/turf/T = get_turf(L)
if(istype(T))
lightning_strike(T, TRUE)
@@ -49,6 +49,8 @@
/datum/material/durasteel/hull,
/datum/material/titanium/hull,
/datum/material/morphium/hull,
/datum/material/plastitanium/hull,
/datum/material/gold/hull,
/datum/material/steel/holographic,
/datum/material/plastic/holographic,
/datum/material/wood/holographic,
-1
View File
@@ -3075,7 +3075,6 @@
#include "code\modules\materials\materials\stone.dm"
#include "code\modules\materials\materials\supermatter.dm"
#include "code\modules\materials\materials\metals\hull.dm"
#include "code\modules\materials\materials\metals\hull_vr.dm"
#include "code\modules\materials\materials\metals\metals.dm"
#include "code\modules\materials\materials\metals\metals_vr.dm"
#include "code\modules\materials\materials\metals\plasteel.dm"