diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index b2219ef32e9..bfbddc03a5a 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -187,6 +187,8 @@ /obj/item/clothing/suit/armor/reactive/fire/hit_reaction(mob/living/carbon/human/owner, attack_text) + if(!active) + return 0 if(prob(hit_reaction_chance)) owner.visible_message("The [src] blocks the [attack_text], sending out jets of flame!") for(var/mob/living/carbon/C in range(6, owner)) @@ -197,6 +199,32 @@ return 1 return 0 + + + + + +/obj/item/clothing/suit/armor/reactive/stealth + name = "reactive stealth armor" + +/obj/item/clothing/suit/armor/reactive/stealth/hit_reaction(mob/living/carbon/human/owner, attack_text) + if(!active) + return 0 + if(prob(hit_reaction_chance)) + var/mob/living/simple_animal/hostile/illusion/escape/E = new(owner.loc) + E.Copy_Parent(owner, 50) + E.GiveTarget(owner) //so it starts running right away + E.Goto(owner, E.move_to_delay, E.minimum_distance) + owner.alpha = 0 + owner.visible_message("[owner] is hit by [attack_text] in the chest!") //We pretend to be hit, since blocking it would stop the message otherwise + spawn(40) + owner.alpha = initial(owner.alpha) + return 1 + + + + + //All of the armor below is mostly unused diff --git a/code/modules/mob/living/simple_animal/hostile/illusion.dm b/code/modules/mob/living/simple_animal/hostile/illusion.dm new file mode 100644 index 00000000000..7518f55e1da --- /dev/null +++ b/code/modules/mob/living/simple_animal/hostile/illusion.dm @@ -0,0 +1,57 @@ +/mob/living/simple_animal/hostile/illusion + name = "illusion" + desc = "It's a fake!" + icon = 'icons/effects/effects.dmi' + icon_state = "static" + icon_living = "static" + icon_dead = "null" + melee_damage_lower = 5 + melee_damage_upper = 5 + a_intent = "harm" + maxHealth = 100 + health = 100 + speed = 0 + faction = list("illusion") + var/life_span = INFINITY //how long until they despawn + var/mob/living/parent_mob + + +/mob/living/simple_animal/hostile/illusion/Life() + ..() + if(world.time > life_span) + death() + + +/mob/living/simple_animal/hostile/illusion/proc/Copy_Parent(mob/living/original, life = 50) + appearance = original.appearance + parent_mob = original + dir = original.dir + life_span = world.time+life //5 seconds + + +/mob/living/simple_animal/hostile/illusion/death() + ..() + visible_message("[src] vanishes in a puff of smoke! It was a fake!") + qdel(src) + + +/mob/living/simple_animal/hostile/illusion/examine(mob/user) + if(parent_mob) + parent_mob.examine(user) + else + return ..() + + +///////Actual Types///////// + +/mob/living/simple_animal/hostile/illusion/escape + retreat_distance = 10 + minimum_distance = 10 + melee_damage_lower = 0 + melee_damage_upper = 0 + speed = -1 + environment_smash = 0 + + +/mob/living/simple_animal/hostile/illusion/escape/AttackingTarget() + return \ No newline at end of file diff --git a/tgstation.dme b/tgstation.dme index 1df1db2c615..4e691e43f47 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1320,6 +1320,7 @@ #include "code\modules\mob\living\simple_animal\hostile\headcrab.dm" #include "code\modules\mob\living\simple_animal\hostile\hivebot.dm" #include "code\modules\mob\living\simple_animal\hostile\hostile.dm" +#include "code\modules\mob\living\simple_animal\hostile\illusion.dm" #include "code\modules\mob\living\simple_animal\hostile\killertomato.dm" #include "code\modules\mob\living\simple_animal\hostile\mimic.dm" #include "code\modules\mob\living\simple_animal\hostile\mining_mobs.dm"