Merge pull request #19741 from ChangelingRain/silveraroundredflowersplatinumaroundorangegasblackenedironaroundsoftyellowstonegoldaroundgreenivycopperaroundblueichorbronzearoundpurplecrystal

Clockwork armor cannot be equipped to people if you do not serve Ratvar
This commit is contained in:
oranges
2016-08-09 09:34:20 +12:00
committed by GitHub
6 changed files with 27 additions and 6 deletions
@@ -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))
+2 -1
View File
@@ -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
+2 -2
View File
@@ -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 << "<span class='warning'>Unwield the [name] first!</span>"
@@ -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 << "<span class='warning'>\The [src] is too cumbersome to carry with anything but your hands!</span>"
return 0
@@ -361,7 +361,7 @@
if(pocket_item.flags & NODROP)
usr << "<span class='warning'>You try to empty [src]'s [pocket_side] pocket, it seems to be stuck!</span>"
usr << "<span class='notice'>You try to empty [src]'s [pocket_side] pocket.</span>"
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 << "<span class='notice'>You try to place [place_item] into [src]'s [pocket_side] pocket.</span>"
delay_denominator = 4
else
+1 -1
View File
@@ -797,7 +797,7 @@ Sorry Giacom. Please don't be mad :(
src << "<span class='warning'>You can't put \the [what.name] on [who], it's stuck to your hand!</span>"
return
if(what)
if(!what.mob_can_equip(who, where, 1))
if(!what.mob_can_equip(who, src, where, 1))
src << "<span class='warning'>\The [what.name] doesn't fit in that place!</span>"
return
visible_message("<span class='notice'>[src] tries to put [what] on [who].</span>")
+1 -1
View File
@@ -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