Shielding Auras (#8760)

Ports Baystation12/Baystation12#19992 and Baystation12/Baystation12#27266.

    Added a personal shield device to the traitor tools uplink.
    Added a radiant shielding aura spell to Battlemage and Cleric.
    Added an exosuit shield drone to the mechfab.

This works, but I'm not entirely happy with the sprites. The personal shield has no on-mob shimmer, it uses a mindbatterer grenade as an icon sprite. The wizard radiant spell uses a pretty big and janky sprite as an on-mob, and the exosuit's shield sprite doesn't follow the dir the mech faces, but that one I can maybe fix on my own. If anyone knows about that last one, lemme know, Bay had code for it that we do not.
This commit is contained in:
Geeves
2020-05-15 22:37:27 +02:00
committed by GitHub
parent 3a4dc8e0f2
commit 097ea6cfbc
27 changed files with 439 additions and 128 deletions
+31
View File
@@ -0,0 +1,31 @@
/*Auras are simple: They are simple overriders for attackbys, bullet_act, damage procs, etc. They also tick after their respective mob.
They should be used for undeterminate mob effects, like for instance a toggle-able forcefield, or indestructability as long as you don't move.
They should also be used for when you want to effect the ENTIRE mob, like having an armor buff or showering candy everytime you walk.
*/
/obj/aura
var/mob/living/user
/obj/aura/Destroy()
if(user)
user.remove_aura(src)
return ..()
/obj/aura/proc/added_to(var/mob/living/target)
user = target
user.add_aura(src)
/obj/aura/proc/removed()
user = null
/obj/aura/proc/life_tick()
return FALSE
/obj/aura/attackby(obj/item/I, mob/user)
return FALSE
/obj/aura/bullet_act(obj/item/projectile/P, def_zone)
return FALSE
/obj/aura/hitby(atom/movable/M, speed)
return FALSE
@@ -0,0 +1,34 @@
/obj/aura/personal_shield
name = "personal shield"
/obj/aura/personal_shield/added_to(mob/living/L)
..()
playsound(user, 'sound/weapons/flash.ogg', 35, 1)
to_chat(user, SPAN_NOTICE("You feel your body prickle as \the [src] comes online."))
/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
/obj/aura/personal_shield/removed()
to_chat(user, SPAN_WARNING("\The [src] goes offline!"))
playsound(user, 'sound/mecha/internaldmgalarm.ogg', 25, TRUE)
..()
/obj/aura/personal_shield/device
var/obj/item/device/personal_shield/shield
/obj/aura/personal_shield/device/bullet_act()
. = ..()
if(shield)
shield.take_charge()
/obj/aura/personal_shield/device/proc/set_shield(var/user_shield)
shield = user_shield
/obj/aura/personal_shield/device/Destroy()
shield = null
return ..()
+21
View File
@@ -0,0 +1,21 @@
/obj/aura/radiant_aura
name = "radiant aura"
icon = 'icons/effects/effects.dmi'
icon_state = "at_shield1"
alpha = 75
layer = ABOVE_MOB_LAYER
/obj/aura/radiant_aura/added_to(mob/living/user)
..()
to_chat(user, SPAN_NOTICE("A bubble of light appears around you, exuding protection and warmth."))
set_light(6, 6, COLOR_AMBER)
/obj/aura/radiant_aura/Destroy()
to_chat(user, SPAN_WARNING("Your protective aura dissipates, leaving you feeling cold and unsafe."))
return ..()
/obj/aura/radiant_aura/bullet_act(obj/item/projectile/P, var/def_zone)
if(P.check_armour == LASER)
user.visible_message(SPAN_WARNING("\The [P] refracts, bending into \the [user]'s aura."))
return AURA_FALSE
return FALSE
@@ -0,0 +1,64 @@
/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"
var/next_recharge
var/uses = 5
var/obj/aura/personal_shield/device/shield
/obj/item/device/personal_shield/examine(mob/user, distance)
..()
if(Adjacent(user))
to_chat(user, SPAN_NOTICE("\The [src] can absorb [uses] more shot\s."))
/obj/item/device/personal_shield/Initialize()
. = ..()
START_PROCESSING(SSprocessing, src)
/obj/item/device/personal_shield/process()
if(next_recharge < world.time)
uses = min(5, uses + 1)
if(uses == 1)
update_icon()
next_recharge = world.time + 1 MINUTE
/obj/item/device/personal_shield/attack_self(mob/living/user)
if(uses && !shield)
shield = new /obj/aura/personal_shield/device(user)
shield.added_to(user)
shield.set_shield(src)
else
dissipate()
/obj/item/device/personal_shield/Move()
dissipate()
return ..()
/obj/item/device/personal_shield/forceMove()
dissipate()
return ..()
/obj/item/device/personal_shield/proc/take_charge()
uses--
if(!uses)
to_chat(shield.user, FONT_LARGE(SPAN_WARNING("\The [src] begins to spark as it breaks!")))
QDEL_NULL(shield)
update_icon()
return
/obj/item/device/personal_shield/update_icon()
if(uses)
icon_state = "batterer"
else
icon_state = "battererburnt"
/obj/item/device/personal_shield/Destroy()
dissipate()
STOP_PROCESSING(SSprocessing, src)
return ..()
/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)