From 83df0fa8f8b475dfd615159ad27cab700e518e3b Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 11 Jul 2015 23:51:39 -0400 Subject: [PATCH 1/3] Makes powercells produced by the protolathe start uncharged. --- code/modules/research/circuitprinter.dm | 2 +- code/modules/research/designs.dm | 10 ++++++++++ code/modules/research/protolathe.dm | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index 49575cd3f74..f50af33481c 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -195,7 +195,7 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid). reagents.remove_reagent(C, D.chemicals[C] * mat_efficiency) if(D.build_path) - var/obj/new_item = new D.build_path(src) + var/obj/new_item = D.Fabricate(src) new_item.loc = loc if(mat_efficiency != 1) // No matter out of nowhere if(new_item.matter && new_item.matter.len > 0) diff --git a/code/modules/research/designs.dm b/code/modules/research/designs.dm index ce5fb4670bd..a85788d1616 100644 --- a/code/modules/research/designs.dm +++ b/code/modules/research/designs.dm @@ -55,6 +55,11 @@ other types of metals and chemistry for reagents). desc = "Allows for the construction of \a [item_name]." return +//Returns a new instance of the item for this design +//This is to allow additional initialization to be performed, including possibly additional contructor arguments. +/datum/design/proc/Fabricate(var/newloc) + return new build_path(newloc) + /datum/design/item build_type = PROTOLATHE @@ -212,6 +217,11 @@ other types of metals and chemistry for reagents). var/obj/item/weapon/cell/C = build_path desc = "Allows the construction of power cells that can hold [initial(C.maxcharge)] units of energy." +/datum/design/item/powercell/Fabricate() + var/obj/item/weapon/cell/C = ..() + C.charge = 0 //shouldn't produce power out of thin air. + return C + /datum/design/item/powercell/basic name = "basic" build_type = PROTOLATHE | MECHFAB diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index 9cb029f58ef..843e7f6dd5a 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -196,7 +196,7 @@ reagents.remove_reagent(C, D.chemicals[C] * mat_efficiency) if(D.build_path) - var/obj/new_item = new D.build_path(src) + var/obj/new_item = D.Fabricate(src) new_item.loc = loc if(mat_efficiency != 1) // No matter out of nowhere if(new_item.matter && new_item.matter.len > 0) From 38775120d73e7252c77b7e8997dda700880c3b95 Mon Sep 17 00:00:00 2001 From: HarpyEagle Date: Thu, 8 Oct 2015 16:03:32 -0400 Subject: [PATCH 2/3] Updates mechfab Robolimb manufacturers are now handled specifically instead of assuming all items follow the same constructor parameter rules. --- code/game/mecha/mech_fabricator.dm | 6 +-- code/modules/research/circuitprinter.dm | 2 +- code/modules/research/designs.dm | 56 ++++++++++++------------ code/modules/research/mechfab_designs.dm | 7 +++ code/modules/research/protolathe.dm | 2 +- 5 files changed, 40 insertions(+), 33 deletions(-) diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 7fc5f17e86d..0685e6efd20 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -144,7 +144,7 @@ sync() else sync_message = "" - + return 1 /obj/machinery/mecha_part_fabricator/attackby(var/obj/item/I, var/mob/user) @@ -155,7 +155,7 @@ return if(default_deconstruction_crowbar(user, I)) return - if(default_part_replacement(user, I)) + if(default_part_replacement(user, I)) return var/material @@ -254,7 +254,7 @@ for(var/M in D.materials) materials[M] = max(0, materials[M] - D.materials[M] * mat_efficiency) if(D.build_path) - var/obj/new_item = new D.build_path(loc, manufacturer) + var/obj/new_item = D.Fabricate(loc, src) visible_message("\The [src] pings, indicating that \the [D] is complete.", "You hear a ping.") if(mat_efficiency != 1) if(new_item.matter && new_item.matter.len > 0) diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index f50af33481c..dd796d7147b 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -195,7 +195,7 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid). reagents.remove_reagent(C, D.chemicals[C] * mat_efficiency) if(D.build_path) - var/obj/new_item = D.Fabricate(src) + var/obj/new_item = D.Fabricate(src, src) new_item.loc = loc if(mat_efficiency != 1) // No matter out of nowhere if(new_item.matter && new_item.matter.len > 0) diff --git a/code/modules/research/designs.dm b/code/modules/research/designs.dm index a85788d1616..98eb37bebd4 100644 --- a/code/modules/research/designs.dm +++ b/code/modules/research/designs.dm @@ -57,7 +57,7 @@ other types of metals and chemistry for reagents). //Returns a new instance of the item for this design //This is to allow additional initialization to be performed, including possibly additional contructor arguments. -/datum/design/proc/Fabricate(var/newloc) +/datum/design/proc/Fabricate(var/newloc, var/fabricator) return new build_path(newloc) /datum/design/item @@ -200,9 +200,9 @@ other types of metals and chemistry for reagents). /datum/design/item/stock_part/RPED name = "Rapid Part Exchange Device" desc = "Special mechanical module made to store, sort, and apply standard machine parts." - id = "rped" + id = "rped" req_tech = list(TECH_ENGINEERING = 3, TECH_MATERIAL = 3) - materials = list(DEFAULT_WALL_MATERIAL = 15000, "glass" = 5000) + materials = list(DEFAULT_WALL_MATERIAL = 15000, "glass" = 5000) build_path = /obj/item/weapon/storage/part_replacer sort_string = "CBAAA" @@ -287,9 +287,9 @@ other types of metals and chemistry for reagents). /datum/design/item/mesons name = "Optical meson scanners design" desc = "Using the meson-scanning technology those glasses allow you to see through walls, floor or anything else." - id = "mesons" + id = "mesons" req_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) - materials = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) + materials = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) build_path = /obj/item/clothing/glasses/meson sort_string = "GAAAC" @@ -298,23 +298,23 @@ other types of metals and chemistry for reagents). name = "Mining equipment design ([item_name])" /datum/design/item/weapon/mining/jackhammer - id = "jackhammer" + id = "jackhammer" req_tech = list(TECH_MATERIAL = 3, TECH_POWER = 2, TECH_ENGINEERING = 2) - materials = list(DEFAULT_WALL_MATERIAL = 2000, "glass" = 500, "silver" = 500) + materials = list(DEFAULT_WALL_MATERIAL = 2000, "glass" = 500, "silver" = 500) build_path = /obj/item/weapon/pickaxe/jackhammer sort_string = "KAAAA" /datum/design/item/weapon/mining/drill - id = "drill" + id = "drill" req_tech = list(TECH_MATERIAL = 2, TECH_POWER = 3, TECH_ENGINEERING = 2) - materials = list(DEFAULT_WALL_MATERIAL = 6000, "glass" = 1000) //expensive, but no need for miners. + materials = list(DEFAULT_WALL_MATERIAL = 6000, "glass" = 1000) //expensive, but no need for miners. build_path = /obj/item/weapon/pickaxe/drill sort_string = "KAAAB" /datum/design/item/weapon/mining/plasmacutter - id = "plasmacutter" + id = "plasmacutter" req_tech = list(TECH_MATERIAL = 4, TECH_PHORON = 3, TECH_ENGINEERING = 3) - materials = list(DEFAULT_WALL_MATERIAL = 1500, "glass" = 500, "gold" = 500, "phoron" = 500) + materials = list(DEFAULT_WALL_MATERIAL = 1500, "glass" = 500, "gold" = 500, "phoron" = 500) build_path = /obj/item/weapon/pickaxe/plasmacutter sort_string = "KAAAC" @@ -326,9 +326,9 @@ other types of metals and chemistry for reagents). sort_string = "KAAAD" /datum/design/item/weapon/mining/drill_diamond - id = "drill_diamond" + id = "drill_diamond" req_tech = list(TECH_MATERIAL = 6, TECH_POWER = 4, TECH_ENGINEERING = 4) - materials = list(DEFAULT_WALL_MATERIAL = 3000, "glass" = 1000, "diamond" = 2000) + materials = list(DEFAULT_WALL_MATERIAL = 3000, "glass" = 1000, "diamond" = 2000) build_path = /obj/item/weapon/pickaxe/diamonddrill sort_string = "KAAAE" /////////////////////////////////// @@ -347,9 +347,9 @@ other types of metals and chemistry for reagents). /datum/design/item/medical/robot_scanner desc = "A hand-held scanner able to diagnose robotic injuries." - id = "robot_scanner" + id = "robot_scanner" req_tech = list(TECH_MAGNET = 3, TECH_BIO = 2, TECH_ENGINEERING = 3) - materials = list(DEFAULT_WALL_MATERIAL = 500, "glass" = 200) + materials = list(DEFAULT_WALL_MATERIAL = 500, "glass" = 200) build_path = /obj/item/device/robotanalyzer sort_string = "MACFA" @@ -404,9 +404,9 @@ other types of metals and chemistry for reagents). /datum/design/item/medical/nanopaste desc = "A tube of paste containing swarms of repair nanites. Very effective in repairing robotic machinery." - id = "nanopaste" + id = "nanopaste" req_tech = list(TECH_MATERIAL = 4, TECH_ENGINEERING = 3) - materials = list(DEFAULT_WALL_MATERIAL = 7000, "glass" = 7000) + materials = list(DEFAULT_WALL_MATERIAL = 7000, "glass" = 7000) build_path = /obj/item/stack/nanopaste sort_string = "MBAAA" @@ -538,16 +538,16 @@ other types of metals and chemistry for reagents). /datum/design/item/weapon/chemsprayer desc = "An advanced chem spraying device." - id = "chemsprayer" + id = "chemsprayer" req_tech = list(TECH_MATERIAL = 3, TECH_ENGINEERING = 3, TECH_BIO = 2) - materials = list(DEFAULT_WALL_MATERIAL = 5000, "glass" = 1000) + materials = list(DEFAULT_WALL_MATERIAL = 5000, "glass" = 1000) build_path = /obj/item/weapon/reagent_containers/spray/chemsprayer sort_string = "TABAA" /datum/design/item/weapon/rapidsyringe - id = "rapidsyringe" + id = "rapidsyringe" req_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 3, TECH_ENGINEERING = 3, TECH_BIO = 2) - materials = list(DEFAULT_WALL_MATERIAL = 5000, "glass" = 1000) + materials = list(DEFAULT_WALL_MATERIAL = 5000, "glass" = 1000) build_path = /obj/item/weapon/gun/launcher/syringe/rapid sort_string = "TABAB" @@ -650,10 +650,10 @@ other types of metals and chemistry for reagents). /datum/design/item/posibrain name = "Positronic brain" - id = "posibrain" + id = "posibrain" req_tech = list(TECH_ENGINEERING = 4, TECH_MATERIAL = 6, TECH_BLUESPACE = 2, TECH_DATA = 4) build_type = PROTOLATHE | MECHFAB - materials = list(DEFAULT_WALL_MATERIAL = 2000, "glass" = 1000, "silver" = 1000, "gold" = 500, "phoron" = 500, "diamond" = 100) + materials = list(DEFAULT_WALL_MATERIAL = 2000, "glass" = 1000, "silver" = 1000, "gold" = 500, "phoron" = 500, "diamond" = 100) build_path = /obj/item/device/mmi/digital/posibrain category = "Misc" sort_string = "VACAB" @@ -1364,16 +1364,16 @@ CIRCUITS BELOW /datum/design/item/pda name = "PDA design" desc = "Cheaper than whiny non-digital assistants." - id = "pda" + id = "pda" req_tech = list(TECH_ENGINEERING = 2, TECH_POWER = 3) - materials = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) + materials = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) build_path = /obj/item/device/pda sort_string = "VAAAA" // Cartridges -/datum/design/item/pda_cartridge +/datum/design/item/pda_cartridge req_tech = list(TECH_ENGINEERING = 2, TECH_POWER = 3) - materials = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) + materials = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) /datum/design/item/pda_cartridge/AssembleDesignName() ..() @@ -1453,7 +1453,7 @@ CIRCUITS BELOW id = "cart_captain" build_path = /obj/item/weapon/cartridge/captain sort_string = "VBAAO" - + /* Uncomment if someone makes these buildable /datum/design/circuit/general_alert name = "general alert console" diff --git a/code/modules/research/mechfab_designs.dm b/code/modules/research/mechfab_designs.dm index cfdce572b11..e83774468c5 100644 --- a/code/modules/research/mechfab_designs.dm +++ b/code/modules/research/mechfab_designs.dm @@ -6,6 +6,13 @@ /datum/design/item/mechfab/robot category = "Robot" +//if the fabricator is a mech fab pass the manufacturer info over to the robot part constructor +/datum/design/item/mechfab/robot/Fabricate(var/newloc, var/fabricator) + if(istype(fabricator, /obj/machinery/mecha_part_fabricator)) + var/obj/machinery/mecha_part_fabricator/mechfab = fabricator + return new build_path(newloc, mechfab.manufacturer) + return ..() + /datum/design/item/mechfab/robot/exoskeleton name = "Robot exoskeleton" id = "robot_exoskeleton" diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index 843e7f6dd5a..c91a22d89f5 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -196,7 +196,7 @@ reagents.remove_reagent(C, D.chemicals[C] * mat_efficiency) if(D.build_path) - var/obj/new_item = D.Fabricate(src) + var/obj/new_item = D.Fabricate(src, src) new_item.loc = loc if(mat_efficiency != 1) // No matter out of nowhere if(new_item.matter && new_item.matter.len > 0) From b9feb805c12472deea46d9d6e36fea38f03e1d05 Mon Sep 17 00:00:00 2001 From: HarpyEagle Date: Thu, 8 Oct 2015 16:11:17 -0400 Subject: [PATCH 3/3] Adds changelog --- html/changelogs/HarpyEagle-dev-freeze.yml | 3 --- html/changelogs/HarpyEagle-dev.yml | 3 --- .../changelogs/HarpyEagle-powercellsanity.yml | 27 +++++++++++++++++++ 3 files changed, 27 insertions(+), 6 deletions(-) delete mode 100644 html/changelogs/HarpyEagle-dev-freeze.yml delete mode 100644 html/changelogs/HarpyEagle-dev.yml create mode 100644 html/changelogs/HarpyEagle-powercellsanity.yml diff --git a/html/changelogs/HarpyEagle-dev-freeze.yml b/html/changelogs/HarpyEagle-dev-freeze.yml deleted file mode 100644 index a999f1236dc..00000000000 --- a/html/changelogs/HarpyEagle-dev-freeze.yml +++ /dev/null @@ -1,3 +0,0 @@ -author: HarpyEagle -changes: [] -delete-after: false diff --git a/html/changelogs/HarpyEagle-dev.yml b/html/changelogs/HarpyEagle-dev.yml deleted file mode 100644 index a999f1236dc..00000000000 --- a/html/changelogs/HarpyEagle-dev.yml +++ /dev/null @@ -1,3 +0,0 @@ -author: HarpyEagle -changes: [] -delete-after: false diff --git a/html/changelogs/HarpyEagle-powercellsanity.yml b/html/changelogs/HarpyEagle-powercellsanity.yml new file mode 100644 index 00000000000..fba91c796d2 --- /dev/null +++ b/html/changelogs/HarpyEagle-powercellsanity.yml @@ -0,0 +1,27 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +author: HarpyEagle +changes: + - tweak: "Fabricated power cells start uncharged." +delete-after: true