mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-12 08:27:13 +01:00
Fixes some ship weapon bugs. (#15035)
* Fixes some ship weapon bugs. * missed entry * list sort * cl + fix Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
@@ -54,6 +54,9 @@
|
||||
var/obj/machinery/computer/ship/targeting/GS = H.machine
|
||||
if(GS.targeting)
|
||||
return
|
||||
if(!istype(GS.connected.loc, /turf/unsimulated/map))
|
||||
to_chat(H, SPAN_WARNING("The safeties won't let you target while you're not on the Overmap!"))
|
||||
return
|
||||
var/my_sector = map_sectors["[H.z]"]
|
||||
if(istype(my_sector, /obj/effect/overmap/visitable))
|
||||
var/obj/effect/overmap/visitable/V = my_sector
|
||||
|
||||
@@ -398,7 +398,10 @@
|
||||
var/obj/effect/landmark/LM
|
||||
if(!selected_entrypoint)
|
||||
return
|
||||
if(selected_entrypoint == "Automatic Hazard Targeting")
|
||||
if(!istype(connected.loc, /turf/unsimulated/map))
|
||||
to_chat(usr, SPAN_WARNING("The safeties are engaged! You need to be undocked in order to fire."))
|
||||
return
|
||||
if(selected_entrypoint == SHIP_HAZARD_TARGET || !selected_entrypoint)
|
||||
LM = null
|
||||
else
|
||||
LM = names_to_entries[selected_entrypoint]
|
||||
@@ -428,5 +431,6 @@
|
||||
for(var/obj/effect/O in V.generic_waypoints)
|
||||
. += capitalize_first_letters(O.name)
|
||||
names_to_entries[capitalize_first_letters(O.name)] = O
|
||||
. = sortList(.)
|
||||
if(!length(.))
|
||||
. += "Automatic Hazard Targeting" //No entrypoints == hazard
|
||||
. += SHIP_HAZARD_TARGET //No entrypoints == hazard
|
||||
@@ -38,58 +38,61 @@
|
||||
return ..()
|
||||
|
||||
/obj/effect/overmap/projectile/proc/check_entry()
|
||||
if(!ammunition)
|
||||
return
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/obj/effect/overmap/visitable/V in T)
|
||||
if(V == ammunition.origin)
|
||||
for(var/obj/effect/overmap/A in T)
|
||||
if(A == ammunition.origin)
|
||||
continue
|
||||
|
||||
if((V.check_ownership(entry_target)) || (V == target)) //Target spotted!
|
||||
if(istype(V, /obj/effect/overmap/visitable/sector/exoplanet) && (ammunition.overmap_behaviour & SHIP_AMMO_CAN_HIT_SHIPS))
|
||||
//Manually stopping & going invisible because this proc needs to sleep for a bit.
|
||||
invisibility = 100
|
||||
moving = FALSE
|
||||
STOP_PROCESSING(SSprocessing, src) //Also, don't sleep in process().
|
||||
var/obj/item/projectile/ship_ammo/widowmaker = new ammunition.original_projectile.type
|
||||
widowmaker.ammo = ammunition
|
||||
qdel(ammunition.original_projectile) //No longer needed.
|
||||
var/turf/laze = get_turf(entry_target)
|
||||
ammunition.original_projectile = widowmaker
|
||||
playsound(laze, 'sound/weapons/gunshot/ship_weapons/orbital_travel.ogg')
|
||||
laze.visible_message(SPAN_DANGER("<font size=6>A bright star is getting closer from the sky...!</font>"))
|
||||
sleep(11 SECONDS) //Let the sound play!
|
||||
widowmaker.primed = TRUE
|
||||
widowmaker.forceMove(entry_target)
|
||||
widowmaker.on_hit(laze, is_landmark_hit = TRUE)
|
||||
log_and_message_admins("A projectile ([name]) has entered a z-level at [entry_target.name]! (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[widowmaker.x];Y=[widowmaker.y];Z=[widowmaker.z]'>JMP</a>)")
|
||||
qdel(widowmaker)
|
||||
qdel(src)
|
||||
else if(istype(V, /obj/effect/overmap/visitable) && (ammunition.overmap_behaviour & SHIP_AMMO_CAN_HIT_SHIPS))
|
||||
if(istype(V, /obj/effect/overmap/visitable/ship))
|
||||
var/obj/effect/overmap/visitable/ship/VS = V
|
||||
if(istype(ammunition.origin, /obj/effect/overmap/visitable/ship))
|
||||
var/obj/effect/overmap/visitable/ship/OR = ammunition.origin
|
||||
if(VS.fore_dir != OR.fore_dir)
|
||||
var/naval_heading = SSatlas.headings_to_naval["[OR.fore_dir]"]["[ammunition.heading]"]
|
||||
var/corrected_heading = SSatlas.naval_to_dir["[VS.fore_dir]"][naval_heading]
|
||||
ammunition.heading = corrected_heading
|
||||
var/obj/item/projectile/ship_ammo/widowmaker = new ammunition.original_projectile.type
|
||||
widowmaker.ammo = ammunition
|
||||
qdel(ammunition.original_projectile) //No longer needed.
|
||||
ammunition.original_projectile = widowmaker
|
||||
widowmaker.primed = TRUE
|
||||
var/turf/entry_turf_initial = get_ranged_target_turf(entry_target, reverse_dir[entry_target.dir], 20)
|
||||
var/turf/entry_turf = get_ranged_target_turf(entry_turf_initial, pick(list(EAST, WEST)), 5)
|
||||
widowmaker.forceMove(entry_turf)
|
||||
widowmaker.dir = ammunition.heading
|
||||
var/turf/target_turf = get_step(widowmaker, widowmaker.dir)
|
||||
widowmaker.on_translate(entry_turf, target_turf)
|
||||
log_and_message_admins("A projectile ([widowmaker.name]) has entered a z-level at [entry_target.name], with direction [dir_name(widowmaker.dir)]! (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[widowmaker.x];Y=[widowmaker.y];Z=[widowmaker.z]'>JMP</a>)")
|
||||
widowmaker.launch_projectile(target_turf)
|
||||
qdel(src)
|
||||
else if(istype(V, /obj/effect/overmap/event) && (ammunition.overmap_behaviour & SHIP_AMMO_CAN_HIT_HAZARDS))
|
||||
var/obj/effect/overmap/event/EV = V
|
||||
if(EV.can_be_destroyed)
|
||||
qdel(EV)
|
||||
if(istype(A, /obj/effect/overmap/visitable))
|
||||
var/obj/effect/overmap/visitable/V = A
|
||||
if((V.check_ownership(entry_target)) || (V == target)) //Target spotted!
|
||||
if(istype(V, /obj/effect/overmap/visitable/sector/exoplanet) && (ammunition.overmap_behaviour & SHIP_AMMO_CAN_HIT_SHIPS))
|
||||
//Manually stopping & going invisible because this proc needs to sleep for a bit.
|
||||
invisibility = 100
|
||||
moving = FALSE
|
||||
STOP_PROCESSING(SSprocessing, src) //Also, don't sleep in process().
|
||||
var/obj/item/projectile/ship_ammo/widowmaker = new ammunition.original_projectile.type
|
||||
widowmaker.ammo = ammunition
|
||||
qdel(ammunition.original_projectile) //No longer needed.
|
||||
var/turf/laze = get_turf(entry_target)
|
||||
ammunition.original_projectile = widowmaker
|
||||
playsound(laze, 'sound/weapons/gunshot/ship_weapons/orbital_travel.ogg')
|
||||
laze.visible_message(SPAN_DANGER("<font size=6>A bright star is getting closer from the sky...!</font>"))
|
||||
sleep(11 SECONDS) //Let the sound play!
|
||||
widowmaker.primed = TRUE
|
||||
widowmaker.forceMove(entry_target)
|
||||
widowmaker.on_hit(laze, is_landmark_hit = TRUE)
|
||||
log_and_message_admins("A projectile ([name]) has entered a z-level at [entry_target.name]! (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[widowmaker.x];Y=[widowmaker.y];Z=[widowmaker.z]'>JMP</a>)")
|
||||
qdel(widowmaker)
|
||||
qdel(src)
|
||||
else if(istype(V, /obj/effect/overmap/visitable) && (ammunition.overmap_behaviour & SHIP_AMMO_CAN_HIT_SHIPS))
|
||||
if(istype(V, /obj/effect/overmap/visitable/ship))
|
||||
var/obj/effect/overmap/visitable/ship/VS = V
|
||||
if(istype(ammunition.origin, /obj/effect/overmap/visitable/ship))
|
||||
var/obj/effect/overmap/visitable/ship/OR = ammunition.origin
|
||||
if(VS.fore_dir != OR.fore_dir)
|
||||
var/naval_heading = SSatlas.headings_to_naval["[OR.fore_dir]"]["[ammunition.heading]"]
|
||||
var/corrected_heading = SSatlas.naval_to_dir["[VS.fore_dir]"][naval_heading]
|
||||
ammunition.heading = corrected_heading
|
||||
var/obj/item/projectile/ship_ammo/widowmaker = new ammunition.original_projectile.type
|
||||
widowmaker.ammo = ammunition
|
||||
qdel(ammunition.original_projectile) //No longer needed.
|
||||
ammunition.original_projectile = widowmaker
|
||||
widowmaker.primed = TRUE
|
||||
var/turf/entry_turf_initial = get_ranged_target_turf(entry_target, reverse_dir[entry_target.dir], 20)
|
||||
var/turf/entry_turf = get_ranged_target_turf(entry_turf_initial, pick(list(EAST, WEST)), 5)
|
||||
widowmaker.forceMove(entry_turf)
|
||||
widowmaker.dir = ammunition.heading
|
||||
var/turf/target_turf = get_step(widowmaker, widowmaker.dir)
|
||||
widowmaker.on_translate(entry_turf, target_turf)
|
||||
log_and_message_admins("A projectile ([widowmaker.name]) has entered a z-level at [entry_target.name], with direction [dir_name(widowmaker.dir)]! (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[widowmaker.x];Y=[widowmaker.y];Z=[widowmaker.z]'>JMP</a>)")
|
||||
widowmaker.launch_projectile(target_turf)
|
||||
qdel(src)
|
||||
if(istype(A, /obj/effect/overmap/event))
|
||||
var/obj/effect/overmap/event/EV = A
|
||||
if(EV.can_be_destroyed && (ammunition.overmap_behaviour & SHIP_AMMO_CAN_HIT_HAZARDS))
|
||||
qdel(EV)
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/overmap/projectile/proc/move_to()
|
||||
|
||||
@@ -304,7 +304,9 @@
|
||||
icon_state = "safeguard_open"
|
||||
|
||||
/obj/machinery/leviathan_safeguard/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/leviathan_key) && !key && !stat && !locked)
|
||||
if(!opened || locked)
|
||||
return
|
||||
if(istype(I, /obj/item/leviathan_key) && !key && !stat)
|
||||
var/obj/item/leviathan_key/LK = I
|
||||
if(use_check_and_message(user))
|
||||
return
|
||||
@@ -316,7 +318,7 @@
|
||||
playsound(src, 'sound/effects/ship_weapons/levi_key_insert.ogg')
|
||||
|
||||
/obj/machinery/leviathan_safeguard/attack_hand(mob/user)
|
||||
if(key && !stat && !locked)
|
||||
if(key && !stat && opened && !locked)
|
||||
if(use_check_and_message(user))
|
||||
return
|
||||
if(do_after(user, 1 SECOND))
|
||||
@@ -368,12 +370,15 @@
|
||||
possible_entry_points[O.name] = O
|
||||
for(var/obj/effect/O in V.entry_points)
|
||||
possible_entry_points[O.name] = O
|
||||
possible_entry_points = sortList(possible_entry_points)
|
||||
if(istype(linked.targeting, /obj/effect/overmap/event))
|
||||
possible_entry_points += SHIP_HAZARD_TARGET
|
||||
var/targeted_landmark = input(user, "Select an entry point.", "Leviathan Control") as null|anything in possible_entry_points
|
||||
if(!targeted_landmark && length(possible_entry_points))
|
||||
return
|
||||
var/obj/effect/landmark
|
||||
if(length(possible_entry_points))
|
||||
landmark = possible_entry_points[targeted_landmark]
|
||||
if(length(possible_entry_points) && !(targeted_landmark == SHIP_HAZARD_TARGET))
|
||||
landmark = possible_entry_points[targeted_landmark]
|
||||
if(do_after(user, 1 SECOND) && !use_check_and_message(user))
|
||||
playsound(src, 'sound/effects/ship_weapons/levi_button_press.ogg')
|
||||
visible_message(SPAN_DANGER("[user] presses \the [src]!"))
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(istype(I, /obj/item/primer) && !primer)
|
||||
var/obj/item/primer/P = I
|
||||
visible_message(SPAN_NOTICE("You start connecting \the [P] to the casing..."), SPAN_NOTICE("[H] starts connecting \the [P] to the casing..."))
|
||||
user.visible_message(SPAN_NOTICE("[H] starts connecting \the [P] to the casing..."), SPAN_NOTICE("You start connecting \the [P] to the casing..."))
|
||||
if(do_after(H, 3 SECONDS))
|
||||
visible_message(SPAN_NOTICE("You connect \the [P] to the casing!"), SPAN_NOTICE("[H] connects \the [P] to the casing!"))
|
||||
H.drop_from_inventory(P)
|
||||
@@ -22,7 +22,7 @@
|
||||
playsound(src, 'sound/machines/rig/rig_deploy.ogg')
|
||||
if(istype(I, /obj/item/warhead) && !warhead)
|
||||
var/obj/item/warhead/W = I
|
||||
visible_message(SPAN_NOTICE("You start connecting \the [W] to the casing..."), SPAN_NOTICE("[H] starts connecting \the [W] to the casing..."))
|
||||
user.visible_message( SPAN_NOTICE("[H] starts connecting \the [W] to the casing..."), SPAN_NOTICE("You start connecting \the [W] to the casing..."))
|
||||
if(do_after(H, 5 SECONDS))
|
||||
visible_message(SPAN_NOTICE("You connect \the [W] to the casing!"), SPAN_NOTICE("[H] connects \the [W] to the casing!"))
|
||||
H.drop_from_inventory(W)
|
||||
@@ -122,8 +122,8 @@
|
||||
warhead_type = SHIP_AMMO_IMPACT_HE
|
||||
slowdown = 2
|
||||
var/drop_counter = 0
|
||||
var/cookoff_devastation = 2
|
||||
var/cookoff_heavy = 2
|
||||
var/cookoff_devastation = 0
|
||||
var/cookoff_heavy = 3
|
||||
var/cookoff_light = 4
|
||||
|
||||
/obj/item/warhead/longbow/too_heavy_to_throw()
|
||||
@@ -162,7 +162,7 @@
|
||||
icon_state = "armor_piercing_obj"
|
||||
warhead_state = "armor_piercing"
|
||||
warhead_type = SHIP_AMMO_IMPACT_AP
|
||||
cookoff_devastation = 1
|
||||
cookoff_devastation = 0
|
||||
cookoff_heavy = 2
|
||||
cookoff_light = 6
|
||||
|
||||
|
||||
Reference in New Issue
Block a user