mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-07-18 19:53:35 +01:00
Quick RCD fixes (#6742)
This commit is contained in:
@@ -21,4 +21,5 @@
|
||||
#define RCD_WINDOOR "Windoor" // Build a window door
|
||||
#define RCD_FRAME "Frame" // Build a Machine or Computer frame
|
||||
#define RCD_WALLFRAME "WallFrame" // Build a selection of wall frames
|
||||
#define RCD_CONVEYOR "Conveyor" // Build direction conveyors
|
||||
#define RCD_CONVEYOR "Conveyor" // Build direction conveyors
|
||||
#define RCD_TURRET "Turret" // Build turrets when emagged
|
||||
@@ -312,11 +312,11 @@
|
||||
w_class = ITEMSIZE_SMALL
|
||||
origin_tech = list(TECH_MATERIAL = 2)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 30000,MAT_GLASS = 15000)
|
||||
var/remaining = RCD_MAX_CAPACITY / 3
|
||||
var/remaining = RCD_MAX_CAPACITY / 0.75 //CHOMPEdit
|
||||
|
||||
/obj/item/weapon/rcd_ammo/large
|
||||
name = "high-capacity matter cartridge"
|
||||
desc = "Do not ingest."
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 45000,MAT_GLASS = 22500)
|
||||
origin_tech = list(TECH_MATERIAL = 4)
|
||||
remaining = RCD_MAX_CAPACITY
|
||||
remaining = RCD_MAX_CAPACITY * 2 //CHOMPEdit
|
||||
|
||||
@@ -195,6 +195,7 @@
|
||||
return "It currently holds [remaining]/[initial(remaining)] matter-units."
|
||||
|
||||
//////////////////
|
||||
//CHOMPEdit start
|
||||
/obj/effect/constructing_effect
|
||||
icon = 'icons/effects/effects_rcd.dmi'
|
||||
icon_state = ""
|
||||
@@ -202,21 +203,12 @@
|
||||
layer = ABOVE_TURF_LAYER
|
||||
anchored = TRUE
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
var/status = 0
|
||||
var/delay = 0
|
||||
|
||||
/obj/effect/constructing_effect/Initialize(mapload, rcd_delay, rcd_status)
|
||||
. = ..()
|
||||
status = rcd_status
|
||||
delay = rcd_delay
|
||||
if (status == RCD_DECONSTRUCT)
|
||||
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, update_icon)), 11)
|
||||
delay -= 11
|
||||
icon_state = "rcd_end_reverse"
|
||||
else
|
||||
update_icon()
|
||||
update_icon(rcd_delay, rcd_status)
|
||||
|
||||
/obj/effect/constructing_effect/update_icon()
|
||||
/obj/effect/constructing_effect/update_icon(var/delay = 30, var/status)
|
||||
icon_state = "rcd"
|
||||
if (delay < 10)
|
||||
icon_state += "_shortest"
|
||||
@@ -226,13 +218,15 @@
|
||||
icon_state += "_short"
|
||||
if (status == RCD_DECONSTRUCT)
|
||||
icon_state += "_reverse"
|
||||
addtimer(CALLBACK(src, PROC_REF(end_animation), status), delay)
|
||||
|
||||
/obj/effect/constructing_effect/proc/end_animation()
|
||||
/obj/effect/constructing_effect/proc/end_animation(status)
|
||||
if (status == RCD_DECONSTRUCT)
|
||||
qdel(src)
|
||||
icon_state = "rcd_end_reverse"
|
||||
else
|
||||
icon_state = "rcd_end"
|
||||
addtimer(CALLBACK(src, PROC_REF(end)), 15)
|
||||
addtimer(CALLBACK(src, PROC_REF(end)), 15)
|
||||
|
||||
/obj/effect/constructing_effect/proc/end()
|
||||
qdel(src)
|
||||
//CHOMPEdit end
|
||||
@@ -75,6 +75,7 @@
|
||||
/obj/item/device/integrated_electronics/wirer,
|
||||
/obj/item/weapon/pipe_dispenser, //CHOMPAdd
|
||||
/obj/item/weapon/holosign_creator/combifan, //CHOMPAdd
|
||||
/obj/item/weapon/rcd, //CHOMPAdd
|
||||
/obj/item/device/integrated_electronics/debugger, //Vorestation edit adding debugger to toolbelt can hold list
|
||||
/obj/item/weapon/shovel/spade, //VOREStation edit. If it can hold minihoes and hatchers, why not the gardening spade?
|
||||
/obj/item/stack/nanopaste, //VOREStation edit. Think of it as a tube of superglue. Belts hold that all the time.
|
||||
@@ -121,6 +122,8 @@
|
||||
storage_slots = 8 //If they get better everything-else, why not the belt too?
|
||||
can_hold = list(
|
||||
/obj/item/weapon/rcd, //They've given one from the get-go, it's hard to imagine they wouldn't be given something that can store it neater than a bag
|
||||
/obj/item/weapon/pipe_dispenser, //CHOMPAdd
|
||||
/obj/item/weapon/holosign_creator/combifan, //CHOMPAdd
|
||||
/obj/item/weapon/tool/crowbar,
|
||||
/obj/item/weapon/tool/screwdriver,
|
||||
/obj/item/weapon/weldingtool,
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
/obj/item/clothing/head/beret/engineering/ce/white,
|
||||
/obj/item/weapon/tank/emergency/oxygen/double, //VOREStation Edit: chief gets the good shit
|
||||
/obj/item/weapon/reagent_containers/spray/windowsealant, //VOREStation Add,
|
||||
/obj/item/weapon/holosign_creator/combifan, //CHOMPAdd
|
||||
/obj/item/weapon/rcd/advanced/loaded, //CHOMPAdd
|
||||
/obj/item/weapon/pipe_dispenser) //YW Add
|
||||
|
||||
@@ -140,6 +141,7 @@
|
||||
/obj/item/clothing/shoes/boots/winter/atmos,
|
||||
/obj/item/weapon/tank/emergency/oxygen/engi,
|
||||
/obj/item/weapon/holosign_creator/combifan, //CHOMPAdd
|
||||
/obj/item/weapon/pipe_dispenser, //CHOMPAdd
|
||||
/obj/item/weapon/storage/belt/utility/atmostech) //VOREStation edit. They don't get a toolbox to fill it from, so why not give a spare one that's full already?
|
||||
|
||||
/obj/structure/closet/secure_closet/atmos_personal/Initialize()
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
/obj/machinery/porta_turret/rcd
|
||||
desc = "A cheap turret printed by a rapid construction device with its own power supply. Not very sturdy, but it still hurts."
|
||||
use_power = FALSE
|
||||
idle_power_usage = 0
|
||||
active_power_usage = 0
|
||||
health = 20
|
||||
maxhealth = 20
|
||||
reqpower = 0
|
||||
enabled = TRUE
|
||||
lethal = TRUE
|
||||
ailock = FALSE
|
||||
check_all = TRUE
|
||||
can_salvage = FALSE
|
||||
check_down = TRUE
|
||||
|
||||
/obj/machinery/porta_turret/rcd/operable()
|
||||
return !inoperable()
|
||||
|
||||
/obj/machinery/porta_turret/rcd/inoperable()
|
||||
return (stat & (BROKEN|EMPED))
|
||||
|
||||
/obj/machinery/porta_turret/rcd/process()
|
||||
if(stat & BROKEN)
|
||||
popDown()
|
||||
return
|
||||
|
||||
if(!enabled)
|
||||
popDown()
|
||||
return
|
||||
|
||||
var/list/targets = list() //list of primary targets
|
||||
var/list/secondarytargets = list() //targets that are least important
|
||||
|
||||
for(var/mob/M in oview(world.view, src))
|
||||
assess_and_assign(M, targets, secondarytargets)
|
||||
|
||||
if(!tryToShootAt(targets))
|
||||
if(!tryToShootAt(secondarytargets)) // if no valid targets, go for secondary targets
|
||||
timeout--
|
||||
if(timeout <= 0)
|
||||
spawn()
|
||||
popDown() // no valid targets, close the cover
|
||||
|
||||
/obj/machinery/porta_turret/rcd/update_icon()
|
||||
if(stat & BROKEN) // Turret is dead.
|
||||
icon_state = "destroyed_target_prism_[turret_type]"
|
||||
|
||||
else if(raised || raising)
|
||||
// Turret is open.
|
||||
if(enabled)
|
||||
// Trying to shoot someone.
|
||||
if(lethal)
|
||||
icon_state = "[lethal_icon_color]_target_prism_[turret_type]"
|
||||
else
|
||||
icon_state = "[icon_color]_target_prism_[turret_type]"
|
||||
|
||||
else
|
||||
// Disabled.
|
||||
icon_state = "grey_target_prism_[turret_type]"
|
||||
|
||||
else
|
||||
// Its closed.
|
||||
icon_state = "turret_cover_[turret_type]"
|
||||
@@ -8,8 +8,10 @@
|
||||
var/frame_type = /obj/structure/frame
|
||||
var/wall_frame_type = /obj/machinery/alarm
|
||||
var/window_dir = "FULL"
|
||||
var/emagged = 0
|
||||
window_type = "rglass"
|
||||
modes = list(RCD_FLOORWALL, RCD_AIRLOCK, RCD_WINDOWGRILLE, RCD_DECONSTRUCT, RCD_WINDOOR, RCD_FIRELOCK, RCD_FRAME, RCD_WALLFRAME, RCD_CONVEYOR)
|
||||
var/turret_faction = null
|
||||
modes = list(RCD_FLOORWALL, RCD_AIRLOCK, RCD_WINDOWGRILLE, RCD_DECONSTRUCT, RCD_WINDOOR, RCD_FIRELOCK, RCD_FRAME, RCD_WALLFRAME, RCD_CONVEYOR, RCD_TURRET)
|
||||
var/static/image/radial_image_firelock = image(icon = 'modular_chomp/icons/mob/radial.dmi', icon_state = "firelock")
|
||||
var/static/image/radial_image_windoor = image(icon= 'modular_chomp/icons/mob/radial.dmi', icon_state = "windoor")
|
||||
var/static/image/radial_image_frame = image(icon = 'icons/mob/radial.dmi', icon_state = "machine")
|
||||
@@ -17,6 +19,10 @@
|
||||
var/static/image/radial_image_access = image(icon = 'icons/mob/radial.dmi', icon_state = "access")
|
||||
var/static/image/radial_image_airlock_type = image(icon = 'icons/mob/radial.dmi', icon_state = "airlocktype")
|
||||
var/static/image/radial_image_conveyor = image(icon = 'modular_chomp/icons/mob/radial.dmi', icon_state = "conveyor")
|
||||
var/static/image/radial_image_turret = image(icon = 'modular_chomp/icons/mob/radial.dmi', icon_state = "turret")
|
||||
|
||||
/obj/item/weapon/rcd/advanced
|
||||
can_remove_rwalls = 1
|
||||
/*
|
||||
Material values
|
||||
plasteel = 12
|
||||
@@ -29,6 +35,13 @@ borosilicate = 9
|
||||
rborosilicate = 12
|
||||
*/
|
||||
|
||||
/obj/item/weapon/rcd/emag_act(var/remaining_charges, var/mob/user)
|
||||
..()
|
||||
if(!emagged)
|
||||
emagged = 1
|
||||
to_chat(user, span("warning","You short out the safeties on \the [src]'s construction limiter"))
|
||||
return TRUE
|
||||
|
||||
/obj/item/weapon/rcd/attackby(obj/item/W, mob/user)
|
||||
var/loaded = 0
|
||||
if(istype(W, /obj/item/weapon/rcd_ammo))
|
||||
@@ -44,7 +57,6 @@ rborosilicate = 12
|
||||
user.drop_from_inventory(W)
|
||||
qdel(W)
|
||||
loaded = 1
|
||||
return TRUE
|
||||
if(istype(W,/obj/item/stack))
|
||||
var/obj/item/stack/S = W
|
||||
if(istype(S,/obj/item/stack/material/glass/phoronrglass))
|
||||
@@ -75,7 +87,6 @@ rborosilicate = 12
|
||||
var/amount_to_use = min(S.amount, maxsheets)
|
||||
S.use(amount_to_use)
|
||||
stored_matter += value*amount_to_use
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
|
||||
to_chat(user, "<span class='notice'>You insert [amount_to_use] [S.name] sheets into [src]. </span>")
|
||||
return 1
|
||||
to_chat(user, "<span class='warning'>You can't insert any more [S.name] sheets into [src]!</span>")
|
||||
@@ -96,6 +107,8 @@ rborosilicate = 12
|
||||
"Change Airlock Type" = radial_image_airlock_type,
|
||||
"Conveyors" = radial_image_conveyor
|
||||
)
|
||||
if(emagged)
|
||||
choices["Turrets"] = radial_image_turret
|
||||
var/choice = show_radial_menu(user, user, choices, radius = 42, custom_check = CALLBACK(src, PROC_REF(check_menu), user), tooltips = TRUE)
|
||||
if(!check_menu(user))
|
||||
return
|
||||
@@ -134,7 +147,8 @@ rborosilicate = 12
|
||||
"Air Alarm" = image(icon = 'modular_chomp/icons/mob/radial.dmi', icon_state = "wallframe"),
|
||||
"Light Bulb" = image(icon = 'modular_chomp/icons/mob/radial.dmi', icon_state = "lightbulb"),
|
||||
"Light Tube" = image(icon = 'modular_chomp/icons/mob/radial.dmi', icon_state = "lighttube"),
|
||||
"Doorbell" = image(icon = 'modular_chomp/icons/mob/radial.dmi', icon_state = "doorbell"),
|
||||
"Doorbell Chime" = image(icon = 'modular_chomp/icons/mob/radial.dmi', icon_state = "doorbell"),
|
||||
"Doorbell Button" = image(icon = 'modular_chomp/icons/mob/radial.dmi', icon_state = "doorbellbutton"),
|
||||
"Status Display" = image(icon = 'modular_chomp/icons/mob/radial.dmi', icon_state = "status"),
|
||||
"Supply Requests Console" = image(icon = 'modular_chomp/icons/mob/radial.dmi', icon_state = "supply"),
|
||||
"ATM" = image(icon = 'modular_chomp/icons/mob/radial.dmi', icon_state = "atm"),
|
||||
@@ -163,8 +177,10 @@ rborosilicate = 12
|
||||
wall_frame_type = /obj/machinery/light/small
|
||||
if("Light Tube")
|
||||
wall_frame_type = /obj/machinery/light
|
||||
if("Doorbell")
|
||||
if("Doorbell Chime")
|
||||
wall_frame_type = /obj/machinery/doorbell_chime
|
||||
if("Doorbell Button")
|
||||
wall_frame_type = /obj/machinery/button/doorbell
|
||||
if("Status Display")
|
||||
wall_frame_type = /obj/machinery/status_display
|
||||
if("Supply Requests Console")
|
||||
@@ -209,6 +225,20 @@ rborosilicate = 12
|
||||
return
|
||||
if("Conveyors")
|
||||
mode_index = modes.Find(RCD_CONVEYOR)
|
||||
if("Turrets")
|
||||
var/list/turret_factions = list(
|
||||
"HOSTILE TO ALL" = image(icon = 'modular_chomp/icons/mob/radial.dmi', icon_state = "turret1"),
|
||||
"HOSTILE TO ENEMIES" = image(icon = 'modular_chomp/icons/mob/radial.dmi', icon_state = "turret2")
|
||||
)
|
||||
var/selected_turret_faction = show_radial_menu(user, src, turret_factions, custom_check = CALLBACK(src, .proc/check_menu, user), require_near = ranged?FALSE:TRUE, tooltips = TRUE)
|
||||
if(!check_menu(user))
|
||||
return
|
||||
switch(selected_turret_faction)
|
||||
if("HOSTILE TO ALL")
|
||||
turret_faction = null
|
||||
if("HOSTILE TO ENEMIES")
|
||||
turret_faction = user.faction
|
||||
mode_index = modes.Find(RCD_TURRET)
|
||||
else
|
||||
return
|
||||
playsound(src, 'sound/effects/pop.ogg', 50, FALSE)
|
||||
@@ -502,6 +532,12 @@ rborosilicate = 12
|
||||
RCD_VALUE_DELAY = 1.5 SECONDS,
|
||||
RCD_VALUE_COST = RCD_SHEETS_PER_MATTER_UNIT * 6
|
||||
)
|
||||
if(RCD_TURRET)
|
||||
return list(
|
||||
RCD_VALUE_MODE = RCD_TURRET,
|
||||
RCD_VALUE_DELAY = 6 SECONDS,
|
||||
RCD_VALUE_COST = RCD_SHEETS_PER_MATTER_UNIT * 10
|
||||
)
|
||||
return FALSE
|
||||
|
||||
|
||||
@@ -586,7 +622,7 @@ rborosilicate = 12
|
||||
A.autoclose = TRUE
|
||||
return TRUE
|
||||
if(RCD_FIRELOCK)
|
||||
if(locate(/obj/machinery/door/firedoor/glass) in src)
|
||||
if(locate(/obj/machinery/door/firedoor) in src)
|
||||
return FALSE
|
||||
to_chat(user, span("notice", "You build a firelock."))
|
||||
new /obj/machinery/door/firedoor/glass(src)
|
||||
@@ -658,6 +694,10 @@ rborosilicate = 12
|
||||
C.set_dir(WEST)
|
||||
to_chat(user, span("notice", "You build a conveyor"))
|
||||
return TRUE
|
||||
if(RCD_TURRET)
|
||||
var/obj/machinery/porta_turret/T = new /obj/machinery/porta_turret/rcd(src)
|
||||
T.faction = the_rcd.turret_faction
|
||||
return TRUE
|
||||
|
||||
//////////////////////////////////////
|
||||
//////////////WALL////////////////////
|
||||
@@ -800,6 +840,9 @@ rborosilicate = 12
|
||||
RCD_VALUE_DELAY = 2 SECONDS,
|
||||
RCD_VALUE_COST = RCD_SHEETS_PER_MATTER_UNIT * 1
|
||||
)
|
||||
if(RCD_WINDOWGRILLE)
|
||||
the_rcd.use_rcd(get_turf(src), user)
|
||||
return 1
|
||||
|
||||
/obj/structure/window/rcd_act(mob/living/user, obj/item/weapon/rcd/the_rcd, passed_mode)
|
||||
switch(passed_mode)
|
||||
@@ -911,6 +954,9 @@ rborosilicate = 12
|
||||
RCD_VALUE_DELAY = 4 SECONDS,
|
||||
RCD_VALUE_COST = RCD_SHEETS_PER_MATTER_UNIT * 4
|
||||
)
|
||||
if(RCD_FIRELOCK)
|
||||
the_rcd.use_rcd(get_turf(src), user)
|
||||
return 1
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/door/airlock/rcd_act(mob/living/user, obj/item/weapon/rcd/the_rcd, passed_mode)
|
||||
@@ -1368,6 +1414,54 @@ rborosilicate = 12
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/door/window/rcd_act(mob/living/user, obj/item/weapon/rcd/the_rcd, passed_mode)
|
||||
if(passed_mode == RCD_DECONSTRUCT)
|
||||
to_chat(user, span("notice", "You deconstruct \the [src]."))
|
||||
qdel(src)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/structure/firedoor_assembly/rcd_values(mob/living/user, obj/item/weapon/rcd/the_rcd, passed_mode)
|
||||
if(passed_mode == RCD_DECONSTRUCT)
|
||||
return list(
|
||||
RCD_VALUE_MODE = RCD_DECONSTRUCT,
|
||||
RCD_VALUE_DELAY = 1 SECONDS,
|
||||
RCD_VALUE_COST = RCD_SHEETS_PER_MATTER_UNIT * 1
|
||||
)
|
||||
return FALSE
|
||||
|
||||
/obj/structure/firedoor_assembly/rcd_act(mob/living/user, obj/item/weapon/rcd/the_rcd, passed_mode)
|
||||
if(passed_mode == RCD_DECONSTRUCT)
|
||||
to_chat(user, span("notice", "You deconstruct \the [src]."))
|
||||
qdel(src)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/structure/door_assembly/rcd_values(mob/living/user, obj/item/weapon/rcd/the_rcd, passed_mode)
|
||||
if(passed_mode == RCD_DECONSTRUCT)
|
||||
return list(
|
||||
RCD_VALUE_MODE = RCD_DECONSTRUCT,
|
||||
RCD_VALUE_DELAY = 1 SECONDS,
|
||||
RCD_VALUE_COST = RCD_SHEETS_PER_MATTER_UNIT * 1
|
||||
)
|
||||
return FALSE
|
||||
|
||||
/obj/structure/door_assembly/rcd_act(mob/living/user, obj/item/weapon/rcd/the_rcd, passed_mode)
|
||||
if(passed_mode == RCD_DECONSTRUCT)
|
||||
to_chat(user, span("notice", "You deconstruct \the [src]."))
|
||||
qdel(src)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/button/doorbell/rcd_values(mob/living/user, obj/item/weapon/rcd/the_rcd, passed_mode)
|
||||
if(passed_mode == RCD_DECONSTRUCT)
|
||||
return list(
|
||||
RCD_VALUE_MODE = RCD_DECONSTRUCT,
|
||||
RCD_VALUE_DELAY = 1 SECONDS,
|
||||
RCD_VALUE_COST = RCD_SHEETS_PER_MATTER_UNIT * 1
|
||||
)
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/button/doorbell/rcd_act(mob/living/user, obj/item/weapon/rcd/the_rcd, passed_mode)
|
||||
if(passed_mode == RCD_DECONSTRUCT)
|
||||
to_chat(user, span("notice", "You deconstruct \the [src]."))
|
||||
qdel(src)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 16 KiB |
@@ -4569,6 +4569,7 @@
|
||||
#include "modular_chomp\code\game\machinery\autolathe_armory.dm"
|
||||
#include "modular_chomp\code\game\machinery\colormate.dm"
|
||||
#include "modular_chomp\code\game\machinery\petrification.dm"
|
||||
#include "modular_chomp\code\game\machinery\portable_turret.dm"
|
||||
#include "modular_chomp\code\game\objects\items.dm"
|
||||
#include "modular_chomp\code\game\objects\items\holosign_creator.dm"
|
||||
#include "modular_chomp\code\game\objects\items\petrifier.dm"
|
||||
|
||||
Reference in New Issue
Block a user