Ports weapons cleaving and reaching features from polaris (#3969)

-axes, chainswords and longswords can now cleave, hitting targets around the user, ported from polaris
-added support for melee weapons that can hit targets two titles away, as well ported from polaris
This commit is contained in:
Alberyk
2017-12-23 21:12:06 +02:00
committed by Erki
parent 5c78e4fc08
commit eb80d3ec68
8 changed files with 105 additions and 8 deletions
+1 -1
View File
@@ -125,7 +125,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
setMoveCooldown(5)
if(W)
+5
View File
@@ -23,8 +23,13 @@ avoid code duplication. This includes items that may sometimes act as a standard
/obj/item/proc/attack_self(mob/user)
return
// Called at the start of resolve_attackby(), before the actual attack.
/obj/item/proc/pre_attack(atom/a, mob/user)
return
//I would prefer to rename this to attack(), but that would involve touching hundreds of files.
/obj/item/proc/resolve_attackby(atom/A, mob/user)
pre_attack(A, user)
add_fingerprint(user)
return A.attackby(src, user)