diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index 2c13eb0c12e..72b06ea7c67 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -1,5 +1,4 @@ //MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE -//Model dictionary trimmed on: 02-02-2017 02:51 (UTC) "aaa" = ( /turf/open/space, /area/space) @@ -19613,6 +19612,7 @@ c_tag = "Auxillary Mining Base"; dir = 1 }, +/obj/structure/mining_shuttle_beacon, /turf/open/floor/plating, /area/shuttle/auxillary_base) "aHc" = ( @@ -25567,11 +25567,11 @@ }, /area/mining_construction) "aRF" = ( -/obj/structure/reagent_dispensers/fueltank, /obj/machinery/light{ icon_state = "tube1"; dir = 4 }, +/obj/machinery/computer/camera_advanced/base_construction, /turf/open/floor/plasteel/yellow/side{ dir = 5 }, @@ -91830,9 +91830,6 @@ d1 = 4; d2 = 8 }, -/obj/structure/mining_shuttle_beacon{ - dir = 2 - }, /obj/machinery/computer/security/telescreen{ desc = "Used for the Auxillary Mining Base."; dir = 1; @@ -91841,6 +91838,7 @@ pixel_x = 0; pixel_y = -28 }, +/obj/structure/reagent_dispensers/fueltank, /turf/open/floor/plasteel/yellow/side, /area/mining_construction) "cYL" = ( diff --git a/_maps/map_files/TgStation/tgstation.2.1.3.dmm b/_maps/map_files/TgStation/tgstation.2.1.3.dmm index a6123d7bd05..70f7bcd9fac 100644 --- a/_maps/map_files/TgStation/tgstation.2.1.3.dmm +++ b/_maps/map_files/TgStation/tgstation.2.1.3.dmm @@ -10008,9 +10008,7 @@ c_tag = "Auxillary Base Construction"; dir = 8 }, -/obj/structure/mining_shuttle_beacon{ - dir = 2 - }, +/obj/machinery/computer/camera_advanced/base_construction, /turf/open/floor/plasteel/yellow/side{ dir = 4 }, @@ -61223,6 +61221,12 @@ /obj/machinery/deepfryer, /turf/open/floor/plasteel/cafeteria, /area/crew_quarters/kitchen) +"cCs" = ( +/obj/structure/mining_shuttle_beacon{ + dir = 4 + }, +/turf/open/floor/plating, +/area/shuttle/auxillary_base) (1,1,1) = {" aaa @@ -71601,7 +71605,7 @@ aqI arD arD arD -arD +cCs arD arD arD diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index 9eb72e8df16..25a7312b0dd 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -175,7 +175,10 @@ name = "circuit board (Xenobiology Console)" build_path = /obj/machinery/computer/camera_advanced/xenobio origin_tech = "programming=3;bio=3" - +/obj/item/weapon/circuitboard/computer/base_construction + name = "circuit board (Aux Mining Base Construction Console)" + build_path = /obj/machinery/computer/camera_advanced/base_construction + origin_tech = "programming=3;engineering=3" /obj/item/weapon/circuitboard/computer/aiupload name = "AI Upload (Computer Board)" build_path = /obj/machinery/computer/upload/ai diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm index e93a204715e..741a3d16d0e 100644 --- a/code/game/machinery/porta_turret/portable_turret.dm +++ b/code/game/machinery/porta_turret/portable_turret.dm @@ -569,6 +569,28 @@ /obj/machinery/porta_turret/ai/assess_perp(mob/living/carbon/human/perp) return 10 //AI turrets shoot at everything not in their faction +/obj/machinery/porta_turret/aux_base + name = "perimeter defense turret" + desc = "A plasma cutter turret calibrated to defend outposts against non-humanoid fauna." + + req_access = list() //Can be disabled/enabled by any humanoid! + installation = null + lethal_projectile = /obj/item/projectile/plasma + lethal_projectile_sound = 'sound/weapons/plasma_cutter.ogg' + mode = TURRET_LETHAL //It would be useless in stun mode anyway + faction = "neutral" //Minebots, medibots, etc that should not be shot. + +/obj/machinery/porta_turret/aux_base/assess_perp(mob/living/carbon/human/perp) + return 0 //Never shoot humanoids. You are on your own if Ashwalkers or the like attack! + +/obj/machinery/porta_turret/aux_base/setup() + return + +/obj/machinery/porta_turret/aux_base/New() + ..() + cover.name = name + cover.desc = desc + //////////////////////// //Turret Control Panel// //////////////////////// diff --git a/code/modules/mining/aux_base_camera.dm b/code/modules/mining/aux_base_camera.dm new file mode 100644 index 00000000000..5b11e9a6b15 --- /dev/null +++ b/code/modules/mining/aux_base_camera.dm @@ -0,0 +1,271 @@ +//Aux base construction console +/mob/camera/aiEye/remote/base_construction + name = "construction holo-drone" + move_on_shuttle = 1 //Allows any curious crew to watch the base after it leaves. (This is safe as the base cannot be modified once it leaves) + icon = 'icons/obj/mining.dmi' + icon_state = "construction_drone" + var/area/starting_area + +mob/camera/aiEye/remote/base_construction/New(loc) + starting_area = get_area(loc) + ..() + +/mob/camera/aiEye/remote/base_construction/setLoc(var/t) + var/area/curr_area = get_area(t) + if(curr_area == starting_area || istype(curr_area, /area/shuttle/auxillary_base)) + return ..() + //While players are only allowed to build in the base area, but consoles starting outside the base can move into the base area to begin work. + +/mob/camera/aiEye/remote/base_construction/relaymove(mob/user, direct) + dir = direct //This camera eye is visible as a drone, and needs to keep the dir updated + ..() + +/obj/item/weapon/rcd/internal //Base console's internal RCD. Roundstart consoles are filled, rebuilt cosoles start empty. + name = "internal RCD" + max_matter = 600 //Bigger container and faster speeds due to being specialized and stationary. + no_ammo_message = "Internal matter exhausted. Please add additional materials." + walldelay = 10 + grilledelay = 5 + windowdelay = 5 + airlockdelay = 20 + decongirderdelay = 10 + deconwalldelay = 20 + deconfloordelay = 30 + deconwindowdelay = 20 + deconairlockdelay = 20 + +/obj/machinery/computer/camera_advanced/base_construction + name = "base contruction console" + desc = "An industrial computer integrated with a camera-assisted rapid construction device." + networks = list("SS13") + var/obj/item/weapon/rcd/internal/RCD //Internal RCD. The computer passes user commands to this in order to avoid massive copypaste. + circuit = /obj/item/weapon/circuitboard/computer/base_construction + off_action = new/datum/action/innate/camera_off/base_construction + var/datum/action/innate/aux_base/switch_mode/switch_mode_action = new //Action for switching the RCD's build modes + var/datum/action/innate/aux_base/build/build_action = new //Action for using the RCD + var/datum/action/innate/aux_base/airlock_type/airlock_mode_action = new //Action for setting the airlock type + var/datum/action/innate/aux_base/window_type/window_action = new //Action for setting the window type + var/datum/action/innate/aux_base/place_fan/fan_action = new //Action for spawning fans + var/fans_remaining = 0 //Number of fans in stock. + var/datum/action/innate/aux_base/install_turret/turret_action = new //Action for spawning turrets + var/turret_stock = 0 //Turrets in stock + var/obj/machinery/computer/shuttle/auxillary_base/found_aux_console //Tracker for the Aux base console, so the eye can always find it. + + icon_screen = "mining" + icon_keyboard = "rd_key" + +/obj/machinery/computer/camera_advanced/base_construction/New() + ..() + RCD = new /obj/item/weapon/rcd/internal(src) + +/obj/machinery/computer/camera_advanced/base_construction/Initialize(mapload) + ..() + if(mapload) //Map spawned consoles have a filled RCD and stocked special structures + RCD.matter = RCD.max_matter + fans_remaining = 4 + turret_stock = 4 + +/obj/machinery/computer/camera_advanced/base_construction/CreateEye() + + var/spawn_spot + if(!found_aux_console) + found_aux_console = locate(/obj/machinery/computer/shuttle/auxillary_base) in machines + + if(found_aux_console) + spawn_spot = found_aux_console + else + spawn_spot = src + + + eyeobj = new /mob/camera/aiEye/remote/base_construction(get_turf(spawn_spot)) + eyeobj.origin = src + + +/obj/machinery/computer/camera_advanced/base_construction/attackby(obj/item/W, mob/user, params) + if(istype(W, /obj/item/weapon/rcd_ammo) || istype(W, /obj/item/stack/sheet)) + RCD.attackby(W, user, params) //If trying to feed the console more materials, pass it along to the RCD. + else + return ..() + +/obj/machinery/computer/camera_advanced/base_construction/GrantActions(mob/living/user) + off_action.target = user + off_action.Grant(user) + switch_mode_action.target = src + switch_mode_action.Grant(user) + build_action.target = src + build_action.Grant(user) + airlock_mode_action.target = src + airlock_mode_action.Grant(user) + window_action.target = src + window_action.Grant(user) + fan_action.target = src + fan_action.Grant(user) + turret_action.target = src + turret_action.Grant(user) + eyeobj.invisibility = 0 //When the eye is in use, make it visible to players so they know when someone is building. + + +/datum/action/innate/aux_base //Parent aux base action + var/mob/living/C //Mob using the action + var/mob/camera/aiEye/remote/base_construction/remote_eye //Console's eye mob + var/obj/machinery/computer/camera_advanced/base_construction/B //Console itself + +/datum/action/innate/aux_base/Activate() + if(!target) + return TRUE + C = owner + remote_eye = C.remote_control + B = target + if(!B.RCD) //The console must always have an RCD. + B.RCD = new /obj/item/weapon/rcd/internal(src) //If the RCD is lost somehow, make a new (empty) one! + +/datum/action/innate/aux_base/proc/check_spot() +//Check a loction to see if it is inside the aux base at the station. Camera visbility checks omitted so as to not hinder construction. + var/turf/build_target = get_turf(remote_eye) + var/area/build_area = get_area(build_target) + + if(!istype(build_area, /area/shuttle/auxillary_base)) + owner << "You can only build within the mining base!" + return FALSE + + + if(build_target.z != ZLEVEL_STATION) + owner << "The mining base has launched and can no longer be modified." + return FALSE + + return TRUE + +/datum/action/innate/camera_off/base_construction + name = "Log out" + +/datum/action/innate/camera_off/base_construction/Activate() + if(!owner || !owner.remote_control) + return + + var/mob/camera/aiEye/remote/base_construction/remote_eye =owner.remote_control + + var/obj/machinery/computer/camera_advanced/base_construction/origin = remote_eye.origin + origin.switch_mode_action.Remove(target) + origin.build_action.Remove(target) + origin.airlock_mode_action.Remove(target) + origin.window_action.Remove(target) + origin.fan_action.Remove(target) + origin.turret_action.Remove(target) + remote_eye.invisibility = INVISIBILITY_MAXIMUM //Hide the eye when not in use. + + ..() + +//*******************FUNCTIONS******************* + +/datum/action/innate/aux_base/build + name = "Build" + button_icon_state = "build" + +/datum/action/innate/aux_base/build/Activate() + if(..()) + return + + if(!check_spot()) + return + + + var/atom/movable/rcd_target + var/turf/target_turf = get_turf(remote_eye) + + //Find airlocks + rcd_target = locate(/obj/machinery/door/airlock) in target_turf + + if(!rcd_target) + rcd_target = locate (/obj/structure) in target_turf + + if(!rcd_target || !rcd_target.anchored) + rcd_target = target_turf + + owner.changeNext_move(CLICK_CD_RANGE) + B.RCD.afterattack(rcd_target, owner, TRUE) //Activate the RCD and force it to work remotely! + playsound(target_turf, 'sound/items/Deconstruct.ogg', 60, 1) + +/datum/action/innate/aux_base/switch_mode + name = "Switch Mode" + button_icon_state = "builder_mode" + +/datum/action/innate/aux_base/switch_mode/Activate() + if(..()) + return + + var/list/buildlist = list("Walls and Floors" = 1,"Airlocks" = 2,"Deconstruction" = 3,"Windows and Grilles" = 4) + var/buildmode = input("Set construction mode.", "Base Console", null) in buildlist + B.RCD.mode = buildlist[buildmode] + owner << "Build mode is now [buildmode]." + +/datum/action/innate/aux_base/airlock_type + name = "Select Airlock Type" + button_icon_state = "airlock_select" + +datum/action/innate/aux_base/airlock_type/Activate() + if(..()) + return + + B.RCD.change_airlock_setting() + + +datum/action/innate/aux_base/window_type + name = "Select Window Type" + button_icon_state = "window_select" + +datum/action/innate/aux_base/window_type/Activate() + if(..()) + return + B.RCD.toggle_window_type() + +datum/action/innate/aux_base/place_fan + name = "Place Tiny Fan" + button_icon_state = "build_fan" + +datum/action/innate/aux_base/place_fan/Activate() + if(..()) + return + + var/turf/fan_turf = get_turf(remote_eye) + + if(!B.fans_remaining) + owner << "[B] is out of fans!" + return + + if(!check_spot()) + return + + if(fan_turf.density) + owner << "Fans may only be placed on a floor." + return + + new /obj/structure/fans/tiny(fan_turf) + B.fans_remaining-- + owner << "Tiny fan placed. [B.fans_remaining] remaining." + playsound(fan_turf, 'sound/machines/click.ogg', 50, 1) + +datum/action/innate/aux_base/install_turret + name = "Install Plasma Anti-Wildlife Turret" + button_icon_state = "build_turret" + +datum/action/innate/aux_base/install_turret/Activate() + if(..()) + return + + if(!check_spot()) + return + + if(!B.turret_stock) + owner << "Unable to construct additional turrets." + return + + var/turf/turret_turf = get_turf(remote_eye) + + if(is_blocked_turf(turret_turf)) + owner << "Location is obtructed by something. Please clear the location and try again." + return + + new /obj/machinery/porta_turret/aux_base(turret_turf) + B.turret_stock-- + owner << "Turret installation complete!" + playsound(turret_turf, 'sound/items/drill_use.ogg', 65, 1) \ No newline at end of file diff --git a/icons/mob/actions.dmi b/icons/mob/actions.dmi index efb324966b2..08abe850544 100644 Binary files a/icons/mob/actions.dmi and b/icons/mob/actions.dmi differ diff --git a/icons/obj/mining.dmi b/icons/obj/mining.dmi index 5c2d4272a12..a5fe40431ed 100644 Binary files a/icons/obj/mining.dmi and b/icons/obj/mining.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 8dd9bc302b6..82f7906db53 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1349,6 +1349,7 @@ #include "code\modules\library\soapstone.dm" #include "code\modules\lighting\lighting_system.dm" #include "code\modules\mining\abandoned_crates.dm" +#include "code\modules\mining\aux_base_camera.dm" #include "code\modules\mining\equipment.dm" #include "code\modules\mining\fulton.dm" #include "code\modules\mining\machine_input_output_plates.dm"