mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 15:45:25 +01:00
Fixes and Tweaks to Defenses
This commit is contained in:
@@ -135,12 +135,11 @@
|
||||
icon_state = "armor_reflec"
|
||||
item_state = "armor_reflec"
|
||||
blood_overlay_type = "armor"
|
||||
reflect_chance = 40
|
||||
var/hit_reflect_chance = 40
|
||||
armor = list(melee = 10, bullet = 10, laser = 80, energy = 50, bomb = 0, bio = 0, rad = 0)
|
||||
siemens_coefficient = 0
|
||||
|
||||
/obj/item/clothing/suit/armor/laserproof/IsReflect(var/def_zone)
|
||||
var/hit_reflect_chance = reflect_chance
|
||||
if(!(def_zone in list("chest", "groin"))) //If not shot where ablative is covering you, you don't get the reflection bonus!
|
||||
hit_reflect_chance = 0
|
||||
if (prob(hit_reflect_chance))
|
||||
|
||||
@@ -410,6 +410,8 @@
|
||||
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]"))
|
||||
return 0
|
||||
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
|
||||
var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone))
|
||||
var/armor = run_armor_check(affecting, "melee")
|
||||
@@ -417,7 +419,7 @@
|
||||
var/obj/item/organ/external/affected = src.get_organ(dam_zone)
|
||||
affected.add_autopsy_data(M.name, damage) // Add the mob's name to the autopsy data
|
||||
apply_damage(damage, BRUTE, affecting, armor, M.name)
|
||||
if(armor >= 2) return
|
||||
updatehealth()
|
||||
|
||||
/mob/living/carbon/human/attack_larva(mob/living/carbon/alien/larva/L as mob)
|
||||
|
||||
@@ -463,6 +465,8 @@
|
||||
else
|
||||
damage = rand(5, 25)
|
||||
|
||||
if(check_shields(damage, "the [M.name]"))
|
||||
return 0
|
||||
|
||||
var/dam_zone = pick("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg", "groin")
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ emp_act
|
||||
return -1 // complete projectile permutation
|
||||
|
||||
//Shields
|
||||
if(check_shields(P.damage, "the [P.name]"))
|
||||
P.on_hit(src, 2, def_zone)
|
||||
if(check_shields(P.damage, "the [P.name]", P))
|
||||
P.on_hit(src, 100, def_zone)
|
||||
return 2
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ emp_act
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/human/proc/check_reflect(var/def_zone) //Reflection checks for anything in your l_hand, r_hand, or wear_suit based on reflect_chance var of the object
|
||||
/mob/living/carbon/human/proc/check_reflect(var/def_zone) //Reflection checks for anything in your l_hand, r_hand, or wear_suit based on the reflection chance var of the object
|
||||
if(wear_suit && istype(wear_suit, /obj/item/))
|
||||
var/obj/item/I = wear_suit
|
||||
if(I.IsReflect(def_zone) == 1)
|
||||
@@ -160,21 +160,30 @@ emp_act
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/human/proc/check_shields(var/damage = 0, var/attack_text = "the attack")
|
||||
|
||||
//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("\red <B>[src] blocks [attack_text] with the [l_hand.name]!</B>")
|
||||
visible_message("<span class='danger'>[src] blocks [attack_text] with [l_hand]!</span>", \
|
||||
"<span class='userdanger'>[src] blocks [attack_text] with [l_hand]!</span>")
|
||||
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("\red <B>[src] blocks [attack_text] with the [r_hand.name]!</B>")
|
||||
visible_message("<span class='danger'>[src] blocks [attack_text] with [r_hand]!</span>", \
|
||||
"<span class='userdanger'>[src] blocks [attack_text] with [r_hand]!</span>")
|
||||
return 1
|
||||
if(wear_suit && istype(wear_suit, /obj/item/))
|
||||
var/obj/item/I = wear_suit
|
||||
if(I.IsShield() && (prob(50)))
|
||||
visible_message("\red <B>The reactive teleport system flings [src] clear of [attack_text]!</B>")
|
||||
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
|
||||
@@ -248,7 +257,7 @@ emp_act
|
||||
|
||||
if(user != src)
|
||||
user.do_attack_animation(src)
|
||||
if(check_shields(I.force, "the [I.name]"))
|
||||
if(check_shields(I.force, "the [I.name]", I))
|
||||
return 0
|
||||
|
||||
if(istype(I,/obj/item/weapon/card/emag))
|
||||
|
||||
@@ -40,10 +40,10 @@
|
||||
|
||||
/mob/living/proc/updatehealth()
|
||||
if(status_flags & GODMODE)
|
||||
health = 100
|
||||
health = maxHealth
|
||||
stat = CONSCIOUS
|
||||
else
|
||||
health = maxHealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss() - halloss
|
||||
return
|
||||
health = maxHealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss() - halloss
|
||||
|
||||
|
||||
//This proc is used for mobs which are affected by pressure to calculate the amount of pressure that actually
|
||||
|
||||
Reference in New Issue
Block a user