From 3b3a3ad44ed14102421be87aa3696c3acfb517df Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Mon, 29 Jun 2020 23:37:51 -0700
Subject: [PATCH 1/7] nayser
---
code/__DEFINES/dcs/signals.dm | 5 ++++
.../modules/mob/living/living_active_block.dm | 6 +++++
.../modules/mob/living/living_active_parry.dm | 24 +++++++++++++++----
code/modules/surgery/organs/augments_arms.dm | 21 ++++++++++++++--
4 files changed, 49 insertions(+), 7 deletions(-)
diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm
index c6b008329a..0619c4569b 100644
--- a/code/__DEFINES/dcs/signals.dm
+++ b/code/__DEFINES/dcs/signals.dm
@@ -222,6 +222,11 @@
#define COMSIG_LIVING_RUN_BLOCK "living_do_run_block" //from base of mob/living/do_run_block(): (real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone)
#define COMSIG_LIVING_GET_BLOCKING_ITEMS "get_blocking_items" //from base of mob/living/get_blocking_items(): (list/items)
+#define COMSIG_LIVING_ACTIVE_BLOCK_START "active_block_start" //from base of mob/living/keybind_start_active_blocking(): (obj/item/blocking_item, list/backup_items)
+ #define COMPONENT_PREVENT_BLOCK_START 1
+#define COMSIG_LIVING_ACTIVE_PARRY_START "active_parry_start" //from base of mob/living/initiate_parry_sequence(): (parrying_method, datum/parrying_item_mob_or_art, list/backup_items)
+ #define COMPONENT_PREVENT_PARRY_START 1
+
//ALL OF THESE DO NOT TAKE INTO ACCOUNT WHETHER AMOUNT IS 0 OR LOWER AND ARE SENT REGARDLESS!
#define COMSIG_LIVING_STATUS_STUN "living_stun" //from base of mob/living/Stun() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_KNOCKDOWN "living_knockdown" //from base of mob/living/Knockdown() (amount, update, ignore)
diff --git a/code/modules/mob/living/living_active_block.dm b/code/modules/mob/living/living_active_block.dm
index e1b90716b6..892b105616 100644
--- a/code/modules/mob/living/living_active_block.dm
+++ b/code/modules/mob/living/living_active_block.dm
@@ -83,6 +83,12 @@
return FALSE
// QOL: Instead of trying to just block with held item, grab first available item.
var/obj/item/I = find_active_block_item()
+ var/list/other_items = list()
+ if(SEND_SIGNAL(src, COMSIG_LIVING_START_ACTIVE_BLOCKING, I, other_items) & COMPONENT_PREVENT_BLOCK_START)
+ to_chat(src, "Something is preventing you from blocking!")
+ return
+ if(!I && length(other_items))
+ I = other_items[1]
if(!I)
to_chat(src, "You can't block with your bare hands!")
return
diff --git a/code/modules/mob/living/living_active_parry.dm b/code/modules/mob/living/living_active_parry.dm
index 50b51d4d95..4994479d16 100644
--- a/code/modules/mob/living/living_active_parry.dm
+++ b/code/modules/mob/living/living_active_parry.dm
@@ -24,25 +24,39 @@
// yanderedev else if time
var/obj/item/using_item = get_active_held_item()
var/datum/block_parry_data/data
+ var/datum/tool
var/method
if(using_item?.can_active_parry())
data = using_item.block_parry_data
method = ITEM_PARRY
+ tool = using_item
else if(mind?.martial_art?.can_martial_parry)
data = mind.martial_art.block_parry_data
method = MARTIAL_PARRY
+ tool = mind.martial_art
else if(combat_flags & COMBAT_FLAG_UNARMED_PARRY)
data = block_parry_data
method = UNARMED_PARRY
+ tool = src
else
// QOL: If none of the above work, try to find another item.
var/obj/item/backup = find_backup_parry_item()
- if(!backup)
- to_chat(src, "You have nothing to parry with!")
- return FALSE
- data = backup.block_parry_data
- using_item = backup
+ if(backup)
+ tool = backup
+ data = backup.block_parry_data
+ using_item = backup
+ method = ITEM_PARRY
+ var/list/other_items = list()
+ if(SEND_SIGNAL(src, COMSIG_LIVING_START_ACTIVE_PARRYING, method, tool, other_items) & COMPONENT_PREVENT_PARRY_START)
+ to_chat(src, "Something is preventing you from parrying!")
+ return
+ if(!using_item && !method && length(other_items))
+ using_item = other_items[1]
method = ITEM_PARRY
+ data = using_item.block_parry_data
+ if(!method)
+ to_chat(src, "You have nothing to parry with!")
+ return FALSE
//QOL: Try to enable combat mode if it isn't already
SEND_SIGNAL(src, COMSIG_ENABLE_COMBAT_MODE)
if(!SEND_SIGNAL(src, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_ACTIVE))
diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm
index b7dfa3eb88..840020b149 100644
--- a/code/modules/surgery/organs/augments_arms.dm
+++ b/code/modules/surgery/organs/augments_arms.dm
@@ -273,12 +273,29 @@
desc = "A deployable riot shield to help deal with civil unrest."
contents = newlist(/obj/item/shield/riot/implant)
-/obj/item/organ/cyberimp/arm/shield/Extend(obj/item/I)
+/obj/item/organ/cyberimp/arm/shield/Extend(obj/item/I, silent = FALSE)
if(I.obj_integrity == 0) //that's how the shield recharge works
- to_chat(owner, "[I] is still too unstable to extend. Give it some time!")
+ if(!silent)
+ to_chat(owner, "[I] is still too unstable to extend. Give it some time!")
return FALSE
return ..()
+/obj/item/organ/cyberimp/arm/shield/Insert(mob/living/carbon/M, special = FALSE, drop_if_replaced = TRUE)
+ . = ..()
+ if(.)
+ RegisterSignal(M, COMSIG_LIVING_START_ACTIVE_BLOCKING, .proc/on_signal)
+
+/obj/item/organ/cyberimp/arm/shield/Remove(special = FALSE)
+ UnregisterSignal(owner, COMSIG_LIVING_START_ACTIVE_BLOCKING)
+ return ..()
+
+/obj/item/organ/cyberimp/arm/shield/proc/on_signal(datum/source, obj/item/blocking_item, list/other_items = list())
+ if(!blocking_item) //if they don't have something
+ var/obj/item/shield/S = locate() in contents
+ if(!Extend(S, TRUE))
+ return
+ other_items += S
+
/obj/item/organ/cyberimp/arm/shield/emag_act()
. = ..()
if(obj_flags & EMAGGED)
From ee34f37ac200bb358e7ed629f82e094f9b15f9af Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Mon, 29 Jun 2020 23:41:53 -0700
Subject: [PATCH 2/7] fix
---
code/modules/mob/living/living_active_block.dm | 12 ++++++------
code/modules/mob/living/living_active_parry.dm | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/code/modules/mob/living/living_active_block.dm b/code/modules/mob/living/living_active_block.dm
index 892b105616..a4e9612247 100644
--- a/code/modules/mob/living/living_active_block.dm
+++ b/code/modules/mob/living/living_active_block.dm
@@ -14,14 +14,14 @@
changeNext_move(data.block_end_click_cd_add)
return TRUE
-/mob/living/proc/start_active_blocking(obj/item/I)
+/mob/living/proc/active_blocking_start(obj/item/I)
if(combat_flags & (COMBAT_FLAG_ACTIVE_BLOCK_STARTING | COMBAT_FLAG_ACTIVE_BLOCKING))
return FALSE
if(!(I in held_items))
return FALSE
var/datum/block_parry_data/data = I.get_block_parry_data()
if(!istype(data)) //Typecheck because if an admin/coder screws up varediting or something we do not want someone being broken forever, the CRASH logs feedback so we know what happened.
- CRASH("start_active_blocking called with an item with no valid data: [I] --> [I.block_parry_data]!")
+ CRASH("active_blocking_start called with an item with no valid data: [I] --> [I.block_parry_data]!")
combat_flags |= COMBAT_FLAG_ACTIVE_BLOCKING
active_block_item = I
if(data.block_lock_attacking)
@@ -70,12 +70,12 @@
if(combat_flags & (COMBAT_FLAG_ACTIVE_BLOCK_STARTING | COMBAT_FLAG_ACTIVE_BLOCKING))
return keybind_stop_active_blocking()
else
- return keybind_start_active_blocking()
+ return keybind_active_blocking_start()
/**
* Proc called by keybindings to start active blocking.
*/
-/mob/living/proc/keybind_start_active_blocking()
+/mob/living/proc/keybind_active_blocking_start()
if(combat_flags & (COMBAT_FLAG_ACTIVE_BLOCK_STARTING | COMBAT_FLAG_ACTIVE_BLOCKING))
return FALSE
if(!(combat_flags & COMBAT_FLAG_BLOCK_CAPABLE))
@@ -84,7 +84,7 @@
// QOL: Instead of trying to just block with held item, grab first available item.
var/obj/item/I = find_active_block_item()
var/list/other_items = list()
- if(SEND_SIGNAL(src, COMSIG_LIVING_START_ACTIVE_BLOCKING, I, other_items) & COMPONENT_PREVENT_BLOCK_START)
+ if(SEND_SIGNAL(src, COMSIG_LIVING_active_blocking_start, I, other_items) & COMPONENT_PREVENT_BLOCK_START)
to_chat(src, "Something is preventing you from blocking!")
return
if(!I && length(other_items))
@@ -110,7 +110,7 @@
animate(src, pixel_x = get_standard_pixel_x_offset(), pixel_y = get_standard_pixel_y_offset(), time = 2.5, FALSE, SINE_EASING | EASE_IN, ANIMATION_END_NOW)
return
combat_flags &= ~(COMBAT_FLAG_ACTIVE_BLOCK_STARTING)
- start_active_blocking(I)
+ active_blocking_start(I)
/**
* Gets the first item we can that can block, but if that fails, default to active held item.COMSIG_ENABLE_COMBAT_MODE
diff --git a/code/modules/mob/living/living_active_parry.dm b/code/modules/mob/living/living_active_parry.dm
index 4994479d16..56a914f2b4 100644
--- a/code/modules/mob/living/living_active_parry.dm
+++ b/code/modules/mob/living/living_active_parry.dm
@@ -47,7 +47,7 @@
using_item = backup
method = ITEM_PARRY
var/list/other_items = list()
- if(SEND_SIGNAL(src, COMSIG_LIVING_START_ACTIVE_PARRYING, method, tool, other_items) & COMPONENT_PREVENT_PARRY_START)
+ if(SEND_SIGNAL(src, COMSIG_LIVING_active_parrying_start, method, tool, other_items) & COMPONENT_PREVENT_PARRY_START)
to_chat(src, "Something is preventing you from parrying!")
return
if(!using_item && !method && length(other_items))
From 6a91ce84162fde331fa57cf32d470f1b59b38ebc Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Mon, 29 Jun 2020 23:43:53 -0700
Subject: [PATCH 3/7] fix
---
code/modules/mob/living/living_active_block.dm | 12 ++++++------
code/modules/mob/living/living_active_parry.dm | 2 +-
code/modules/surgery/organs/augments_arms.dm | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/code/modules/mob/living/living_active_block.dm b/code/modules/mob/living/living_active_block.dm
index a4e9612247..4bdd1d1c65 100644
--- a/code/modules/mob/living/living_active_block.dm
+++ b/code/modules/mob/living/living_active_block.dm
@@ -14,14 +14,14 @@
changeNext_move(data.block_end_click_cd_add)
return TRUE
-/mob/living/proc/active_blocking_start(obj/item/I)
+/mob/living/proc/ACTIVE_BLOCKING_START(obj/item/I)
if(combat_flags & (COMBAT_FLAG_ACTIVE_BLOCK_STARTING | COMBAT_FLAG_ACTIVE_BLOCKING))
return FALSE
if(!(I in held_items))
return FALSE
var/datum/block_parry_data/data = I.get_block_parry_data()
if(!istype(data)) //Typecheck because if an admin/coder screws up varediting or something we do not want someone being broken forever, the CRASH logs feedback so we know what happened.
- CRASH("active_blocking_start called with an item with no valid data: [I] --> [I.block_parry_data]!")
+ CRASH("ACTIVE_BLOCKING_START called with an item with no valid data: [I] --> [I.block_parry_data]!")
combat_flags |= COMBAT_FLAG_ACTIVE_BLOCKING
active_block_item = I
if(data.block_lock_attacking)
@@ -70,12 +70,12 @@
if(combat_flags & (COMBAT_FLAG_ACTIVE_BLOCK_STARTING | COMBAT_FLAG_ACTIVE_BLOCKING))
return keybind_stop_active_blocking()
else
- return keybind_active_blocking_start()
+ return keybind_ACTIVE_BLOCKING_START()
/**
* Proc called by keybindings to start active blocking.
*/
-/mob/living/proc/keybind_active_blocking_start()
+/mob/living/proc/keybind_ACTIVE_BLOCKING_START()
if(combat_flags & (COMBAT_FLAG_ACTIVE_BLOCK_STARTING | COMBAT_FLAG_ACTIVE_BLOCKING))
return FALSE
if(!(combat_flags & COMBAT_FLAG_BLOCK_CAPABLE))
@@ -84,7 +84,7 @@
// QOL: Instead of trying to just block with held item, grab first available item.
var/obj/item/I = find_active_block_item()
var/list/other_items = list()
- if(SEND_SIGNAL(src, COMSIG_LIVING_active_blocking_start, I, other_items) & COMPONENT_PREVENT_BLOCK_START)
+ if(SEND_SIGNAL(src, COMSIG_LIVING_ACTIVE_BLOCKING_START, I, other_items) & COMPONENT_PREVENT_BLOCK_START)
to_chat(src, "Something is preventing you from blocking!")
return
if(!I && length(other_items))
@@ -110,7 +110,7 @@
animate(src, pixel_x = get_standard_pixel_x_offset(), pixel_y = get_standard_pixel_y_offset(), time = 2.5, FALSE, SINE_EASING | EASE_IN, ANIMATION_END_NOW)
return
combat_flags &= ~(COMBAT_FLAG_ACTIVE_BLOCK_STARTING)
- active_blocking_start(I)
+ ACTIVE_BLOCKING_START(I)
/**
* Gets the first item we can that can block, but if that fails, default to active held item.COMSIG_ENABLE_COMBAT_MODE
diff --git a/code/modules/mob/living/living_active_parry.dm b/code/modules/mob/living/living_active_parry.dm
index 56a914f2b4..c0957d3a9a 100644
--- a/code/modules/mob/living/living_active_parry.dm
+++ b/code/modules/mob/living/living_active_parry.dm
@@ -47,7 +47,7 @@
using_item = backup
method = ITEM_PARRY
var/list/other_items = list()
- if(SEND_SIGNAL(src, COMSIG_LIVING_active_parrying_start, method, tool, other_items) & COMPONENT_PREVENT_PARRY_START)
+ if(SEND_SIGNAL(src, COMSIG_LIVING_ACTIVE_PARRYING_START, method, tool, other_items) & COMPONENT_PREVENT_PARRY_START)
to_chat(src, "Something is preventing you from parrying!")
return
if(!using_item && !method && length(other_items))
diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm
index 840020b149..f5729ba5cb 100644
--- a/code/modules/surgery/organs/augments_arms.dm
+++ b/code/modules/surgery/organs/augments_arms.dm
@@ -283,10 +283,10 @@
/obj/item/organ/cyberimp/arm/shield/Insert(mob/living/carbon/M, special = FALSE, drop_if_replaced = TRUE)
. = ..()
if(.)
- RegisterSignal(M, COMSIG_LIVING_START_ACTIVE_BLOCKING, .proc/on_signal)
+ RegisterSignal(M, COMSIG_LIVING_ACTIVE_BLOCKING_START, .proc/on_signal)
/obj/item/organ/cyberimp/arm/shield/Remove(special = FALSE)
- UnregisterSignal(owner, COMSIG_LIVING_START_ACTIVE_BLOCKING)
+ UnregisterSignal(owner, COMSIG_LIVING_ACTIVE_BLOCKING_START)
return ..()
/obj/item/organ/cyberimp/arm/shield/proc/on_signal(datum/source, obj/item/blocking_item, list/other_items = list())
From 7a2818d6575f7d2ee8da3262f416bd4a3e83eb8a Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Mon, 29 Jun 2020 23:45:18 -0700
Subject: [PATCH 4/7] fix
---
code/modules/mob/living/living_active_block.dm | 12 ++++++------
code/modules/mob/living/living_active_parry.dm | 2 +-
code/modules/surgery/organs/augments_arms.dm | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/code/modules/mob/living/living_active_block.dm b/code/modules/mob/living/living_active_block.dm
index 4bdd1d1c65..97bbea666f 100644
--- a/code/modules/mob/living/living_active_block.dm
+++ b/code/modules/mob/living/living_active_block.dm
@@ -14,14 +14,14 @@
changeNext_move(data.block_end_click_cd_add)
return TRUE
-/mob/living/proc/ACTIVE_BLOCKING_START(obj/item/I)
+/mob/living/proc/ACTIVE_BLOCK_START(obj/item/I)
if(combat_flags & (COMBAT_FLAG_ACTIVE_BLOCK_STARTING | COMBAT_FLAG_ACTIVE_BLOCKING))
return FALSE
if(!(I in held_items))
return FALSE
var/datum/block_parry_data/data = I.get_block_parry_data()
if(!istype(data)) //Typecheck because if an admin/coder screws up varediting or something we do not want someone being broken forever, the CRASH logs feedback so we know what happened.
- CRASH("ACTIVE_BLOCKING_START called with an item with no valid data: [I] --> [I.block_parry_data]!")
+ CRASH("ACTIVE_BLOCK_START called with an item with no valid data: [I] --> [I.block_parry_data]!")
combat_flags |= COMBAT_FLAG_ACTIVE_BLOCKING
active_block_item = I
if(data.block_lock_attacking)
@@ -70,12 +70,12 @@
if(combat_flags & (COMBAT_FLAG_ACTIVE_BLOCK_STARTING | COMBAT_FLAG_ACTIVE_BLOCKING))
return keybind_stop_active_blocking()
else
- return keybind_ACTIVE_BLOCKING_START()
+ return keybind_ACTIVE_BLOCK_START()
/**
* Proc called by keybindings to start active blocking.
*/
-/mob/living/proc/keybind_ACTIVE_BLOCKING_START()
+/mob/living/proc/keybind_ACTIVE_BLOCK_START()
if(combat_flags & (COMBAT_FLAG_ACTIVE_BLOCK_STARTING | COMBAT_FLAG_ACTIVE_BLOCKING))
return FALSE
if(!(combat_flags & COMBAT_FLAG_BLOCK_CAPABLE))
@@ -84,7 +84,7 @@
// QOL: Instead of trying to just block with held item, grab first available item.
var/obj/item/I = find_active_block_item()
var/list/other_items = list()
- if(SEND_SIGNAL(src, COMSIG_LIVING_ACTIVE_BLOCKING_START, I, other_items) & COMPONENT_PREVENT_BLOCK_START)
+ if(SEND_SIGNAL(src, COMSIG_LIVING_ACTIVE_BLOCK_START, I, other_items) & COMPONENT_PREVENT_BLOCK_START)
to_chat(src, "Something is preventing you from blocking!")
return
if(!I && length(other_items))
@@ -110,7 +110,7 @@
animate(src, pixel_x = get_standard_pixel_x_offset(), pixel_y = get_standard_pixel_y_offset(), time = 2.5, FALSE, SINE_EASING | EASE_IN, ANIMATION_END_NOW)
return
combat_flags &= ~(COMBAT_FLAG_ACTIVE_BLOCK_STARTING)
- ACTIVE_BLOCKING_START(I)
+ ACTIVE_BLOCK_START(I)
/**
* Gets the first item we can that can block, but if that fails, default to active held item.COMSIG_ENABLE_COMBAT_MODE
diff --git a/code/modules/mob/living/living_active_parry.dm b/code/modules/mob/living/living_active_parry.dm
index c0957d3a9a..0dab70b045 100644
--- a/code/modules/mob/living/living_active_parry.dm
+++ b/code/modules/mob/living/living_active_parry.dm
@@ -47,7 +47,7 @@
using_item = backup
method = ITEM_PARRY
var/list/other_items = list()
- if(SEND_SIGNAL(src, COMSIG_LIVING_ACTIVE_PARRYING_START, method, tool, other_items) & COMPONENT_PREVENT_PARRY_START)
+ if(SEND_SIGNAL(src, COMSIG_LIVING_ACTIVE_PARRY_START, method, tool, other_items) & COMPONENT_PREVENT_PARRY_START)
to_chat(src, "Something is preventing you from parrying!")
return
if(!using_item && !method && length(other_items))
diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm
index f5729ba5cb..ca1a125929 100644
--- a/code/modules/surgery/organs/augments_arms.dm
+++ b/code/modules/surgery/organs/augments_arms.dm
@@ -283,10 +283,10 @@
/obj/item/organ/cyberimp/arm/shield/Insert(mob/living/carbon/M, special = FALSE, drop_if_replaced = TRUE)
. = ..()
if(.)
- RegisterSignal(M, COMSIG_LIVING_ACTIVE_BLOCKING_START, .proc/on_signal)
+ RegisterSignal(M, COMSIG_LIVING_ACTIVE_BLOCK_START, .proc/on_signal)
/obj/item/organ/cyberimp/arm/shield/Remove(special = FALSE)
- UnregisterSignal(owner, COMSIG_LIVING_ACTIVE_BLOCKING_START)
+ UnregisterSignal(owner, COMSIG_LIVING_ACTIVE_BLOCK_START)
return ..()
/obj/item/organ/cyberimp/arm/shield/proc/on_signal(datum/source, obj/item/blocking_item, list/other_items = list())
From 97564316124148e0f42418df7709f72124955c50 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Mon, 29 Jun 2020 23:52:18 -0700
Subject: [PATCH 5/7] Spelling
---
code/modules/mob/living/living_active_block.dm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/code/modules/mob/living/living_active_block.dm b/code/modules/mob/living/living_active_block.dm
index 97bbea666f..95b1fad320 100644
--- a/code/modules/mob/living/living_active_block.dm
+++ b/code/modules/mob/living/living_active_block.dm
@@ -70,12 +70,12 @@
if(combat_flags & (COMBAT_FLAG_ACTIVE_BLOCK_STARTING | COMBAT_FLAG_ACTIVE_BLOCKING))
return keybind_stop_active_blocking()
else
- return keybind_ACTIVE_BLOCK_START()
+ return keybind_start_active_blocking()
/**
* Proc called by keybindings to start active blocking.
*/
-/mob/living/proc/keybind_ACTIVE_BLOCK_START()
+/mob/living/proc/keybind_start_active_blocking()
if(combat_flags & (COMBAT_FLAG_ACTIVE_BLOCK_STARTING | COMBAT_FLAG_ACTIVE_BLOCKING))
return FALSE
if(!(combat_flags & COMBAT_FLAG_BLOCK_CAPABLE))
From 203949673970673a2fb3688b743832401567d08a Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Tue, 30 Jun 2020 03:05:15 -0700
Subject: [PATCH 6/7] groan
---
code/game/objects/items/shields.dm | 2 +-
code/modules/mob/living/living_active_block.dm | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/code/game/objects/items/shields.dm b/code/game/objects/items/shields.dm
index aefa5d3cc8..21a26f7cd8 100644
--- a/code/game/objects/items/shields.dm
+++ b/code/game/objects/items/shields.dm
@@ -386,7 +386,7 @@ obj/item/shield/riot/bullet_proof
max_integrity = 100
obj_integrity = 100
can_shatter = FALSE
- item_flags = SLOWS_WHILE_IN_HAND
+ item_flags = SLOWS_WHILE_IN_HAND | ITEM_CAN_BLOCK
var/recharge_timerid
var/recharge_delay = 15 SECONDS
diff --git a/code/modules/mob/living/living_active_block.dm b/code/modules/mob/living/living_active_block.dm
index 95b1fad320..fc66908b7f 100644
--- a/code/modules/mob/living/living_active_block.dm
+++ b/code/modules/mob/living/living_active_block.dm
@@ -87,7 +87,7 @@
if(SEND_SIGNAL(src, COMSIG_LIVING_ACTIVE_BLOCK_START, I, other_items) & COMPONENT_PREVENT_BLOCK_START)
to_chat(src, "Something is preventing you from blocking!")
return
- if(!I && length(other_items))
+ if(!I?.can_active_block() && length(other_items))
I = other_items[1]
if(!I)
to_chat(src, "You can't block with your bare hands!")
From f03343b5167a7080f0e5ce7e751a901fdc0bf552 Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Tue, 30 Jun 2020 05:19:50 -0700
Subject: [PATCH 7/7] fix
---
code/modules/mob/living/living_active_block.dm | 11 ++++++-----
code/modules/surgery/organs/augments_arms.dm | 3 ++-
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/code/modules/mob/living/living_active_block.dm b/code/modules/mob/living/living_active_block.dm
index fc66908b7f..4211b2cfd9 100644
--- a/code/modules/mob/living/living_active_block.dm
+++ b/code/modules/mob/living/living_active_block.dm
@@ -87,11 +87,11 @@
if(SEND_SIGNAL(src, COMSIG_LIVING_ACTIVE_BLOCK_START, I, other_items) & COMPONENT_PREVENT_BLOCK_START)
to_chat(src, "Something is preventing you from blocking!")
return
- if(!I?.can_active_block() && length(other_items))
- I = other_items[1]
if(!I)
- to_chat(src, "You can't block with your bare hands!")
- return
+ if(!length(other_items))
+ to_chat(src, "You can't block with your bare hands!")
+ return
+ I = other_items[1]
if(!I.can_active_block())
to_chat(src, "[I] is either not capable of being used to actively block, or is not currently in a state that can! (Try wielding it if it's twohanded, for example.)")
return
@@ -121,7 +121,8 @@
for(var/obj/item/I in held_items - held)
if(I.can_active_block())
return I
- return held
+ else
+ return held
/**
* Proc called by keybindings to stop active blocking.
diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm
index ca1a125929..b42770723b 100644
--- a/code/modules/surgery/organs/augments_arms.dm
+++ b/code/modules/surgery/organs/augments_arms.dm
@@ -132,6 +132,7 @@
"You extend [holder] from your [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm.",
"You hear a short mechanical noise.")
playsound(get_turf(owner), 'sound/mecha/mechmove03.ogg', 50, 1)
+ return TRUE
/obj/item/organ/cyberimp/arm/ui_action_click()
if(crit_fail || (organ_flags & ORGAN_FAILING) || (!holder && !contents.len))
@@ -289,7 +290,7 @@
UnregisterSignal(owner, COMSIG_LIVING_ACTIVE_BLOCK_START)
return ..()
-/obj/item/organ/cyberimp/arm/shield/proc/on_signal(datum/source, obj/item/blocking_item, list/other_items = list())
+/obj/item/organ/cyberimp/arm/shield/proc/on_signal(datum/source, obj/item/blocking_item, list/other_items)
if(!blocking_item) //if they don't have something
var/obj/item/shield/S = locate() in contents
if(!Extend(S, TRUE))