mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-22 05:25:15 +01:00
Merge pull request #13522 from KorPhaeron/just_an_illusion
Reactive Illusion Armour
This commit is contained in:
@@ -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("<span class='danger'>The [src] blocks the [attack_text], sending out jets of flame!</span>")
|
||||
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("<span class='danger'>[owner] is hit by [attack_text] in the chest!</span>") //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
|
||||
|
||||
|
||||
|
||||
@@ -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("<span class='warning'>[src] vanishes in a puff of smoke! It was a fake!</span>")
|
||||
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
|
||||
Reference in New Issue
Block a user