Removes bridge crew access to the ammunition room and flak, other changes. (#15084)

* Removes bridge crew access to the ammunition room and flak, other changes.

* fffff

* fix projectiles not deleting at map end; projectile range nerf; wrap-around; leviathan projectile speed up

* fixes

* automatic detargeting

* fix that

Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
Matt Atlas
2022-11-15 23:04:08 +01:00
committed by GitHub
co-authored by Matt Atlas
parent 178a3d5fd9
commit 0d52eea501
12 changed files with 161 additions and 46 deletions
+2 -1
View File
@@ -99,7 +99,8 @@
C.targeting = FALSE
/obj/effect/overmap/visitable/proc/detarget(var/obj/effect/overmap/O, var/obj/machinery/computer/C)
playsound(C, 'sound/items/rfd_interrupt.ogg')
if(C)
playsound(C, 'sound/items/rfd_interrupt.ogg')
if(O)
O.cut_overlay(O.targeted_overlay)
O.maptext = null
+5
View File
@@ -54,7 +54,11 @@ var/global/area/overmap/map_overmap // Global object used to locate the overmap
LAZYADD(SSshuttle.sectors_to_initialize, src) //Queued for further init. Will populate the waypoint lists; waypoints not spawned yet will be added in as they spawn.
SSshuttle.clear_init_queue()
START_PROCESSING(SSprocessing, src)
/obj/effect/overmap/visitable/process()
if(get_dist(src, targeting) > 7)
detarget(targeting)
/obj/effect/overmap/visitable/Destroy()
for(var/obj/machinery/hologram/holopad/H as anything in SSmachinery.all_holopads)
@@ -71,6 +75,7 @@ var/global/area/overmap/map_overmap // Global object used to locate the overmap
ship_weapons.Cut()
targeting = null
levi_safeguard = null
STOP_PROCESSING(SSprocessing, src)
. = ..()
//This is called later in the init order by SSshuttle to populate sector objects. Importantly for subtypes, shuttles will be created by then.
@@ -5,6 +5,8 @@
icon_state = "ammo_loader"
density = TRUE
anchored = TRUE
var/damage = 0
var/max_damage = 1000
var/obj/machinery/ship_weapon/weapon
var/weapon_id //Used to connect weapon systems to the relevant ammunition loader.
@@ -22,6 +24,23 @@
if(!weapon)
crash_with("[src] at [x] [y] [z] has no weapon attached!")
/obj/machinery/ammunition_loader/ex_act(severity)
switch(severity)
if(1)
add_damage(50)
if(2)
add_damage(25)
if(3)
add_damage(10)
/obj/machinery/ammunition_loader/proc/add_damage(var/amount)
damage = max(0, min(damage + amount, max_damage))
update_damage()
/obj/machinery/ammunition_loader/proc/update_damage()
if(damage >= max_damage)
qdel(src)
/obj/machinery/ammunition_loader/attackby(obj/item/W, mob/user)
if(isliving(user))
var/mob/living/carbon/human/H = user
@@ -23,6 +23,7 @@
var/obj/entry_point
var/obj/item/projectile/original_projectile
var/heading = SOUTH
var/range = OVERMAP_PROJECTILE_RANGE_MEDIUM
//Cookoff variables.
var/cookoff_devastation = 0
@@ -177,6 +178,7 @@
P.desc = desc
P.ammunition = src
P.target = overmap_target
P.range = range
if(istype(origin, /obj/effect/overmap/visitable/ship))
var/obj/effect/overmap/visitable/ship/S = origin
P.dir = S.dir
+27 -19
View File
@@ -4,6 +4,8 @@
icon = 'icons/obj/machines/ship_guns/longbow.dmi'
idle_power_usage = 1500
active_power_usage = 50000
anchored = TRUE
density = TRUE
var/damage = 0
var/max_damage = 1000
var/heavy_firing_sound = 'sound/weapons/gunshot/ship_weapons/120mm_mortar.ogg' //The sound in the immediate firing area. Very loud.
@@ -124,6 +126,7 @@
for(var/A in connected_dummies)
var/obj/structure/ship_weapon_dummy/dummy = A
qdel(dummy)
connected_dummies.Cut()
/obj/machinery/ship_weapon/proc/pre_fire(var/atom/target, var/obj/effect/landmark/landmark) //We can fire, so what do we do before that? Think like a laser charging up.
fire(target, landmark)
@@ -135,39 +138,43 @@
var/list/connected_z_levels = GetConnectedZlevels(z)
for(var/mob/living/carbon/human/H in player_list)
if(H.z in connected_z_levels)
playsound(H, heavy_firing_sound, 100)
sound_to(H, sound(heavy_firing_sound, volume = 50))
if(H.is_listening())
H.adjustEarDamage(rand(0, 5), 2, TRUE)
else if(firing_effects & FIRING_EFFECT_FLAG_SILENT)
for(var/mob/living/carbon/human/H in get_area(src))
playsound(H, heavy_firing_sound, 100)
if(H.is_listening())
H.adjustEarDamage(rand(0, 5), 2, TRUE)
for(var/mob/living/carbon/human/H in human_mob_list)
if(get_area(H) == get_area(src))
sound_to(H, sound(heavy_firing_sound, volume = 50))
if(H.is_listening())
H.adjustEarDamage(rand(0, 5), 2, TRUE)
else
for(var/mob/living/carbon/human/H in get_area(src))
playsound(H, heavy_firing_sound, 100)
if (H.is_listening())
H.adjustEarDamage(rand(0, 5), 2, TRUE)
var/list/connected_z_levels = GetConnectedZlevels(z)
for(var/mob/living/carbon/human/H in player_list)
if(H.z in connected_z_levels)
playsound(H, light_firing_sound, 50)
for(var/mob/living/carbon/human/H in human_mob_list)
var/list/connected_z_levels = GetConnectedZlevels(z)
if(get_area(H) == get_area(src))
sound_to(H, sound(heavy_firing_sound, volume = 50))
if (H.is_listening())
H.adjustEarDamage(rand(0, 5), 2, TRUE)
else
if(H.z in connected_z_levels)
sound_to(H, sound(light_firing_sound, volume = 50))
if(screenshake_type == SHIP_GUN_SCREENSHAKE_ALL_MOBS)
var/list/connected_z_levels = GetConnectedZlevels(z)
for(var/mob/living/H in living_mob_list)
for(var/mob/living/carbon/human/H in human_mob_list)
if(H.z in connected_z_levels)
to_chat(H, SPAN_DANGER("<font size=4>Your legs buckle as the ground shakes beneath you!</font>"))
shake_camera(H, 10, 5)
else if(screenshake_type == SHIP_GUN_SCREENSHAKE_SCREEN)
for(var/mob/living/carbon/human/H in get_area(src))
if(!H.buckled_to)
to_chat(H, SPAN_DANGER("<font size=4>Your legs buckle as the ground shakes beneath you!</font>"))
shake_camera(H, 10, 5)
for(var/mob/living/carbon/human/H in human_mob_list)
if(get_area(H) == get_area(src))
if(!H.buckled_to)
to_chat(H, SPAN_DANGER("<font size=4>Your legs buckle as the ground shakes beneath you!</font>"))
shake_camera(H, 10, 5)
if(firing_effects & FIRING_EFFECT_FLAG_THROW_MOBS)
var/list/connected_z_levels = GetConnectedZlevels(z)
for(var/mob/M in living_mob_list)
if(M.z in connected_z_levels)
M.throw_at_random(FALSE, 7, 10)
if(!M.Check_Shoegrip() && !M.buckled_to)
M.throw_at_random(FALSE, 7, 10)
flick("weapon_firing", src)
return TRUE
@@ -252,6 +259,7 @@
icon_state = "dummy"
mouse_opacity = 2
layer = OBJ_LAYER+0.1 //Higher than the gun itself.
anchored = TRUE
density = TRUE
opacity = FALSE
atmos_canpass = CANPASS_DENSITY
@@ -8,7 +8,7 @@
var/obj/item/ship_ammunition/ammunition
var/atom/target //The target is the actual overmap object we're hitting.
var/obj/entry_target //The entry target is where the projectile itself is going to spawn in world.
var/range = OVERMAP_PROJECTILE_RANGE_ULTRAHIGH
var/range = OVERMAP_PROJECTILE_RANGE_MEDIUM
var/current_range_counter = 0
var/speed = 0 //A projectile with 0 speed does not move. Note that this is the 'lag' variable on walk_towards! Lower speed is better.
@@ -24,13 +24,34 @@
/obj/effect/overmap/projectile/Bump(var/atom/A)
if(istype(A, /turf/unsimulated/map/edge))
QDEL_NULL(ammunition)
qdel(src)
handle_wraparound()
..()
/obj/effect/overmap/projectile/proc/handle_wraparound()
var/nx = x
var/ny = y
var/low_edge = 1
var/high_edge = current_map.overmap_size - 1
if((dir & WEST) && x == low_edge)
nx = high_edge
else if((dir & EAST) && x == high_edge)
nx = low_edge
if((dir & SOUTH) && y == low_edge)
ny = high_edge
else if((dir & NORTH) && y == high_edge)
ny = low_edge
if((x == nx) && (y == ny))
return //we're not flying off anywhere
if(!check_entry())
var/turf/T = locate(nx,ny,z)
if(T)
forceMove(T)
/obj/effect/overmap/projectile/Move()
if(!check_entry())
. = ..()
handle_wraparound()
current_range_counter++
if(current_range_counter >= range)
qdel(src)
@@ -83,11 +83,13 @@
/obj/machinery/ship_weapon/leviathan/disable()
firing = FALSE
for(var/mob/living/L in living_mob_list)
if(get_area(L) == get_area(src))
sound_to(L, 'sound/effects/ship_weapons/leviathan_powerdown.ogg')
visible_message(SPAN_DANGER("<font size=4>\The [src]'s humming comes to an abrupt halt.</font>"))
update_use_power(POWER_USE_OFF)
if(use_power != POWER_USE_OFF)
visible_message(SPAN_DANGER("<font size=4>\The [src]'s humming comes to an abrupt halt.</font>"))
for(var/mob/living/L in living_mob_list)
if(AreConnectedZLevels(L.z, z))
sound_to(L, 'sound/effects/ship_weapons/leviathan_powerdown.ogg')
to_chat(L, SPAN_WARNING("The ground below you settles down, no longer vibrating."))
update_use_power(POWER_USE_OFF)
icon_state = "weapon_off"
/obj/machinery/ship_weapon/leviathan/enable()
@@ -95,10 +97,11 @@
if(!smes)
visible_message(SPAN_DANGER("\The [src] doesn't light up at all! Its maintenance display indicates there is no SMES to draw power from."))
return
for(var/mob/living/L in living_mob_list)
if(get_area(L) == get_area(src))
sound_to(L, 'sound/effects/ship_weapons/leviathan_powerup.ogg')
visible_message(SPAN_DANGER("<font size=4>\The [src] lights up with a powerful hum...</font>"))
for(var/mob/living/L in living_mob_list)
if(AreConnectedZLevels(L.z, z))
sound_to(L, 'sound/effects/ship_weapons/leviathan_powerup.ogg')
to_chat(L, SPAN_WARNING("The ground below you starts vibrating with a slight hum..."))
update_use_power(POWER_USE_IDLE)
icon_state = "weapon_on"
@@ -121,6 +124,7 @@
/obj/item/ship_ammunition/leviathan
name = "zero-point artillery beam"
desc = "A beam of pure energy."
range = OVERMAP_PROJECTILE_RANGE_ULTRAHIGH
caliber = SHIP_CALIBER_ZTA
impact_type = SHIP_AMMO_IMPACT_ZTA
overmap_icon_state = "heavy_pulse"
@@ -129,6 +133,9 @@
. = ..()
set_light(3, 3, LIGHT_COLOR_PURPLE)
/obj/item/ship_ammunition/leviathan/get_speed()
return 2
/obj/item/projectile/ship_ammo/leviathan
name = "zero-point artillery beam"
desc = "A concentrated stream of pure energy."
@@ -41,6 +41,7 @@
P.forceMove(src)
var/image/OL = image(P.icon, P.primer_state, layer = layer - 0.01)
add_overlay(OL)
update_status()
/obj/item/ship_ammunition/longbow/proc/add_warhead(var/obj/item/warhead/W)
if(W && !QDELETED(W))
@@ -54,20 +55,23 @@
cookoff_devastation = warhead.cookoff_devastation
cookoff_heavy = warhead.cookoff_heavy
cookoff_light = warhead.cookoff_light
update_status()
/obj/item/ship_ammunition/longbow/update_status()
desc = initial(desc)
desc += "<br>"
if(primer && !warhead)
desc += "It is loaded with [primer], but no warhead."
name = "longbow casing"
ammunition_flags = initial(ammunition_flags)
else if(warhead && !primer)
desc += "It has a [warhead], but no primer."
name = "longbow casing"
name = "[warhead.warhead_type] longbow casing"
else if(warhead && primer)
desc += "It has a [warhead] and is loaded with [primer]! It's ready to go."
name = "longbow shell"
name = "[warhead.warhead_type] longbow shell"
else
name = "longbow casing"
desc += "It isn't loaded with a warhead and has no primer."
ammunition_flags = initial(ammunition_flags)
@@ -87,6 +91,7 @@
desc = "This is a medium power primer for Longbow warheads."
icon = 'icons/obj/guns/ship/ship_ammo_longarm.dmi'
icon_state = "primer_med_obj"
w_class = ITEMSIZE_HUGE
var/primer_state = "primer_med" //This is the overlay state when it gets applied to the projectile.
var/speed = 30 //Somewhat of a misleading name. This is the lag in world ticks between each walk() called by the overmap projectile. Lower is better.
@@ -109,6 +114,7 @@
desc = "This is a generic warhead. Not for use."
icon = 'icons/obj/guns/ship/ship_ammo_longarm.dmi'
icon_state = "generic_warhead_obj"
w_class = ITEMSIZE_HUGE
var/warhead_state = "generic_warhead" //This is the overlay state when it gets applied to the projectile.
var/caliber
var/warhead_type
@@ -182,7 +188,6 @@
add_primer(P)
var/obj/item/warhead/longbow/W = new()
add_warhead(W)
update_status()
/obj/item/ship_ammunition/longbow/preset_ap/Initialize()
. = ..()
@@ -190,7 +195,6 @@
add_primer(P)
var/obj/item/warhead/longbow/ap/W = new()
add_warhead(W)
update_status()
/obj/item/ship_ammunition/longbow/preset_bb/Initialize()
. = ..()
@@ -198,4 +202,3 @@
add_primer(P)
var/obj/item/warhead/longbow/bunker/W = new()
add_warhead(W)
update_status()
+1 -2
View File
@@ -43,13 +43,11 @@ var/const/OVERMAP_SPEED_CONSTANT = (1 SECOND)
min_speed = round(min_speed, SHIP_MOVE_RESOLUTION)
max_speed = round(max_speed, SHIP_MOVE_RESOLUTION)
SSshuttle.ships += src
START_PROCESSING(SSprocessing, src)
/obj/effect/overmap/visitable/ship/find_z_levels(var/fore_direction)
. = ..(fore_dir)
/obj/effect/overmap/visitable/ship/Destroy()
STOP_PROCESSING(SSprocessing, src)
SSshuttle.ships -= src
for(var/obj/machinery/computer/ship/S in SSmachinery.machinery)
if(S.linked == src)
@@ -146,6 +144,7 @@ var/const/OVERMAP_SPEED_CONSTANT = (1 SECOND)
adjust_speed(0, -acceleration)
/obj/effect/overmap/visitable/ship/process()
..()
if(!halted && !is_still())
var/list/deltas = list(0,0)
for(var/i = 1 to 2)