diff --git a/code/__DEFINES/dcs/signals/atom/signals_obj.dm b/code/__DEFINES/dcs/signals/atom/signals_obj.dm index 3445fe3df55f..d1a8301641fb 100644 --- a/code/__DEFINES/dcs/signals/atom/signals_obj.dm +++ b/code/__DEFINES/dcs/signals/atom/signals_obj.dm @@ -64,3 +64,6 @@ // from /obj/item/device/binoculars/range/designator/acquire_target() #define COMSIG_DESIGNATOR_LASE "comsig_designator_lase" #define COMSIG_DESIGNATOR_LASE_OFF "comsig_designator_lase_off" + +/// from /obj/vehicle/multitile/blackfoot/add_seated_verbs() +#define COMSIG_BLACKFOOT_ACTIONS_UPDATE "comsig_blackfoot_actions_update" diff --git a/code/modules/vehicles/blackfoot/blackfoot.dm b/code/modules/vehicles/blackfoot/blackfoot.dm index 0c84c9abc8d0..b0a694872d67 100644 --- a/code/modules/vehicles/blackfoot/blackfoot.dm +++ b/code/modules/vehicles/blackfoot/blackfoot.dm @@ -23,6 +23,7 @@ bound_y = 0 interior_map = /datum/map_template/interior/blackfoot + var/area/interior_area move_max_momentum = 2.2 move_momentum_build_factor = 1.5 @@ -45,6 +46,7 @@ /obj/item/hardpoint/primary/blackfoot_launchers, /obj/item/hardpoint/support/sensor_array, /obj/item/hardpoint/secondary/doorgun, + /obj/item/hardpoint/support/recon_system, ) entrances = list( @@ -79,6 +81,9 @@ var/state = STATE_STOWED + /// used by the recon_system module to allow the VTOL to 'run dark' + var/stealth_mode = FALSE + COOLDOWN_DECLARE(turn_cooldown) COOLDOWN_DECLARE(flight_sound_cooldown) @@ -357,6 +362,8 @@ give_action(M, /datum/action/human_action/blackfoot/toggle_engines) give_action(M, /datum/action/human_action/blackfoot/toggle_targeting) + SEND_SIGNAL(src, COMSIG_BLACKFOOT_ACTIONS_UPDATE) + for(var/atom/movable/screen/blackfoot/screen_to_add as anything in custom_hud) M.client.add_to_screen(screen_to_add) screen_to_add.update(fuel, max_fuel, health, maxhealth, battery, max_battery) @@ -444,6 +451,8 @@ if(launchers) launchers.safety = TRUE + SEND_SIGNAL(src, COMSIG_BLACKFOOT_ACTIONS_UPDATE, TRUE) + for(var/atom/movable/screen/blackfoot/screen_to_remove as anything in custom_hud) M.client.remove_from_screen(screen_to_remove) @@ -895,6 +904,12 @@ vehicle.toggle_stowed() return +/obj/vehicle/multitile/blackfoot/perform_honk() + if(stealth_mode) + to_chat(seats[VEHICLE_DRIVER], SPAN_WARNING("Perhaps sounding the horn isn't the best way to be stealthy?")) + return + if(honk_sound) + playsound(loc, honk_sound, 75, TRUE, 15) //heard within ~15 tiles /datum/action/human_action/blackfoot/New(Target, obj/item/holder) . = ..() diff --git a/code/modules/vehicles/blackfoot/interior.dm b/code/modules/vehicles/blackfoot/interior.dm index bf7c10e7892a..e20cadf8be1d 100644 --- a/code/modules/vehicles/blackfoot/interior.dm +++ b/code/modules/vehicles/blackfoot/interior.dm @@ -63,6 +63,10 @@ if(istype(interior.exterior, /obj/vehicle/multitile/blackfoot)) var/obj/vehicle/multitile/blackfoot/linked_blackfoot = interior.exterior loader.linked_blackfoot = linked_blackfoot + var/area/interior_area = get_area(loader) + linked_blackfoot.interior_area = interior_area + interior_area.set_base_lighting(COLOR_WHITE, 255) // setting this in on_load allows it to be edited + qdel(src) diff --git a/code/modules/vehicles/hardpoints/primary/blackfoot_launchers.dm b/code/modules/vehicles/hardpoints/primary/blackfoot_launchers.dm index 6ec7f25de419..0caeb12e1458 100644 --- a/code/modules/vehicles/hardpoints/primary/blackfoot_launchers.dm +++ b/code/modules/vehicles/hardpoints/primary/blackfoot_launchers.dm @@ -36,10 +36,19 @@ return icon /obj/item/hardpoint/primary/blackfoot_launchers/try_fire(atom/target, mob/living/user, params) + var/obj/vehicle/multitile/blackfoot/blackfoot_owner = owner + + if(!blackfoot_owner) + return + if(safety) to_chat(user, SPAN_WARNING("Targeting mode is not enabled, unable to fire.")) return + if(blackfoot_owner.stealth_mode) + to_chat(user, SPAN_WARNING("Weapons system unavailable while recon mode is active.")) + return + if(ammo && ammo.current_rounds <= 0) reload(user) return diff --git a/code/modules/vehicles/hardpoints/secondary/doorgun.dm b/code/modules/vehicles/hardpoints/secondary/doorgun.dm index 4a98c999a63e..ea38dc8f455d 100644 --- a/code/modules/vehicles/hardpoints/secondary/doorgun.dm +++ b/code/modules/vehicles/hardpoints/secondary/doorgun.dm @@ -48,6 +48,10 @@ if(!blackfoot_owner) return + if(blackfoot_owner.stealth_mode) + to_chat(user, SPAN_WARNING("Weapons system unavailable while recon mode is active.")) + return + if(!blackfoot_owner.back_door || !blackfoot_owner.back_door.open) to_chat(user, SPAN_WARNING("You should probably open the rear door before firing.")) return diff --git a/code/modules/vehicles/hardpoints/support/recon_system.dm b/code/modules/vehicles/hardpoints/support/recon_system.dm new file mode 100644 index 000000000000..0294f2ae62e8 --- /dev/null +++ b/code/modules/vehicles/hardpoints/support/recon_system.dm @@ -0,0 +1,100 @@ +/obj/item/hardpoint/support/recon_system + name = "\improper AQ-133 Acquisition System" + desc = "A short-range Air-to-Ground LIDAR target acquisition system designed to actively track and profile non-IFF signatures in a localized range of detection." + icon = 'icons/obj/vehicles/hardpoints/blackfoot.dmi' + icon_state = "radar" + disp_icon = "blackfoot" + disp_icon_state = "radar" + + health = 250 + + var/active = FALSE + +/datum/action/human_action/blackfoot/recon_mode + name = "Toggle Recon Mode" + action_icon_state = "nightvision" + +/obj/item/hardpoint/support/recon_system/on_install(obj/vehicle/multitile/blackfoot/vehicle) + if(!istype(vehicle)) + return + + RegisterSignal(src, COMSIG_BLACKFOOT_ACTIONS_UPDATE, PROC_REF(handle_action_update)) + +/obj/item/hardpoint/support/recon_system/proc/handle_action_update(should_remove_action = FALSE) + var/obj/vehicle/multitile/blackfoot/blackfoot_owner = owner + + if(!blackfoot_owner) + return + + var/mob/user = blackfoot_owner.seats[VEHICLE_DRIVER] + + if(!user) + return + + if(should_remove_action) + remove_action(user, /datum/action/human_action/blackfoot/recon_mode) + else + give_action(user, /datum/action/human_action/blackfoot/recon_mode) + +/datum/action/human_action/blackfoot/recon_mode/action_activate() + var/obj/vehicle/multitile/blackfoot/vehicle = owner.interactee + + if(!istype(vehicle)) + return + + . = ..() + + for(var/obj/item/hardpoint/support/recon_system/recon_system in vehicle.hardpoints) + if(recon_system.active) + recon_system.deactivate() + else + recon_system.activate() + +/obj/item/hardpoint/support/recon_system/get_icon_image(x_offset, y_offset, new_dir) + var/obj/vehicle/multitile/blackfoot/blackfoot_owner = owner + + if(!blackfoot_owner) + return + + var/image/icon = image(icon = disp_icon, icon_state = "[disp_icon_state]_[blackfoot_owner.get_sprite_state()]", pixel_x = x_offset, pixel_y = y_offset, dir = new_dir) + + return icon + +/obj/item/hardpoint/support/recon_system/deactivate() + var/obj/vehicle/multitile/blackfoot/blackfoot_owner = owner + + if(!blackfoot_owner) + return + + var/mob/user = blackfoot_owner.seats[VEHICLE_DRIVER] + var/area/interior_area = blackfoot_owner.interior_area + + + if(!user) + return + + if(interior_area) + interior_area.set_base_lighting(COLOR_WHITE, 255) + + active = FALSE + +/obj/item/hardpoint/support/recon_system/proc/activate() + set name = "Toggle Recon Mode" + set desc = "Toggle between stowed and deployed mode." + set category = "Vehicle" + + var/obj/vehicle/multitile/blackfoot/blackfoot_owner = owner + + if(!blackfoot_owner) + return + + var/mob/user = blackfoot_owner.seats[VEHICLE_DRIVER] + var/area/interior_area = blackfoot_owner.interior_area + + if(!user) + return + + if(interior_area) + interior_area.set_base_lighting("#BB3F3F", 200) + + active = TRUE diff --git a/code/modules/vehicles/interior/areas.dm b/code/modules/vehicles/interior/areas.dm index 58ab7def2e71..b036fe577933 100644 --- a/code/modules/vehicles/interior/areas.dm +++ b/code/modules/vehicles/interior/areas.dm @@ -48,3 +48,4 @@ /area/interior/vehicle/blackfoot name = "blackfoot interior" ambience_exterior = 'sound/vehicles/vtol/interior.ogg' + base_lighting_alpha = 0 // baselighting will be set by on_load in interior diff --git a/colonialmarines.dme b/colonialmarines.dme index 6252acb0dfe7..30d01532a6a0 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -2630,6 +2630,7 @@ #include "code\modules\vehicles\hardpoints\support\flare.dm" #include "code\modules\vehicles\hardpoints\support\iwsa.dm" #include "code\modules\vehicles\hardpoints\support\overdrive.dm" +#include "code\modules\vehicles\hardpoints\support\recon_system.dm" #include "code\modules\vehicles\hardpoints\support\sensor_array.dm" #include "code\modules\vehicles\hardpoints\support\support.dm" #include "code\modules\vehicles\hardpoints\wheels\apc_wheels.dm"