Merge pull request #10416 from r4d6/RCD-Updates

Massive RCD Port & Updates
This commit is contained in:
kevinz000
2020-01-12 00:45:21 -08:00
committed by GitHub
12 changed files with 530 additions and 342 deletions
+4 -1
View File
@@ -110,4 +110,7 @@
#define RCD_DECONSTRUCT 3 #define RCD_DECONSTRUCT 3
#define RCD_WINDOWGRILLE 4 #define RCD_WINDOWGRILLE 4
#define RCD_MACHINE 8 #define RCD_MACHINE 8
#define RCD_COMPUTER 16 #define RCD_COMPUTER 16
#define RCD_UPGRADE_FRAMES 1
#define RCD_UPGRADE_SIMPLE_CIRCUITS 2
+3
View File
@@ -1408,6 +1408,9 @@
/obj/machinery/door/airlock/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd) /obj/machinery/door/airlock/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
switch(the_rcd.mode) switch(the_rcd.mode)
if(RCD_DECONSTRUCT) if(RCD_DECONSTRUCT)
if(security_level != AIRLOCK_SECURITY_NONE && the_rcd.canRturf != TRUE)
to_chat(user, "<span class='notice'>[src]'s reinforcement needs to be removed first.</span>")
return FALSE
return list("mode" = RCD_DECONSTRUCT, "delay" = 50, "cost" = 32) return list("mode" = RCD_DECONSTRUCT, "delay" = 50, "cost" = 32)
return FALSE return FALSE
+15
View File
@@ -450,6 +450,21 @@
return return
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 /obj/structure/firelock_frame/heavy
name = "heavy firelock frame" name = "heavy firelock frame"
reinforced = TRUE reinforced = TRUE
+340 -325
View File
@@ -1,325 +1,340 @@
#define FIREALARM_COOLDOWN 67 // Chosen fairly arbitrarily, it is the length of the audio in FireAlarm.ogg. The actual track length is 7 seconds 8ms but but the audio stops at 6s 700ms #define FIREALARM_COOLDOWN 67 // Chosen fairly arbitrarily, it is the length of the audio in FireAlarm.ogg. The actual track length is 7 seconds 8ms but but the audio stops at 6s 700ms
/obj/item/electronics/firealarm /obj/item/electronics/firealarm
name = "fire alarm electronics" name = "fire alarm electronics"
desc = "A fire alarm circuit. Can handle heat levels up to 40 degrees celsius." desc = "A fire alarm circuit. Can handle heat levels up to 40 degrees celsius."
/obj/item/wallframe/firealarm /obj/item/wallframe/firealarm
name = "fire alarm frame" name = "fire alarm frame"
desc = "Used for building fire alarms." desc = "Used for building fire alarms."
icon = 'icons/obj/monitors.dmi' icon = 'icons/obj/monitors.dmi'
icon_state = "fire_bitem" icon_state = "fire_bitem"
result_path = /obj/machinery/firealarm result_path = /obj/machinery/firealarm
/obj/machinery/firealarm /obj/machinery/firealarm
name = "fire alarm" name = "fire alarm"
desc = "<i>\"Pull this in case of emergency\"</i>. Thus, keep pulling it forever." desc = "<i>\"Pull this in case of emergency\"</i>. Thus, keep pulling it forever."
icon = 'icons/obj/monitors.dmi' icon = 'icons/obj/monitors.dmi'
icon_state = "fire0" icon_state = "fire0"
max_integrity = 250 max_integrity = 250
integrity_failure = 100 integrity_failure = 100
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 90, "acid" = 30) armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 90, "acid" = 30)
use_power = IDLE_POWER_USE use_power = IDLE_POWER_USE
idle_power_usage = 2 idle_power_usage = 2
active_power_usage = 6 active_power_usage = 6
power_channel = ENVIRON power_channel = ENVIRON
resistance_flags = FIRE_PROOF resistance_flags = FIRE_PROOF
light_power = 0 light_power = 0
light_range = 7 light_range = 7
light_color = "#ff3232" light_color = "#ff3232"
var/detecting = 1 var/detecting = 1
var/buildstage = 2 // 2 = complete, 1 = no wires, 0 = circuit gone var/buildstage = 2 // 2 = complete, 1 = no wires, 0 = circuit gone
var/last_alarm = 0 var/last_alarm = 0
var/area/myarea = null var/area/myarea = null
/obj/machinery/firealarm/Initialize(mapload, dir, building) /obj/machinery/firealarm/Initialize(mapload, dir, building)
. = ..() . = ..()
if(dir) if(dir)
src.setDir(dir) src.setDir(dir)
if(building) if(building)
buildstage = 0 buildstage = 0
panel_open = TRUE panel_open = TRUE
pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24) pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0 pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
update_icon() update_icon()
myarea = get_area(src) myarea = get_area(src)
LAZYADD(myarea.firealarms, src) LAZYADD(myarea.firealarms, src)
/obj/machinery/firealarm/Destroy() /obj/machinery/firealarm/Destroy()
LAZYREMOVE(myarea.firealarms, src) LAZYREMOVE(myarea.firealarms, src)
return ..() return ..()
/obj/machinery/firealarm/power_change() /obj/machinery/firealarm/power_change()
..() ..()
update_icon() update_icon()
/obj/machinery/firealarm/update_icon() /obj/machinery/firealarm/update_icon()
cut_overlays() cut_overlays()
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays) SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
if(panel_open) if(panel_open)
icon_state = "fire_b[buildstage]" icon_state = "fire_b[buildstage]"
return return
if(stat & BROKEN) if(stat & BROKEN)
icon_state = "firex" icon_state = "firex"
return return
icon_state = "fire0" icon_state = "fire0"
if(stat & NOPOWER) if(stat & NOPOWER)
return return
add_overlay("fire_overlay") add_overlay("fire_overlay")
if(is_station_level(z)) if(is_station_level(z))
add_overlay("fire_[GLOB.security_level]") add_overlay("fire_[GLOB.security_level]")
SSvis_overlays.add_vis_overlay(src, icon, "fire_[GLOB.security_level]", ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir) SSvis_overlays.add_vis_overlay(src, icon, "fire_[GLOB.security_level]", ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir)
else else
add_overlay("fire_[SEC_LEVEL_GREEN]") add_overlay("fire_[SEC_LEVEL_GREEN]")
SSvis_overlays.add_vis_overlay(src, icon, "fire_[SEC_LEVEL_GREEN]", ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir) SSvis_overlays.add_vis_overlay(src, icon, "fire_[SEC_LEVEL_GREEN]", ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir)
var/area/A = src.loc var/area/A = src.loc
A = A.loc A = A.loc
if(!detecting || !A.fire) if(!detecting || !A.fire)
add_overlay("fire_off") add_overlay("fire_off")
SSvis_overlays.add_vis_overlay(src, icon, "fire_off", ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir) SSvis_overlays.add_vis_overlay(src, icon, "fire_off", ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir)
else if(obj_flags & EMAGGED) else if(obj_flags & EMAGGED)
add_overlay("fire_emagged") add_overlay("fire_emagged")
SSvis_overlays.add_vis_overlay(src, icon, "fire_emagged", ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir) SSvis_overlays.add_vis_overlay(src, icon, "fire_emagged", ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir)
else else
add_overlay("fire_on") add_overlay("fire_on")
SSvis_overlays.add_vis_overlay(src, icon, "fire_on", ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir) SSvis_overlays.add_vis_overlay(src, icon, "fire_on", ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir)
/obj/machinery/firealarm/emp_act(severity) /obj/machinery/firealarm/emp_act(severity)
. = ..() . = ..()
if (. & EMP_PROTECT_SELF) if (. & EMP_PROTECT_SELF)
return return
if(prob(50 / severity)) if(prob(50 / severity))
alarm() alarm()
/obj/machinery/firealarm/emag_act(mob/user) /obj/machinery/firealarm/emag_act(mob/user)
. = ..() . = ..()
if(obj_flags & EMAGGED) if(obj_flags & EMAGGED)
return return
obj_flags |= EMAGGED obj_flags |= EMAGGED
update_icon() update_icon()
if(user) if(user)
user.visible_message("<span class='warning'>Sparks fly out of [src]!</span>", user.visible_message("<span class='warning'>Sparks fly out of [src]!</span>",
"<span class='notice'>You emag [src], disabling its thermal sensors.</span>") "<span class='notice'>You emag [src], disabling its thermal sensors.</span>")
playsound(src, "sparks", 50, 1) playsound(src, "sparks", 50, 1)
return TRUE return TRUE
/obj/machinery/firealarm/temperature_expose(datum/gas_mixture/air, temperature, volume) /obj/machinery/firealarm/temperature_expose(datum/gas_mixture/air, temperature, volume)
if((temperature > T0C + 200 || temperature < BODYTEMP_COLD_DAMAGE_LIMIT) && (last_alarm+FIREALARM_COOLDOWN < world.time) && !(obj_flags & EMAGGED) && detecting && !stat) if((temperature > T0C + 200 || temperature < BODYTEMP_COLD_DAMAGE_LIMIT) && (last_alarm+FIREALARM_COOLDOWN < world.time) && !(obj_flags & EMAGGED) && detecting && !stat)
alarm() alarm()
..() ..()
/obj/machinery/firealarm/proc/alarm(mob/user) /obj/machinery/firealarm/proc/alarm(mob/user)
if(!is_operational() || (last_alarm+FIREALARM_COOLDOWN > world.time)) if(!is_operational() || (last_alarm+FIREALARM_COOLDOWN > world.time))
return return
last_alarm = world.time last_alarm = world.time
var/area/A = get_area(src) var/area/A = get_area(src)
A.firealert(src) A.firealert(src)
playsound(loc, 'goon/sound/machinery/FireAlarm.ogg', 75) playsound(loc, 'goon/sound/machinery/FireAlarm.ogg', 75)
if(user) if(user)
log_game("[user] triggered a fire alarm at [COORD(src)]") log_game("[user] triggered a fire alarm at [COORD(src)]")
/obj/machinery/firealarm/proc/reset(mob/user) /obj/machinery/firealarm/proc/reset(mob/user)
if(!is_operational()) if(!is_operational())
return return
var/area/A = get_area(src) var/area/A = get_area(src)
A.firereset(src) A.firereset(src)
if(user) if(user)
log_game("[user] reset a fire alarm at [COORD(src)]") log_game("[user] reset a fire alarm at [COORD(src)]")
/obj/machinery/firealarm/attack_hand(mob/user) /obj/machinery/firealarm/attack_hand(mob/user)
if(buildstage != 2) if(buildstage != 2)
return ..() return ..()
add_fingerprint(user) add_fingerprint(user)
var/area/A = get_area(src) var/area/A = get_area(src)
if(A.fire) if(A.fire)
reset(user) reset(user)
else else
alarm(user) alarm(user)
/obj/machinery/firealarm/attack_ai(mob/user) /obj/machinery/firealarm/attack_ai(mob/user)
return attack_hand(user) return attack_hand(user)
/obj/machinery/firealarm/attack_robot(mob/user) /obj/machinery/firealarm/attack_robot(mob/user)
return attack_hand(user) return attack_hand(user)
/obj/machinery/firealarm/attackby(obj/item/W, mob/user, params) /obj/machinery/firealarm/attackby(obj/item/W, mob/user, params)
add_fingerprint(user) add_fingerprint(user)
if(istype(W, /obj/item/screwdriver) && buildstage == 2) if(istype(W, /obj/item/screwdriver) && buildstage == 2)
W.play_tool_sound(src) W.play_tool_sound(src)
panel_open = !panel_open panel_open = !panel_open
to_chat(user, "<span class='notice'>The wires have been [panel_open ? "exposed" : "unexposed"].</span>") to_chat(user, "<span class='notice'>The wires have been [panel_open ? "exposed" : "unexposed"].</span>")
update_icon() update_icon()
return return
if(panel_open) if(panel_open)
if(istype(W, /obj/item/weldingtool) && user.a_intent == INTENT_HELP) if(istype(W, /obj/item/weldingtool) && user.a_intent == INTENT_HELP)
if(obj_integrity < max_integrity) if(obj_integrity < max_integrity)
if(!W.tool_start_check(user, amount=0)) if(!W.tool_start_check(user, amount=0))
return return
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>") to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
if(W.use_tool(src, user, 40, volume=50)) if(W.use_tool(src, user, 40, volume=50))
obj_integrity = max_integrity obj_integrity = max_integrity
to_chat(user, "<span class='notice'>You repair [src].</span>") to_chat(user, "<span class='notice'>You repair [src].</span>")
else else
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>") to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
return return
switch(buildstage) switch(buildstage)
if(2) if(2)
if(istype(W, /obj/item/multitool)) if(istype(W, /obj/item/multitool))
detecting = !detecting detecting = !detecting
if (src.detecting) if (src.detecting)
user.visible_message("[user] has reconnected [src]'s detecting unit!", "<span class='notice'>You reconnect [src]'s detecting unit.</span>") user.visible_message("[user] has reconnected [src]'s detecting unit!", "<span class='notice'>You reconnect [src]'s detecting unit.</span>")
else else
user.visible_message("[user] has disconnected [src]'s detecting unit!", "<span class='notice'>You disconnect [src]'s detecting unit.</span>") user.visible_message("[user] has disconnected [src]'s detecting unit!", "<span class='notice'>You disconnect [src]'s detecting unit.</span>")
return return
else if (istype(W, /obj/item/wirecutters)) else if (istype(W, /obj/item/wirecutters))
buildstage = 1 buildstage = 1
W.play_tool_sound(src) W.play_tool_sound(src)
new /obj/item/stack/cable_coil(user.loc, 5) new /obj/item/stack/cable_coil(user.loc, 5)
to_chat(user, "<span class='notice'>You cut the wires from \the [src].</span>") to_chat(user, "<span class='notice'>You cut the wires from \the [src].</span>")
update_icon() update_icon()
return return
else if(W.force) //hit and turn it on else if(W.force) //hit and turn it on
..() ..()
var/area/A = get_area(src) var/area/A = get_area(src)
if(!A.fire) if(!A.fire)
alarm() alarm()
return return
if(1) if(1)
if(istype(W, /obj/item/stack/cable_coil)) if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/coil = W var/obj/item/stack/cable_coil/coil = W
if(coil.get_amount() < 5) if(coil.get_amount() < 5)
to_chat(user, "<span class='warning'>You need more cable for this!</span>") to_chat(user, "<span class='warning'>You need more cable for this!</span>")
else else
coil.use(5) coil.use(5)
buildstage = 2 buildstage = 2
to_chat(user, "<span class='notice'>You wire \the [src].</span>") to_chat(user, "<span class='notice'>You wire \the [src].</span>")
update_icon() update_icon()
return return
else if(istype(W, /obj/item/crowbar)) else if(istype(W, /obj/item/crowbar))
user.visible_message("[user.name] removes the electronics from [src.name].", \ user.visible_message("[user.name] removes the electronics from [src.name].", \
"<span class='notice'>You start prying out the circuit...</span>") "<span class='notice'>You start prying out the circuit...</span>")
if(W.use_tool(src, user, 20, volume=50)) if(W.use_tool(src, user, 20, volume=50))
if(buildstage == 1) if(buildstage == 1)
if(stat & BROKEN) if(stat & BROKEN)
to_chat(user, "<span class='notice'>You remove the destroyed circuit.</span>") to_chat(user, "<span class='notice'>You remove the destroyed circuit.</span>")
stat &= ~BROKEN stat &= ~BROKEN
else else
to_chat(user, "<span class='notice'>You pry out the circuit.</span>") to_chat(user, "<span class='notice'>You pry out the circuit.</span>")
new /obj/item/electronics/firealarm(user.loc) new /obj/item/electronics/firealarm(user.loc)
buildstage = 0 buildstage = 0
update_icon() update_icon()
return return
if(0) if(0)
if(istype(W, /obj/item/electronics/firealarm)) if(istype(W, /obj/item/electronics/firealarm))
to_chat(user, "<span class='notice'>You insert the circuit.</span>") to_chat(user, "<span class='notice'>You insert the circuit.</span>")
qdel(W) qdel(W)
buildstage = 1 buildstage = 1
update_icon() update_icon()
return return
else if(istype(W, /obj/item/electroadaptive_pseudocircuit)) else if(istype(W, /obj/item/electroadaptive_pseudocircuit))
var/obj/item/electroadaptive_pseudocircuit/P = W var/obj/item/electroadaptive_pseudocircuit/P = W
if(!P.adapt_circuit(user, 15)) if(!P.adapt_circuit(user, 15))
return return
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \ 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>") "<span class='notice'>You adapt a fire alarm circuit and slot it into the assembly.</span>")
buildstage = 1 buildstage = 1
update_icon() update_icon()
return return
else if(istype(W, /obj/item/wrench)) else if(istype(W, /obj/item/wrench))
user.visible_message("[user] removes the fire alarm assembly from the wall.", \ user.visible_message("[user] removes the fire alarm assembly from the wall.", \
"<span class='notice'>You remove the fire alarm assembly from the wall.</span>") "<span class='notice'>You remove the fire alarm assembly from the wall.</span>")
var/obj/item/wallframe/firealarm/frame = new /obj/item/wallframe/firealarm() var/obj/item/wallframe/firealarm/frame = new /obj/item/wallframe/firealarm()
frame.forceMove(user.drop_location()) frame.forceMove(user.drop_location())
W.play_tool_sound(src) W.play_tool_sound(src)
qdel(src) qdel(src)
return return
return ..() return ..()
/obj/machinery/firealarm/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir) /obj/machinery/firealarm/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
. = ..() if((buildstage == 0) && (the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS))
if(.) //damage received return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 20, "cost" = 1)
if(obj_integrity > 0 && !(stat & BROKEN) && buildstage != 0) return FALSE
if(prob(33))
alarm() /obj/machinery/firealarm/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
switch(passed_mode)
/obj/machinery/firealarm/singularity_pull(S, current_size) if(RCD_UPGRADE_SIMPLE_CIRCUITS)
if (current_size >= STAGE_FIVE) // If the singulo is strong enough to pull anchored objects, the fire alarm experiences integrity failure user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
deconstruct() "<span class='notice'>You adapt a fire alarm circuit and slot it into the assembly.</span>")
..() buildstage = 1
update_icon()
/obj/machinery/firealarm/obj_break(damage_flag) return TRUE
if(!(stat & BROKEN) && !(flags_1 & NODECONSTRUCT_1) && buildstage != 0) //can't break the electronics if there isn't any inside. return FALSE
LAZYREMOVE(myarea.firealarms, src)
stat |= BROKEN /obj/machinery/firealarm/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
update_icon() . = ..()
if(.) //damage received
/obj/machinery/firealarm/deconstruct(disassembled = TRUE) if(obj_integrity > 0 && !(stat & BROKEN) && buildstage != 0)
if(!(flags_1 & NODECONSTRUCT_1)) if(prob(33))
new /obj/item/stack/sheet/metal(loc, 1) alarm()
if(!(stat & BROKEN))
var/obj/item/I = new /obj/item/electronics/firealarm(loc) /obj/machinery/firealarm/singularity_pull(S, current_size)
if(!disassembled) if (current_size >= STAGE_FIVE) // If the singulo is strong enough to pull anchored objects, the fire alarm experiences integrity failure
I.obj_integrity = I.max_integrity * 0.5 deconstruct()
new /obj/item/stack/cable_coil(loc, 3) ..()
qdel(src)
/obj/machinery/firealarm/obj_break(damage_flag)
/obj/machinery/firealarm/proc/update_fire_light(fire) if(!(stat & BROKEN) && !(flags_1 & NODECONSTRUCT_1) && buildstage != 0) //can't break the electronics if there isn't any inside.
if(fire == !!light_power) LAZYREMOVE(myarea.firealarms, src)
return // do nothing if we're already active stat |= BROKEN
if(fire) update_icon()
set_light(l_power = 0.8)
else /obj/machinery/firealarm/deconstruct(disassembled = TRUE)
set_light(l_power = 0) if(!(flags_1 & NODECONSTRUCT_1))
new /obj/item/stack/sheet/metal(loc, 1)
/* if(!(stat & BROKEN))
* Return of Party button var/obj/item/I = new /obj/item/electronics/firealarm(loc)
*/ if(!disassembled)
I.obj_integrity = I.max_integrity * 0.5
/area new /obj/item/stack/cable_coil(loc, 3)
var/party = FALSE qdel(src)
/obj/machinery/firealarm/partyalarm /obj/machinery/firealarm/proc/update_fire_light(fire)
name = "\improper PARTY BUTTON" if(fire == !!light_power)
desc = "Cuban Pete is in the house!" return // do nothing if we're already active
var/static/party_overlay if(fire)
set_light(l_power = 0.8)
/obj/machinery/firealarm/partyalarm/reset() else
if (stat & (NOPOWER|BROKEN)) set_light(l_power = 0)
return
var/area/A = get_area(src) /*
if (!A || !A.party) * Return of Party button
return */
A.party = FALSE
A.cut_overlay(party_overlay) /area
var/party = FALSE
/obj/machinery/firealarm/partyalarm/alarm()
if (stat & (NOPOWER|BROKEN)) /obj/machinery/firealarm/partyalarm
return name = "\improper PARTY BUTTON"
var/area/A = get_area(src) desc = "Cuban Pete is in the house!"
if (!A || A.party || A.name == "Space") var/static/party_overlay
return
A.party = TRUE /obj/machinery/firealarm/partyalarm/reset()
if (!party_overlay) if (stat & (NOPOWER|BROKEN))
party_overlay = iconstate2appearance('icons/turf/areas.dmi', "party") return
A.add_overlay(party_overlay) var/area/A = get_area(src)
if (!A || !A.party)
return
A.party = FALSE
A.cut_overlay(party_overlay)
/obj/machinery/firealarm/partyalarm/alarm()
if (stat & (NOPOWER|BROKEN))
return
var/area/A = get_area(src)
if (!A || A.party || A.name == "Space")
return
A.party = TRUE
if (!party_overlay)
party_overlay = iconstate2appearance('icons/turf/areas.dmi', "party")
A.add_overlay(party_overlay)
@@ -452,4 +452,45 @@
icon_state = "slugboom" icon_state = "slugboom"
randomdir = FALSE randomdir = FALSE
duration = 30 duration = 30
pixel_x = -24 pixel_x = -24
/obj/effect/constructing_effect
icon = 'icons/effects/effects_rcd.dmi'
icon_state = ""
layer = ABOVE_ALL_MOB_LAYER
anchored = TRUE
var/status = 0
var/delay = 0
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/obj/effect/constructing_effect/Initialize(mapload, rcd_delay, rcd_status)
. = ..()
status = rcd_status
delay = rcd_delay
if (status == RCD_DECONSTRUCT)
addtimer(CALLBACK(src, /atom/.proc/update_icon), 11)
delay -= 11
icon_state = "rcd_end_reverse"
else
update_icon()
/obj/effect/constructing_effect/update_icon()
icon_state = "rcd"
if (delay < 10)
icon_state += "_shortest"
else if (delay < 20)
icon_state += "_shorter"
else if (delay < 37)
icon_state += "_short"
if (status == RCD_DECONSTRUCT)
icon_state += "_reverse"
/obj/effect/constructing_effect/proc/end_animation()
if (status == RCD_DECONSTRUCT)
qdel(src)
else
icon_state = "rcd_end"
addtimer(CALLBACK(src, .proc/end), 15)
/obj/effect/constructing_effect/proc/end()
qdel(src)
+29 -9
View File
@@ -47,7 +47,11 @@ RLD
/obj/item/construction/examine(mob/user) /obj/item/construction/examine(mob/user)
. = ..() . = ..()
. += "\A [src]. It currently holds [matter]/[max_matter] matter-units." . += "It currently holds [matter]/[max_matter] matter-units."
if(upgrade & RCD_UPGRADE_FRAMES)
. += "It contains the design for machine frames, computer frames and deconstruction."
if(upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS)
. += "It contains the design for firelock, air alarm, fire alarm, apc circuits and crap power cells."
/obj/item/construction/Destroy() /obj/item/construction/Destroy()
QDEL_NULL(spark_system) QDEL_NULL(spark_system)
@@ -85,9 +89,11 @@ RLD
to_chat(user, "<span class='notice'>[src] now holds [matter]/[max_matter] matter-units.</span>") to_chat(user, "<span class='notice'>[src] now holds [matter]/[max_matter] matter-units.</span>")
else if(istype(W, /obj/item/rcd_upgrade)) else if(istype(W, /obj/item/rcd_upgrade))
to_chat(user, "<span class='notice'>You upgrade the RCD with the [W]!</span>") to_chat(user, "<span class='notice'>You upgrade the RCD with the [W]!</span>")
upgrade = TRUE var/obj/item/rcd_upgrade/rcd_up = W
playsound(src.loc, 'sound/machines/click.ogg', 50, 1) if(!(upgrade & rcd_up.upgrade))
qdel(W) upgrade |= rcd_up.upgrade
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
qdel(W)
else else
return ..() return ..()
update_icon() //ensures that ammo counters (if present) get updated update_icon() //ensures that ammo counters (if present) get updated
@@ -116,10 +122,10 @@ RLD
if(matter < amount) if(matter < amount)
if(user) if(user)
to_chat(user, no_ammo_message) to_chat(user, no_ammo_message)
return 0 return FALSE
matter -= amount matter -= amount
update_icon() update_icon()
return 1 return TRUE
/obj/item/construction/proc/checkResource(amount, mob/user) /obj/item/construction/proc/checkResource(amount, mob/user)
. = matter >= amount . = matter >= amount
@@ -439,18 +445,22 @@ RLD
var/list/rcd_results = A.rcd_vals(user, src) var/list/rcd_results = A.rcd_vals(user, src)
if(!rcd_results) if(!rcd_results)
return FALSE return FALSE
var/delay = rcd_results["delay"] * delay_mod
var/obj/effect/constructing_effect/rcd_effect = new(get_turf(A), delay, src.mode)
var/turf/the_turf = get_turf(A) var/turf/the_turf = get_turf(A)
var/turf_coords = "[COORD(the_turf)]" var/turf_coords = "[COORD(the_turf)]"
investigate_log("[user] is attempting to use [src] on [A] (loc [turf_coords] at [the_turf]) with cost [rcd_results["cost"]], delay [rcd_results["delay"]], mode [rcd_results["mode"]].", INVESTIGATE_RCD) investigate_log("[user] is attempting to use [src] on [A] (loc [turf_coords] at [the_turf]) with cost [rcd_results["cost"]], delay [rcd_results["delay"]], mode [rcd_results["mode"]].", INVESTIGATE_RCD)
if(do_after(user, rcd_results["delay"] * delay_mod, target = A)) if(do_after(user, delay, target = A))
if(checkResource(rcd_results["cost"], user)) if(checkResource(rcd_results["cost"], user))
var/atom/cached = A var/atom/cached = A
if(A.rcd_act(user, src, rcd_results["mode"])) if(A.rcd_act(user, src, rcd_results["mode"]))
rcd_effect.end_animation()
useResource(rcd_results["cost"], user) useResource(rcd_results["cost"], user)
activate() activate()
investigate_log("[user] used [src] on [cached] (loc [turf_coords] at [the_turf]) with cost [rcd_results["cost"]], delay [rcd_results["delay"]], mode [rcd_results["mode"]].", INVESTIGATE_RCD) investigate_log("[user] used [src] on [cached] (loc [turf_coords] at [the_turf]) with cost [rcd_results["cost"]], delay [rcd_results["delay"]], mode [rcd_results["mode"]].", INVESTIGATE_RCD)
playsound(src, 'sound/machines/click.ogg', 50, 1) playsound(src, 'sound/machines/click.ogg', 50, 1)
return TRUE return TRUE
qdel(rcd_effect)
/obj/item/construction/rcd/Initialize() /obj/item/construction/rcd/Initialize()
. = ..() . = ..()
@@ -467,7 +477,7 @@ RLD
"Grilles & Windows" = image(icon = 'icons/mob/radial.dmi', icon_state = "grillewindow"), "Grilles & Windows" = image(icon = 'icons/mob/radial.dmi', icon_state = "grillewindow"),
"Floors & Walls" = image(icon = 'icons/mob/radial.dmi', icon_state = "wallfloor") "Floors & Walls" = image(icon = 'icons/mob/radial.dmi', icon_state = "wallfloor")
) )
if(upgrade) if(upgrade & RCD_UPGRADE_FRAMES)
choices += list( choices += list(
"Deconstruct" = image(icon= 'icons/mob/radial.dmi', icon_state = "delete"), "Deconstruct" = image(icon= 'icons/mob/radial.dmi', icon_state = "delete"),
"Machine Frames" = image(icon = 'icons/mob/radial.dmi', icon_state = "machine"), "Machine Frames" = image(icon = 'icons/mob/radial.dmi', icon_state = "machine"),
@@ -593,6 +603,7 @@ RLD
energyfactor = 66 energyfactor = 66
/obj/item/construction/rcd/loaded /obj/item/construction/rcd/loaded
materials = list(MAT_METAL=48000, MAT_GLASS=32000)
matter = 160 matter = 160
/obj/item/construction/rcd/loaded/upgraded /obj/item/construction/rcd/loaded/upgraded
@@ -825,9 +836,18 @@ RLD
/obj/item/rcd_upgrade /obj/item/rcd_upgrade
name = "RCD advanced design disk" 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 = 'icons/obj/module.dmi'
icon_state = "datadisk3" 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 GLOW_MODE
#undef LIGHT_MODE #undef LIGHT_MODE
+1 -1
View File
@@ -263,7 +263,7 @@
A.autoclose = TRUE A.autoclose = TRUE
return TRUE return TRUE
if(RCD_DECONSTRUCT) if(RCD_DECONSTRUCT)
if(ScrapeAway(flags = CHANGETURF_INHERIT_AIR) == src) if(!ScrapeAway(flags = CHANGETURF_INHERIT_AIR))
return FALSE return FALSE
to_chat(user, "<span class='notice'>You deconstruct [src].</span>") to_chat(user, "<span class='notice'>You deconstruct [src].</span>")
return TRUE return TRUE
@@ -822,6 +822,21 @@
return ..() 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) /obj/machinery/airalarm/AltClick(mob/user)
. = ..() . = ..()
if(!user.canUseTopic(src, !issilicon(user)) || !isturf(loc)) if(!user.canUseTopic(src, !issilicon(user)) || !isturf(loc))
+46
View File
@@ -701,6 +701,52 @@
else else
return ..() 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) /obj/machinery/power/apc/AltClick(mob/user)
. = ..() . = ..()
if(!user.canUseTopic(src, !issilicon(user)) || !isturf(loc)) if(!user.canUseTopic(src, !issilicon(user)) || !isturf(loc))
+34 -4
View File
@@ -389,13 +389,23 @@
////////////Tools////////////// ////////////Tools//////////////
/////////////////////////////// ///////////////////////////////
/datum/design/rcd_upgrade /datum/design/rcd_upgrade/frames
name = "Advanced RCD designs upgrade" name = "RCD frames designs upgrade"
desc = "Adds the computer frame and machine frame to the RCD." desc = "Adds the computer frame and machine frame to the RCD."
id = "rcd_upgrade" id = "rcd_upgrade_frames"
build_type = PROTOLATHE build_type = PROTOLATHE
materials = list(MAT_METAL = 5000, MAT_GLASS = 2500, MAT_SILVER = 1500, MAT_TITANIUM = 2000) 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("Equipment")
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(MAT_METAL = 5000, MAT_GLASS = 2500, MAT_SILVER = 1500, MAT_TITANIUM = 2000)
build_path = /obj/item/rcd_upgrade/simple_circuits
category = list("Equipment") category = list("Equipment")
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING
@@ -429,6 +439,26 @@
category = list("Equipment") category = list("Equipment")
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING
/datum/design/rcd_loaded
name = "Rapid Construction Device"
desc = "A tool that can construct and deconstruct walls, airlocks and floors on the fly."
id = "rcd_loaded"
build_type = PROTOLATHE
materials = list(MAT_METAL = MINERAL_MATERIAL_AMOUNT, MAT_GLASS = MINERAL_MATERIAL_AMOUNT) // costs more than what it did in the autolathe, this one comes loaded.
build_path = /obj/item/construction/rcd/loaded
category = list("Equipment")
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING
/datum/design/rpd
name = "Rapid Pipe Dispenser"
desc = "A tool that can construct and deconstruct pipes on the fly."
id = "rpd"
build_type = PROTOLATHE
materials = list(MAT_METAL = 75000, MAT_GLASS = 37500)
build_path = /obj/item/pipe_dispenser
category = list("Equipment")
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING
/datum/design/alienwrench /datum/design/alienwrench
name = "Alien Wrench" name = "Alien Wrench"
desc = "An advanced wrench obtained through Abductor technology." desc = "An advanced wrench obtained through Abductor technology."
+1 -1
View File
@@ -200,7 +200,7 @@
display_name = "Advanced Engineering" display_name = "Advanced Engineering"
description = "Pushing the boundaries of physics, one chainsaw-fist at a time." description = "Pushing the boundaries of physics, one chainsaw-fist at a time."
prereq_ids = list("engineering", "emp_basic") 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" , "rcd_loaded", "rpd", "tray_goggles_prescription", "engine_goggles_prescription", "mesons_prescription", "rcd_upgrade_frames", "rcd_upgrade_simple_circuits")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 4000) research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 4000)
export_price = 5000 export_price = 5000
Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB