diff --git a/code/game/machinery/pipe/pipe_recipes.dm b/code/game/machinery/pipe/pipe_recipes.dm index 0bf8f10105..14dbfc2603 100644 --- a/code/game/machinery/pipe/pipe_recipes.dm +++ b/code/game/machinery/pipe/pipe_recipes.dm @@ -4,6 +4,7 @@ var/global/list/atmos_pipe_recipes = null var/global/list/disposal_pipe_recipes = null +var/global/list/all_pipe_recipes = null // VOREStation Add /hook/startup/proc/init_pipe_recipes() global.atmos_pipe_recipes = list( @@ -68,6 +69,7 @@ var/global/list/disposal_pipe_recipes = null new /datum/pipe_recipe/disposal("Chute", DISPOSAL_PIPE_CHUTE, "intake"), ) ) + global.all_pipe_recipes = disposal_pipe_recipes + atmos_pipe_recipes // VOREStation Add return TRUE // @@ -96,6 +98,7 @@ var/global/list/disposal_pipe_recipes = null /datum/pipe_recipe/pipe var/obj/item/pipe/construction_type // The type PATH to the type of pipe fitting object the recipe makes. var/obj/machinery/atmospherics/pipe_type // The type PATH of what actual pipe the fitting becomes. + var/paintable = FALSE // If TRUE, allow the RPD to paint this pipe. // VOREStation Add /datum/pipe_recipe/pipe/New(var/label, var/obj/machinery/atmospherics/path) name = label @@ -105,6 +108,7 @@ var/global/list/disposal_pipe_recipes = null dirtype = initial(construction_type.dispenser_class) if (dirtype == PIPE_TRIN_M) icon_state_m = "[icon_state]m" + paintable = ispath(path, /obj/machinery/atmospherics/pipe) && !(ispath(path, /obj/machinery/atmospherics/pipe/vent)) // VOREStation Add // Render an HTML link to select this pipe type /datum/pipe_recipe/pipe/Render(dispenser) diff --git a/code/game/objects/items/weapons/RPD_vr.dm b/code/game/objects/items/weapons/RPD_vr.dm new file mode 100644 index 0000000000..c627956d63 --- /dev/null +++ b/code/game/objects/items/weapons/RPD_vr.dm @@ -0,0 +1,377 @@ +#define PAINT_MODE -2 +#define EATING_MODE -1 +#define ATMOS_MODE 0 +#define DISPOSALS_MODE 1 +#define TRANSIT_MODE 2 + +/obj/item/weapon/pipe_dispenser + name = "Rapid Piping Device (RPD)" + desc = "A device used to rapidly pipe things." + icon = 'icons/obj/tools_vr.dmi' + icon_state = "rpd" + item_state = "rpd" + item_icons = list( + slot_l_hand_str = 'icons/mob/items/lefthand_vr.dmi', + slot_r_hand_str = 'icons/mob/items/righthand_vr.dmi', + ) + flags = NOBLUDGEON + force = 10 + throwforce = 10 + throw_speed = 1 + throw_range = 5 + w_class = ITEMSIZE_NORMAL + matter = list(MAT_STEEL = 50000, MAT_GLASS = 25000) + var/datum/effect/effect/system/spark_spread/spark_system + var/mode = ATMOS_MODE + var/p_dir = NORTH // Next pipe will be built with this dir + var/p_flipped = FALSE // If the next pipe should be built flipped + var/paint_color = "grey" // Pipe color index for next pipe painted/built. + var/screen = ATMOS_MODE // Starts on the atmos tab. + var/piping_layer = PIPING_LAYER_DEFAULT + var/wrench_mode = FALSE + var/obj/item/weapon/tool/wrench/tool + var/datum/pipe_recipe/recipe // pipe recipie selected for display/construction + var/static/datum/pipe_recipe/first_atmos + var/static/datum/pipe_recipe/first_disposal + var/static/datum/asset/iconsheet/pipes/icon_assets + var/static/list/pipe_layers = list( + "Regular" = PIPING_LAYER_REGULAR, + "Supply" = PIPING_LAYER_SUPPLY, + "Scrubber" = PIPING_LAYER_SCRUBBER, + "Fuel" = PIPING_LAYER_FUEL, + "Aux" = PIPING_LAYER_AUX + ) + +/obj/item/weapon/pipe_dispenser/Initialize() + . = ..() + src.spark_system = new /datum/effect/effect/system/spark_spread + spark_system.set_up(5, 0, src) + spark_system.attach(src) + tool = new /obj/item/weapon/tool/wrench/cyborg(src) // RPDs have wrenches inside of them, so that they can wrench down spawned pipes without being used as superior wrenches themselves. + +/obj/item/weapon/pipe_dispenser/proc/SetupPipes() + if(!first_atmos) + first_atmos = atmos_pipe_recipes[atmos_pipe_recipes[1]][1] + recipe = first_atmos + if(!first_disposal) + first_disposal = disposal_pipe_recipes[disposal_pipe_recipes[1]][1] + +/obj/item/weapon/pipe_dispenser/Destroy() + qdel_null(spark_system) + qdel_null(tool) + return ..() + +/obj/item/weapon/pipe_dispenser/suicide_act(mob/user) + var/datum/gender/TU = gender_datums[user.get_visible_gender()] + user.visible_message("[user] points the end of the RPD down [TU.his] throat and presses a button! It looks like [TU.hes] trying to commit suicide...") + playsound(get_turf(user), 'sound/machines/click.ogg', 50, 1) + playsound(get_turf(user), 'sound/items/deconstruct.ogg', 50, 1) + return(BRUTELOSS) + +/obj/item/weapon/pipe_dispenser/attack_self(mob/user) + src.interact(user) + +// TODO - Wouldn't it be nice to have nanoui? +/obj/item/weapon/pipe_dispenser/interact(mob/user) + SetupPipes() + if(!icon_assets) + icon_assets = get_asset_datum(/datum/asset/iconsheet/pipes) + icon_assets.send(user) + + var/list/lines = list() + if(mode >= ATMOS_MODE) + lines += "