Antimagic now gets used up once it loses all charges (#44956)

Also makes the tinfoil hat load correctly if varedited in the DMM.
This commit is contained in:
nemvar
2019-07-04 13:04:20 -07:00
committed by Tad Hardesty
parent 951f7d48af
commit 698fb9c080
2 changed files with 4 additions and 3 deletions
+1
View File
@@ -44,5 +44,6 @@
charges -= chargecost
if(charges <= 0)
expire?.Invoke(user)
qdel(src)
return COMPONENT_BLOCK_MAGIC
+3 -3
View File
@@ -272,6 +272,8 @@
. = ..()
if(!warped)
AddComponent(/datum/component/anti_magic, FALSE, FALSE, TRUE, ITEM_SLOT_HEAD, 6, TRUE, null, CALLBACK(src, .proc/warp_up))
else
warp_up()
/obj/item/clothing/head/foilhat/equipped(mob/living/carbon/human/user, slot)
. = ..()
@@ -304,9 +306,7 @@
name = "scorched tinfoil hat"
desc = "A badly warped up hat. Quite unprobable this will still work against any of fictional and contemporary dangers it used to."
warped = TRUE
var/datum/component/anti_magic/C = GetComponent(/datum/component/anti_magic)
C.RemoveComponent()
if(!isliving(loc))
if(!isliving(loc) || !paranoia)
return
var/mob/living/target = loc
if(target.get_item_by_slot(SLOT_HEAD) != src)