From e01021218036e6ebf8fa62116dd03f61cd7bb690 Mon Sep 17 00:00:00 2001 From: timothyteakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Mon, 15 Jun 2020 23:49:38 +0100 Subject: [PATCH] please work --- code/modules/projectiles/projectile.dm | 30 ++++++++++--------- .../research/techweb/nodes/bepis_nodes.dm | 9 ++++++ 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index b46e6f5ead..39e8b63e4b 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -45,6 +45,8 @@ var/pixels_range_leftover = 0 /// "leftover" tick pixels and stuff yeah, so we don't round off things and introducing tracing inaccuracy. var/pixels_tick_leftover = 0 + /// Used to detect jumps in the middle of a pixel_move. Yes, this is ugly as sin code-wise but it works. + var/pixel_move_interrupted = FALSE /// Pixels moved per second. var/pixels_per_second = TILES_TO_PIXELS(12.5) @@ -307,20 +309,15 @@ beam_segments[beam_index] = null /obj/item/projectile/Bump(atom/A) - var/datum/point/pcache = trajectory.copy_to() + if(!trajectory) + return var/turf/T = get_turf(A) - if(trajectory && ricochets < ricochets_max && check_ricochet_flag(A) && check_ricochet(A)) - ricochets++ - if(A.handle_ricochet(src)) - on_ricochet(A) - ignore_source_check = TRUE - decayedRange = max(0, decayedRange - reflect_range_decrease) - ricochet_chance *= ricochet_decay_chance - damage *= ricochet_decay_damage - range = decayedRange - if(hitscan) - store_hitscan_collision(pcache) - return TRUE + if(check_ricochet(A)) + var/datum/point/pcache = trajectory.copy_to() + if(hitscan) + store_hitscan_collision(pcache) + handle_ricochet(A) + return TRUE var/distance = get_dist(T, starting) // Get the distance between the turf shot from and the mob we hit and use that for the calculations. if(def_zone && check_zone(def_zone) != BODY_ZONE_CHEST) @@ -489,6 +486,7 @@ /obj/item/projectile/proc/setAngle(new_angle, hitscan_store_segment = TRUE) //wrapper for overrides. Angle = new_angle + pixel_move_interrupted = TRUE if(!nondirectional_sprite) var/matrix/M = new M.Turn(Angle) @@ -515,6 +513,7 @@ trajectory.initialize_location(target.x, target.y, target.z, 0, 0) if(hitscan) record_hitscan_start(RETURN_PRECISE_POINT(src)) + pixel_move_interrupted = TRUE if(zc) after_z_change(old, target) @@ -573,6 +572,7 @@ M.Turn(Angle) transform = M var/forcemoved = FALSE + pixel_move_interrupted = FALSE // reset that var/turf/oldloc = loc var/old_px = pixel_x var/old_py = pixel_y @@ -613,7 +613,9 @@ pixels_range_leftover += pixel_increment_amount if(pixels_range_leftover > world.icon_size) Range() - if(QDELETED(src)) + if(QDELETED(src) || pixel_move_interrupted) // this doesn't take into account with pixel_move_interrupted the portion of the move cut off by any forcemoves, but we're opting to ignore that for now + // the reason is the entire point of moving to pixel speed rather than tile speed is smoothness, which will be crucial when pixel movement is done in the future + // reverting back to tile is more or less the only way of fixing this issue. return pixels_range_leftover -= world.icon_size if(!hitscanning && !forcemoved) diff --git a/code/modules/research/techweb/nodes/bepis_nodes.dm b/code/modules/research/techweb/nodes/bepis_nodes.dm index 0033564274..41d3a08d64 100644 --- a/code/modules/research/techweb/nodes/bepis_nodes.dm +++ b/code/modules/research/techweb/nodes/bepis_nodes.dm @@ -80,3 +80,12 @@ research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) hidden = TRUE experimental = TRUE + +/datum/techweb_node/sticky_advanced + id = "sticky_advanced" + display_name = "Advanced Sticky Technology" + description = "Taking a good joke too far? Nonsense!" + design_ids = list("super_sticky_tape", "pointy_tape") + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) + hidden = TRUE + experimental = TRUE