Turns personal shields into a belt device (#8947)

This commit is contained in:
Alberyk
2020-05-28 01:28:34 +02:00
committed by GitHub
parent f1493c6d2e
commit d809007c90
5 changed files with 27 additions and 7 deletions
+3 -1
View File
@@ -1,5 +1,7 @@
/obj/aura/personal_shield
name = "personal shield"
icon = 'icons/effects/effects.dmi'
icon_state = "shield"
/obj/aura/personal_shield/added_to(mob/living/L)
..()
@@ -8,7 +10,7 @@
/obj/aura/personal_shield/bullet_act(obj/item/projectile/P, var/def_zone)
user.visible_message(SPAN_WARNING("\The [user]'s [src.name] flashes before \the [P] can hit them!"))
flick("shield_impact", src)
playsound(user, 'sound/effects/basscannon.ogg', 35, TRUE)
return AURA_FALSE|AURA_CANCEL
@@ -1,8 +1,13 @@
/obj/item/device/personal_shield
name = "personal shield"
desc = "Truely a life-saver: this device protects its user from being hit by objects moving very, very fast, though only for a few shots."
icon = 'icons/obj/device.dmi'
icon_state = "batterer"
icon = 'icons/obj/personal_shield.dmi'
icon_state = "personal_shield"
item_state = "personal_shield"
contained_sprite = TRUE
slot_flags = SLOT_BELT
w_class = ITEMSIZE_LARGE
action_button_name = "Toggle Shield"
var/next_recharge
var/uses = 5
var/obj/aura/personal_shield/device/shield
@@ -28,8 +33,11 @@
shield = new /obj/aura/personal_shield/device(user)
shield.added_to(user)
shield.set_shield(src)
user.update_inv_belt()
else
dissipate()
user.update_inv_belt()
update_icon()
/obj/item/device/personal_shield/Move()
dissipate()
@@ -48,10 +56,12 @@
return
/obj/item/device/personal_shield/update_icon()
if(uses)
icon_state = "batterer"
if(uses && shield)
icon_state = "[icon_state]_on"
item_state = "[icon_state]_on"
else
icon_state = "battererburnt"
icon_state = "[icon_state]"
item_state = "[icon_state]"
/obj/item/device/personal_shield/Destroy()
dissipate()
@@ -61,4 +71,5 @@
/obj/item/device/personal_shield/proc/dissipate()
if(shield?.user)
to_chat(shield.user, FONT_LARGE(SPAN_WARNING("\The [src] fades around you, dissipating.")))
QDEL_NULL(shield)
QDEL_NULL(shield)
update_icon()
@@ -0,0 +1,7 @@
author: Alberyk
delete-after: True
changes:
- rscadd: "Added a new icon to the personal shield and its aura."
- tweak: "Personal shields can now be stored on the belt slot."
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB