From a8a071851af42184ac885a4c0dffba6a9ad3f2e9 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Thu, 13 Feb 2020 00:32:26 -0700
Subject: [PATCH 1/5] s
---
code/__DEFINES/flags.dm | 1 -
code/__DEFINES/interaction_flags.dm | 2 --
code/__DEFINES/obj_flags.dm | 25 ++++++++++----------
code/_onclick/item_attack.dm | 6 ++++-
code/modules/antagonists/cult/blood_magic.dm | 2 +-
code/modules/projectiles/gun.dm | 2 +-
6 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm
index 317066f673..957f6edae4 100644
--- a/code/__DEFINES/flags.dm
+++ b/code/__DEFINES/flags.dm
@@ -54,7 +54,6 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define PASSCLOSEDTURF (1<<5)
#define LETPASSTHROW (1<<6)
-
//Movement Types
#define GROUND (1<<0)
#define FLYING (1<<1)
diff --git a/code/__DEFINES/interaction_flags.dm b/code/__DEFINES/interaction_flags.dm
index 6df5bf77fb..dc3242c910 100644
--- a/code/__DEFINES/interaction_flags.dm
+++ b/code/__DEFINES/interaction_flags.dm
@@ -20,5 +20,3 @@
#define INTERACT_MACHINE_SET_MACHINE (1<<6) //MACHINES HAVE THIS BY DEFAULT, SOMEONE SHOULD RUN THROUGH MACHINES AND REMOVE IT FROM THINGS LIKE LIGHT SWITCHES WHEN POSSIBLE!!--------------------------
//This flag determines if a machine set_machine's the user when the user uses it, making updateUsrDialog make the user re-call interact() on it.
//THIS FLAG IS ON ALL MACHINES BY DEFAULT, NEEDS TO BE RE-EVALUATED LATER!!
-
-#define INTERACT_GHOST_READ (1<<0)
\ No newline at end of file
diff --git a/code/__DEFINES/obj_flags.dm b/code/__DEFINES/obj_flags.dm
index 831f73ac74..1c21e2d7b6 100644
--- a/code/__DEFINES/obj_flags.dm
+++ b/code/__DEFINES/obj_flags.dm
@@ -17,18 +17,19 @@
// Flags for the item_flags var on /obj/item
-#define BEING_REMOVED (1<<0)
-#define IN_INVENTORY (1<<1) //is this item equipped into an inventory slot or hand of a mob? used for tooltips
-#define FORCE_STRING_OVERRIDE (1<<2) //used for tooltips
-#define NEEDS_PERMIT (1<<3) //Used by security bots to determine if this item is safe for public use.
-#define SLOWS_WHILE_IN_HAND (1<<4)
-#define NO_MAT_REDEMPTION (1<<5) //Stops you from putting things like an RCD or other items into an ORM or protolathe for materials.
-#define DROPDEL (1<<6) //When dropped, it calls qdel on itself
-#define NOBLUDGEON (1<<7) //when an item has this it produces no "X has been hit by Y with Z" message in the default attackby()
-#define ABSTRACT (1<<8) //for all things that are technically items but used for various different stuff
-#define IMMUTABLE_SLOW (1<<9) //When players should not be able to change the slowdown of the item (Speed potions, ect)
-#define SURGICAL_TOOL (1<<10) //Tool commonly used for surgery: won't attack targets in an active surgical operation on help intent (in case of mistakes)
-#define NO_UNIFORM_REQUIRED (1<<11) //Can be worn on certain slots (currently belt and id) that would otherwise require an uniform.
+#define BEING_REMOVED (1<<0)
+#define IN_INVENTORY (1<<1) //is this item equipped into an inventory slot or hand of a mob? used for tooltips
+#define FORCE_STRING_OVERRIDE (1<<2) //used for tooltips
+#define NEEDS_PERMIT (1<<3) //Used by security bots to determine if this item is safe for public use.
+#define SLOWS_WHILE_IN_HAND (1<<4)
+#define NO_MAT_REDEMPTION (1<<5) //Stops you from putting things like an RCD or other items into an ORM or protolathe for materials.
+#define DROPDEL (1<<6) //When dropped, it calls qdel on itself
+#define NOBLUDGEON (1<<7) //when an item has this it produces no "X has been hit by Y with Z" message in the default attackby()
+#define ABSTRACT (1<<8) //for all things that are technically items but used for various different stuff
+#define IMMUTABLE_SLOW (1<<9) //When players should not be able to change the slowdown of the item (Speed potions, ect)
+#define SURGICAL_TOOL (1<<10) //Tool commonly used for surgery: won't attack targets in an active surgical operation on help intent (in case of mistakes)
+#define NO_UNIFORM_REQUIRED (1<<11) //Can be worn on certain slots (currently belt and id) that would otherwise require an uniform.
+#define NO_ATTACK_CHAIN_SOFT_STAMCRIT (1<<12) //Entirely blocks melee_attack_chain() if user is soft stamcritted. Uses getStaminaLoss() to check at this point in time.
// Flags for the clothing_flags var on /obj/item/clothing
diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm
index cda19dbaac..e658c7d8e8 100644
--- a/code/_onclick/item_attack.dm
+++ b/code/_onclick/item_attack.dm
@@ -1,5 +1,9 @@
/obj/item/proc/melee_attack_chain(mob/user, atom/target, params)
+ if(item_flags & NO_ATTACK_CHAIN_SOFT_STAMCRIT)
+ if(user.getStaminaLoss() >= STAMINA_SOFTCRIT)
+ to_chat(user, "You are too exhausted to swing [src]!")
+ return
if(!tool_attack_chain(user, target) && pre_attack(target, user, params))
// Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example)
var/resolved = target.attackby(src, user, params)
@@ -112,7 +116,7 @@
send_item_attack_message(I, user)
if(I.force)
apply_damage(totitemdamage, I.damtype) //CIT CHANGE - replaces I.force with totitemdamage
- if(I.damtype == BRUTE && !HAS_TRAIT(src, TRAIT_NOMARROW))
+ if(I.damtype == BRUTE && !HAS_TRAIT(src, TRAIT_NOMARROW))
if(prob(33))
I.add_mob_blood(src)
var/turf/location = get_turf(src)
diff --git a/code/modules/antagonists/cult/blood_magic.dm b/code/modules/antagonists/cult/blood_magic.dm
index 1bb1b8533a..3f70dc6e82 100644
--- a/code/modules/antagonists/cult/blood_magic.dm
+++ b/code/modules/antagonists/cult/blood_magic.dm
@@ -343,7 +343,7 @@
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "disintegrate"
item_state = null
- item_flags = NEEDS_PERMIT | ABSTRACT | DROPDEL
+ item_flags = NEEDS_PERMIT | ABSTRACT | DROPDEL | NO_ATTACK_CHAIN_SOFT_STAMCRIT
w_class = WEIGHT_CLASS_HUGE
throwforce = 0
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index 9740b4be04..6029fe302d 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -15,7 +15,7 @@
throw_speed = 3
throw_range = 5
force = 5
- item_flags = NEEDS_PERMIT
+ item_flags = NEEDS_PERMIT | NO_ATTACK_CHAIN_SOFT_STAMCRIT
attack_verb = list("struck", "hit", "bashed")
var/fire_sound = "gunshot"
From 4b2624b932ffe7e38801def96484475fbc071109 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Thu, 13 Feb 2020 03:09:56 -0700
Subject: [PATCH 2/5] Update interaction_flags.dm
---
code/__DEFINES/interaction_flags.dm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/code/__DEFINES/interaction_flags.dm b/code/__DEFINES/interaction_flags.dm
index dc3242c910..6f35ee8e1f 100644
--- a/code/__DEFINES/interaction_flags.dm
+++ b/code/__DEFINES/interaction_flags.dm
@@ -20,3 +20,5 @@
#define INTERACT_MACHINE_SET_MACHINE (1<<6) //MACHINES HAVE THIS BY DEFAULT, SOMEONE SHOULD RUN THROUGH MACHINES AND REMOVE IT FROM THINGS LIKE LIGHT SWITCHES WHEN POSSIBLE!!--------------------------
//This flag determines if a machine set_machine's the user when the user uses it, making updateUsrDialog make the user re-call interact() on it.
//THIS FLAG IS ON ALL MACHINES BY DEFAULT, NEEDS TO BE RE-EVALUATED LATER!!
+
+#define INTERACT_GHOST_READ (1<<0)
From 481f038e018e9a0ab7fbeecbb55be7aef16f801f Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Thu, 13 Feb 2020 05:40:36 -0700
Subject: [PATCH 3/5] Update item_attack.dm
---
code/_onclick/item_attack.dm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm
index 742f295406..9ba51afc69 100644
--- a/code/_onclick/item_attack.dm
+++ b/code/_onclick/item_attack.dm
@@ -9,9 +9,11 @@
*/
/obj/item/proc/melee_attack_chain(mob/user, atom/target, params)
if(item_flags & NO_ATTACK_CHAIN_SOFT_STAMCRIT)
- if(user.getStaminaLoss() >= STAMINA_SOFTCRIT)
- to_chat(user, "You are too exhausted to swing [src]!")
- return
+ if(isliving(user))
+ var/mob/living/L = user
+ if(L.getStaminaLoss() >= STAMINA_SOFTCRIT)
+ to_chat(L, "You are too exhausted to swing [src]!")
+ return
if(tool_behaviour && target.tool_act(user, src, tool_behaviour))
return
if(pre_attack(target, user, params))
From 3865224e786748ae2b7b9a233470a24a4143b8e6 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Thu, 13 Feb 2020 15:40:30 -0700
Subject: [PATCH 4/5] fine
---
code/__DEFINES/obj_flags.dm | 2 +-
code/modules/projectiles/gun.dm | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/code/__DEFINES/obj_flags.dm b/code/__DEFINES/obj_flags.dm
index 1c21e2d7b6..d78de86d25 100644
--- a/code/__DEFINES/obj_flags.dm
+++ b/code/__DEFINES/obj_flags.dm
@@ -29,7 +29,7 @@
#define IMMUTABLE_SLOW (1<<9) //When players should not be able to change the slowdown of the item (Speed potions, ect)
#define SURGICAL_TOOL (1<<10) //Tool commonly used for surgery: won't attack targets in an active surgical operation on help intent (in case of mistakes)
#define NO_UNIFORM_REQUIRED (1<<11) //Can be worn on certain slots (currently belt and id) that would otherwise require an uniform.
-#define NO_ATTACK_CHAIN_SOFT_STAMCRIT (1<<12) //Entirely blocks melee_attack_chain() if user is soft stamcritted. Uses getStaminaLoss() to check at this point in time.
+#define NO_ATTACK_CHAIN_SOFT_STAMCRIT (1<<12) //Entirely blocks melee_attack_chain() if user is soft stamcritted. Uses getStaminaLoss() to check at this point in time. THIS DOES NOT BLOCK RANGED AFTERATTACK()S, ONLY MELEE RANGE AFTERATTACK()S.
// Flags for the clothing_flags var on /obj/item/clothing
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index 6029fe302d..f931fbf54b 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -162,6 +162,9 @@
return
if(firing)
return
+ if(user.getStaminaLoss >= STAMINA_SOFTCRIT) //respect stamina softcrit
+ to_chat(user, "You are too exhausted to fire [src]!")
+ return
if(flag) //It's adjacent, is the user, or is on the user's person
if(target in user.contents) //can't shoot stuff inside us.
return
From fc5eeeac0082063d57cec1c5e7dfca39745f837b Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Sat, 15 Feb 2020 12:14:51 -0700
Subject: [PATCH 5/5] Update gun.dm
---
code/modules/projectiles/gun.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index ebc94d689a..34f7134591 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -168,7 +168,7 @@
return
if(firing)
return
- if(user.getStaminaLoss >= STAMINA_SOFTCRIT) //respect stamina softcrit
+ if(user.getStaminaLoss() >= STAMINA_SOFTCRIT) //respect stamina softcrit
to_chat(user, "You are too exhausted to fire [src]!")
return
if(flag) //It's adjacent, is the user, or is on the user's person