mirror of
https://github.com/Yawn-Wider/YWPolarisVore.git
synced 2026-07-20 12:33:59 +01:00
7c8bb85de3
* Update settings * Whitespace changes * Comment out merger hooks in gitattributes Corrupt maps would have to be resolved in repo before hooks could be updated * Revert "Whitespace changes" This reverts commit afbdd1d8442973f5d570c30920d9d865b5acd479. * Whitespace again minus example * Gitignore example changelog * Restore changelog merge setting * Keep older dmi hook attribute until hooks can be updated * update vscode settings too * Renormalize remaining * Revert "Gitignore example changelog" This reverts commit de22ad375d3ee4d5930c550da2fd23a29a86e616. * Attempt to normalize example.yml (and another file I guess) * Try again
43 lines
1.4 KiB
Plaintext
43 lines
1.4 KiB
Plaintext
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
|
|
|
|
//All devices that link into the R&D console fall into thise type for easy identification and some shared procs.
|
|
|
|
/obj/machinery/r_n_d
|
|
name = "R&D Device"
|
|
icon = 'icons/obj/machines/research.dmi'
|
|
density = TRUE
|
|
anchored = TRUE
|
|
use_power = USE_POWER_IDLE
|
|
var/busy = 0
|
|
var/obj/machinery/computer/rdconsole/linked_console
|
|
|
|
var/list/materials = list() // Materials this machine can accept.
|
|
var/list/hidden_materials = list() // Materials this machine will not display, unless it contains them. Must be in the materials list as well.
|
|
|
|
/obj/machinery/r_n_d/attack_hand(mob/user as mob)
|
|
return
|
|
|
|
/obj/machinery/r_n_d/proc/getMaterialType(var/name)
|
|
var/datum/material/M = get_material_by_name(name)
|
|
if(M && M.stack_type)
|
|
return M.stack_type
|
|
return null
|
|
|
|
/obj/machinery/r_n_d/proc/getMaterialName(var/type)
|
|
if(istype(type, /obj/item/stack/material))
|
|
var/obj/item/stack/material/M = type
|
|
return M.material.name
|
|
return null
|
|
|
|
/obj/machinery/r_n_d/proc/eject(var/material, var/amount)
|
|
if(!(material in materials))
|
|
return
|
|
var/obj/item/stack/material/sheetType = getMaterialType(material)
|
|
var/perUnit = initial(sheetType.perunit)
|
|
var/eject = round(materials[material] / perUnit)
|
|
eject = amount == -1 ? eject : min(eject, amount)
|
|
if(eject < 1)
|
|
return
|
|
new sheetType(loc, eject)
|
|
materials[material] -= eject * perUnit
|