Material datums - Moogle Helped - Check #10169 for more info (#10176)

* Hmm

* work please

* Fixes

* Ack

* REEE

* EEEE

* e

* e

* e

* STAND FIX

* Update code/game/machinery/autolathe.dm

Co-authored-by: Nichlas Pihl <nichlas00100@gmail.com>

* Update code/game/machinery/autolathe.dm

Co-authored-by: Nichlas Pihl <nichlas00100@gmail.com>

Co-authored-by: Nichlas Pihl <nichlas00100@gmail.com>
This commit is contained in:
Jamie D
2020-10-28 17:53:59 +00:00
committed by GitHub
parent 2094d37c89
commit 10c9af0d77
195 changed files with 2308 additions and 1646 deletions

View File

@@ -67,19 +67,6 @@
//let's just pretend fulltile windows being children of border windows is fine
#define FULLTILE_WINDOW_DIR NORTHEAST
//Material defines, for determining how much of a given material an item contains
#define MAT_METAL "$metal"
#define MAT_GLASS "$glass"
#define MAT_SILVER "$silver"
#define MAT_GOLD "$gold"
#define MAT_DIAMOND "$diamond"
#define MAT_URANIUM "$uranium"
#define MAT_PLASMA "$plasma"
#define MAT_BLUESPACE "$bluespace"
#define MAT_BANANIUM "$bananium"
#define MAT_TITANIUM "$titanium"
#define MAT_BIOMASS "$biomass"
#define MAT_PLASTIC "$plastic"
//The amount of materials you get from a sheet of mineral like iron/diamond/glass etc
#define MINERAL_MATERIAL_AMOUNT 2000
//The maximum size of a stack object.

View File

@@ -0,0 +1,32 @@
/// Module is compatible with Security Cyborg models
#define BORG_MODULE_SECURITY (1<<0)
/// Module is compatible with Miner Cyborg models
#define BORG_MODULE_MINER (1<<1)
/// Module is compatible with Janitor Cyborg models
#define BORG_MODULE_JANITOR (1<<2)
/// Module is compatible with Medical Cyborg models
#define BORG_MODULE_MEDICAL (1<<3)
/// Module is compatible with Engineering Cyborg models
#define BORG_MODULE_ENGINEERING (1<<4)
/// Module is compatible with Ripley Exosuit models
#define EXOSUIT_MODULE_RIPLEY (1<<0)
/// Module is compatible with Odyseeus Exosuit models
#define EXOSUIT_MODULE_ODYSSEUS (1<<1)
/// Module is compatible with Clarke Exosuit models
#define EXOSUIT_MODULE_CLARKE (1<<2)
/// Module is compatible with Gygax Exosuit models
#define EXOSUIT_MODULE_GYGAX (1<<3)
/// Module is compatible with Durand Exosuit models
#define EXOSUIT_MODULE_DURAND (1<<4)
/// Module is compatible with H.O.N.K Exosuit models
#define EXOSUIT_MODULE_HONK (1<<5)
/// Module is compatible with Phazon Exosuit models
#define EXOSUIT_MODULE_PHAZON (1<<6)
/// Module is compatible with "Working" Exosuit models - Ripley and Clarke
#define EXOSUIT_MODULE_WORKING EXOSUIT_MODULE_RIPLEY | EXOSUIT_MODULE_CLARKE
/// Module is compatible with "Combat" Exosuit models - Gygax, H.O.N.K, Durand and Phazon
#define EXOSUIT_MODULE_COMBAT EXOSUIT_MODULE_GYGAX | EXOSUIT_MODULE_HONK | EXOSUIT_MODULE_DURAND | EXOSUIT_MODULE_PHAZON
/// Module is compatible with "Medical" Exosuit modelsm - Odysseus
#define EXOSUIT_MODULE_MEDICAL EXOSUIT_MODULE_ODYSSEUS

View File

@@ -0,0 +1,12 @@
/// Is the material from an ore? currently unused but exists atm for categorizations sake
#define MAT_CATEGORY_ORE "ore capable"
/// Hard materials, such as iron or metal
#define MAT_CATEGORY_RIGID "rigid material"
/// Gets the reference for the material type that was given
#define getmaterialref(A) (SSmaterials.materials[A])
/// Flag for atoms, this flag ensures it isn't re-colored by materials. Useful for snowflake icons such as default toolboxes.
#define MATERIAL_NO_COLOR (1<<0)

View File

@@ -1,12 +1,12 @@
//! Defines for subsystems and overlays
//!
//!
//! Lots of important stuff in here, make sure you have your brain switched on
//! when editing this file
//! ## DB defines
/**
* DB major schema version
*
*
* Update this whenever the db schema changes
*
* make sure you add an update to the schema_version stable in the db changelog
@@ -15,7 +15,7 @@
/**
* DB minor schema version
*
*
* Update this whenever the db schema changes
*
* make sure you add an update to the schema_version stable in the db changelog
@@ -108,6 +108,7 @@
#define INIT_ORDER_SOUNDS 83
#define INIT_ORDER_INSTRUMENTS 82
#define INIT_ORDER_VIS 80
#define INIT_ORDER_MATERIALS 76
#define INIT_ORDER_RESEARCH 75
#define INIT_ORDER_EVENTS 70
#define INIT_ORDER_MAPPING 65

View File

@@ -47,11 +47,6 @@
for(var/path in subtypesof(/datum/surgery))
GLOB.surgeries_list += new path()
//Materials
for(var/path in subtypesof(/datum/material))
var/datum/material/D = new path()
GLOB.materials_list[D.id] = D
GLOB.emote_list = init_emote_list()
//Skillcapes
for(var/path in subtypesof(/datum/skillcape))

View File

@@ -16,7 +16,6 @@ GLOBAL_LIST_EMPTY(singularities) //list of all singularities on the stati
GLOBAL_LIST(chemical_reactions_list) //list of all /datum/chemical_reaction datums. Used during chemical reactions
GLOBAL_LIST(chemical_reagents_list) //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff
GLOBAL_LIST_EMPTY(materials_list) //list of all /datum/material datums indexed by material id.
GLOBAL_LIST_EMPTY(tech_list) //list of all /datum/tech datums indexed by id.
GLOBAL_LIST_EMPTY(surgeries_list) //list of all surgeries by name, associated with their path.
GLOBAL_LIST_EMPTY(crafting_recipes) //list of all table craft recipes

View File

@@ -0,0 +1,25 @@
/*! How material datums work
Materials are now instanced datums, with an associative list of them being kept in SSmaterials. We only instance the materials once and then re-use these instances for everything.
These materials call on_applied() on whatever item they are applied to, common effects are adding components, changing color and changing description. This allows us to differentiate items based on the material they are made out of.area
*/
SUBSYSTEM_DEF(materials)
name = "Materials"
flags = SS_NO_FIRE
init_order = INIT_ORDER_MATERIALS
///Dictionary of material.type || material ref
var/list/materials = list()
///Dictionary of category || list of material refs
var/list/materials_by_category = list()
/datum/controller/subsystem/materials/Initialize(timeofday)
InitializeMaterials()
return ..()
///Ran on initialize, populated the materials and materials_by_category dictionaries with their appropiate vars (See these variables for more info)
/datum/controller/subsystem/materials/proc/InitializeMaterials(timeofday)
for(var/type in subtypesof(/datum/material))
var/datum/material/ref = new type
materials[type] = ref
for(var/c in ref.categories)
materials_by_category[c] += list(ref)

View File

@@ -157,6 +157,7 @@ SUBSYSTEM_DEF(research)
stack_trace("WARNING: Design ID clash with ID [initial(DN.id)] detected! Path: [path]")
errored_datums[DN] = initial(DN.id)
continue
DN.InitializeMaterials() //Initialize the materials in the design
returned[initial(DN.id)] = DN
techweb_designs = returned
verify_techweb_designs()

View File

@@ -0,0 +1,106 @@
///Component specifically for explosion sensetive things, currently only applies to heat based explosions but can later perhaps be used for things that are dangerous to handle carelessly like nitroglycerin.
/datum/component/explodable
var/devastation_range = 0
var/heavy_impact_range = 0
var/light_impact_range = 2
var/flash_range = 3
var/equipped_slot //For items, lets us determine where things should be hit.
/datum/component/explodable/Initialize(devastation_range_override, heavy_impact_range_override, light_impact_range_override, flash_range_override)
if(!isatom(parent))
return COMPONENT_INCOMPATIBLE
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/explodable_attack)
RegisterSignal(parent, COMSIG_TRY_STORAGE_INSERT, .proc/explodable_insert_item)
RegisterSignal(parent, COMSIG_ATOM_EX_ACT, .proc/detonate)
if(ismovable(parent))
RegisterSignal(parent, COMSIG_MOVABLE_IMPACT, .proc/explodable_impact)
RegisterSignal(parent, COMSIG_MOVABLE_BUMP, .proc/explodable_bump)
if(isitem(parent))
RegisterSignal(parent, list(COMSIG_ITEM_ATTACK, COMSIG_ITEM_ATTACK_OBJ, COMSIG_ITEM_HIT_REACT), .proc/explodable_attack)
RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, .proc/on_equip)
RegisterSignal(parent, COMSIG_ITEM_DROPPED, .proc/on_drop)
if(devastation_range_override)
devastation_range = devastation_range_override
if(heavy_impact_range_override)
heavy_impact_range = heavy_impact_range_override
if(light_impact_range_override)
light_impact_range = light_impact_range_override
if(flash_range_override)
flash_range = flash_range_override
/datum/component/explodable/proc/explodable_insert_item(datum/source, obj/item/I, mob/M, silent = FALSE, force = FALSE)
check_if_detonate(I)
/datum/component/explodable/proc/explodable_impact(datum/source, atom/hit_atom, datum/thrownthing/throwingdatum)
check_if_detonate(hit_atom)
/datum/component/explodable/proc/explodable_bump(datum/source, atom/A)
check_if_detonate(A)
///Called when you use this object to attack sopmething
/datum/component/explodable/proc/explodable_attack(datum/source, atom/movable/target, mob/living/user)
check_if_detonate(target)
///Called when you attack a specific body part of the thing this is equipped on. Useful for exploding pants.
/datum/component/explodable/proc/explodable_attack_zone(datum/source, damage, damagetype, def_zone)
if(!def_zone)
return
if(damagetype != BURN) //Don't bother if it's not fire.
return
if(!is_hitting_zone(def_zone)) //You didn't hit us! ha!
return
detonate()
/datum/component/explodable/proc/on_equip(datum/source, mob/equipper, slot)
RegisterSignal(equipper, COMSIG_MOB_APPLY_DAMAGE, .proc/explodable_attack_zone, TRUE)
/datum/component/explodable/proc/on_drop(datum/source, mob/user)
UnregisterSignal(user, COMSIG_MOB_APPLY_DAMAGE)
/// Checks if we're hitting the zone this component is covering
/datum/component/explodable/proc/is_hitting_zone(def_zone)
var/obj/item/item = parent
var/mob/living/L = item.loc //Get whoever is equipping the item currently
if(!istype(L))
return
var/obj/item/bodypart/bodypart = L.get_bodypart(check_zone(def_zone))
var/list/equipment_items = list()
if(iscarbon(L))
var/mob/living/carbon/C = L
equipment_items += list(C.head, C.wear_mask, C.back, C.gloves, C.shoes, C.glasses, C.ears)
if(ishuman(C))
var/mob/living/carbon/human/H = C
equipment_items += list(H.wear_suit, H.w_uniform, H.belt, H.s_store, H.wear_id)
for(var/bp in equipment_items)
if(!bp)
continue
var/obj/item/I = bp
if(I.body_parts_covered & bodypart.body_part)
return TRUE
return FALSE
/datum/component/explodable/proc/check_if_detonate(target)
if(!isitem(target))
return
var/obj/item/I = target
if(!I.is_hot())
return
detonate() //If we're touching a hot item we go boom
/// Expldoe and remove the object
/datum/component/explodable/proc/detonate()
var/atom/A = parent
explosion(A, devastation_range, heavy_impact_range, light_impact_range, flash_range) //epic explosion time
qdel(A)

View File

@@ -1,4 +1,4 @@
/*
/*!
This datum should be used for handling mineral contents of machines and whatever else is supposed to hold minerals and make use of them.
Variables:
@@ -13,7 +13,7 @@
var/total_amount = 0
var/max_amount
var/sheet_type
var/list/materials
var/list/materials //Map of key = material ref | Value = amount
var/show_on_examine
var/disable_attackby
var/list/allowed_typecache
@@ -22,6 +22,7 @@
var/datum/callback/precondition
var/datum/callback/after_insert
/// Sets up the proper signals and fills the list of materials with the appropriate references.
/datum/component/material_container/Initialize(list/mat_list, max_amt = 0, _show_on_examine = FALSE, list/allowed_types, datum/callback/_precondition, datum/callback/_after_insert, _disable_attackby)
materials = list()
max_amount = max(0, max_amt)
@@ -40,23 +41,19 @@
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/OnAttackBy)
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/OnExamine)
var/list/possible_mats = list()
for(var/mat_type in subtypesof(/datum/material))
var/datum/material/MT = mat_type
possible_mats[initial(MT.id)] = mat_type
for(var/id in mat_list)
if(possible_mats[id])
var/mat_path = possible_mats[id]
materials[id] = new mat_path()
for(var/mat in mat_list) //Make the assoc list ref | amount
var/datum/material/M = getmaterialref(mat) || mat
materials[M] = 0
/datum/component/material_container/proc/OnExamine(datum/source, mob/user)
if(show_on_examine)
for(var/I in materials)
var/datum/material/M = materials[I]
var/amt = amount(M.id)
var/datum/material/M = I
var/amt = materials[I]
if(amt)
to_chat(user, "<span class='notice'>It has [amt] units of [lowertext(M.name)] stored.</span>")
/// Proc that allows players to fill the parent with mats
/datum/component/material_container/proc/OnAttackBy(datum/source, obj/item/I, mob/living/user)
var/list/tc = allowed_typecache
if(disable_attackby)
@@ -81,6 +78,7 @@
return
user_insert(I, user)
/// Proc used for when player inserts materials
/datum/component/material_container/proc/user_insert(obj/item/I, mob/living/user)
set waitfor = FALSE
var/requested_amount
@@ -112,23 +110,33 @@
else if(I == active_held)
user.put_in_active_hand(I)
//For inserting an amount of material
/datum/component/material_container/proc/insert_amount(amt, id = null)
if(amt > 0 && has_space(amt))
var/total_amount_saved = total_amount
if(id)
var/datum/material/M = materials[id]
if(M)
M.amount += amt
total_amount += amt
else
for(var/i in materials)
var/datum/material/M = materials[i]
M.amount += amt
total_amount += amt
return (total_amount - total_amount_saved)
return FALSE
/// Proc specifically for inserting items, returns the amount of materials entered.
/datum/component/material_container/proc/insert_item(obj/item/I, var/multiplier = 1, stack_amt)
if(!I)
return FALSE
if(istype(I, /obj/item/stack))
return insert_stack(I, stack_amt, multiplier)
multiplier = CEILING(multiplier, 0.01)
var/material_amount = get_item_material_amount(I)
if(!material_amount || !has_space(material_amount))
return FALSE
last_inserted_id = insert_item_materials(I, multiplier)
return material_amount
/datum/component/material_container/proc/insert_item_materials(obj/item/I, multiplier = 1)
var/primary_mat
var/max_mat_value = 0
for(var/MAT in materials)
materials[MAT] += I.materials[MAT] * multiplier
total_amount += I.materials[MAT] * multiplier
if(I.materials[MAT] > max_mat_value)
primary_mat = MAT
return primary_mat
/// Proc for putting a stack inside of the container
/datum/component/material_container/proc/insert_stack(obj/item/stack/S, amt, multiplier = 1)
if(isnull(amt))
amt = S.amount
@@ -147,250 +155,198 @@
if(!amt)
return FALSE
last_inserted_id = insert_materials(S,amt * multiplier)
last_inserted_id = insert_item_materials(S,amt * multiplier)
S.use(amt)
return amt
/datum/component/material_container/proc/insert_item(obj/item/I, multiplier = 1, stack_amt)
if(!I)
return FALSE
if(istype(I, /obj/item/stack))
return insert_stack(I, stack_amt, multiplier)
/// For inserting an amount of material
/datum/component/material_container/proc/insert_amount_mat(amt, var/datum/material/mat)
if(!istype(mat))
mat = getmaterialref(mat)
if(amt > 0 && has_space(amt))
var/total_amount_saved = total_amount
if(mat)
materials[mat] += amt
else
for(var/i in materials)
materials[i] += amt
total_amount += amt
return (total_amount - total_amount_saved)
return FALSE
var/material_amount = get_item_material_amount(I)
if(!material_amount || !has_space(material_amount))
return FALSE
last_inserted_id = insert_materials(I, multiplier)
return material_amount
/datum/component/material_container/proc/insert_materials(obj/item/I, multiplier = 1) //for internal usage only
var/datum/material/M
var/primary_mat
var/max_mat_value = 0
for(var/MAT in materials)
M = materials[MAT]
M.amount += I.materials[MAT] * multiplier
total_amount += I.materials[MAT] * multiplier
if(I.materials[MAT] > max_mat_value)
primary_mat = MAT
return primary_mat
//For consuming material
//mats is a list of types of material to use and the corresponding amounts, example: list(MAT_METAL=100, MAT_GLASS=200)
/datum/component/material_container/proc/use_amount(list/mats, multiplier=1)
if(!mats || !mats.len)
return FALSE
var/datum/material/M
for(var/MAT in materials)
M = materials[MAT]
if(M.amount < (mats[MAT] * multiplier))
return FALSE
var/total_amount_save = total_amount
for(var/MAT in materials)
M = materials[MAT]
M.amount -= mats[MAT] * multiplier
total_amount -= mats[MAT] * multiplier
return total_amount_save - total_amount
/datum/component/material_container/proc/use_amount_type(amt, id)
var/datum/material/M = materials[id]
if(M)
if(M.amount >= amt)
M.amount -= amt
/// Uses an amount of a specific material, effectively removing it.
/datum/component/material_container/proc/use_amount_mat(amt, var/datum/material/mat)
if(!istype(mat))
mat = getmaterialref(mat)
var/amount = materials[mat]
if(mat)
if(amount >= amt)
materials[mat] -= amt
total_amount -= amt
return amt
return FALSE
/datum/component/material_container/proc/transer_amt_to(var/datum/component/material_container/T, amt, id)
if((amt==0)||(!T)||(!id))
/// Proc for transfering materials to another container.
/datum/component/material_container/proc/transer_amt_to(var/datum/component/material_container/T, amt, var/datum/material/mat)
if(!istype(mat))
mat = getmaterialref(mat)
if((amt==0)||(!T)||(!mat))
return FALSE
if(amt<0)
return T.transer_amt_to(src, -amt, id)
var/datum/material/M = materials[id]
if(M)
var/tr = min(amt, M.amount,T.can_insert_amount(amt, id))
if(tr)
use_amount_type(tr, id)
T.insert_amount(tr, id)
return tr
return T.transer_amt_to(src, -amt, mat)
var/tr = min(amt, materials[mat],T.can_insert_amount_mat(amt, mat))
if(tr)
use_amount_mat(tr, mat)
T.insert_amount_mat(tr, mat)
return tr
return FALSE
/datum/component/material_container/proc/can_insert_amount(amt, id)
if(amt && id)
var/datum/material/M = materials[id]
/// Proc for checking if there is room in the component, returning the amount or else the amount lacking.
/datum/component/material_container/proc/can_insert_amount_mat(amt, mat)
if(amt && mat)
var/datum/material/M = mat
if(M)
if((total_amount + amt) <= max_amount)
return amt
else
return (max_amount-total_amount)
/datum/component/material_container/proc/can_use_amount(amt, id, list/mats)
if(amt && id)
var/datum/material/M = materials[id]
if(M && M.amount >= amt)
return TRUE
else if(istype(mats))
for(var/M in mats)
if(materials[M] && (mats[M] <= materials[M]))
continue
else
return FALSE
return TRUE
return FALSE
//For spawning mineral sheets; internal use only
/datum/component/material_container/proc/retrieve(sheet_amt, datum/material/M, target = null)
/// For consuming a dictionary of materials. mats is the map of materials to use and the corresponding amounts, example: list(M/datum/material/glass =100, datum/material/iron=200)
/datum/component/material_container/proc/use_materials(list/mats, multiplier=1)
if(!mats || !length(mats))
return FALSE
var/list/mats_to_remove = list() //Assoc list MAT | AMOUNT
for(var/x in mats) //Loop through all required materials
var/datum/material/req_mat = x
if(!istype(req_mat))
req_mat = getmaterialref(req_mat) //Get the ref if necesary
if(!materials[req_mat]) //Do we have the resource?
return FALSE //Can't afford it
var/amount_required = mats[x] * multiplier
if(!(materials[req_mat] >= amount_required)) // do we have enough of the resource?
return FALSE //Can't afford it
mats_to_remove[req_mat] += amount_required //Add it to the assoc list of things to remove
continue
var/total_amount_save = total_amount
for(var/i in mats_to_remove)
total_amount_save -= use_amount_mat(mats_to_remove[i], i)
return total_amount_save - total_amount
/// For spawning mineral sheets at a specific location. Used by machines to output sheets.
/datum/component/material_container/proc/retrieve_sheets(sheet_amt, var/datum/material/M, target = null)
if(!M.sheet_type)
return 0
return 0 //Add greyscale sheet handling here later
if(sheet_amt <= 0)
return 0
if(!target)
target = get_turf(parent)
if(M.amount < (sheet_amt * MINERAL_MATERIAL_AMOUNT))
sheet_amt = round(M.amount / MINERAL_MATERIAL_AMOUNT)
if(materials[M] < (sheet_amt * MINERAL_MATERIAL_AMOUNT))
sheet_amt = round(materials[M] / MINERAL_MATERIAL_AMOUNT)
var/count = 0
while(sheet_amt > MAX_STACK_SIZE)
new M.sheet_type(target, MAX_STACK_SIZE)
count += MAX_STACK_SIZE
use_amount_type(sheet_amt * MINERAL_MATERIAL_AMOUNT, M.id)
use_amount_mat(sheet_amt * MINERAL_MATERIAL_AMOUNT, M)
sheet_amt -= MAX_STACK_SIZE
if(sheet_amt >= 1)
new M.sheet_type(target, sheet_amt)
count += sheet_amt
use_amount_type(sheet_amt * MINERAL_MATERIAL_AMOUNT, M.id)
use_amount_mat(sheet_amt * MINERAL_MATERIAL_AMOUNT, M)
return count
/datum/component/material_container/proc/retrieve_sheets(sheet_amt, id, target = null)
if(materials[id])
return retrieve(sheet_amt, materials[id], target)
return FALSE
/datum/component/material_container/proc/retrieve_amount(amt, id, target)
return retrieve_sheets(amount2sheet(amt), id, target)
/// Proc to get all the materials and dump them as sheets
/datum/component/material_container/proc/retrieve_all(target = null)
var/result = 0
var/datum/material/M
for(var/MAT in materials)
M = materials[MAT]
result += retrieve_sheets(amount2sheet(M.amount), MAT, target)
var/amount = materials[MAT]
result += retrieve_sheets(amount2sheet(amount), MAT, target)
return result
/// Proc that returns TRUE if the container has space
/datum/component/material_container/proc/has_space(amt = 0)
return (total_amount + amt) <= max_amount
/// Checks if its possible to afford a certain amount of materials. Takes a dictionary of materials.
/datum/component/material_container/proc/has_materials(list/mats, multiplier=1)
if(!mats || !mats.len)
return FALSE
var/datum/material/M
for(var/MAT in mats)
M = materials[MAT]
if(M.amount < (mats[MAT] * multiplier))
for(var/x in mats) //Loop through all required materials
var/datum/material/req_mat = x
if(!istype(req_mat))
if(ispath(req_mat)) //Is this an actual material, or is it a category?
req_mat = getmaterialref(req_mat) //Get the ref
else // Its a category. (For example MAT_CATEGORY_RIGID)
if(!has_enough_of_category(req_mat, mats[req_mat], multiplier)) //Do we have enough of this category?
return FALSE
else
continue
if(!has_enough_of_material(req_mat, mats[req_mat], multiplier))//Not a category, so just check the normal way
return FALSE
return TRUE
/// Returns all the categories in a recipe.
/datum/component/material_container/proc/get_categories(list/mats)
var/list/categories = list()
for(var/x in mats) //Loop through all required materials
if(!istext(x)) //This means its not a category
continue
categories += x
return categories
/// Returns TRUE if you have enough of the specified material.
/datum/component/material_container/proc/has_enough_of_material(var/datum/material/req_mat, amount, multiplier=1)
if(!materials[req_mat]) //Do we have the resource?
return FALSE //Can't afford it
var/amount_required = amount * multiplier
if(materials[req_mat] >= amount_required) // do we have enough of the resource?
return TRUE
return FALSE //Can't afford it
/// Returns TRUE if you have enough of a specified material category (Which could be multiple materials)
/datum/component/material_container/proc/has_enough_of_category(category, amount, multiplier=1)
for(var/i in SSmaterials.materials_by_category[category])
var/datum/material/mat = i
if(materials[mat] >= amount) //we have enough
return TRUE
return FALSE
/// Turns a material amount into the amount of sheets it should output
/datum/component/material_container/proc/amount2sheet(amt)
if(amt >= MINERAL_MATERIAL_AMOUNT)
return round(amt / MINERAL_MATERIAL_AMOUNT)
return FALSE
/// Turns an amount of sheets into the amount of material amount it should output
/datum/component/material_container/proc/sheet2amount(sheet_amt)
if(sheet_amt > 0)
return sheet_amt * MINERAL_MATERIAL_AMOUNT
return FALSE
/datum/component/material_container/proc/amount(id)
var/datum/material/M = materials[id]
return M ? M.amount : 0
//returns the amount of material relevant to this container;
//if this container does not support glass, any glass in 'I' will not be taken into account
///returns the amount of material relevant to this container; if this container does not support glass, any glass in 'I' will not be taken into account
/datum/component/material_container/proc/get_item_material_amount(obj/item/I)
if(!istype(I))
return FALSE
var/material_amount = 0
for(var/MAT in materials)
for(var/MAT in I.materials)
material_amount += I.materials[MAT]
return material_amount
/datum/material
var/name
var/amount = 0
var/id = null
var/sheet_type = null
var/coin_type = null
/datum/material/metal
name = "Metal"
id = MAT_METAL
sheet_type = /obj/item/stack/sheet/metal
coin_type = /obj/item/coin/iron
/datum/material/glass
name = "Glass"
id = MAT_GLASS
sheet_type = /obj/item/stack/sheet/glass
/datum/material/silver
name = "Silver"
id = MAT_SILVER
sheet_type = /obj/item/stack/sheet/mineral/silver
coin_type = /obj/item/coin/silver
/datum/material/gold
name = "Gold"
id = MAT_GOLD
sheet_type = /obj/item/stack/sheet/mineral/gold
coin_type = /obj/item/coin/gold
/datum/material/diamond
name = "Diamond"
id = MAT_DIAMOND
sheet_type = /obj/item/stack/sheet/mineral/diamond
coin_type = /obj/item/coin/diamond
/datum/material/uranium
name = "Uranium"
id = MAT_URANIUM
sheet_type = /obj/item/stack/sheet/mineral/uranium
coin_type = /obj/item/coin/uranium
/datum/material/plasma
name = "Solid Plasma"
id = MAT_PLASMA
sheet_type = /obj/item/stack/sheet/mineral/plasma
coin_type = /obj/item/coin/plasma
/datum/material/bluespace
name = "Bluespace Mesh"
id = MAT_BLUESPACE
sheet_type = /obj/item/stack/sheet/bluespace_crystal
/datum/material/bananium
name = "Bananium"
id = MAT_BANANIUM
sheet_type = /obj/item/stack/sheet/mineral/bananium
coin_type = /obj/item/coin/bananium
/datum/material/titanium
name = "Titanium"
id = MAT_TITANIUM
sheet_type = /obj/item/stack/sheet/mineral/titanium
/datum/material/biomass
name = "Biomass"
id = MAT_BIOMASS
/datum/material/plastic
name = "Plastic"
id = MAT_PLASTIC
sheet_type = /obj/item/stack/sheet/plastic
/// Returns the amount of a specific material in this container.
/datum/component/material_container/proc/get_material_amount(var/datum/material/mat)
if(!istype(mat))
mat = getmaterialref(mat)
return(materials[mat])

View File

@@ -18,7 +18,7 @@
hl3_release_date = _half_life
can_contaminate = _can_contaminate
if(istype(parent, /atom))
if(istype(parent, /atom))
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/rad_examine)
if(istype(parent, /obj/item))
RegisterSignal(parent, COMSIG_ITEM_ATTACK, .proc/rad_attack)
@@ -89,6 +89,8 @@
/datum/component/radioactive/proc/rad_attack(datum/source, atom/movable/target, mob/living/user)
radiation_pulse(parent, strength/20)
target.rad_act(strength/2)
if(!hl3_release_date)
return
strength -= strength / hl3_release_date
#undef RAD_AMOUNT_LOW

View File

@@ -54,7 +54,7 @@ handles linking back and forth.
/datum/component/remote_materials/proc/_MakeLocal()
silo = null
mat_container = parent.AddComponent(/datum/component/material_container,
list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE, MAT_PLASTIC),
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, /datum/material/plastic),
local_size,
FALSE,
/obj/item/stack)

View File

@@ -0,0 +1,67 @@
/*! Material datum
Simple datum which is instanced once per type and is used for every object of said material. It has a variety of variables that define behavior. Subtyping from this makes it easier to create your own materials.
*/
/datum/material
var/name = "material"
var/desc = "its..stuff."
///Var that's mostly used by science machines to identify specific materials, should most likely be phased out at some point
var/id = "mat"
///Base color of the material, is used for greyscale. Item isn't changed in color if this is null.
var/color
///Base alpha of the material, is used for greyscale icons.
var/alpha
///Materials "Traits". its a map of key = category | Value = Bool. Used to define what it can be used for.gold
var/list/categories = list()
///The type of sheet this material creates. This should be replaced as soon as possible by greyscale sheets.
var/sheet_type
///The type of coin this material spawns. This should be replaced as soon as possible by greyscale coins.
var/coin_type
///This is a modifier for force, and resembles the strength of the material
var/strength_modifier = 1
///This is a modifier for integrity, and resembles the strength of the material
var/integrity_modifier = 1
///This proc is called when the material is added to an object.
/datum/material/proc/on_applied(atom/source, amount, material_flags)
if(!(material_flags & MATERIAL_NO_COLOR)) //Prevent changing things with pre-set colors, to keep colored toolboxes their looks for example
if(color) //Do we have a custom color?
source.add_atom_colour(color, FIXED_COLOUR_PRIORITY)
if(alpha)
source.alpha = alpha
if(istype(source, /obj)) //objs
on_applied_obj(source, amount, material_flags)
///This proc is called when the material is added to an object specifically.
/datum/material/proc/on_applied_obj(var/obj/o, amount, material_flags)
var/new_max_integrity = CEILING(o.max_integrity * integrity_modifier, 1)
// This is to keep the same damage relative to the max integrity of the object
o.obj_integrity = (o.obj_integrity / o.max_integrity) * new_max_integrity
o.max_integrity = new_max_integrity
o.force *= strength_modifier
o.throwforce *= strength_modifier
///This proc is called when the material is removed from an object.
/datum/material/proc/on_removed(atom/source, material_flags)
if(!(material_flags & MATERIAL_NO_COLOR)) //Prevent changing things with pre-set colors, to keep colored toolboxes their looks for example
if(color)
source.remove_atom_colour(FIXED_COLOUR_PRIORITY, color)
source.alpha = initial(source.alpha)
if(istype(source, /obj)) //objs
on_removed_obj(source, material_flags)
///This proc is called when the material is removed from an object specifically.
/datum/material/proc/on_removed_obj(var/obj/o, amount, material_flags)
var/new_max_integrity = initial(o.max_integrity)
// This is to keep the same damage relative to the max integrity of the object
o.obj_integrity = (o.obj_integrity / o.max_integrity) * new_max_integrity
o.max_integrity = new_max_integrity
o.force = initial(o.force)
o.throwforce = initial(o.throwforce)

View File

@@ -0,0 +1,147 @@
///Has no special properties.
/datum/material/iron
name = "iron"
id = "iron"
desc = "Common iron ore often found in sedimentary and igneous layers of the crust."
color = "#878687"
categories = list(MAT_CATEGORY_ORE = TRUE, MAT_CATEGORY_RIGID = TRUE)
sheet_type = /obj/item/stack/sheet/metal
coin_type = /obj/item/coin/iron
///Breaks extremely easily but is transparent.
/datum/material/glass
name = "glass"
id = "glass"
desc = "Glass forged by melting sand."
color = "#dae6f0"
alpha = 210
categories = list(MAT_CATEGORY_RIGID = TRUE)
integrity_modifier = 0.1
sheet_type = /obj/item/stack/sheet/glass
///Has no special properties. Could be good against vampires in the future perhaps.
/datum/material/silver
name = "silver"
id = "silver"
desc = "Silver"
color = "#bdbebf"
categories = list(MAT_CATEGORY_ORE = TRUE, MAT_CATEGORY_RIGID = TRUE)
sheet_type = /obj/item/stack/sheet/mineral/silver
coin_type = /obj/item/coin/silver
///Slight force increase
/datum/material/gold
name = "gold"
id = "gold"
desc = "Gold"
color = "#f0972b"
strength_modifier = 1.2
categories = list(MAT_CATEGORY_ORE = TRUE, MAT_CATEGORY_RIGID = TRUE)
sheet_type = /obj/item/stack/sheet/mineral/gold
coin_type = /obj/item/coin/gold
///Has no special properties
/datum/material/diamond
name = "diamond"
id = "diamond"
desc = "Highly pressurized carbon"
color = "#22c2d4"
categories = list(MAT_CATEGORY_ORE = TRUE, MAT_CATEGORY_RIGID = TRUE)
sheet_type = /obj/item/stack/sheet/mineral/diamond
coin_type = /obj/item/coin/diamond
///Is slightly radioactive
/datum/material/uranium
name = "uranium"
id = "uranium"
desc = "Uranium"
color = "#1fb83b"
categories = list(MAT_CATEGORY_ORE = TRUE, MAT_CATEGORY_RIGID = TRUE)
sheet_type = /obj/item/stack/sheet/mineral/uranium
coin_type = /obj/item/coin/uranium
/datum/material/uranium/on_applied(atom/source, amount, material_flags)
. = ..()
source.AddComponent(/datum/component/radioactive, amount / 10, source, 0) //half-life of 0 because we keep on going.
/datum/material/uranium/on_removed(atom/source, material_flags)
. = ..()
qdel(source.GetComponent(/datum/component/radioactive))
///Adds firestacks on hit (Still needs support to turn into gas on destruction)
/datum/material/plasma
name = "plasma"
id = "plasma"
desc = "Isn't plasma a state of matter? Oh whatever."
color = "#c716b8"
categories = list(MAT_CATEGORY_ORE = TRUE, MAT_CATEGORY_RIGID = TRUE)
sheet_type = /obj/item/stack/sheet/mineral/plasma
coin_type = /obj/item/coin/plasma
/datum/material/plasma/on_applied(atom/source, amount, material_flags)
. = ..()
if(ismovable(source))
source.AddComponent(/datum/component/explodable, 0, 0, amount / 1000, amount / 500)
/datum/material/plasma/on_removed(atom/source, material_flags)
. = ..()
qdel(source.GetComponent(/datum/component/explodable))
///Can cause bluespace effects on use. (Teleportation) (Not yet implemented)
/datum/material/bluespace
name = "bluespace crystal"
id = "bluespace_crystal"
desc = "Crystals with bluespace properties"
color = "#506bc7"
categories = list(MAT_CATEGORY_ORE = TRUE)
sheet_type = /obj/item/stack/sheet/bluespace_crystal
///Honks and slips
/datum/material/bananium
name = "bananium"
id = "bananium"
desc = "Material with hilarious properties"
color = "#fff263"
categories = list(MAT_CATEGORY_ORE = TRUE, MAT_CATEGORY_RIGID = TRUE)
sheet_type = /obj/item/stack/sheet/mineral/bananium
coin_type = /obj/item/coin/bananium
/datum/material/bananium/on_applied(atom/source, amount, material_flags)
. = ..()
source.AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg'=1), 50)
source.AddComponent(/datum/component/slippery, min(amount / 10, 80))
/datum/material/bananium/on_removed(atom/source, amount, material_flags)
. = ..()
qdel(source.GetComponent(/datum/component/slippery))
qdel(source.GetComponent(/datum/component/squeak))
///Mediocre force increase
/datum/material/titanium
name = "titanium"
id = "titanium"
desc = "Titanium"
color = "#b3c0c7"
strength_modifier = 1.3
categories = list(MAT_CATEGORY_ORE = TRUE, MAT_CATEGORY_RIGID = TRUE)
sheet_type = /obj/item/stack/sheet/mineral/titanium
///Force decrease
/datum/material/plastic
name = "plastic"
id = "plastic"
desc = "plastic"
color = "#caccd9"
strength_modifier = 0.85
sheet_type = /obj/item/stack/sheet/plastic
///Force decrease and mushy sound effect. (Not yet implemented)
/datum/material/biomass
name = "biomass"
id = "biomass"
desc = "Organic matter"
color = "#735b4d"
strength_modifier = 0.8

View File

@@ -69,6 +69,11 @@
/// Radiation insulation types
var/rad_insulation = RAD_NO_INSULATION
///The custom materials this atom is made of, used by a lot of things like furniture, walls, and floors (if I finish the functionality, that is.)
var/list/custom_materials
///Bitfield for how the atom handles materials.
var/material_flags = NONE
var/chat_color_name // Last name used to calculate a color for the chatmessage overlays
var/chat_color // Last color calculated for the the chatmessage overlays
@@ -156,6 +161,15 @@
if (canSmoothWith)
canSmoothWith = typelist("canSmoothWith", canSmoothWith)
if(custom_materials && custom_materials.len)
var/temp_list = list()
for(var/i in custom_materials)
var/datum/material/material = getmaterialref(i) || i
temp_list[material] = custom_materials[material] //Get the proper instanced version
custom_materials = null //Null the list to prepare for applying the materials properly
set_custom_materials(temp_list)
ComponentInitialize()
return INITIALIZE_HINT_NORMAL
@@ -448,6 +462,11 @@
if(desc)
. += desc
if(custom_materials)
for(var/i in custom_materials)
var/datum/material/M = i
. += "<u>It is made out of [M.name]</u>."
if(reagents)
if(reagents.flags & TRANSPARENT)
. += "It contains:"
@@ -1111,7 +1130,7 @@
/**
* Recursive getter method to return a list of all ghosts orbitting this atom
*
*
* This will work fine without manually passing arguments.
*/
/atom/proc/get_all_orbiters(list/processed, source = TRUE)
@@ -1127,3 +1146,18 @@
var/atom/atom_orbiter = o
output += atom_orbiter.get_all_orbiters(processed, source = FALSE)
return output
///Sets the custom materials for an item.
/atom/proc/set_custom_materials(var/list/materials, multiplier = 1)
if(custom_materials) //Only runs if custom materials existed at first. Should usually be the case but check anyways
for(var/i in custom_materials)
var/datum/material/custom_material = i
custom_material.on_removed(src, material_flags) //Remove the current materials
custom_materials = list() //Reset the list
for(var/x in materials)
var/datum/material/custom_material = x
custom_material.on_applied(src, materials[custom_material] * multiplier, material_flags)
custom_materials[custom_material] += materials[x] * multiplier

View File

@@ -40,14 +40,14 @@
/obj/item/clothing/shoes/clown_shoes/banana_shoes/combat/Initialize()
. = ..()
var/datum/component/material_container/bananium = GetComponent(/datum/component/material_container)
bananium.insert_amount(max_recharge, MAT_BANANIUM)
bananium.insert_amount_mat(max_recharge, /datum/material/bananium)
START_PROCESSING(SSobj, src)
/obj/item/clothing/shoes/clown_shoes/banana_shoes/combat/process()
var/datum/component/material_container/bananium = GetComponent(/datum/component/material_container)
var/bananium_amount = bananium.amount(MAT_BANANIUM)
var/bananium_amount = bananium.get_material_amount(/datum/material/bananium)
if(bananium_amount < max_recharge)
bananium.insert_amount(min(recharge_rate, max_recharge - bananium_amount), MAT_BANANIUM)
bananium.insert_amount_mat(min(recharge_rate, max_recharge - bananium_amount), /datum/material/bananium)
/obj/item/clothing/shoes/clown_shoes/banana_shoes/combat/attack_self(mob/user)
ui_action_click(user)

View File

@@ -41,7 +41,7 @@
var/list/categories = list("Tools","Electronics","Construction","T-Comm","Security","Machinery","Medical","Misc","Dinnerware","Imported", "Search")
/obj/machinery/autolathe/Initialize()
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS), 0, TRUE, null, null, CALLBACK(src, .proc/AfterMaterialInsert))
AddComponent(/datum/component/material_container, list(/datum/material/iron, /datum/material/glass), 0, TRUE, null, null, CALLBACK(src, .proc/AfterMaterialInsert))
. = ..()
wires = new /datum/wires/autolathe(src)
@@ -74,8 +74,8 @@
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
data["total_amount"] = materials.total_amount
data["max_amount"] = materials.max_amount
data["metal_amount"] = materials.amount(MAT_METAL)
data["glass_amount"] = materials.amount(MAT_GLASS)
data["metal_amount"] = materials.get_material_amount(/datum/material/iron)
data["glass_amount"] = materials.get_material_amount(/datum/material/glass)
data["rightwall"] = wallcheck(4) // Wall data for ui
data["leftwall"] = wallcheck(8)
data["abovewall"] = wallcheck(1)
@@ -95,7 +95,9 @@
design["category"] = D.category
var/max_multiplier_list = list()
if(ispath(D.build_path, /obj/item/stack))
var/max_multiplier = min(D.maxstack, D.materials[MAT_METAL] ? round(materials.amount(MAT_METAL)/D.materials[MAT_METAL]):INFINITY,D.materials[MAT_GLASS]?round(materials.amount(MAT_GLASS)/D.materials[MAT_GLASS]):INFINITY)
var/max_multiplier
for(var/datum/material/mat in D.materials)
max_multiplier = min(D.maxstack, round(materials.get_material_amount(mat)/D.materials[mat]))
if (max_multiplier > 10 && !disabled)
max_multiplier_list += "10"
if (max_multiplier > 25 && !disabled)
@@ -222,9 +224,9 @@
use_power(MINERAL_MATERIAL_AMOUNT / 10)
else
switch(id_inserted)
if (MAT_METAL)
if (/datum/material/iron)
flick("autolathe_o",src)//plays metal insertion animation
if (MAT_GLASS)
else
flick("autolathe_r",src)//plays glass insertion animation
use_power(min(1000, amount_inserted / 100))
updateUsrDialog()
@@ -250,29 +252,33 @@
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
var/dat = "<b>Total amount:</b> [materials.total_amount] / [materials.max_amount] cm<sup>3</sup><br>"
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
dat += "<b>[M.name] amount:</b> [M.amount] cm<sup>3</sup><br>"
var/datum/material/M = mat_id
var/mineral_amount = materials.materials[mat_id]
if(mineral_amount > 0)
dat += "<b>[M.name] amount:</b> [mineral_amount] cm<sup>3</sup><br>"
return dat
/obj/machinery/autolathe/proc/can_build(datum/design/D, amount = 1)
if(D.make_reagents.len)
return FALSE
var/coeff = (ispath(D.build_path, /obj/item/stack) ? 1 : prod_coeff)
var/list/required_materials = list()
for(var/i in D.materials)
required_materials[i] = D.materials[i] * coeff * amount
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
if(D.materials[MAT_METAL] && (materials.amount(MAT_METAL) < (D.materials[MAT_METAL] * coeff * amount)))
return FALSE
if(D.materials[MAT_GLASS] && (materials.amount(MAT_GLASS) < (D.materials[MAT_GLASS] * coeff * amount)))
return FALSE
if(wallcheck(printdirection))
say("Output blocked, please remove obstruction.")
return FALSE
return TRUE
return materials.has_materials(required_materials)
/obj/machinery/autolathe/proc/get_design_cost_metal(datum/design/D)
var/coeff = (ispath(D.build_path, /obj/item/stack) ? 1 : prod_coeff)
var/dat
if(D.materials[MAT_METAL])
dat = D.materials[MAT_METAL] * coeff
if(D.materials[/datum/material/iron])
dat = D.materials[/datum/material/iron] * coeff
else
dat = 0
return dat
@@ -280,8 +286,8 @@
/obj/machinery/autolathe/proc/get_design_cost_glass(datum/design/D)
var/coeff = (ispath(D.build_path, /obj/item/stack) ? 1 : prod_coeff)
var/dat
if(D.materials[MAT_GLASS])
dat = D.materials[MAT_GLASS] * coeff
if(D.materials[/datum/material/glass])
dat = D.materials[/datum/material/glass] * coeff
else
dat = 0
return dat
@@ -333,18 +339,37 @@
/obj/machinery/autolathe/proc/make_item(datum/design/D, multiplier)
var/is_stack = ispath(request.build_path, /obj/item/stack)
var/coeff = (is_stack ? 1 : prod_coeff) //stacks are unaffected by production coefficient
var/metal_cost = request.materials[MAT_METAL]
var/glass_cost = request.materials[MAT_GLASS]
var/power = max(2000, (metal_cost + glass_cost) * multiplier / 5)
var/total_amount = 0
for(var/MAT in request.materials)
total_amount += request.materials[MAT]
var/power = max(2000, (total_amount)*multiplier/5) //Change this to use all materials
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
if (!materials)
say("No access to material storage, please contact the quartermaster.")
return FALSE
if(can_build(D, multiplier)) // Check if we can build if not, return
if((materials.amount(MAT_METAL) >= metal_cost * multiplier * coeff) && (materials.amount(MAT_GLASS) >= glass_cost * multiplier * coeff))
var/list/materials_used = list()
var/list/picked_materials
var/list/custom_materials = list() //These will apply their material effect, This should usually only be one.
for(var/MAT in request.materials)
var/datum/material/used_material = MAT
var/amount_needed = request.materials[MAT] * coeff * multiplier
if(istext(used_material)) //This means its a category
var/list/list_to_show = list()
for(var/i in SSmaterials.materials_by_category[used_material])
if(materials.materials[i])
list_to_show += i
used_material = input("Choose [used_material]", "Custom Material") as null|anything in list_to_show
if(!used_material)
return //Didn't pick any material, so you can't build shit either.
custom_materials[used_material] += amount_needed
materials_used[used_material] = amount_needed
if(materials.has_materials(materials_used))
use_power(power)
var/list/materials_used = list(MAT_METAL=metal_cost * coeff * multiplier, MAT_GLASS=glass_cost * coeff*multiplier)
materials.use_amount(materials_used)
materials.use_materials(materials_used)
being_built = list(D, multiplier)
desc = "It's building \a [initial(D.name)]."
icon_state = "autolathe_n"
@@ -367,6 +392,9 @@
for(var/mat in materials_used)
new_item.materials[mat] = materials_used[mat] / multiplier
new_item.autolathe_crafted(src)
if(picked_materials.len)
new_item.set_custom_materials(picked_materials, 1 / multiplier) //Ensure we get the non multiplied amount
item_beingbuilt = null
icon_state = "autolathe"
updateUsrDialog()

View File

@@ -164,7 +164,7 @@ GLOBAL_LIST_EMPTY(request_list)
name = "disassembled bounty board"
desc = "Used to build a new bounty board, just secure to the wall."
icon_state = "request_kiosk"
materials = list(MAT_METAL = 14000, MAT_GLASS = 8000)
materials = list(/datum/material/iron = 14000, /datum/material/glass = 8000)
result_path = /obj/machinery/bounty_board
/**

View File

@@ -287,4 +287,4 @@
desc = "Used for building buttons."
icon_state = "button"
result_path = /obj/machinery/button
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT)

View File

@@ -8,7 +8,7 @@
desc = "The basic construction for Nanotrasen-Always-Watching-You cameras."
icon = 'icons/obj/machines/camera.dmi'
icon_state = "cameracase"
materials = list(MAT_METAL=400, MAT_GLASS=250)
materials = list(/datum/material/iron=400, /datum/material/glass=250)
result_path = /obj/structure/camera_assembly
/obj/structure/camera_assembly

View File

@@ -138,7 +138,7 @@
desc = "A frame for a defibrillator mount. It can't be removed once it's placed."
icon = 'icons/obj/machines/defib_mount.dmi'
icon_state = "defibrillator_mount"
materials = list(MAT_METAL = 300, MAT_GLASS = 100)
materials = list(/datum/material/iron = 300, /datum/material/glass = 100)
w_class = WEIGHT_CLASS_BULKY
result_path = /obj/machinery/defibrillator_mount
pixel_shift = -28

View File

@@ -15,7 +15,7 @@
density = TRUE
max_integrity = 100
var/proj_pass_rate = 50 //How many projectiles will pass the cover. Lower means stronger cover
var/material = METAL
var/bar_material = METAL
/obj/structure/barricade/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
@@ -26,7 +26,7 @@
return
/obj/structure/barricade/attackby(obj/item/I, mob/user, params)
if(I.tool_behaviour == TOOL_WELDER && user.a_intent != INTENT_HARM && material == METAL)
if(I.tool_behaviour == TOOL_WELDER && user.a_intent != INTENT_HARM && bar_material == METAL)
if(obj_integrity < max_integrity)
if(!I.tool_start_check(user, amount=0))
return
@@ -60,7 +60,7 @@
desc = "This space is blocked off by a wooden barricade."
icon = 'icons/obj/structures.dmi'
icon_state = "woodenbarricade"
material = WOOD
bar_material = WOOD
var/drop_amount = 3
/obj/structure/barricade/wooden/attackby(obj/item/I, mob/user)
@@ -112,7 +112,7 @@
max_integrity = 280
proj_pass_rate = 20
pass_flags = LETPASSTHROW
material = SAND
bar_material = SAND
climbable = TRUE
smooth = SMOOTH_TRUE
canSmoothWith = list(/obj/structure/barricade/sandbags, /turf/closed/wall, /turf/closed/wall/r_wall, /obj/structure/falsewall, /obj/structure/falsewall/reinforced, /turf/closed/wall/rust, /turf/closed/wall/r_wall/rust, /obj/structure/barricade/security)

View File

@@ -50,10 +50,10 @@
/obj/machinery/droneDispenser/Initialize()
. = ..()
var/datum/component/material_container/materials = AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS), MINERAL_MATERIAL_AMOUNT * MAX_STACK_SIZE * 2, TRUE, /obj/item/stack)
materials.insert_amount(starting_amount)
var/datum/component/material_container/materials = AddComponent(/datum/component/material_container, list(/datum/material/iron, /datum/material/glass), MINERAL_MATERIAL_AMOUNT * MAX_STACK_SIZE * 2, TRUE, /obj/item/stack)
materials.insert_amount_mat(starting_amount)
materials.precise_insertion = TRUE
using_materials = list(MAT_METAL=metal_cost, MAT_GLASS=glass_cost)
using_materials = list(/datum/material/iron=metal_cost, /datum/material/glass=glass_cost)
/obj/machinery/droneDispenser/preloaded
starting_amount = 5000
@@ -138,7 +138,7 @@
update_icon()
if(DRONE_PRODUCTION)
materials.use_amount(using_materials)
materials.use_materials(using_materials)
if(power_used)
use_power(power_used)

View File

@@ -174,7 +174,7 @@ GLOBAL_LIST_EMPTY(allCasters)
name = "newscaster frame"
desc = "Used to build newscasters, just secure to the wall."
icon_state = "newscaster"
materials = list(MAT_METAL=14000, MAT_GLASS=8000)
materials = list(/datum/material/iron=14000, /datum/material/glass=8000)
result_path = /obj/machinery/newscaster

View File

@@ -954,7 +954,7 @@
desc = "Used for building turret control panels."
icon_state = "apc"
result_path = /obj/machinery/turretid
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT)
/obj/item/gun/proc/get_turret_properties()
. = list()

View File

@@ -18,7 +18,7 @@
var/item_recycle_sound = 'sound/items/welder.ogg'
/obj/machinery/recycler/Initialize()
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE, MAT_PLASTIC), INFINITY, FALSE, null, null, null, TRUE)
AddComponent(/datum/component/material_container, list(/datum/material/iron, /datum/material/glass, /datum/material/plasma, /datum/material/silver, /datum/material/gold, /datum/material/diamond, /datum/material/uranium, /datum/material/bananium, /datum/material/titanium, /datum/material/bluespace, /datum/material/plastic), INFINITY, FALSE, null, null, null, TRUE)
AddComponent(/datum/component/butchering, 1, amount_produced,amount_produced/5)
. = ..()
update_icon()

View File

@@ -16,6 +16,8 @@
var/selectable = 1 // Set to 0 for passive equipment such as mining scanner or armor plates
var/harmful = FALSE //Controls if equipment can be used to attack by a pacifist.
var/destroy_sound = 'sound/mecha/critdestr.ogg'
/// Bitflag. Used by exosuit fabricator to assign sub-categories based on which exosuits can equip this.
var/mech_flags = NONE
/obj/item/mecha_parts/mecha_equipment/proc/update_chassis_page()
if(chassis)

View File

@@ -1,7 +1,7 @@
// Sleeper, Medical Beam, and Syringe gun
/obj/item/mecha_parts/mecha_equipment/medical
mech_flags = EXOSUIT_MODULE_MEDICAL
/obj/item/mecha_parts/mecha_equipment/medical/Initialize()
. = ..()
START_PROCESSING(SSobj, src)
@@ -529,7 +529,7 @@
range = MELEE|RANGED
equip_cooldown = 0
var/obj/item/gun/medbeam/mech/medigun
materials = list(MAT_METAL = 15000, MAT_GLASS = 8000, MAT_PLASMA = 3000, MAT_GOLD = 8000, MAT_DIAMOND = 2000)
materials = list(/datum/material/iron = 15000, /datum/material/glass = 8000, /datum/material/plasma = 3000, /datum/material/gold = 8000, /datum/material/diamond = 2000)
/obj/item/mecha_parts/mecha_equipment/medical/mechmedbeam/Initialize()
. = ..()

View File

@@ -167,4 +167,4 @@
mineral_scan_pulse(get_turf(src))
#undef DRILL_BASIC
#undef DRILL_HARDENED
#undef DRILL_HARDENED

View File

@@ -400,7 +400,8 @@
/obj/item/mecha_parts/mecha_equipment/generator/get_equip_info()
var/output = ..()
if(output)
return "[output] \[[fuel]: [round(fuel.amount*fuel.perunit,0.1)] cm<sup>3</sup>\] - <a href='?src=[REF(src)];toggle=1'>[equip_ready?"A":"Dea"]ctivate</a>"
return "[output] \[[fuel]: [round(fuel.amount*fuel.mats_per_stack,0.1)] cm<sup>3</sup>\] - <a href='?src=[REF(src)];toggle=1'>[equip_ready?"A":"Dea"]ctivate</a>"
/obj/item/mecha_parts/mecha_equipment/generator/action(target)
if(chassis)
@@ -410,9 +411,9 @@
/obj/item/mecha_parts/mecha_equipment/generator/proc/load_fuel(var/obj/item/stack/sheet/P)
if(P.type == fuel.type && P.amount > 0)
var/to_load = max(max_fuel - fuel.amount*fuel.perunit,0)
var/to_load = max(max_fuel - fuel.amount*fuel.mats_per_stack,0)
if(to_load)
var/units = min(max(round(to_load / P.perunit),1),P.amount)
var/units = min(max(round(to_load / P.mats_per_stack),1),P.amount)
fuel.amount += units
P.use(units)
occupant_message("[units] unit\s of [fuel] successfully loaded.")
@@ -448,7 +449,7 @@
if(cur_charge < chassis.cell.maxcharge)
use_fuel = fuel_per_cycle_active
chassis.give_power(power_per_cycle)
fuel.amount -= min(use_fuel/fuel.perunit,fuel.amount)
fuel.amount -= min(use_fuel/fuel.mats_per_stack,fuel.amount)
update_equip_info()
return 1

View File

@@ -10,6 +10,7 @@
var/projectile_delay = 0
var/firing_effect_type = /obj/effect/temp_visual/dir_setting/firing_effect //the visual effect appearing when the weapon is fired.
var/kickback = TRUE //Will using this weapon in no grav push mecha back.
mech_flags = EXOSUIT_MODULE_COMBAT
/obj/item/mecha_parts/mecha_equipment/weapon/can_attach(obj/mecha/M)
if(!..())
@@ -153,7 +154,7 @@
fire_sound = 'sound/weapons/plasma_cutter.ogg'
harmful = TRUE
/obj/item/mecha_parts/mecha_equipment/weapon/energy/plasma/can_attach(obj/mecha/working/M)
/obj/item/mecha_parts/mecha_equipment/weapon/energy/plasma/can_attach(obj/mecha/M)
if(..()) //combat mech
return 1
else if(M.equipment.len < M.max_equip && istype(M))
@@ -178,6 +179,7 @@
equip_cooldown = 150
range = MELEE|RANGED
kickback = FALSE
mech_flags = EXOSUIT_MODULE_HONK
/obj/item/mecha_parts/mecha_equipment/weapon/honker/can_attach(obj/mecha/combat/honker/M)
if(..())
@@ -428,6 +430,7 @@
missile_speed = 1.5
projectile_energy_cost = 100
equip_cooldown = 20
mech_flags = EXOSUIT_MODULE_HONK
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/banana_mortar/can_attach(obj/mecha/combat/honker/M)
if(..())
@@ -445,6 +448,7 @@
missile_speed = 1.5
projectile_energy_cost = 100
equip_cooldown = 10
mech_flags = EXOSUIT_MODULE_HONK
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/mousetrap_mortar/can_attach(obj/mecha/combat/honker/M)
if(..())
@@ -470,6 +474,7 @@
projectiles = 10
projectile_energy_cost = 500
diags_first = TRUE
mech_flags = EXOSUIT_MODULE_HONK
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/punching_glove/can_attach(obj/mecha/combat/honker/M)
if(..())
@@ -499,4 +504,4 @@
if(ismovable(hit_atom))
var/atom/movable/AM = hit_atom
AM.safe_throw_at(get_edge_target_turf(AM,get_dir(src, AM)), 7, 2)
qdel(src)
qdel(src)

View File

@@ -9,22 +9,44 @@
active_power_usage = 5000
req_access = list(ACCESS_ROBOTICS)
circuit = /obj/item/circuitboard/machine/mechfab
var/time_coeff = 1
var/component_coeff = 1
var/datum/techweb/specialized/autounlocking/exofab/stored_research
var/sync = 0
var/part_set
var/datum/design/being_built
subsystem_type = /datum/controller/subsystem/processing/fastprocess
/// Current items in the build queue.
var/list/queue = list()
var/processing_queue = 0
var/screen = "main"
var/temp
/// Whether or not the machine is building the entire queue automagically.
var/process_queue = FALSE
/// The current design datum that the machine is building.
var/datum/design/being_built
/// World time when the build will finish.
var/build_finish = 0
/// World time when the build started.
var/build_start = 0
/// Reference to all materials used in the creation of the item being_built.
var/list/build_materials
/// Part currently stored in the Exofab.
var/obj/item/stored_part
/// Coefficient for the speed of item building. Based on the installed parts.
var/time_coeff = 1
/// Coefficient for the efficiency of material usage in item building. Based on the installed parts.
var/component_coeff = 1
/// Reference to the techweb.
var/datum/techweb/stored_research
/// Whether the Exofab links to the ore silo on init. Special derelict or maintanance variants should set this to FALSE.
var/link_on_init = TRUE
/// Reference to a remote material inventory, such as an ore silo.
var/datum/component/remote_materials/rmat
/// A list of categories that valid MECHFAB design datums will broadly categorise themselves under.
var/list/part_sets = list(
"Cyborg",
"Ripley",
"Firefighter",
"Odysseus",
"Clarke",
"Gygax",
"Durand",
"H.O.N.K",
@@ -32,12 +54,16 @@
"Exosuit Equipment",
"Exosuit Ammunition",
"Cyborg Upgrade Modules",
"Cybernetics",
"Implants",
"Control Interfaces",
"Misc"
)
/obj/machinery/mecha_part_fabricator/Initialize(mapload)
stored_research = new
rmat = AddComponent(/datum/component/remote_materials, "mechfab", mapload)
stored_research = SSresearch.science_tech
rmat = AddComponent(/datum/component/remote_materials, "mechfab", mapload && link_on_init)
RefreshParts() //Recalculating local material sizes if the fab isn't linked
return ..()
/obj/machinery/mecha_part_fabricator/RefreshParts()
@@ -60,347 +86,520 @@
T += Ml.rating
time_coeff = round(initial(time_coeff) - (initial(time_coeff)*(T))/5,0.01)
// Adjust the build time of any item currently being built.
if(being_built)
var/last_const_time = build_finish - build_start
var/new_const_time = get_construction_time_w_coeff(initial(being_built.construction_time))
var/const_time_left = build_finish - world.time
var/new_build_time = (new_const_time / last_const_time) * const_time_left
build_finish = world.time + new_build_time
update_static_data(usr)
/obj/machinery/mecha_part_fabricator/examine(mob/user)
. = ..()
if(in_range(user, src) || isobserver(user))
. += "<span class='notice'>The status display reads: Storing up to <b>[rmat.local_size]</b> material units.<br>Material consumption at <b>[component_coeff*100]%</b>.<br>Build time reduced by <b>[100-time_coeff*100]%</b>.<span>"
. += "<span class='notice'>The status display reads: Storing up to <b>[rmat.local_size]</b> material units.<br>Material consumption at <b>[component_coeff*100]%</b>.<br>Build time reduced by <b>[100-time_coeff*100]%</b>.</span>"
/obj/machinery/mecha_part_fabricator/emag_act()
if(obj_flags & EMAGGED)
return
obj_flags |= EMAGGED
req_access = list()
say("DB error \[Code 0x00F1\]")
sleep(10)
say("Attempting auto-repair...")
sleep(15)
say("User DB corrupted \[Code 0x00FA\]. Truncating data structure...")
sleep(30)
say("User DB truncated. Please contact your Nanotrasen system operator for future assistance.")
/obj/machinery/mecha_part_fabricator/proc/output_parts_list(set_name)
var/output = ""
for(var/v in stored_research.researched_designs)
var/datum/design/D = SSresearch.techweb_design_by_id(v)
if(D.build_type & MECHFAB)
if(!(set_name in D.category))
continue
output += "<div class='part'>[output_part_info(D)]<br>\["
if(check_resources(D))
output += "<a href='?src=[REF(src)];part=[D.id]'>Build</a> | "
output += "<a href='?src=[REF(src)];add_to_queue=[D.id]'>Add to queue</a>\]\[<a href='?src=[REF(src)];part_desc=[D.id]'>?</a>\]</div>"
return output
/obj/machinery/mecha_part_fabricator/proc/output_part_info(datum/design/D)
var/output = "[initial(D.name)] (Cost: [output_part_cost(D)]) [get_construction_time_w_coeff(D)/10]sec"
return output
/obj/machinery/mecha_part_fabricator/proc/output_part_cost(datum/design/D)
var/i = 0
var/output
/**
* Generates an info list for a given part.
*
* Returns a list of part information.
* * D - Design datum to get information on.
* * categories - Boolean, whether or not to parse snowflake categories into the part information list.
*/
/obj/machinery/mecha_part_fabricator/proc/output_part_info(datum/design/D, categories = FALSE)
var/cost = list()
for(var/c in D.materials)
output += "[i?" | ":null][get_resource_cost_w_coeff(D, c)] [material2name(c)]"
i++
return output
var/datum/material/M = c
cost[M.name] = get_resource_cost_w_coeff(D, M)
var/obj/built_item = D.build_path
var/list/category_override = null
var/list/sub_category = null
if(categories)
// Handle some special cases to build up sub-categories for the fab interface.
// Start with checking if this design builds a cyborg module.
if(built_item in typesof(/obj/item/borg/upgrade))
var/obj/item/borg/upgrade/U = built_item
var/module_types = initial(U.module_flags)
sub_category = list()
if(module_types)
if(module_types & BORG_MODULE_SECURITY)
sub_category += "Security"
if(module_types & BORG_MODULE_MINER)
sub_category += "Mining"
if(module_types & BORG_MODULE_JANITOR)
sub_category += "Janitor"
if(module_types & BORG_MODULE_MEDICAL)
sub_category += "Medical"
if(module_types & BORG_MODULE_ENGINEERING)
sub_category += "Engineering"
else
sub_category += "All Cyborgs"
// Else check if this design builds a piece of exosuit equipment.
else if(built_item in typesof(/obj/item/mecha_parts/mecha_equipment))
var/obj/item/mecha_parts/mecha_equipment/E = built_item
var/mech_types = initial(E.mech_flags)
sub_category = "Equipment"
if(mech_types)
category_override = list()
if(mech_types & EXOSUIT_MODULE_RIPLEY)
category_override += "Ripley"
if(mech_types & EXOSUIT_MODULE_ODYSSEUS)
category_override += "Odysseus"
if(mech_types & EXOSUIT_MODULE_CLARKE)
category_override += "Clarke"
if(mech_types & EXOSUIT_MODULE_GYGAX)
category_override += "Gygax"
if(mech_types & EXOSUIT_MODULE_DURAND)
category_override += "Durand"
if(mech_types & EXOSUIT_MODULE_HONK)
category_override += "H.O.N.K"
if(mech_types & EXOSUIT_MODULE_PHAZON)
category_override += "Phazon"
var/list/part = list(
"name" = D.name,
"desc" = initial(built_item.desc),
"printTime" = get_construction_time_w_coeff(initial(D.construction_time))/10,
"cost" = cost,
"id" = D.id,
"subCategory" = sub_category,
"categoryOverride" = category_override,
"searchMeta" = D.search_metadata
)
return part
/**
* Generates a list of resources / materials available to this Exosuit Fab
*
* Returns null if there is no material container available.
* List format is list(material_name = list(amount = ..., ref = ..., etc.))
*/
/obj/machinery/mecha_part_fabricator/proc/output_available_resources()
var/output
var/datum/component/material_container/materials = rmat.mat_container
var/list/material_data = list()
if(materials)
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
output += "<span class=\"res_name\">[M.name]: </span>[M.amount] cm&sup3;"
if(M.amount >= MINERAL_MATERIAL_AMOUNT)
output += "<span style='font-size:80%;'>- Remove \[<a href='?src=[REF(src)];remove_mat=1;material=[mat_id]'>1</a>\]"
if(M.amount >= (MINERAL_MATERIAL_AMOUNT * 10))
output += " | \[<a href='?src=[REF(src)];remove_mat=10;material=[mat_id]'>10</a>\]"
output += " | \[<a href='?src=[REF(src)];remove_mat=50;material=[mat_id]'>All</a>\]</span>"
output += "<br>"
else
output += "<font color='red'>No material storage connected, please contact the quartermaster.</font><br>"
return output
var/datum/material/M = mat_id
var/list/material_info = list()
var/amount = materials.materials[mat_id]
material_info = list(
"name" = M.name,
"ref" = REF(M),
"amount" = amount,
"sheets" = round(amount / MINERAL_MATERIAL_AMOUNT),
"removable" = amount >= MINERAL_MATERIAL_AMOUNT
)
material_data += list(material_info)
return material_data
return null
/**
* Intended to be called when an item starts printing.
*
* Adds the overlay to show the fab working and sets active power usage settings.
*/
/obj/machinery/mecha_part_fabricator/proc/on_start_printing()
add_overlay("fab-active")
use_power = ACTIVE_POWER_USE
/**
* Intended to be called when the exofab has stopped working and is no longer printing items.
*
* Removes the overlay to show the fab working and sets idle power usage settings. Additionally resets the description and turns off queue processing.
*/
/obj/machinery/mecha_part_fabricator/proc/on_finish_printing()
cut_overlay("fab-active")
use_power = IDLE_POWER_USE
desc = initial(desc)
process_queue = FALSE
/**
* Calculates resource/material costs for printing an item based on the machine's resource coefficient.
*
* Returns a list of k,v resources with their amounts.
* * D - Design datum to calculate the modified resource cost of.
*/
/obj/machinery/mecha_part_fabricator/proc/get_resources_w_coeff(datum/design/D)
var/list/resources = list()
for(var/R in D.materials)
resources[R] = get_resource_cost_w_coeff(D, R)
var/datum/material/M = R
resources[M] = get_resource_cost_w_coeff(D, M)
return resources
/**
* Checks if the Exofab has enough resources to print a given item.
*
* Returns FALSE if the design has no reagents used in its construction (?) or if there are insufficient resources.
* Returns TRUE if there are sufficient resources to print the item.
* * D - Design datum to calculate the modified resource cost of.
*/
/obj/machinery/mecha_part_fabricator/proc/check_resources(datum/design/D)
if(D.reagents_list.len) // No reagents storage - no reagent designs.
if(length(D.reagents_list)) // No reagents storage - no reagent designs.
return FALSE
var/datum/component/material_container/materials = rmat.mat_container
if(materials.has_materials(get_resources_w_coeff(D)))
return TRUE
return FALSE
/obj/machinery/mecha_part_fabricator/proc/build_part(datum/design/D)
var/list/res_coef = get_resources_w_coeff(D)
/**
* Attempts to build the next item in the build queue.
*
* Returns FALSE if either there are no more parts to build or the next part is not buildable.
* Returns TRUE if the next part has started building.
* * verbose - Whether the machine should use say() procs. Set to FALSE to disable the machine saying reasons for failure to build.
*/
/obj/machinery/mecha_part_fabricator/proc/build_next_in_queue(verbose = TRUE)
if(!length(queue))
return FALSE
var/datum/design/D = queue[1]
if(build_part(D, verbose))
remove_from_queue(1)
return TRUE
return FALSE
/**
* Starts the build process for a given design datum.
*
* Returns FALSE if the procedure fails. Returns TRUE when being_built is set.
* Uses materials.
* * D - Design datum to attempt to print.
* * verbose - Whether the machine should use say() procs. Set to FALSE to disable the machine saying reasons for failure to build.
*/
/obj/machinery/mecha_part_fabricator/proc/build_part(datum/design/D, verbose = TRUE)
if(!D)
return FALSE
var/datum/component/material_container/materials = rmat.mat_container
if (!materials)
say("No access to material storage, please contact the quartermaster.")
return 0
if(verbose)
say("No access to material storage, please contact the quartermaster.")
return FALSE
if (rmat.on_hold())
say("Mineral access is on hold, please contact the quartermaster.")
return 0
if(verbose)
say("Mineral access is on hold, please contact the quartermaster.")
return FALSE
if(!check_resources(D))
say("Not enough resources. Queue processing stopped.")
temp = {"<span class='alert'>Not enough resources to build next part.</span><br>
<a href='?src=[REF(src)];process_queue=1'>Try again</a> | <a href='?src=[REF(src)];clear_temp=1'>Return</a><a>"}
if(verbose)
say("Not enough resources. Processing stopped.")
return FALSE
build_materials = get_resources_w_coeff(D)
materials.use_materials(build_materials)
being_built = D
desc = "It's building \a [initial(D.name)]."
materials.use_amount(res_coef)
rmat.silo_log(src, "built", -1, "[D.name]", res_coef)
build_finish = world.time + get_construction_time_w_coeff(initial(D.construction_time))
build_start = world.time
desc = "It's building \a [D.name]."
add_overlay("fab-active")
use_power = ACTIVE_POWER_USE
updateUsrDialog()
sleep(get_construction_time_w_coeff(D))
use_power = IDLE_POWER_USE
cut_overlay("fab-active")
desc = initial(desc)
rmat.silo_log(src, "built", -1, "[D.name]", build_materials)
var/location = get_step(src,(dir))
var/obj/item/I = new D.build_path(location)
I.materials = res_coef
say("\The [I] is complete.")
being_built = null
updateUsrDialog()
return TRUE
/obj/machinery/mecha_part_fabricator/proc/update_queue_on_page()
send_byjax(usr,"mecha_fabricator.browser","queue",list_queue())
return
/obj/machinery/mecha_part_fabricator/process()
// If there's a stored part to dispense due to an obstruction, try to dispense it.
if(stored_part)
var/turf/exit = get_step(src,(dir))
if(exit.density)
return TRUE
/obj/machinery/mecha_part_fabricator/proc/add_part_set_to_queue(set_name)
if(set_name in part_sets)
for(var/v in stored_research.researched_designs)
var/datum/design/D = SSresearch.techweb_design_by_id(v)
if(D.build_type & MECHFAB)
if(set_name in D.category)
add_to_queue(D)
say("Obstruction cleared. \The [stored_part] is complete.")
stored_part.forceMove(exit)
stored_part = null
/obj/machinery/mecha_part_fabricator/proc/add_to_queue(D)
// If there's nothing being built, try to build something
if(!being_built)
// If we're not processing the queue anymore or there's nothing to build, end processing.
if(!process_queue || !build_next_in_queue())
on_finish_printing()
end_processing()
return TRUE
on_start_printing()
// If there's an item being built, check if it is complete.
if(being_built && (build_finish < world.time))
// Then attempt to dispense it and if appropriate build the next item.
dispense_built_part(being_built)
if(process_queue)
build_next_in_queue(FALSE)
return TRUE
/**
* Dispenses a part to the tile infront of the Exosuit Fab.
*
* Returns FALSE is the machine cannot dispense the part on the appropriate turf.
* Return TRUE if the part was successfully dispensed.
* * D - Design datum to attempt to dispense.
*/
/obj/machinery/mecha_part_fabricator/proc/dispense_built_part(datum/design/D)
var/obj/item/I = new D.build_path(src)
//I.set_custom_materials(build_materials)
being_built = null
var/turf/exit = get_step(src,(dir))
if(exit.density)
say("Error! Part outlet is obstructed.")
desc = "It's trying to dispense \a [D.name], but the part outlet is obstructed."
stored_part = I
return FALSE
say("\The [I] is complete.")
I.forceMove(exit)
return TRUE
/**
* Adds a list of datum designs to the build queue.
*
* Will only add designs that are in this machine's stored techweb.
* Does final checks for datum IDs and makes sure this machine can build the designs.
* * part_list - List of datum design ids for designs to add to the queue.
*/
/obj/machinery/mecha_part_fabricator/proc/add_part_set_to_queue(list/part_list)
for(var/v in stored_research.researched_designs)
var/datum/design/D = SSresearch.techweb_design_by_id(v)
if((D.build_type & MECHFAB) && (D.id in part_list))
add_to_queue(D)
/**
* Adds a datum design to the build queue.
*
* Returns TRUE if successful and FALSE if the design was not added to the queue.
* * D - Datum design to add to the queue.
*/
/obj/machinery/mecha_part_fabricator/proc/add_to_queue(datum/design/D)
if(!istype(queue))
queue = list()
if(D)
queue[++queue.len] = D
return queue.len
return TRUE
return FALSE
/**
* Removes datum design from the build queue based on index.
*
* Returns TRUE if successful and FALSE if a design was not removed from the queue.
* * index - Index in the build queue of the element to remove.
*/
/obj/machinery/mecha_part_fabricator/proc/remove_from_queue(index)
if(!isnum(index) || !ISINTEGER(index) || !istype(queue) || (index<1 || index>queue.len))
if(!isnum(index) || !ISINTEGER(index) || !istype(queue) || (index<1 || index>length(queue)))
return FALSE
queue.Cut(index,++index)
return TRUE
/obj/machinery/mecha_part_fabricator/proc/process_queue()
var/datum/design/D = queue[1]
if(!D)
remove_from_queue(1)
if(queue.len)
return process_queue()
else
return
temp = null
while(D)
if(stat&(NOPOWER|BROKEN))
return FALSE
if(build_part(D))
remove_from_queue(1)
else
return FALSE
D = listgetindex(queue, 1)
say("Queue processing finished successfully.")
/**
* Generates a list of parts formatted for tgui based on the current build queue.
*
* Returns a formatted list of lists containing formatted part information for every part in the build queue.
*/
/obj/machinery/mecha_part_fabricator/proc/list_queue()
var/output = "<b>Queue contains:</b>"
if(!istype(queue) || !queue.len)
output += "<br>Nothing"
else
output += "<ol>"
var/i = 0
for(var/datum/design/D in queue)
i++
var/obj/part = D.build_path
output += "<li[!check_resources(D)?" style='color: #f00;'":null]>"
output += initial(part.name) + " - "
output += "[i>1?"<a href='?src=[REF(src)];queue_move=-1;index=[i]' class='arrow'>&uarr;</a>":null] "
output += "[i<queue.len?"<a href='?src=[REF(src)];queue_move=+1;index=[i]' class='arrow'>&darr;</a>":null] "
output += "<a href='?src=[REF(src)];remove_from_queue=[i]'>Remove</a></li>"
if(!istype(queue) || !length(queue))
return null
output += "</ol>"
output += "\[<a href='?src=[REF(src)];process_queue=1'>Process queue</a> | <a href='?src=[REF(src)];clear_queue=1'>Clear queue</a>\]"
return output
var/list/queued_parts = list()
for(var/datum/design/D in queue)
var/list/part = output_part_info(D)
queued_parts += list(part)
return queued_parts
/obj/machinery/mecha_part_fabricator/proc/sync()
temp = "Updating local R&D database..."
updateUsrDialog()
sleep(30) //only sleep if called by user
for(var/obj/machinery/computer/rdconsole/RDC in oview(7,src))
RDC.stored_research.copy_research_to(stored_research)
temp = "Processed equipment designs.<br>"
//check if the tech coefficients have changed
temp += "<a href='?src=[REF(src)];clear_temp=1'>Return</a>"
updateUsrDialog()
say("Successfully synchronized with R&D server.")
return
temp = "Unable to connect to local R&D Database.<br>Please check your connections and try again.<br><a href='?src=[REF(src)];clear_temp=1'>Return</a>"
updateUsrDialog()
return
/obj/machinery/mecha_part_fabricator/proc/get_resource_cost_w_coeff(datum/design/D, resource, roundto = 1)
/**
* Calculates the coefficient-modified resource cost of a single material component of a design's recipe.
*
* Returns coefficient-modified resource cost for the given material component.
* * D - Design datum to pull the resource cost from.
* * resource - Material datum reference to the resource to calculate the cost of.
* * roundto - Rounding value for round() proc
*/
/obj/machinery/mecha_part_fabricator/proc/get_resource_cost_w_coeff(datum/design/D, datum/material/resource, roundto = 1)
return round(D.materials[resource]*component_coeff, roundto)
/obj/machinery/mecha_part_fabricator/proc/get_construction_time_w_coeff(datum/design/D, roundto = 1) //aran
return round(initial(D.construction_time)*time_coeff, roundto)
/**
* Calculates the coefficient-modified build time of a design.
*
* Returns coefficient-modified build time of a given design.
* * D - Design datum to calculate the modified build time of.
* * roundto - Rounding value for round() proc
*/
/obj/machinery/mecha_part_fabricator/proc/get_construction_time_w_coeff(construction_time, roundto = 1) //aran
return round(construction_time*time_coeff, roundto)
/obj/machinery/mecha_part_fabricator/ui_interact(mob/user)
. = ..()
var/dat, left_part
user.set_machine(src)
var/turf/exit = get_step(src,(dir))
if(exit.density)
say("Error! Part outlet is obstructed.")
return
if(temp)
left_part = temp
else if(being_built)
var/obj/I = being_built.build_path
left_part = {"<TT>Building [initial(I.name)].<BR>
Please wait until completion...</TT>"}
/obj/machinery/mecha_part_fabricator/ui_assets(mob/user)
return list(
get_asset_datum(/datum/asset/spritesheet/sheetmaterials)
)
/obj/machinery/mecha_part_fabricator/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "ExosuitFabricator")
ui.open()
/obj/machinery/mecha_part_fabricator/ui_static_data(mob/user)
var/list/data = list()
var/list/final_sets = list()
var/list/buildable_parts = list()
for(var/part_set in part_sets)
final_sets += part_set
for(var/v in stored_research.researched_designs)
var/datum/design/D = SSresearch.techweb_design_by_id(v)
if(D.build_type & MECHFAB)
// This is for us.
var/list/part = output_part_info(D, TRUE)
if(part["category_override"])
for(var/cat in part["category_override"])
buildable_parts[cat] += list(part)
if(!(cat in part_sets))
final_sets += cat
continue
for(var/cat in part_sets)
// Find all matching categories.
if(!(cat in D.category))
continue
buildable_parts[cat] += list(part)
data["partSets"] = final_sets
data["buildableParts"] = buildable_parts
return data
/obj/machinery/mecha_part_fabricator/ui_data(mob/user)
var/list/data = list()
data["materials"] = output_available_resources()
if(being_built)
var/list/part = list(
"name" = being_built.name,
"duration" = build_finish - world.time,
"printTime" = get_construction_time_w_coeff(initial(being_built.construction_time))
)
data["buildingPart"] = part
else
switch(screen)
if("main")
left_part = output_available_resources()+"<hr>"
left_part += "<a href='?src=[REF(src)];sync=1'>Sync with R&D servers</a><hr>"
for(var/part_set in part_sets)
left_part += "<a href='?src=[REF(src)];part_set=[part_set]'>[part_set]</a> - \[<a href='?src=[REF(src)];partset_to_queue=[part_set]'>Add all parts to queue</a>\]<br>"
if("parts")
left_part += output_parts_list(part_set)
left_part += "<hr><a href='?src=[REF(src)];screen=main'>Return</a>"
dat = {"<html>
<head>
<meta charset='UTF-8'>
<title>[name]</title>
<style>
.res_name {font-weight: bold; text-transform: capitalize;}
.red {color: #f00;}
.part {margin-bottom: 10px;}
.arrow {text-decoration: none; font-size: 10px;}
body, table {height: 100%;}
td {vertical-align: top; padding: 5px;}
html, body {padding: 0px; margin: 0px;}
h1 {font-size: 18px; margin: 5px 0px;}
</style>
<script language='javascript' type='text/javascript'>
[js_byjax]
</script>
</head><body>
<body>
<table style='width: 100%;'>
<tr>
<td style='width: 65%; padding-right: 10px;'>
[left_part]
</td>
<td style='width: 35%; background: #ccc;' id='queue'>
[list_queue()]
</td>
<tr>
</table>
</body>
</html>"}
user << browse(dat, "window=mecha_fabricator;size=1000x430")
onclose(user, "mecha_fabricator")
return
data["buildingPart"] = null
/obj/machinery/mecha_part_fabricator/Topic(href, href_list)
if(..())
data["queue"] = list_queue()
if(stored_part)
data["storedPart"] = stored_part.name
else
data["storedPart"] = null
data["isProcessingQueue"] = process_queue
return data
/obj/machinery/mecha_part_fabricator/ui_act(action, list/params)
. = ..()
if(.)
return
if(href_list["part_set"])
var/tpart_set = href_list["part_set"]
if(tpart_set)
if(tpart_set=="clear")
part_set = null
else
part_set = tpart_set
screen = "parts"
if(href_list["part"])
var/T = href_list["part"]
for(var/v in stored_research.researched_designs)
var/datum/design/D = SSresearch.techweb_design_by_id(v)
if(D.build_type & MECHFAB)
if(D.id == T)
if(!processing_queue)
build_part(D)
else
add_to_queue(D)
break
if(href_list["add_to_queue"])
var/T = href_list["add_to_queue"]
for(var/v in stored_research.researched_designs)
var/datum/design/D = SSresearch.techweb_design_by_id(v)
if(D.build_type & MECHFAB)
if(D.id == T)
. = TRUE
add_fingerprint(usr)
usr.set_machine(src)
switch(action)
if("sync_rnd")
// Syncronises designs on interface with R&D techweb.
update_static_data(usr)
say("Successfully synchronized with R&D server.")
return
if("add_queue_set")
// Add all parts of a set to queue
var/part_list = params["part_list"]
add_part_set_to_queue(part_list)
return
if("add_queue_part")
// Add a specific part to queue
var/T = params["id"]
for(var/v in stored_research.researched_designs)
var/datum/design/D = SSresearch.techweb_design_by_id(v)
if((D.build_type & MECHFAB) && (D.id == T))
add_to_queue(D)
break
return update_queue_on_page()
if(href_list["remove_from_queue"])
remove_from_queue(text2num(href_list["remove_from_queue"]))
return update_queue_on_page()
if(href_list["partset_to_queue"])
add_part_set_to_queue(href_list["partset_to_queue"])
return update_queue_on_page()
if(href_list["process_queue"])
spawn(0)
if(processing_queue || being_built)
return FALSE
processing_queue = 1
process_queue()
processing_queue = 0
if(href_list["clear_temp"])
temp = null
if(href_list["screen"])
screen = href_list["screen"]
if(href_list["queue_move"] && href_list["index"])
var/index = text2num(href_list["index"])
var/new_index = index + text2num(href_list["queue_move"])
if(isnum(index) && isnum(new_index) && ISINTEGER(index) && ISINTEGER(new_index))
if(ISINRANGE(new_index,1,queue.len))
queue.Swap(index,new_index)
return update_queue_on_page()
if(href_list["clear_queue"])
queue = list()
return update_queue_on_page()
if(href_list["sync"])
sync()
if(href_list["part_desc"])
var/T = href_list["part_desc"]
for(var/v in stored_research.researched_designs)
var/datum/design/D = SSresearch.techweb_design_by_id(v)
if(D.build_type & MECHFAB)
if(D.id == T)
var/obj/part = D.build_path
temp = {"<h1>[initial(part.name)] description:</h1>
[initial(part.desc)]<br>
<a href='?src=[REF(src)];clear_temp=1'>Return</a>
"}
break
return
if("del_queue_part")
// Delete a specific from from the queue
var/index = text2num(params["index"])
remove_from_queue(index)
return
if("clear_queue")
// Delete everything from queue
queue.Cut()
return
if("build_queue")
// Build everything in queue
if(process_queue)
return
process_queue = TRUE
if(href_list["remove_mat"] && href_list["material"])
eject_sheets(href_list["material"], href_list["remove_mat"])
if(!being_built)
begin_processing()
return
if("stop_queue")
// Pause queue building. Also known as stop.
process_queue = FALSE
return
if("build_part")
// Build a single part
if(being_built || process_queue)
return
updateUsrDialog()
return
var/id = params["id"]
var/datum/design/D = SSresearch.techweb_design_by_id(id)
if(!(D.build_type & MECHFAB) || !(D.id == id))
return
if(build_part(D))
on_start_printing()
begin_processing()
return
if("move_queue_part")
// Moves a part up or down in the queue.
var/index = text2num(params["index"])
var/new_index = index + text2num(params["newindex"])
if(isnum(index) && isnum(new_index) && ISINTEGER(index) && ISINTEGER(new_index))
if(ISINRANGE(new_index,1,length(queue)))
queue.Swap(index,new_index)
return
if("remove_mat")
// Remove a material from the fab
var/mat_ref = params["ref"]
var/amount = text2num(params["amount"])
var/datum/material/mat = locate(mat_ref)
eject_sheets(mat, amount)
return
return FALSE
/**
* Eject material sheets.
*
* Returns the number of sheets successfully ejected.
* eject_sheet - Byond REF of the material to eject.
* eject_amt - Number of sheets to attempt to eject.
*/
/obj/machinery/mecha_part_fabricator/proc/eject_sheets(eject_sheet, eject_amt)
var/datum/component/material_container/mat_container = rmat.mat_container
if (!mat_container)
@@ -415,23 +614,26 @@
rmat.silo_log(src, "ejected", -count, "sheets", matlist)
return count
/obj/machinery/mecha_part_fabricator/proc/AfterMaterialInsert(type_inserted, id_inserted, amount_inserted)
var/stack_name = material2name(id_inserted)
add_overlay("fab-load-[stack_name]")
addtimer(CALLBACK(src, /atom/proc/cut_overlay, "fab-load-[stack_name]"), 10)
updateUsrDialog()
/obj/machinery/mecha_part_fabricator/proc/AfterMaterialInsert(item_inserted, id_inserted, amount_inserted)
var/datum/material/M = id_inserted
add_overlay("fab-load-[M.name]")
addtimer(CALLBACK(src, /atom/proc/cut_overlay, "fab-load-[M.name]"), 10)
/obj/machinery/mecha_part_fabricator/attackby(obj/item/W, mob/user, params)
if(default_deconstruction_screwdriver(user, "fab-o", "fab-idle", W))
/obj/machinery/mecha_part_fabricator/screwdriver_act(mob/living/user, obj/item/I)
if(..())
return TRUE
if(being_built)
to_chat(user, "<span class='warning'>\The [src] is currently processing! Please wait until completion.</span>")
return FALSE
return default_deconstruction_screwdriver(user, "fab-o", "fab-idle", I)
if(default_deconstruction_crowbar(W))
/obj/machinery/mecha_part_fabricator/crowbar_act(mob/living/user, obj/item/I)
if(..())
return TRUE
return ..()
/obj/machinery/mecha_part_fabricator/proc/material2name(ID)
return copytext(ID,2)
if(being_built)
to_chat(user, "<span class='warning'>\The [src] is currently processing! Please wait until completion.</span>")
return FALSE
return default_deconstruction_crowbar(I)
/obj/machinery/mecha_part_fabricator/proc/is_insertion_ready(mob/user)
if(panel_open)
@@ -440,5 +642,7 @@
if(being_built)
to_chat(user, "<span class='warning'>\The [src] is currently processing! Please wait until completion.</span>")
return FALSE
return TRUE
return TRUE
/obj/machinery/mecha_part_fabricator/maint
link_on_init = FALSE

View File

@@ -66,7 +66,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
var/equip_delay_other = 20 //In deciseconds, how long an item takes to put on another person
var/strip_delay = 40 //In deciseconds, how long an item takes to remove from another person
var/breakouttime = 0
var/list/materials
var/list/materials //materials in this object, and the amount
var/list/attack_verb //Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]"
var/list/species_exception = null // list() of species types, if a species cannot put items in a certain slot, but species type is in list, it will be able to wear that item
@@ -110,6 +110,14 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
materials = typelist("materials", materials)
if(materials) //Otherwise, use the instances already provided.
var/list/temp_list = list()
for(var/i in materials) //Go through all of our materials, get the subsystem instance, and then replace the list.
var/amount = materials[i]
var/datum/material/M = getmaterialref(i)
temp_list[M] = amount
materials = temp_list
if (attack_verb)
attack_verb = typelist("attack_verb", attack_verb)

View File

@@ -22,7 +22,7 @@ AI MODULES
throw_range = 7
var/list/laws = list()
var/bypass_law_amt_check = 0
materials = list(MAT_GOLD=50)
materials = list(/datum/material/gold=50)
/obj/item/aiModule/examine(var/mob/user as mob)
. = ..()

View File

@@ -23,7 +23,7 @@ RLD
throw_range = 5
w_class = WEIGHT_CLASS_NORMAL
slot_flags = ITEM_SLOT_BELT
materials = list(MAT_METAL=100000)
materials = list(/datum/material/iron=100000)
req_access_txt = "11"
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 50)
resistance_flags = FIRE_PROOF
@@ -599,11 +599,11 @@ RLD
w_class = WEIGHT_CLASS_TINY
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
materials = list(MAT_METAL=12000, MAT_GLASS=8000)
materials = list(/datum/material/iron=12000, /datum/material/glass=8000)
var/ammoamt = 40
/obj/item/rcd_ammo/large
materials = list(MAT_METAL=48000, MAT_GLASS=32000)
materials = list(/datum/material/iron=48000, /datum/material/glass=32000)
ammoamt = 160

View File

@@ -206,7 +206,7 @@ GLOBAL_LIST_INIT(fluid_duct_recipes, list(
throw_range = 5
w_class = WEIGHT_CLASS_NORMAL
slot_flags = ITEM_SLOT_BELT
materials = list(MAT_METAL=75000, MAT_GLASS=37500)
materials = list(/datum/material/iron=75000, /datum/material/glass=37500)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 50)
resistance_flags = FIRE_PROOF
var/datum/effect_system/spark_spread/spark_system

View File

@@ -7,7 +7,7 @@
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=50, MAT_GLASS=50)
materials = list(/datum/material/iron=50, /datum/material/glass=50)
flags_1 = CONDUCT_1
item_flags = NOBLUDGEON

View File

@@ -1,6 +1,6 @@
/obj/item/wallframe
icon = 'icons/obj/wallframe.dmi'
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT*2)
materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT*2)
flags_1 = CONDUCT_1
item_state = "syringe_kit"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
@@ -66,8 +66,8 @@
if(iswallturf(T))
T.attackby(src, user, params)
var/metal_amt = round(materials[MAT_METAL]/MINERAL_MATERIAL_AMOUNT)
var/glass_amt = round(materials[MAT_GLASS]/MINERAL_MATERIAL_AMOUNT)
var/metal_amt = round(materials[/datum/material/iron]/MINERAL_MATERIAL_AMOUNT)
var/glass_amt = round(materials[/datum/material/glass]/MINERAL_MATERIAL_AMOUNT)
if(W.tool_behaviour == TOOL_WRENCH && (metal_amt || glass_amt))
to_chat(user, "<span class='notice'>You dismantle [src].</span>")
@@ -119,5 +119,5 @@
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
flags_1 = CONDUCT_1
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=50, MAT_GLASS=50)
materials = list(/datum/material/iron=50, /datum/material/glass=50)
grind_results = list(/datum/reagent/iron = 10, /datum/reagent/silicon = 10)

View File

@@ -10,7 +10,7 @@
item_state = "electronic"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
materials = list(MAT_GLASS=1000)
materials = list(/datum/material/glass=1000)
w_class = WEIGHT_CLASS_SMALL
grind_results = list(/datum/reagent/silicon = 20)
var/build_path = null

View File

@@ -8,7 +8,7 @@
item_flags = NOBLUDGEON
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
materials = list(MAT_METAL=250, MAT_GLASS=500)
materials = list(/datum/material/iron=250, /datum/material/glass=500)
var/max_duration = 3000
var/duration = 300
var/last_use = 0

View File

@@ -12,7 +12,7 @@
item_flags = NOBLUDGEON
force = 3
attack_verb = list("blown up", "exploded", "detonated")
materials = list(MAT_METAL=50, MAT_GLASS=30)
materials = list(/datum/material/iron=50, /datum/material/glass=30)
/obj/item/doorCharge/ex_act(severity, target)
switch(severity)

View File

@@ -5,7 +5,7 @@
icon = 'icons/obj/module.dmi'
icon_state = "boris"
w_class = WEIGHT_CLASS_TINY
materials = list(MAT_METAL = 50, MAT_GLASS = 300)
materials = list(/datum/material/iron = 50, /datum/material/glass = 300)
var/recharging = FALSE
var/circuits = 5 //How many circuits the pseudocircuit has left
var/static/recycleable_circuits = typecacheof(list(/obj/item/electronics/firelock, /obj/item/electronics/airalarm, /obj/item/electronics/firealarm, \

View File

@@ -10,7 +10,7 @@
w_class = WEIGHT_CLASS_SMALL
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
materials = list(MAT_METAL=50, MAT_GLASS=20)
materials = list(/datum/material/iron=50, /datum/material/glass=20)
actions_types = list(/datum/action/item_action/toggle_light)
var/on = FALSE
var/brightness_on = 4 //range of light when on

View File

@@ -9,7 +9,7 @@
item_state = "electronic"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
materials = list(MAT_METAL=250, MAT_GLASS=500)
materials = list(/datum/material/iron=250, /datum/material/glass=500)
var/max_shield_integrity = 250
var/shield_integrity = 250
var/max_fields = 3

View File

@@ -18,7 +18,7 @@
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
w_class = WEIGHT_CLASS_SMALL
slot_flags = ITEM_SLOT_BELT
materials = list(MAT_METAL = 150, MAT_GLASS = 150)
materials = list(/datum/material/iron = 150, /datum/material/glass = 150)
var/grace = RAD_GRACE_PERIOD
var/datum/looping_sound/geiger/soundloop

View File

@@ -8,7 +8,7 @@
flags_1 = CONDUCT_1
item_flags = NOBLUDGEON
slot_flags = ITEM_SLOT_BELT
materials = list(MAT_METAL=500, MAT_GLASS=500)
materials = list(/datum/material/iron=500, /datum/material/glass=500)
w_class = WEIGHT_CLASS_SMALL
var/turf/pointer_loc
var/energy = 5

View File

@@ -24,7 +24,7 @@
throwforce = 0
throw_range = 7
throw_speed = 3
materials = list(MAT_METAL=50, MAT_GLASS=20)
materials = list(/datum/material/iron=50, /datum/material/glass=20)
var/obj/machinery/buffer // simple machine buffer for device linkage
toolspeed = 1
usesound = 'sound/weapons/empty.ogg'

View File

@@ -6,7 +6,7 @@
item_flags = NOBLUDGEON
var/paint_color = "grey"
materials = list(MAT_METAL=5000, MAT_GLASS=2000)
materials = list(/datum/material/iron=5000, /datum/material/glass=2000)
/obj/item/pipe_painter/afterattack(atom/A, mob/user, proximity_flag)
. = ..()

View File

@@ -13,7 +13,7 @@
throwforce = 5
throw_speed = 1
throw_range = 2
materials = list(MAT_METAL=750)
materials = list(/datum/material/iron=750)
var/drain_rate = 2000000 // amount of power to drain per tick
var/power_drained = 0 // has drained this much power
var/max_power = 6e8 // maximum power that can be drained before exploding

View File

@@ -9,7 +9,7 @@
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BACK
w_class = WEIGHT_CLASS_HUGE
materials = list(MAT_METAL=10000, MAT_GLASS=2500)
materials = list(/datum/material/iron=10000, /datum/material/glass=2500)
var/on = TRUE
var/code = 2
var/frequency = FREQ_ELECTROPACK

View File

@@ -19,7 +19,7 @@ GLOBAL_LIST_INIT(channel_tokens, list(
desc = "An updated, modular intercom that fits over the head. Takes encryption keys."
icon_state = "headset"
item_state = "headset"
materials = list(MAT_METAL=75)
materials = list(/datum/material/iron=75)
subspace_transmission = TRUE
canhear_range = 0 // can't hear headsets from very far away
@@ -73,7 +73,7 @@ GLOBAL_LIST_INIT(channel_tokens, list(
else if(AIuser)
return ..(freq, level)
return FALSE
/obj/item/radio/headset/ui_data(mob/user)
. = ..()
.["headset"] = TRUE

View File

@@ -151,4 +151,4 @@
result_path = /obj/item/radio/intercom/unscrewed
pixel_shift = 29
inverse = TRUE
materials = list(MAT_METAL = 75, MAT_GLASS = 25)
materials = list(/datum/material/iron = 75, /datum/material/glass = 25)

View File

@@ -11,7 +11,7 @@
throw_speed = 3
throw_range = 7
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=75, MAT_GLASS=25)
materials = list(/datum/material/iron=75, /datum/material/glass=25)
obj_flags = USES_TGUI
var/on = TRUE

View File

@@ -22,7 +22,7 @@ GENE SCANNER
item_state = "electronic"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
materials = list(MAT_METAL=150)
materials = list(/datum/material/iron=150)
/obj/item/t_scanner/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins to emit terahertz-rays into [user.p_their()] brain with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
@@ -86,7 +86,7 @@ GENE SCANNER
w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 7
materials = list(MAT_METAL=200)
materials = list(/datum/material/iron=200)
var/mode = 1
var/scanmode = 0
var/advanced = FALSE
@@ -442,7 +442,7 @@ GENE SCANNER
throw_speed = 3
throw_range = 7
tool_behaviour = TOOL_ANALYZER
materials = list(MAT_METAL=30, MAT_GLASS=20)
materials = list(/datum/material/iron=30, /datum/material/glass=20)
grind_results = list(/datum/reagent/mercury = 5, /datum/reagent/iron = 5, /datum/reagent/silicon = 5)
var/cooldown = FALSE
var/cooldown_time = 250
@@ -630,7 +630,7 @@ GENE SCANNER
throwforce = 0
throw_speed = 3
throw_range = 7
materials = list(MAT_METAL=30, MAT_GLASS=20)
materials = list(/datum/material/iron=30, /datum/material/glass=20)
/obj/item/slime_scanner/attack(mob/living/M, mob/living/user)
if(user.stat || user.eye_blind)
@@ -689,7 +689,7 @@ GENE SCANNER
w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 7
materials = list(MAT_METAL=200)
materials = list(/datum/material/iron=200)
/obj/item/nanite_scanner/attack(mob/living/M, mob/living/carbon/human/user)
user.visible_message("<span class='notice'>[user] has analyzed [M]'s nanites.</span>")
@@ -715,7 +715,7 @@ GENE SCANNER
w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 7
materials = list(MAT_METAL=200)
materials = list(/datum/material/iron=200)
var/list/discovered = list() //hit a dna console to update the scanners database
var/list/buffer
var/ready = TRUE

View File

@@ -9,7 +9,7 @@
w_class = WEIGHT_CLASS_SMALL
flags_1 = HEAR_1
slot_flags = ITEM_SLOT_BELT
materials = list(MAT_METAL=60, MAT_GLASS=30)
materials = list(/datum/material/iron=60, /datum/material/glass=30)
force = 2
throwforce = 0
var/recording = 0
@@ -220,7 +220,7 @@
if(mytape.ruined)
to_chat(user, "<span class='notice'>The tape inside the [src] appears to be broken.</span>")
return
update_available_icons()
if(icons_available)
var/selection = show_radial_menu(user, src, icons_available, radius = 38, require_near = TRUE, tooltips = TRUE)
@@ -283,7 +283,7 @@
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
w_class = WEIGHT_CLASS_TINY
materials = list(MAT_METAL=20, MAT_GLASS=5)
materials = list(/datum/material/iron=20, /datum/material/glass=5)
force = 1
throwforce = 0
var/max_capacity = 600

View File

@@ -69,7 +69,7 @@ effective or pretty fucking useless.
*/
/obj/item/healthanalyzer/rad_laser
materials = list(MAT_METAL=400)
materials = list(/datum/material/iron=400)
var/irradiate = TRUE
var/stealth = FALSE
var/used = FALSE // is it cooling down?

View File

@@ -11,7 +11,7 @@
throw_speed = 2
throw_range = 7
force = 10
materials = list(MAT_METAL = 90)
materials = list(/datum/material/iron = 90)
attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed")
dog_fashion = /datum/dog_fashion/back
resistance_flags = FIRE_PROOF
@@ -36,7 +36,7 @@
throwforce = 2
w_class = WEIGHT_CLASS_SMALL
force = 3
materials = list(MAT_METAL = 50, MAT_GLASS = 40)
materials = list(/datum/material/iron = 50, /datum/material/glass = 40)
max_water = 30
sprite_name = "miniFE"
dog_fashion = null

View File

@@ -12,7 +12,7 @@
throw_speed = 1
throw_range = 5
w_class = WEIGHT_CLASS_NORMAL
materials = list(MAT_METAL=500)
materials = list(/datum/material/iron=500)
resistance_flags = FIRE_PROOF
var/status = FALSE
var/lit = FALSE //on or off

View File

@@ -34,7 +34,7 @@
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 5
materials = list(MAT_METAL=500)
materials = list(/datum/material/iron=500)
breakouttime = 600 //Deciseconds = 60s = 1 minute
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
var/cuffsound = 'sound/weapons/handcuffs.ogg'
@@ -116,7 +116,7 @@
color = "#ff0000"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
materials = list(MAT_METAL=150, MAT_GLASS=75)
materials = list(/datum/material/iron=150, /datum/material/glass=75)
breakouttime = 300 //Deciseconds = 30s
cuffsound = 'sound/weapons/cablecuff.ogg'

View File

@@ -9,7 +9,7 @@
throw_speed = 2
throw_range = 5
w_class = WEIGHT_CLASS_TINY
materials = list(MAT_GLASS=500)
materials = list(/datum/material/glass=500)
var/obj/item/implant/imp = null
var/imp_type

View File

@@ -9,7 +9,7 @@
throw_speed = 3
throw_range = 5
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=600, MAT_GLASS=200)
materials = list(/datum/material/iron=600, /datum/material/glass=200)
var/obj/item/implant/imp = null
var/imp_type = null

View File

@@ -23,7 +23,7 @@
throwforce = 0
throw_speed = 3
throw_range = 5
materials = list(MAT_METAL=80)
materials = list(/datum/material/iron=80)
flags_1 = CONDUCT_1
attack_verb = list("attacked", "stabbed", "poked")
hitsound = 'sound/weapons/bladeslice.ogg'
@@ -73,7 +73,7 @@
hitsound = 'sound/weapons/bladeslice.ogg'
throw_speed = 3
throw_range = 6
materials = list(MAT_METAL=12000)
materials = list(/datum/material/iron=12000)
attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
sharpness = IS_SHARP_ACCURATE
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
@@ -131,7 +131,7 @@
flags_1 = CONDUCT_1
force = 15
throwforce = 10
materials = list(MAT_METAL=18000)
materials = list(/datum/material/iron=18000)
attack_verb = list("cleaved", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
w_class = WEIGHT_CLASS_NORMAL
custom_price = 60

View File

@@ -15,7 +15,7 @@
w_class = WEIGHT_CLASS_NORMAL
attack_verb = list("flogged", "whipped", "lashed", "disciplined")
hitsound = 'sound/weapons/chainhit.ogg'
materials = list(MAT_METAL = 1000)
materials = list(/datum/material/iron = 1000)
/obj/item/melee/chainofcommand/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is strangling [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
@@ -57,7 +57,7 @@
sharpness = IS_SHARP
attack_verb = list("slashed", "cut")
hitsound = 'sound/weapons/rapierhit.ogg'
materials = list(MAT_METAL = 1000)
materials = list(/datum/material/iron = 1000)
/obj/item/melee/cutlass
name = "cutlass"
@@ -71,7 +71,7 @@
w_class = WEIGHT_CLASS_BULKY
attack_verb = list("slashed", "cut")
hitsound = 'sound/weapons/rapierhit.ogg'
materials = list(MAT_METAL = 1000)
materials = list(/datum/material/iron = 1000)
/obj/item/melee/sabre/Initialize()
. = ..()

View File

@@ -15,7 +15,7 @@
w_class = WEIGHT_CLASS_BULKY
throw_speed = 2
throw_range = 3
materials = list(MAT_METAL = 7500, MAT_GLASS = 100)
materials = list(/datum/material/iron = 7500, /datum/material/glass = 100)
var/open = TRUE
var/locked = FALSE
var/list/occupants = list()

View File

@@ -12,7 +12,7 @@
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
throw_speed = 3
throw_range = 7
materials = list(MAT_METAL = 500, MAT_GLASS = 250)
materials = list(/datum/material/iron = 500, /datum/material/glass = 250)
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
var/active = FALSE
var/atom/movable/target //The thing we're searching for

View File

@@ -13,6 +13,8 @@
// if true, is not stored in the robot to be ejected
// if module is reset
var/one_use = FALSE
/// Bitflags listing module compatibility. Used in the exosuit fabricator for creating sub-categories.
var/list/module_flags = NONE
/obj/item/borg/upgrade/proc/action(mob/living/silicon/robot/R, user = usr)
if(R.stat == DEAD)
@@ -95,6 +97,7 @@
icon_state = "cyborg_upgrade3"
require_module = 1
module_type = /obj/item/robot_module/security
module_flags = BORG_MODULE_SECURITY
/obj/item/borg/upgrade/disablercooler/action(mob/living/silicon/robot/R, user = usr)
. = ..()
@@ -143,6 +146,7 @@
icon_state = "cyborg_upgrade3"
require_module = 1
module_type = /obj/item/robot_module/miner
module_flags = BORG_MODULE_MINER
/obj/item/borg/upgrade/ddrill/action(mob/living/silicon/robot/R, user = usr)
. = ..()
@@ -175,6 +179,7 @@
icon_state = "cyborg_upgrade3"
require_module = 1
module_type = /obj/item/robot_module/miner
module_flags = BORG_MODULE_MINER
/obj/item/borg/upgrade/soh/action(mob/living/silicon/robot/R , user = usr) //yogs single line
. = ..()
@@ -207,6 +212,7 @@
icon_state = "cyborg_upgrade3"
require_module = 1
module_type = /obj/item/robot_module/janitor
module_flags = BORG_MODULE_JANITOR
/obj/item/borg/upgrade/tboh/action(mob/living/silicon/robot/R, user = usr)//yogs single line
. = ..()
@@ -239,6 +245,7 @@
icon_state = "cyborg_upgrade3"
require_module = 1
module_type = /obj/item/robot_module/janitor
module_flags = BORG_MODULE_JANITOR
/obj/item/borg/upgrade/amop/action(mob/living/silicon/robot/R, user = usr)//yogs single line
. = ..()
@@ -293,6 +300,7 @@
resistance_flags = LAVA_PROOF | FIRE_PROOF
require_module = 1
module_type = /obj/item/robot_module/miner
module_flags = BORG_MODULE_MINER
/obj/item/borg/upgrade/lavaproof/action(mob/living/silicon/robot/R, user = usr)
. = ..()
@@ -424,6 +432,7 @@
require_module = 1
module_type = /obj/item/robot_module/medical
var/list/additional_reagents = list()
module_flags = BORG_MODULE_MEDICAL
/obj/item/borg/upgrade/hypospray/action(mob/living/silicon/robot/R, user = usr)
. = ..()
@@ -483,6 +492,7 @@
icon_state = "cyborg_upgrade3"
require_module = 1
module_type = /obj/item/robot_module/medical
module_flags = BORG_MODULE_MEDICAL
/obj/item/borg/upgrade/defib/action(mob/living/silicon/robot/R, user = usr)
. = ..()
@@ -510,6 +520,7 @@
icon_state = "cyborg_upgrade3"
require_module = 1
module_type = /obj/item/robot_module/medical
module_flags = BORG_MODULE_MEDICAL
/obj/item/borg/upgrade/processor/action(mob/living/silicon/robot/R, user = usr)
. = ..()
@@ -600,6 +611,7 @@
icon_state = "borgrped"
require_module = TRUE
module_type = /obj/item/robot_module/engineering
module_flags = BORG_MODULE_ENGINEERING
/obj/item/borg/upgrade/rped/action(mob/living/silicon/robot/R, user = usr)
. = ..()
@@ -627,6 +639,7 @@
icon_state = "adv_plasmacutter"
require_module = TRUE
module_type = /obj/item/robot_module/miner
module_flags = BORG_MODULE_MINER
/obj/item/borg/upgrade/plasmacutter/action(mob/living/silicon/robot/R, user = usr)
. = ..()
@@ -654,6 +667,7 @@
icon_state = "pinpointer_crew"
require_module = TRUE
module_type = /obj/item/robot_module/medical
module_flags = BORG_MODULE_MEDICAL
/obj/item/borg/upgrade/pinpointer/action(mob/living/silicon/robot/R, user = usr)
. = ..()
@@ -701,4 +715,4 @@
if(CONFIG_GET(flag/disable_secborg))
to_chat(user, "<span class='warning'>Nanotrasen policy disallows the use of weapons of mass destruction.</span>")
return FALSE
return ..()
return ..()

View File

@@ -20,7 +20,7 @@
throw_speed = 2
throw_range = 3
w_class = WEIGHT_CLASS_BULKY
materials = list(MAT_GLASS=7500, MAT_METAL=1000)
materials = list(/datum/material/glass=7500, /datum/material/iron=1000)
attack_verb = list("shoved", "bashed")
var/cooldown = 0 //shield bash cooldown. based on world.time
transparent = TRUE
@@ -87,7 +87,7 @@
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
transparent = FALSE
materials = list(MAT_METAL=8500)
materials = list(/datum/material/iron=8500)
max_integrity = 65
/obj/item/shield/riot/roman/fake

View File

@@ -7,7 +7,7 @@
item_color = "cosmos"
singular_name = "bluespace crystal"
w_class = WEIGHT_CLASS_TINY
materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/bluespace=MINERAL_MATERIAL_AMOUNT)
points = 75
var/blink_range = 8 // The teleport range when crushed/thrown at someone.
refined_type = /obj/item/stack/sheet/bluespace_crystal
@@ -50,7 +50,7 @@
/obj/item/stack/ore/bluespace_crystal/artificial
name = "artificial bluespace crystal"
desc = "An artificially made bluespace crystal, it looks delicate."
materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT*0.5)
materials = list(/datum/material/bluespace=MINERAL_MATERIAL_AMOUNT*0.5)
blink_range = 4 // Not as good as the organic stuff!
points = 0 //nice try
refined_type = null
@@ -64,7 +64,7 @@
item_state = "sheet-polycrystal"
singular_name = "bluespace polycrystal"
desc = "A stable polycrystal, made of fused-together bluespace crystals. You could probably break one off."
materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/bluespace=MINERAL_MATERIAL_AMOUNT)
attack_verb = list("bluespace polybashed", "bluespace polybattered", "bluespace polybludgeoned", "bluespace polythrashed", "bluespace polysmashed")
novariants = TRUE
grind_results = list(/datum/reagent/bluespace = 20)

View File

@@ -25,7 +25,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
throwforce = 10
throw_speed = 3
throw_range = 7
materials = list(MAT_METAL=1000)
materials = list(/datum/material/iron=1000)
max_amount = 50
attack_verb = list("hit", "bludgeoned", "whacked")
hitsound = 'sound/weapons/grenadelaunch.ogg'

View File

@@ -19,7 +19,7 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \
singular_name = "glass sheet"
icon_state = "sheet-glass"
item_state = "sheet-glass"
materials = list(MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/glass
@@ -94,7 +94,7 @@ GLOBAL_LIST_INIT(pglass_recipes, list ( \
singular_name = "plasma glass sheet"
icon_state = "sheet-pglass"
item_state = "sheet-pglass"
materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 75, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/plasmaglass
@@ -145,7 +145,7 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
singular_name = "reinforced glass sheet"
icon_state = "sheet-rglass"
item_state = "sheet-rglass"
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/rglass
@@ -191,7 +191,7 @@ GLOBAL_LIST_INIT(prglass_recipes, list ( \
singular_name = "reinforced plasma glass sheet"
icon_state = "sheet-prglass"
item_state = "sheet-prglass"
materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT, MAT_METAL = MINERAL_MATERIAL_AMOUNT * 0.5,)
materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT, /datum/material/iron = MINERAL_MATERIAL_AMOUNT * 0.5,)
armor = list("melee" = 20, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/plasmarglass
@@ -212,7 +212,7 @@ GLOBAL_LIST_INIT(titaniumglass_recipes, list(
singular_name = "titanium glass sheet"
icon_state = "sheet-titaniumglass"
item_state = "sheet-titaniumglass"
materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/titaniumglass
@@ -234,7 +234,7 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list(
singular_name = "plastitanium glass sheet"
icon_state = "sheet-plastitaniumglass"
item_state = "sheet-plastitaniumglass"
materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_PLASMA=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/plasma=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/plastitaniumglass
@@ -257,7 +257,7 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list(
item_state = "shard-glass"
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi'
materials = list(MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT)
attack_verb = list("stabbed", "slashed", "sliced", "cut")
hitsound = 'sound/weapons/bladeslice.ogg'
resistance_flags = ACID_PROOF
@@ -347,5 +347,5 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list(
force = 6
throwforce = 11
icon_state = "plasmalarge"
materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT)
icon_prefix = "plasma"

View File

@@ -44,7 +44,7 @@ GLOBAL_LIST_INIT(sandstone_recipes, list ( \
item_state = "sheet-sandstone"
throw_speed = 3
throw_range = 5
materials = list(MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT)
sheettype = "sandstone"
merge_type = /obj/item/stack/sheet/mineral/sandstone
@@ -103,7 +103,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \
item_state = "sheet-diamond"
singular_name = "diamond"
sheettype = "diamond"
materials = list(MAT_DIAMOND=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/diamond=MINERAL_MATERIAL_AMOUNT)
novariants = TRUE
grind_results = list(/datum/reagent/carbon = 30)
point_value = 50
@@ -133,7 +133,7 @@ GLOBAL_LIST_INIT(diamond_recipes, list ( \
item_state = "sheet-uranium"
singular_name = "uranium sheet"
sheettype = "uranium"
materials = list(MAT_URANIUM=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/uranium=MINERAL_MATERIAL_AMOUNT)
novariants = TRUE
grind_results = list(/datum/reagent/uranium = 20)
point_value = 35
@@ -164,7 +164,7 @@ GLOBAL_LIST_INIT(uranium_recipes, list ( \
sheettype = "plasma"
resistance_flags = FLAMMABLE
max_integrity = 100
materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT)
grind_results = list(/datum/reagent/toxin/plasma = 20)
point_value = 25
merge_type = /obj/item/stack/sheet/mineral/plasma
@@ -208,7 +208,7 @@ GLOBAL_LIST_INIT(plasma_recipes, list ( \
item_state = "sheet-gold"
singular_name = "gold bar"
sheettype = "gold"
materials = list(MAT_GOLD=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/gold=MINERAL_MATERIAL_AMOUNT)
grind_results = list(/datum/reagent/gold = 20)
point_value = 30
merge_type = /obj/item/stack/sheet/mineral/gold
@@ -240,7 +240,7 @@ GLOBAL_LIST_INIT(gold_recipes, list ( \
item_state = "sheet-silver"
singular_name = "silver bar"
sheettype = "silver"
materials = list(MAT_SILVER=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/silver=MINERAL_MATERIAL_AMOUNT)
grind_results = list(/datum/reagent/silver = 20)
point_value = 25
merge_type = /obj/item/stack/sheet/mineral/silver
@@ -272,7 +272,7 @@ GLOBAL_LIST_INIT(silver_recipes, list ( \
item_state = "sheet-bananium"
singular_name = "bananium sheet"
sheettype = "bananium"
materials = list(MAT_BANANIUM=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/bananium=MINERAL_MATERIAL_AMOUNT)
novariants = TRUE
grind_results = list(/datum/reagent/consumable/banana = 20)
point_value = 50
@@ -307,7 +307,7 @@ GLOBAL_LIST_INIT(bananium_recipes, list ( \
throw_speed = 1
throw_range = 3
sheettype = "titanium"
materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT)
point_value = 35
merge_type = /obj/item/stack/sheet/mineral/titanium
@@ -337,7 +337,7 @@ GLOBAL_LIST_INIT(titanium_recipes, list ( \
throw_speed = 1
throw_range = 3
sheettype = "plastitanium"
materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT, MAT_PLASMA=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT, /datum/material/plasma=MINERAL_MATERIAL_AMOUNT)
point_value = 45
merge_type = /obj/item/stack/sheet/mineral/plastitanium

View File

@@ -99,7 +99,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
singular_name = "metal sheet"
icon_state = "sheet-metal"
item_state = "sheet-metal"
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT)
throwforce = 10
flags_1 = CONDUCT_1
resistance_flags = FIRE_PROOF
@@ -160,7 +160,7 @@ GLOBAL_LIST_INIT(plasteel_recipes, list ( \
desc = "This sheet is an alloy of iron and plasma."
icon_state = "sheet-plasteel"
item_state = "sheet-metal"
materials = list(MAT_METAL=2000, MAT_PLASMA=2000)
materials = list(/datum/material/iron=2000, /datum/material/plasma=2000)
throwforce = 10
flags_1 = CONDUCT_1
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 80)
@@ -674,7 +674,7 @@ GLOBAL_LIST_INIT(plastic_recipes, list(
singular_name = "plastic sheet"
icon_state = "sheet-plastic"
item_state = "sheet-plastic"
materials = list(MAT_PLASTIC=MINERAL_MATERIAL_AMOUNT)
materials = list(/datum/material/plastic=MINERAL_MATERIAL_AMOUNT)
throwforce = 7
merge_type = /obj/item/stack/sheet/plastic

View File

@@ -10,7 +10,7 @@
throw_range = 3
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "smashed")
novariants = FALSE
var/perunit = MINERAL_MATERIAL_AMOUNT
mats_per_stack = MINERAL_MATERIAL_AMOUNT
var/sheettype = null //this is used for girders in the creation of walls/false walls
var/point_value = 0 //turn-in value for the gulag stacker - loosely relative to its rarity.
var/is_fabric = FALSE //is this a valid material for the loom?

View File

@@ -23,6 +23,7 @@
var/novariants = TRUE //Determines whether the item should update it's sprites based on amount.
//NOTE: When adding grind_results, the amounts should be for an INDIVIDUAL ITEM - these amounts will be multiplied by the stack size in on_grind()
var/obj/structure/table/tableVariant // we tables now (stores table variant to be built from this stack)
var/mats_per_stack = 0
/obj/item/stack/on_grind()
for(var/i in 1 to grind_results.len) //This should only call if it's ground, so no need to check if grind_results exists

View File

@@ -6,7 +6,7 @@
item_state = "tile-plasma"
turf_type = /turf/open/floor/mineral/plasma
mineralType = "plasma"
materials = list(MAT_PLASMA=500)
materials = list(/datum/material/plasma=500)
/obj/item/stack/tile/mineral/uranium
name = "uranium tile"
@@ -16,7 +16,7 @@
item_state = "tile-uranium"
turf_type = /turf/open/floor/mineral/uranium
mineralType = "uranium"
materials = list(MAT_URANIUM=500)
materials = list(/datum/material/uranium=500)
/obj/item/stack/tile/mineral/gold
name = "gold tile"
@@ -26,7 +26,7 @@
item_state = "tile-gold"
turf_type = /turf/open/floor/mineral/gold
mineralType = "gold"
materials = list(MAT_GOLD=500)
materials = list(/datum/material/gold=500)
/obj/item/stack/tile/mineral/silver
name = "silver tile"
@@ -36,7 +36,7 @@
item_state = "tile-silver"
turf_type = /turf/open/floor/mineral/silver
mineralType = "silver"
materials = list(MAT_SILVER=500)
materials = list(/datum/material/silver=500)
/obj/item/stack/tile/mineral/diamond
name = "diamond tile"
@@ -46,7 +46,7 @@
item_state = "tile-diamond"
turf_type = /turf/open/floor/mineral/diamond
mineralType = "diamond"
materials = list(MAT_DIAMOND=500)
materials = list(/datum/material/diamond=500)
/obj/item/stack/tile/mineral/bananium
name = "bananium tile"
@@ -56,7 +56,7 @@
item_state = "tile-bananium"
turf_type = /turf/open/floor/mineral/bananium
mineralType = "bananium"
materials = list(MAT_BANANIUM=500)
materials = list(/datum/material/bananium=500)
/obj/item/stack/tile/mineral/abductor
name = "alien floor tile"
@@ -76,7 +76,7 @@
item_state = "tile-shuttle"
turf_type = /turf/open/floor/mineral/titanium
mineralType = "titanium"
materials = list(MAT_TITANIUM=500)
materials = list(/datum/material/titanium=500)
/obj/item/stack/tile/mineral/plastitanium
name = "plastitanium tile"
@@ -86,7 +86,7 @@
item_state = "tile-darkshuttle"
turf_type = /turf/open/floor/mineral/plastitanium
mineralType = "plastitanium"
materials = list(MAT_TITANIUM=250, MAT_PLASMA=250)
materials = list(/datum/material/titanium=250, /datum/material/plasma=250)
/obj/item/stack/tile/mineral/snow
name = "snow tile"

View File

@@ -11,6 +11,7 @@
throw_speed = 3
throw_range = 7
max_amount = 60
mats_per_stack = 500
var/turf_type = null
var/mineralType = null
novariants = TRUE
@@ -303,7 +304,7 @@
icon_state = "tile"
item_state = "tile"
force = 6
materials = list(MAT_METAL=500)
materials = list(/datum/material/iron=500)
throwforce = 10
flags_1 = CONDUCT_1
turf_type = /turf/open/floor/plasteel

View File

@@ -287,7 +287,7 @@
throw_range = 5
w_class = WEIGHT_CLASS_BULKY
flags_1 = CONDUCT_1
materials = list(MAT_METAL=3000)
materials = list(/datum/material/iron=3000)
/obj/item/storage/bag/tray/ComponentInitialize()
. = ..()

View File

@@ -342,7 +342,7 @@
desc = "Proves to the world that you are the strongest!"
icon_state = "championbelt"
item_state = "champion"
materials = list(MAT_GOLD=400)
materials = list(/datum/material/gold=400)
/obj/item/storage/belt/champion/ComponentInitialize()
. = ..()

View File

@@ -1,8 +1,8 @@
/obj/item/storage/toolbox
name = "toolbox"
desc = "Danger. Very robust."
icon_state = "red"
item_state = "toolbox_red"
icon_state = "toolbox_default"
item_state = "toolbox_default"
lefthand_file = 'icons/mob/inhands/equipment/toolbox_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/toolbox_righthand.dmi'
flags_1 = CONDUCT_1
@@ -11,9 +11,10 @@
throw_speed = 2
throw_range = 7
w_class = WEIGHT_CLASS_BULKY
materials = list(MAT_METAL = 500)
materials = list(/datum/material/iron = 500)
attack_verb = list("robusted")
hitsound = 'sound/weapons/smash.ogg'
custom_materials = list(/datum/material/iron = 500) //Toolboxes by default use iron as their core, custom material.
var/latches = "single_latch"
var/has_latches = TRUE
@@ -41,6 +42,7 @@
name = "emergency toolbox"
icon_state = "red"
item_state = "toolbox_red"
material_flags = MATERIAL_NO_COLOR
/obj/item/storage/toolbox/emergency/PopulateContents()
new /obj/item/crowbar/red(src)
@@ -63,11 +65,13 @@
name = "rusty red toolbox"
icon_state = "toolbox_red_old"
has_latches = FALSE
material_flags = MATERIAL_NO_COLOR
/obj/item/storage/toolbox/mechanical
name = "mechanical toolbox"
icon_state = "blue"
item_state = "toolbox_blue"
material_flags = MATERIAL_NO_COLOR
/obj/item/storage/toolbox/mechanical/PopulateContents()
new /obj/item/screwdriver(src)
@@ -81,6 +85,7 @@
name = "rusty blue toolbox"
icon_state = "toolbox_blue_old"
has_latches = FALSE
material_flags = MATERIAL_NO_COLOR
/obj/item/storage/toolbox/mechanical/old/heirloom
name = "toolbox" //this will be named "X family toolbox"
@@ -128,6 +133,7 @@
name = "electrical toolbox"
icon_state = "yellow"
item_state = "toolbox_yellow"
material_flags = MATERIAL_NO_COLOR
/obj/item/storage/toolbox/electrical/PopulateContents()
var/pickedcolor = pick("red","yellow","green","blue","pink","orange","cyan","white")
@@ -149,6 +155,7 @@
force = 15
throwforce = 18
w_class = WEIGHT_CLASS_NORMAL
material_flags = MATERIAL_NO_COLOR
/obj/item/storage/toolbox/syndicate/ComponentInitialize()
. = ..()
@@ -176,6 +183,7 @@
name = "mechanical toolbox"
icon_state = "blue"
item_state = "toolbox_blue"
material_flags = MATERIAL_NO_COLOR
/obj/item/storage/toolbox/drone/PopulateContents()
var/pickedcolor = pick("red","yellow","green","blue","pink","orange","cyan","white")
@@ -197,6 +205,7 @@
w_class = WEIGHT_CLASS_HUGE
attack_verb = list("robusted", "crushed", "smashed")
var/fabricator_type = /obj/item/clockwork/replica_fabricator/scarab
material_flags = MATERIAL_NO_COLOR
/obj/item/storage/toolbox/brass/ComponentInitialize()
. = ..()

View File

@@ -11,7 +11,7 @@
throwforce = 10
throw_speed = 1
throw_range = 4
materials = list(MAT_METAL = 500)
materials = list(/datum/material/iron = 500)
actions_types = list(/datum/action/item_action/set_internals)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 10, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 30)
var/datum/gas_mixture/air_contents = null

View File

@@ -23,7 +23,7 @@
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
throw_speed = 3
throw_range = 7
materials = list(MAT_METAL=400)
materials = list(/datum/material/iron=400)
var/tracking_range = 20
/obj/item/locator/ui_interact(mob/user, datum/tgui/ui)
@@ -109,7 +109,7 @@
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 5
materials = list(MAT_METAL=10000)
materials = list(/datum/material/iron=10000)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 100)
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
var/list/active_portal_pairs

View File

@@ -11,7 +11,7 @@
force = 5
throwforce = 7
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=50)
materials = list(/datum/material/iron=50)
attack_verb = list("attacked", "bashed", "battered", "bludgeoned", "whacked")
tool_behaviour = TOOL_CROWBAR
@@ -50,7 +50,7 @@
w_class = WEIGHT_CLASS_NORMAL
throw_speed = 3
throw_range = 3
materials = list(MAT_METAL=70)
materials = list(/datum/material/iron=70)
icon_state = "crowbar_large"
item_state = "crowbar"
toolspeed = 0.7

View File

@@ -13,7 +13,7 @@
throwforce = 5
throw_speed = 3
throw_range = 5
materials = list(MAT_METAL=75)
materials = list(/datum/material/iron=75)
attack_verb = list("stabbed")
hitsound = 'sound/weapons/bladeslice.ogg'
usesound = list('sound/items/screwdriver.ogg', 'sound/items/screwdriver2.ogg')

View File

@@ -21,7 +21,7 @@
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 30)
resistance_flags = FIRE_PROOF
materials = list(MAT_METAL=70, MAT_GLASS=30)
materials = list(/datum/material/iron=70, /datum/material/glass=30)
var/welding = 0 //Whether or not the welding tool is off(0), on(1) or currently welding(2)
var/status = TRUE //Whether the welder is secured or unsecured (able to attach rods to it to make a flamethrower)
var/max_fuel = 20 //The max amount of fuel the welder can hold
@@ -297,7 +297,7 @@
desc = "A slightly larger welder with a larger tank."
icon_state = "indwelder"
max_fuel = 40
materials = list(MAT_GLASS=60)
materials = list(/datum/material/glass=60)
/obj/item/weldingtool/largetank/cyborg
name = "integrated welding tool"
@@ -319,7 +319,7 @@
icon_state = "miniwelder"
max_fuel = 10
w_class = WEIGHT_CLASS_TINY
materials = list(MAT_METAL=30, MAT_GLASS=10)
materials = list(/datum/material/iron=30, /datum/material/glass=10)
change_icons = 0
/obj/item/weldingtool/mini/flamethrower_screwdriver()
@@ -345,7 +345,7 @@
icon_state = "upindwelder"
item_state = "upindwelder"
max_fuel = 80
materials = list(MAT_METAL=70, MAT_GLASS=120)
materials = list(/datum/material/iron=70, /datum/material/glass=120)
/obj/item/weldingtool/experimental
name = "experimental welding tool"
@@ -353,7 +353,7 @@
icon_state = "exwelder"
item_state = "exwelder"
max_fuel = 40
materials = list(MAT_METAL=70, MAT_GLASS=120)
materials = list(/datum/material/iron=70, /datum/material/glass=120)
var/last_gen = 0
change_icons = 0
can_off_process = 1

View File

@@ -12,7 +12,7 @@
throw_speed = 3
throw_range = 7
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=80)
materials = list(/datum/material/iron=80)
attack_verb = list("pinched", "nipped")
hitsound = 'sound/items/wirecutter.ogg'
usesound = 'sound/items/wirecutter.ogg'

View File

@@ -11,7 +11,7 @@
throwforce = 7
w_class = WEIGHT_CLASS_SMALL
usesound = 'sound/items/ratchet.ogg'
materials = list(MAT_METAL=150)
materials = list(/datum/material/iron=150)
attack_verb = list("bashed", "battered", "bludgeoned", "whacked")
tool_behaviour = TOOL_WRENCH

View File

@@ -180,7 +180,7 @@
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
w_class = WEIGHT_CLASS_NORMAL
materials = list(MAT_METAL=10, MAT_GLASS=10)
materials = list(/datum/material/iron=10, /datum/material/glass=10)
attack_verb = list("struck", "pistol whipped", "hit", "bashed")
var/bullets = 7
@@ -234,7 +234,7 @@
icon = 'icons/obj/ammo.dmi'
icon_state = "357OLD-7"
w_class = WEIGHT_CLASS_TINY
materials = list(MAT_METAL=10, MAT_GLASS=10)
materials = list(/datum/material/iron=10, /datum/material/glass=10)
var/amount_left = 7
/obj/item/toy/ammo/gun/update_icon()

View File

@@ -467,7 +467,7 @@
throw_speed = 4
embedding = list("embedded_impact_pain_multiplier" = 3)
armour_penetration = 10
materials = list(MAT_METAL=1150, MAT_GLASS=2075)
materials = list(/datum/material/iron=1150, /datum/material/glass=2075)
hitsound = 'sound/weapons/bladeslice.ogg'
attack_verb = list("attacked", "poked", "jabbed", "torn", "gored")
sharpness = IS_SHARP
@@ -575,7 +575,7 @@
throwforce = 13
throw_speed = 2
throw_range = 4
materials = list(MAT_METAL=13000)
materials = list(/datum/material/iron=13000)
attack_verb = list("sawed", "torn", "cut", "chopped", "diced")
hitsound = "swing_hit"
sharpness = IS_SHARP

View File

@@ -17,7 +17,7 @@
/obj/item/banhammer/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is hitting [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to ban [user.p_them()]self from life.</span>")
return (BRUTELOSS|FIRELOSS|TOXLOSS|OXYLOSS)
/*
/*
oranges says: This is a meme relating to the english translation of the ss13 russian wiki page on lurkmore.
mrdoombringer sez: and remember kids, if you try and PR a fix for this item's grammar, you are admitting that you are, indeed, a newfriend.
for further reading, please see: https://github.com/tgstation/tgstation/pull/30173 and https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=%2F%2Flurkmore.to%2FSS13&edit-text=&act=url
@@ -239,7 +239,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
force = 9
throwforce = 10
w_class = WEIGHT_CLASS_NORMAL
materials = list(MAT_METAL=1150, MAT_GLASS=75)
materials = list(/datum/material/iron=1150, /datum/material/glass=75)
attack_verb = list("hit", "bludgeoned", "whacked", "bonked")
/obj/item/wirerod/attackby(obj/item/I, mob/user, params)
@@ -283,7 +283,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
embedding = list("embedded_pain_multiplier" = 4, "embed_chance" = 100, "embedded_fall_chance" = 0)
w_class = WEIGHT_CLASS_SMALL
sharpness = IS_SHARP
materials = list(MAT_METAL=500, MAT_GLASS=500)
materials = list(/datum/material/iron=500, /datum/material/glass=500)
resistance_flags = FIRE_PROOF
/obj/item/throwing_star/magspear
@@ -309,7 +309,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
throwforce = 5
throw_speed = 3
throw_range = 6
materials = list(MAT_METAL=12000)
materials = list(/datum/material/iron=12000)
hitsound = 'sound/weapons/genhit.ogg'
attack_verb = list("stubbed", "poked")
resistance_flags = FIRE_PROOF
@@ -358,7 +358,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
else
user.visible_message("<span class='suicide'>[user] is strangling [user.p_them()]self with [src]'s cord! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return(OXYLOSS)
/obj/item/phone/real
desc = "A bluespace last resort negotiation tool connected directly to the enemy should anything ever go wrong. Misuse will likely lead to the line being cut or anything else they're capable of. All communication is monitored by Nanotrasen Officials."
@@ -371,7 +371,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
to_chat(usr, "<span class='danger'>Message sent. Pray you made the right choice.</span>")
usr.log_talk(input, LOG_SAY, tag="Syndicate announcement")
deadchat_broadcast(" has messaged the Syndicate using the red phone, \"[input]\" at <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr)
/obj/item/phone/banana
name = "banana phone"
desc = "Direct telecommunications line to the Clown Planet. Use for emergencies only!"
@@ -384,7 +384,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
w_class = WEIGHT_CLASS_SMALL
attack_verb = list("called", "rang")
hitsound = 'sound/items/bikehorn.ogg'
/obj/item/phone/banana/attack_self(mob/user)
var/input = stripped_input(usr, "Please choose a message to send. If you are unsure, you can still turn back.", "Send a message to the Clown Planet.", "")
if(!input || !(usr in view(1,src)))
@@ -394,7 +394,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
to_chat(usr, "<span class='danger'>Message sent. The Clown Planet will judge your message.</span>")
usr.log_talk(input, LOG_SAY, tag="Clown Planet announcement")
deadchat_broadcast(" has messaged the Clown Planet using the banana phone, \"[input]\" at <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr)
/obj/item/cane
name = "cane"
desc = "A cane used by a true gentleman. Or a clown."
@@ -406,7 +406,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
force = 5
throwforce = 5
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=50)
materials = list(/datum/material/iron=50)
attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed")
/obj/item/staff

View File

@@ -270,7 +270,7 @@
throw_range = 3
hitsound = 'sound/items/trayhit1.ogg'
hit_reaction_chance = 50
materials = list(MAT_METAL = 2000)
materials = list(/datum/material/iron = 2000)
var/break_chance = 5 //Likely hood of smashing the chair.
var/obj/structure/chair/origin_type = /obj/structure/chair
@@ -311,7 +311,7 @@
if(remaining_mats)
for(var/M=1 to remaining_mats)
new stack_type(get_turf(loc))
else if(materials[MAT_METAL])
else if(materials[/datum/material/iron])
new /obj/item/stack/rods(get_turf(loc), 2)
qdel(src)

View File

@@ -33,7 +33,7 @@
integrity_failure = 30
smooth = SMOOTH_TRUE
canSmoothWith = list(/obj/structure/table, /obj/structure/table/reinforced)
/** Performs a complex check for toe stubbing as people would scream "IMPROVE DONT REMOVE" if I had my way.
* Uses an early probability based return for to save cycles which is perfectly valid since the highest probability is 20 anyway.
* Chance of getting your toe stubbed: (regular = 0.033%, running = 0.1%, blind = 20%, blurry_eyes = 2%, congenitally blind = 1% )
@@ -45,7 +45,7 @@
return
if(!istype(H) || H.shoes || !(H.mobility_flags & MOBILITY_STAND) || !H.dna.species.has_toes())
return
var/speed_multiplier = 2/H.cached_multiplicative_slowdown
var/speed_multiplier = 2/H.cached_multiplicative_slowdown
var/blindness_multiplier = 0
if(H.eye_blurry)
blindness_multiplier = 4
@@ -56,7 +56,7 @@
var/chance = 0.5*blindness_multiplier*speed_multiplier
if(prob(chance))
to_chat(H, "<span class='warning'>You stub your toe on the [name]!</span>")
H.visible_message("[H] stubs their toe on the [name].")
H.visible_message("[H] stubs their toe on the [name].")
H.emote("scream")
var/shiddedleg = pick(BODY_ZONE_PRECISE_R_FOOT, BODY_ZONE_PRECISE_L_FOOT)
H.apply_damage(2*speed_multiplier, BRUTE, def_zone = shiddedleg)
@@ -130,7 +130,7 @@
if(istype(mover) && (mover.pass_flags & PASSTABLE))
return TRUE
if(iscarbon(mover))
var/mob/living/carbon/C = mover
var/obj/item/tank/jetpack/jetpacktable = C.get_jetpack()
@@ -640,7 +640,7 @@
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "rack_parts"
flags_1 = CONDUCT_1
materials = list(MAT_METAL=2000)
materials = list(/datum/material/iron=2000)
var/building = FALSE
/obj/item/rack_parts/attackby(obj/item/W, mob/user, params)

View File

@@ -9,7 +9,7 @@
throw_speed = 3
throw_range = 5
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=600, MAT_GLASS=200)
materials = list(/datum/material/iron=600, /datum/material/glass=200)
var/uses = 2
/obj/item/overthrow_converter/proc/convert(mob/living/carbon/human/target, mob/living/carbon/human/user) // Should probably also delete any mindshield implant. Not sure.

View File

@@ -12,7 +12,7 @@
icon_state = ""
flags_1 = CONDUCT_1
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=100)
materials = list(/datum/material/iron=100)
throwforce = 2
throw_speed = 3
throw_range = 7

View File

@@ -8,7 +8,7 @@
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
throwforce = 0
w_class = WEIGHT_CLASS_TINY
materials = list(MAT_METAL = 300, MAT_GLASS = 300)
materials = list(/datum/material/iron = 300, /datum/material/glass = 300)
light_color = LIGHT_COLOR_WHITE
light_power = FLASH_LIGHT_POWER
var/flashing_overlay = "flash-f"

View File

@@ -2,7 +2,7 @@
name = "health sensor"
desc = "Used for scanning and monitoring health."
icon_state = "health"
materials = list(MAT_METAL=800, MAT_GLASS=200)
materials = list(/datum/material/iron=800, /datum/material/glass=200)
attachable = TRUE
var/scanning = FALSE

View File

@@ -2,7 +2,7 @@
name = "igniter"
desc = "A small electronic device able to ignite combustible substances."
icon_state = "igniter"
materials = list(MAT_METAL=500, MAT_GLASS=50)
materials = list(/datum/material/iron=500, /datum/material/glass=50)
var/datum/effect_system/spark_spread/sparks
heat = 1000

View File

@@ -3,7 +3,7 @@
desc = "A handy little spring-loaded trap for catching pesty rodents."
icon_state = "mousetrap"
item_state = "mousetrap"
materials = list(MAT_METAL=100)
materials = list(/datum/material/iron=100)
attachable = TRUE
layer = BELOW_OBJ_LAYER
var/armed = FALSE

View File

@@ -5,7 +5,7 @@
item_state = "signaler"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
materials = list(MAT_METAL=400, MAT_GLASS=120)
materials = list(/datum/material/iron=400, /datum/material/glass=120)
wires = WIRE_RECEIVE | WIRE_PULSE | WIRE_RADIO_PULSE | WIRE_RADIO_RECEIVE
attachable = TRUE
var/code = DEFAULT_SIGNALER_CODE

View File

@@ -2,7 +2,7 @@
name = "timer"
desc = "Used to time things. Works well with contraptions which has to count down. Tick tock."
icon_state = "timer"
materials = list(MAT_METAL=500, MAT_GLASS=50)
materials = list(/datum/material/iron=500, /datum/material/glass=50)
attachable = TRUE
var/timing = FALSE
var/time = 5

View File

@@ -7,7 +7,7 @@
name = "voice analyzer"
desc = "A small electronic device able to record a voice sample, and send a signal when that sample is repeated."
icon_state = "voice"
materials = list(MAT_METAL=500, MAT_GLASS=50)
materials = list(/datum/material/iron=500, /datum/material/glass=50)
flags_1 = HEAR_1
attachable = TRUE
verb_say = "beeps"

Some files were not shown because too many files have changed in this diff Show More