Merge pull request #8901 from Fox-McCloud/component-port

Ports TG Components and R&D Tweaks
This commit is contained in:
tigercat2000
2018-04-24 19:01:49 -07:00
committed by GitHub
75 changed files with 2077 additions and 2571 deletions
+151
View File
@@ -0,0 +1,151 @@
//shorthand
#define GET_COMPONENT_FROM(varname, path, target) var##path/##varname = ##target.GetComponent(##path)
#define GET_COMPONENT(varname, path) GET_COMPONENT_FROM(varname, path, src)
#define COMPONENT_INCOMPATIBLE 1
// How multiple components of the exact same type are handled in the same datum
#define COMPONENT_DUPE_HIGHLANDER 0 //old component is deleted (default)
#define COMPONENT_DUPE_ALLOWED 1 //duplicates allowed
#define COMPONENT_DUPE_UNIQUE 2 //new component is deleted
#define COMPONENT_DUPE_UNIQUE_PASSARGS 4 //old component is given the initialization args of the new
// All signals. Format:
// When the signal is called: (signal arguments)
// /datum signals
#define COMSIG_COMPONENT_ADDED "component_added" //when a component is added to a datum: (/datum/component)
#define COMSIG_COMPONENT_REMOVING "component_removing" //before a component is removed from a datum because of RemoveComponent: (/datum/component)
#define COMSIG_PARENT_QDELETED "parent_qdeleted" //before a datum's Destroy() is called: ()
// /atom signals
#define COMSIG_PARENT_ATTACKBY "atom_attackby" //from base of atom/attackby(): (/obj/item, /mob/living, params)
#define COMPONENT_NO_AFTERATTACK 1 //Return this in response if you don't want afterattack to be called
#define COMSIG_ATOM_HULK_ATTACK "hulk_attack" //from base of atom/attack_hulk(): (/mob/living/carbon/human)
#define COMSIG_PARENT_EXAMINE "atom_examine" //from base of atom/examine(): (/mob)
#define COMSIG_ATOM_GET_EXAMINE_NAME "atom_examine_name" //from base of atom/get_examine_name(): (/mob, list/overrides)
//Positions for overrides list
#define EXAMINE_POSITION_ARTICLE 1
#define EXAMINE_POSITION_BEFORE 2
//End positions
#define COMPONENT_EXNAME_CHANGED 1
#define COMSIG_ATOM_ENTERED "atom_entered" //from base of atom/Entered(): (atom/movable/entering, /atom)
#define COMSIG_ATOM_EXITED "atom_exited" //from base of atom/Exited(): (atom/movable/exiting, atom/newloc)
#define COMSIG_ATOM_EX_ACT "atom_ex_act" //from base of atom/ex_act(): (severity, target)
#define COMSIG_ATOM_EMP_ACT "atom_emp_act" //from base of atom/emp_act(): (severity)
#define COMSIG_ATOM_FIRE_ACT "atom_fire_act" //from base of atom/fire_act(): (exposed_temperature, exposed_volume)
#define COMSIG_ATOM_BULLET_ACT "atom_bullet_act" //from base of atom/bullet_act(): (/obj/item/projectile, def_zone)
#define COMSIG_ATOM_BLOB_ACT "atom_blob_act" //from base of atom/blob_act(): (/obj/structure/blob)
#define COMSIG_ATOM_ACID_ACT "atom_acid_act" //from base of atom/acid_act(): (acidpwr, acid_volume)
#define COMSIG_ATOM_EMAG_ACT "atom_emag_act" //from base of atom/emag_act(): ()
#define COMSIG_ATOM_RAD_ACT "atom_rad_act" //from base of atom/rad_act(intensity)
#define COMSIG_ATOM_NARSIE_ACT "atom_narsie_act" //from base of atom/narsie_act(): ()
#define COMSIG_ATOM_RATVAR_ACT "atom_ratvar_act" //from base of atom/ratvar_act(): ()
#define COMSIG_ATOM_RCD_ACT "atom_rcd_act" //from base of atom/rcd_act(): (/mob, /obj/item/construction/rcd, passed_mode)
#define COMSIG_ATOM_SING_PULL "atom_sing_pull" //from base of atom/singularity_pull(): (S, current_size)
#define COMSIG_ATOM_SET_LIGHT "atom_set_light" //from base of atom/set_light(): (l_range, l_power, l_color)
#define COMSIG_ATOM_ROTATE "atom_rotate" //from base of atom/shuttleRotate(): (rotation, params)
#define COMSIG_ATOM_DIR_CHANGE "atom_dir_change" //from base of atom/setDir(): (old_dir, new_dir)
#define COMSIG_ATOM_CONTENTS_DEL "atom_contents_del" //from base of atom/handle_atom_del(): (atom/deleted)
/////////////////
#define COMSIG_ATOM_ATTACK_GHOST "atom_attack_ghost" //from base of atom/attack_ghost(): (mob/dead/observer/ghost)
#define COMSIG_ATOM_ATTACK_HAND "atom_attack_hand" //from base of atom/attack_hand(): (mob/user)
#define COMSIG_ATOM_ATTACK_PAW "atom_attack_paw" //from base of atom/attack_paw(): (mob/user)
#define COMPONENT_NO_ATTACK_HAND 1 //works on all 3.
/////////////////
#define COMSIG_ENTER_AREA "enter_area" //from base of area/Entered(): (/area)
#define COMSIG_EXIT_AREA "exit_area" //from base of area/Exited(): (/area)
#define COMSIG_CLICK "atom_click" //from base of atom/Click(): (location, control, params)
#define COMSIG_CLICK_SHIFT "shift_click" //from base of atom/ShiftClick(): (/mob)
#define COMSIG_CLICK_CTRL "ctrl_click" //from base of atom/CtrlClickOn(): (/mob)
#define COMSIG_CLICK_ALT "alt_click" //from base of atom/AltClick(): (/mob)
#define COMSIG_CLICK_CTRL_SHIFT "ctrl_shift_click" //from base of atom/CtrlShiftClick(/mob)
#define COMSIG_MOUSEDROP_ONTO "mousedrop_onto" //from base of atom/MouseDrop(): (/atom/over, /mob/user)
#define COMPONENT_NO_MOUSEDROP 1
#define COMSIG_MOUSEDROPPED_ONTO "mousedropped_onto" //from base of atom/MouseDrop_T: (/atom/from, /mob/user)
// /area signals
#define COMSIG_AREA_ENTERED "area_entered" //from base of area/Entered(): (atom/movable/M)
#define COMSIG_AREA_EXITED "area_exited" //from base of area/Exited(): (atom/movable/M)
// /atom/movable signals
#define COMSIG_MOVABLE_MOVED "movable_moved" //from base of atom/movable/Moved(): (/atom, dir)
#define COMSIG_MOVABLE_CROSSED "movable_crossed" //from base of atom/movable/Crossed(): (/atom/movable)
#define COMSIG_MOVABLE_UNCROSSED "movable_uncrossed" //from base of atom/movable/Uncrossed(): (/atom/movable)
#define COMSIG_MOVABLE_COLLIDE "movable_collide" //from base of atom/movable/Collide(): (/atom)
#define COMSIG_MOVABLE_IMPACT "movable_impact" //from base of atom/movable/throw_impact(): (/atom/hit_atom, /datum/thrownthing/throwingdatum)
#define COMSIG_MOVABLE_IMPACT_ZONE "item_impact_zone" //from base of mob/living/hitby(): (mob/living/target, hit_zone)
#define COMSIG_MOVABLE_BUCKLE "buckle" //from base of atom/movable/buckle_mob(): (mob, force)
#define COMSIG_MOVABLE_UNBUCKLE "unbuckle" //from base of atom/movable/unbuckle_mob(): (mob, force)
#define COMSIG_MOVABLE_THROW "movable_throw" //from base of atom/movable/throw_at(): (datum/thrownthing, spin)
// /obj signals
#define COMSIG_OBJ_DECONSTRUCT "obj_deconstruct" //from base of obj/deconstruct(): (disassembled)
// /obj/item signals
#define COMSIG_ITEM_ATTACK "item_attack" //from base of obj/item/attack(): (/mob/living/target, /mob/living/user)
#define COMSIG_ITEM_ATTACK_SELF "item_attack_self" //from base of obj/item/attack_self(): (/mob)
#define COMSIG_ITEM_ATTACK_OBJ "item_attack_obj" //from base of obj/item/attack_obj(): (/obj, /mob)
#define COMPONENT_NO_ATTACK_OBJ 1
#define COMSIG_ITEM_PRE_ATTACK "item_pre_attack" //from base of obj/item/pre_attack(): (atom/target, mob/user, params)
#define COMPONENT_NO_ATTACK 1
#define COMSIG_ITEM_EQUIPPED "item_equip" //from base of obj/item/equipped(): (/mob/equipper, slot)
#define COMSIG_ITEM_DROPPED "item_drop"
#define COMSIG_ITEM_PICKUP "item_pickup" //from base of obj/item/pickup(): (/mob/taker)
#define COMSIG_ITEM_ATTACK_ZONE "item_attack_zone" //from base of mob/living/carbon/attacked_by(): (mob/living/carbon/target, mob/living/user, hit_zone)
// /obj/item/clothing signals
#define COMSIG_SHOES_STEP_ACTION "shoes_step_action" //from base of obj/item/clothing/shoes/proc/step_action(): ()
// /obj/machinery signals
#define COMSIG_MACHINE_PROCESS "machine_process" //from machinery subsystem fire(): ()
#define COMSIG_MACHINE_PROCESS_ATMOS "machine_process_atmos" //from air subsystem process_atmos_machinery(): ()
// /mob/living/carbon/human signals
#define COMSIG_HUMAN_MELEE_UNARMED_ATTACK "human_melee_unarmed_attack" //from mob/living/carbon/human/UnarmedAttack(): (atom/target)
#define COMSIG_HUMAN_MELEE_UNARMED_ATTACKBY "human_melee_unarmed_attackby" //from mob/living/carbon/human/UnarmedAttack(): (mob/living/carbon/human/attacker)
#define COMSIG_HUMAN_DISARM_HIT "human_disarm_hit" //Hit by successful disarm attack (mob/living/carbon/human/attacker,zone_targeted)
/*******Component Specific Signals*******/
//Janitor
#define COMSIG_TURF_IS_WET "check_turf_wet" //(): Returns bitflags of wet values.
#define COMSIG_TURF_MAKE_DRY "make_turf_try" //(max_strength, immediate, duration_decrease = INFINITY): Returns bool.
#define COMSIG_COMPONENT_CLEAN_ACT "clean_act" //called on an object to clean it of cleanables. Usualy with soap: (num/strength)
//Food
#define COMSIG_FOOD_EATEN "food_eaten" //from base of obj/item/reagent_containers/food/snacks/attack(): (mob/living/eater, mob/feeder)
//Mood
#define COMSIG_ADD_MOOD_EVENT "add_mood" //Called when you send a mood event from anywhere in the code.
#define COMSIG_CLEAR_MOOD_EVENT "clear_mood" //Called when you clear a mood event from anywhere in the code.
//NTnet
#define COMSIG_COMPONENT_NTNET_RECIEVE "ntnet_recieve" //called on an object by its NTNET connection component on recieve. (sending_id(number), sending_netname(text), data(datum/netdata))
// /datum/component/storage signals
#define COMSIG_CONTAINS_STORAGE "is_storage" //() - returns bool.
#define COMSIG_TRY_STORAGE_INSERT "storage_try_insert" //(obj/item/inserting, mob/user, silent, force) - returns bool
#define COMSIG_TRY_STORAGE_SHOW "storage_show_to" //(mob/show_to, force) - returns bool.
#define COMSIG_TRY_STORAGE_HIDE_FROM "storage_hide_from" //(mob/hide_from) - returns bool
#define COMSIG_TRY_STORAGE_HIDE_ALL "storage_hide_all" //returns bool
#define COMSIG_TRY_STORAGE_SET_LOCKSTATE "storage_lock_set_state" //(newstate)
#define COMSIG_IS_STORAGE_LOCKED "storage_get_lockstate" //() - returns bool. MUST CHECK IF STORAGE IS THERE FIRST!
#define COMSIG_TRY_STORAGE_TAKE_TYPE "storage_take_type" //(type, atom/destination, amount = INFINITY, check_adjacent, force, mob/user, list/inserted) - returns bool - type can be a list of types.
#define COMSIG_TRY_STORAGE_FILL_TYPE "storage_fill_type" //(type, amount = INFINITY, force = FALSE) //don't fuck this up. Force will ignore max_items, and amount is normally clamped to max_items.
#define COMSIG_TRY_STORAGE_TAKE "storage_take_obj" //(obj, new_loc, force = FALSE) - returns bool
#define COMSIG_TRY_STORAGE_QUICK_EMPTY "storage_quick_empty" //(loc) - returns bool - if loc is null it will dump at parent location.
#define COMSIG_TRY_STORAGE_RETURN_INVENTORY "storage_return_inventory" //(list/list_to_inject_results_into)
#define COMSIG_TRY_STORAGE_CAN_INSERT "storage_can_equip" //(obj/item/insertion_candidate, mob/user, silent) - returns bool
/*******Non-Signal Component Related Defines*******/
//Arch
#define ARCH_PROB "probability" //Probability for each item
#define ARCH_MAXDROP "max_drop_amount" //each item's max drop amount
//Ouch my toes!
#define CALTROP_BYPASS_SHOES 1
#define CALTROP_IGNORE_WALKERS 2
+2
View File
@@ -40,10 +40,12 @@
#define MAT_DIAMOND "$diamond"
#define MAT_URANIUM "$uranium"
#define MAT_PLASMA "$plasma"
#define MAT_BLUESPACE "$bluespace"
#define MAT_BANANIUM "$bananium"
#define MAT_TRANQUILLITE "$tranquillite"
#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.
+30
View File
@@ -24,6 +24,36 @@
#define DROPDEL 16384 // When dropped, it calls qdel on itself
/* Secondary atom flags, for the flags_2 var, denoted with a _2 */
#define SLOWS_WHILE_IN_HAND_2 1
#define NO_EMP_WIRES_2 2
#define HOLOGRAM_2 4
#define FROZEN_2 8
#define STATIONLOVING_2 16
#define INFORM_ADMINS_ON_RELOCATE_2 32
#define BANG_PROTECT_2 64
// An item worn in the ear slot with HEALS_EARS will heal your ears each
// Life() tick, even if normally your ears would be too damaged to heal.
#define HEALS_EARS_2 128
// A mob with OMNITONGUE has no restriction in the ability to speak
// languages that they know. So even if they wouldn't normally be able to
// through mob or tongue restrictions, this flag allows them to ignore
// those restrictions.
#define OMNITONGUE_2 256
// TESLA_IGNORE grants immunity from being targeted by tesla-style electricity
#define TESLA_IGNORE_2 512
// Stops you from putting things like an RCD or other items into an ORM or protolathe for materials.
#define NO_MAT_REDEMPTION_2 1024
// LAVA_PROTECT used on the flags_2 variable for both SUIT and HEAD items, and stops lava damage. Must be present in both to stop lava damage.
#define LAVA_PROTECT_2 2048
//Reagent flags
#define REAGENT_NOREACT 1
+1
View File
@@ -22,6 +22,7 @@
#define MECHFAB 16 //Remember, objects utilising this flag should have construction_time and construction_cost vars.
#define PODFAB 32 //Used by the spacepod part fabricator. Same idea as the mechfab
#define BIOGENERATOR 64 //Uses biomass
#define SMELTER 128 //uses various minerals
//Note: More then one of these can be added to a design but imprinter and lathe designs are incompatable.
#define HYDRO_SPEED_MULTIPLIER 1
+16 -1
View File
@@ -364,4 +364,19 @@
value = splittext(value, "]") //"name]!" --> list("name","!")
for(var/A in value)
if(var_source.vars.Find(A))
. += A
. += A
/proc/type2parent(child)
var/string_type = "[child]"
var/last_slash = findlasttext(string_type, "/")
if(last_slash == 1)
switch(child)
if(/datum)
return null
if(/obj || /mob)
return /atom/movable
if(/area || /turf)
return /atom
else
return /datum
return text2path(copytext(string_type, 1, last_slash))
+2 -2
View File
@@ -14,10 +14,10 @@
// No comment
/atom/proc/attackby(obj/item/W, mob/user, params)
return
return SendSignal(COMSIG_PARENT_ATTACKBY, W, user, params)
/obj/attackby(obj/item/I, mob/living/user, params)
return I.attack_obj(src, user)
return ..() || I.attack_obj(src, user)
/mob/living/attackby(obj/item/I, mob/living/user, params)
user.changeNext_move(CLICK_CD_MELEE)
+1
View File
@@ -295,6 +295,7 @@ SUBSYSTEM_DEF(garbage)
if(isnull(D.gc_destroyed))
D.SendSignal(COMSIG_PARENT_QDELETED)
D.gc_destroyed = GC_CURRENTLY_BEING_QDELETED
var/start_time = world.time
var/start_tick = world.tick_usage
+1 -1
View File
@@ -101,7 +101,7 @@
name = "Move Small Containers"
id = "boxes"
blacklist = null
whitelist = list(/obj/item/storage, /obj/item/moneybag, /obj/item/evidencebag,
whitelist = list(/obj/item/storage, /obj/item/storage/bag/money, /obj/item/evidencebag,
/obj/item/storage/bag/tray, /obj/item/pizzabox, /obj/item/clipboard,
/obj/item/smallDelivery, /obj/structure/bigDelivery)
+120
View File
@@ -0,0 +1,120 @@
# Datum Component System (DCS)
## Concept
Loosely adapted from /vg/. This is an entity component system for adding behaviours to datums when inheritance doesn't quite cut it. By using signals and events instead of direct inheritance, you can inject behaviours without hacky overloads. It requires a different method of thinking, but is not hard to use correctly. If a behaviour can have application across more than one thing. Make it generic, make it a component. Atom/mob/obj event? Give it a signal, and forward it's arguments with a `SendSignal()` call. Now every component that want's to can also know about this happening.
### In the code
#### Slippery things
At the time of this writing, every object that is slippery overrides atom/Crossed does some checks, then slips the mob. Instead of all those Crossed overrides they could add a slippery component to all these objects. And have the checks in one proc that is run by the Crossed event
#### Powercells
A lot of objects have powercells. The `get_cell()` proc was added to give generic access to the cell var if it had one. This is just a specific use case of `GetComponent()`
#### Radios
The radio object as it is should not exist, given that more things use the _concept_ of radios rather than the object itself. The actual function of the radio can exist in a component which all the things that use it (Request consoles, actual radios, the SM shard) can add to themselves.
#### Standos
Stands have a lot of procs which mimic mob procs. Rather than inserting hooks for all these procs in overrides, the same can be accomplished with signals
## API
### Defines
1. `COMPONENT_INCOMPATIBLE` Return this from `/datum/component/Initialize` or `datum/component/OnTransfer` to have the component be deleted if it's applied to an incorrect type. `parent` must not be modified if this is to be returned.
### Vars
1. `/datum/var/list/datum_components` (private)
* Lazy associated list of type -> component/list of components.
1. `/datum/component/var/enabled` (protected, boolean)
* If the component is enabled. If not, it will not react to signals
* `FALSE` by default, set to `TRUE` when a signal is registered
1. `/datum/component/var/dupe_mode` (protected, enum)
* How duplicate component types are handled when added to the datum.
* `COMPONENT_DUPE_HIGHLANDER` (default): Old component will be deleted, new component will first have `/datum/component/proc/InheritComponent(datum/component/old, FALSE)` on it
* `COMPONENT_DUPE_ALLOWED`: The components will be treated as separate, `GetComponent()` will return the first added
* `COMPONENT_DUPE_UNIQUE`: New component will be deleted, old component will first have `/datum/component/proc/InheritComponent(datum/component/new, TRUE)` on it
* `COMPONENT_DUPE_UNIQUE_PASSARGS`: New component will never exist and instead its initialization arguments will be passed on to the old component.
1. `/datum/component/var/dupe_type` (protected, type)
* Definition of a duplicate component type
* `null` means exact match on `type` (default)
* Any other type means that and all subtypes
1. `/datum/component/var/list/signal_procs` (private)
* Associated lazy list of signals -> `/datum/callback`s that will be run when the parent datum recieves that signal
1. `/datum/component/var/datum/parent` (protected, read-only)
* The datum this component belongs to
* Never `null` in child procs
### Procs
1. `/datum/proc/GetComponent(component_type(type)) -> datum/component?` (public, final)
* Returns a reference to a component of component_type if it exists in the datum, null otherwise
1. `/datum/proc/GetComponents(component_type(type)) -> list` (public, final)
* Returns a list of references to all components of component_type that exist in the datum
1. `/datum/proc/GetExactComponent(component_type(type)) -> datum/component?` (public, final)
* Returns a reference to a component whose type MATCHES component_type if that component exists in the datum, null otherwise
1. `GET_COMPONENT(varname, component_type)` OR `GET_COMPONENT_FROM(varname, component_type, src)`
* Shorthand for `var/component_type/varname = src.GetComponent(component_type)`
1. `/datum/proc/AddComponent(component_type(type), ...) -> datum/component` (public, final)
* Creates an instance of `component_type` in the datum and passes `...` to its `Initialize()` call
* Sends the `COMSIG_COMPONENT_ADDED` signal to the datum
* All components a datum owns are deleted with the datum
* Returns the component that was created. Or the old component in a dupe situation where `COMPONENT_DUPE_UNIQUE` was set
* If this tries to add an component to an incompatible type, the component will be deleted and the result will be `null`. This is very unperformant, try not to do it
* Properly handles duplicate situations based on the `dupe_mode` var
1. `/datum/proc/LoadComponent(component_type(type), ...) -> datum/component` (public, final)
* Equivalent to calling `GetComponent(component_type)` where, if the result would be `null`, returns `AddComponent(component_type, ...)` instead
1. `/datum/proc/ComponentActivated(datum/component/C)` (abstract, async)
* Called on a component's `parent` after a signal recieved causes it to activate. `src` is the parameter
* Will only be called if a component's callback returns `TRUE`
1. `/datum/proc/TakeComponent(datum/component/C)` (public, final)
* Properly transfers ownership of a component from one datum to another
* Signals `COMSIG_COMPONENT_REMOVING` on the parent
* Called on the datum you want to own the component with another datum's component
1. `/datum/proc/SendSignal(signal, ...)` (public, final)
* Call to send a signal to the components of the target datum
* Extra arguments are to be specified in the signal definition
* Returns a bitflag with signal specific information assembled from all activated components
1. `/datum/component/New(datum/parent, ...)` (private, final)
* Runs internal setup for the component
* Extra arguments are passed to `Initialize()`
1. `/datum/component/Initialize(...)` (abstract, no-sleep)
* Called by `New()` with the same argments excluding `parent`
* Component does not exist in `parent`'s `datum_components` list yet, although `parent` is set and may be used
* Signals will not be recieved while this function is running
* Component may be deleted after this function completes without being attached
* Do not call `qdel(src)` from this function
1. `/datum/component/Destroy(force(bool), silent(bool))` (virtual, no-sleep)
* Sends the `COMSIG_COMPONENT_REMOVING` signal to the parent datum if the `parent` isn't being qdeleted
* Properly removes the component from `parent` and cleans up references
* Setting `force` makes it not check for and remove the component from the parent
* Setting `silent` deletes the component without sending a `COMSIG_COMPONENT_REMOVING` signal
1. `/datum/component/proc/InheritComponent(datum/component/C, i_am_original(boolean))` (abstract, no-sleep)
* Called on a component when a component of the same type was added to the same parent
* See `/datum/component/var/dupe_mode`
* `C`'s type will always be the same of the called component
1. `/datum/component/proc/AfterComponentActivated()` (abstract, async)
* Called on a component that was activated after it's `parent`'s `ComponentActivated()` is called
1. `/datum/component/proc/OnTransfer(datum/new_parent)` (abstract, no-sleep)
* Called before `new_parent` is assigned to `parent` in `TakeComponent()`
* Allows the component to react to ownership transfers
1. `/datum/component/proc/_RemoveFromParent()` (private, final)
* Clears `parent` and removes the component from it's component list
1. `/datum/component/proc/_JoinParent` (private, final)
* Tries to add the component to it's `parent`s `datum_components` list
1. `/datum/component/proc/RegisterSignal(signal(string/list of strings), proc_ref(type), override(boolean))` (protected, final) (Consider removing for performance gainz)
* If signal is a list it will be as if RegisterSignal was called for each of the entries with the same following arguments
* Makes a component listen for the specified `signal` on it's `parent` datum.
* When that signal is recieved `proc_ref` will be called on the component, along with associated arguments
* Example proc ref: `.proc/OnEvent`
* If a previous registration is overwritten by the call, a runtime occurs. Setting `override` to TRUE prevents this
* These callbacks run asyncronously
* Returning `TRUE` from these callbacks will trigger a `TRUE` return from the `SendSignal()` that initiated it
### See/Define signals and their arguments in __DEFINES\components.dm
+264
View File
@@ -0,0 +1,264 @@
/datum/component
var/enabled = FALSE
var/dupe_mode = COMPONENT_DUPE_HIGHLANDER
var/dupe_type
var/list/signal_procs
var/datum/parent
/datum/component/New(datum/P, ...)
parent = P
var/list/arguments = args.Copy(2)
if(Initialize(arglist(arguments)) == COMPONENT_INCOMPATIBLE)
qdel(src, TRUE, TRUE)
CRASH("Incompatible [type] assigned to a [P]!")
_JoinParent(P)
/datum/component/proc/_JoinParent()
var/datum/P = parent
//lazy init the parent's dc list
var/list/dc = P.datum_components
if(!dc)
P.datum_components = dc = list()
//set up the typecache
var/our_type = type
for(var/I in _GetInverseTypeList(our_type))
var/test = dc[I]
if(test) //already another component of this type here
var/list/components_of_type
if(!length(test))
components_of_type = list(test)
dc[I] = components_of_type
else
components_of_type = test
if(I == our_type) //exact match, take priority
var/inserted = FALSE
for(var/J in 1 to components_of_type.len)
var/datum/component/C = components_of_type[J]
if(C.type != our_type) //but not over other exact matches
components_of_type.Insert(J, I)
inserted = TRUE
break
if(!inserted)
components_of_type += src
else //indirect match, back of the line with ya
components_of_type += src
else //only component of this type, no list
dc[I] = src
/datum/component/proc/Initialize(...)
return
/datum/component/Destroy(force=FALSE, silent=FALSE)
enabled = FALSE
var/datum/P = parent
if(!force)
_RemoveFromParent()
if(!silent)
P.SendSignal(COMSIG_COMPONENT_REMOVING, src)
parent = null
LAZYCLEARLIST(signal_procs)
return ..()
/datum/component/proc/_RemoveFromParent()
var/datum/P = parent
var/list/dc = P.datum_components
for(var/I in _GetInverseTypeList())
var/list/components_of_type = dc[I]
if(length(components_of_type)) //
var/list/subtracted = components_of_type - src
if(subtracted.len == 1) //only 1 guy left
dc[I] = subtracted[1] //make him special
else
dc[I] = subtracted
else //just us
dc -= I
if(!dc.len)
P.datum_components = null
/datum/component/proc/RegisterSignal(sig_type_or_types, proc_or_callback, override = FALSE)
if(QDELETED(src))
return
var/list/procs = signal_procs
if(!procs)
procs = list()
signal_procs = procs
var/list/sig_types = islist(sig_type_or_types) ? sig_type_or_types : list(sig_type_or_types)
for(var/sig_type in sig_types)
if(!override)
. = procs[sig_type]
if(.)
stack_trace("[sig_type] overridden. Use override = TRUE to suppress this warning")
if(!istype(proc_or_callback, /datum/callback)) //if it wasnt a callback before, it is now
proc_or_callback = CALLBACK(src, proc_or_callback)
procs[sig_type] = proc_or_callback
enabled = TRUE
/datum/component/proc/InheritComponent(datum/component/C, i_am_original)
return
/datum/component/proc/OnTransfer(datum/new_parent)
return
/datum/component/proc/_GetInverseTypeList(our_type = type)
#if DM_VERSION >= 513
#warning 512 is definitely stable now, remove the old code
#endif
#if DM_VERSION < 512
//remove this when we use 512 full time
set invisibility = 101
#endif
//we can do this one simple trick
var/current_type = parent_type
. = list(our_type, current_type)
//and since most components are root level + 1, this won't even have to run
while(current_type != /datum/component)
current_type = type2parent(current_type)
. += current_type
/datum/proc/SendSignal(sigtype, ...)
var/list/comps = datum_components
if(!comps)
return NONE
var/list/arguments = args.Copy(2)
var/target = comps[/datum/component]
if(!length(target))
var/datum/component/C = target
if(!C.enabled)
return NONE
var/datum/callback/CB = C.signal_procs[sigtype]
if(!CB)
return NONE
return CB.InvokeAsync(arglist(arguments))
. = NONE
for(var/I in target)
var/datum/component/C = I
if(!C.enabled)
continue
var/datum/callback/CB = C.signal_procs[sigtype]
if(!CB)
continue
. |= CB.InvokeAsync(arglist(arguments))
/datum/proc/GetComponent(c_type)
var/list/dc = datum_components
if(!dc)
return null
. = dc[c_type]
if(length(.))
return .[1]
/datum/proc/GetExactComponent(c_type)
var/list/dc = datum_components
if(!dc)
return null
var/datum/component/C = dc[c_type]
if(C)
if(length(C))
C = C[1]
if(C.type == c_type)
return C
return null
/datum/proc/GetComponents(c_type)
var/list/dc = datum_components
if(!dc)
return null
. = dc[c_type]
if(!length(.))
return list(.)
/datum/proc/AddComponent(new_type, ...)
var/datum/component/nt = new_type
var/dm = initial(nt.dupe_mode)
var/dt = initial(nt.dupe_type)
var/datum/component/old_comp
var/datum/component/new_comp
if(ispath(nt))
if(nt == /datum/component)
CRASH("[nt] attempted instantiation!")
if(!isnum(dm))
CRASH("[nt]: Invalid dupe_mode ([dm])!")
if(dt && !ispath(dt))
CRASH("[nt]: Invalid dupe_type ([dt])!")
else
new_comp = nt
args[1] = src
if(dm != COMPONENT_DUPE_ALLOWED)
if(!dt)
old_comp = GetExactComponent(nt)
else
old_comp = GetComponent(dt)
if(old_comp)
switch(dm)
if(COMPONENT_DUPE_UNIQUE)
if(!new_comp)
new_comp = new nt(arglist(args))
if(!QDELETED(new_comp))
old_comp.InheritComponent(new_comp, TRUE)
QDEL_NULL(new_comp)
if(COMPONENT_DUPE_HIGHLANDER)
if(!new_comp)
new_comp = new nt(arglist(args))
if(!QDELETED(new_comp))
new_comp.InheritComponent(old_comp, FALSE)
QDEL_NULL(old_comp)
if(COMPONENT_DUPE_UNIQUE_PASSARGS)
if(!new_comp)
var/list/arguments = args.Copy(2)
old_comp.InheritComponent(null, TRUE, arguments)
else
old_comp.InheritComponent(new_comp, TRUE)
else if(!new_comp)
new_comp = new nt(arglist(args)) // There's a valid dupe mode but there's no old component, act like normal
else if(!new_comp)
new_comp = new nt(arglist(args)) // Dupes are allowed, act like normal
if(!old_comp && !QDELETED(new_comp)) // Nothing related to duplicate components happened and the new component is healthy
SendSignal(COMSIG_COMPONENT_ADDED, new_comp)
return new_comp
return old_comp
/datum/proc/LoadComponent(component_type, ...)
. = GetComponent(component_type)
if(!.)
return AddComponent(arglist(args))
/datum/proc/TakeComponent(datum/component/C)
if(!C)
return
var/datum/helicopter = C.parent
if(helicopter == src)
//if we're taking to the same thing no need for anything
return
if(C.OnTransfer(src) == COMPONENT_INCOMPATIBLE)
qdel(C)
return
C._RemoveFromParent()
helicopter.SendSignal(COMSIG_COMPONENT_REMOVING, C)
C.parent = src
if(C == AddComponent(C))
C._JoinParent()
/datum/proc/TransferComponents(datum/target)
var/list/dc = datum_components
if(!dc)
return
var/comps = dc[/datum/component]
if(islist(comps))
for(var/I in comps)
target.TakeComponent(I)
else
target.TakeComponent(comps)
/datum/component/nano_host()
return parent
@@ -0,0 +1,389 @@
/*
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:
amount - raw amount of the mineral this container is holding, calculated by the defined value MINERAL_MATERIAL_AMOUNT=2000.
max_amount - max raw amount of mineral this container can hold.
sheet_type - type of the mineral sheet the container handles, used for output.
parent - object that this container is being used by, used for output.
MAX_STACK_SIZE - size of a stack of mineral sheets. Constant.
*/
/datum/component/material_container
var/total_amount = 0
var/max_amount
var/sheet_type
var/list/materials
var/show_on_examine
var/list/allowed_typecache
var/last_inserted_id
var/precise_insertion = FALSE
var/datum/callback/precondition
var/datum/callback/after_insert
/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)
materials = list()
max_amount = max(0, max_amt)
show_on_examine = _show_on_examine
if(allowed_types)
allowed_typecache = typecacheof(allowed_types)
precondition = _precondition
after_insert = _after_insert
RegisterSignal(COMSIG_PARENT_ATTACKBY, .proc/OnAttackBy)
RegisterSignal(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()
/datum/component/material_container/proc/OnExamine(mob/user)
for(var/I in materials)
var/datum/material/M = materials[I]
var/amt = amount(M.id)
if(amt)
to_chat(user, "<span class='notice'>It has [amt] units of [lowertext(M.name)] stored.</span>")
/datum/component/material_container/proc/OnAttackBy(obj/item/I, mob/living/user)
var/list/tc = allowed_typecache
if(user.a_intent != INTENT_HELP)
return
if((I.flags_2 & (HOLOGRAM_2 | NO_MAT_REDEMPTION_2)) || (tc && !is_type_in_typecache(I, tc)))
to_chat(user, "<span class='warning'>[parent] won't accept [I]!</span>")
return
. = COMPONENT_NO_AFTERATTACK
var/datum/callback/pc = precondition
if(pc && !pc.Invoke(user))
return
var/material_amount = get_item_material_amount(I)
if(!material_amount)
to_chat(user, "<span class='warning'>[I] does not contain sufficient amounts of metal or glass to be accepted by [parent].</span>")
return
if(!has_space(material_amount))
to_chat(user, "<span class='warning'>[parent] is full. Please remove metal or glass from [parent] in order to insert more.</span>")
return
user_insert(I, user)
/datum/component/material_container/proc/user_insert(obj/item/I, mob/living/user)
set waitfor = FALSE
var/requested_amount
if(istype(I, /obj/item/stack) && precise_insertion)
var/atom/current_parent = parent
var/obj/item/stack/S = I
requested_amount = input(user, "How much do you want to insert?", "Inserting [S.singular_name]s") as num|null
if(isnull(requested_amount) || (requested_amount <= 0))
return
if(QDELETED(I) || QDELETED(user) || QDELETED(src) || parent != current_parent || user.incapacitated() || !in_range(current_parent, user) || user.l_hand != I && user.r_hand != I)
return
if(!user.drop_item())
to_chat(user, "<span class='warning'>[I] is stuck to you and cannot be placed into [parent].</span>")
return
var/inserted = insert_item(I, stack_amt = requested_amount)
if(inserted)
if(istype(I, /obj/item/stack))
var/obj/item/stack/S = I
to_chat(user, "<span class='notice'>You insert [inserted] [S.singular_name][inserted>1 ? "s" : ""] into [parent].</span>")
if(!QDELETED(I))
if(!user.put_in_hands(I))
stack_trace("Warning: User could not put object back in hand during material container insertion, line [__LINE__]! This can lead to issues.")
I.forceMove(user.loc)
else
to_chat(user, "<span class='notice'>You insert a material total of [inserted] into [parent].</span>")
qdel(I)
if(after_insert)
after_insert.Invoke(I.type, last_inserted_id, inserted)
else
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
/datum/component/material_container/proc/insert_stack(obj/item/stack/S, amt, multiplier = 1)
if(isnull(amt))
amt = S.amount
if(amt <= 0)
return FALSE
if(amt > S.amount)
amt = S.amount
var/material_amt = get_item_material_amount(S)
if(!material_amt)
return FALSE
amt = min(amt, round(((max_amount - total_amount) / material_amt)))
if(!amt)
return FALSE
last_inserted_id = insert_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)
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
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))
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 FALSE
/datum/component/material_container/proc/can_insert_amount(amt, id)
if(amt && id)
var/datum/material/M = materials[id]
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)
if(!M.sheet_type)
return FALSE
if(sheet_amt > 0)
if(M.amount < (sheet_amt * MINERAL_MATERIAL_AMOUNT))
sheet_amt = round(M.amount / MINERAL_MATERIAL_AMOUNT)
var/count = 0
while(sheet_amt > MAX_STACK_SIZE)
new M.sheet_type(get_turf(parent), MAX_STACK_SIZE)
count += MAX_STACK_SIZE
use_amount_type(sheet_amt * MINERAL_MATERIAL_AMOUNT, M.id)
sheet_amt -= MAX_STACK_SIZE
if(round((sheet_amt * MINERAL_MATERIAL_AMOUNT) / MINERAL_MATERIAL_AMOUNT))
var/obj/item/stack/sheet/s = new M.sheet_type(get_turf(parent), sheet_amt)
if(target)
s.forceMove(target)
count += sheet_amt
use_amount_type(sheet_amt * MINERAL_MATERIAL_AMOUNT, M.id)
return count
return FALSE
/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)
/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)
return result
/datum/component/material_container/proc/has_space(amt = 0)
return (total_amount + amt) <= max_amount
/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))
return FALSE
return TRUE
/datum/component/material_container/proc/amount2sheet(amt)
if(amt >= MINERAL_MATERIAL_AMOUNT)
return round(amt / MINERAL_MATERIAL_AMOUNT)
return FALSE
/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
/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)
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/clown
/datum/material/tranquillite
name = "Tranquillite"
id = MAT_TRANQUILLITE
sheet_type = /obj/item/stack/sheet/mineral/tranquillite
coin_type = /obj/item/coin/mime
/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
+14 -1
View File
@@ -1,6 +1,6 @@
/datum
var/gc_destroyed //Time when this object was destroyed.
var/list/datum_components //for /datum/components
var/var_edited = FALSE //Warranty void if seal is broken
var/tmp/unique_datum_id = null
@@ -15,4 +15,17 @@
// Return the appropriate QDEL_HINT; in most cases this is QDEL_HINT_QUEUE.
/datum/proc/Destroy(force = FALSE, ...)
tag = null
var/list/dc = datum_components
if(dc)
var/all_components = dc[/datum/component]
if(length(all_components))
for(var/I in all_components)
var/datum/component/C = I
qdel(C, FALSE, TRUE)
else
var/datum/component/C = all_components
qdel(C, FALSE, TRUE)
dc.Cut()
return QDEL_HINT_QUEUE
-292
View File
@@ -1,292 +0,0 @@
/*
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:
amount - raw amount of the mineral this container is holding, calculated by the defined value MINERAL_MATERIAL_AMOUNT=2000.
max_amount - max raw amount of mineral this container can hold.
sheet_type - type of the mineral sheet the container handles, used for output.
owner - object that this container is being used by, used for output.
MAX_STACK_SIZE - size of a stack of mineral sheets. Constant.
*/
/datum/material_container
var/total_amount = 0
var/max_amount
var/sheet_type
var/obj/owner
var/list/materials = list()
//MAX_STACK_SIZE = 50
//MINERAL_MATERIAL_AMOUNT = 2000
/datum/material_container/New(obj/O, list/mat_list, max_amt = 0)
owner = O
max_amount = max(0, max_amt)
if(mat_list[MAT_METAL])
materials[MAT_METAL] = new /datum/material/metal()
if(mat_list[MAT_GLASS])
materials[MAT_GLASS] = new /datum/material/glass()
if(mat_list[MAT_SILVER])
materials[MAT_SILVER] = new /datum/material/silver()
if(mat_list[MAT_GOLD])
materials[MAT_GOLD] = new /datum/material/gold()
if(mat_list[MAT_DIAMOND])
materials[MAT_DIAMOND] = new /datum/material/diamond()
if(mat_list[MAT_URANIUM])
materials[MAT_URANIUM] = new /datum/material/uranium()
if(mat_list[MAT_PLASMA])
materials[MAT_PLASMA] = new /datum/material/plasma()
if(mat_list[MAT_BANANIUM])
materials[MAT_BANANIUM] = new /datum/material/bananium()
if(mat_list[MAT_TRANQUILLITE])
materials[MAT_TRANQUILLITE] = new /datum/material/tranquillite()
if(mat_list[MAT_TITANIUM])
materials[MAT_TITANIUM] = new /datum/material/titanium()
/datum/material_container/Destroy()
QDEL_LIST_ASSOC_VAL(materials)
owner = null
return ..()
//For inserting an amount of material
/datum/material_container/proc/insert_amount(amt, material_type = null)
if(amt > 0 && has_space(amt))
var/total_amount_saved = total_amount
if(material_type)
var/datum/material/M = materials[material_type]
if(M)
M.amount += amt
total_amount += amt
else
for(var/datum/material/M in materials)
M.amount += amt
total_amount += amt
return (total_amount - total_amount_saved)
return 0
/datum/material_container/proc/insert_stack(obj/item/stack/S, amt = 0)
if(amt <= 0)
return 0
if(amt > S.amount)
amt = S.amount
var/material_amt = get_item_material_amount(S)
if(!material_amt)
return 0
amt = min(amt, round(((max_amount - total_amount) / material_amt)))
if(!amt)
return 0
insert_materials(S,amt)
S.use(amt)
return amt
/datum/material_container/proc/insert_item(obj/item/I, multiplier = 1)
if(!I)
return 0
if(istype(I,/obj/item/stack))
var/obj/item/stack/S = I
return insert_stack(I, S.amount)
var/material_amount = get_item_material_amount(I)
if(!material_amount || !has_space(material_amount))
return 0
insert_materials(I, multiplier)
return material_amount
/datum/material_container/proc/insert_materials(obj/item/I, multiplier = 1) //for internal usage only
var/datum/material/M
for(var/MAT in materials)
M = materials[MAT]
M.amount += I.materials[MAT] * multiplier
total_amount += I.materials[MAT] * multiplier
//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/material_container/proc/use_amount(list/mats, multiplier=1)
if(!mats || !mats.len)
return 0
var/datum/material/M
for(var/MAT in materials)
M = materials[MAT]
if(M.amount < (mats[MAT] * multiplier))
return 0
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/material_container/proc/use_amount_type(amt, material_type)
var/datum/material/M
M = materials[material_type]
if(M)
if(M.amount >= amt)
M.amount -= amt
total_amount -= amt
return amt
return 0
//For spawning mineral sheets; internal use only
/datum/material_container/proc/retrieve(sheet_amt, datum/material/M)
if(!M.sheet_type)
return 0
if(sheet_amt > 0)
if(M.amount < (sheet_amt * MINERAL_MATERIAL_AMOUNT))
sheet_amt = round(M.amount / MINERAL_MATERIAL_AMOUNT)
var/count = 0
while(sheet_amt > MAX_STACK_SIZE)
new M.sheet_type(get_turf(owner), MAX_STACK_SIZE)
count += MAX_STACK_SIZE
use_amount_type(sheet_amt * MINERAL_MATERIAL_AMOUNT, M.material_type)
sheet_amt -= MAX_STACK_SIZE
if(round(M.amount / MINERAL_MATERIAL_AMOUNT))
new M.sheet_type(get_turf(owner), sheet_amt)
count += sheet_amt
use_amount_type(sheet_amt * MINERAL_MATERIAL_AMOUNT, M.material_type)
return count
return 0
/datum/material_container/proc/retrieve_sheets(sheet_amt, material_type)
if(materials[material_type])
return retrieve(sheet_amt, materials[material_type])
return 0
/datum/material_container/proc/retrieve_amount(amt, material_type)
return retrieve_sheets(amount2sheet(amt),material_type)
/datum/material_container/proc/retrieve_all()
var/result = 0
var/datum/material/M
for(var/MAT in materials)
M = materials[MAT]
result += retrieve_sheets(amount2sheet(M.amount), MAT)
return result
/datum/material_container/proc/has_space(amt = 0)
return (total_amount + amt) <= max_amount
/datum/material_container/proc/has_materials(list/mats, multiplier=1)
if(!mats || !mats.len)
return 0
var/datum/material/M
for(var/MAT in mats)
M = materials[MAT]
if(M.amount < (mats[MAT] * multiplier))
return 0
return 1
/datum/material_container/proc/amount2sheet(amt)
if(amt >= MINERAL_MATERIAL_AMOUNT)
return round(amt / MINERAL_MATERIAL_AMOUNT)
return 0
/datum/material_container/proc/sheet2amount(sheet_amt)
if(sheet_amt > 0)
return sheet_amt * MINERAL_MATERIAL_AMOUNT
return 0
/datum/material_container/proc/amount(material_type)
var/datum/material/M = materials[material_type]
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
/datum/material_container/proc/get_item_material_amount(obj/item/I)
if(!istype(I))
return 0
var/material_amount = 0
for(var/MAT in materials)
material_amount += I.materials[MAT]
return material_amount
/datum/material
var/amount = 0
var/material_type = null
var/sheet_type = null
/datum/material/metal
/datum/material/metal/New()
..()
material_type = MAT_METAL
sheet_type = /obj/item/stack/sheet/metal
/datum/material/glass
/datum/material/glass/New()
..()
material_type = MAT_GLASS
sheet_type = /obj/item/stack/sheet/glass
/datum/material/silver
/datum/material/silver/New()
..()
material_type = MAT_SILVER
sheet_type = /obj/item/stack/sheet/mineral/silver
/datum/material/gold
/datum/material/gold/New()
..()
material_type = MAT_GOLD
sheet_type = /obj/item/stack/sheet/mineral/gold
/datum/material/diamond
/datum/material/diamond/New()
..()
material_type = MAT_DIAMOND
sheet_type = /obj/item/stack/sheet/mineral/diamond
/datum/material/uranium
/datum/material/uranium/New()
..()
material_type = MAT_URANIUM
sheet_type = /obj/item/stack/sheet/mineral/uranium
/datum/material/plasma
/datum/material/plasma/New()
..()
material_type = MAT_PLASMA
sheet_type = /obj/item/stack/sheet/mineral/plasma
/datum/material/bananium
/datum/material/bananium/New()
..()
material_type = MAT_BANANIUM
sheet_type = /obj/item/stack/sheet/mineral/bananium
/datum/material/tranquillite
/datum/material/tranquillite/New()
..()
material_type = MAT_TRANQUILLITE
sheet_type = /obj/item/stack/sheet/mineral/tranquillite
/datum/material/titanium
/datum/material/titanium/New()
..()
material_type = MAT_TITANIUM
sheet_type = /obj/item/stack/sheet/mineral/titanium
/datum/material/biomass
/datum/material/biomass/New()
..()
material_type = MAT_BIOMASS
+2 -2
View File
@@ -1236,8 +1236,8 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
/datum/supply_packs/materials/plastic30
name = "30 Plastic Sheets Crate"
contains = list(/obj/item/stack/sheet/plastic)
amount = 30
cost = 25
amount = 50
cost = 10
containername = "plastic sheets crate"
//////////////////////////////////////////////////////////////////////////////
+4 -1
View File
@@ -1,7 +1,8 @@
/atom
layer = 2
var/level = 2
var/flags = 0
var/flags = NONE
var/flags_2 = NONE
var/list/fingerprints
var/list/fingerprintshidden
var/fingerprintslast = null
@@ -220,6 +221,8 @@
else
to_chat(user, "Nothing.")
SendSignal(COMSIG_PARENT_EXAMINE, user)
return distance == -1 || (get_dist(src, user) <= distance) || isobserver(user) //observers do not have a range limit
/atom/proc/relaymove()
+20 -31
View File
@@ -35,11 +35,10 @@
var/selected_category
var/screen = 1
var/datum/material_container/materials
var/list/categories = list("Tools", "Electronics", "Construction", "Communication", "Security", "Machinery", "Medical", "Miscellaneous", "Dinnerware", "Imported")
/obj/machinery/autolathe/New()
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS), 0, FALSE, null, null, CALLBACK(src, .proc/AfterMaterialInsert))
..()
component_parts = list()
component_parts += new /obj/item/circuitboard/autolathe(null)
@@ -48,7 +47,6 @@
component_parts += new /obj/item/stock_parts/matter_bin(null)
component_parts += new /obj/item/stock_parts/manipulator(null)
component_parts += new /obj/item/stock_parts/console_screen(null)
materials = new /datum/material_container(src, list(MAT_METAL = 1, MAT_GLASS = 1))
RefreshParts()
wires = new(src)
@@ -68,7 +66,8 @@
/obj/machinery/autolathe/Destroy()
QDEL_NULL(wires)
QDEL_NULL(materials)
GET_COMPONENT(materials, /datum/component/material_container)
materials.retrieve_all()
return ..()
/obj/machinery/autolathe/interact(mob/user)
@@ -88,6 +87,7 @@
ui.open()
/obj/machinery/autolathe/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state)
GET_COMPONENT(materials, /datum/component/material_container)
var/data[0]
data["screen"] = screen
data["total_amount"] = materials.total_amount
@@ -138,7 +138,7 @@
/obj/machinery/autolathe/proc/design_cost_data(datum/design/D)
var/list/data = list()
var/coeff = get_coeff(D)
GET_COMPONENT(materials, /datum/component/material_container)
var/has_metal = 1
if(D.materials[MAT_METAL] && (materials.amount(MAT_METAL) < (D.materials[MAT_METAL] / coeff)))
has_metal = 0
@@ -152,6 +152,7 @@
return data
/obj/machinery/autolathe/proc/queue_data(list/data)
GET_COMPONENT(materials, /datum/component/material_container)
var/temp_metal = materials.amount(MAT_METAL)
var/temp_glass = materials.amount(MAT_GLASS)
data["processing"] = being_built.len ? get_processing_line() : null
@@ -183,7 +184,6 @@
if(panel_open)
if(istype(O, /obj/item/crowbar))
materials.retrieve_all()
default_deconstruction_crowbar(O)
return 1
else
@@ -213,32 +213,18 @@
to_chat(user, "<span class='warning'>This is not the correct type of disk for the autolathe!</span>")
return 1
var/material_amount = materials.get_item_material_amount(O)
if(!material_amount)
to_chat(user, "<span class='warning'>This object does not contain sufficient amounts of metal or glass to be accepted by the autolathe.</span>")
return 1
if(!materials.has_space(material_amount))
to_chat(user, "<span class='warning'>The autolathe is full. Please remove metal or glass from the autolathe in order to insert more.</span>")
return 1
if(!user.unEquip(O))
to_chat(user, "<span class='warning'>\The [O] is stuck to you and cannot be placed into the autolathe.</span>")
return 1
return ..()
busy = 1
var/inserted = materials.insert_item(O)
if(inserted)
if(istype(O,/obj/item/stack))
if(O.materials[MAT_METAL])
/obj/machinery/autolathe/proc/AfterMaterialInsert(type_inserted, id_inserted, amount_inserted)
if(ispath(type_inserted, /obj/item/ore/bluespace_crystal))
use_power(MINERAL_MATERIAL_AMOUNT / 10)
else
switch(id_inserted)
if(MAT_METAL)
flick("autolathe_o",src)//plays metal insertion animation
if(O.materials[MAT_GLASS])
flick("autolathe_r", src)//plays glass insertion animation
to_chat(user, "<span class='notice'>You insert [inserted] sheet[inserted>1 ? "s" : ""] to the autolathe.</span>")
use_power(inserted * 100)
else
to_chat(user, "<span class='notice'>You insert a material total of [inserted] to the autolathe.</span>")
use_power(max(500, inserted / 10))
qdel(O)
busy = 0
if(MAT_GLASS)
flick("autolathe_r",src)//plays glass insertion animation
use_power(min(1000, amount_inserted / 100))
SSnanoui.update_uis(src)
/obj/machinery/autolathe/attack_ghost(mob/user)
@@ -274,6 +260,7 @@
//multiplier checks : only stacks can have one and its value is 1, 10 ,25 or max_multiplier
var/multiplier = text2num(href_list["multiplier"])
GET_COMPONENT(materials, /datum/component/material_container)
var/max_multiplier = min(design_last_ordered.maxstack, design_last_ordered.materials[MAT_METAL] ?round(materials.amount(MAT_METAL)/design_last_ordered.materials[MAT_METAL]):INFINITY,design_last_ordered.materials[MAT_GLASS]?round(materials.amount(MAT_GLASS)/design_last_ordered.materials[MAT_GLASS]):INFINITY)
var/is_stack = ispath(design_last_ordered.build_path, /obj/item/stack)
@@ -327,6 +314,7 @@
for(var/obj/item/stock_parts/matter_bin/MB in component_parts)
tot_rating += MB.rating
tot_rating *= 25000
GET_COMPONENT(materials, /datum/component/material_container)
materials.max_amount = tot_rating * 3
for(var/obj/item/stock_parts/manipulator/M in component_parts)
prod_coeff += M.rating - 1
@@ -339,6 +327,7 @@
desc = initial(desc)+"\nIt's building \a [initial(D.name)]."
var/is_stack = ispath(D.build_path, /obj/item/stack)
var/coeff = get_coeff(D)
GET_COMPONENT(materials, /datum/component/material_container)
var/metal_cost = D.materials[MAT_METAL]
var/glass_cost = D.materials[MAT_GLASS]
var/power = max(2000, (metal_cost+glass_cost)*multiplier/5)
@@ -370,7 +359,7 @@
return 0
var/coeff = get_coeff(D)
GET_COMPONENT(materials, /datum/component/material_container)
var/metal_amount = materials.amount(MAT_METAL)
if(custom_metal)
metal_amount = custom_metal
+1 -1
View File
@@ -652,7 +652,7 @@ obj/item/circuitboard/rdserver
/obj/item/circuitboard/podfab
name = "Circuit board (Spacepod Fabricator)"
build_path = /obj/machinery/spod_part_fabricator //ah fuck my life
build_path = /obj/machinery/mecha_part_fabricator/spacepod
board_type = "machine"
origin_tech = "programming=2;engineering=2"
frame_desc = "Requires 3 Matter Bins, 2 Manipulators, 2 Micro-Lasers, and 1 Console Screen."
+4 -7
View File
@@ -13,25 +13,20 @@ var/const/SAFETY_COOLDOWN = 100
var/blood = 0
var/eat_dir = WEST
var/amount_produced = 1
var/datum/material_container/materials
var/crush_damage = 1000
var/eat_victim_items = 1
var/item_recycle_sound = 'sound/machines/recycler.ogg'
/obj/machinery/recycler/New()
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_URANIUM, MAT_BANANIUM, MAT_TRANQUILLITE, MAT_TITANIUM, MAT_PLASTIC, MAT_BLUESPACE))
..()
component_parts = list()
component_parts += new /obj/item/circuitboard/recycler(null)
component_parts += new /obj/item/stock_parts/matter_bin(null)
component_parts += new /obj/item/stock_parts/manipulator(null)
materials = new /datum/material_container(src, list(MAT_METAL=1, MAT_GLASS=1, MAT_SILVER=1, MAT_GOLD=1, MAT_DIAMOND=1, MAT_PLASMA=1, MAT_URANIUM=1, MAT_BANANIUM=1, MAT_TRANQUILLITE=1, MAT_TITANIUM=1))
RefreshParts()
update_icon()
/obj/machinery/recycler/Destroy()
QDEL_NULL(materials)
return ..()
/obj/machinery/recycler/RefreshParts()
var/amt_made = 0
var/mat_mod = 0
@@ -40,6 +35,7 @@ var/const/SAFETY_COOLDOWN = 100
mat_mod *= 50000
for(var/obj/item/stock_parts/manipulator/M in component_parts)
amt_made = 25 * M.rating //% of materials salvaged
GET_COMPONENT(materials, /datum/component/material_container)
materials.max_amount = mat_mod
amount_produced = min(100, amt_made)
@@ -130,8 +126,9 @@ var/const/SAFETY_COOLDOWN = 100
playsound(loc, item_recycle_sound, 100, 0)
/obj/machinery/recycler/proc/recycle_item(obj/item/I)
I.loc = loc
I.forceMove(loc)
GET_COMPONENT(materials, /datum/component/material_container)
var/material_amount = materials.get_item_material_amount(I)
if(!material_amount)
qdel(I)
-146
View File
@@ -1,146 +0,0 @@
/obj/machinery/robotic_fabricator
name = "Robotic Fabricator"
icon = 'icons/obj/robotics.dmi'
icon_state = "fab-idle"
density = 1
anchored = 1
var/metal_amount = 0
var/operating = 0
var/obj/item/robot_parts/being_built = null
use_power = 1
idle_power_usage = 20
active_power_usage = 5000
/obj/machinery/robotic_fabricator/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
if(istype(O, /obj/item/stack/sheet/metal))
if(src.metal_amount < 150000.0)
var/count = 0
src.overlays += "fab-load-metal"
spawn(15)
if(O)
if(!O:amount)
return
while(metal_amount < 150000 && O:amount)
src.metal_amount += O:materials[MAT_METAL] /*O:height * O:width * O:length * 100000.0*/
O:amount--
count++
if(O:amount < 1)
qdel(O)
to_chat(user, "You insert [count] metal sheet\s into the fabricator.")
src.overlays -= "fab-load-metal"
updateDialog()
else
to_chat(user, "The robot part maker is full. Please remove metal from the robot part maker in order to insert more.")
/obj/machinery/robotic_fabricator/power_change()
if(powered())
stat &= ~NOPOWER
else
stat |= NOPOWER
/obj/machinery/robotic_fabricator/attack_hand(user as mob)
var/dat
if(..())
return
if(src.operating)
dat = {"
<TT>Building [src.being_built.name].<BR>
Please wait until completion...</TT><BR>
<BR>
"}
else
dat = {"
<B>Metal Amount:</B> [min(150000, src.metal_amount)] cm<sup>3</sup> (MAX: 150,000)<BR><HR>
<BR>
<A href='?src=[UID()];make=1'>Left Arm (25,000 cc metal.)<BR>
<A href='?src=[UID()];make=2'>Right Arm (25,000 cc metal.)<BR>
<A href='?src=[UID()];make=3'>Left Leg (25,000 cc metal.)<BR>
<A href='?src=[UID()];make=4'>Right Leg (25,000 cc metal).<BR>
<A href='?src=[UID()];make=5'>Chest (50,000 cc metal).<BR>
<A href='?src=[UID()];make=6'>Head (50,000 cc metal).<BR>
<A href='?src=[UID()];make=7'>Robot Frame (75,000 cc metal).<BR>
"}
user << browse("<HEAD><TITLE>Robotic Fabricator Control Panel</TITLE></HEAD><TT>[dat]</TT>", "window=robot_fabricator")
onclose(user, "robot_fabricator")
return
/obj/machinery/robotic_fabricator/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["make"])
if(!src.operating)
var/part_type = text2num(href_list["make"])
var/build_type = ""
var/build_time = 200
var/build_cost = 25000
switch(part_type)
if(1)
build_type = "/obj/item/robot_parts/l_arm"
build_time = 200
build_cost = 10000
if(2)
build_type = "/obj/item/robot_parts/r_arm"
build_time = 200
build_cost = 10000
if(3)
build_type = "/obj/item/robot_parts/l_leg"
build_time = 200
build_cost = 10000
if(4)
build_type = "/obj/item/robot_parts/r_leg"
build_time = 200
build_cost = 10000
if(5)
build_type = "/obj/item/robot_parts/chest"
build_time = 350
build_cost = 40000
if(6)
build_type = "/obj/item/robot_parts/head"
build_time = 350
build_cost = 5000
if(7)
build_type = "/obj/item/robot_parts/robot_suit"
build_time = 600
build_cost = 15000
var/building = text2path(build_type)
if(!isnull(building))
if(src.metal_amount >= build_cost)
src.operating = 1
src.use_power = 2
src.metal_amount = max(0, src.metal_amount - build_cost)
src.being_built = new building(src)
src.overlays += "fab-active"
src.updateUsrDialog()
spawn (build_time)
if(!isnull(src.being_built))
src.being_built.loc = get_turf(src)
src.being_built = null
src.use_power = 1
src.operating = 0
src.overlays -= "fab-active"
return
for(var/mob/M in viewers(1, src))
if(M.client && M.machine == src)
src.attack_hand(M)
+1 -1
View File
@@ -1,7 +1,7 @@
/obj/machinery/slot_machine
name = "slot machine"
desc = "Gambling for the antisocial."
icon = 'icons/obj/objects.dmi'
icon = 'icons/obj/economy.dmi'
icon_state = "slots-off"
anchored = 1
density = 1
@@ -192,6 +192,7 @@
equip_cooldown = 10
energy_drain = 250
range = MELEE|RANGED
flags_2 = NO_MAT_REDEMPTION_2
var/mode = 0 //0 - deconstruct, 1 - wall or floor, 2 - airlock.
var/canRwall = 0
toolspeed = 1
+141 -200
View File
@@ -3,27 +3,15 @@
icon_state = "fab-idle"
name = "exosuit fabricator"
desc = "Nothing is being built."
density = 1
anchored = 1
density = TRUE
anchored = TRUE
use_power = 1
idle_power_usage = 20
active_power_usage = 5000
var/time_coeff = 1
var/component_coeff = 1
var/list/resources = list(
MAT_METAL=0,
MAT_GLASS=0,
MAT_BANANIUM=0,
MAT_TRANQUILLITE=0,
MAT_DIAMOND=0,
MAT_GOLD=0,
MAT_PLASMA=0,
MAT_SILVER=0,
MAT_URANIUM=0,
MAT_TITANIUM=0
)
var/res_max_amount = 200000
var/datum/research/files
var/fabricator_type = MECHFAB
var/id
var/sync = 0
var/part_set
@@ -49,6 +37,10 @@
)
/obj/machinery/mecha_part_fabricator/New()
var/datum/component/material_container/materials = AddComponent(/datum/component/material_container,
list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TRANQUILLITE, MAT_TITANIUM, MAT_BLUESPACE), 0,
FALSE, list(/obj/item/stack, /obj/item/ore/bluespace_crystal), CALLBACK(src, .proc/is_insertion_ready), CALLBACK(src, .proc/AfterMaterialInsert))
materials.precise_insertion = TRUE
..()
component_parts = list()
component_parts += new /obj/item/circuitboard/mechfab(null)
@@ -71,13 +63,19 @@
component_parts += new /obj/item/stock_parts/console_screen(null)
RefreshParts()
/obj/machinery/mecha_part_fabricator/Destroy()
GET_COMPONENT(materials, /datum/component/material_container)
materials.retrieve_all()
return ..()
/obj/machinery/mecha_part_fabricator/RefreshParts()
var/T = 0
//maximum stocking amount (max 412000)
//maximum stocking amount (default 300000, 600000 at T4)
for(var/obj/item/stock_parts/matter_bin/M in component_parts)
T += M.rating
res_max_amount = (187000+(T * 37500))
GET_COMPONENT(materials, /datum/component/material_container)
materials.max_amount = (200000 + (T*50000))
//resources adjustment coefficient (1 -> 0.85 -> 0.7 -> 0.55)
T = 1.15
@@ -96,54 +94,62 @@
var/output = ""
for(var/v in files.known_designs)
var/datum/design/D = files.known_designs[v]
if(D.build_type & MECHFAB)
if(D.build_type & fabricator_type)
if(!(set_name in D.category))
continue
var/resources_available = check_resources(D)
output += "<div class='part'>[output_part_info(D)]<br>\[[resources_available?"<a href='?src=[UID()];part=[D.id]'>Build</a> | ":null]<a href='?src=[UID()];add_to_queue=[D.id]'>Add to queue</a>\]\[<a href='?src=[UID()];part_desc=[D.id]'>?</a>\]</div>"
output += "<div class='part'>[output_part_info(D)]<br>\["
if(check_resources(D))
output += "<a href='?src=[UID()];part=[D.id]'>Build</a> | "
output += "<a href='?src=[UID()];add_to_queue=[D.id]'>Add to queue</a>\]\[<a href='?src=[UID()];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] seconds"
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
for(var/c in D.materials)
if(c in resources)
output += "[i?" | ":null][get_resource_cost_w_coeff(D,c)] [material2name(c)]"
i++
output += "[i?" | ":null][get_resource_cost_w_coeff(D, c)] [material2name(c)]"
i++
return output
/obj/machinery/mecha_part_fabricator/proc/output_available_resources()
var/output
for(var/resource in resources)
var/amount = min(res_max_amount, resources[resource])
output += "<span class=\"res_name\">[material2name(resource)]: </span>[amount] cm&sup3;, [round(resources[resource] / MINERAL_MATERIAL_AMOUNT,0.1)] sheets"
if(amount>0)
output += "<span style='font-size:80%;'> - Remove \[<a href='?src=[UID()];remove_mat=1;material=[resource]'>1</a>\] | \[<a href='?src=[UID()];remove_mat=10;material=[resource]'>10</a>\] | \[<a href='?src=[UID()];remove_mat=1;material=[resource];custom_eject=1'>Custom</a>\] | \[<a href='?src=[UID()];remove_mat=[resources[resource] / MINERAL_MATERIAL_AMOUNT];material=[resource]'>All</a>\]</span>"
GET_COMPONENT(materials, /datum/component/material_container)
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=[UID()];remove_mat=1;material=[mat_id]'>1</a>\]"
if(M.amount >= (MINERAL_MATERIAL_AMOUNT * 10))
output += " | \[<a href='?src=[UID()];remove_mat=10;material=[mat_id]'>10</a>\]"
output += " | \[<a href='?src=[UID()];remove_mat=50;material=[mat_id]'>All</a>\]</span>"
output += "<br/>"
return output
/obj/machinery/mecha_part_fabricator/proc/remove_resources(datum/design/D)
for(var/resource in D.materials)
if(resource in resources)
resources[resource] -= get_resource_cost_w_coeff(D,resource)
/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)
return resources
/obj/machinery/mecha_part_fabricator/proc/check_resources(datum/design/D)
for(var/R in D.materials)
if(R in resources)
if(resources[R] < get_resource_cost_w_coeff(D, R))
return 0
else
return 0
return 1
if(D.reagents_list.len) // No reagents storage - no reagent designs.
return FALSE
GET_COMPONENT(materials, /datum/component/material_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)
being_built = D
desc = "It's building \a [initial(D.name)]."
remove_resources(D)
var/list/res_coef = get_resources_w_coeff(D)
GET_COMPONENT(materials, /datum/component/material_container)
materials.use_amount(res_coef)
overlays += "fab-active"
use_power = 2
updateUsrDialog()
@@ -160,13 +166,12 @@
L.origin_tech = I.origin_tech
else
I.loc = get_step(src,SOUTH)
I.materials[MAT_METAL] = get_resource_cost_w_coeff(D,MAT_METAL)
I.materials[MAT_GLASS] = get_resource_cost_w_coeff(D,MAT_GLASS)
visible_message("[bicon(src)] <b>\The [src]</b> beeps, \"\The [I] is complete.\"")
I.materials = res_coef
atom_say("[I] is complete.")
being_built = null
updateUsrDialog()
return 1
return TRUE
/obj/machinery/mecha_part_fabricator/proc/update_queue_on_page()
send_byjax(usr,"mecha_fabricator.browser","queue",list_queue())
@@ -176,7 +181,7 @@
if(set_name in part_sets)
for(var/v in files.known_designs)
var/datum/design/D = files.known_designs[v]
if(D.build_type & MECHFAB)
if(D.build_type & fabricator_type)
if(set_name in D.category)
add_to_queue(D)
@@ -189,9 +194,9 @@
/obj/machinery/mecha_part_fabricator/proc/remove_from_queue(index)
if(!isnum(index) || !istype(queue) || (index<1 || index>queue.len))
return 0
return FALSE
queue.Cut(index,++index)
return 1
return TRUE
/obj/machinery/mecha_part_fabricator/proc/process_queue()
var/datum/design/D = queue[1]
@@ -204,16 +209,16 @@
temp = null
while(D)
if(stat&(NOPOWER|BROKEN))
return 0
return FALSE
if(!check_resources(D))
visible_message("[bicon(src)] <b>\The [src]</b> beeps, \"Not enough resources. Queue processing stopped.\"")
atom_say("Not enough resources. Queue processing stopped.")
temp = {"<span class='alert'>Not enough resources to build next part.</span><br>
<a href='?src=[UID()];process_queue=1'>Try again</a> | <a href='?src=[UID()];clear_temp=1'>Return</a><a>"}
return 0
return FALSE
remove_from_queue(1)
build_part(D)
D = listgetindex(queue, 1)
visible_message("[bicon(src)] <b>\The [src]</b> beeps, \"Queue processing finished successfully.\"")
atom_say("Queue processing finished successfully.")
/obj/machinery/mecha_part_fabricator/proc/list_queue()
var/output = "<b>Queue contains:</b>"
@@ -225,7 +230,11 @@
for(var/datum/design/D in queue)
i++
var/obj/part = D.build_path
output += "<li[!check_resources(D)?" style='color: #f00;'":null]>[initial(part.name)] - [i>1?"<a href='?src=[UID()];queue_move=-1;index=[i]' class='arrow'>&uarr;</a>":null] [i<queue.len?"<a href='?src=[UID()];queue_move=+1;index=[i]' class='arrow'>&darr;</a>":null] <a href='?src=[UID()];remove_from_queue=[i]'>Remove</a></li>"
output += "<li[!check_resources(D)?" style='color: #f00;'":null]>"
output += initial(part.name) + " - "
output += "[i>1?"<a href='?src=[UID()];queue_move=-1;index=[i]' class='arrow'>&uarr;</a>":null] "
output += "[i<queue.len?"<a href='?src=[UID()];queue_move=+1;index=[i]' class='arrow'>&darr;</a>":null] "
output += "<a href='?src=[UID()];remove_from_queue=[i]'>Remove</a></li>"
output += "</ol>"
output += "\[<a href='?src=[UID()];process_queue=1'>Process queue</a> | <a href='?src=[UID()];clear_queue=1'>Clear queue</a>\]"
@@ -246,7 +255,7 @@
temp += "<a href='?src=[UID()];clear_temp=1'>Return</a>"
updateUsrDialog()
visible_message("[bicon(src)] <b>\The [src]</b> beeps, \"Successfully synchronized with R&D server.\"")
atom_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=[UID()];clear_temp=1'>Return</a>"
@@ -275,9 +284,9 @@
if(..())
return
user.set_machine(src)
var/turf/exit = get_step(src,SOUTH)
if(isliving(user) && exit.density)
visible_message("[bicon(src)] <b>\The [src]</b> beeps, \"Error! Part outlet is obstructed.\"")
var/turf/exit = get_step(src,(dir))
if(exit.density)
atom_say("Error! Part outlet is obstructed.")
return
if(temp)
left_part = temp
@@ -295,8 +304,9 @@
if("parts")
left_part += output_parts_list(part_set)
left_part += "<hr><a href='?src=[UID()];screen=main'>Return</a>"
dat = {"
<title>[name]</title>
dat = {"<html>
<head>
<title>[name]</title>
<style>
.res_name {font-weight: bold; text-transform: capitalize;}
.red {color: #f00;}
@@ -310,19 +320,21 @@
<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: #000;' id='queue'>
<td style='width: 35%; background: #ccc;' id='queue'>
[list_queue()]
</td>
<tr>
</table>"}
var/datum/browser/popup = new(user, "mecha_fabricator", name, 1000, 490)
popup.set_content(dat)
popup.open(0)
</table>
</body>
</html>"}
user << browse(dat, "window=mecha_fabricator;size=1000x430")
onclose(user, "mecha_fabricator")
return
@@ -340,17 +352,23 @@
screen = "parts"
if(href_list["part"])
var/T = afilter.getStr("part")
var/datum/design/D = files.known_designs[T]
if(D && (D.build_type & MECHFAB))
if(!processing_queue)
build_part(D)
else
add_to_queue(D)
for(var/v in files.known_designs)
var/datum/design/D = files.known_designs[v]
if(D.build_type & fabricator_type)
if(D.id == T)
if(!processing_queue)
build_part(D)
else
add_to_queue(D)
break
if(href_list["add_to_queue"])
var/T = afilter.getStr("add_to_queue")
var/datum/design/D = files.known_designs[T]
if(D && D.build_type & MECHFAB)
add_to_queue(D)
for(var/v in files.known_designs)
var/datum/design/D = files.known_designs[v]
if(D.build_type & fabricator_type)
if(D.id == T)
add_to_queue(D)
break
return update_queue_on_page()
if(href_list["remove_from_queue"])
remove_from_queue(afilter.getNum("remove_from_queue"))
@@ -359,9 +377,9 @@
add_part_set_to_queue(afilter.get("partset_to_queue"))
return update_queue_on_page()
if(href_list["process_queue"])
spawn(-1)
spawn(0)
if(processing_queue || being_built)
return 0
return FALSE
processing_queue = 1
process_queue()
processing_queue = 0
@@ -383,144 +401,67 @@
sync()
if(href_list["part_desc"])
var/T = afilter.getStr("part_desc")
var/datum/design/D = files.known_designs[T]
if(D && D.build_type & MECHFAB)
var/obj/part = D.build_path
temp = {"<h1>[initial(part.name)] description:</h1>
[initial(part.desc)]<br>
<a href='?src=[UID()];clear_temp=1'>Return</a>
"}
for(var/v in files.known_designs)
var/datum/design/D = files.known_designs[v]
if(D.build_type & fabricator_type)
if(D.id == T)
var/obj/part = D.build_path
temp = {"<h1>[initial(part.name)] description:</h1>
[initial(part.desc)]<br>
<a href='?src=[UID()];clear_temp=1'>Return</a>
"}
break
if(href_list["remove_mat"] && href_list["material"])
var/amount = text2num(href_list["remove_mat"])
var/material = href_list["material"]
if(href_list["custom_eject"])
amount = input("How many sheets would you like to eject from the machine?", "How much?", 1) as null|num
amount = max(0,min(round(resources[material]/MINERAL_MATERIAL_AMOUNT),amount)) // Rounding errors aren't scary, as the mineral eject proc is smart
if(!amount)
return
amount = round(amount)
if(amount < 0 || amount > resources[material]) //href protection, except that resources[] is 2000 per sheet
return
var/removed = remove_material(material,amount)
if(removed == -1)
temp = "Not enough [material2name(material)] to produce a sheet."
else
temp = "Ejected [removed] of [material2name(material)]"
temp += "<br><a href='?src=[UID()];clear_temp=1'>Return</a>"
GET_COMPONENT(materials, /datum/component/material_container)
materials.retrieve_sheets(text2num(href_list["remove_mat"]), href_list["material"])
updateUsrDialog()
return
/obj/machinery/mecha_part_fabricator/proc/remove_material(var/mat_string, var/amount)
if(resources[mat_string] < MINERAL_MATERIAL_AMOUNT) //not enough mineral for a sheet
return -1
var/type
switch(mat_string)
if(MAT_METAL)
type = /obj/item/stack/sheet/metal
if(MAT_GLASS)
type = /obj/item/stack/sheet/glass
if(MAT_GOLD)
type = /obj/item/stack/sheet/mineral/gold
if(MAT_SILVER)
type = /obj/item/stack/sheet/mineral/silver
if(MAT_DIAMOND)
type = /obj/item/stack/sheet/mineral/diamond
if(MAT_PLASMA)
type = /obj/item/stack/sheet/mineral/plasma
if(MAT_URANIUM)
type = /obj/item/stack/sheet/mineral/uranium
if(MAT_BANANIUM)
type = /obj/item/stack/sheet/mineral/bananium
if(MAT_TRANQUILLITE)
type = /obj/item/stack/sheet/mineral/tranquillite
if(MAT_TITANIUM)
type = /obj/item/stack/sheet/mineral/titanium
else
return 0
var/result = 0
/obj/machinery/mecha_part_fabricator/proc/AfterMaterialInsert(type_inserted, id_inserted, amount_inserted)
var/stack_name = material2name(id_inserted)
overlays += "fab-load-[stack_name]"
sleep(10)
overlays -= "fab-load-[stack_name]"
updateUsrDialog()
while(amount > 50)
new type(get_turf(src),50)
amount -= 50
result += 50
resources[mat_string] -= 50 * MINERAL_MATERIAL_AMOUNT
var/total_amount = round(resources[mat_string]/MINERAL_MATERIAL_AMOUNT)
if(total_amount)//if there's still enough material for sheets
var/obj/item/stack/sheet/res = new type(get_turf(src),min(amount,total_amount))
resources[mat_string] -= res.amount*MINERAL_MATERIAL_AMOUNT
result += res.amount
return result
/obj/machinery/mecha_part_fabricator/attackby(obj/W as obj, mob/user as mob, params)
/obj/machinery/mecha_part_fabricator/attackby(obj/item/W, mob/user, params)
if(default_deconstruction_screwdriver(user, "fab-o", "fab-idle", W))
return
if(exchange_parts(user, W))
return
if(panel_open)
if(istype(W, /obj/item/crowbar))
for(var/material in resources)
remove_material(material, resources[material]/MINERAL_MATERIAL_AMOUNT)
default_deconstruction_crowbar(W)
return 1
else
to_chat(user, "<span class='danger'>You can't load \the [name] while it's opened.</span>")
return 1
if(default_deconstruction_crowbar(W))
return TRUE
if(istype(W, /obj/item/stack))
var/material
switch(W.type)
if(/obj/item/stack/sheet/mineral/gold)
material = MAT_GOLD
if(/obj/item/stack/sheet/mineral/silver)
material = MAT_SILVER
if(/obj/item/stack/sheet/mineral/diamond)
material = MAT_DIAMOND
if(/obj/item/stack/sheet/mineral/plasma)
material = MAT_PLASMA
if(/obj/item/stack/sheet/metal)
material = MAT_METAL
if(/obj/item/stack/sheet/glass)
material = MAT_GLASS
if(/obj/item/stack/sheet/mineral/bananium)
material = MAT_BANANIUM
if(/obj/item/stack/sheet/mineral/tranquillite)
material = MAT_TRANQUILLITE
if(/obj/item/stack/sheet/mineral/uranium)
material = MAT_URANIUM
if(/obj/item/stack/sheet/mineral/titanium)
material = MAT_TITANIUM
else
return ..()
else
return ..()
if(being_built)
to_chat(user, "\The [src] is currently processing. Please wait until completion.")
return
if(res_max_amount - resources[material] < MINERAL_MATERIAL_AMOUNT) //overstuffing the fabricator
to_chat(user, "\The [src] [material2name(material)] storage is full.")
return
var/obj/item/stack/sheet/stack = W
var/sname = "[stack.name]"
if(resources[material] < res_max_amount)
overlays += "fab-load-[material2name(material)]"//loading animation is now an overlay based on material type. No more spontaneous conversion of all ores to metal. -vey
var/transfer_amount = min(stack.amount, round((res_max_amount - resources[material])/MINERAL_MATERIAL_AMOUNT,1))
resources[material] += transfer_amount * MINERAL_MATERIAL_AMOUNT
stack.use(transfer_amount)
to_chat(user, "You insert [transfer_amount] [sname] sheet\s into \the [src].")
sleep(10)
updateUsrDialog()
overlays -= "fab-load-[material2name(material)]" //No matter what the overlay shall still be deleted
else
to_chat(user, "\The [src] cannot hold any more [sname] sheet\s.")
return
/obj/machinery/mecha_part_fabricator/proc/material2name(var/ID)
/obj/machinery/mecha_part_fabricator/proc/material2name(ID)
return copytext(ID,2)
/obj/machinery/mecha_part_fabricator/proc/is_insertion_ready(mob/user)
if(panel_open)
to_chat(user, "<span class='warning'>You can't load [src] while it's opened!</span>")
return FALSE
if(being_built)
to_chat(user, "<span class='warning'>\The [src] is currently processing! Please wait until completion.</span>")
return FALSE
return TRUE
/obj/machinery/mecha_part_fabricator/spacepod
name = "spacepod fabricator"
fabricator_type = PODFAB
part_sets = list( "Pod_Weaponry",
"Pod_Armor",
"Pod_Cargo",
"Pod_Parts",
"Pod_Frame",
"Misc")
/obj/machinery/mecha_part_fabricator/robot
name = "Robotic Fabricator"
part_sets = list("Cyborg")
@@ -364,24 +364,26 @@ var/global/list/datum/stack_recipe/brass_recipes = list ( \
throw_range = 3
origin_tech = "materials=2;biotech=2"
var/global/list/datum/stack_recipe/plastic_recipes = list ( \
new/datum/stack_recipe("plastic flaps", /obj/structure/plasticflaps, 5, one_per_turf = 1, on_floor = 1, time = 40), \
new/datum/stack_recipe("plastic crate", /obj/structure/closet/crate/plastic, 10, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("plastic ashtray", /obj/item/ashtray/plastic, 2, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("plastic fork", /obj/item/kitchen/utensil/pfork, 1, on_floor = 1), \
new/datum/stack_recipe("plastic spoon", /obj/item/kitchen/utensil/pspoon, 1, on_floor = 1), \
new/datum/stack_recipe("plastic spork", /obj/item/kitchen/utensil/pspork, 1, on_floor = 1), \
new/datum/stack_recipe("plastic knife", /obj/item/kitchen/knife/plastic, 1, on_floor = 1), \
new/datum/stack_recipe("plastic bag", /obj/item/storage/bag/plasticbag, 3, on_floor = 1), \
new/datum/stack_recipe("bear mould", /obj/item/kitchen/mould/bear, 1, on_floor = 1), \
new/datum/stack_recipe("worm mould", /obj/item/kitchen/mould/worm, 1, on_floor = 1), \
new/datum/stack_recipe("bean mould", /obj/item/kitchen/mould/bean, 1, on_floor = 1), \
new/datum/stack_recipe("ball mould", /obj/item/kitchen/mould/ball, 1, on_floor = 1), \
new/datum/stack_recipe("cane mould", /obj/item/kitchen/mould/cane, 1, on_floor = 1), \
new/datum/stack_recipe("cash mould", /obj/item/kitchen/mould/cash, 1, on_floor = 1), \
new/datum/stack_recipe("coin mould", /obj/item/kitchen/mould/coin, 1, on_floor = 1), \
new/datum/stack_recipe("sucker mould", /obj/item/kitchen/mould/loli, 1, on_floor = 1), \
)
GLOBAL_LIST_INIT(plastic_recipes, list(
new /datum/stack_recipe("plastic flaps", /obj/structure/plasticflaps, 5, one_per_turf = 1, on_floor = 1, time = 40), \
new /datum/stack_recipe("wet floor sign", /obj/item/caution, 2), \
new /datum/stack_recipe("water bottle", /obj/item/reagent_containers/food/drinks/waterbottle/empty), \
new /datum/stack_recipe("large water bottle", /obj/item/reagent_containers/food/drinks/waterbottle/large/empty,3), \
new /datum/stack_recipe("plastic crate", /obj/structure/closet/crate/plastic, 10, one_per_turf = 1, on_floor = 1), \
new /datum/stack_recipe("plastic ashtray", /obj/item/ashtray/plastic, 2, one_per_turf = 1, on_floor = 1), \
new /datum/stack_recipe("plastic fork", /obj/item/kitchen/utensil/pfork, 1, on_floor = 1), \
new /datum/stack_recipe("plastic spoon", /obj/item/kitchen/utensil/pspoon, 1, on_floor = 1), \
new /datum/stack_recipe("plastic spork", /obj/item/kitchen/utensil/pspork, 1, on_floor = 1), \
new /datum/stack_recipe("plastic knife", /obj/item/kitchen/knife/plastic, 1, on_floor = 1), \
new /datum/stack_recipe("plastic bag", /obj/item/storage/bag/plasticbag, 3, on_floor = 1), \
new /datum/stack_recipe("bear mould", /obj/item/kitchen/mould/bear, 1, on_floor = 1), \
new /datum/stack_recipe("worm mould", /obj/item/kitchen/mould/worm, 1, on_floor = 1), \
new /datum/stack_recipe("bean mould", /obj/item/kitchen/mould/bean, 1, on_floor = 1), \
new /datum/stack_recipe("ball mould", /obj/item/kitchen/mould/ball, 1, on_floor = 1), \
new /datum/stack_recipe("cane mould", /obj/item/kitchen/mould/cane, 1, on_floor = 1), \
new /datum/stack_recipe("cash mould", /obj/item/kitchen/mould/cash, 1, on_floor = 1), \
new /datum/stack_recipe("coin mould", /obj/item/kitchen/mould/coin, 1, on_floor = 1), \
new /datum/stack_recipe("sucker mould", /obj/item/kitchen/mould/loli, 1, on_floor = 1)))
/obj/item/stack/sheet/plastic
name = "plastic"
@@ -390,10 +392,11 @@ var/global/list/datum/stack_recipe/plastic_recipes = list ( \
icon_state = "sheet-plastic"
throwforce = 7
origin_tech = "materials=1;biotech=1"
materials = list(MAT_PLASTIC = MINERAL_MATERIAL_AMOUNT)
merge_type = /obj/item/stack/sheet/plastic
/obj/item/stack/sheet/plastic/New()
recipes = plastic_recipes
recipes = GLOB.plastic_recipes
. = ..()
/obj/item/stack/sheet/plastic/fifty
+1
View File
@@ -20,6 +20,7 @@ RCD
origin_tech = "engineering=4;materials=2"
toolspeed = 1
usesound = 'sound/items/Deconstruct.ogg'
flags_2 = NO_MAT_REDEMPTION_2
var/datum/effect_system/spark_spread/spark_system
var/max_matter = 100
var/matter = 0
@@ -69,6 +69,7 @@
item_state = "card-id"
origin_tech = "magnets=2;syndicate=2"
flags = NOBLUDGEON
flags_2 = NO_MAT_REDEMPTION_2
/obj/item/card/emag/attack()
return
@@ -38,6 +38,7 @@
max_w_class = WEIGHT_CLASS_HUGE
max_combined_w_class = 35
burn_state = FIRE_PROOF
flags_2 = NO_MAT_REDEMPTION_2
cant_hold = list(/obj/item/storage/backpack/holding)
/obj/item/storage/backpack/holding/New()
@@ -75,7 +75,7 @@
origin_tech = "materials=4;bluespace=4;engineering=4;plasmatech=3"
max_combined_w_class = 60
storage_slots = 60
flags_2 = NO_MAT_REDEMPTION_2
// -----------------------------
// Plastic Bag
+7 -1
View File
@@ -51,12 +51,18 @@
for(var/A in L)
var/turf/T = A
if(T.Adjacent(user))
. += T.contents
for(var/B in T)
var/atom/movable/AM = B
if(AM.flags_2 & HOLOGRAM_2)
continue
. += AM
/datum/personal_crafting/proc/get_surroundings(mob/user)
. = list()
for(var/obj/item/I in get_environment(user))
if(I.flags_2 & HOLOGRAM_2)
continue
if(istype(I, /obj/item/stack))
var/obj/item/stack/S = I
.[I.type] += S.amount
+26 -1
View File
@@ -365,4 +365,29 @@
name = "Goon from a Blue Toolbox special edition"
desc = "Wine from the land down under, where the dingos roam and the roos do wander."
icon_state = "goonbag"
list_reagents = list("wine" = 70)
list_reagents = list("wine" = 70)
/obj/item/reagent_containers/food/drinks/waterbottle
name = "bottle of water"
desc = "A bottle of water filled at an old Earth bottling facility."
icon = 'icons/obj/drinks.dmi'
icon_state = "smallbottle"
item_state = "bottle"
list_reagents = list("water" = 49.5, "fluorine" = 0.5) //see desc, don't think about it too hard
materials = list(MAT_GLASS = 0)
volume = 50
amount_per_transfer_from_this = 10
/obj/item/reagent_containers/food/drinks/waterbottle/empty
list_reagents = list()
/obj/item/reagent_containers/food/drinks/waterbottle/large
desc = "A fresh commercial-sized bottle of water."
icon_state = "largebottle"
materials = list(MAT_GLASS = 0)
list_reagents = list("water" = 100)
volume = 100
amount_per_transfer_from_this = 20
/obj/item/reagent_containers/food/drinks/waterbottle/large/empty
list_reagents = list()
@@ -64,13 +64,6 @@
icon_state = "cola"
list_reagents = list("cola" = 30)
/obj/item/reagent_containers/food/drinks/cans/waterbottle
name = "Bottled Water"
desc = "Introduced to the vending machines by Skrellian request, this water comes straight from the Martian poles."
icon_state = "waterbottle"
is_plastic = 1
list_reagents = list("water" = 30)
/obj/item/reagent_containers/food/drinks/cans/beer
name = "Space Beer"
desc = "Contains only water, malt and hops."
+1 -1
View File
@@ -1,7 +1,7 @@
/*****************************Coin********************************/
/obj/item/coin
icon = 'icons/obj/items.dmi'
icon = 'icons/obj/economy.dmi'
name = "coin"
icon_state = "coin__heads"
flags = CONDUCT
@@ -393,7 +393,7 @@
for(var/i in T)
if(istype(i, /obj/item) && !is_type_in_typecache(i, banned_items_typecache))
var/obj/item/W = i
if(!W.admin_spawned)
if(!W.admin_spawned && !(W.flags_2 & HOLOGRAM_2) && !(W.flags & ABSTRACT))
L += W
if(L.len)
var/obj/item/CHOSEN = pick(L)
@@ -1,29 +0,0 @@
/**********************Input and output plates**************************/
/obj/machinery/mineral/input
icon = 'icons/mob/screen_gen.dmi'
icon_state = "x2"
name = "Input area"
density = 0
anchored = 1.0
New()
icon_state = "blank"
/obj/machinery/mineral/output
icon = 'icons/mob/screen_gen.dmi'
icon_state = "x"
name = "Output area"
density = 0
anchored = 1.0
New()
icon_state = "blank"
/obj/machinery/mineral
var/input_dir = NORTH
var/output_dir = SOUTH
/obj/machinery/mineral/proc/unload_mineral(var/atom/movable/S)
S.loc = loc
var/turf/T = get_step(src,output_dir)
if(T)
S.loc = T
+176 -412
View File
@@ -1,201 +1,69 @@
#define SMELT_AMOUNT 10
/**********************Mineral processing unit console**************************/
/obj/machinery/mineral
var/input_dir = NORTH
var/output_dir = SOUTH
/obj/machinery/mineral/proc/unload_mineral(atom/movable/S)
S.forceMove(loc)
var/turf/T = get_step(src,output_dir)
if(T)
S.forceMove(T)
/obj/machinery/mineral/processing_unit_console
name = "production machine console"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "console"
density = 1
anchored = 1
density = TRUE
anchored = TRUE
var/obj/machinery/mineral/processing_unit/machine = null
var/machinedir = EAST
/obj/machinery/mineral/processing_unit_console/New()
..()
spawn(7)
src.machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, machinedir))
if(machine)
machine.CONSOLE = src
else
qdel(src)
/obj/machinery/mineral/processing_unit_console/attack_hand(user as mob)
var/dat = "<b>Smelter control console</b><br><br>"
//iron
if(machine.ore_iron || machine.ore_glass || machine.ore_plasma || machine.ore_uranium || machine.ore_gold || machine.ore_silver || machine.ore_diamond || machine.ore_clown || machine.ore_mime || machine.ore_adamantine)
if(machine.ore_iron)
if(machine.selected_iron==1)
dat += "<A href='?src=[UID()];sel_iron=no'><font color='green'>Smelting</font></A> "
else
dat += "<A href='?src=[UID()];sel_iron=yes'><font color='red'>Not smelting</font></A> "
dat += "Iron: [machine.ore_iron]<br>"
else
machine.selected_iron = 0
//sand - glass
if(machine.ore_glass)
if(machine.selected_glass==1)
dat += "<A href='?src=[UID()];sel_glass=no'><font color='green'>Smelting</font></A> "
else
dat += "<A href='?src=[UID()];sel_glass=yes'><font color='red'>Not smelting</font></A> "
dat += "Sand: [machine.ore_glass]<br>"
else
machine.selected_glass = 0
//plasma
if(machine.ore_plasma)
if(machine.selected_plasma==1)
dat += "<A href='?src=[UID()];sel_plasma=no'><font color='green'>Smelting</font></A> "
else
dat += "<A href='?src=[UID()];sel_plasma=yes'><font color='red'>Not smelting</font></A> "
dat += "Plasma: [machine.ore_plasma]<br>"
else
machine.selected_plasma = 0
//uranium
if(machine.ore_uranium)
if(machine.selected_uranium==1)
dat += "<A href='?src=[UID()];sel_uranium=no'><font color='green'>Smelting</font></A> "
else
dat += "<A href='?src=[UID()];sel_uranium=yes'><font color='red'>Not smelting</font></A> "
dat += "Uranium: [machine.ore_uranium]<br>"
else
machine.selected_uranium = 0
//gold
if(machine.ore_gold)
if(machine.selected_gold==1)
dat += "<A href='?src=[UID()];sel_gold=no'><font color='green'>Smelting</font></A> "
else
dat += "<A href='?src=[UID()];sel_gold=yes'><font color='red'>Not smelting</font></A> "
dat += "Gold: [machine.ore_gold]<br>"
else
machine.selected_gold = 0
//silver
if(machine.ore_silver)
if(machine.selected_silver==1)
dat += "<A href='?src=[UID()];sel_silver=no'><font color='green'>Smelting</font></A> "
else
dat += "<A href='?src=[UID()];sel_silver=yes'><font color='red'>Not smelting</font></A> "
dat += "Silver: [machine.ore_silver]<br>"
else
machine.selected_silver = 0
//diamond
if(machine.ore_diamond)
if(machine.selected_diamond==1)
dat += "<A href='?src=[UID()];sel_diamond=no'><font color='green'>Smelting</font></A> "
else
dat += "<A href='?src=[UID()];sel_diamond=yes'><font color='red'>Not smelting</font></A> "
dat += "Diamond: [machine.ore_diamond]<br>"
else
machine.selected_diamond = 0
//bananium
if(machine.ore_clown)
if(machine.selected_clown==1)
dat += "<A href='?src=[UID()];sel_clown=no'><font color='green'>Smelting</font></A> "
else
dat += "<A href='?src=[UID()];sel_clown=yes'><font color='red'>Not smelting</font></A> "
dat += "Bananium: [machine.ore_clown]<br>"
else
machine.selected_clown = 0
//tranquillite
if(machine.ore_mime)
if(machine.selected_mime==1)
dat += "<A href='?src=[UID()];sel_mime=no'><font color='green'>Smelting</font></A> "
else
dat += "<A href='?src=[UID()];sel_mime=yes'><font color='red'>Not smelting</font></A> "
dat += "Tranquillite: [machine.ore_mime]<br>"
else
machine.selected_mime = 0
//titanium
if(machine.ore_titanium)
if (machine.selected_titanium==1)
dat += "<A href='?src=\ref[src];sel_titanium=no'><font color='green'>Smelting</font></A> "
else
dat += "<A href='?src=\ref[src];sel_titanium=yes'><font color='red'>Not smelting</font></A> "
dat += "Titanium: [machine.ore_titanium]<br>"
else
machine.selected_titanium = 0
//On or off
dat += text("Machine is currently ")
if(machine.on==1)
dat += text("<A href='?src=[UID()];set_on=off'>On</A> ")
else
dat += text("<A href='?src=[UID()];set_on=on'>Off</A> ")
machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, machinedir))
if(machine)
machine.CONSOLE = src
else
dat+="---No Materials Loaded---"
qdel(src)
/obj/machinery/mineral/processing_unit_console/attack_hand(mob/user)
if(..())
return
if(!machine)
return
user << browse("[dat]", "window=console_processing_unit")
var/dat = machine.get_machine_data()
var/datum/browser/popup = new(user, "processing", "Smelting Console", 300, 500)
popup.set_content(dat)
popup.open()
/obj/machinery/mineral/processing_unit_console/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["sel_iron"])
if(href_list["sel_iron"] == "yes")
machine.selected_iron = 1
else
machine.selected_iron = 0
if(href_list["sel_glass"])
if(href_list["sel_glass"] == "yes")
machine.selected_glass = 1
else
machine.selected_glass = 0
if(href_list["sel_plasma"])
if(href_list["sel_plasma"] == "yes")
machine.selected_plasma = 1
else
machine.selected_plasma = 0
if(href_list["sel_uranium"])
if(href_list["sel_uranium"] == "yes")
machine.selected_uranium = 1
else
machine.selected_uranium = 0
if(href_list["sel_gold"])
if(href_list["sel_gold"] == "yes")
machine.selected_gold = 1
else
machine.selected_gold = 0
if(href_list["sel_silver"])
if(href_list["sel_silver"] == "yes")
machine.selected_silver = 1
else
machine.selected_silver = 0
if(href_list["sel_diamond"])
if(href_list["sel_diamond"] == "yes")
machine.selected_diamond = 1
else
machine.selected_diamond = 0
if(href_list["sel_clown"])
if(href_list["sel_clown"] == "yes")
machine.selected_clown = 1
else
machine.selected_clown = 0
if(href_list["sel_mime"])
if(href_list["sel_mime"] == "yes")
machine.selected_mime = 1
else
machine.selected_mime = 0
if(href_list["sel_titanium"])
if (href_list["sel_titanium"] == "yes")
machine.selected_titanium = 1
else
machine.selected_titanium = 0
add_fingerprint(usr)
if(href_list["material"])
machine.selected_material = href_list["material"]
machine.selected_alloy = null
if(href_list["alloy"])
machine.selected_material = null
machine.selected_alloy = href_list["alloy"]
if(href_list["set_on"])
if(href_list["set_on"] == "on")
machine.on = 1
else
machine.on = 0
src.updateUsrDialog()
return
machine.on = (href_list["set_on"] == "on")
updateUsrDialog()
/obj/machinery/mineral/processing_unit_console/Destroy()
machine = null
return ..()
/**********************Mineral processing unit**************************/
@@ -204,244 +72,140 @@
name = "furnace"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "furnace"
density = 1
anchored = 1
density = TRUE
anchored = TRUE
var/obj/machinery/mineral/CONSOLE = null
var/ore_gold = 0
var/ore_silver = 0
var/ore_diamond = 0
var/ore_glass = 0
var/ore_plasma = 0
var/ore_uranium = 0
var/ore_iron = 0
var/ore_clown = 0
var/ore_mime = 0
var/ore_adamantine = 0
var/ore_titanium = 0
var/selected_gold = 0
var/selected_silver = 0
var/selected_diamond = 0
var/selected_glass = 0
var/selected_plasma = 0
var/selected_uranium = 0
var/selected_iron = 0
var/selected_clown = 0
var/selected_mime = 0
var/selected_titanium = 0
var/on = 0 //0 = off, 1 =... oh you know!
var/on = FALSE
var/selected_material = MAT_METAL
var/selected_alloy = null
var/datum/research/files
speed_process = TRUE
/obj/machinery/mineral/processing_unit/New()
..()
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TRANQUILLITE, MAT_TITANIUM, MAT_BLUESPACE), INFINITY)
files = new /datum/research/smelter(src)
/obj/machinery/mineral/processing_unit/Destroy()
CONSOLE = null
QDEL_NULL(files)
GET_COMPONENT(materials, /datum/component/material_container)
materials.retrieve_all()
return ..()
/obj/machinery/mineral/processing_unit/process()
for(var/i in 1 to 10)
if(on)
if(selected_glass && !selected_gold && !selected_silver && !selected_diamond && !selected_plasma && !selected_uranium && !selected_iron && !selected_clown && !selected_mime)
if(ore_glass > 0)
ore_glass--
generate_mineral(/obj/item/stack/sheet/glass)
else
on = 0
continue
if(selected_glass && !selected_gold && !selected_silver && !selected_diamond && !selected_plasma && !selected_uranium && selected_iron && !selected_clown && !selected_mime)
if(ore_glass > 0 && ore_iron > 0)
ore_glass--
ore_iron--
generate_mineral(/obj/item/stack/sheet/rglass)
else
on = 0
continue
if(!selected_glass && selected_gold && !selected_silver && !selected_diamond && !selected_plasma && !selected_uranium && !selected_iron && !selected_clown && !selected_mime)
if(ore_gold > 0)
ore_gold--
generate_mineral(/obj/item/stack/sheet/mineral/gold)
else
on = 0
continue
if(!selected_glass && !selected_gold && selected_silver && !selected_diamond && !selected_plasma && !selected_uranium && !selected_iron && !selected_clown && !selected_mime)
if(ore_silver > 0)
ore_silver--
generate_mineral(/obj/item/stack/sheet/mineral/silver)
else
on = 0
continue
if(!selected_glass && !selected_gold && !selected_silver && selected_diamond && !selected_plasma && !selected_uranium && !selected_iron && !selected_clown && !selected_mime)
if(ore_diamond > 0)
ore_diamond--
generate_mineral(/obj/item/stack/sheet/mineral/diamond)
else
on = 0
continue
if(!selected_glass && !selected_gold && !selected_silver && !selected_diamond && selected_plasma && !selected_uranium && !selected_iron && !selected_clown && !selected_mime)
if(ore_plasma > 0)
ore_plasma--
generate_mineral(/obj/item/stack/sheet/mineral/plasma)
else
on = 0
continue
if(!selected_glass && !selected_gold && !selected_silver && !selected_diamond && !selected_plasma && selected_uranium && !selected_iron && !selected_clown && !selected_mime)
if(ore_uranium > 0)
ore_uranium--
generate_mineral(/obj/item/stack/sheet/mineral/uranium)
else
on = 0
continue
if(!selected_glass && !selected_gold && !selected_silver && !selected_diamond && !selected_plasma && !selected_uranium && selected_iron && !selected_clown && !selected_mime)
if(ore_iron > 0)
ore_iron--
generate_mineral(/obj/item/stack/sheet/metal)
else
on = 0
continue
if(!selected_glass && !selected_gold && !selected_silver && !selected_diamond && selected_plasma && !selected_uranium && selected_iron && !selected_clown && !selected_mime)
if(ore_iron > 0 && ore_plasma > 0)
ore_iron--
ore_plasma--
generate_mineral(/obj/item/stack/sheet/plasteel)
else
on = 0
continue
if(!selected_glass && !selected_gold && !selected_silver && !selected_diamond && !selected_plasma && !selected_uranium && !selected_iron && selected_clown && !selected_mime)
if(ore_clown > 0)
ore_clown--
generate_mineral(/obj/item/stack/sheet/mineral/bananium)
else
on = 0
continue
if(!selected_glass && !selected_gold && !selected_silver && !selected_diamond && !selected_plasma && !selected_uranium && !selected_iron && !selected_clown && selected_mime)
if(ore_mime > 0)
ore_mime--
generate_mineral(/obj/item/stack/sheet/mineral/tranquillite)
else
on = 0
continue
if (!selected_glass && !selected_gold && !selected_silver && !selected_diamond && !selected_plasma && !selected_uranium && !selected_iron && !selected_clown && !selected_mime && selected_titanium)
if (ore_titanium > 0)
ore_titanium--
generate_mineral(/obj/item/stack/sheet/mineral/titanium)
else
on = 0
continue
if (!selected_glass && !selected_gold && !selected_silver && !selected_diamond && selected_plasma && !selected_uranium && !selected_iron && !selected_clown && !selected_mime && selected_titanium)
if (ore_titanium > 0)
ore_titanium--
ore_plasma--
generate_mineral(/obj/item/stack/sheet/mineral/plastitanium)
else
on = 0
continue
//if a non valid combination is selected
var/b = 1 //this part checks if all required ores are available
if(!(selected_gold || selected_silver ||selected_diamond || selected_uranium | selected_plasma || selected_iron || selected_iron))
b = 0
if(selected_gold == 1)
if(ore_gold <= 0)
b = 0
if(selected_silver == 1)
if(ore_silver <= 0)
b = 0
if(selected_diamond == 1)
if(ore_diamond <= 0)
b = 0
if(selected_uranium == 1)
if(ore_uranium <= 0)
b = 0
if(selected_plasma == 1)
if(ore_plasma <= 0)
b = 0
if(selected_iron == 1)
if(ore_iron <= 0)
b = 0
if(selected_glass == 1)
if(ore_glass <= 0)
b = 0
if(selected_clown == 1)
if(ore_clown <= 0)
b = 0
if(selected_mime == 1)
if(ore_mime <= 0)
b = 0
if(selected_titanium == 1)
if(ore_titanium <= 0)
b = 0
if(b) //if they are, deduct one from each, produce slag and shut the machine off
if(selected_gold == 1)
ore_gold--
if(selected_silver == 1)
ore_silver--
if(selected_diamond == 1)
ore_diamond--
if(selected_uranium == 1)
ore_uranium--
if(selected_plasma == 1)
ore_plasma--
if(selected_iron == 1)
ore_iron--
if(selected_clown == 1)
ore_clown--
if(selected_mime == 1)
ore_mime--
if(selected_titanium == 1)
ore_titanium--
generate_mineral(/obj/item/ore/slag)
on = 0
else
on = 0
break
break
else
break
var/turf/T = get_step(src,input_dir)
var/turf/T = get_step(src, input_dir)
if(T)
var/n = 0
for(var/obj/item/O in T)
n++
if(n>10)
break
if(istype(O,/obj/item/ore/iron))
ore_iron++;
O.loc = null
continue
if(istype(O,/obj/item/ore/glass))
ore_glass++;
O.loc = null
continue
if(istype(O,/obj/item/ore/diamond))
ore_diamond++;
O.loc = null
continue
if(istype(O,/obj/item/ore/plasma))
ore_plasma++
O.loc = null
continue
if(istype(O,/obj/item/ore/gold))
ore_gold++
O.loc = null
continue
if(istype(O,/obj/item/ore/silver))
ore_silver++
O.loc = null
continue
if(istype(O,/obj/item/ore/uranium))
ore_uranium++
O.loc = null
continue
if(istype(O,/obj/item/ore/bananium))
ore_clown++
O.loc = null
continue
if(istype(O,/obj/item/ore/tranquillite))
ore_mime++
O.loc = null
continue
if(istype(O,/obj/item/ore/titanium))
ore_titanium++
O.loc = null
continue
unload_mineral(O)
for(var/obj/item/ore/O in T)
process_ore(O)
CHECK_TICK
if(on)
if(selected_material)
smelt_ore()
/obj/machinery/mineral/processing_unit/proc/generate_mineral(var/P)
else if(selected_alloy)
smelt_alloy()
if(CONSOLE)
CONSOLE.updateUsrDialog()
/obj/machinery/mineral/processing_unit/proc/process_ore(obj/item/ore/O)
GET_COMPONENT(materials, /datum/component/material_container)
var/material_amount = materials.get_item_material_amount(O)
if(!materials.has_space(material_amount))
unload_mineral(O)
else
materials.insert_item(O)
qdel(O)
if(CONSOLE)
CONSOLE.updateUsrDialog()
/obj/machinery/mineral/processing_unit/proc/get_machine_data()
var/dat = "<b>Smelter control console</b><br><br>"
GET_COMPONENT(materials, /datum/component/material_container)
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
dat += "<span class=\"res_name\">[M.name]: </span>[M.amount] cm&sup3;"
if(selected_material == mat_id)
dat += " <i>Smelting</i>"
else
dat += " <A href='?src=[CONSOLE.UID()];material=[mat_id]'><b>Not Smelting</b></A> "
dat += "<br>"
dat += "<br><br>"
dat += "<b>Smelt Alloys</b><br>"
for(var/v in files.known_designs)
var/datum/design/D = files.known_designs[v]
dat += "<span class=\"res_name\">[D.name] "
if(selected_alloy == D.id)
dat += " <i>Smelting</i>"
else
dat += " <A href='?src=[CONSOLE.UID()];alloy=[D.id]'><b>Not Smelting</b></A> "
dat += "<br>"
dat += "<br><br>"
//On or off
dat += "Machine is currently "
if(on)
dat += "<A href='?src=[CONSOLE.UID()];set_on=off'>On</A> "
else
dat += "<A href='?src=[CONSOLE.UID()];set_on=on'>Off</A> "
return dat
/obj/machinery/mineral/processing_unit/proc/smelt_ore()
GET_COMPONENT(materials, /datum/component/material_container)
var/datum/material/mat = materials.materials[selected_material]
if(mat)
var/sheets_to_remove = (mat.amount >= (MINERAL_MATERIAL_AMOUNT * SMELT_AMOUNT) ) ? SMELT_AMOUNT : round(mat.amount / MINERAL_MATERIAL_AMOUNT)
if(!sheets_to_remove)
on = FALSE
else
var/out = get_step(src, output_dir)
materials.retrieve_sheets(sheets_to_remove, selected_material, out)
/obj/machinery/mineral/processing_unit/proc/smelt_alloy()
var/datum/design/alloy = files.FindDesignByID(selected_alloy) //check if it's a valid design
if(!alloy)
on = FALSE
return
var/amount = can_smelt(alloy)
if(!amount)
on = FALSE
return
GET_COMPONENT(materials, /datum/component/material_container)
materials.use_amount(alloy.materials, amount)
generate_mineral(alloy.build_path)
/obj/machinery/mineral/processing_unit/proc/can_smelt(datum/design/D)
if(D.make_reagents.len)
return FALSE
var/build_amount = SMELT_AMOUNT
GET_COMPONENT(materials, /datum/component/material_container)
for(var/mat_id in D.materials)
var/M = D.materials[mat_id]
var/datum/material/smelter_mat = materials.materials[mat_id]
if(!M || !smelter_mat)
return FALSE
build_amount = min(build_amount, round(smelter_mat.amount / M))
return build_amount
/obj/machinery/mineral/processing_unit/proc/generate_mineral(P)
var/O = new P(src)
unload_mineral(O)
#undef SMELT_AMOUNT
+25 -27
View File
@@ -4,21 +4,21 @@
name = "stacking machine console"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "console"
density = 0
anchored = 1
desc = "Controls a stacking machine... in theory."
density = FALSE
anchored = TRUE
var/obj/machinery/mineral/stacking_machine/machine = null
var/machinedir = SOUTHEAST
/obj/machinery/mineral/stacking_unit_console/New()
..()
spawn(7)
src.machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
if(machine)
machine.CONSOLE = src
else
qdel(src)
machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
if(machine)
machine.CONSOLE = src
else
qdel(src)
/obj/machinery/mineral/stacking_unit_console/attack_hand(user as mob)
/obj/machinery/mineral/stacking_unit_console/attack_hand(mob/user)
var/obj/item/stack/sheet/s
var/dat
@@ -34,24 +34,21 @@
user << browse("[dat]", "window=console_stacking_machine")
return
/obj/machinery/mineral/stacking_unit_console/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
add_fingerprint(usr)
if(href_list["release"])
if(!(text2path(href_list["release"]) in machine.stack_list)) return //someone tried to spawn materials by spoofing hrefs
if(!(text2path(href_list["release"]) in machine.stack_list))
return //someone tried to spawn materials by spoofing hrefs
var/obj/item/stack/sheet/inp = machine.stack_list[text2path(href_list["release"])]
var/obj/item/stack/sheet/out = new inp.type()
out.amount = inp.amount
inp.amount = 0
machine.unload_mineral(out)
src.updateUsrDialog()
return
updateUsrDialog()
/**********************Mineral stacking unit**************************/
@@ -60,8 +57,9 @@
name = "stacking machine"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "stacker"
density = 1
anchored = 1.0
desc = "A machine that automatically stacks acquired materials. Controlled by a nearby console."
density = TRUE
anchored = TRUE
var/obj/machinery/mineral/stacking_unit_console/CONSOLE
var/stk_types = list()
var/stk_amt = list()
@@ -69,7 +67,14 @@
var/stack_amt = 50; //ammount to stack before releassing
input_dir = EAST
output_dir = WEST
speed_process = 1
speed_process = TRUE
/obj/machinery/mineral/stacking_machine/process()
var/turf/T = get_step(src, input_dir)
if(T)
for(var/obj/item/stack/sheet/S in T)
process_sheet(S)
CHECK_TICK
/obj/machinery/mineral/stacking_machine/proc/process_sheet(obj/item/stack/sheet/inp)
if(!(inp.type in stack_list)) //It's the first of this sheet added
@@ -83,11 +88,4 @@
var/obj/item/stack/sheet/out = new inp.type()
out.amount = stack_amt
unload_mineral(out)
storage.amount -= stack_amt
/obj/machinery/mineral/stacking_machine/process()
var/turf/T = get_step(src, input_dir)
if(T)
for(var/obj/item/stack/sheet/S in T)
process_sheet(S)
CHECK_TICK
storage.amount -= stack_amt
+69 -174
View File
@@ -2,208 +2,103 @@
/obj/machinery/mineral/mint
name = "Coin press"
icon = 'icons/obj/stationobjs.dmi'
name = "coin press"
icon = 'icons/obj/economy.dmi'
icon_state = "coinpress0"
density = 1
anchored = 1.0
var/amt_silver = 0 //amount of silver
var/amt_gold = 0 //amount of gold
var/amt_diamond = 0
var/amt_iron = 0
var/amt_plasma = 0
var/amt_uranium = 0
var/amt_clown = 0
var/amt_mime = 0
density = TRUE
anchored = TRUE
var/newCoins = 0 //how many coins the machine made in it's last load
var/processing = 0
var/chosen = "metal" //which material will be used to make coins
var/processing = FALSE
var/chosen = MAT_METAL //which material will be used to make coins
var/coinsToProduce = 10
speed_process = 1
speed_process = TRUE
/obj/machinery/mineral/mint/New()
..()
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_URANIUM, MAT_DIAMOND, MAT_BANANIUM, MAT_TRANQUILLITE), MINERAL_MATERIAL_AMOUNT * 50)
/obj/machinery/mineral/mint/process()
var/turf/T = get_step(src,input_dir)
if(T)
for(var/obj/item/stack/sheet/O in T)
if(istype(O, /obj/item/stack/sheet/mineral/gold))
amt_gold += 100 * O.amount
qdel(O)
if(istype(O, /obj/item/stack/sheet/mineral/silver))
amt_silver += 100 * O.amount
qdel(O)
if(istype(O, /obj/item/stack/sheet/mineral/diamond))
amt_diamond += 100 * O.amount
qdel(O)
if(istype(O, /obj/item/stack/sheet/mineral/plasma))
amt_plasma += 100 * O.amount
qdel(O)
if(istype(O, /obj/item/stack/sheet/mineral/uranium))
amt_uranium += 100 * O.amount
qdel(O)
if(istype(O, /obj/item/stack/sheet/metal))
amt_iron += 100 * O.amount
qdel(O)
if(istype(O, /obj/item/stack/sheet/mineral/bananium))
amt_clown += 100 * O.amount
qdel(O)
if(istype(O, /obj/item/stack/sheet/mineral/tranquillite))
amt_mime += 100 * O.amount
qdel(O)
var/turf/T = get_step(src, input_dir)
if(!T)
return
GET_COMPONENT(materials, /datum/component/material_container)
for(var/obj/item/stack/sheet/O in T)
materials.insert_stack(O, O.amount)
/obj/machinery/mineral/mint/attack_hand(user as mob)
/obj/machinery/mineral/mint/attack_hand(mob/user)
if(..())
return
var/dat = "<b>Coin Press</b><br>"
dat += text("<br><font color='#ffcc00'><b>Gold inserted: </b>[amt_gold]</font> ")
if(chosen == "gold")
dat += text("chosen")
else
dat += text("<A href='?src=[UID()];choose=gold'>Choose</A>")
dat += text("<br><font color='#888888'><b>Silver inserted: </b>[amt_silver]</font> ")
if(chosen == "silver")
dat += text("chosen")
else
dat += text("<A href='?src=[UID()];choose=silver'>Choose</A>")
dat += text("<br><font color='#555555'><b>Iron inserted: </b>[amt_iron]</font> ")
if(chosen == "metal")
dat += text("chosen")
else
dat += text("<A href='?src=[UID()];choose=metal'>Choose</A>")
dat += text("<br><font color='#8888FF'><b>Diamond inserted: </b>[amt_diamond]</font> ")
if(chosen == "diamond")
dat += text("chosen")
else
dat += text("<A href='?src=[UID()];choose=diamond'>Choose</A>")
dat += text("<br><font color='#FF8800'><b>Plasma inserted: </b>[amt_plasma]</font> ")
if(chosen == "plasma")
dat += text("chosen")
else
dat += text("<A href='?src=[UID()];choose=plasma'>Choose</A>")
dat += text("<br><font color='#008800'><b>Uranium inserted: </b>[amt_uranium]</font> ")
if(chosen == "uranium")
dat += text("chosen")
else
dat += text("<A href='?src=[UID()];choose=uranium'>Choose</A>")
if(amt_clown > 0)
dat += text("<br><font color='#AAAA00'><b>Bananium inserted: </b>[amt_clown]</font> ")
if(chosen == "clown")
dat += text("chosen")
GET_COMPONENT(materials, /datum/component/material_container)
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
if(!M.amount && chosen != mat_id)
continue
dat += "<br><b>[M.name] amount:</b> [M.amount] cm<sup>3</sup> "
if(chosen == mat_id)
dat += "<b>Chosen</b>"
else
dat += text("<A href='?src=[UID()];choose=clown'>Choose</A>")
if(amt_mime > 0)
dat += text("<br><font color='#666666'><b>Tranquillite inserted: </b>[amt_mime]</font> ")
if(chosen == "mime")
dat += text("chosen")
else
dat += text("<A href='?src=[UID()];choose=mime'>Choose</A>")
dat += "<A href='?src=[UID()];choose=[mat_id]'>Choose</A>"
dat += text("<br><br>Will produce [coinsToProduce] [chosen] coins if enough materials are available.<br>")
//dat += text("The dial which controls the number of conins to produce seems to be stuck. A technician has already been dispatched to fix this.")
dat += text("<A href='?src=[UID()];chooseAmt=-10'>-10</A> ")
dat += text("<A href='?src=[UID()];chooseAmt=-5'>-5</A> ")
dat += text("<A href='?src=[UID()];chooseAmt=-1'>-1</A> ")
dat += text("<A href='?src=[UID()];chooseAmt=1'>+1</A> ")
dat += text("<A href='?src=[UID()];chooseAmt=5'>+5</A> ")
dat += text("<A href='?src=[UID()];chooseAmt=10'>+10</A> ")
var/datum/material/M = materials.materials[chosen]
dat += text("<br><br>In total this machine produced <font color='green'><b>[newCoins]</b></font> coins.")
dat += text("<br><A href='?src=[UID()];makeCoins=[1]'>Make coins</A>")
user << browse("[dat]", "window=mint")
dat += "<br><br>Will produce [coinsToProduce] [lowertext(M.name)] coins if enough materials are available.<br>"
dat += "<A href='?src=[UID()];chooseAmt=-10'>-10</A> "
dat += "<A href='?src=[UID()];chooseAmt=-5'>-5</A> "
dat += "<A href='?src=[UID()];chooseAmt=-1'>-1</A> "
dat += "<A href='?src=[UID()];chooseAmt=1'>+1</A> "
dat += "<A href='?src=[UID()];chooseAmt=5'>+5</A> "
dat += "<A href='?src=[UID()];chooseAmt=10'>+10</A> "
dat += "<br><br>In total this machine produced <font color='green'><b>[newCoins]</b></font> coins."
dat += "<br><A href='?src=[UID()];makeCoins=[1]'>Make coins</A>"
user << browse(dat, "window=mint")
/obj/machinery/mineral/mint/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if(processing==1)
add_fingerprint(usr)
if(processing == 1)
to_chat(usr, "<span class='notice'>The machine is processing.</span>")
return
GET_COMPONENT(materials, /datum/component/material_container)
if(href_list["choose"])
chosen = href_list["choose"]
if(materials.materials[href_list["choose"]])
chosen = href_list["choose"]
if(href_list["chooseAmt"])
coinsToProduce = Clamp(coinsToProduce + text2num(href_list["chooseAmt"]), 0, 1000)
if(href_list["makeCoins"])
var/temp_coins = coinsToProduce
processing = 1;
processing = TRUE
icon_state = "coinpress1"
switch(chosen)
if("metal")
while(amt_iron > 0 && coinsToProduce > 0)
create_coins(/obj/item/coin/iron)
amt_iron -= 20
coinsToProduce--
newCoins++
src.updateUsrDialog()
sleep(5)
if("gold")
while(amt_gold > 0 && coinsToProduce > 0)
create_coins(/obj/item/coin/gold)
amt_gold -= 20
coinsToProduce--
newCoins++
src.updateUsrDialog()
sleep(5)
if("silver")
while(amt_silver > 0 && coinsToProduce > 0)
create_coins(/obj/item/coin/silver)
amt_silver -= 20
coinsToProduce--
newCoins++
src.updateUsrDialog()
sleep(5)
if("diamond")
while(amt_diamond > 0 && coinsToProduce > 0)
create_coins(/obj/item/coin/diamond)
amt_diamond -= 20
coinsToProduce--
newCoins++
src.updateUsrDialog()
sleep(5)
if("plasma")
while(amt_plasma > 0 && coinsToProduce > 0)
create_coins(/obj/item/coin/plasma)
amt_plasma -= 20
coinsToProduce--
newCoins++
src.updateUsrDialog()
sleep(5)
if("uranium")
while(amt_uranium > 0 && coinsToProduce > 0)
create_coins(/obj/item/coin/uranium)
amt_uranium -= 20
coinsToProduce--
newCoins++
src.updateUsrDialog()
sleep(5)
if("clown")
while(amt_clown > 0 && coinsToProduce > 0)
create_coins(/obj/item/coin/clown)
amt_clown -= 20
coinsToProduce--
newCoins++
src.updateUsrDialog()
sleep(5)
if("mime")
while(amt_mime > 0 && coinsToProduce > 0)
create_coins(/obj/item/coin/mime)
amt_mime -= 20
coinsToProduce--
newCoins++
src.updateUsrDialog()
sleep(5)
icon_state = "coinpress0"
processing = 0
coinsToProduce = temp_coins
src.updateUsrDialog()
return
var/coin_mat = MINERAL_MATERIAL_AMOUNT * 0.2
var/datum/material/M = materials.materials[chosen]
if(!M || !M.coin_type)
updateUsrDialog()
return
/obj/machinery/mineral/mint/proc/create_coins(var/P)
while(coinsToProduce > 0 && materials.use_amount_type(coin_mat, chosen))
create_coins(M.coin_type)
coinsToProduce--
newCoins++
updateUsrDialog()
sleep(5)
icon_state = "coinpress0"
processing = FALSE
coinsToProduce = temp_coins
updateUsrDialog()
/obj/machinery/mineral/mint/proc/create_coins(P)
var/turf/T = get_step(src,output_dir)
if(T)
var/obj/item/O = new P(src)
var/obj/item/moneybag/M = locate(/obj/item/moneybag/, T)
var/obj/item/storage/bag/money/M = locate(/obj/item/storage/bag/money, T)
if(!M)
M = new /obj/item/moneybag(src)
M = new /obj/item/storage/bag/money(src)
unload_mineral(M)
O.loc = M
O.forceMove(M)
+10 -107
View File
@@ -1,117 +1,20 @@
/*****************************Money bag********************************/
/obj/item/moneybag
icon = 'icons/obj/storage.dmi'
name = "Money bag"
/obj/item/storage/bag/money
name = "money bag"
icon_state = "moneybag"
flags = CONDUCT
force = 10.0
force = 10
throwforce = 0
burn_state = FLAMMABLE
burntime = 20
max_integrity = 100
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_NORMAL
storage_slots = 40
max_combined_w_class = 40
can_hold = list(/obj/item/coin, /obj/item/stack/spacecash)
/obj/item/moneybag/attack_hand(user as mob)
var/amt_gold = 0
var/amt_silver = 0
var/amt_diamond = 0
var/amt_iron = 0
var/amt_plasma = 0
var/amt_uranium = 0
var/amt_clown = 0
var/amt_mime = 0
var/amt_adamantine = 0
for(var/obj/item/coin/C in contents)
if(istype(C,/obj/item/coin/diamond))
amt_diamond++
if(istype(C,/obj/item/coin/plasma))
amt_plasma++
if(istype(C,/obj/item/coin/iron))
amt_iron++
if(istype(C,/obj/item/coin/silver))
amt_silver++
if(istype(C,/obj/item/coin/gold))
amt_gold++
if(istype(C,/obj/item/coin/uranium))
amt_uranium++
if(istype(C,/obj/item/coin/clown))
amt_clown++
if(istype(C,/obj/item/coin/mime))
amt_mime++
if(istype(C,/obj/item/coin/adamantine))
amt_adamantine++
var/dat = text("<b>The contents of the moneybag reveal...</b><br>")
if(amt_gold)
dat += text("Gold coins: [amt_gold] <A href='?src=[UID()];remove=gold'>Remove one</A><br>")
if(amt_silver)
dat += text("Silver coins: [amt_silver] <A href='?src=[UID()];remove=silver'>Remove one</A><br>")
if(amt_iron)
dat += text("Metal coins: [amt_iron] <A href='?src=[UID()];remove=iron'>Remove one</A><br>")
if(amt_diamond)
dat += text("Diamond coins: [amt_diamond] <A href='?src=[UID()];remove=diamond'>Remove one</A><br>")
if(amt_plasma)
dat += text("Plasma coins: [amt_plasma] <A href='?src=[UID()];remove=plasma'>Remove one</A><br>")
if(amt_uranium)
dat += text("Uranium coins: [amt_uranium] <A href='?src=[UID()];remove=uranium'>Remove one</A><br>")
if(amt_clown)
dat += text("Bananium coins: [amt_clown] <A href='?src=[UID()];remove=clown'>Remove one</A><br>")
if(amt_mime)
dat += text("Tranquillite coins: [amt_mime] <A href='?src=[UID()];remove=mime'>Remove one</A><br>")
if(amt_adamantine)
dat += text("Adamantine coins: [amt_adamantine] <A href='?src=[UID()];remove=adamantine'>Remove one</A><br>")
user << browse("[dat]", "window=moneybag")
/obj/item/moneybag/attackby(obj/item/W as obj, mob/user as mob, params)
..()
if(istype(W, /obj/item/coin))
var/obj/item/coin/C = W
if(!user.drop_item())
return
to_chat(user, "<span class='notice'>You add the [C.name] into the bag.</span>")
contents += C
if(istype(W, /obj/item/moneybag))
var/obj/item/moneybag/C = W
for(var/obj/O in C.contents)
contents += O;
to_chat(user, "<span class='notice'>You empty the [C.name] into the bag.</span>")
return
/obj/item/moneybag/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["remove"])
var/obj/item/coin/COIN
switch(href_list["remove"])
if("gold")
COIN = locate(/obj/item/coin/gold,src.contents)
if("silver")
COIN = locate(/obj/item/coin/silver,src.contents)
if("iron")
COIN = locate(/obj/item/coin/iron,src.contents)
if("diamond")
COIN = locate(/obj/item/coin/diamond,src.contents)
if("plasma")
COIN = locate(/obj/item/coin/plasma,src.contents)
if("uranium")
COIN = locate(/obj/item/coin/uranium,src.contents)
if("clown")
COIN = locate(/obj/item/coin/clown,src.contents)
if("mime")
COIN = locate(/obj/item/coin/mime,src.contents)
if("adamantine")
COIN = locate(/obj/item/coin/adamantine,src.contents)
if(!COIN)
return
COIN.loc = src.loc
return
/obj/item/moneybag/vault
/obj/item/moneybag/vault/New()
/obj/item/storage/bag/money/vault/New()
..()
new /obj/item/coin/silver(src)
new /obj/item/coin/silver(src)
@@ -119,4 +22,4 @@
new /obj/item/coin/silver(src)
new /obj/item/coin/gold(src)
new /obj/item/coin/gold(src)
new /obj/item/coin/adamantine(src)
new /obj/item/coin/adamantine(src)
@@ -1,6 +1,7 @@
/obj/item/gun/magic/staff
slot_flags = SLOT_BACK
ammo_type = /obj/item/ammo_casing/magic
flags_2 = NO_MAT_REDEMPTION_2
/obj/item/gun/magic/staff/change
name = "staff of change"
@@ -20,18 +20,6 @@
M.adjustToxLoss(1.5)
..()
/datum/reagent/plasticide
name = "Plasticide"
id = "plasticide"
description = "Liquid plastic, do not eat."
reagent_state = LIQUID
color = "#CF3600" // rgb: 207, 54, 0
/datum/reagent/plasticide/on_mob_life(mob/living/M)
M.adjustToxLoss(1.5)
..()
/datum/reagent/minttoxin
name = "Mint Toxin"
id = "minttoxin"
@@ -93,17 +93,18 @@
result_amount = 2
mix_message = "The mixture gives off a sharp acidic tang."
/datum/chemical_reaction/plastication
name = "Plastic"
id = "solidplastic"
/datum/chemical_reaction/plastic_polymers
name = "plastic polymers"
id = "plastic_polymers"
result = null
required_reagents = list("facid" = 10, "plasticide" = 20)
required_reagents = list("oil" = 5, "sacid" = 2, "ash" = 3)
min_temp = 374
result_amount = 1
/datum/chemical_reaction/plastication/on_reaction(datum/reagents/holder)
var/obj/item/stack/sheet/metal/M = new /obj/item/stack/sheet/plastic
M.amount = 10
M.forceMove(get_turf(holder.my_atom))
var/obj/item/stack/sheet/plastic/P = new /obj/item/stack/sheet/plastic
P.amount = 10
P.forceMove(get_turf(holder.my_atom))
/datum/chemical_reaction/lube
name = "Space Lube"
+18 -68
View File
@@ -10,10 +10,6 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
icon_state = "circuit_imprinter"
flags = OPENCONTAINER
var/g_amount = 0
var/gold_amount = 0
var/diamond_amount = 0
var/max_material_amount = 75000.0
var/efficiency_coeff
var/list/categories = list(
@@ -55,13 +51,16 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
reagents.my_atom = src
/obj/machinery/r_n_d/circuit_imprinter/RefreshParts()
var/T = 0
reagents.maximum_volume = 0
for(var/obj/item/reagent_containers/glass/G in component_parts)
reagents.maximum_volume += G.volume
G.reagents.trans_to(src, G.reagents.total_volume)
materials.max_amount = 0
for(var/obj/item/stock_parts/matter_bin/M in component_parts)
T += M.rating
max_material_amount = T * 75000.0
T = 0
materials.max_amount += M.rating * 75000
var/T = 0
for(var/obj/item/stock_parts/manipulator/M in component_parts)
T += M.rating
efficiency_coeff = 2 ** (T - 1) //Only 1 manipulator here, you're making runtimes Razharas
@@ -72,23 +71,18 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
/obj/machinery/r_n_d/circuit_imprinter/proc/check_mat(datum/design/being_built, var/M)
switch(M)
if(MAT_GLASS)
return (g_amount - (being_built.materials[M]/efficiency_coeff) >= 0)
if(MAT_GOLD)
return (gold_amount - (being_built.materials[M]/efficiency_coeff) >= 0)
if(MAT_DIAMOND)
return (diamond_amount - (being_built.materials[M]/efficiency_coeff) >= 0)
else
return (reagents.has_reagent(M, (being_built.materials[M]/efficiency_coeff)) != 0)
var/list/all_materials = being_built.reagents_list + being_built.materials
var/A = materials.amount(M)
if(!A)
A = reagents.get_reagent_amount(M)
/obj/machinery/r_n_d/circuit_imprinter/proc/TotalMaterials()
return g_amount + gold_amount + diamond_amount
return round(A / max(1, (all_materials[M]/efficiency_coeff)))
/obj/machinery/r_n_d/circuit_imprinter/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
if(shocked)
shock(user,50)
if(shock(user,50))
return TRUE
if(default_deconstruction_screwdriver(user, "circuit_imprinter_t", "circuit_imprinter", O))
if(linked_console)
linked_console.linked_imprinter = null
@@ -104,57 +98,13 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
if(istype(I, /obj/item/reagent_containers/glass/beaker))
reagents.trans_to(I, reagents.total_volume)
I.loc = src.loc
for(var/obj/item/reagent_containers/glass/G in component_parts)
reagents.trans_to(G, G.reagents.maximum_volume)
if(g_amount >= MINERAL_MATERIAL_AMOUNT)
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc)
G.amount = round(g_amount / MINERAL_MATERIAL_AMOUNT)
if(gold_amount >= MINERAL_MATERIAL_AMOUNT)
var/obj/item/stack/sheet/mineral/gold/G = new /obj/item/stack/sheet/mineral/gold(src.loc)
G.amount = round(gold_amount / MINERAL_MATERIAL_AMOUNT)
if(diamond_amount >= MINERAL_MATERIAL_AMOUNT)
var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond(src.loc)
G.amount = round(diamond_amount / MINERAL_MATERIAL_AMOUNT)
materials.retrieve_all()
default_deconstruction_crowbar(O)
return
else
to_chat(user, "<span class='warning'>You can't load the [src.name] while it's opened.</span>")
return
if(disabled)
return
if(!linked_console)
to_chat(user, "<span class='warning'>The [name] must be linked to an R&D console first!</span>")
return 1
if(O.is_open_container())
return
if(!istype(O, /obj/item/stack/sheet/glass) && !istype(O, /obj/item/stack/sheet/mineral/gold) && !istype(O, /obj/item/stack/sheet/mineral/diamond))
to_chat(user, "<span class='warning'>You cannot insert this item into the [name]!</span>")
return
if(stat)
return
if(busy)
to_chat(user, "<span class='warning'>The [name] is busy. Please wait for completion of previous operation.</span>")
return
var/obj/item/stack/sheet/stack = O
if((TotalMaterials() + stack.perunit) > max_material_amount)
to_chat(user, "<span class='warning'>The [name] is full. Please remove glass from the protolathe in order to insert more.</span>")
return
var/amount = round(input("How many sheets do you want to add?") as num)
if(amount <= 0 || stack.amount <= 0)
return
if(amount > stack.amount)
amount = min(stack.amount, round((max_material_amount-TotalMaterials())/stack.perunit))
busy = 1
use_power(max(1000, (MINERAL_MATERIAL_AMOUNT*amount/10)))
to_chat(user, "<span class='notice'>You add [amount] sheets to the [src.name].</span>")
if(istype(stack, /obj/item/stack/sheet/glass))
g_amount += amount * MINERAL_MATERIAL_AMOUNT
else if(istype(stack, /obj/item/stack/sheet/mineral/gold))
gold_amount += amount * MINERAL_MATERIAL_AMOUNT
else if(istype(stack, /obj/item/stack/sheet/mineral/diamond))
diamond_amount += amount * MINERAL_MATERIAL_AMOUNT
stack.use(amount)
busy = 0
src.updateUsrDialog()
return FALSE
else
return ..()
+1 -1
View File
@@ -42,6 +42,6 @@ other types of metals and chemistry for reagents).
var/locked = 0 //If true it will spawn inside a lockbox with currently sec access
var/access_requirement = list(access_armory) //What special access requirements will the lockbox have? Defaults to armory.
var/category = null //Primarily used for Mech Fabricators, but can be used for anything
var/list/reagents = list() //List of reagents. Format: "id" = amount.
var/list/reagents_list = list() //List of reagents. Format: "id" = amount.
var/maxstack = 1
var/lathe_time_factor = 1 //How many times faster than normal is this to build on the protolathe
@@ -8,7 +8,7 @@
id = "freeform_module"
req_tech = list("programming" = 5, "materials" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20, MAT_GOLD = 100)
materials = list(MAT_GLASS = 1000, MAT_GOLD = 100)
build_path = /obj/item/aiModule/freeform
category = list("AI Modules")
@@ -18,7 +18,7 @@
id = "onecrewmember_module"
req_tech = list("programming" = 6, "materials" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20, MAT_DIAMOND = 100)
materials = list(MAT_GLASS = 1000, MAT_DIAMOND = 100)
build_path = /obj/item/aiModule/oneCrewMember
category = list("AI Modules")
@@ -28,7 +28,7 @@
id = "oxygen_module"
req_tech = list("programming" = 4, "biotech" = 2, "materials" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20, MAT_GOLD = 100)
materials = list(MAT_GLASS = 1000, MAT_GOLD = 100)
build_path = /obj/item/aiModule/oxygen
category = list("AI Modules")
@@ -38,7 +38,7 @@
id = "protectstation_module"
req_tech = list("programming" = 5, "materials" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20, MAT_GOLD = 100)
materials = list(MAT_GLASS = 1000, MAT_GOLD = 100)
build_path = /obj/item/aiModule/protectStation
category = list("AI Modules")
@@ -48,7 +48,7 @@
id = "purge_module"
req_tech = list("programming" = 5, "materials" = 6)
build_type = IMPRINTER
materials = list(MAT_GLASS = 2000, "sacid" = 20, MAT_DIAMOND = 100)
materials = list(MAT_GLASS = 1000, MAT_DIAMOND = 100)
build_path = /obj/item/aiModule/purge
category = list("AI Modules")
@@ -58,7 +58,7 @@
id = "quarantine_module"
req_tech = list("programming" = 3, "biotech" = 2, "materials" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20, MAT_GOLD = 100)
materials = list(MAT_GLASS = 1000, MAT_GOLD = 100)
build_path = /obj/item/aiModule/quarantine
category = list("AI Modules")
@@ -68,7 +68,7 @@
id = "reset_module"
req_tech = list("programming" = 4, "materials" = 6)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20, MAT_GOLD = 100)
materials = list(MAT_GLASS = 1000, MAT_GOLD = 100)
build_path = /obj/item/aiModule/reset
category = list("AI Modules")
@@ -78,7 +78,7 @@
id = "safeguard_module"
req_tech = list("programming" = 3, "materials" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20, MAT_GOLD = 100)
materials = list(MAT_GLASS = 1000, MAT_GOLD = 100)
build_path = /obj/item/aiModule/safeguard
category = list("AI Modules")
@@ -88,7 +88,7 @@
id = "antimov_module"
req_tech = list("programming" = 5, "syndicate" = 2, "materials" = 5)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20, MAT_DIAMOND = 100)
materials = list(MAT_GLASS = 1000, MAT_DIAMOND = 100)
build_path = /obj/item/aiModule/antimov
category = list("AI Modules")
@@ -98,7 +98,7 @@
id = "asimov_module"
req_tech = list("programming" = 3, "materials" = 5)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20, MAT_DIAMOND = 100)
materials = list(MAT_GLASS = 1000, MAT_DIAMOND = 100)
build_path = /obj/item/aiModule/asimov
category = list("AI Modules")
@@ -108,7 +108,7 @@
id = "corporate_module"
req_tech = list("programming" = 5, "materials" = 5)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20, MAT_DIAMOND = 100)
materials = list(MAT_GLASS = 1000, MAT_DIAMOND = 100)
build_path = /obj/item/aiModule/corp
category = list("AI Modules")
@@ -118,7 +118,7 @@
id = "crewsimov_module"
req_tech = list("programming" = 3, "materials" = 5)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20, MAT_DIAMOND = 100)
materials = list(MAT_GLASS = 1000, MAT_DIAMOND = 100)
build_path = /obj/item/aiModule/crewsimov
category = list("AI Modules")
@@ -128,7 +128,7 @@
id = "freeformcore_module"
req_tech = list("programming" = 6, "materials" = 6)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20, MAT_DIAMOND = 100)
materials = list(MAT_GLASS = 1000, MAT_DIAMOND = 100)
build_path = /obj/item/aiModule/freeformcore
category = list("AI Modules")
@@ -138,7 +138,7 @@
id = "paladin_module"
req_tech = list("programming" = 5, "materials" = 5)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20, MAT_DIAMOND = 100)
materials = list(MAT_GLASS = 1000, MAT_DIAMOND = 100)
build_path = /obj/item/aiModule/paladin
category = list("AI Modules")
@@ -148,6 +148,6 @@
id = "tyrant_module"
req_tech = list("programming" = 5, "syndicate" = 2, "materials" = 5)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20, MAT_DIAMOND = 100)
materials = list(MAT_GLASS = 1000, MAT_DIAMOND = 100)
build_path = /obj/item/aiModule/tyrant
category = list("AI Modules")
@@ -224,7 +224,7 @@
/datum/design/rglass
name = "Reinforced Glass"
id = "rglass"
build_type = AUTOLATHE
build_type = AUTOLATHE | SMELTER
materials = list(MAT_METAL = 1000, MAT_GLASS = MINERAL_MATERIAL_AMOUNT)
build_path = /obj/item/stack/sheet/rglass
category = list("initial","Construction")
@@ -17,7 +17,7 @@
id = "bag_holding"
req_tech = list("bluespace" = 7, "materials" = 5, "engineering" = 5, "plasmatech" = 6)
build_type = PROTOLATHE
materials = list(MAT_GOLD = 3000, MAT_DIAMOND = 1500, MAT_URANIUM = 250)
materials = list(MAT_GOLD = 3000, MAT_DIAMOND = 1500, MAT_URANIUM = 250, MAT_BLUESPACE = 2000)
build_path = /obj/item/storage/backpack/holding
category = list("Bluespace")
@@ -8,7 +8,7 @@
id = "aicore"
req_tech = list("programming" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/aicore
category = list("Computer Boards")
@@ -18,7 +18,7 @@
id = "aifixer"
req_tech = list("programming" = 4, "magnets" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/aifixer
category = list("Computer Boards")
@@ -28,7 +28,7 @@
id = "aiupload"
req_tech = list("programming" = 5, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/aiupload
category = list("Computer Boards")
@@ -38,7 +38,7 @@
id = "atmosalerts"
req_tech = list("programming" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/atmos_alert
category = list("Computer Boards")
@@ -48,7 +48,7 @@
id = "air_management"
req_tech = list("programming" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/air_management
category = list("Computer Boards")
@@ -58,7 +58,7 @@
id = "seccamera"
req_tech = list("programming" = 2, "combat" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/camera
category = list("Computer Boards")
@@ -68,7 +68,7 @@
id = "clonecontrol"
req_tech = list("programming" = 4, "biotech" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/cloning
category = list("Computer Boards")
@@ -78,7 +78,7 @@
id = "comconsole"
req_tech = list("programming" = 3, "magnets" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/communications
category = list("Computer Boards")
@@ -88,7 +88,7 @@
id = "crewconsole"
req_tech = list("programming" = 3, "magnets" = 2, "biotech" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/crew
category = list("Computer Boards")
@@ -98,7 +98,7 @@
id = "borgupload"
req_tech = list("programming" = 5, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/borgupload
category = list("Computer Boards")
@@ -108,7 +108,7 @@
id = "scan_console"
req_tech = list("programming" = 2, "biotech" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/scan_consolenew
category = list("Computer Boards")
@@ -118,7 +118,7 @@
id = "dronecontrol"
req_tech = list("programming" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/drone_control
category = list("Computer Boards")
@@ -128,7 +128,7 @@
id = "mechacontrol"
req_tech = list("programming" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mecha_control
category = list("Computer Boards")
@@ -138,7 +138,7 @@
id = "idcardconsole"
req_tech = list("programming" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/card
category = list("Computer Boards")
@@ -148,7 +148,7 @@
id = "mechapower"
req_tech = list("programming" = 3, "powerstorage" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mech_bay_power_console
category = list("Computer Boards")
@@ -158,7 +158,7 @@
id = "med_data"
req_tech = list("programming" = 2, "biotech" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/med_data
category = list("Computer Boards")
@@ -168,7 +168,7 @@
id = "message_monitor"
req_tech = list("programming" = 5)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/message_monitor
category = list("Computer Boards")
@@ -178,7 +178,7 @@
id = "operating"
req_tech = list("programming" = 2, "biotech" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/operating
category = list("Computer Boards")
@@ -188,7 +188,7 @@
id = "pandemic"
req_tech = list("programming" = 3, "biotech" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/pandemic
category = list("Computer Boards")
@@ -198,7 +198,7 @@
id = "powermonitor"
req_tech = list("programming" = 2, "powerstorage" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/powermonitor
category = list("Computer Boards")
@@ -208,7 +208,7 @@
id = "prisonmanage"
req_tech = list("programming" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/prisoner
category = list("Computer Boards")
@@ -218,7 +218,7 @@
id = "rdconsole"
req_tech = list("programming" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/rdconsole
category = list("Computer Boards")
@@ -228,7 +228,7 @@
id = "rdservercontrol"
req_tech = list("programming" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/rdservercontrol
category = list("Computer Boards")
@@ -238,7 +238,7 @@
id = "robocontrol"
req_tech = list("programming" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/robotics
category = list("Computer Boards")
@@ -248,7 +248,7 @@
id = "secdata"
req_tech = list("programming" = 2, "combat" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/secure_data
category = list("Computer Boards")
@@ -258,7 +258,7 @@
id = "solarcontrol"
req_tech = list("programming" = 2, "powerstorage" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/solar_control
category = list("Computer Boards")
@@ -268,7 +268,7 @@
id = "spacepodc"
req_tech = list("programming" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/pod_locater
category = list("Computer Boards")
@@ -278,7 +278,7 @@
id = "ordercomp"
req_tech = list("programming" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/ordercomp
category = list("Computer Boards")
@@ -288,7 +288,7 @@
id = "supplycomp"
req_tech = list("programming" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/supplycomp
category = list("Computer Boards")
@@ -298,7 +298,7 @@
id = "comm_monitor"
req_tech = list("programming" = 3, "magnets" = 3, "bluespace" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/comm_monitor
category = list("Computer Boards")
@@ -308,7 +308,7 @@
id = "comm_server"
req_tech = list("programming" = 3, "magnets" = 3, "bluespace" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/comm_server
category = list("Computer Boards")
@@ -318,7 +318,7 @@
id = "comm_traffic"
req_tech = list("programming" = 3, "magnets" = 3, "bluespace" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/comm_traffic
category = list("Computer Boards")
@@ -328,7 +328,7 @@
id = "telesci_console"
req_tech = list("programming" = 3, "bluespace" = 3, "plasmatech" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/telesci_console
category = list("Computer Boards")
@@ -338,7 +338,7 @@
id = "teleconsole"
req_tech = list("programming" = 3, "bluespace" = 3, "plasmatech" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/teleporter
category = list("Computer Boards")
@@ -348,7 +348,7 @@
id = "GAC"
req_tech = list("programming" = 3, "magnets" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/air_management
category = list("Computer Boards")
@@ -358,7 +358,7 @@
id = "tankcontrol"
req_tech = list("programming" = 3, "magnets" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/large_tank_control
category = list("Computer Boards")
@@ -368,7 +368,7 @@
id = "AAC"
req_tech = list("programming" = 4, "magnets" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/atmos_automation
category = list("Computer Boards")
@@ -378,6 +378,6 @@
id = "xenobioconsole"
req_tech = list("programming" = 3, "biotech" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/xenobiology
category = list("Computer Boards")
@@ -63,7 +63,7 @@
id = "netcard_basic"
req_tech = list("programming" = 2, "engineering" = 1)
build_type = IMPRINTER
materials = list(MAT_METAL = 250, MAT_GLASS = 100, "sacid" = 20)
materials = list(MAT_METAL = 250, MAT_GLASS = 100)
build_path = /obj/item/computer_hardware/network_card
category = list("Computer Parts")
@@ -72,7 +72,7 @@
id = "netcard_advanced"
req_tech = list("programming" = 4, "engineering" = 2)
build_type = IMPRINTER
materials = list(MAT_METAL = 500, MAT_GLASS = 200, "sacid" = 20)
materials = list(MAT_METAL = 500, MAT_GLASS = 200)
build_path = /obj/item/computer_hardware/network_card/advanced
category = list("Computer Parts")
@@ -81,7 +81,7 @@
id = "netcard_wired"
req_tech = list("programming" = 5, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_METAL = 2500, MAT_GLASS = 400, "sacid" = 20)
materials = list(MAT_METAL = 2500, MAT_GLASS = 400)
build_path = /obj/item/computer_hardware/network_card/wired
category = list("Computer Parts")
@@ -92,7 +92,7 @@
id = "portadrive_basic"
req_tech = list("programming" = 1)
build_type = IMPRINTER
materials = list(MAT_GLASS = 800, "sacid" = 20)
materials = list(MAT_GLASS = 800)
build_path = /obj/item/computer_hardware/hard_drive/portable
category = list("Computer Parts")
@@ -101,7 +101,7 @@
id = "portadrive_advanced"
req_tech = list("programming" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1600, "sacid" = 20)
materials = list(MAT_GLASS = 1600)
build_path = /obj/item/computer_hardware/hard_drive/portable/advanced
category = list("Computer Parts")
@@ -110,7 +110,7 @@
id = "portadrive_super"
req_tech = list("programming" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 3200, "sacid" = 20)
materials = list(MAT_GLASS = 3200)
build_path = /obj/item/computer_hardware/hard_drive/portable/super
category = list("Computer Parts")
@@ -219,7 +219,7 @@
id = "cpu_normal"
req_tech = list("programming" = 3, "engineering" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1600, "sacid" = 20)
materials = list(MAT_GLASS = 1600)
build_path = /obj/item/computer_hardware/processor_unit
category = list("Computer Parts")
@@ -228,7 +228,7 @@
id = "cpu_small"
req_tech = list("programming" = 2, "engineering" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 800, "sacid" = 20)
materials = list(MAT_GLASS = 800)
build_path = /obj/item/computer_hardware/processor_unit/small
category = list("Computer Parts")
@@ -237,7 +237,7 @@
id = "pcpu_normal"
req_tech = list("programming" = 5, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS= 6400, MAT_GOLD = 2000, "sacid" = 40)
materials = list(MAT_GLASS= 6400, MAT_GOLD = 2000)
build_path = /obj/item/computer_hardware/processor_unit/photonic
category = list("Computer Parts")
@@ -246,6 +246,6 @@
id = "pcpu_small"
req_tech = list("programming" = 4, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 3200, MAT_GOLD = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 3200, MAT_GOLD = 1000)
build_path = /obj/item/computer_hardware/processor_unit/photonic/small
category = list("Computer Parts")
@@ -8,7 +8,7 @@
id = "thermomachine"
req_tech = list("programming" = 3, "plasmatech" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/thermomachine
category = list ("Engineering Machinery")
@@ -18,7 +18,7 @@
id = "smes"
req_tech = list("programming" = 4, "powerstorage" = 5, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/smes
category = list ("Engineering Machinery")
@@ -28,7 +28,7 @@
id = "emitter"
req_tech = list("programming" = 3, "powerstorage" = 5, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/emitter
category = list ("Engineering Machinery")
@@ -38,7 +38,7 @@
id = "power_turbine_console"
req_tech = list("programming" = 4, "powerstorage" = 5, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/turbine_computer
category = list ("Engineering Machinery")
@@ -48,7 +48,7 @@
id = "power_compressor"
req_tech = list("programming" = 4, "powerstorage" = 5, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/power_compressor
category = list ("Engineering Machinery")
@@ -58,7 +58,7 @@
id = "power_turbine"
req_tech = list("programming" = 4, "powerstorage" = 4, "engineering" = 5)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/power_turbine
category = list ("Engineering Machinery")
@@ -68,7 +68,7 @@
id = "quantumpad"
req_tech = list("programming" = 4, "bluespace" = 4, "plasmatech" = 3, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/quantumpad
category = list ("Teleportation Machinery")
@@ -78,7 +78,7 @@
id = "telepad"
req_tech = list("programming" = 4, "bluespace" = 5, "plasmatech" = 4, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/telesci_pad
category = list ("Teleportation Machinery")
@@ -88,7 +88,7 @@
id = "tele_hub"
req_tech = list("programming" = 3, "bluespace" = 5, "materials" = 4, "engineering" = 5)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/teleporter_hub
category = list ("Teleportation Machinery")
@@ -98,7 +98,7 @@
id = "tele_station"
req_tech = list("programming" = 5, "bluespace" = 4, "engineering" = 4, "plasmatech" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/teleporter_station
category = list ("Teleportation Machinery")
@@ -108,7 +108,7 @@
id = "tele_perma"
req_tech = list("programming" = 3, "bluespace" = 5, "materials" = 4, "engineering" = 5)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/teleporter_perma
category = list ("Teleportation Machinery")
@@ -118,7 +118,7 @@
id = "bodyscanner"
req_tech = list("programming" = 3, "biotech" = 2, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/bodyscanner
category = list("Medical Machinery")
@@ -128,7 +128,7 @@
id = "bodyscanner_console"
req_tech = list("programming" = 3, "biotech" = 2, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/bodyscanner_console
category = list("Medical Machinery")
@@ -138,7 +138,7 @@
id = "clonepod"
req_tech = list("programming" = 4, "biotech" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/clonepod
category = list("Medical Machinery")
@@ -148,7 +148,7 @@
id = "clonescanner"
req_tech = list("programming" = 4, "biotech" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/clonescanner
category = list("Medical Machinery")
@@ -158,7 +158,7 @@
id = "cryotube"
req_tech = list("programming" = 5, "biotech" = 3, "engineering" = 4, "plasmatech" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/cryo_tube
category = list("Medical Machinery")
@@ -168,7 +168,7 @@
id = "chem_dispenser"
req_tech = list("programming" = 5, "biotech" = 3, "materials" = 4, "plasmatech" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/chem_dispenser
category = list("Medical Machinery")
@@ -178,7 +178,7 @@
id = "chem_master"
req_tech = list("biotech" = 3, "materials" = 3, "programming" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/chem_master
category = list("Medical Machinery")
@@ -188,7 +188,7 @@
id = "chem_heater"
req_tech = list("engineering" = 2, "biotech" = 2, "programming" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/chem_heater
category = list ("Medical Machinery")
@@ -198,7 +198,7 @@
id = "sleeper"
req_tech = list("programming" = 3, "biotech" = 2, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/sleeper
category = list("Medical Machinery")
@@ -208,7 +208,7 @@
id = "biogenerator"
req_tech = list("programming" = 2, "biotech" = 3, "materials" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/biogenerator
category = list ("Hydroponics Machinery")
@@ -218,7 +218,7 @@
id = "hydro_tray"
req_tech = list("biotech" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/hydroponics
category = list ("Hydroponics Machinery")
@@ -228,7 +228,7 @@
id = "autolathe"
req_tech = list("programming" = 3, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/autolathe
category = list("Research Machinery")
@@ -238,7 +238,7 @@
id = "circuit_imprinter"
req_tech = list("programming" = 2, "engineering" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/circuit_imprinter
category = list("Research Machinery")
@@ -248,7 +248,7 @@
id = "cyborgrecharger"
req_tech = list("powerstorage" = 3, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/cyborgrecharger
category = list("Research Machinery")
@@ -258,7 +258,7 @@
id = "destructive_analyzer"
req_tech = list("programming" = 2, "magnets" = 2, "engineering" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/destructive_analyzer
category = list("Research Machinery")
@@ -268,7 +268,7 @@
id = "mechfab"
req_tech = list("programming" = 3, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mechfab
category = list("Research Machinery")
@@ -278,7 +278,7 @@
id = "mech_recharger"
req_tech = list("programming" = 3, "powerstorage" = 4, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mech_recharger
category = list("Research Machinery")
@@ -288,7 +288,7 @@
id = "experimentor"
req_tech = list("programming" = 2, "magnets" = 2, "engineering" = 2, "bluespace" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/experimentor
category = list("Research Machinery")
@@ -298,7 +298,7 @@
id = "protolathe"
req_tech = list("programming" = 2, "engineering" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/protolathe
category = list("Research Machinery")
@@ -308,7 +308,7 @@
id = "rdserver"
req_tech = list("programming" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/rdserver
category = list("Research Machinery")
@@ -318,7 +318,7 @@
id = "gibber"
req_tech = list("programming" = 2, "engineering" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/gibber
category = list ("Misc. Machinery")
@@ -328,7 +328,7 @@
id = "smartfridge"
req_tech = list("programming" = 1)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/smartfridge
category = list ("Misc. Machinery")
@@ -338,7 +338,7 @@
id = "monkey_recycler"
req_tech = list("programming" = 1)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/monkey_recycler
category = list ("Misc. Machinery")
@@ -348,7 +348,7 @@
id = "seed_extractor"
req_tech = list("programming" = 1)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/seed_extractor
category = list ("Hydroponics Machinery")
@@ -358,7 +358,7 @@
id = "processor"
req_tech = list("programming" = 1)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/processor
category = list ("Misc. Machinery")
@@ -368,7 +368,7 @@
id = "recycler"
req_tech = list("programming" = 2, "engineering" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/recycler
category = list ("Misc. Machinery")
@@ -378,7 +378,7 @@
id = "holopad"
req_tech = list("programming" = 1)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/holopad
category = list ("Misc. Machinery")
@@ -388,7 +388,7 @@
id = "arcademachinebattle"
req_tech = list("programming" = 1)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/arcade/battle
category = list("Misc. Machinery")
@@ -398,7 +398,7 @@
id = "microwave"
req_tech = list("programming" = 2, "magnets" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/microwave
category = list("Misc. Machinery")
@@ -408,7 +408,7 @@
id = "oven"
req_tech = list("programming" = 2, "magnets" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/oven
category = list("Misc. Machinery")
@@ -418,7 +418,7 @@
id = "grill"
req_tech = list("programming" = 2, "magnets" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/grill
category = list("Misc. Machinery")
@@ -428,7 +428,7 @@
id = "candymaker"
req_tech = list("programming" = 2, "magnets" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/candy_maker
category = list("Misc. Machinery")
@@ -438,7 +438,7 @@
id = "deepfryer"
req_tech = list("programming" = 1)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/deepfryer
category = list("Misc. Machinery")
@@ -448,7 +448,7 @@
id = "arcademachineonion"
req_tech = list("programming" = 1)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/arcade/orion_trail
category = list("Misc. Machinery")
@@ -458,7 +458,7 @@
id = "selunload"
req_tech = list("engineering" = 1, "programming" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 2000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/programmable
category = list("Misc. Machinery")
@@ -468,7 +468,7 @@
id = "pod"
req_tech = list("programming" = 2,"engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 2000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/pod
category = list("Misc. Machinery")
@@ -478,7 +478,7 @@
id = "ore_redemption"
req_tech = list("programming" = 2, "engineering" = 2, "plasmatech" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS=1000, "sacid"=20)
materials = list(MAT_GLASS=1000)
build_path = /obj/item/circuitboard/ore_redemption
category = list ("Misc. Machinery")
@@ -488,7 +488,7 @@
id = "mining_equipment_vendor"
req_tech = list("engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS=1000, "sacid"=20)
materials = list(MAT_GLASS=1000)
build_path = /obj/item/circuitboard/mining_equipment_vendor
category = list ("Misc. Machinery")
@@ -498,7 +498,7 @@
id = "clawgame"
req_tech = list("programming" = 1)
build_type = IMPRINTER
materials = list(MAT_GLASS=1000, "sacid"=20)
materials = list(MAT_GLASS=1000)
build_path = /obj/item/circuitboard/clawgame
category = list ("Misc. Machinery")
@@ -508,7 +508,7 @@
id = "prize_counter"
req_tech = list("programming" = 2, "materials" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS=1000, "sacid"=20)
materials = list(MAT_GLASS=1000)
build_path = /obj/item/circuitboard/prize_counter
category = list("Misc. Machinery")
@@ -518,7 +518,7 @@
id = "gameboard"
req_tech = list("programming" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS=1000, "sacid"=20)
materials = list(MAT_GLASS=1000)
build_path = /obj/item/circuitboard/gameboard
category = list("Misc. Machinery")
@@ -528,7 +528,7 @@
id = "plantgenes"
req_tech = list("programming" = 4, "biotech" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS=1000, "sacid"=20)
materials = list(MAT_GLASS=1000)
build_path = /obj/item/circuitboard/plantgenes
category = list("Hydroponics Machinery")
@@ -538,6 +538,6 @@
id = "ntnet_relay"
req_tech = list("programming" = 2, "engineering" = 2, "bluespace" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS=1000, "sacid"=20)
materials = list(MAT_GLASS=1000)
build_path = /obj/item/circuitboard/machine/ntnet_relay
category = list("Subspace Telecomms")
+19 -19
View File
@@ -8,7 +8,7 @@
id = "ripley_main"
req_tech = list("programming" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mecha/ripley/main
category = list("Exosuit Modules")
@@ -18,7 +18,7 @@
id = "ripley_peri"
req_tech = list("programming" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mecha/ripley/peripherals
category = list("Exosuit Modules")
@@ -29,7 +29,7 @@
id = "odysseus_main"
req_tech = list("programming" = 3,"biotech" = 3, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mecha/odysseus/main
category = list("Exosuit Modules")
@@ -39,7 +39,7 @@
id = "odysseus_peri"
req_tech = list("programming" = 3,"biotech" = 3, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mecha/odysseus/peripherals
category = list("Exosuit Modules")
@@ -50,7 +50,7 @@
id = "gygax_main"
req_tech = list("programming" = 4, "combat" = 3, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mecha/gygax/main
category = list("Exosuit Modules")
@@ -60,7 +60,7 @@
id = "gygax_peri"
req_tech = list("programming" = 4, "combat" = 3, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mecha/gygax/peripherals
category = list("Exosuit Modules")
@@ -70,7 +70,7 @@
id = "gygax_targ"
req_tech = list("programming" = 4, "combat" = 4, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mecha/gygax/targeting
category = list("Exosuit Modules")
@@ -81,7 +81,7 @@
id = "durand_main"
req_tech = list("programming" = 4, "combat" = 4, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mecha/durand/main
category = list("Exosuit Modules")
@@ -91,7 +91,7 @@
id = "durand_peri"
req_tech = list("programming" = 4, "combat" = 4, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mecha/durand/peripherals
category = list("Exosuit Modules")
@@ -101,7 +101,7 @@
id = "durand_targ"
req_tech = list("programming" = 5, "combat" = 4, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mecha/durand/targeting
category = list("Exosuit Modules")
@@ -112,7 +112,7 @@
id = "phazon_main"
req_tech = list("programming" = 6, "materials" = 6, "plasmatech" = 5)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000, MAT_BLUESPACE = 100)
build_path = /obj/item/circuitboard/mecha/phazon/main
category = list("Exosuit Modules")
@@ -122,7 +122,7 @@
id = "phazon_peri"
req_tech = list("programming" = 6, "bluespace" = 5, "plasmatech" = 5)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000, MAT_BLUESPACE = 100)
build_path = /obj/item/circuitboard/mecha/phazon/peripherals
category = list("Exosuit Modules")
@@ -132,7 +132,7 @@
id = "phazon_targ"
req_tech = list("programming" = 6, "magnets" = 5, "plasmatech" = 5)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000, MAT_BLUESPACE = 100)
build_path = /obj/item/circuitboard/mecha/phazon/targeting
category = list("Exosuit Modules")
@@ -143,7 +143,7 @@
id = "honker_main"
req_tech = list("programming" = 3, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mecha/honker/main
category = list("Exosuit Modules")
@@ -153,7 +153,7 @@
id = "honker_peri"
req_tech = list("programming" = 3, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mecha/honker/peripherals
category = list("Exosuit Modules")
@@ -163,7 +163,7 @@
id = "honker_targ"
req_tech = list("programming" = 3, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mecha/honker/targeting
category = list("Exosuit Modules")
@@ -173,7 +173,7 @@
id = "reticence_main"
req_tech = list("programming" = 3, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mecha/reticence/main
category = list("Exosuit Modules")
@@ -183,7 +183,7 @@
id = "reticence_peri"
req_tech = list("programming" = 3, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mecha/reticence/peripherals
category = list("Exosuit Modules")
@@ -193,6 +193,6 @@
id = "reticence_targ"
req_tech = list("programming" = 3, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/mecha/reticence/targeting
category = list("Exosuit Modules")
@@ -27,7 +27,7 @@
id = "bluespacebeaker"
req_tech = list("bluespace" = 6, "materials" = 5, "plasmatech" = 4)
build_type = PROTOLATHE
materials = list(MAT_METAL = 3000, MAT_PLASMA = 3000, MAT_DIAMOND = 500)
materials = list(MAT_GLASS = 3000, MAT_PLASMA = 3000, MAT_DIAMOND = 250, MAT_BLUESPACE = 250)
build_path = /obj/item/reagent_containers/glass/beaker/bluespace
category = list("Medical")
@@ -311,7 +311,7 @@
req_tech = list("materials" = 7, "programming" = 5, "biotech" = 7, "magnets" = 5,"plasmatech" = 6)
build_type = PROTOLATHE | MECHFAB
construction_time = 60
materials = list(MAT_METAL = 600, MAT_GLASS = 600, MAT_SILVER = 600, MAT_GOLD = 600, MAT_PLASMA = 1000, MAT_URANIUM = 1000, MAT_DIAMOND = 2000)
materials = list(MAT_METAL = 600, MAT_GLASS = 600, MAT_SILVER = 600, MAT_GOLD = 600, MAT_PLASMA = 1000, MAT_URANIUM = 1000, MAT_DIAMOND = 1000, MAT_BLUESPACE = 1000)
build_path = /obj/item/organ/internal/cyberimp/eyes/xray
category = list("Misc", "Medical")
@@ -52,7 +52,7 @@
id = "bluespace_cell"
req_tech = list("powerstorage" = 6, "materials" = 5, "engineering" = 5, "bluespace" = 5)
build_type = PROTOLATHE | MECHFAB
materials = list(MAT_METAL = 800, MAT_GOLD = 120, MAT_SILVER = 150, MAT_GLASS = 160, MAT_DIAMOND = 160, MAT_TITANIUM = 300)
materials = list(MAT_METAL = 800, MAT_GOLD = 120, MAT_GLASS = 160, MAT_DIAMOND = 160, MAT_TITANIUM = 300, MAT_BLUESPACE = 100)
construction_time=100
build_path = /obj/item/stock_parts/cell/bluespace
category = list("Misc","Power")
@@ -63,7 +63,7 @@
id = "pacman"
req_tech = list("programming" = 2, "plasmatech" = 3, "powerstorage" = 3, "engineering" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/pacman
category = list("Engineering Machinery")
@@ -73,7 +73,7 @@
id = "mrspacman"
req_tech = list("programming" = 3, "powerstorage" = 5, "engineering" = 5, "plasmatech" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 2000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/pacman/mrs
category = list("Engineering Machinery")
@@ -83,7 +83,7 @@
id = "superpacman"
req_tech = list("programming" = 3, "powerstorage" = 4, "engineering" = 4)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/pacman/super
category = list("Engineering Machinery")
@@ -93,7 +93,7 @@
id = "tesla_coil"
req_tech = list("programming" = 3, "powerstorage" = 3, "magnets" = 3)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/tesla_coil
category = list("Engineering Machinery")
@@ -103,6 +103,6 @@
id = "grounding_rod"
req_tech = list("programming" = 3, "powerstorage" = 3, "magnets" = 3, "plasmatech" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/grounding_rod
category = list("Engineering Machinery")
@@ -0,0 +1,37 @@
///////SMELTABLE ALLOYS///////
/datum/design/plasteel_alloy
name = "Plasma + Iron alloy"
id = "plasteel"
build_type = SMELTER
materials = list(MAT_METAL = MINERAL_MATERIAL_AMOUNT, MAT_PLASMA = MINERAL_MATERIAL_AMOUNT)
build_path = /obj/item/stack/sheet/plasteel
category = list("initial")
/datum/design/plastitanium_alloy
name = "Plasma + Titanium alloy"
id = "plastitanium"
build_type = SMELTER
materials = list(MAT_TITANIUM = MINERAL_MATERIAL_AMOUNT, MAT_PLASMA = MINERAL_MATERIAL_AMOUNT)
build_path = /obj/item/stack/sheet/mineral/plastitanium
category = list("initial")
/datum/design/plaglass_alloy
name = "Plasma + Glass alloy"
id = "plasmaglass"
build_type = SMELTER
materials = list(MAT_PLASMA = MINERAL_MATERIAL_AMOUNT, MAT_GLASS = MINERAL_MATERIAL_AMOUNT)
build_path = /obj/item/stack/sheet/plasmaglass
category = list("initial")
/datum/design/alienalloy
name = "Alien Alloy"
desc = "A sheet of reverse-engineered alien alloy."
id = "alienalloy"
req_tech = list("abductor" = 1, "materials" = 7, "plasmatech" = 2)
build_type = PROTOLATHE | SMELTER
materials = list(MAT_METAL = 4000, MAT_PLASMA = 4000)
build_path = /obj/item/stack/sheet/mineral/abductor
category = list("Stock Parts")
lathe_time_factor = 5
@@ -192,7 +192,7 @@
id = "triphasic_scanning"
req_tech = list("magnets" = 6, "materials" = 5, "engineering" = 5, "bluespace" = 5)
build_type = PROTOLATHE
materials = list(MAT_METAL = 200, MAT_GLASS = 200, MAT_DIAMOND = 60)
materials = list(MAT_METAL = 200, MAT_GLASS = 200, MAT_DIAMOND = 30, MAT_BLUESPACE = 30)
build_path = /obj/item/stock_parts/scanning_module/triphasic
category = list("Stock Parts")
lathe_time_factor = 0.2
@@ -225,7 +225,7 @@
id = "bluespace_matter_bin"
req_tech = list("materials" = 7, "engineering" = 5, "bluespace" = 5)
build_type = PROTOLATHE
materials = list(MAT_METAL = 250, MAT_DIAMOND = 200)
materials = list(MAT_METAL = 250, MAT_DIAMOND = 100, MAT_BLUESPACE = 100)
build_path = /obj/item/stock_parts/matter_bin/bluespace
category = list("Stock Parts")
lathe_time_factor = 0.2
@@ -248,17 +248,4 @@
build_type = PROTOLATHE
materials = list(MAT_METAL = 15000, MAT_GLASS = 5000, MAT_SILVER = 2500) //hardcore
build_path = /obj/item/storage/part_replacer/bluespace
category = list("Stock Parts")
//Alien Parts
/datum/design/alienalloy
name = "Alien Alloy"
desc = "A sheet of reverse-engineered alien alloy."
id = "alienalloy"
req_tech = list("abductor" = 1, "materials" = 7, "plasmatech" = 2)
build_type = PROTOLATHE
materials = list(MAT_METAL = 4000, MAT_PLASMA = 4000)
build_path = /obj/item/stack/sheet/mineral/abductor
category = list("Stock Parts")
lathe_time_factor = 5
category = list("Stock Parts")
@@ -7,7 +7,7 @@
id = "s-bus"
req_tech = list("programming" = 2, "engineering" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/telecomms/bus
category = list("Subspace Telecomms")
@@ -17,7 +17,7 @@
id = "s-hub"
req_tech = list("programming" = 2, "engineering" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/telecomms/hub
category = list("Subspace Telecomms")
@@ -28,7 +28,7 @@
id = "s-processor"
req_tech = list("programming" = 2, "engineering" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/telecomms/processor
category = list("Subspace Telecomms")
@@ -38,7 +38,7 @@
id = "s-relay"
req_tech = list("programming" = 2, "engineering" = 2, "bluespace" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/telecomms/relay
category = list("Subspace Telecomms")
@@ -48,7 +48,7 @@
id = "s-server"
req_tech = list("programming" = 2, "engineering" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/telecomms/server
category = list("Subspace Telecomms")
@@ -58,7 +58,7 @@
id = "s-broadcaster"
req_tech = list("programming" = 2, "engineering" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/telecomms/broadcaster
category = list("Subspace Telecomms")
@@ -68,7 +68,7 @@
id = "s-receiver"
req_tech = list("programming" = 2, "engineering" = 2, "bluespace" = 1)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000, "sacid" = 20)
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/telecomms/receiver
category = list("Subspace Telecomms")
@@ -20,7 +20,7 @@
req_tech = list("combat" = 5, "materials" = 5, "biotech" = 6, "plasmatech" = 7)
build_type = PROTOLATHE
materials = list(MAT_GOLD = 5000,MAT_URANIUM = 10000)
reagents = list("mutagen" = 40)
reagents_list = list("mutagen" = 40)
build_path = /obj/item/gun/energy/decloner
locked = 1
category = list("Weapons")
@@ -43,7 +43,7 @@
req_tech = list("materials" = 2, "biotech" = 4)
build_type = PROTOLATHE
materials = list(MAT_METAL = 2000, MAT_GLASS = 500)
reagents = list("radium" = 20)
reagents_list = list("radium" = 20)
build_path = /obj/item/gun/energy/floragun
category = list("Weapons")
@@ -64,7 +64,7 @@
id = "wormholeprojector"
req_tech = list("combat" = 5, "engineering" = 5, "bluespace" = 7, "plasmatech" = 6)
build_type = PROTOLATHE
materials = list(MAT_SILVER = 2000, MAT_METAL = 5000, MAT_DIAMOND = 3000)
materials = list(MAT_SILVER = 2000, MAT_METAL = 5000, MAT_DIAMOND = 2000, MAT_BLUESPACE = 3000)
build_path = /obj/item/gun/energy/wormhole_projector
locked = 1
access_requirement = list(access_rd) //screw you, HoS, this aint yours; this is only for a man of science---and trouble.
@@ -242,7 +242,7 @@
id = "xray"
req_tech = list("combat" = 7, "magnets" = 5, "biotech" = 5, "powerstorage" = 4)
build_type = PROTOLATHE
materials = list(MAT_GOLD = 5000,MAT_URANIUM = 8000, MAT_METAL = 5000, MAT_TITANIUM = 2000)
materials = list(MAT_GOLD = 5000, MAT_URANIUM = 4000, MAT_METAL = 5000, MAT_TITANIUM = 2000, MAT_BLUESPACE = 2000)
build_path = /obj/item/gun/energy/xray
locked = 1
category = list("Weapons")
@@ -9,7 +9,6 @@ Note: Must be placed within 3 tiles of the R&D Console
name = "Destructive Analyzer"
desc = "Learn science by destroying things!"
icon_state = "d_analyzer"
var/obj/item/loaded_item = null
var/decon_mod = 0
/obj/machinery/r_n_d/destructive_analyzer/New()
@@ -46,7 +45,8 @@ Note: Must be placed within 3 tiles of the R&D Console
/obj/machinery/r_n_d/destructive_analyzer/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
if(shocked)
shock(user,50)
if(shock(user,50))
return TRUE
if(default_deconstruction_screwdriver(user, "d_analyzer_t", "d_analyzer", O))
if(linked_console)
linked_console.linked_destroy = null
@@ -56,7 +56,8 @@ Note: Must be placed within 3 tiles of the R&D Console
if(exchange_parts(user, O))
return
default_deconstruction_crowbar(O)
if(default_deconstruction_crowbar(O))
return
if(disabled)
return
@@ -84,5 +85,4 @@ Note: Must be placed within 3 tiles of the R&D Console
flick("d_analyzer_la", src)
spawn(10)
icon_state = "d_analyzer_l"
busy = 0
return
busy = 0
+2 -2
View File
@@ -25,7 +25,6 @@
var/recentlyExperimented = 0
var/mob/trackedIan
var/mob/trackedRuntime
var/obj/item/loaded_item = null
var/badThingCoeff = 0
var/resetTime = 15
var/cloneMode = FALSE
@@ -450,8 +449,9 @@
visible_message("<span class='warning'>[src]'s crushing mechanism slowly and smoothly descends, flattening the [exp_on]!</span>")
new /obj/item/stack/sheet/plasteel(get_turf(pick(oview(1,src))))
if(linked_console.linked_lathe)
GET_COMPONENT_FROM(linked_materials, /datum/component/material_container, linked_console.linked_lathe)
for(var/material in exp_on.materials)
linked_console.linked_lathe.materials.insert_amount( min((linked_console.linked_lathe.materials.max_amount - linked_console.linked_lathe.materials.total_amount), (exp_on.materials[material])), material)
linked_materials.insert_amount( min((linked_materials.max_amount - linked_materials.total_amount), (exp_on.materials[material])), material)
if(prob(EFFECT_PROB_VERYLOW-badThingCoeff))
visible_message("<span class='danger'>[src]'s crusher goes way too many levels too high, crushing right through space-time!</span>")
playsound(src.loc, 'sound/effects/supermatter.ogg', 50, 1, -3)
+5 -42
View File
@@ -13,7 +13,6 @@ Note: Must be placed west/left of and R&D console to function.
icon_state = "protolathe"
flags = OPENCONTAINER
var/datum/material_container/materials
var/efficiency_coeff
var/list/categories = list(
@@ -42,7 +41,6 @@ Note: Must be placed west/left of and R&D console to function.
component_parts += new /obj/item/stock_parts/manipulator(null)
component_parts += new /obj/item/reagent_containers/glass/beaker/large(null)
component_parts += new /obj/item/reagent_containers/glass/beaker/large(null)
materials = new(src, list(MAT_METAL=1, MAT_GLASS=1, MAT_SILVER=1, MAT_GOLD=1, MAT_DIAMOND=1, MAT_PLASMA=1, MAT_URANIUM=1, MAT_BANANIUM=1, MAT_TRANQUILLITE=1, MAT_TITANIUM=1))
RefreshParts()
reagents.my_atom = src
@@ -61,10 +59,6 @@ Note: Must be placed west/left of and R&D console to function.
reagents.my_atom = src
/obj/machinery/r_n_d/protolathe/Destroy()
QDEL_NULL(materials)
return ..()
/obj/machinery/r_n_d/protolathe/RefreshParts()
var/T = 0
for(var/obj/item/reagent_containers/glass/G in component_parts)
@@ -81,14 +75,15 @@ Note: Must be placed west/left of and R&D console to function.
var/A = materials.amount(M)
if(!A)
A = reagents.get_reagent_amount(M)
A = A / max(1, (being_built.reagents[M]))
A = A / max(1, (being_built.reagents_list[M]))
else
A = A / max(1, (being_built.materials[M]))
return A
/obj/machinery/r_n_d/protolathe/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
if(shocked)
shock(user,50)
if(shock(user,50))
return TRUE
if(default_deconstruction_screwdriver(user, "protolathe_t", "protolathe", O))
if(linked_console)
linked_console.linked_lathe = null
@@ -112,39 +107,7 @@ Note: Must be placed west/left of and R&D console to function.
else
to_chat(user, "<span class='warning'>You can't load the [src.name] while it's opened.</span>")
return 1
if(disabled)
return
if(!linked_console)
to_chat(user, "<span class='warning'> The [src.name] must be linked to an R&D console first!</span>")
return 1
if(busy)
to_chat(user, "<span class='warning'>The [src.name] is busy. Please wait for completion of previous operation.</span>")
return 1
if(O.is_open_container())
return
if(stat)
return 1
if(!istype(O,/obj/item/stack/sheet))
return 1
if(!materials.has_space( materials.get_item_material_amount(O) ))
to_chat(user, "<span class='warning'>The [src.name]'s material bin is full! Please remove material before adding more.</span>")
return 1
var/obj/item/stack/sheet/stack = O
var/amount = round(input("How many sheets do you want to add?") as num)//No decimals
if(!in_range(src, stack) || !user.Adjacent(src))
return
var/amount_inserted = materials.insert_stack(O,amount)
if(!amount_inserted)
return 1
return FALSE
else
busy = 1
use_power(max(1000, (MINERAL_MATERIAL_AMOUNT*amount_inserted/10)))
to_chat(user, "<span class='notice'>You add [amount_inserted] sheets to the [src.name].</span>")
var/stackname = stack.name
src.overlays += "protolathe_[stackname]"
sleep(10)
src.overlays -= "protolathe_[stackname]"
busy = 0
updateUsrDialog()
return ..()
+62 -44
View File
@@ -100,6 +100,10 @@ won't update every console in existence) but it's more of a hassle to do. Also,
return_name = "Tranquillite"
if("titanium")
return_name = "Titanium"
if("bluespace")
return_name = "Bluespace Mesh"
if("plastic")
return_name = "Plastic"
return return_name
else
for(var/R in subtypesof(/datum/reagent))
@@ -443,16 +447,16 @@ won't update every console in existence) but it's more of a hassle to do. Also,
enough_materials = 0
g2g = 0
else
for(var/R in being_built.reagents)
if(!linked_lathe.reagents.has_reagent(R, being_built.reagents[R])*coeff)
for(var/R in being_built.reagents_list)
if(!linked_lathe.reagents.has_reagent(R, being_built.reagents_list[R])*coeff)
src.visible_message("<span class='notice'>The [src.name] beeps, \"Not enough reagents to complete prototype.\"</span>")
enough_materials = 0
g2g = 0
if(enough_materials)
linked_lathe.materials.use_amount(efficient_mats, amount)
for(var/R in being_built.reagents)
linked_lathe.reagents.remove_reagent(R, being_built.reagents[R]*coeff)
for(var/R in being_built.reagents_list)
linked_lathe.reagents.remove_reagent(R, being_built.reagents_list[R]*coeff)
var/P = being_built.build_path //lets save these values before the spawn() just in case. Nobody likes runtimes.
var/O = being_built.locked
@@ -484,6 +488,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
else if(href_list["imprint"]) //Causes the Circuit Imprinter to build something.
var/coeff = linked_imprinter.efficiency_coeff
var/g2g = 1
var/enough_materials = 1
if(linked_imprinter)
if(linked_imprinter.busy)
to_chat(usr, "<span class='danger'>Circuit Imprinter is busy at the moment.</span>")
@@ -505,20 +510,25 @@ won't update every console in existence) but it's more of a hassle to do. Also,
flick("circuit_imprinter_ani",linked_imprinter)
use_power(power)
for(var/M in being_built.materials)
if(!linked_imprinter.check_mat(being_built, M))
src.visible_message("<span class='notice'>The [src.name] beeps, \"Not enough materials to complete prototype.\"</span>")
g2g = 0
break
switch(M)
if(MAT_GLASS)
linked_imprinter.g_amount = max(0, (linked_imprinter.g_amount-being_built.materials[M]/coeff))
if(MAT_GOLD)
linked_imprinter.gold_amount = max(0, (linked_imprinter.gold_amount-being_built.materials[M]/coeff))
if(MAT_DIAMOND)
linked_imprinter.diamond_amount = max(0, (linked_imprinter.diamond_amount-being_built.materials[M]/coeff))
else
linked_imprinter.reagents.remove_reagent(M, being_built.materials[M]/coeff)
var/list/efficient_mats = list()
for(var/MAT in being_built.materials)
efficient_mats[MAT] = being_built.materials[MAT]/coeff
if(!linked_imprinter.materials.has_materials(efficient_mats))
visible_message("<span class='notice'>The [src.name] beeps, \"Not enough materials to complete prototype.\"</span>")
enough_materials = 0
g2g = 0
else
for(var/R in being_built.reagents_list)
if(!linked_imprinter.reagents.has_reagent(R, being_built.reagents_list[R]/coeff))
visible_message("<span class='notice'>The [name] beeps, \"Not enough reagents to complete prototype.\"</span>")
enough_materials = 0
g2g = 0
if(enough_materials)
linked_imprinter.materials.use_amount(efficient_mats)
for(var/R in being_built.reagents_list)
linked_imprinter.reagents.remove_reagent(R, being_built.reagents_list[R]/coeff)
var/P = being_built.build_path //lets save these values before the spawn() just in case. Nobody likes runtimes.
spawn(IMPRINTER_DELAY)
@@ -563,25 +573,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
desired_num_sheets = round(desired_num_sheets) // No partial-sheet goofery
else
desired_num_sheets = text2num(href_list["imprinter_ejectsheet_amt"])
var/res_amount, type
switch(href_list["imprinter_ejectsheet"])
if(MAT_GLASS)
type = /obj/item/stack/sheet/glass
res_amount = "g_amount"
if(MAT_GOLD)
type = /obj/item/stack/sheet/mineral/gold
res_amount = "gold_amount"
if(MAT_DIAMOND)
type = /obj/item/stack/sheet/mineral/diamond
res_amount = "diamond_amount"
if(ispath(type) && hasvar(linked_imprinter, res_amount))
var/obj/item/stack/sheet/sheet = new type(linked_imprinter.loc)
var/available_num_sheets = round(linked_imprinter.vars[res_amount]/sheet.perunit)
if(available_num_sheets>0)
sheet.amount = min(available_num_sheets, desired_num_sheets)
linked_imprinter.vars[res_amount] = max(0, (linked_imprinter.vars[res_amount]-sheet.amount * sheet.perunit))
else
qdel(sheet)
linked_imprinter.materials.retrieve_sheets(desired_num_sheets, href_list["imprinter_ejectsheet"])
else if(href_list["find_device"]) //The R&D console looks for devices nearby to link up with.
add_wait_message("Updating Database...", SYNC_DEVICE_DELAY)
@@ -718,6 +710,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
if(b_type & MECHFAB) lathe_types += "Mech Fabricator"
if(b_type & PODFAB) lathe_types += "Spacepod Fabricator"
if(b_type & BIOGENERATOR) lathe_types += "Biogenerator"
if(b_type & SMELTER) lathe_types += "Smelter"
var/list/materials = list()
disk_data["materials"] = materials
for(var/M in d_disk.blueprint.materials)
@@ -785,11 +778,11 @@ won't update every console in existence) but it's more of a hassle to do. Also,
material_list["is_red"] = 0
c = min(c, t)
for(var/R in D.reagents)
for(var/R in D.reagents_list)
var/list/material_list = list()
materials_list[++materials_list.len] = material_list
material_list["name"] = CallMaterialName(R)
material_list["amount"] = D.reagents[R]*coeff
material_list["amount"] = D.reagents_list[R]*coeff
var/t = linked_lathe.check_mat(D, R)
if(t < 1)
@@ -805,12 +798,14 @@ won't update every console in existence) but it's more of a hassle to do. Also,
materials_list[++materials_list.len] = list("name" = "Glass", "id" = MAT_GLASS, "amount" = linked_lathe.materials.amount(MAT_GLASS))
materials_list[++materials_list.len] = list("name" = "Gold", "id" = MAT_GOLD, "amount" = linked_lathe.materials.amount(MAT_GOLD))
materials_list[++materials_list.len] = list("name" = "Silver", "id" = MAT_SILVER, "amount" = linked_lathe.materials.amount(MAT_SILVER))
materials_list[++materials_list.len] = list("name" = "Plasma", "id" = MAT_PLASMA, "amount" = linked_lathe.materials.amount(MAT_PLASMA))
materials_list[++materials_list.len] = list("name" = "Solid Plasma", "id" = MAT_PLASMA, "amount" = linked_lathe.materials.amount(MAT_PLASMA))
materials_list[++materials_list.len] = list("name" = "Uranium", "id" = MAT_URANIUM, "amount" = linked_lathe.materials.amount(MAT_URANIUM))
materials_list[++materials_list.len] = list("name" = "Diamond", "id" = MAT_DIAMOND, "amount" = linked_lathe.materials.amount(MAT_DIAMOND))
materials_list[++materials_list.len] = list("name" = "Bananium", "id" = MAT_BANANIUM, "amount" = linked_lathe.materials.amount(MAT_BANANIUM))
materials_list[++materials_list.len] = list("name" = "Tranquillite", "id" = MAT_TRANQUILLITE, "amount" = linked_lathe.materials.amount(MAT_TRANQUILLITE))
materials_list[++materials_list.len] = list("name" = "Titanium", "id" = MAT_TITANIUM, "amount" = linked_lathe.materials.amount(MAT_TITANIUM))
materials_list[++materials_list.len] = list("name" = "Plastic", "id" = MAT_PLASTIC, "amount" = linked_lathe.materials.amount(MAT_PLASTIC))
materials_list[++materials_list.len] = list("name" = "Bluespace Mesh", "id" = MAT_BLUESPACE, "amount" = linked_lathe.materials.amount(MAT_BLUESPACE))
if(submenu == 3)
var/list/loaded_chemicals = list()
data["loaded_chemicals"] = loaded_chemicals
@@ -822,8 +817,10 @@ won't update every console in existence) but it's more of a hassle to do. Also,
loaded_chemical["id"] = R.id
if(menu == 5 && linked_imprinter)
data["total_materials"] = linked_imprinter.TotalMaterials()
data["total_materials"] = linked_imprinter.materials.total_amount
data["max_materials"] = linked_imprinter.materials.max_amount
data["total_chemicals"] = linked_imprinter.reagents.total_volume
data["max_chemicals"] = linked_imprinter.reagents.maximum_volume
data["categories"] = linked_imprinter.categories
if(submenu == 1)
var/list/designs_list = list()
@@ -847,13 +844,34 @@ won't update every console in existence) but it's more of a hassle to do. Also,
material_list["is_red"] = 1
else
material_list["is_red"] = 0
for(var/R in D.reagents_list)
var/list/material_list = list()
materials_list[++materials_list.len] = material_list
material_list["name"] = CallMaterialName(R)
material_list["amount"] = D.reagents_list[R]*coeff
if(!linked_imprinter.check_mat(D, R))
check_materials = 0
material_list["is_red"] = 1
else
material_list["is_red"] = 0
design_list["can_build"] = check_materials
if(submenu == 2)
var/list/materials_list = list()
data["loaded_materials"] = materials_list
materials_list[++materials_list.len] = list("name" = "Glass", "id" = MAT_GLASS, "amount" = linked_imprinter.g_amount)
materials_list[++materials_list.len] = list("name" = "Gold", "id" = MAT_GOLD, "amount" = linked_imprinter.gold_amount)
materials_list[++materials_list.len] = list("name" = "Diamond", "id" = MAT_DIAMOND, "amount" = linked_imprinter.diamond_amount)
materials_list[++materials_list.len] = list("name" = "Metal", "id" = MAT_METAL, "amount" = linked_imprinter.materials.amount(MAT_METAL))
materials_list[++materials_list.len] = list("name" = "Glass", "id" = MAT_GLASS, "amount" = linked_imprinter.materials.amount(MAT_GLASS))
materials_list[++materials_list.len] = list("name" = "Gold", "id" = MAT_GOLD, "amount" = linked_imprinter.materials.amount(MAT_GOLD))
materials_list[++materials_list.len] = list("name" = "Silver", "id" = MAT_SILVER, "amount" = linked_imprinter.materials.amount(MAT_SILVER))
materials_list[++materials_list.len] = list("name" = "Solid Plasma", "id" = MAT_PLASMA, "amount" = linked_imprinter.materials.amount(MAT_PLASMA))
materials_list[++materials_list.len] = list("name" = "Uranium", "id" = MAT_URANIUM, "amount" = linked_imprinter.materials.amount(MAT_URANIUM))
materials_list[++materials_list.len] = list("name" = "Diamond", "id" = MAT_DIAMOND, "amount" = linked_imprinter.materials.amount(MAT_DIAMOND))
materials_list[++materials_list.len] = list("name" = "Bananium", "id" = MAT_BANANIUM, "amount" = linked_imprinter.materials.amount(MAT_BANANIUM))
materials_list[++materials_list.len] = list("name" = "Tranquillite", "id" = MAT_TRANQUILLITE, "amount" = linked_imprinter.materials.amount(MAT_TRANQUILLITE))
materials_list[++materials_list.len] = list("name" = "Titanium", "id" = MAT_TITANIUM, "amount" = linked_imprinter.materials.amount(MAT_TITANIUM))
materials_list[++materials_list.len] = list("name" = "Plastic", "id" = MAT_PLASTIC, "amount" = linked_imprinter.materials.amount(MAT_PLASTIC))
materials_list[++materials_list.len] = list("name" = "Bluespace Mesh", "id" = MAT_BLUESPACE, "amount" = linked_imprinter.materials.amount(MAT_BLUESPACE))
if(submenu == 3)
var/list/loaded_chemicals = list()
data["loaded_chemicals"] = loaded_chemicals
+43
View File
@@ -16,8 +16,14 @@
var/disable_wire
var/shock_wire
var/obj/machinery/computer/rdconsole/linked_console
var/obj/item/loaded_item = null
var/datum/component/material_container/materials //Store for hyper speed!
/obj/machinery/r_n_d/New()
materials = AddComponent(/datum/component/material_container,
list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TRANQUILLITE, MAT_TITANIUM, MAT_BLUESPACE, MAT_PLASTIC), 0,
FALSE, list(/obj/item/stack, /obj/item/ore/bluespace_crystal), CALLBACK(src, .proc/is_insertion_ready), CALLBACK(src, .proc/AfterMaterialInsert))
materials.precise_insertion = TRUE
..()
wires["Red"] = 0
wires["Blue"] = 0
@@ -88,3 +94,40 @@
src.shocked = !src.shocked
src.shock(usr,50)
src.updateUsrDialog()
//whether the machine can have an item inserted in its current state.
/obj/machinery/r_n_d/proc/is_insertion_ready(mob/user)
if(panel_open)
to_chat(user, "<span class='warning'>You can't load [src] while it's opened!</span>")
return FALSE
if(disabled)
return FALSE
if(!linked_console)
to_chat(user, "<span class='warning'>[src] must be linked to an R&D console first!</span>")
return FALSE
if(busy)
to_chat(user, "<span class='warning'>[src] is busy right now.</span>")
return FALSE
if(stat & BROKEN)
to_chat(user, "<span class='warning'>[src] is broken.</span>")
return FALSE
if(stat & NOPOWER)
to_chat(user, "<span class='warning'>[src] has no power.</span>")
return FALSE
if(loaded_item)
to_chat(user, "<span class='warning'>[src] is already loaded.</span>")
return FALSE
return TRUE
/obj/machinery/r_n_d/proc/AfterMaterialInsert(type_inserted, id_inserted, amount_inserted)
var/stack_name
if(ispath(type_inserted, /obj/item/ore/bluespace_crystal))
stack_name = "bluespace polycrystal"
use_power(MINERAL_MATERIAL_AMOUNT / 10)
else
var/obj/item/stack/S = type_inserted
stack_name = initial(S.name)
use_power(min(1000, (amount_inserted / 100)))
overlays += "[initial(name)]_[stack_name]"
sleep(10)
overlays -= "[initial(name)]_[stack_name]"
+15
View File
@@ -183,6 +183,21 @@ research holder datum.
return
..()
//Smelter files
/datum/research/smelter/New()
for(var/T in (subtypesof(/datum/tech)))
possible_tech += new T(src)
for(var/path in subtypesof(/datum/design))
var/datum/design/D = new path(src)
possible_designs += D
if((D.build_type & SMELTER) && ("initial" in D.category))
AddDesign2Known(D)
/datum/research/smelter/AddDesign2Known(datum/design/D)
if(!(D.build_type & SMELTER))
return
..()
/***************************************************************
** Technology Datums **
** Includes all the various technoliges and what they make. **
@@ -218,6 +218,8 @@
SM.sentience_act()
to_chat(SM, "<span class='warning'>All at once it makes sense: you know what you are and who you are! Self awareness is yours!</span>")
to_chat(SM, "<span class='userdanger'>You are grateful to be self aware and owe [user] a great debt. Serve [user], and assist them in completing their goals at any cost.</span>")
if(SM.flags_2 & HOLOGRAM_2) //Check to see if it's a holodeck creature
to_chat(SM, "<span class='userdanger'>You also become depressingly aware that you are not a real creature, but instead a holoform. Your existence is limited to the parameters of the holodeck.</span>")
to_chat(user, "<span class='notice'>[M] accepts the potion and suddenly becomes attentive and aware. It worked!</span>")
qdel(src)
else
-541
View File
@@ -1,541 +0,0 @@
/obj/machinery/spod_part_fabricator
icon = 'icons/obj/robotics.dmi'
icon_state = "fab-idle"
name = "spacepod fabricator"
desc = "Nothing is being built."
density = 1
anchored = 1
use_power = 1
idle_power_usage = 20
active_power_usage = 5000
var/time_coeff = 1
var/resource_coeff = 1
var/time_coeff_tech = 1
var/resource_coeff_tech = 1
var/list/resources = list(
MAT_METAL=0,
MAT_GLASS=0,
MAT_BANANIUM=0,
MAT_DIAMOND=0,
MAT_GOLD=0,
MAT_PLASMA=0,
MAT_SILVER=0,
MAT_URANIUM=0
)
var/res_max_amount = 200000
var/datum/research/files
var/id
var/sync = 0
var/part_set
var/datum/design/being_built
var/list/queue = list()
var/processing_queue = 0
var/screen = "main"
var/temp
var/list/part_sets = list(
"Pod_Weaponry",
"Pod_Armor",
"Pod_Cargo",
"Pod_Parts",
"Pod_Frame",
"Misc",
)
var/turf/exit
/obj/machinery/spod_part_fabricator/New()
..()
component_parts = list()
component_parts += new /obj/item/circuitboard/podfab(null)
component_parts += new /obj/item/stock_parts/matter_bin(null)
component_parts += new /obj/item/stock_parts/matter_bin(null)
component_parts += new /obj/item/stock_parts/matter_bin(null)
component_parts += new /obj/item/stock_parts/manipulator(null)
component_parts += new /obj/item/stock_parts/manipulator(null)
component_parts += new /obj/item/stock_parts/micro_laser(null)
component_parts += new /obj/item/stock_parts/micro_laser(null)
component_parts += new /obj/item/stock_parts/console_screen(null)
RefreshParts()
files = new /datum/research(src) //Setup the research data holder.
for(var/direction in cardinal)
exit = get_step(src,direction)
if(!exit.density)
break
exit = loc
/obj/machinery/spod_part_fabricator/upgraded/New()
..()
component_parts = list()
component_parts += new /obj/item/circuitboard/podfab(null)
component_parts += new /obj/item/stock_parts/matter_bin/super(null)
component_parts += new /obj/item/stock_parts/matter_bin/super(null)
component_parts += new /obj/item/stock_parts/matter_bin/super(null)
component_parts += new /obj/item/stock_parts/manipulator/pico(null)
component_parts += new /obj/item/stock_parts/manipulator/pico(null)
component_parts += new /obj/item/stock_parts/micro_laser/ultra(null)
component_parts += new /obj/item/stock_parts/micro_laser/ultra(null)
component_parts += new /obj/item/stock_parts/console_screen(null)
RefreshParts()
/obj/machinery/spod_part_fabricator/RefreshParts()
var/T = 0
//maximum stocking amount (max 412000)
for(var/obj/item/stock_parts/matter_bin/M in component_parts)
T += M.rating
res_max_amount = (187000+(T * 37500))
//ressources adjustment coefficient (1 -> 0.88 -> 0.75)
T = -1
for(var/obj/item/stock_parts/micro_laser/Ma in component_parts)
T += Ma.rating
resource_coeff = round(initial(resource_coeff) - (initial(resource_coeff)*(T))/8,0.01)
//building time adjustment coefficient (1 -> 0.8 -> 0.6)
T = -1
for(var/obj/item/stock_parts/manipulator/Ml in component_parts)
T += Ml.rating
time_coeff = round(initial(time_coeff) - (initial(time_coeff)*(T))/5,0.01)
/obj/machinery/spod_part_fabricator/proc/output_parts_list(set_name)
var/output = ""
for(var/v in files.known_designs)
var/datum/design/D = files.known_designs[v]
if(D.build_type & PODFAB)
if(!(set_name in D.category))
continue
var/resources_available = check_resources(D)
output += "<div class='part'>[output_part_info(D)]<br>\[[resources_available?"<a href='?src=[UID()];part=[D.id]'>Build</a> | ":null]<a href='?src=[UID()];add_to_queue=[D.id]'>Add to queue</a>\]\[<a href='?src=[UID()];part_desc=[D.id]'>?</a>\]</div>"
return output
/obj/machinery/spod_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] seconds"
return output
/obj/machinery/spod_part_fabricator/proc/output_part_cost(datum/design/D)
var/i = 0
var/output
for(var/c in D.materials)
if(c in resources)
output += "[i?" | ":null][get_resource_cost_w_coeff(D,c)] [material2name(c)]"
i++
return output
/obj/machinery/spod_part_fabricator/proc/output_available_resources()
var/output
for(var/resource in resources)
var/amount = min(res_max_amount, resources[resource])
output += "<span class=\"res_name\">[material2name(resource)]: </span>[amount] cm&sup3;, [round(resources[resource] / MINERAL_MATERIAL_AMOUNT,0.1)] sheets"
if(amount>0)
output += "<span style='font-size:80%;'> - Remove \[<a href='?src=[UID()];remove_mat=1;material=[resource]'>1</a>\] | \[<a href='?src=[UID()];remove_mat=10;material=[resource]'>10</a>\] | \[<a href='?src=[UID()];remove_mat=1;material=[resource];custom_eject=1'>Custom</a>\] | \[<a href='?src=[UID()];remove_mat=[resources[resource] / MINERAL_MATERIAL_AMOUNT];material=[resource]'>All</a>\]</span>"
output += "<br/>"
return output
/obj/machinery/spod_part_fabricator/proc/remove_resources(datum/design/D)
for(var/resource in D.materials)
if(resource in resources)
resources[resource] -= get_resource_cost_w_coeff(D,resource)
/obj/machinery/spod_part_fabricator/proc/check_resources(datum/design/D)
for(var/R in D.materials)
if(R in resources)
if(resources[R] < get_resource_cost_w_coeff(D, R))
return 0
else
return 0
return 1
/obj/machinery/spod_part_fabricator/proc/build_part(datum/design/D)
being_built = D
desc = "It's building \a [initial(D.name)]."
remove_resources(D)
overlays += "fab-active"
use_power = 2
updateUsrDialog()
sleep(get_construction_time_w_coeff(D))
use_power = 1
overlays -= "fab-active"
desc = initial(desc)
var/obj/item/I = new D.build_path
var/O = D.locked
if(O)
var/obj/item/storage/lockbox/L = new/obj/item/storage/lockbox(exit)
I.loc = L
L.name += " ([I.name])"
else
I.loc = exit
I.materials[MAT_METAL] = get_resource_cost_w_coeff(D,MAT_METAL)
I.materials[MAT_GLASS] = get_resource_cost_w_coeff(D,MAT_GLASS)
visible_message("[bicon(src)] <b>\The [src]</b> beeps, \"\The [I] is complete.\"")
being_built = null
updateUsrDialog()
return 1
/obj/machinery/spod_part_fabricator/proc/update_queue_on_page()
send_byjax(usr,"mecha_fabricator.browser","queue",list_queue())
return
/obj/machinery/spod_part_fabricator/proc/add_part_set_to_queue(set_name)
if(set_name in part_sets)
for(var/v in files.known_designs)
var/datum/design/D = files.known_designs[v]
if(D.build_type & PODFAB)
if(set_name in D.category)
add_to_queue(D)
/obj/machinery/spod_part_fabricator/proc/add_to_queue(D)
if(!istype(queue))
queue = list()
if(D)
queue[++queue.len] = D
return queue.len
/obj/machinery/spod_part_fabricator/proc/remove_from_queue(index)
if(!isnum(index) || !istype(queue) || (index<1 || index>queue.len))
return 0
queue.Cut(index,++index)
return 1
/obj/machinery/spod_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 0
if(!check_resources(D))
visible_message("[bicon(src)] <b>\The [src]</b> beeps, \"Not enough resources. Queue processing stopped.\"")
temp = {"<span class='alert'>Not enough resources to build next part.</span><br>
<a href='?src=[UID()];process_queue=1'>Try again</a> | <a href='?src=[UID()];clear_temp=1'>Return</a><a>"}
return 0
remove_from_queue(1)
build_part(D)
D = listgetindex(queue, 1)
visible_message("[bicon(src)] <b>\The [src]</b> beeps, \"Queue processing finished successfully.\"")
/obj/machinery/spod_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]>[initial(part.name)] - [i>1?"<a href='?src=[UID()];queue_move=-1;index=[i]' class='arrow'>&uarr;</a>":null] [i<queue.len?"<a href='?src=[UID()];queue_move=+1;index=[i]' class='arrow'>&darr;</a>":null] <a href='?src=[UID()];remove_from_queue=[i]'>Remove</a></li>"
output += "</ol>"
output += "\[<a href='?src=[UID()];process_queue=1'>Process queue</a> | <a href='?src=[UID()];clear_queue=1'>Clear queue</a>\]"
return output
/obj/machinery/spod_part_fabricator/proc/update_tech()
if(!files)
return
var/output
for(var/v in files.known_tech)
var/datum/tech/T = files.known_tech[v]
if(T && T.level > 1)
var/diff
switch(T.id)
if("materials")
//one materials level is 1/32, so that max level is 0.75 coefficient
diff = round(initial(resource_coeff_tech) - (initial(resource_coeff_tech)*(T.level-1))/32,0.01)
if(resource_coeff_tech>diff)
resource_coeff_tech = diff
output+="Production efficiency increased.<br>"
if("programming")
//one materials level is 1/40, so that max level is 0.8 coefficient
diff = round(initial(time_coeff_tech) - (initial(time_coeff_tech)*(T.level-1))/40,0.1)
if(time_coeff_tech>diff)
time_coeff_tech = diff
output+="Production routines updated.<br>"
return output
/obj/machinery/spod_part_fabricator/proc/sync()
temp = "Updating local R&D database..."
updateUsrDialog()
sleep(30) //only sleep if called by user
var/area/localarea = get_area(src)
for(var/obj/machinery/computer/rdconsole/RDC in localarea.contents)
if(!RDC.sync)
continue
RDC.files.push_data(files)
temp = "Processed equipment designs.<br>"
//check if the tech coefficients have changed
temp += update_tech()
temp += "<a href='?src=[UID()];clear_temp=1'>Return</a>"
updateUsrDialog()
visible_message("[bicon(src)] <b>\The [src]</b> beeps, \"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=[UID()];clear_temp=1'>Return</a>"
updateUsrDialog()
return
/obj/machinery/spod_part_fabricator/proc/get_resource_cost_w_coeff(datum/design/D, resource, roundto = 1)
return round(D.materials[resource]*resource_coeff*resource_coeff_tech, roundto)
/obj/machinery/spod_part_fabricator/proc/get_construction_time_w_coeff(datum/design/D, roundto = 1) //aran
return round(initial(D.construction_time)*time_coeff*time_coeff_tech, roundto)
/obj/machinery/spod_part_fabricator/attack_hand(mob/user)
if(..())
return 1
return interact(user)
/obj/machinery/spod_part_fabricator/interact(mob/user as mob)
var/dat, left_part
if(..())
return
user.set_machine(src)
if(exit.density)
visible_message("[bicon(src)] <b>\The [src]</b> beeps, \"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>"}
else
switch(screen)
if("main")
left_part = output_available_resources()+"<hr>"
left_part += "<a href='?src=[UID()];sync=1'>Sync with R&D servers</a><hr>"
for(var/part_set in part_sets)
left_part += "<a href='?src=[UID()];part_set=[part_set]'>[part_set]</a> - \[<a href='?src=[UID()];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=[UID()];screen=main'>Return</a>"
dat = {"
<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>
<table style='width: 100%;'>
<tr>
<td style='width: 65%; padding-right: 10px;'>
[left_part]
</td>
<td style='width: 35%; background: #000;' id='queue'>
[list_queue()]
</td>
<tr>
</table>"}
var/datum/browser/popup = new(user, "mecha_fabricator", name, 1000, 430)
popup.set_content(dat)
popup.open(0)
onclose(user, "mecha_fabricator")
return
/obj/machinery/spod_part_fabricator/Topic(href, href_list)
if(..())
return
var/datum/topic_input/afilter = new /datum/topic_input(href,href_list)
if(href_list["part_set"])
var/tpart_set = afilter.getStr("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 = afilter.getStr("part")
var/datum/design/D = files.known_designs[T]
if(D && D.build_type & PODFAB)
if(!processing_queue)
build_part(D)
else
add_to_queue(D)
if(href_list["add_to_queue"])
var/T = afilter.getStr("add_to_queue")
var/datum/design/D = files.known_designs[T]
if(D && D.build_type & PODFAB)
add_to_queue(D)
return update_queue_on_page()
if(href_list["remove_from_queue"])
remove_from_queue(afilter.getNum("remove_from_queue"))
return update_queue_on_page()
if(href_list["partset_to_queue"])
add_part_set_to_queue(afilter.get("partset_to_queue"))
return update_queue_on_page()
if(href_list["process_queue"])
spawn(-1)
if(processing_queue || being_built)
return 0
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 = afilter.getNum("index")
var/new_index = index + afilter.getNum("queue_move")
if(isnum(index) && isnum(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 = afilter.getStr("part_desc")
var/datum/design/D = files.known_designs[T]
if(D && D.build_type & PODFAB)
var/obj/part = D.build_path
temp = {"<h1>[initial(part.name)] description:</h1>
[initial(part.desc)]<br>
<a href='?src=[UID()];clear_temp=1'>Return</a>
"}
if(href_list["remove_mat"] && href_list["material"])
var/amount = text2num(href_list["remove_mat"])
var/material = href_list["material"]
if(href_list["custom_eject"])
amount = input("How many sheets would you like to eject from the machine?", "How much?", 1) as null|num
amount = max(0,min(round(resources[material]/MINERAL_MATERIAL_AMOUNT),amount)) // Rounding errors aren't scary, as the mineral eject proc is smart
if(!amount)
return
amount = round(amount)
if(amount < 0 || amount > resources[material]) //href protection
return
var/removed = remove_material(material,amount)
if(removed == -1)
temp = "Not enough [material2name(material)] to produce a sheet."
else
temp = "Ejected [removed] of [material2name(material)]"
temp += "<br><a href='?src=[UID()];clear_temp=1'>Return</a>"
updateUsrDialog()
return
/obj/machinery/spod_part_fabricator/proc/remove_material(var/mat_string, var/amount)
if(resources[mat_string] < MINERAL_MATERIAL_AMOUNT) //not enough mineral for a sheet
return -1
var/type
switch(mat_string)
if(MAT_METAL)
type = /obj/item/stack/sheet/metal
if(MAT_GLASS)
type = /obj/item/stack/sheet/glass
if(MAT_GOLD)
type = /obj/item/stack/sheet/mineral/gold
if(MAT_SILVER)
type = /obj/item/stack/sheet/mineral/silver
if(MAT_DIAMOND)
type = /obj/item/stack/sheet/mineral/diamond
if(MAT_PLASMA)
type = /obj/item/stack/sheet/mineral/plasma
if(MAT_URANIUM)
type = /obj/item/stack/sheet/mineral/uranium
if(MAT_BANANIUM)
type = /obj/item/stack/sheet/mineral/bananium
else
return 0
var/result = 0
while(amount > 50)
new type(get_turf(src),50)
amount -= 50
result += 50
resources[mat_string] -= 50 * MINERAL_MATERIAL_AMOUNT
var/total_amount = round(resources[mat_string]/MINERAL_MATERIAL_AMOUNT)
if(total_amount)//if there's still enough material for sheets
var/obj/item/stack/sheet/res = new type(get_turf(src),min(amount,total_amount))
resources[mat_string] -= res.amount*MINERAL_MATERIAL_AMOUNT
result += res.amount
return result
/obj/machinery/spod_part_fabricator/attackby(obj/W as obj, mob/user as mob, params)
if(default_deconstruction_screwdriver(user, "fab-o", "fab-idle", W))
return
if(exchange_parts(user, W))
return
if(panel_open)
if(istype(W, /obj/item/crowbar))
for(var/material in resources)
remove_material(material, resources[material]/MINERAL_MATERIAL_AMOUNT)
default_deconstruction_crowbar(W)
return 1
else
to_chat(user, "<span class='danger'>You can't load \the [name] while it's opened.</span>")
return 1
if(istype(W, /obj/item/stack))
var/material
switch(W.type)
if(/obj/item/stack/sheet/mineral/gold)
material = MAT_GOLD
if(/obj/item/stack/sheet/mineral/silver)
material = MAT_SILVER
if(/obj/item/stack/sheet/mineral/diamond)
material = MAT_DIAMOND
if(/obj/item/stack/sheet/mineral/plasma)
material = MAT_PLASMA
if(/obj/item/stack/sheet/metal)
material = MAT_METAL
if(/obj/item/stack/sheet/glass)
material = MAT_GLASS
if(/obj/item/stack/sheet/mineral/bananium)
material = MAT_BANANIUM
if(/obj/item/stack/sheet/mineral/uranium)
material = MAT_URANIUM
else
return ..()
if(being_built)
to_chat(user, "\The [src] is currently processing. Please wait until completion.")
return
if(res_max_amount - resources[material] < MINERAL_MATERIAL_AMOUNT) //overstuffing the fabricator
to_chat(user, "\The [src] [material2name(material)] storage is full.")
return
var/obj/item/stack/sheet/stack = W
var/sname = "[stack.name]"
if(resources[material] < res_max_amount)
overlays += "fab-load-[material2name(material)]"//loading animation is now an overlay based on material type. No more spontaneous conversion of all ores to metal. -vey
var/transfer_amount = min(stack.amount, round((res_max_amount - resources[material])/MINERAL_MATERIAL_AMOUNT,1))
resources[material] += transfer_amount * MINERAL_MATERIAL_AMOUNT
stack.use(transfer_amount)
to_chat(user, "You insert [transfer_amount] [sname] sheet\s into \the [src].")
sleep(10)
updateUsrDialog()
overlays -= "fab-load-[material2name(material)]" //No matter what the overlay shall still be deleted
else
to_chat(user, "\The [src] cannot hold any more [sname] sheet\s.")
return
/obj/machinery/spod_part_fabricator/proc/material2name(var/ID)
return copytext(ID,2)
+3
View File
@@ -5,6 +5,7 @@
icon = 'icons/obj/telescience.dmi'
icon_state = "bluespace_crystal"
w_class = WEIGHT_CLASS_TINY
materials = list(MAT_BLUESPACE = MINERAL_MATERIAL_AMOUNT)
origin_tech = "bluespace=6;materials=3"
points = 50
var/blink_range = 8 // The teleport range when crushed/thrown at someone.
@@ -45,6 +46,7 @@
name = "artificial bluespace crystal"
desc = "An artificially made bluespace crystal, it looks delicate."
origin_tech = "bluespace=3;plasmatech=4"
materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT * 0.5)
blink_range = 4 // Not as good as the organic stuff!
points = 0 // nice try
refined_type = null
@@ -59,6 +61,7 @@ var/global/list/datum/stack_recipe/bluespace_crystal_recipes = list(new/datum/st
icon_state = "polycrystal"
desc = "A stable polycrystal, made of fused-together bluespace crystals. You could probably break one off."
origin_tech = "bluespace=6;materials=3"
materials = list(MAT_BLUESPACE = MINERAL_MATERIAL_AMOUNT)
attack_verb = list("bluespace polybashed", "bluespace polybattered", "bluespace polybludgeoned", "bluespace polythrashed", "bluespace polysmashed")
toolspeed = 1
usesound = 'sound/items/Deconstruct.ogg'