diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index afb0e6c44a..17b62d739f 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -121,7 +121,7 @@ // A is a turf or is on a turf, or in something on a turf (pen in a box); but not something in something on a turf (pen in a box in a backpack) sdepth = A.storage_depth_turf() if(isturf(A) || isturf(A.loc) || (sdepth != -1 && sdepth <= 1)) - if(A.Adjacent(src)) // see adjacent.dm + if(A.Adjacent(src) || (W && W.attack_can_reach(src, A, W.reach)) ) // see adjacent.dm if(W) // Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example) var/resolved = W.resolve_attackby(A,src) diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm index b0f19c3ba3..627b4e8b14 100644 --- a/code/game/gamemodes/changeling/changeling_powers.dm +++ b/code/game/gamemodes/changeling/changeling_powers.dm @@ -168,7 +168,8 @@ turf/proc/AdjacentTurfsRangedSting() /obj/structure/target_stake, /obj/structure/cable, /obj/structure/disposalpipe, - /obj/machinery/ + /obj/machinery, + /mob ) var/L[] = new() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index ff7be9f549..bd3eb7fe31 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -81,6 +81,7 @@ var/toolspeed = 1.0 // This is a multipler on how 'fast' a tool works. e.g. setting this to 0.5 will make the tool work twice as fast. var/attackspeed = DEFAULT_ATTACK_COOLDOWN // How long click delay will be when using this, in 1/10ths of a second. Checked in the user's get_attack_speed(). + var/reach = 1 // Length of tiles it can reach, 1 is adjacent. var/addblends // Icon overlay for ADD highlights when applicable. /obj/item/New() @@ -641,3 +642,11 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. /obj/item/proc/pwr_drain() return 0 // Process Kill +// Used for non-adjacent melee attacks with specific weapons capable of reaching more than one tile. +// This uses changeling range string A* but for this purpose its also applicable. +/obj/item/proc/attack_can_reach(var/atom/us, var/atom/them, var/range) + if(us.Adjacent(them)) + return TRUE // Already adjacent. + if(AStar(get_turf(us), get_turf(them), /turf/proc/AdjacentTurfsRangedSting, /turf/proc/Distance, max_nodes=25, max_node_depth=range)) + return TRUE + return FALSE diff --git a/code/game/objects/items/weapons/material/twohanded.dm b/code/game/objects/items/weapons/material/twohanded.dm index 3863e5a517..624039c066 100644 --- a/code/game/objects/items/weapons/material/twohanded.dm +++ b/code/game/objects/items/weapons/material/twohanded.dm @@ -145,6 +145,7 @@ base_icon = "spearglass" name = "spear" desc = "A haphazardly-constructed yet still deadly weapon of ancient design." + description_info = "This weapon can strike from two tiles away, and over certain objects such as tables, or other people." force = 10 w_class = ITEMSIZE_LARGE slot_flags = SLOT_BACK @@ -158,4 +159,6 @@ attack_verb = list("attacked", "poked", "jabbed", "torn", "gored") default_material = "glass" applies_material_colour = 0 - fragile = 1 //It's a haphazard thing of glass, wire, and steel \ No newline at end of file + fragile = 1 //It's a haphazard thing of glass, wire, and steel + reach = 2 // Spears are long. + attackspeed = 14 \ No newline at end of file