Add simple RCD Circuits

Port : https://github.com/tgstation/tgstation/pull/45357
This commit is contained in:
r4d6
2020-01-03 02:32:43 -05:00
parent 15d79d8818
commit 5c94e02eac
8 changed files with 127 additions and 13 deletions

View File

@@ -110,4 +110,7 @@
#define RCD_DECONSTRUCT 3
#define RCD_WINDOWGRILLE 4
#define RCD_MACHINE 8
#define RCD_COMPUTER 16
#define RCD_COMPUTER 16
#define RCD_UPGRADE_FRAMES 1
#define RCD_UPGRADE_SIMPLE_CIRCUITS 2

View File

@@ -450,6 +450,21 @@
return
return ..()
/obj/structure/firelock_frame/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
if((constructionStep == CONSTRUCTION_NOCIRCUIT) && (the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS))
return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 20, "cost" = 1)
return FALSE
/obj/structure/firelock_frame/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
switch(passed_mode)
if(RCD_UPGRADE_SIMPLE_CIRCUITS)
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
"<span class='notice'>You adapt a firelock circuit and slot it into the assembly.</span>")
constructionStep = CONSTRUCTION_GUTTED
update_icon()
return TRUE
return FALSE
/obj/structure/firelock_frame/heavy
name = "heavy firelock frame"
reinforced = TRUE

View File

@@ -256,6 +256,20 @@
return
return ..()
/obj/machinery/firealarm/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
if((buildstage == 0) && (the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS))
return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 20, "cost" = 1)
return FALSE
/obj/machinery/firealarm/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
switch(passed_mode)
if(RCD_UPGRADE_SIMPLE_CIRCUITS)
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
"<span class='notice'>You adapt a fire alarm circuit and slot it into the assembly.</span>")
buildstage = 1
update_icon()
return TRUE
return FALSE
/obj/machinery/firealarm/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
. = ..()

View File

@@ -85,9 +85,11 @@ RLD
to_chat(user, "<span class='notice'>[src] now holds [matter]/[max_matter] matter-units.</span>")
else if(istype(W, /obj/item/rcd_upgrade))
to_chat(user, "<span class='notice'>You upgrade the RCD with the [W]!</span>")
upgrade = TRUE
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
qdel(W)
var/obj/item/rcd_upgrade/rcd_up = W
if(!(upgrade & rcd_up.upgrade))
upgrade |= rcd_up.upgrade
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
qdel(W)
else
return ..()
update_icon() //ensures that ammo counters (if present) get updated
@@ -116,10 +118,10 @@ RLD
if(matter < amount)
if(user)
to_chat(user, no_ammo_message)
return 0
return FALSE
matter -= amount
update_icon()
return 1
return TRUE
/obj/item/construction/proc/checkResource(amount, mob/user)
. = matter >= amount
@@ -471,7 +473,7 @@ RLD
"Grilles & Windows" = image(icon = 'icons/mob/radial.dmi', icon_state = "grillewindow"),
"Floors & Walls" = image(icon = 'icons/mob/radial.dmi', icon_state = "wallfloor")
)
if(upgrade)
if(upgrade & RCD_UPGRADE_FRAMES)
choices += list(
"Deconstruct" = image(icon= 'icons/mob/radial.dmi', icon_state = "delete"),
"Machine Frames" = image(icon = 'icons/mob/radial.dmi', icon_state = "machine"),
@@ -829,9 +831,18 @@ RLD
/obj/item/rcd_upgrade
name = "RCD advanced design disk"
desc = "It contains the design for machine frames, computer frames, and deconstruction."
desc = "It seems to be empty."
icon = 'icons/obj/module.dmi'
icon_state = "datadisk3"
var/upgrade
/obj/item/rcd_upgrade/frames
desc = "It contains the design for machine frames, computer frames and deconstruction."
upgrade = RCD_UPGRADE_FRAMES
/obj/item/rcd_upgrade/simple_circuits
desc = "It contains the design for firelock, air alarm, fire alarm, apc circuits and crap power cells."
upgrade = RCD_UPGRADE_SIMPLE_CIRCUITS
#undef GLOW_MODE
#undef LIGHT_MODE

View File

@@ -822,6 +822,21 @@
return ..()
/obj/machinery/airalarm/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
if((buildstage == 0) && (the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS))
return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 20, "cost" = 1)
return FALSE
/obj/machinery/airalarm/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
switch(passed_mode)
if(RCD_UPGRADE_SIMPLE_CIRCUITS)
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
"<span class='notice'>You adapt an air alarm circuit and slot it into the assembly.</span>")
buildstage = 1
update_icon()
return TRUE
return FALSE
/obj/machinery/airalarm/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, !issilicon(user)) || !isturf(loc))

View File

@@ -701,6 +701,52 @@
else
return ..()
/obj/machinery/power/apc/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
if(the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS)
if(!has_electronics)
if(stat & BROKEN)
to_chat(user, "<span class='warning'>[src]'s frame is too damaged to support a circuit.</span>")
return FALSE
return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 20, "cost" = 1)
else if(!cell)
if(stat & MAINT)
to_chat(user, "<span class='warning'>There's no connector for a power cell.</span>")
return FALSE
return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 50, "cost" = 10) //16 for a wall
else
to_chat(user, "<span class='warning'>[src] has both electronics and a cell.</span>")
return FALSE
return FALSE
/obj/machinery/power/apc/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
switch(passed_mode)
if(RCD_UPGRADE_SIMPLE_CIRCUITS)
if(!has_electronics)
if(stat & BROKEN)
to_chat(user, "<span class='warning'>[src]'s frame is too damaged to support a circuit.</span>")
return
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
"<span class='notice'>You adapt a power control board and click it into place in [src]'s guts.</span>")
has_electronics = TRUE
locked = TRUE
return TRUE
else if(!cell)
if(stat & MAINT)
to_chat(user, "<span class='warning'>There's no connector for a power cell.</span>")
return FALSE
var/obj/item/stock_parts/cell/crap/empty/C = new(src)
C.forceMove(src)
cell = C
chargecount = 0
user.visible_message("<span class='notice'>[user] fabricates a weak power cell and places it into [src].</span>", \
"<span class='warning'>Your [the_rcd.name] whirrs with strain as you create a weak power cell and place it into [src]!</span>")
update_icon()
return TRUE
else
to_chat(user, "<span class='warning'>[src] has both electronics and a cell.</span>")
return FALSE
return FALSE
/obj/machinery/power/apc/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, !issilicon(user)) || !isturf(loc))

View File

@@ -379,13 +379,23 @@
////////////Tools//////////////
///////////////////////////////
/datum/design/rcd_upgrade
name = "Advanced RCD designs upgrade"
/datum/design/rcd_upgrade/frames
name = "RCD frames designs upgrade"
desc = "Adds the computer frame and machine frame to the RCD."
id = "rcd_upgrade"
id = "rcd_upgrade_frames"
build_type = PROTOLATHE
materials = list(MAT_METAL = 5000, MAT_GLASS = 2500, MAT_SILVER = 1500, MAT_TITANIUM = 2000)
build_path = /obj/item/rcd_upgrade
build_path = /obj/item/rcd_upgrade/frames
category = list("Tool Designs")
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING
/datum/design/rcd_upgrade/simple_circuits
name = "RCD simple circuits designs upgrade"
desc = "Adds the simple circuits to the RCD."
id = "rcd_upgrade_simple_circuits"
build_type = PROTOLATHE
materials = list(/datum/material/iron = 5000, /datum/material/glass = 2500, /datum/material/silver = 1500, /datum/material/titanium = 2000)
build_path = /obj/item/rcd_upgrade/simple_circuits
category = list("Equipment")
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING

View File

@@ -200,7 +200,7 @@
display_name = "Advanced Engineering"
description = "Pushing the boundaries of physics, one chainsaw-fist at a time."
prereq_ids = list("engineering", "emp_basic")
design_ids = list("engine_goggles", "magboots", "forcefield_projector", "weldingmask", "tray_goggles_prescription", "engine_goggles_prescription", "mesons_prescription", "rcd_upgrade")
design_ids = list("engine_goggles", "magboots", "forcefield_projector", "weldingmask", "tray_goggles_prescription", "engine_goggles_prescription", "mesons_prescription", "rcd_upgrade_frames", "rcd_upgrade_simple_circuits")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 4000)
export_price = 5000