mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-13 08:03:43 +01:00
Saber SMG update, add armour piercing variable
This commit is contained in:
@@ -262,7 +262,7 @@ emp_act
|
||||
else
|
||||
visible_message("\red <B>[src] has been attacked in the [hit_area] with [I.name] by [user]!</B>")
|
||||
|
||||
var/armor = run_armor_check(affecting, "melee", "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].")
|
||||
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)
|
||||
var/weapon_sharp = is_sharp(I)
|
||||
var/weapon_edge = has_edge(I)
|
||||
if ((weapon_sharp || weapon_edge) && prob(getarmor(user.zone_sel.selecting, "melee")))
|
||||
|
||||
@@ -10,8 +10,16 @@
|
||||
1 - halfblock
|
||||
2 - fullblock
|
||||
*/
|
||||
/mob/living/proc/run_armor_check(var/def_zone = null, var/attack_flag = "melee", var/absorb_text = null, var/soften_text = null)
|
||||
/mob/living/proc/run_armor_check(var/def_zone = null, var/attack_flag = "melee", var/absorb_text = null, var/soften_text = null, armour_penetration, penetrated_text)
|
||||
var/armor = getarmor(def_zone, attack_flag)
|
||||
|
||||
//the if "armor" check is because this is used for everything on /living, including humans
|
||||
if(armor && armour_penetration)
|
||||
armor = max(0, armor - armour_penetration)
|
||||
if(penetrated_text)
|
||||
src << "<span class='userdanger'>[penetrated_text]</span>"
|
||||
else
|
||||
src << "<span class='userdanger'>Your armor was penetrated!</span>"
|
||||
|
||||
if(armor >= 100)
|
||||
if(absorb_text)
|
||||
@@ -42,7 +50,7 @@
|
||||
Stun(2)
|
||||
|
||||
//Armor
|
||||
var/armor = run_armor_check(def_zone, P.flag)
|
||||
var/armor = run_armor_check(def_zone, P.flag, "", "", P.armour_penetration)
|
||||
var/proj_sharp = is_sharp(P)
|
||||
var/proj_edge = has_edge(P)
|
||||
if ((proj_sharp || proj_edge) && prob(getarmor(def_zone, P.flag)))
|
||||
|
||||
Reference in New Issue
Block a user