mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
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:
@@ -44,5 +44,6 @@
|
||||
charges -= chargecost
|
||||
if(charges <= 0)
|
||||
expire?.Invoke(user)
|
||||
qdel(src)
|
||||
return COMPONENT_BLOCK_MAGIC
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user