From b7f29c9a67302b25e62df9970b743d12cbef9351 Mon Sep 17 00:00:00 2001 From: spasticVerbalizer Date: Sun, 24 May 2015 14:13:38 +0200 Subject: [PATCH 1/2] Added quick-equip verb for drones --- .../simple_animal/friendly/drone/inventory.dm | 29 ++++++++++++++++++- .../spasticVerbalizer-droneQuickEquip.yml | 5 ++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 html/changelogs/spasticVerbalizer-droneQuickEquip.yml diff --git a/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm b/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm index 3ee98de3c03..d9adbd6038b 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm @@ -112,4 +112,31 @@ /mob/living/simple_animal/drone/stripPanelEquip(obj/item/what, mob/who, where) - ..(what, who, where, 1) \ No newline at end of file + ..(what, who, where, 1) + +/mob/living/simple_animal/drone/verb/quick_equip() + set name = "quick-equip" + set hidden = 1 + if (isdrone(src)) + var/mob/living/simple_animal/drone/D = src + var/obj/item/I = D.get_active_hand() + var/obj/item/weapon/storage/S = D.get_inactive_hand() + var/obj/item/weapon/storage/T = D.internal_storage + if (!I) + usr << "You are not holding anything to equip!" + return + if(D.equip_to_appropriate_slot(I)) + if(hand) + update_inv_l_hand(0) + else + update_inv_r_hand(0) + else if(s_active && s_active.can_be_inserted(I,1)) //if storage active insert there + s_active.handle_item_insertion(I) + else if(istype(S, /obj/item/weapon/storage) && S.can_be_inserted(I,1)) //see if we have box in other hand + S.handle_item_insertion(I) + else if (istype(T) && T.can_be_inserted(I,1)) // If carrying storage item like toolbox + T.handle_item_insertion(I) + else if(!D.internal_storage) + D.equip_to_slot(I, "drone_storage_slot") + else + D << "You are unable to equip that!" diff --git a/html/changelogs/spasticVerbalizer-droneQuickEquip.yml b/html/changelogs/spasticVerbalizer-droneQuickEquip.yml new file mode 100644 index 00000000000..eb18e8577f5 --- /dev/null +++ b/html/changelogs/spasticVerbalizer-droneQuickEquip.yml @@ -0,0 +1,5 @@ +author: spasticVerbalizer +delete-after: True + +changes: + - rscfix: "Drones can now properly quick-equip." From ab28bb26e8ec5384821c08e5df509f775941f56e Mon Sep 17 00:00:00 2001 From: spasticVerbalizer Date: Sun, 24 May 2015 17:52:01 +0200 Subject: [PATCH 2/2] Feedback --- .../simple_animal/friendly/drone/inventory.dm | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm b/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm index d9adbd6038b..c835c1c4e79 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm @@ -117,26 +117,24 @@ /mob/living/simple_animal/drone/verb/quick_equip() set name = "quick-equip" set hidden = 1 - if (isdrone(src)) - var/mob/living/simple_animal/drone/D = src - var/obj/item/I = D.get_active_hand() - var/obj/item/weapon/storage/S = D.get_inactive_hand() - var/obj/item/weapon/storage/T = D.internal_storage - if (!I) - usr << "You are not holding anything to equip!" - return - if(D.equip_to_appropriate_slot(I)) - if(hand) - update_inv_l_hand(0) - else - update_inv_r_hand(0) - else if(s_active && s_active.can_be_inserted(I,1)) //if storage active insert there - s_active.handle_item_insertion(I) - else if(istype(S, /obj/item/weapon/storage) && S.can_be_inserted(I,1)) //see if we have box in other hand - S.handle_item_insertion(I) - else if (istype(T) && T.can_be_inserted(I,1)) // If carrying storage item like toolbox - T.handle_item_insertion(I) - else if(!D.internal_storage) - D.equip_to_slot(I, "drone_storage_slot") + var/obj/item/I = get_active_hand() + var/obj/item/weapon/storage/S = get_inactive_hand() + var/obj/item/weapon/storage/T = internal_storage + if (!I) + usr << "You are not holding anything to equip!" + return + if(equip_to_appropriate_slot(I)) + if(hand) + update_inv_l_hand(0) else - D << "You are unable to equip that!" + update_inv_r_hand(0) + else if(s_active && s_active.can_be_inserted(I,1)) //if storage active insert there + s_active.handle_item_insertion(I) + else if(istype(S, /obj/item/weapon/storage) && S.can_be_inserted(I,1)) //see if we have box in other hand + S.handle_item_insertion(I) + else if (istype(T) && T.can_be_inserted(I,1)) // If carrying storage item like toolbox + T.handle_item_insertion(I) + else if(!internal_storage) + equip_to_slot(I, "drone_storage_slot") + else + usr << "You are unable to equip that!"