diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 21f7b6b0a9be..52a35b715b1a 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -45,7 +45,10 @@ if(orbiting) orbiting.end_orbit(src) orbiting = null - vis_contents.Cut() + + vis_locs = null //clears this atom out of all viscontents + if(length(vis_contents)) + vis_contents.Cut() . = ..() moveToNullspace() //so we move into null space. Must be after ..() b/c atom's Dispose handles deleting our lighting stuff diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index 9d950a1697e7..2292df761894 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -1453,10 +1453,6 @@ GLOBAL_DATUM_INIT(supply_controller, /datum/controller/supply, new()) world.log << "## ERROR: Eek. The supply/elevator datum is missing somehow." return - if(!should_block_game_interaction(SSshuttle.vehicle_elevator)) - to_chat(usr, SPAN_WARNING("The elevator needs to be in the cargo bay dock to call a vehicle up. Ask someone to send it away.")) - return - if(ismaintdrone(usr)) return diff --git a/code/modules/cm_tech/techs/marine/tier1/arc.dm b/code/modules/cm_tech/techs/marine/tier1/arc.dm index b16fdad2289a..bde5a839c769 100644 --- a/code/modules/cm_tech/techs/marine/tier1/arc.dm +++ b/code/modules/cm_tech/techs/marine/tier1/arc.dm @@ -1,7 +1,7 @@ /datum/tech/arc name = "M540 Armored Recon Carrier" desc = "Purchase an M540 Armored Recon Carrier, specialized in assisting groundside command. Able to be driven by Staff Officers, Executive Officers, and Commanding Officers." - icon_state = "ltb" //zonenote changeme + icon_state = "upgrade" required_points = 0 //zonenote @@ -15,8 +15,8 @@ /datum/tech/arc/on_unlock() . = ..() - var/obj/structure/machinery/computer/supplycomp/vehicle/comp = VehicleElevatorConsole - var/obj/structure/machinery/cm_vending/gear/vehicle_crew/gearcomp = VehicleGearConsole + var/obj/structure/machinery/computer/supplycomp/vehicle/comp = GLOB.VehicleElevatorConsole + var/obj/structure/machinery/cm_vending/gear/vehicle_crew/gearcomp = GLOB.VehicleGearConsole if(!comp || !gearcomp) return FALSE diff --git a/code/modules/mob/living/carbon/human/human_abilities.dm b/code/modules/mob/living/carbon/human/human_abilities.dm index a568e93df5c0..2d7f472952cc 100644 --- a/code/modules/mob/living/carbon/human/human_abilities.dm +++ b/code/modules/mob/living/carbon/human/human_abilities.dm @@ -605,3 +605,26 @@ CULT var/mob/living/carbon/human/human_user = owner SEND_SIGNAL(human_user, COMSIG_MOB_MG_EXIT) + +/datum/action/human_action/toggle_arc_antenna + name = "Toggle Sensor Antenna" + action_icon_state = "recoil_compensation" + +/datum/action/human_action/toggle_arc_antenna/give_to(mob/user) + . = ..() + RegisterSignal(user, COMSIG_MOB_RESET_VIEW, PROC_REF(remove_from)) + +/datum/action/human_action/toggle_arc_antenna/remove_from(mob/user) + . = ..() + UnregisterSignal(user, COMSIG_MOB_RESET_VIEW) + +/datum/action/human_action/toggle_arc_antenna/action_activate() + if(!can_use_action()) + return + + var/mob/living/carbon/human/human_user = owner + if(istype(human_user.buckled, /obj/structure/bed/chair/comfy/vehicle)) + var/obj/structure/bed/chair/comfy/vehicle/vehicle_chair = human_user.buckled + if(istype(vehicle_chair.vehicle, /obj/vehicle/multitile/arc)) + var/obj/vehicle/multitile/arc/vehicle = vehicle_chair.vehicle + vehicle.toggle_antenna(human_user) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index d8373da7aeb8..e6a71f5a2400 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -515,7 +515,8 @@ else direct_hit = TRUE - SEND_SIGNAL(firer, COMSIG_BULLET_DIRECT_HIT, L) + if(firer) + SEND_SIGNAL(firer, COMSIG_BULLET_DIRECT_HIT, L) // At present, Xenos have no inherent effects or localized damage stemming from limb targeting // Therefore we exempt the shooter from direct hit accuracy penalties as well, @@ -582,7 +583,7 @@ if(SEND_SIGNAL(src, COMSIG_BULLET_POST_HANDLE_MOB, L, .) & COMPONENT_BULLET_PASS_THROUGH) return FALSE -/obj/item/projectile/proc/check_canhit(turf/current_turf, turf/next_turf) +/obj/projectile/proc/check_canhit(turf/current_turf, turf/next_turf) var/proj_dir = get_dir(current_turf, next_turf) if((proj_dir & (proj_dir - 1)) && !current_turf.Adjacent(next_turf)) ammo.on_hit_turf(current_turf, src) diff --git a/code/modules/vehicles/arc/arc.dm b/code/modules/vehicles/arc/arc.dm index bfc9c2255875..bc68b619d19b 100644 --- a/code/modules/vehicles/arc/arc.dm +++ b/code/modules/vehicles/arc/arc.dm @@ -3,7 +3,7 @@ desc = "An M540-A Armored Recon Carrier. A lightly armored reconnaissance and intelligence vehicle. Entrances on the sides." icon = 'icons/obj/vehicles/arc.dmi' - icon_state = "arc_base" //Holdover until thwomp does his thing + icon_state = "arc_base" pixel_x = -48 pixel_y = -48 @@ -16,7 +16,7 @@ interior_map = /datum/map_template/interior/arc passengers_slots = 3 - xenos_slots = 8 + xenos_slots = 5 entrances = list( "left" = list(2, 0), @@ -37,6 +37,7 @@ hardpoints_allowed = list( /obj/item/hardpoint/locomotion/apc_wheels, /obj/item/hardpoint/primary/arc_sentry, + /obj/item/hardpoint/support/arc_antenna, ) seats = list( @@ -85,6 +86,9 @@ RegisterSignal(src, COMSIG_ARC_ANTENNA_TOGGLED, PROC_REF(on_antenna_toggle)) +/obj/vehicle/multitile/arc/crew_mousedown(datum/source, atom/object, turf/location, control, params) + return + /obj/vehicle/multitile/arc/proc/on_antenna_toggle(datum/source) SIGNAL_HANDLER @@ -136,12 +140,19 @@ RRS.total = 1 role_reserved_slots += RRS +/obj/vehicle/multitile/arc/set_seated_mob(seat, mob/living/M) + . = ..() + if(!.) + return + + give_action(M, /datum/action/human_action/toggle_arc_antenna) + /obj/vehicle/multitile/arc/add_seated_verbs(mob/living/M, seat) if(!M.client) return add_verb(M.client, list( /obj/vehicle/multitile/proc/get_status_info, - /obj/vehicle/multitile/arc/open_controls_guide, + //obj/vehicle/multitile/proc/open_controls_guide, /obj/vehicle/multitile/proc/toggle_door_lock, /obj/vehicle/multitile/proc/activate_horn, /obj/vehicle/multitile/proc/name_vehicle, @@ -153,7 +164,7 @@ return remove_verb(M.client, list( /obj/vehicle/multitile/proc/get_status_info, - /obj/vehicle/multitile/arc/proc/open_controls_guide, + //obj/vehicle/multitile/proc/open_controls_guide, /obj/vehicle/multitile/proc/toggle_door_lock, /obj/vehicle/multitile/proc/activate_horn, /obj/vehicle/multitile/proc/name_vehicle, @@ -165,11 +176,11 @@ if(!camera) camera = new /obj/structure/machinery/camera/vehicle(src) if(change_tag) - camera.c_tag = "#[rand(1,100)] M540 \"[nickname]\" ARC" + camera.c_tag = "#[rand(1,100)] M540-A \"[nickname]\" ARC" if(camera_int) camera_int.c_tag = camera.c_tag + " interior" else - camera.c_tag = "#[rand(1,100)] 540 ARC" + camera.c_tag = "#[rand(1,100)] 540-A ARC" if(camera_int) camera_int.c_tag = camera.c_tag + " interior" @@ -197,5 +208,6 @@ ARC.update_icon() /obj/effect/vehicle_spawner/arc/load_hardpoints(obj/vehicle/multitile/arc/vehicle) - vehicle.add_hardpoint(new /obj/item/hardpoint/locomotion/apc_wheels) + vehicle.add_hardpoint(new /obj/item/hardpoint/locomotion/arc_wheels) vehicle.add_hardpoint(new /obj/item/hardpoint/primary/arc_sentry) + vehicle.add_hardpoint(new /obj/item/hardpoint/support/arc_antenna) diff --git a/code/modules/vehicles/arc/verbs.dm b/code/modules/vehicles/arc/verbs.dm index c60c5c4e9129..f977beca2488 100644 --- a/code/modules/vehicles/arc/verbs.dm +++ b/code/modules/vehicles/arc/verbs.dm @@ -1,9 +1,9 @@ -/obj/vehicle/multitile/arc/proc/toggle_antenna() +/obj/vehicle/multitile/arc/proc/toggle_antenna(mob/toggler) set name = "Toggle Sensor Antenna" set desc = "Raises or lowers the external sensor antenna. While raised, the ARC cannot move." set category = "Vehicle" - var/mob/user = usr + var/mob/user = toggler || usr if(!user || !istype(user)) return @@ -24,24 +24,50 @@ to_chat(user, SPAN_WARNING("[vehicle]'s hull is too damaged to operate!")) return + var/obj/item/hardpoint/support/arc_antenna/antenna = locate() in vehicle.hardpoints + if(!antenna) + to_chat(user, SPAN_WARNING("[vehicle] has no antenna mounted!")) + return + + if(antenna.health <= 0) + to_chat(user, SPAN_WARNING("[antenna] is broken!")) + return + if(vehicle.antenna_deployed) - to_chat(user, SPAN_NOTICE("You begin to retract the antenna...")) - if(!do_after(user, vehicle.antenna_toggle_time, target = vehicle)) + to_chat(user, SPAN_NOTICE("You begin to retract [antenna]...")) + if(!do_after(user, max(vehicle.antenna_toggle_time - antenna.deploy_animation_time, 1 SECONDS), target = vehicle)) + to_chat(user, SPAN_NOTICE("You stop retracting [antenna].")) return - STOP_PROCESSING(SSslowobj, vehicle) - to_chat(user, SPAN_NOTICE("You retract the antenna, enabling the ARC to move again.")) + + antenna.retract_antenna() + addtimer(CALLBACK(vehicle, PROC_REF(finish_antenna_retract), vehicle, user), antenna.deploy_animation_time) else - to_chat(user, SPAN_NOTICE("You begin to extend the antenna...")) - if(!do_after(user, vehicle.antenna_toggle_time, target = vehicle)) + to_chat(user, SPAN_NOTICE("You begin to extend [antenna]...")) + if(!do_after(user, max(vehicle.antenna_toggle_time - antenna.deploy_animation_time, 1 SECONDS), target = vehicle)) + to_chat(user, SPAN_NOTICE("You stop extending [antenna].")) return - START_PROCESSING(SSslowobj, vehicle) - to_chat(user, SPAN_NOTICE("You extend the antenna, locking the ARC in place.")) + antenna.deploy_antenna() + addtimer(CALLBACK(vehicle, PROC_REF(finish_antenna_deploy), vehicle, user), antenna.deploy_animation_time) + +/obj/vehicle/multitile/arc/proc/finish_antenna_retract(obj/vehicle/multitile/arc/vehicle, mob/user) + var/obj/item/hardpoint/support/arc_antenna/antenna = locate() in vehicle.hardpoints + STOP_PROCESSING(SSslowobj, vehicle) + to_chat(user, SPAN_NOTICE("You retract [antenna], enabling the ARC to move again.")) playsound(user, 'sound/machines/hydraulics_2.ogg', 80, TRUE) vehicle.antenna_deployed = !vehicle.antenna_deployed + vehicle.update_icon() SEND_SIGNAL(vehicle, COMSIG_ARC_ANTENNA_TOGGLED) +/obj/vehicle/multitile/arc/proc/finish_antenna_deploy(obj/vehicle/multitile/arc/vehicle, mob/user) + var/obj/item/hardpoint/support/arc_antenna/antenna = locate() in vehicle.hardpoints + START_PROCESSING(SSslowobj, vehicle) + to_chat(user, SPAN_NOTICE("You extend [antenna], locking the ARC in place.")) + playsound(user, 'sound/machines/hydraulics_2.ogg', 80, TRUE) + vehicle.antenna_deployed = !vehicle.antenna_deployed + vehicle.update_icon() + SEND_SIGNAL(vehicle, COMSIG_ARC_ANTENNA_TOGGLED) /obj/vehicle/multitile/arc/open_controls_guide() set name = "Vehicle Controls Guide" diff --git a/code/modules/vehicles/hardpoints/hardpoint.dm b/code/modules/vehicles/hardpoints/hardpoint.dm index 21e3e4b29f89..dff08004ba95 100644 --- a/code/modules/vehicles/hardpoints/hardpoint.dm +++ b/code/modules/vehicles/hardpoints/hardpoint.dm @@ -581,7 +581,6 @@ /// Wrapper proc for the autofire system to ensure the important args aren't null. /obj/item/hardpoint/proc/fire_wrapper(atom/target, mob/living/user, params) - SHOULD_NOT_OVERRIDE(TRUE) if(!target) target = src.target if(!user) diff --git a/code/modules/vehicles/hardpoints/hardpoint_ammo/arc_sentry_ammo.dm b/code/modules/vehicles/hardpoints/hardpoint_ammo/arc_sentry_ammo.dm index 9808e8c692b1..a364564719df 100644 --- a/code/modules/vehicles/hardpoints/hardpoint_ammo/arc_sentry_ammo.dm +++ b/code/modules/vehicles/hardpoints/hardpoint_ammo/arc_sentry_ammo.dm @@ -1,6 +1,6 @@ /obj/item/ammo_magazine/hardpoint/arc_sentry name = "\improper RE700 Rotary Cannon Magazine" - desc = "A magazine for RE700 Rotary Cannon filled with 20mm rounds. Slightly contuses targets upon hit. Supports IFF." + desc = "A magazine for RE700 Rotary Cannon filled with 20mm rounds. Supports IFF." caliber = "20mm" icon_state = "ace_autocannon" //zonenote w_class = SIZE_LARGE diff --git a/code/modules/vehicles/hardpoints/primary/arc_sentry.dm b/code/modules/vehicles/hardpoints/primary/arc_sentry.dm index 6c6932b8b4a2..4db6e251968e 100644 --- a/code/modules/vehicles/hardpoints/primary/arc_sentry.dm +++ b/code/modules/vehicles/hardpoints/primary/arc_sentry.dm @@ -1,7 +1,7 @@ // APC cannons /obj/item/hardpoint/primary/arc_sentry name = "\improper RE700 Rotary Cannon" - desc = "A primary two-barrel cannon for the APC that shoots 20mm IFF-compatible rounds." + desc = "A primary two-barrel cannon for the ARC that shoots 12.7mm IFF-compatible rounds." icon = 'icons/obj/vehicles/hardpoints/arc.dmi' icon_state = "autocannon" @@ -12,7 +12,7 @@ damage_multiplier = 0.1 health = 125 - origins = list(0, -2) + origins = list(0, 1) ammo = new /obj/item/ammo_magazine/hardpoint/arc_sentry max_clips = 2 @@ -22,21 +22,26 @@ muzzleflash_icon_state = "muzzle_flash_double" muzzle_flash_pos = list( - "1" = list(11, -29), - "2" = list(-11, 10), - "4" = list(-14, 9), - "8" = list(14, 9) + "1" = list(1, 0), + "2" = list(1, -25), + "4" = list(16, -4), + "8" = list(-16, -4) ) + gun_firemode = GUN_FIREMODE_BURSTFIRE + gun_firemode_list = list( + GUN_FIREMODE_BURSTFIRE, + ) + burst_delay = 2 + burst_amount = 3 + /// Potential targets the turret can shoot at var/list/targets = list() - /// The currently focused target - var/atom/movable/target = null + /// The currently focused sentry target + var/atom/movable/sentry_target = null /// The range that this turret can shoot at the furthest var/turret_range = 4 /// What factions this sentry is aligned with var/faction_group = FACTION_LIST_MARINE - /// How many rounds will fire in a burst - var/burst_amount = 3 /obj/item/hardpoint/primary/arc_sentry/on_install(obj/vehicle/multitile/V) . = ..() @@ -45,34 +50,13 @@ /obj/item/hardpoint/primary/arc_sentry/on_uninstall(obj/vehicle/multitile/V) . = ..() UnregisterSignal(owner, COMSIG_ARC_ANTENNA_TOGGLED) - fast_machines -= src + START_PROCESSING(SSfastobj, src) /obj/item/hardpoint/primary/arc_sentry/Destroy() - fast_machines -= src - target = null + STOP_PROCESSING(SSfastobj, src) + sentry_target = null return ..() -/obj/item/hardpoint/primary/arc_sentry/get_icon_image(x_offset, y_offset, new_dir) - var/is_broken = health <= 0 - var/antenna_extended = FALSE - if(istype(owner, /obj/vehicle/multitile/arc)) - var/obj/vehicle/multitile/arc/arc_owner = owner - antenna_extended = arc_owner.antenna_deployed - - var/image/I = image(icon = disp_icon, icon_state = "[disp_icon_state]_[antenna_extended ? "extended" : "cover"]_[is_broken ? "1" : "0"]", pixel_x = x_offset, pixel_y = y_offset, dir = new_dir) - switch(round((health / initial(health)) * 100)) - if(0 to 20) - I.color = "#4e4e4e" - if(21 to 40) - I.color = "#6e6e6e" - if(41 to 60) - I.color = "#8b8b8b" - if(61 to 80) - I.color = "#bebebe" - else - I.color = null - return I - /obj/item/hardpoint/primary/arc_sentry/proc/toggle_processing() SIGNAL_HANDLER if(!owner) @@ -80,10 +64,10 @@ var/obj/vehicle/multitile/arc/vehicle = owner if(vehicle.antenna_deployed) - fast_machines |= src + START_PROCESSING(SSfastobj, src) else - fast_machines -= src + STOP_PROCESSING(SSfastobj, src) /obj/item/hardpoint/primary/arc_sentry/process() for(var/mob/living/in_range_mob in range(turret_range, owner)) @@ -92,10 +76,10 @@ if(!length(targets)) return FALSE - if(!target && length(targets)) - target = pick(targets) + if(!sentry_target && length(targets)) + sentry_target = pick(targets) - get_target(target) + get_target(sentry_target) return TRUE /obj/item/hardpoint/primary/arc_sentry/set_bullet_traits() @@ -104,42 +88,79 @@ BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_iff) )) -/obj/item/hardpoint/primary/arc_sentry/fire(atom/movable/target) - set waitfor = FALSE - if(ammo.current_rounds <= 0) - return +/obj/item/hardpoint/primary/arc_sentry/fire_wrapper(atom/target, mob/living/user, params) + if(!target) + target = src.target + if(!target) + return NONE + + return try_fire(target, null, params) + +/obj/item/hardpoint/primary/arc_sentry/clear_los() + var/turf/muzzle_turf = get_origin_turf() - next_use = world.time + cooldown * owner.misc_multipliers["cooldown"] + var/turf/checking_turf = muzzle_turf + while(!(owner in checking_turf)) + // Dense turfs block LoS + if(checking_turf.density) + return FALSE - for(var/bullets_fired in 1 to burst_amount) - var/atom/tile = target - if(!prob((accuracy * 100) / owner.misc_multipliers["accuracy"])) - tile = get_step(get_turf(target), pick(cardinal)) - if(LAZYLEN(activation_sounds)) - playsound(src, pick(activation_sounds), 60, 1) - fire_projectile(tile) - if(ammo.current_rounds <= 0) - break - if(bullets_fired < burst_amount) - sleep(2) + // Ensure that we can pass over all objects in the turf + for(var/obj/object in checking_turf) + // Since vehicles are multitile the + if(object == owner) + continue + + // Non-dense objects are irrelevant + if(!object.density) + continue + + // Make sure we can pass object from all directions + if(!HAS_FLAG(object.pass_flags.flags_can_pass_all, PASS_OVER_THROW_ITEM)) + if(!HAS_FLAG(object.flags_atom, ON_BORDER)) + return FALSE + //If we're behind the object, check the behind pass flags + else if(dir == object.dir && !HAS_FLAG(object.pass_flags.flags_can_pass_behind, PASS_OVER_THROW_ITEM)) + return FALSE + //If we're in front, check front pass flags + else if(dir == turn(object.dir, 180) && !HAS_FLAG(object.pass_flags.flags_can_pass_front, PASS_OVER_THROW_ITEM)) + return FALSE -/obj/item/hardpoint/primary/arc_sentry/fire_projectile(atom/movable/target) - set waitfor = FALSE + // Trace back towards the vehicle + checking_turf = get_step(checking_turf, turn(dir,180)) - var/turf/origin_turf = get_turf(src) + return TRUE + +/obj/item/hardpoint/primary/arc_sentry/handle_fire(atom/target, mob/living/user, params) + var/turf/origin_turf = get_origin_turf() //origin_turf = locate(origin_turf.x + origins[1], origin_turf.y + origins[2], origin_turf.z) //zonenote - var/obj/item/projectile/arc_sentry/new_bullet = generate_bullet(origin_turf) + var/obj/projectile/arc_sentry/new_bullet = generate_bullet(origin_turf) + ammo.current_rounds-- + SEND_SIGNAL(new_bullet, COMSIG_BULLET_USER_EFFECTS, user) new_bullet.runtime_iff_group = faction_group // Technically shouldn't be directly modifying this, but sue me - new_bullet.fire_at(target, owner, origin_turf, new_bullet.ammo.max_range, new_bullet.ammo.shell_speed) //zonenote origin + //new_bullet.fire_at(fire_target, owner, origin_turf, new_bullet.ammo.max_range, new_bullet.ammo.shell_speed) //zonenote origin + // turf-targeted projectiles are fired without scatter, because proc would raytrace them further away + var/ammo_flags = new_bullet.ammo.flags_ammo_behavior | new_bullet.projectile_override_flags + if(!HAS_FLAG(ammo_flags, AMMO_HITS_TARGET_TURF) && !HAS_FLAG(ammo_flags, AMMO_EXPLOSIVE)) //AMMO_EXPLOSIVE is also a turf-targeted projectile + new_bullet.scatter = scatter + target = simulate_scatter(new_bullet, target, origin_turf, get_turf(target), user) + + INVOKE_ASYNC(new_bullet, TYPE_PROC_REF(/obj/projectile, fire_at), target, user, src, new_bullet.ammo.max_range, new_bullet.ammo.shell_speed) + new_bullet = null + + shots_fired++ + play_firing_sounds() if(use_muzzle_flash) muzzle_flash(Get_Angle(origin_turf, target)) - ammo.current_rounds-- + set_fire_cooldown(gun_firemode) + return AUTOFIRE_CONTINUE + /obj/item/hardpoint/primary/arc_sentry/generate_bullet(turf/origin_turf) - var/obj/item/projectile/arc_sentry/new_proj = new(origin_turf, create_cause_data(initial(name), owner)) + var/obj/projectile/arc_sentry/new_proj = new(origin_turf, create_cause_data(initial(name), owner)) new_proj.generate_bullet(new ammo.default_ammo) new_proj.permutated += owner // Apply bullet traits from gun @@ -154,6 +175,28 @@ new_proj.apply_bullet_trait(trait_list) return new_proj +/obj/item/hardpoint/primary/arc_sentry/start_fire(datum/source, atom/object, turf/location, control, params) + if(istype(object, /atom/movable/screen)) + return + + if(QDELETED(object)) + return + + if(!auto_firing && !burst_firing && !COOLDOWN_FINISHED(src, fire_cooldown)) + if(max(fire_delay, burst_delay + extra_delay) >= 2.0 SECONDS) //filter out guns with high firerate to prevent message spam. + to_chat(source, SPAN_WARNING("You need to wait [SPAN_HELPFUL(COOLDOWN_SECONDSLEFT(src, fire_cooldown))] seconds before [name] can be used again.")) + return + + set_target(object) + + if(gun_firemode == GUN_FIREMODE_SEMIAUTO) + var/fire_return = try_fire(object, source, params) + //end-of-fire, show ammo (if changed) + if(fire_return == AUTOFIRE_CONTINUE) + reset_fire() + display_ammo(source) + else + SEND_SIGNAL(src, COMSIG_GUN_FIRE) /obj/item/hardpoint/primary/arc_sentry/proc/get_target(atom/movable/new_target) if(!islist(targets)) @@ -171,21 +214,21 @@ if(isliving(movable)) var/mob/living/living_mob = movable if(living_mob.stat & DEAD) - if(movable == target) - target = null + if(movable == sentry_target) + sentry_target = null targets.Remove(movable) continue if(living_mob.get_target_lock(faction_group) || living_mob.invisibility || HAS_TRAIT(living_mob, TRAIT_ABILITY_BURROWED)) - if(living_mob == target) - target = null + if(living_mob == sentry_target) + sentry_target = null targets.Remove(living_mob) continue var/list/turf/path = getline2(get_turf(src), movable, include_from_atom = FALSE) if(!length(path)|| get_dist(get_turf(src), movable) > turret_range) - if(movable == target) - target = null + if(movable == sentry_target) + sentry_target = null targets.Remove(movable) continue @@ -211,8 +254,8 @@ break if(blocked) - if(movable == target) - target = null + if(movable == sentry_target) + sentry_target = null targets.Remove(movable) continue @@ -223,19 +266,22 @@ else conscious_targets += living_mob - if(length(conscious_targets)) - target = pick(conscious_targets) + if((sentry_target in conscious_targets) || (sentry_target in unconscious_targets)) + sentry_target = sentry_target + + else if(length(conscious_targets)) + sentry_target = pick(conscious_targets) else if(length(unconscious_targets)) - target = pick(unconscious_targets) + sentry_target = pick(unconscious_targets) - if(!target) //No targets, don't bother firing + if(!sentry_target) //No targets, don't bother firing return - fire(target) + start_fire(object = sentry_target) -/obj/item/projectile/arc_sentry/check_canhit(turf/current_turf, turf/next_turf) +/obj/projectile/arc_sentry/check_canhit(turf/current_turf, turf/next_turf) var/proj_dir = get_dir(current_turf, next_turf) if(!(firer in current_turf) && !(firer in next_turf) && (proj_dir & (proj_dir - 1)) && !current_turf.Adjacent(next_turf)) ammo.on_hit_turf(current_turf, src) diff --git a/code/modules/vehicles/hardpoints/support/antenna.dm b/code/modules/vehicles/hardpoints/support/antenna.dm new file mode 100644 index 000000000000..b17119e5a81d --- /dev/null +++ b/code/modules/vehicles/hardpoints/support/antenna.dm @@ -0,0 +1,70 @@ +/obj/item/hardpoint/support/arc_antenna + name = "\improper U-56 Communications Antenna" + desc = "A heavy-duty antenna built for the ARC." + icon = 'icons/obj/vehicles/hardpoints/arc.dmi' + + icon_state = "antenna" + disp_icon = "arc" + disp_icon_state = "antenna" + + damage_multiplier = 0.1 + + health = 500 + + /// How long the antenna deploy/retract animation is, keep accurate to the sprite in the dmi + var/deploy_animation_time = 1.7 SECONDS + +/obj/item/hardpoint/support/arc_antenna/proc/deploy_antenna() + set waitfor = FALSE + + disp_icon_state = "" + if(owner) + owner.update_icon() + var/obj/dummy_obj = new() + dummy_obj.icon = 'icons/obj/vehicles/arc.dmi' + dummy_obj.icon_state = "antenna_cover_0" + dummy_obj.dir = owner.dir + dummy_obj.vis_flags = VIS_INHERIT_ID | VIS_INHERIT_LAYER | VIS_INHERIT_PLANE + owner.vis_contents += dummy_obj + flick("antenna_extending", dummy_obj) + sleep(deploy_animation_time) + qdel(dummy_obj) + disp_icon_state = initial(disp_icon_state) + +/obj/item/hardpoint/support/arc_antenna/proc/retract_antenna() + set waitfor = FALSE + + disp_icon_state = "" + if(owner) + owner.update_icon() + var/obj/dummy_obj = new() + dummy_obj.icon = 'icons/obj/vehicles/arc.dmi' + dummy_obj.icon_state = "antenna_cover_0" + dummy_obj.dir = owner.dir + dummy_obj.vis_flags = VIS_INHERIT_ID | VIS_INHERIT_LAYER | VIS_INHERIT_PLANE + owner.vis_contents += dummy_obj + flick("antenna_retracting", dummy_obj) + sleep(deploy_animation_time) + qdel(dummy_obj) + disp_icon_state = initial(disp_icon_state) + +/obj/item/hardpoint/support/arc_antenna/get_icon_image(x_offset, y_offset, new_dir) + var/is_broken = health <= 0 + var/antenna_extended = FALSE + if(istype(owner, /obj/vehicle/multitile/arc)) + var/obj/vehicle/multitile/arc/arc_owner = owner + antenna_extended = arc_owner.antenna_deployed + + var/image/I = image(icon = disp_icon, icon_state = "[disp_icon_state]_[antenna_extended ? "extended" : "cover"]_[is_broken ? "1" : "0"]", pixel_x = x_offset, pixel_y = y_offset, dir = new_dir) + switch(round((health / initial(health)) * 100)) + if(0 to 20) + I.color = "#4e4e4e" + if(21 to 40) + I.color = "#6e6e6e" + if(41 to 60) + I.color = "#8b8b8b" + if(61 to 80) + I.color = "#bebebe" + else + I.color = null + return I diff --git a/code/modules/vehicles/multitile/multitile.dm b/code/modules/vehicles/multitile/multitile.dm index f3b7be510b08..18dade67b834 100644 --- a/code/modules/vehicles/multitile/multitile.dm +++ b/code/modules/vehicles/multitile/multitile.dm @@ -334,11 +334,12 @@ // Checked here because we want to be able to null the mob in a seat if(!istype(M)) - return + return FALSE M.set_interaction(src) M.reset_view(src) give_action(M, /datum/action/human_action/vehicle_unbuckle) + return TRUE /// Get crewmember of seat. /obj/vehicle/multitile/proc/get_seat_mob(seat) diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm index 2239329d3e44..905c66927c24 100644 --- a/code/modules/vehicles/vehicle.dm +++ b/code/modules/vehicles/vehicle.dm @@ -155,10 +155,11 @@ // Checked here because we want to be able to null the mob in a seat if(!istype(M)) - return + return FALSE M.forceMove(src) M.set_interaction(src) + return TRUE /obj/vehicle/proc/turn_on() if(stat) diff --git a/colonialmarines.dme b/colonialmarines.dme index 85179be69c46..01497c92bc9f 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -396,8 +396,8 @@ #include "code\datums\components\cell.dm" #include "code\datums\components\cluster_stack.dm" #include "code\datums\components\connect_mob_behalf.dm" -#include "code\datums\components\disk_reader.dm" #include "code\datums\components\crate_tag.dm" +#include "code\datums\components\disk_reader.dm" #include "code\datums\components\footstep.dm" #include "code\datums\components\healing_reduction.dm" #include "code\datums\components\id_lock.dm" @@ -2443,12 +2443,14 @@ #include "code\modules\vehicles\hardpoints\secondary\tow.dm" #include "code\modules\vehicles\hardpoints\special\firing_port_weapon.dm" #include "code\modules\vehicles\hardpoints\special\special.dm" +#include "code\modules\vehicles\hardpoints\support\antenna.dm" #include "code\modules\vehicles\hardpoints\support\artillery.dm" #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\support.dm" #include "code\modules\vehicles\hardpoints\wheels\apc_wheels.dm" +#include "code\modules\vehicles\hardpoints\wheels\arc_wheels.dm" #include "code\modules\vehicles\hardpoints\wheels\locomotion.dm" #include "code\modules\vehicles\hardpoints\wheels\treads.dm" #include "code\modules\vehicles\hardpoints\wheels\van_wheels.dm" diff --git a/icons/obj/vehicles/arc.dmi b/icons/obj/vehicles/arc.dmi index 2d62c6218a7a..b44cf45b3a5d 100644 Binary files a/icons/obj/vehicles/arc.dmi and b/icons/obj/vehicles/arc.dmi differ diff --git a/icons/obj/vehicles/hardpoints/arc.dmi b/icons/obj/vehicles/hardpoints/arc.dmi index ca2bcc39da25..72854adf2382 100644 Binary files a/icons/obj/vehicles/hardpoints/arc.dmi and b/icons/obj/vehicles/hardpoints/arc.dmi differ