diff --git a/code/game/gamemodes/clock_cult/clock_items.dm b/code/game/gamemodes/clock_cult/clock_items.dm index 31d16e11498..e614d9008e7 100644 --- a/code/game/gamemodes/clock_cult/clock_items.dm +++ b/code/game/gamemodes/clock_cult/clock_items.dm @@ -651,6 +651,11 @@ user.adjustBrainLoss(30) addtimer(user, "unEquip", 1, FALSE, src, 1) //equipped happens before putting stuff on(but not before picking items up). thus, we need to wait for it to be on before forcing it off. +/obj/item/clothing/head/helmet/clockwork/mob_can_equip(mob/M, mob/equipper, slot, disable_warning = 0) + if(equipper && !is_servant_of_ratvar(equipper)) + return 0 + return ..() + /obj/item/clothing/suit/armor/clockwork name = "clockwork cuirass" desc = "A bulky cuirass made of brass." @@ -661,6 +666,11 @@ armor = list(melee = 80, bullet = 50, laser = -15, energy = 5, bomb = 35, bio = 0, rad = 0) allowed = list(/obj/item/clockwork, /obj/item/clothing/glasses/wraith_spectacles, /obj/item/clothing/glasses/judicial_visor, /obj/item/device/mmi/posibrain/soul_vessel) +/obj/item/clothing/suit/armor/clockwork/mob_can_equip(mob/M, mob/equipper, slot, disable_warning = 0) + if(equipper && !is_servant_of_ratvar(equipper)) + return 0 + return ..() + /obj/item/clothing/suit/armor/clockwork/equipped(mob/living/user, slot) ..() if(slot == slot_wear_suit && !is_servant_of_ratvar(user)) @@ -694,6 +704,11 @@ permeability_coefficient = 0.05 armor = list(melee = 80, bullet = 50, laser = -15, energy = 5, bomb = 35, bio = 0, rad = 0) +/obj/item/clothing/gloves/clockwork/mob_can_equip(mob/M, mob/equipper, slot, disable_warning = 0) + if(equipper && !is_servant_of_ratvar(equipper)) + return 0 + return ..() + /obj/item/clothing/gloves/clockwork/equipped(mob/living/user, slot) ..() if(slot == slot_gloves && !is_servant_of_ratvar(user)) @@ -721,6 +736,11 @@ put_on_delay = 30 burn_state = FIRE_PROOF +/obj/item/clothing/shoes/clockwork/mob_can_equip(mob/M, mob/equipper, slot, disable_warning = 0) + if(equipper && !is_servant_of_ratvar(equipper)) + return 0 + return ..() + /obj/item/clothing/shoes/clockwork/equipped(mob/living/user, slot) ..() if(slot == slot_shoes && !is_servant_of_ratvar(user)) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index e96a4fa6df0..442f35adf38 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -378,9 +378,10 @@ obj/item/proc/item_action_slot_check(slot, mob/user) return 1 //the mob M is attempting to equip this item into the slot passed through as 'slot'. Return 1 if it can do this and 0 if it can't. +//if this is being done by a mob other than M, it will include the mob equipper, who is trying to equip the item to mob M. equipper will be null otherwise. //If you are making custom procs but would like to retain partial or complete functionality of this one, include a 'return ..()' to where you want this to happen. //Set disable_warning to 1 if you wish it to not give you outputs. -/obj/item/proc/mob_can_equip(mob/M, slot, disable_warning = 0) +/obj/item/proc/mob_can_equip(mob/M, mob/equipper, slot, disable_warning = 0) if(!M) return 0 diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index bb16e93d1a1..160b5485ff2 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -83,7 +83,7 @@ user.put_in_inactive_hand(O) return -/obj/item/weapon/twohanded/mob_can_equip(mob/M, slot) +/obj/item/weapon/twohanded/mob_can_equip(mob/M, mob/equipper, slot, disable_warning = 0) //Cannot equip wielded items. if(wielded) M << "Unwield the [name] first!" @@ -130,7 +130,7 @@ /obj/item/weapon/twohanded/required/attack_self() return -/obj/item/weapon/twohanded/required/mob_can_equip(mob/M, slot) +/obj/item/weapon/twohanded/required/mob_can_equip(mob/M, mob/equipper, slot, disable_warning = 0) if(wielded) M << "\The [src] is too cumbersome to carry with anything but your hands!" return 0 diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index eb4e7d9c45d..4b1268a267f 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -361,7 +361,7 @@ if(pocket_item.flags & NODROP) usr << "You try to empty [src]'s [pocket_side] pocket, it seems to be stuck!" usr << "You try to empty [src]'s [pocket_side] pocket." - else if(place_item && place_item.mob_can_equip(src, pocket_id, 1) && !(place_item.flags&ABSTRACT)) + else if(place_item && place_item.mob_can_equip(src, usr, pocket_id, 1) && !(place_item.flags&ABSTRACT)) usr << "You try to place [place_item] into [src]'s [pocket_side] pocket." delay_denominator = 4 else diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 10ea7f04e82..681c33553ae 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -797,7 +797,7 @@ Sorry Giacom. Please don't be mad :( src << "You can't put \the [what.name] on [who], it's stuck to your hand!" return if(what) - if(!what.mob_can_equip(who, where, 1)) + if(!what.mob_can_equip(who, src, where, 1)) src << "\The [what.name] doesn't fit in that place!" return visible_message("[src] tries to put [what] on [who].") diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 8bf33b5a50d..da9d63281a8 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -212,7 +212,7 @@ var/next_mob_id = 0 //unset redraw_mob to prevent the mob from being redrawn at the end. /mob/proc/equip_to_slot_if_possible(obj/item/W, slot, qdel_on_fail = 0, disable_warning = 0, redraw_mob = 1) if(!istype(W)) return 0 - if(!W.mob_can_equip(src, slot, disable_warning)) + if(!W.mob_can_equip(src, null, slot, disable_warning)) if(qdel_on_fail) qdel(W) else