TG Hit Reaction Port+Armor Fixes

This commit is contained in:
Fox-McCloud
2016-07-07 21:17:03 -04:00
parent 3626342f8c
commit 14cfc90ff9
33 changed files with 356 additions and 231 deletions
+92 -15
View File
@@ -222,30 +222,27 @@
//Reactive armor
//When the wearer gets hit, this armor will teleport the user a short distance away (to safety or to more danger, no one knows. That's the fun of it!)
/obj/item/clothing/suit/armor/reactive
name = "Reactive Teleport Armor"
desc = "Someone seperated our Research Director from his own head!"
var/active = 0.0
name = "reactive armor"
desc = "Doesn't seem to do much for some reason."
var/active = 0
icon_state = "reactiveoff"
item_state = "reactiveoff"
blood_overlay_type = "armor"
action_button_name = "Toggle Reactive Armor"
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
action_button_name = "Toggle Reactive Armor"
unacidable = 1
hit_reaction_chance = 50
/obj/item/clothing/suit/armor/reactive/IsShield()
if(active)
return 1
return 0
/obj/item/clothing/suit/armor/reactive/attack_self(mob/user as mob)
/obj/item/clothing/suit/armor/reactive/attack_self(mob/user)
active = !(active)
if(active)
to_chat(user, "<span class='notice'>The reactive armor is now active.</span>")
to_chat(user, "<span class='notice'>[src] is now active.</span>")
icon_state = "reactive"
item_state = "reactive"
else
to_chat(user, "<span class='notice'>The reactive armor is now inactive.</span>")
to_chat(user, "<span class='notice'>[src] is now inactive.</span>")
icon_state = "reactiveoff"
item_state = "reactiveoff"
add_fingerprint(user)
@@ -255,11 +252,91 @@
active = 0
icon_state = "reactiveoff"
item_state = "reactiveoff"
var/mob/living/carbon/human/user = usr
user.update_inv_wear_suit()
..()
//When the wearer gets hit, this armor will teleport the user a short distance away (to safety or to more danger, no one knows. That's the fun of it!)
/obj/item/clothing/suit/armor/reactive/teleport
name = "reactive teleport armor"
desc = "Someone seperated our Research Director from his own head!"
var/tele_range = 6
/obj/item/clothing/suit/armor/reactive/teleport/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance)
if(!active)
return 0
if(prob(hit_reaction_chance))
var/mob/living/carbon/human/H = owner
owner.visible_message("<span class='danger'>The reactive teleport system flings [H] clear of [attack_text], shutting itself off in the process!</span>")
var/list/turfs = new/list()
for(var/turf/T in orange(tele_range, H))
if(istype(T, /turf/space))
continue
if(T.density)
continue
if(T.x>world.maxx-tele_range || T.x<tele_range)
continue
if(T.y>world.maxy-tele_range || T.y<tele_range)
continue
turfs += T
if(!turfs.len)
turfs += pick(/turf in orange(tele_range, H))
var/turf/picked = pick(turfs)
if(!isturf(picked))
return
if(H.buckled)
H.buckled.unbuckle_mob()
H.forceMove(picked)
return 1
return 0
/obj/item/clothing/suit/armor/reactive/fire
name = "reactive incendiary armor"
/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))
if(C != owner)
C.fire_stacks += 8
C.IgniteMob()
owner.fire_stacks = -20
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
/obj/item/clothing/suit/armor/reactive/tesla
name = "reactive tesla armor"
/obj/item/clothing/suit/armor/reactive/tesla/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 arcs of lightning!</span>")
for(var/mob/living/M in view(6, owner))
if(M == owner)
continue
owner.Beam(M,icon_state="lightning[rand(1, 12)]",icon='icons/effects/effects.dmi',time=5)
M.adjustFireLoss(25)
playsound(M, 'sound/machines/defib_zap.ogg', 50, 1, -1)
return 1
//All of the armor below is mostly unused
@@ -70,6 +70,9 @@
item_color = "clown"
flags_size = ONESIZEFITSALL
/obj/item/clothing/under/rank/clown/hit_reaction()
playsound(loc, 'sound/items/bikehorn.ogg', 50, 1, -1)
return 0
/obj/item/clothing/under/rank/head_of_personnel
desc = "It's a jumpsuit worn by someone who works in the position of \"Head of Personnel\"."
+1 -1
View File
@@ -92,7 +92,7 @@
sharp = 0
edge = 0
/obj/item/weapon/claymore/fluff/IsShield()
/obj/item/weapon/claymore/fluff/hit_reaction()
return 0
/obj/item/weapon/crowbar/fluff/zelda_creedy_1 // Zomgponies: Griffin Rowley
+1 -2
View File
@@ -313,7 +313,7 @@
throw_range = 3
w_class = 4
var/extend = 1
flags = NOSHIELD | CONDUCT
flags = CONDUCT
armour_penetration = 20
slot_flags = SLOT_BACK
origin_tech = "materials=2;combat=2"
@@ -339,7 +339,6 @@
throw_range = 3
w_class = 2.0
extend = 0
flags = NOSHIELD
armour_penetration = 20
slot_flags = SLOT_BELT
origin_tech = "materials=3;combat=3"
+4 -5
View File
@@ -181,7 +181,7 @@
attack_verb = list("smashed", "slammed", "whacked", "thwacked")
icon = 'icons/obj/weapons.dmi'
icon_state = "bostaff0"
block_chance = 50
/obj/item/weapon/twohanded/bostaff/update_icon()
icon_state = "bostaff[wielded]"
@@ -239,8 +239,7 @@
return ..()
return ..()
/obj/item/weapon/twohanded/bostaff/IsShield()
/obj/item/weapon/twohanded/bostaff/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance)
if(wielded)
return 1
else
return 0
return ..()
return 0
@@ -85,7 +85,7 @@
leaping = 0
update_icons()
/mob/living/carbon/alien/humanoid/hunter/throw_impact(A)
/mob/living/carbon/alien/humanoid/hunter/throw_impact(atom/A)
if(!leaping)
return ..()
@@ -93,20 +93,26 @@
if(A)
if(istype(A, /mob/living))
var/mob/living/L = A
L.visible_message("<span class ='danger'>[src] pounces on [L]!</span>", "<span class ='userdanger'>[src] pounces on you!</span>")
if(ishuman(L))
var/mob/living/carbon/human/H = L
H.apply_effect(5, WEAKEN, H.run_armor_check(null, "melee"))
else
L.Weaken(5)
sleep(2)//Runtime prevention (infinite bump() calls on hulks)
step_towards(src,L)
var/blocked = 0
if(ishuman(A))
var/mob/living/carbon/human/H = A
if(H.check_shields(90, "the [name]", src, attack_type = THROWN_PROJECTILE_ATTACK))
blocked = 1
if(!blocked)
L.visible_message("<span class ='danger'>[src] pounces on [L]!</span>", "<span class ='userdanger'>[src] pounces on you!</span>")
if(ishuman(L))
var/mob/living/carbon/human/H = L
H.apply_effect(5, WEAKEN, H.run_armor_check(null, "melee"))
else
L.Weaken(5)
sleep(2)//Runtime prevention (infinite bump() calls on hulks)
step_towards(src,L)
toggle_leap(0)
pounce_cooldown = !pounce_cooldown
spawn(pounce_cooldown_time) //3s by default
pounce_cooldown = !pounce_cooldown
else
else if(A.density && !A.CanPass(src))
visible_message("<span class ='danger'>[src] smashes into [A]!</span>", "<span class ='alertalien'>[src] smashes into [A]!</span>")
weakened = 2
+11 -12
View File
@@ -203,15 +203,14 @@
now_pushing = 0
return
if(tmob.r_hand && istype(tmob.r_hand, /obj/item/weapon/shield/riot))
if(prob(99))
now_pushing = 0
return
if(tmob.l_hand && istype(tmob.l_hand, /obj/item/weapon/shield/riot))
if(prob(99))
now_pushing = 0
return
//anti-riot equipment is also anti-push
if(tmob.r_hand && (prob(tmob.r_hand.block_chance * 2)) && !istype(tmob.r_hand, /obj/item/clothing))
now_pushing = 0
return
if(tmob.l_hand && (prob(tmob.l_hand.block_chance * 2)) && !istype(tmob.l_hand, /obj/item/clothing))
now_pushing = 0
return
if(!(tmob.status_flags & CANPUSH))
now_pushing = 0
@@ -414,16 +413,16 @@
M.attack_log += text("\[[time_stamp()]\] <font color='red'>attacked [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>was attacked by [M.name] ([M.ckey])</font>")
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
if(check_shields(damage, "the [M.name]"))
if(check_shields(damage, "the [M.name]", null, MELEE_ATTACK, M.armour_penetration))
return 0
var/dam_zone = pick("head", "chest", "groin", "l_arm", "l_hand", "r_arm", "r_hand", "l_leg", "l_foot", "r_leg", "r_foot")
var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone))
var/armor = run_armor_check(affecting, "melee")
var/armor = run_armor_check(affecting, "melee", armour_penetration = M.armour_penetration)
var/obj/item/organ/external/affected = src.get_organ(dam_zone)
if(affected)
affected.add_autopsy_data(M.name, damage) // Add the mob's name to the autopsy data
apply_damage(damage,M.melee_damage_type, affecting, armor, M.name)
apply_damage(damage, M.melee_damage_type, affecting, armor)
updatehealth()
/mob/living/carbon/human/attack_larva(mob/living/carbon/alien/larva/L as mob)
@@ -461,7 +460,7 @@
else
damage = rand(5, 25)
if(check_shields(damage, "the [M.name]"))
if(check_shields(damage, "the [M.name]", null, MELEE_ATTACK))
return 0
var/dam_zone = pick("head", "chest", "groin", "l_arm", "l_hand", "r_arm", "r_hand", "l_leg", "l_foot", "r_leg", "r_foot")
@@ -18,10 +18,9 @@
..()
if((M != src) && check_shields(0, M.name))
if((M != src) && M.a_intent != "help" && check_shields(0, M.name, attack_type = UNARMED_ATTACK))
add_logs(src, M, "attempted to touch")
M.do_attack_animation(src)
visible_message("\red <B>[M] attempted to touch [src]!</B>")
visible_message("<span class='warning'>[M] attempted to touch [src]!</span>")
return 0
if(istype(M.gloves , /obj/item/clothing/gloves/boxing/hologlove))
@@ -32,7 +32,7 @@ emp_act
return -1 // complete projectile permutation
//Shields
if(check_shields(P.damage, "the [P.name]", P))
if(check_shields(P.damage, "the [P.name]", P, PROJECTILE_ATTACK, P.armour_penetration))
P.on_hit(src, 100, def_zone)
return 2
@@ -132,40 +132,24 @@ emp_act
//End Here
/mob/living/carbon/human/proc/check_shields(var/damage = 0, var/attack_text = "the attack", var/obj/item/O)
if(O)
if(O.flags & NOSHIELD) //weapon ignores shields altogether
return 0
if(l_hand && istype(l_hand, /obj/item/weapon))//Current base is the prob(50-d/3)
var/obj/item/weapon/I = l_hand
if(I.IsShield() && (prob(50 - round(damage / 3))))
visible_message("<span class='danger'>[src] blocks [attack_text] with [l_hand]!</span>", \
"<span class='userdanger'>[src] blocks [attack_text] with [l_hand]!</span>")
/mob/living/carbon/human/proc/check_shields(damage = 0, attack_text = "the attack", atom/movable/AM, attack_type = MELEE_ATTACK, armour_penetration = 0)
var/block_chance_modifier = round(damage / -3)
if(l_hand && !istype(l_hand, /obj/item/clothing))
var/final_block_chance = l_hand.block_chance - (Clamp((armour_penetration-l_hand.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example
if(l_hand.hit_reaction(src, attack_text, final_block_chance, damage, attack_type))
return 1
if(r_hand && istype(r_hand, /obj/item/weapon))
var/obj/item/weapon/I = r_hand
if(I.IsShield() && (prob(50 - round(damage / 3))))
visible_message("<span class='danger'>[src] blocks [attack_text] with [r_hand]!</span>", \
"<span class='userdanger'>[src] blocks [attack_text] with [r_hand]!</span>")
if(r_hand && !istype(r_hand, /obj/item/clothing))
var/final_block_chance = r_hand.block_chance - (Clamp((armour_penetration-r_hand.armour_penetration)/2,0,100)) + block_chance_modifier //Need to reset the var so it doesn't carry over modifications between attempts
if(r_hand.hit_reaction(src, attack_text, final_block_chance, damage, attack_type))
return 1
if(wear_suit && istype(wear_suit, /obj/item/))
var/obj/item/I = wear_suit
if(I.IsShield() && (prob(50)))
visible_message("<span class='danger'>The reactive teleport system flings [src] clear of [attack_text]!</span>", \
"<span class='userdanger'>The reactive teleport system flings [src] clear of [attack_text]!</span>")
var/list/turfs = new/list()
for(var/turf/T in orange(6, src))
if(istype(T,/turf/space)) continue
if(T.density) continue
if(T.x>world.maxx-6 || T.x<6) continue
if(T.y>world.maxy-6 || T.y<6) continue
turfs += T
if(!turfs.len) turfs += pick(/turf in orange(6, src))
var/turf/picked = pick(turfs)
if(!isturf(picked)) return
if(buckled)
buckled.unbuckle_mob()
src.loc = picked
if(wear_suit)
var/final_block_chance = wear_suit.block_chance - (Clamp((armour_penetration-wear_suit.armour_penetration)/2,0,100)) + block_chance_modifier
if(wear_suit.hit_reaction(src, attack_text, final_block_chance, damage, attack_type))
return 1
if(w_uniform)
var/final_block_chance = w_uniform.block_chance - (Clamp((armour_penetration-w_uniform.armour_penetration)/2,0,100)) + block_chance_modifier
if(w_uniform.hit_reaction(src, attack_text, final_block_chance, damage, attack_type))
return 1
return 0
@@ -221,7 +205,7 @@ emp_act
if(user != src)
user.do_attack_animation(src)
if(check_shields(I.force, "the [I.name]", I))
if(check_shields(I.force, "the [I.name]", I, MELEE_ATTACK, I.armour_penetration))
return 0
if(istype(I,/obj/item/weapon/card/emag))
@@ -315,59 +299,52 @@ emp_act
//this proc handles being hit by a thrown atom
/mob/living/carbon/human/hitby(atom/movable/AM as mob|obj,var/speed = 5)
if(istype(AM,/obj/))
var/obj/O = AM
if(istype(AM, /obj/item))
var/obj/item/I = AM
if(in_throw_mode && !get_active_hand() && speed <= 5) //empty active hand and we're in throw mode
if(canmove && !restrained())
if(isturf(O.loc))
put_in_active_hand(O)
visible_message("<span class='warning'>[src] catches [O]!</span>")
if(isturf(I.loc))
put_in_active_hand(I)
visible_message("<span class='warning'>[src] catches [I]!</span>")
throw_mode_off()
return
var/zone = ran_zone("chest", 65)
var/dtype = BRUTE
if(istype(O,/obj/item/weapon))
var/obj/item/weapon/W = O
if(istype(I, /obj/item/weapon))
var/obj/item/weapon/W = I
dtype = W.damtype
var/throw_damage = O.throwforce*(speed/5)
var/throw_damage = I.throwforce*(speed/5)
/*
if(!zone)
visible_message("\blue \The [O] misses [src] narrowly!")
return
*/
O.throwing = 0 //it hit, so stop moving
I.throwing = 0 //it hit, so stop moving
if ((O.thrower != src) && check_shields(throw_damage, "[O]"))
if((I.thrower != src) && check_shields(throw_damage, "\the [I.name]", I, THROWN_PROJECTILE_ATTACK))
return
var/obj/item/organ/external/affecting = get_organ(zone)
if(!affecting)
var/missverb = (O.gender == PLURAL) ? "whizz" : "whizzes"
visible_message("<span class='notice'>\The [O] [missverb] past [src]'s missing [parse_zone(zone)]!</span>",
"<span class='notice'>\The [O] [missverb] past your missing [parse_zone(zone)]!</span>")
var/missverb = (I.gender == PLURAL) ? "whizz" : "whizzes"
visible_message("<span class='notice'>\The [I] [missverb] past [src]'s missing [parse_zone(zone)]!</span>",
"<span class='notice'>\The [I] [missverb] past your missing [parse_zone(zone)]!</span>")
return
var/hit_area = affecting.name
src.visible_message("\red [src] has been hit in the [hit_area] by [O].")
var/armor = run_armor_check(affecting, "melee", "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].") //I guess "melee" is the best fit here
src.visible_message("\red [src] has been hit in the [hit_area] by [I].")
var/armor = run_armor_check(affecting, "melee", "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].", I.armour_penetration) //I guess "melee" is the best fit here
apply_damage(throw_damage, dtype, zone, armor, is_sharp(I), has_edge(I), I)
apply_damage(throw_damage, dtype, zone, armor, is_sharp(O), has_edge(O), O)
if(ismob(O.thrower))
var/mob/M = O.thrower
if(ismob(I.thrower))
var/mob/M = I.thrower
if(M)
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been hit with a [O], thrown by [key_name(M)]</font>")
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Hit [key_name(src)] with a thrown [O]</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been hit with a [I], thrown by [key_name(M)]</font>")
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Hit [key_name(src)] with a thrown [I]</font>")
if(!istype(src,/mob/living/simple_animal/mouse))
msg_admin_attack("[key_name_admin(src)] was hit by a [O], thrown by [key_name_admin(M)]")
msg_admin_attack("[key_name_admin(src)] was hit by a [I], thrown by [key_name_admin(M)]")
//thrown weapon embedded object code.
if(dtype == BRUTE && istype(O,/obj/item))
var/obj/item/I = O
if(dtype == BRUTE && istype(I))
if (!I.is_robot_module())
var/sharp = is_sharp(I)
var/damage = throw_damage
@@ -384,10 +361,10 @@ emp_act
affecting.embed(I)
// Begin BS12 momentum-transfer code.
if(O.throw_source && speed >= 15)
var/obj/item/weapon/W = O
if(I.throw_source && speed >= 15)
var/obj/item/weapon/W = I
var/momentum = speed/2
var/dir = get_dir(O.throw_source, src)
var/dir = get_dir(I.throw_source, src)
visible_message("\red [src] staggers under the impact!","\red You stagger under the impact!")
src.throw_at(get_edge_target_turf(src,dir),1,momentum)
@@ -399,9 +376,9 @@ emp_act
if(T)
src.loc = T
visible_message("<span class='warning'>[src] is pinned to the wall by [O]!</span>","<span class='warning'>You are pinned to the wall by [O]!</span>")
visible_message("<span class='warning'>[src] is pinned to the wall by [I]!</span>","<span class='warning'>You are pinned to the wall by [I]!</span>")
src.anchored = 1
src.pinned += O
src.pinned += I
/mob/living/carbon/human/proc/bloody_hands(var/mob/living/source, var/amount = 2)
+21 -30
View File
@@ -62,49 +62,40 @@
//this proc handles being hit by a thrown atom
/mob/living/hitby(atom/movable/AM as mob|obj,var/speed = 5)//Standardization and logging -Sieve
if(istype(AM,/obj/))
var/obj/O = AM
if(istype(AM, /obj/item))
var/obj/item/I = AM
var/zone = ran_zone("chest", 65)//Hits a random part of the body, geared towards the chest
var/dtype = BRUTE
if(istype(O,/obj/item/weapon))
var/obj/item/weapon/W = O
if(istype(I, /obj/item/weapon))
var/obj/item/weapon/W = I
dtype = W.damtype
if (W.hitsound && W.throwforce > 0)
playsound(loc, W.hitsound, 30, 1, -1)
//run to-hit check here
var/throw_damage = O.throwforce*(speed/5)
var/throw_damage = I.throwforce*(speed/5)
//var/miss_chance = 15
//if (O.throw_source)
//var/distance = get_dist(O.throw_source, loc)
//miss_chance = min(15*(distance-2), 0)
/*
if (prob(miss_chance))
visible_message("\blue \The [O] misses [src] narrowly!")
return
*/
src.visible_message("\red [src] has been hit by [O].")
var/armor = run_armor_check(zone, "melee")
src.visible_message("\red [src] has been hit by [I].")
var/armor = run_armor_check(zone, "melee", "Your armor has protected your [parse_zone(zone)].", "Your armor has softened hit to your [parse_zone(zone)].", I.armour_penetration)
apply_damage(throw_damage, dtype, zone, armor, is_sharp(O), has_edge(O), O)
apply_damage(throw_damage, dtype, zone, armor, is_sharp(I), has_edge(I), I)
O.throwing = 0 //it hit, so stop moving
I.throwing = 0 //it hit, so stop moving
if(ismob(O.thrower))
var/mob/M = O.thrower
if(ismob(I.thrower))
var/mob/M = I.thrower
if(M)
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been hit with a [O], thrown by [key_name(M)]</font>")
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Hit [key_name(src)] with a thrown [O]</font>")
attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been hit with a [I], thrown by [key_name(M)]</font>")
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Hit [key_name(src)] with a thrown [I]</font>")
if(!istype(src,/mob/living/simple_animal/mouse))
msg_admin_attack("[key_name_admin(src)] was hit by a [O], thrown by [key_name_admin(M)]")
msg_admin_attack("[key_name_admin(src)] was hit by a [I], thrown by [key_name_admin(M)]")
// Begin BS12 momentum-transfer code.
if(O.throw_source && speed >= 15)
var/obj/item/weapon/W = O
if(I.throw_source && speed >= 15)
var/obj/item/weapon/W = I
var/momentum = speed/2
var/dir = get_dir(O.throw_source, src)
var/dir = get_dir(I.throw_source, src)
visible_message("\red [src] staggers under the impact!","\red You stagger under the impact!")
src.throw_at(get_edge_target_turf(src,dir),1,momentum)
@@ -113,16 +104,16 @@
if(W.sharp) //Projectile is suitable for pinning.
//Handles embedding for non-humans and simple_animals.
O.loc = src
src.embedded += O
I.loc = src
embedded += I
var/turf/T = near_wall(dir,2)
if(T)
src.loc = T
visible_message("<span class='warning'>[src] is pinned to the wall by [O]!</span>","<span class='warning'>You are pinned to the wall by [O]!</span>")
visible_message("<span class='warning'>[src] is pinned to the wall by [I]!</span>","<span class='warning'>You are pinned to the wall by [I]!</span>")
src.anchored = 1
src.pinned += O
src.pinned += I
/mob/living/mech_melee_attack(obj/mecha/M)
if(M.occupant.a_intent == I_HARM)
@@ -0,0 +1,75 @@
/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"
attacktext = "gores"
maxHealth = 100
health = 100
speed = 0
faction = list("illusion")
var/life_span = INFINITY //how long until they despawn
var/mob/living/parent_mob
var/multiply_chance = 0 //if we multiply on hit
/mob/living/simple_animal/hostile/illusion/Life()
..()
if(world.time > life_span)
death()
/mob/living/simple_animal/hostile/illusion/death(gibbed)
..()
visible_message("<span class='danger'>\The [src] vanishes into thin air! It was a fake!</span>")
ghostize()
qdel(src)
/mob/living/simple_animal/hostile/illusion/proc/Copy_Parent(mob/living/original, life = 50, health = 100, damage = 0, replicate = 0 )
appearance = original.appearance
parent_mob = original
dir = original.dir
life_span = world.time+life
melee_damage_lower = damage
melee_damage_upper = damage
multiply_chance = replicate
faction -= "neutral"
transform = initial(transform)
pixel_y = initial(pixel_y)
pixel_x = initial(pixel_x)
/mob/living/simple_animal/hostile/illusion/examine(mob/user)
if(parent_mob)
parent_mob.examine(user)
else
return ..()
/mob/living/simple_animal/hostile/illusion/AttackingTarget()
..()
if(istype(target, /mob/living) && prob(multiply_chance))
var/mob/living/L = target
if(L.stat == DEAD)
return
var/mob/living/simple_animal/hostile/illusion/M = new(loc)
M.faction = faction.Copy()
M.Copy_Parent(parent_mob, 80, health/2, melee_damage_upper, multiply_chance/2)
M.GiveTarget(L)
///////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
@@ -39,6 +39,7 @@
icon_living = "syndicatemelee"
attacktext = "slashes"
attack_sound = 'sound/weapons/bladeslice.ogg'
armour_penetration = 28
status_flags = 0
loot = list(/obj/effect/landmark/mobcorpse/syndicatesoldier, /obj/item/weapon/melee/energy/sword/saber/red, /obj/item/weapon/shield/energy)
@@ -49,6 +49,7 @@
//LETTING SIMPLE ANIMALS ATTACK? WHAT COULD GO WRONG. Defaults to zero so Ian can still be cuddly
var/melee_damage_lower = 0
var/melee_damage_upper = 0
var/armour_penetration = 0 //How much armour they ignore, as a flat reduction from the targets armour value
var/melee_damage_type = BRUTE //Damage type of a simple mob's melee attack, should it do damage.
var/list/damage_coeff = list(BRUTE = 1, BURN = 1, TOX = 1, CLONE = 1, STAMINA = 0, OXY = 1) // 1 for full damage , 0 for none , -1 for 1:1 heal from that source
var/attacktext = "attacks"