From 7209b9107e5101d5ea62443712e0f17d8688e312 Mon Sep 17 00:00:00 2001 From: dovydas12345 Date: Sat, 27 Oct 2018 15:48:12 +0300 Subject: [PATCH 1/5] No more catching two handed items with one hand --- code/modules/mob/living/carbon/carbon_defense.dm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index e22b3b25445..9f3e8431029 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -2,13 +2,26 @@ if(!skipcatch) if(in_throw_mode && !get_active_hand()) //empty active hand and we're in throw mode if(canmove && !restrained()) - if(istype(AM, /obj/item)) + if(istype(AM, /obj/item/twohanded)) + var/obj/item/twohanded/I = AM + if(!get_active_hand() && !get_inactive_hand()) + if(isturf(I.loc)) + put_in_active_hand(I) + visible_message("[src] catches [I]!") + throw_mode_off() + return 1 + else + visible_message("[src] fails to catch [I]!") + + else if(istype(AM, /obj/item)) var/obj/item/I = AM if(isturf(I.loc)) put_in_active_hand(I) visible_message("[src] catches [I]!") throw_mode_off() return 1 + else + visible_message("[src] fails to catch [I]!") ..() /mob/living/carbon/water_act(volume, temperature, source) From 1bd51e6daa3af2448e5716fef24b5e640a9e0091 Mon Sep 17 00:00:00 2001 From: dovydas12345 <37041561+dovydas12345@users.noreply.github.com> Date: Sat, 27 Oct 2018 16:01:24 +0300 Subject: [PATCH 2/5] No more failed message, when they aren't trying to catch it --- .../mob/living/carbon/carbon_defense.dm | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 9f3e8431029..d6036114df9 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -1,10 +1,10 @@ /mob/living/carbon/hitby(atom/movable/AM, skipcatch, hitpush = 1, blocked = 0) if(!skipcatch) - if(in_throw_mode && !get_active_hand()) //empty active hand and we're in throw mode + if(in_throw_mode) //Makes sure player is in throw mode if(canmove && !restrained()) if(istype(AM, /obj/item/twohanded)) var/obj/item/twohanded/I = AM - if(!get_active_hand() && !get_inactive_hand()) + if(!get_active_hand() && !get_inactive_hand()) //Makes sure both hands are empty if(isturf(I.loc)) put_in_active_hand(I) visible_message("[src] catches [I]!") @@ -14,14 +14,15 @@ visible_message("[src] fails to catch [I]!") else if(istype(AM, /obj/item)) - var/obj/item/I = AM - if(isturf(I.loc)) - put_in_active_hand(I) - visible_message("[src] catches [I]!") - throw_mode_off() - return 1 - else - visible_message("[src] fails to catch [I]!") + if(!get_active_hand()) //Makes sure active hand is empty + var/obj/item/I = AM + if(isturf(I.loc)) + put_in_active_hand(I) + visible_message("[src] catches [I]!") + throw_mode_off() + return 1 + else + visible_message("[src] fails to catch [I]!") ..() /mob/living/carbon/water_act(volume, temperature, source) From e3ffe1098b98fde694eca21e96484e4cc94dfdf2 Mon Sep 17 00:00:00 2001 From: dovydas12345 <37041561+dovydas12345@users.noreply.github.com> Date: Sat, 27 Oct 2018 16:12:45 +0300 Subject: [PATCH 3/5] Wooops --- code/modules/mob/living/carbon/carbon_defense.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index d6036114df9..3adbb6206d9 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -14,8 +14,8 @@ visible_message("[src] fails to catch [I]!") else if(istype(AM, /obj/item)) + var/obj/item/I = AM if(!get_active_hand()) //Makes sure active hand is empty - var/obj/item/I = AM if(isturf(I.loc)) put_in_active_hand(I) visible_message("[src] catches [I]!") From de09a1f309d08a371a00503d6e6392d4197bf7b4 Mon Sep 17 00:00:00 2001 From: dovydas12345 <37041561+dovydas12345@users.noreply.github.com> Date: Sat, 27 Oct 2018 20:54:31 +0300 Subject: [PATCH 4/5] Requested changes, removes fail message --- .../mob/living/carbon/carbon_defense.dm | 35 +++++++------------ 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 3adbb6206d9..ac2730d3e37 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -1,28 +1,17 @@ /mob/living/carbon/hitby(atom/movable/AM, skipcatch, hitpush = 1, blocked = 0) if(!skipcatch) - if(in_throw_mode) //Makes sure player is in throw mode - if(canmove && !restrained()) - if(istype(AM, /obj/item/twohanded)) - var/obj/item/twohanded/I = AM - if(!get_active_hand() && !get_inactive_hand()) //Makes sure both hands are empty - if(isturf(I.loc)) - put_in_active_hand(I) - visible_message("[src] catches [I]!") - throw_mode_off() - return 1 - else - visible_message("[src] fails to catch [I]!") - - else if(istype(AM, /obj/item)) - var/obj/item/I = AM - if(!get_active_hand()) //Makes sure active hand is empty - if(isturf(I.loc)) - put_in_active_hand(I) - visible_message("[src] catches [I]!") - throw_mode_off() - return 1 - else - visible_message("[src] fails to catch [I]!") + if(in_throw_mode && canmove && !restrained()) //Makes sure player is in throw mode + if(!istype(AM,/obj/item) || !isturf(AM.loc)) + retrun FALSE + if(get_active_hand()) + return FALSE + if(istype(AM, /obj/item/twohanded)) + if(get_inactive_hand()) + return FALSE + put_in_active_hand(AM) + visible_message("[src] catches [AM]!") + throw_mode_off() + return TRUE ..() /mob/living/carbon/water_act(volume, temperature, source) From 892478ab94dfe68f438bc58471c6c473b4c02889 Mon Sep 17 00:00:00 2001 From: dovydas12345 <37041561+dovydas12345@users.noreply.github.com> Date: Sat, 27 Oct 2018 20:55:00 +0300 Subject: [PATCH 5/5] Spelling --- code/modules/mob/living/carbon/carbon_defense.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index ac2730d3e37..d4cafa847fd 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -2,7 +2,7 @@ if(!skipcatch) if(in_throw_mode && canmove && !restrained()) //Makes sure player is in throw mode if(!istype(AM,/obj/item) || !isturf(AM.loc)) - retrun FALSE + return FALSE if(get_active_hand()) return FALSE if(istype(AM, /obj/item/twohanded))