diff --git a/code/modules/overmap/ship_weaponry/_ship_ammunition.dm b/code/modules/overmap/ship_weaponry/_ship_ammunition.dm index 95ee48e2122..f53b49dc666 100644 --- a/code/modules/overmap/ship_weaponry/_ship_ammunition.dm +++ b/code/modules/overmap/ship_weaponry/_ship_ammunition.dm @@ -33,6 +33,13 @@ . = ..() update_status() +/obj/item/ship_ammunition/Destroy() + origin = null + overmap_target = null + entry_point = null + original_projectile = null + return ..() + /obj/item/ship_ammunition/attackby(obj/item/I, mob/user) if(I.ispen()) var/obj/item/pen/P = I diff --git a/code/modules/overmap/ship_weaponry/_ship_gun.dm b/code/modules/overmap/ship_weaponry/_ship_gun.dm index 3015f4520ca..85d505b0c25 100644 --- a/code/modules/overmap/ship_weaponry/_ship_gun.dm +++ b/code/modules/overmap/ship_weaponry/_ship_gun.dm @@ -51,11 +51,11 @@ /obj/machinery/ship_weapon/ex_act(severity) switch(severity) if(1) - add_damage(250) + add_damage(50) if(2) - add_damage(100) + add_damage(25) if(3) - add_damage(75) + add_damage(10) /obj/machinery/ship_weapon/proc/add_damage(var/amount) damage = max(0, min(damage + amount, max_damage)) diff --git a/code/modules/overmap/ship_weaponry/projectiles/_overmap_projectiles.dm b/code/modules/overmap/ship_weaponry/projectiles/_overmap_projectiles.dm index f36865e356e..57b726585b6 100644 --- a/code/modules/overmap/ship_weaponry/projectiles/_overmap_projectiles.dm +++ b/code/modules/overmap/ship_weaponry/projectiles/_overmap_projectiles.dm @@ -9,16 +9,18 @@ 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/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. var/moving = FALSE //Is the projectile actively moving on the overmap? + var/entering = FALSE //Are we entering an entry point? /obj/effect/overmap/projectile/Initialize(var/maploading, var/sx, var/sy) . = ..() x = sx y = sy z = current_map.overmap_z - START_PROCESSING(SSprocessing, src) + addtimer(CALLBACK(src, .proc/move_to), 1) /obj/effect/overmap/projectile/Bump(var/atom/A) if(istype(A, /turf/unsimulated/map/edge)) @@ -26,16 +28,12 @@ qdel(src) ..() -/obj/effect/overmap/projectile/process() - if(target) - move_to() - if(!moving) - check_entry() - /obj/effect/overmap/projectile/Move() - . = ..() - if(.) - check_entry() + if(!check_entry()) + . = ..() + current_range_counter++ + if(current_range_counter >= range) + qdel(src) /obj/effect/overmap/projectile/Destroy() ammunition = null @@ -43,7 +41,13 @@ entry_target = null return ..() +/obj/effect/overmap/projectile/proc/prepare_for_entry() + moving = FALSE + entering = FALSE + walk(src, 0) + /obj/effect/overmap/projectile/proc/check_entry() + . = FALSE if(!ammunition) return var/turf/T = get_turf(src) @@ -54,10 +58,9 @@ 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. - STOP_PROCESSING(SSprocessing, src) //Also, don't sleep in process(). - invisibility = 100 - moving = FALSE + . = TRUE + //Manually stopping because this proc needs to sleep for a bit. + prepare_for_entry() var/obj/item/projectile/ship_ammo/widowmaker = new ammunition.original_projectile.type widowmaker.ammo = ammunition qdel(ammunition.original_projectile) //No longer needed. @@ -74,12 +77,14 @@ qdel(widowmaker) qdel(src) else if(istype(V, /obj/effect/overmap/visitable) && (ammunition.overmap_behaviour & SHIP_AMMO_CAN_HIT_SHIPS)) + . = TRUE 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/naval_heading = SSatlas.headings_to_naval["[VS.dir]"]["[ammunition.heading]"] var/corrected_heading = SSatlas.naval_to_dir["[VS.fore_dir]"][naval_heading] ammunition.heading = corrected_heading + prepare_for_entry() var/obj/item/projectile/ship_ammo/widowmaker = new ammunition.original_projectile.type widowmaker.ammo = ammunition qdel(ammunition.original_projectile) //No longer needed. @@ -99,6 +104,7 @@ 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)) + . = TRUE qdel(EV) qdel(src) @@ -107,18 +113,12 @@ walk(src, 0) moving = FALSE return - if(!moving) + if(!moving && !entering) if(ammunition.ammunition_behaviour == SHIP_AMMO_BEHAVIOUR_DUMBFIRE) walk(src, ammunition.heading, speed) else if(ammunition.ammunition_behaviour == SHIP_AMMO_BEHAVIOUR_GUIDED) walk_towards(src, target, speed) - moving = TRUE - -/obj/effect/overmap/projectile/Destroy() - if(!QDELETED(ammunition)) - QDEL_NULL(ammunition) - ammunition = null - return ..() + moving = TRUE /obj/effect/overmap/projectile/get_scan_data(mob/user) . = ..() diff --git a/code/modules/overmap/ship_weaponry/weaponry/longbow.dm b/code/modules/overmap/ship_weaponry/weaponry/longbow.dm index a08b0e12957..d41521ac0ac 100644 --- a/code/modules/overmap/ship_weaponry/weaponry/longbow.dm +++ b/code/modules/overmap/ship_weaponry/weaponry/longbow.dm @@ -20,6 +20,8 @@ /obj/item/projectile/ship_ammo/longbow/launch_projectile(atom/target, target_zone, mob/user, params, angle_override, forced_spread) if(ammo.impact_type == SHIP_AMMO_IMPACT_AP) penetrating = 1 + if(ammo.impact_type == SHIP_AMMO_IMPACT_BUNKERBUSTER) + penetrating = 3 . = ..() /obj/item/projectile/ship_ammo/longbow/on_hit(atom/target, blocked, def_zone, is_landmark_hit) diff --git a/html/changelogs/mattatlas-thelastfix.yml b/html/changelogs/mattatlas-thelastfix.yml new file mode 100644 index 00000000000..1cea218275c --- /dev/null +++ b/html/changelogs/mattatlas-thelastfix.yml @@ -0,0 +1,43 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: MattAtlas + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Decreased the amount of damage ship guns take to compensate for explosions hitting them more than once." + - bugfix: "Ship projectiles now properly hit their targets if they're on the same tile." + - bugfix: "Ship projectiles should feel a lot faster to start up and less clunky."