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 23:37:27 +03:00
committed by GitHub
parent 3a4dc8e0f2
commit 097ea6cfbc
27 changed files with 439 additions and 128 deletions
@@ -149,6 +149,11 @@ There are several things that need to be remembered:
if(species.has_floating_eyes)
ovr += species.get_eyes(src)
for(var/aura in auras)
var/obj/aura/A = aura
var/icon/aura_overlay = icon(A.icon, icon_state = A.icon_state)
ovr += aura_overlay
add_overlay(ovr)
if (lying_prev != lying || size_multiplier != 1)
+2
View File
@@ -25,6 +25,8 @@
//Random events (vomiting etc)
handle_random_events()
aura_check(AURA_TYPE_LIFE)
. = 1
//Handle temperature/pressure differences between body and environment
+22
View File
@@ -906,3 +906,25 @@ default behaviour is:
Paralyse(rand(8,16))
make_jittery(rand(150,200))
adjustHalLoss(rand(50,60))
/mob/living/update_icons()
for(var/aura in auras)
var/obj/aura/A = aura
var/icon/aura_overlay = icon(A.icon, icon_state = A.icon_state)
add_overlay(aura_overlay)
/mob/living/proc/add_aura(var/obj/aura/aura)
LAZYDISTINCTADD(auras, aura)
update_icons()
return TRUE
/mob/living/proc/remove_aura(var/obj/aura/aura)
LAZYREMOVE(auras, aura)
update_icons()
return TRUE
/mob/living/Destroy()
if(auras)
for(var/a in auras)
remove_aura(a)
return ..()
+24
View File
@@ -100,6 +100,28 @@
P.on_hit(src, absorb, def_zone)
return absorb
/mob/living/proc/aura_check(var/type)
if(!auras)
return TRUE
. = TRUE
var/list/newargs = args - args[1]
for(var/a in auras)
var/obj/aura/aura = a
var/result = 0
switch(type)
if(AURA_TYPE_WEAPON)
result = aura.attackby(arglist(newargs))
if(AURA_TYPE_BULLET)
result = aura.bullet_act(arglist(newargs))
if(AURA_TYPE_THROWN)
result = aura.hitby(arglist(newargs))
if(AURA_TYPE_LIFE)
result = aura.life_tick()
if(result & AURA_FALSE)
. = FALSE
if(result & AURA_CANCEL)
break
//For visuals, blood splatters and so on.
/mob/living/proc/bullet_impact_visuals(var/obj/item/projectile/P, var/def_zone, var/damage)
var/list/impact_sounds = LAZYACCESS(P.impact_sounds, get_bullet_impact_effect_type(def_zone))
@@ -170,6 +192,8 @@
//this proc handles being hit by a thrown atom
/mob/living/hitby(atom/movable/AM as mob|obj,var/speed = THROWFORCE_SPEED_DIVISOR)//Standardization and logging -Sieve
if(!aura_check(AURA_TYPE_THROWN, AM, speed))
return
if(istype(AM,/obj/))
var/obj/O = AM
var/dtype = O.damtype
+2 -1
View File
@@ -69,4 +69,5 @@
var/burn_mod = 1
var/brute_mod = 1
var/limb_breaking = FALSE // used to limit people from queuing up limb-breaks
var/limb_breaking = FALSE // used to limit people from queuing up limb-breaks
var/list/obj/aura/auras //Basically a catch-all aura/force-field thing.