From ff56ebaa689b9afbf7b6b9a32d6ac7f360001324 Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Wed, 9 Dec 2015 08:58:26 -0600 Subject: [PATCH 1/2] Reactive illusion armour --- code/modules/clothing/suits/armor.dm | 25 ++++++++++ .../living/simple_animal/hostile/illusion.dm | 49 +++++++++++++++++++ tgstation.dme | 1 + 3 files changed, 75 insertions(+) create mode 100644 code/modules/mob/living/simple_animal/hostile/illusion.dm diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index b2219ef32e9..fa9afcbae0e 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,29 @@ 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) + owner.alpha = 0 + spawn(30) + 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..6a21eb2b9e2 --- /dev/null +++ b/code/modules/mob/living/simple_animal/hostile/illusion.dm @@ -0,0 +1,49 @@ +/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 \ 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" From 7d642e052a1fd7e300b6cf66d392e3309c673b2a Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Wed, 9 Dec 2015 09:36:03 -0600 Subject: [PATCH 2/2] Tweaks to illusions to make them respond faster --- code/modules/clothing/suits/armor.dm | 5 ++++- .../mob/living/simple_animal/hostile/illusion.dm | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index fa9afcbae0e..bfbddc03a5a 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -213,8 +213,11 @@ 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 - spawn(30) + 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 diff --git a/code/modules/mob/living/simple_animal/hostile/illusion.dm b/code/modules/mob/living/simple_animal/hostile/illusion.dm index 6a21eb2b9e2..7518f55e1da 100644 --- a/code/modules/mob/living/simple_animal/hostile/illusion.dm +++ b/code/modules/mob/living/simple_animal/hostile/illusion.dm @@ -46,4 +46,12 @@ /mob/living/simple_animal/hostile/illusion/escape retreat_distance = 10 - minimum_distance = 10 \ No newline at end of file + 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