Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robot parts now have a material (so you can reclaim them) #17338

Merged
merged 11 commits into from
Jan 24, 2024
1 change: 1 addition & 0 deletions _std/__std.dme
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
#include "defines\lighting.dm"
#include "defines\living.dm"
#include "defines\logging.dm"
#include "defines\manufacturing.dm"
#include "defines\materials.dm"
#include "defines\mechanics.dm"
#include "defines\medals.dm"
Expand Down
15 changes: 15 additions & 0 deletions _std/defines/manufacturing.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Material costs for robot parts

#define ROBOT_FRAME_COST 1.8
#define ROBOT_HEAD_COST 1.2
#define ROBOT_CHEST_COST 1.2
#define ROBOT_LIMB_COST 0.6

#define ROBOT_LIGHT_COST_MOD 0.5 // multiplier

#define ROBOT_STURDY_COST 0.2 // 2 pieces of plate
#define ROBOT_HEAVY_COST ROBOT_STURDY_COST + 0.3 // extra 2 pieces of plate and 2 rods

#define ROBOT_TREAD_METAL_COST 0.6
#define ROBOT_SCREEN_METAL_COST 0.6
#define ROBOT_THRUSTER_COST 2.5
54 changes: 36 additions & 18 deletions code/datums/manufacturing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1352,159 +1352,176 @@ ABSTRACT_TYPE(/datum/manufacture)
/datum/manufacture/robo_frame
name = "Cyborg Frame"
item_paths = list("MET-2")
item_amounts = list(18)
item_amounts = list(ROBOT_FRAME_COST * 10)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these all * 10? Why not just have the defines be 10x larger?

Copy link
Contributor Author

@Valtsu0 Valtsu0 Jan 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manufacturing for some reason has the values as 10 times larger as the material value used in the item.
if i had the defines 10 times larger, i would have to do:
material_amt = ROBOT_FRAME_COST / 10

For example in order for sheet to cost 0.1 metal it has to have 1 in the recipe and in order to be reclaimed for the same amount it has to have a material amount of 0.1

item_outputs = list(/obj/item/parts/robot_parts/robot_frame)
time = 45 SECONDS
create = 1
category = "Component"
apply_material = 1

/datum/manufacture/full_cyborg_standard
name = "Standard Cyborg Parts"
item_paths = list("MET-2")
item_amounts = list(48)
item_amounts = list((ROBOT_CHEST_COST + ROBOT_HEAD_COST + ROBOT_LIMB_COST * 4) * 10)
item_outputs = list(/obj/item/parts/robot_parts/chest/standard,/obj/item/parts/robot_parts/head/standard,
/obj/item/parts/robot_parts/arm/right/standard,/obj/item/parts/robot_parts/arm/left/standard,
/obj/item/parts/robot_parts/leg/right/standard,/obj/item/parts/robot_parts/leg/left/standard)
time = 120 SECONDS
create = 1
category = "Component"
apply_material = 1

/datum/manufacture/full_cyborg_light
name = "Light Cyborg Parts"
item_paths = list("MET-2")
item_amounts = list(24)
item_amounts = list((ROBOT_CHEST_COST + ROBOT_HEAD_COST + ROBOT_LIMB_COST * 4) * ROBOT_LIGHT_COST_MOD * 10)
item_outputs = list(/obj/item/parts/robot_parts/chest/light,/obj/item/parts/robot_parts/head/light,
/obj/item/parts/robot_parts/arm/right/light,/obj/item/parts/robot_parts/arm/left/light,
/obj/item/parts/robot_parts/leg/right/light,/obj/item/parts/robot_parts/leg/left/light)
time = 62 SECONDS
create = 1
category = "Component"
apply_material = 1

/datum/manufacture/robo_chest
name = "Cyborg Chest"
item_paths = list("MET-2")
item_amounts = list(12)
item_amounts = list(ROBOT_CHEST_COST * 10)
item_outputs = list(/obj/item/parts/robot_parts/chest/standard)
time = 30 SECONDS
create = 1
category = "Component"
apply_material = 1

/datum/manufacture/robo_chest_light
name = "Light Cyborg Chest"
item_paths = list("MET-2")
item_amounts = list(6)
item_amounts = list(ROBOT_CHEST_COST * ROBOT_LIGHT_COST_MOD * 10)
item_outputs = list(/obj/item/parts/robot_parts/chest/light)
time = 15 SECONDS
create = 1
category = "Component"
apply_material = 1

/datum/manufacture/robo_head
name = "Cyborg Head"
item_paths = list("MET-2")
item_amounts = list(12)
item_amounts = list(ROBOT_HEAD_COST * 10)
item_outputs = list(/obj/item/parts/robot_parts/head/standard)
time = 30 SECONDS
create = 1
category = "Component"
apply_material = 1

/datum/manufacture/robo_head_screen
name = "Cyborg Screen Head"
item_paths = list("MET-2","CON-1","CRY-1")
item_amounts = list(6,2,6)
item_amounts = list(ROBOT_SCREEN_METAL_COST * 10,2,6)
item_outputs = list(/obj/item/parts/robot_parts/head/screen)
time = 24 SECONDS
create = 1
category = "Component"
apply_material = 1

/datum/manufacture/robo_head_light
name = "Light Cyborg Head"
item_paths = list("MET-1")
item_amounts = list(6)
item_amounts = list(ROBOT_HEAD_COST * ROBOT_LIGHT_COST_MOD * 10)
item_outputs = list(/obj/item/parts/robot_parts/head/light)
time = 15 SECONDS
create = 1
category = "Component"
apply_material = 1

/datum/manufacture/robo_arm_r
name = "Cyborg Arm (Right)"
item_paths = list("MET-2")
item_amounts = list(6)
item_amounts = list(ROBOT_LIMB_COST * 10)
item_outputs = list(/obj/item/parts/robot_parts/arm/right/standard)
time = 15 SECONDS
create = 1
category = "Component"
apply_material = 1

/datum/manufacture/robo_arm_r_light
name = "Light Cyborg Arm (Right)"
item_paths = list("MET-1")
item_amounts = list(3)
item_amounts = list(ROBOT_LIMB_COST * ROBOT_LIGHT_COST_MOD * 10)
item_outputs = list(/obj/item/parts/robot_parts/arm/right/light)
time = 8 SECONDS
create = 1
category = "Component"
apply_material = 1

/datum/manufacture/robo_arm_l
name = "Cyborg Arm (Left)"
item_paths = list("MET-2")
item_amounts = list(6)
item_amounts = list(ROBOT_LIMB_COST * 10)
item_outputs = list(/obj/item/parts/robot_parts/arm/left/standard)
time = 15 SECONDS
create = 1
category = "Component"
apply_material = 1

/datum/manufacture/robo_arm_l_light
name = "Light Cyborg Arm (Left)"
item_paths = list("MET-1")
item_amounts = list(3)
item_amounts = list(ROBOT_LIMB_COST * ROBOT_LIGHT_COST_MOD * 10)
item_outputs = list(/obj/item/parts/robot_parts/arm/left/light)
time = 8 SECONDS
create = 1
category = "Component"
apply_material = 1

/datum/manufacture/robo_leg_r
name = "Cyborg Leg (Right)"
item_paths = list("MET-2")
item_amounts = list(6)
item_amounts = list(ROBOT_LIMB_COST * 10)
item_outputs = list(/obj/item/parts/robot_parts/leg/right/standard)
time = 15 SECONDS
create = 1
category = "Component"
apply_material = 1

/datum/manufacture/robo_leg_r_light
name = "Light Cyborg Leg (Right)"
item_paths = list("MET-1")
item_amounts = list(3)
item_amounts = list(ROBOT_LIMB_COST * ROBOT_LIGHT_COST_MOD * 10)
item_outputs = list(/obj/item/parts/robot_parts/leg/right/light)
time = 8 SECONDS
create = 1
category = "Component"
apply_material = 1

/datum/manufacture/robo_leg_l
name = "Cyborg Leg (Left)"
item_paths = list("MET-2")
item_amounts = list(6)
item_amounts = list(ROBOT_LIMB_COST * 10)
item_outputs = list(/obj/item/parts/robot_parts/leg/left/standard)
time = 15 SECONDS
create = 1
category = "Component"
apply_material = 1

/datum/manufacture/robo_leg_l_light
name = "Light Cyborg Leg (Left)"
item_paths = list("MET-1")
item_amounts = list(3)
item_amounts = list(ROBOT_LIMB_COST * ROBOT_LIGHT_COST_MOD * 10)
item_outputs = list(/obj/item/parts/robot_parts/leg/left/light)
time = 8 SECONDS
create = 1
category = "Component"
apply_material = 1

/datum/manufacture/robo_leg_treads
name = "Cyborg Treads"
item_paths = list("MET-2","CON-1")
item_amounts = list(12,6)
item_amounts = list(ROBOT_TREAD_METAL_COST * 2 * 10,6)
item_outputs = list(/obj/item/parts/robot_parts/leg/left/treads, /obj/item/parts/robot_parts/leg/right/treads)
time = 15 SECONDS
create = 1
category = "Component"
apply_material = 1

/datum/manufacture/robo_module
name = "Blank Cyborg Module"
Expand Down Expand Up @@ -1881,11 +1898,12 @@ ABSTRACT_TYPE(/datum/manufacture)
/datum/manufacture/thrusters
name = "Alastor Pattern Thrusters"
item_paths = list("MET-2")
item_amounts = list(50)
item_amounts = list(ROBOT_THRUSTER_COST * 2 * 10)
item_outputs = list(/obj/item/parts/robot_parts/leg/right/thruster,/obj/item/parts/robot_parts/leg/left/thruster)
time = 120 SECONDS
create = 1
category = "Component"
apply_material = 1

/******************** Science **************************/

Expand Down
4 changes: 4 additions & 0 deletions code/mob/living/silicon/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
var/total_weight = 0
var/datum/robot_cosmetic/cosmetic_mods = null

var/datum/material/frame_material

var/list/obj/clothes = list()

var/next_cache = 0
Expand Down Expand Up @@ -115,6 +117,7 @@
APPLY_MOVEMENT_MODIFIER(src, /datum/movement_modifier/robot_base, "robot_health_slow_immunity")
if (frame)
src.freemodule = frame.freemodule
src.frame_material = frame.material
if (starter && !(src.dependent || src.shell))
var/obj/item/parts/robot_parts/chest/light/PC = new /obj/item/parts/robot_parts/chest/light(src)
var/obj/item/cell/supercell/charged/CELL = new /obj/item/cell/supercell/charged(PC)
Expand Down Expand Up @@ -283,6 +286,7 @@
chest.cell = src.cell

var/obj/item/parts/robot_parts/robot_frame/frame = new(T)
frame.setMaterial(src.frame_material)
frame.emagged = src.emagged
frame.syndicate = src.syndicate
frame.freemodule = src.freemodule
Expand Down