From 4f492f9639bb3d0b2a0956344cb5f2e9b0e49108 Mon Sep 17 00:00:00 2001
From: SECBATON GRIFFON <87321915+SECBATON-GRIFFON@users.noreply.github.com>
Date: Wed, 28 Aug 2024 02:01:02 +0100
Subject: [PATCH 01/15] initial commit
---
code/_hooks/events.dm | 5 ++
code/game/atoms.dm | 2 +-
.../objects/structures/vehicles/vehicle.dm | 1 +
code/modules/mob/mob_movement.dm | 1 -
code/modules/projectiles/gun.dm | 1 -
code/modules/projectiles/targeting.dm | 59 +++++++++----------
6 files changed, 34 insertions(+), 35 deletions(-)
diff --git a/code/_hooks/events.dm b/code/_hooks/events.dm
index b565c5157a4a..fdd597c41f60 100644
--- a/code/_hooks/events.dm
+++ b/code/_hooks/events.dm
@@ -26,6 +26,11 @@
// atom/movable/mover: the movable itself.
/event/moved
+// Called whenever an /atom/movable relay-moves.
+// Arguments:
+// atom/movable/mover: the movable itself.
+/event/relaymoved
+
// Called right before an /atom/movable attempts to move or change dir.
/event/before_move
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index 726282d220a7..a0c6698e7844 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -508,7 +508,7 @@ its easier to just keep the beam vertical.
bug.removed(usr)
/atom/proc/relaymove()
- return
+ INVOKE_EVENT(src, /event/relaymoved, "mover" = src)
// Try to override a mob's eastface(), westface() etc. (CTRL+RIGHTARROW, CTRL+LEFTARROW). Return 1 if successful, which blocks the mob's own eastface() etc.
// Called first on the mob's loc (turf, locker, mech), then on whatever the mob is buckled to, if anything.
diff --git a/code/game/objects/structures/vehicles/vehicle.dm b/code/game/objects/structures/vehicles/vehicle.dm
index 9c27110e3f77..49ce75264813 100644
--- a/code/game/objects/structures/vehicles/vehicle.dm
+++ b/code/game/objects/structures/vehicles/vehicle.dm
@@ -184,6 +184,7 @@
/obj/structure/bed/chair/vehicle/relaymove(var/mob/living/user, direction)
+ ..()
if(user.incapacitated())
unlock_atom(user)
return
diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm
index ed50cb5a1a33..de0b597521c9 100644
--- a/code/modules/mob/mob_movement.dm
+++ b/code/modules/mob/mob_movement.dm
@@ -351,7 +351,6 @@
var/old_dir = mob.dir
mob.delayNextMove(move_delay)
- mob.last_move_intent = world.time + 10
mob.set_glide_size(DELAY2GLIDESIZE(move_delay)) //Since we're moving OUT OF OUR OWN VOLITION AND BY OURSELVES we can update our glide_size here!
INVOKE_EVENT(mob, /event/before_move)
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index 2479c5f97ee6..4ae0bbfa87af 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -54,7 +54,6 @@
var/tmp/lock_time = -100
var/mouthshoot = 0 ///To stop people from suiciding twice... >.>
var/automatic = 0 //Used to determine if you can target multiple people.
- var/tmp/mob/living/last_moved_mob //Used to fire faster at more than one person.
var/tmp/told_cant_shoot = 0 //So that it doesn't spam them with the fact they cannot hit them.
var/firerate = 1 // 0 for one bullet after tarrget moves and aim is lowered,
//1 for keep shooting until aim is lowered
diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm
index 2e97f1118a7a..5db550da02e8 100644
--- a/code/modules/projectiles/targeting.dm
+++ b/code/modules/projectiles/targeting.dm
@@ -76,21 +76,31 @@
M.Targeted(src)
//HE MOVED, SHOOT HIM!
-/obj/item/weapon/gun/proc/TargetActed(var/mob/living/T)
+/obj/item/weapon/gun/proc/TargetMoved(mob/living/mover)
+ TargetActed(mover) //alias just so events work
+
+/obj/item/weapon/gun/proc/TargetActed(mob/living/user,modifiers,atom/target)
+ if(world.time <= lock_time)
+ return
+ if(target && (isturf(target) || istype(target,/obj/abstract/screen))) // these are okay to click
+ return
+ lock_time = world.time + 15
var/mob/living/M = loc
- if(M == T)
+ message_admins("HE MOVED, SHOOT HIM!")
+ if(M == user)
return
if(!istype(M))
return
+ if(M.client && M.client.target_can_move && !M.client.target_can_run && user.m_intent != "run")
+ return
if(src != M.get_active_hand())
stop_aim()
return
- M.last_move_intent = world.time
if(canbe_fired())
- var/firing_check = can_hit(T,usr) //0 if it cannot hit them, 1 if it is capable of hitting, and 2 if a special check is preventing it from firing.
+ var/firing_check = can_hit(user,usr) //0 if it cannot hit them, 1 if it is capable of hitting, and 2 if a special check is preventing it from firing.
if(firing_check > 0)
if(firing_check == 1)
- Fire(T,usr, reflex = 1)
+ Fire(user,usr, reflex = 1)
else if(!told_cant_shoot)
to_chat(M, "They can't be hit from here!")
told_cant_shoot = 1
@@ -99,10 +109,10 @@
else
click_empty(M)
- usr.dir = get_cardinal_dir(src, T)
+ usr.dir = get_cardinal_dir(src, user)
if (!firerate) // If firerate is set to lower aim after one shot, untarget the target
- T.NotTargeted(src)
+ user.NotTargeted(src)
/proc/GunTrace(X1,Y1,X2,Y2,Z=1,exc_obj,PX1=16,PY1=16,PX2=16,PY2=16)
// to_chat(bluh, "Tracin' [X1],[Y1] to [X2],[Y2] on floor [Z].")
@@ -153,9 +163,6 @@
//Targeting management procs
/mob
var/list/targeted_by
- var/target_time = -100
- var/last_move_intent = -100
- var/last_target_click = -5
var/target_locked = null
/mob/living/proc/Targeted(var/obj/item/weapon/gun/I) //Self explanitory.
@@ -203,30 +210,18 @@
to_chat(src, "Your captive is allowing you to walk. Make sure to change your move intent to walk before trying to move, or you will be fired upon.")//Self explanitory.
//set_m_intent("walk") -there's a real fucked up exploit behind this, so it's been removed. Needs testing. -Angelite-
-
- //Processing the aiming. Should be probably in separate object with process() but lasy.
- while(targeted_by && T.client)
- if((last_move_intent > I.lock_time + 10) && !T.client.target_can_move) //If target moved when not allowed to
- I.TargetActed(src)
- if(I.last_moved_mob == src) //If they were the last ones to move, give them more of a grace period, so that an automatic weapon can hold down a room better.
- I.lock_time = world.time + 5
- I.lock_time = world.time + 5
- I.last_moved_mob = src
- else if((last_move_intent > I.lock_time + 10) && !T.client.target_can_run && m_intent == "run") //If the target ran while targeted
- I.TargetActed(src)
- if(I.last_moved_mob == src) //If they were the last ones to move, give them more of a grace period, so that an automatic weapon can hold down a room better.
- I.lock_time = world.time + 5
- I.lock_time = world.time + 5
- I.last_moved_mob = src
- if((last_target_click > I.lock_time + 10) && !T.client.target_can_click) //If the target clicked the map to pick something up/shoot/etc
- I.TargetActed(src)
- if(I.last_moved_mob == src) //If they were the last ones to move, give them more of a grace period, so that an automatic weapon can hold down a room better.
- I.lock_time = world.time + 5
- I.lock_time = world.time + 5
- I.last_moved_mob = src
- sleep(1)
+
+ if(T.client)
+ if(!T.client.target_can_move || !T.client.target_can_run)
+ register_event(/event/moved, I, nameof(I::TargetMoved()))
+ register_event(/event/relaymoved, I, nameof(I::TargetMoved()))
+ if(!T.client.target_can_click)
+ register_event(/event/clickon, I, nameof(I::TargetActed()))
/mob/living/proc/NotTargeted(var/obj/item/weapon/gun/I)
+ unregister_event(/event/moved, I, nameof(I::TargetMoved()))
+ unregister_event(/event/relaymoved, I, nameof(I::TargetMoved()))
+ unregister_event(/event/clickon, I, nameof(I::TargetActed()))
if(!I.silenced)
for(var/mob/living/M in viewers(src))
M << 'sound/weapons/TargetOff.ogg'
From c7b185270d920ad5c02a4b5376577ccd1e81d451 Mon Sep 17 00:00:00 2001
From: SECBATON GRIFFON <87321915+SECBATON-GRIFFON@users.noreply.github.com>
Date: Wed, 28 Aug 2024 02:10:30 +0100
Subject: [PATCH 02/15] removes this, it works
---
code/modules/projectiles/targeting.dm | 1 -
1 file changed, 1 deletion(-)
diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm
index 5db550da02e8..f38ace1b982c 100644
--- a/code/modules/projectiles/targeting.dm
+++ b/code/modules/projectiles/targeting.dm
@@ -86,7 +86,6 @@
return
lock_time = world.time + 15
var/mob/living/M = loc
- message_admins("HE MOVED, SHOOT HIM!")
if(M == user)
return
if(!istype(M))
From 8f47000a16106409bb304e62236f132ad420b873 Mon Sep 17 00:00:00 2001
From: SECBATON GRIFFON <87321915+SECBATON-GRIFFON@users.noreply.github.com>
Date: Wed, 28 Aug 2024 02:23:26 +0100
Subject: [PATCH 03/15] feedback cleanup
---
code/modules/projectiles/targeting.dm | 31 ++++++++++++++++-----------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm
index f38ace1b982c..d8fd0b63912e 100644
--- a/code/modules/projectiles/targeting.dm
+++ b/code/modules/projectiles/targeting.dm
@@ -182,10 +182,6 @@
targeted_by = list()
targeted_by += I
I.lock_time = world.time + 20 //Target has 2 second to realize they're targeted and stop (or target the opponent).
- to_chat(src, "((Your character is being targeted. They have 2 seconds to stop any click or move actions. While targeted, they may \
- drag and drop items in or into the map, speak, and click on interface buttons. Clicking on the map objects (floors and walls are fine), their items \
- (other than a weapon to de-target), or moving will result in being fired upon. The aggressor may also fire manually, \
- so try not to get on their bad side.\black ))")
if(targeted_by.len == 1)
spawn(0)
@@ -205,17 +201,26 @@
else
I.lower_aim()
return
- if(m_intent == "run" && T.client.target_can_move == 1 && T.client.target_can_run == 0 && (ishuman(T)))
- to_chat(src, "Your captive is allowing you to walk. Make sure to change your move intent to walk before trying to move, or you will be fired upon.")//Self explanitory.
-
+ var/msg = ""
+ if(!T.client.target_can_click)
+ msg += "While targeted, they may drag and drop items in or into the map, speak, and click on interface buttons. \
+ Clicking on the map objects (floors and walls are fine), their items (other than a weapon to de-target) will result in being fired upon.\n"
+ if(!T.client.target_can_move)
+ msg += "Moving will result in being fired upon.\n"
+ else if(m_intent == "run" && !T.client.target_can_run && (ishuman(T))) //Self explanitory.
+ msg += "Your captive is allowing you to walk. \
+ Make sure to change your move intent to walk before trying to move, or you will be fired upon.\n"
+ to_chat(src, "Your character is being targeted. They have 2 seconds to stop any of the following actions: \n \
+ [msg]\n \
+ The aggressor may also fire manually, so try not to get on their bad side.")
+
//set_m_intent("walk") -there's a real fucked up exploit behind this, so it's been removed. Needs testing. -Angelite-
- if(T.client)
- if(!T.client.target_can_move || !T.client.target_can_run)
- register_event(/event/moved, I, nameof(I::TargetMoved()))
- register_event(/event/relaymoved, I, nameof(I::TargetMoved()))
- if(!T.client.target_can_click)
- register_event(/event/clickon, I, nameof(I::TargetActed()))
+ if(!T.client.target_can_move || !T.client.target_can_run)
+ register_event(/event/moved, I, nameof(I::TargetMoved()))
+ register_event(/event/relaymoved, I, nameof(I::TargetMoved()))
+ if(!T.client.target_can_click)
+ register_event(/event/clickon, I, nameof(I::TargetActed()))
/mob/living/proc/NotTargeted(var/obj/item/weapon/gun/I)
unregister_event(/event/moved, I, nameof(I::TargetMoved()))
From f83a3ea6180e7094f0c7e217da010dff190f4b84 Mon Sep 17 00:00:00 2001
From: SECBATON GRIFFON <87321915+SECBATON-GRIFFON@users.noreply.github.com>
Date: Wed, 28 Aug 2024 02:32:39 +0100
Subject: [PATCH 04/15] vanquishes usr
---
code/modules/projectiles/targeting.dm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm
index d8fd0b63912e..8461d792e99b 100644
--- a/code/modules/projectiles/targeting.dm
+++ b/code/modules/projectiles/targeting.dm
@@ -96,10 +96,10 @@
stop_aim()
return
if(canbe_fired())
- var/firing_check = can_hit(user,usr) //0 if it cannot hit them, 1 if it is capable of hitting, and 2 if a special check is preventing it from firing.
+ var/firing_check = can_hit(user,M) //0 if it cannot hit them, 1 if it is capable of hitting, and 2 if a special check is preventing it from firing.
if(firing_check > 0)
if(firing_check == 1)
- Fire(user,usr, reflex = 1)
+ Fire(user,M, reflex = 1)
else if(!told_cant_shoot)
to_chat(M, "They can't be hit from here!")
told_cant_shoot = 1
@@ -108,7 +108,7 @@
else
click_empty(M)
- usr.dir = get_cardinal_dir(src, user)
+ M.dir = get_cardinal_dir(src, user)
if (!firerate) // If firerate is set to lower aim after one shot, untarget the target
user.NotTargeted(src)
From c4a835d0f440130d6f9d238e623d68ff82b13fa5 Mon Sep 17 00:00:00 2001
From: SECBATON GRIFFON <87321915+SECBATON-GRIFFON@users.noreply.github.com>
Date: Wed, 28 Aug 2024 02:43:51 +0100
Subject: [PATCH 05/15] catching this
---
code/modules/projectiles/targeting.dm | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm
index 8461d792e99b..12f310ebb4dc 100644
--- a/code/modules/projectiles/targeting.dm
+++ b/code/modules/projectiles/targeting.dm
@@ -221,6 +221,12 @@
register_event(/event/relaymoved, I, nameof(I::TargetMoved()))
if(!T.client.target_can_click)
register_event(/event/clickon, I, nameof(I::TargetActed()))
+ register_event(/event/logout, T, nameof(src::TargeterLogout()))
+
+/mob/living/proc/TargeterLogout(mob/living/user)
+ for(var/obj/item/weapon/gun/G in user)
+ NotTargeted(G)
+ unregister_event(/event/logout, user, nameof(src::TargeterLogout()))
/mob/living/proc/NotTargeted(var/obj/item/weapon/gun/I)
unregister_event(/event/moved, I, nameof(I::TargetMoved()))
From bdc518f540a7801aacc6f3923ad16660d7d14ec9 Mon Sep 17 00:00:00 2001
From: SECBATON GRIFFON <87321915+SECBATON-GRIFFON@users.noreply.github.com>
Date: Wed, 28 Aug 2024 02:46:35 +0100
Subject: [PATCH 06/15] client checks are back too
---
code/modules/projectiles/targeting.dm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm
index 12f310ebb4dc..6908e1da96b1 100644
--- a/code/modules/projectiles/targeting.dm
+++ b/code/modules/projectiles/targeting.dm
@@ -90,11 +90,11 @@
return
if(!istype(M))
return
- if(M.client && M.client.target_can_move && !M.client.target_can_run && user.m_intent != "run")
- return
- if(src != M.get_active_hand())
+ if(!M.client || src != M.get_active_hand())
stop_aim()
return
+ if(M.client && M.client.target_can_move && !M.client.target_can_run && user.m_intent != "run")
+ return
if(canbe_fired())
var/firing_check = can_hit(user,M) //0 if it cannot hit them, 1 if it is capable of hitting, and 2 if a special check is preventing it from firing.
if(firing_check > 0)
From a9377525ddb4efa21938793e4f5e522874b9448a Mon Sep 17 00:00:00 2001
From: SECBATON GRIFFON <87321915+SECBATON-GRIFFON@users.noreply.github.com>
Date: Wed, 28 Aug 2024 02:48:46 +0100
Subject: [PATCH 07/15] redundant
---
code/modules/projectiles/targeting.dm | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm
index 6908e1da96b1..9f8eac34dcd6 100644
--- a/code/modules/projectiles/targeting.dm
+++ b/code/modules/projectiles/targeting.dm
@@ -86,14 +86,12 @@
return
lock_time = world.time + 15
var/mob/living/M = loc
- if(M == user)
- return
- if(!istype(M))
+ if(M == user || !istype(M))
return
if(!M.client || src != M.get_active_hand())
stop_aim()
return
- if(M.client && M.client.target_can_move && !M.client.target_can_run && user.m_intent != "run")
+ if(M.client.target_can_move && !M.client.target_can_run && user.m_intent != "run")
return
if(canbe_fired())
var/firing_check = can_hit(user,M) //0 if it cannot hit them, 1 if it is capable of hitting, and 2 if a special check is preventing it from firing.
From db3ba97c232ec87c8f47ba1ea6297e4ad28c7fe6 Mon Sep 17 00:00:00 2001
From: SECBATON GRIFFON <87321915+SECBATON-GRIFFON@users.noreply.github.com>
Date: Wed, 28 Aug 2024 02:50:26 +0100
Subject: [PATCH 08/15] adds this here too
---
code/game/mecha/mecha.dm | 1 +
1 file changed, 1 insertion(+)
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index 4124d52ce8b8..eb79c17b7cda 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -351,6 +351,7 @@
//////////////////////////////////
/obj/mecha/relaymove(mob/user,direction)
+ ..()
if(user != src.occupant) //While not "realistic", this piece is player friendly.
user.forceMove(get_turf(src))
to_chat(user, "You climb out from [src]")
From f2a8ef4a92f536583ef2762db987b318b87f9de9 Mon Sep 17 00:00:00 2001
From: SECBATON GRIFFON <87321915+SECBATON-GRIFFON@users.noreply.github.com>
Date: Wed, 28 Aug 2024 02:59:15 +0100
Subject: [PATCH 09/15] clarification
---
code/modules/projectiles/targeting.dm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm
index 9f8eac34dcd6..1df13a3ce11f 100644
--- a/code/modules/projectiles/targeting.dm
+++ b/code/modules/projectiles/targeting.dm
@@ -85,6 +85,8 @@
if(target && (isturf(target) || istype(target,/obj/abstract/screen))) // these are okay to click
return
lock_time = world.time + 15
+ //if(I.last_moved_mob == src) //If they were the last ones to move, give them more of a grace period, so that an automatic weapon can hold down a room better.
+ //I.lock_time = world.time + 15 //just look at the logic of this... it did nothing!!! uncomment if you want this to work again too. be sure to add the variable back.
var/mob/living/M = loc
if(M == user || !istype(M))
return
From 71a9dc79b3ef3179c095d371f0896a665f901d8d Mon Sep 17 00:00:00 2001
From: SECBATON GRIFFON <87321915+SECBATON-GRIFFON@users.noreply.github.com>
Date: Wed, 28 Aug 2024 02:59:48 +0100
Subject: [PATCH 10/15] update syntax
---
code/modules/projectiles/targeting.dm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm
index 1df13a3ce11f..7b26ef593723 100644
--- a/code/modules/projectiles/targeting.dm
+++ b/code/modules/projectiles/targeting.dm
@@ -85,8 +85,8 @@
if(target && (isturf(target) || istype(target,/obj/abstract/screen))) // these are okay to click
return
lock_time = world.time + 15
- //if(I.last_moved_mob == src) //If they were the last ones to move, give them more of a grace period, so that an automatic weapon can hold down a room better.
- //I.lock_time = world.time + 15 //just look at the logic of this... it did nothing!!! uncomment if you want this to work again too. be sure to add the variable back.
+ //if(last_moved_mob == user) //If they were the last ones to move, give them more of a grace period, so that an automatic weapon can hold down a room better.
+ //lock_time = world.time + 15 //just look at the logic of this... it did nothing!!! uncomment if you want this to work again too. be sure to add the variable back.
var/mob/living/M = loc
if(M == user || !istype(M))
return
From e2e0adcf4ab1446a9a982ac00137fcbd36ab7d4b Mon Sep 17 00:00:00 2001
From: SECBATON GRIFFON <87321915+SECBATON-GRIFFON@users.noreply.github.com>
Date: Wed, 28 Aug 2024 03:01:07 +0100
Subject: [PATCH 11/15] for the user too
---
code/modules/projectiles/targeting.dm | 1 +
1 file changed, 1 insertion(+)
diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm
index 7b26ef593723..448c8550bee0 100644
--- a/code/modules/projectiles/targeting.dm
+++ b/code/modules/projectiles/targeting.dm
@@ -102,6 +102,7 @@
Fire(user,M, reflex = 1)
else if(!told_cant_shoot)
to_chat(M, "They can't be hit from here!")
+ to_chat(user, "Luckily, you can't be hit from here!")
told_cant_shoot = 1
spawn(30)
told_cant_shoot = 0
From 87e8045852d16e5e27ef06f2e0af6dcb98aa1f81 Mon Sep 17 00:00:00 2001
From: SECBATON GRIFFON <87321915+SECBATON-GRIFFON@users.noreply.github.com>
Date: Wed, 28 Aug 2024 03:16:09 +0100
Subject: [PATCH 12/15] specifies
---
code/modules/projectiles/targeting.dm | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm
index 448c8550bee0..147be62378a6 100644
--- a/code/modules/projectiles/targeting.dm
+++ b/code/modules/projectiles/targeting.dm
@@ -93,8 +93,13 @@
if(!M.client || src != M.get_active_hand())
stop_aim()
return
- if(M.client.target_can_move && !M.client.target_can_run && user.m_intent != "run")
+ if(M.client.target_can_click && target) // this var only gets filled in from the click event calls, so that's a way of knowing
return
+ if(M.client.target_can_move)
+ if(!M.client.target_can_run && user.m_intent != "run")
+ return
+ else if(!target)
+ return
if(canbe_fired())
var/firing_check = can_hit(user,M) //0 if it cannot hit them, 1 if it is capable of hitting, and 2 if a special check is preventing it from firing.
if(firing_check > 0)
@@ -102,7 +107,6 @@
Fire(user,M, reflex = 1)
else if(!told_cant_shoot)
to_chat(M, "They can't be hit from here!")
- to_chat(user, "Luckily, you can't be hit from here!")
told_cant_shoot = 1
spawn(30)
told_cant_shoot = 0
From 5a3ffcde1c1561ddd7812fa55f6988842da36b16 Mon Sep 17 00:00:00 2001
From: SECBATON GRIFFON <87321915+SECBATON-GRIFFON@users.noreply.github.com>
Date: Wed, 28 Aug 2024 03:27:11 +0100
Subject: [PATCH 13/15] fix
---
code/modules/projectiles/projectile.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm
index fce54773f36b..0e62cee67df6 100644
--- a/code/modules/projectiles/projectile.dm
+++ b/code/modules/projectiles/projectile.dm
@@ -773,7 +773,7 @@ var/list/impact_master = list()
return //cannot shoot yourself
if(istype(A, /obj/item/projectile))
return
- if(istype(A, /mob/living))
+ if(isliving(A) || (locate(/mob/living) in A) || (locate(/mob/living) in A.locked_atoms))
result = 2 //We hit someone, return 1!
return
result = 1
From 4eee105491c4ae09e10efc5d3249ce7f726c9418 Mon Sep 17 00:00:00 2001
From: SECBATON GRIFFON <87321915+SECBATON-GRIFFON@users.noreply.github.com>
Date: Wed, 28 Aug 2024 03:29:18 +0100
Subject: [PATCH 14/15] compiles
---
code/modules/projectiles/projectile.dm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm
index 0e62cee67df6..fcd6f4f066f9 100644
--- a/code/modules/projectiles/projectile.dm
+++ b/code/modules/projectiles/projectile.dm
@@ -773,9 +773,11 @@ var/list/impact_master = list()
return //cannot shoot yourself
if(istype(A, /obj/item/projectile))
return
- if(isliving(A) || (locate(/mob/living) in A) || (locate(/mob/living) in A.locked_atoms))
- result = 2 //We hit someone, return 1!
- return
+ if(ismovable(A))
+ var/atom/movable/AM = A
+ if(isliving(AM) || (locate(/mob/living) in AM) || (locate(/mob/living) in AM.locked_atoms))
+ result = 2 //We hit someone, return 1!
+ return
result = 1
return
From 1ef26cc9baa454831f570f031db9a61f8902d30f Mon Sep 17 00:00:00 2001
From: SECBATON GRIFFON <87321915+SECBATON-GRIFFON@users.noreply.github.com>
Date: Wed, 28 Aug 2024 03:45:48 +0100
Subject: [PATCH 15/15] clearer
---
code/modules/projectiles/targeting.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm
index 147be62378a6..cf6e9fdceaef 100644
--- a/code/modules/projectiles/targeting.dm
+++ b/code/modules/projectiles/targeting.dm
@@ -96,7 +96,7 @@
if(M.client.target_can_click && target) // this var only gets filled in from the click event calls, so that's a way of knowing
return
if(M.client.target_can_move)
- if(!M.client.target_can_run && user.m_intent != "run")
+ if(!M.client.target_can_run && !user.locked_to && user.m_intent != "run") // if the user is relaymoving i'm pretty sure that's NOT walking
return
else if(!target)
return