This commit is contained in:
Ghommie
2019-10-19 15:02:56 +02:00
parent 26617ba780
commit e991328087
16 changed files with 58 additions and 74 deletions
+2 -2
View File
@@ -408,12 +408,12 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
SEND_SIGNAL(src, COMSIG_ITEM_EQUIPPED, user, slot)
for(var/X in actions)
var/datum/action/A = X
if(item_action_slot_check(slot, user)) //some items only give their actions buttons when in a specific slot.
if(item_action_slot_check(slot, user, A)) //some items only give their actions buttons when in a specific slot.
A.Grant(user)
item_flags |= IN_INVENTORY
//sometimes we only want to grant the item's action if it's equipped in a specific slot.
/obj/item/proc/item_action_slot_check(slot, mob/user)
/obj/item/proc/item_action_slot_check(slot, mob/user, datum/action/A)
if(slot == SLOT_IN_BACKPACK || slot == SLOT_LEGCUFFED) //these aren't true slots, so avoid granting actions there
return FALSE
return TRUE
+1 -1
View File
@@ -37,7 +37,7 @@
PA = new(src)
user.put_in_hands(PA)
/obj/item/chrono_eraser/item_action_slot_check(slot, mob/user)
/obj/item/chrono_eraser/item_action_slot_check(slot, mob/user, datum/action/A)
if(slot == SLOT_BACK)
return 1
+2 -2
View File
@@ -193,7 +193,7 @@
remove_paddles(user)
update_icon()
/obj/item/defibrillator/item_action_slot_check(slot, mob/user)
/obj/item/defibrillator/item_action_slot_check(slot, mob/user, datum/action/A)
if(slot == user.getBackSlot())
return 1
@@ -244,7 +244,7 @@
w_class = WEIGHT_CLASS_NORMAL
slot_flags = ITEM_SLOT_BELT
/obj/item/defibrillator/compact/item_action_slot_check(slot, mob/user)
/obj/item/defibrillator/compact/item_action_slot_check(slot, mob/user, datum/action/A)
if(slot == user.getBeltSlot())
return TRUE
@@ -195,7 +195,7 @@ effective or pretty fucking useless.
Deactivate()
return
/obj/item/shadowcloak/item_action_slot_check(slot, mob/user)
/obj/item/shadowcloak/item_action_slot_check(slot, mob/user, datum/action/A)
if(slot == SLOT_BELT)
return 1
+2 -2
View File
@@ -24,7 +24,7 @@
/obj/item/watertank/ui_action_click(mob/user)
toggle_mister(user)
/obj/item/watertank/item_action_slot_check(slot, mob/user)
/obj/item/watertank/item_action_slot_check(slot, mob/user, datum/action/A)
if(slot == user.getBackSlot())
return 1
@@ -341,7 +341,7 @@
/obj/item/reagent_containers/chemtank/ui_action_click()
toggle_injection()
/obj/item/reagent_containers/chemtank/item_action_slot_check(slot, mob/user)
/obj/item/reagent_containers/chemtank/item_action_slot_check(slot, mob/user, datum/action/A)
if(slot == SLOT_BACK)
return 1