Clean up check for item being equipped

Moved some common code to item.dm. Someone should probably take a look
at get_equipped_items() in inventory.dm sometime in the future.
This commit is contained in:
Mike
2014-04-13 13:36:48 -04:00
committed by ZomgPonies
parent 6d8d253ad7
commit bf98751d8b
3 changed files with 16 additions and 18 deletions
+3 -12
View File
@@ -155,17 +155,6 @@
species_restricted = list("Vox")
action_button_name = "Toggle the magclaws"
//make sure these can only be used when equipped.
/obj/item/clothing/shoes/magboots/vox/proc/can_use()
if(!ismob(loc))
return 0
var/mob/M = loc
if(src in M.get_equipped_items())
return 1
else
return 0
/obj/item/clothing/shoes/magboots/vox/attack_self(mob/user)
if(src.magpulse)
flags &= ~NOSLIP
@@ -173,7 +162,8 @@
canremove = 1
user << "You relax your deathgrip on the flooring."
else
if (!can_use())
//make sure these can only be used when equipped.
if (!is_equipped())
user << "You will have to put on the [src] before you can do that."
return
@@ -185,6 +175,7 @@
//In case they somehow come off while enabled.
/obj/item/clothing/shoes/magboots/vox/dropped(mob/user as mob)
..()
if(src.magpulse)
user.visible_message("The [src] go limp as they are removed from [usr]'s feet.", "The [src] go limp as they are removed from your feet.")
flags &= ~NOSLIP