mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
Armour Refactor (#18547)
* initial commit * bullet fix + 100% armour pen * equivalent armour values * percentage armour pen * updates bombing * adds more defines * i like armour too much * review pass 1 * review pass 2 * updates with lavaland elites * armour penetration value tweaks * wt550 AP round change
This commit is contained in:
@@ -66,7 +66,10 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
|
||||
var/permeability_coefficient = 1 // for chemicals/diseases
|
||||
var/siemens_coefficient = 1 // for electrical admittance/conductance (electrocution checks and shit)
|
||||
var/slowdown = 0 // How much clothing is slowing you down. Negative values speeds you up
|
||||
var/armour_penetration = 0 //percentage of armour effectiveness to remove
|
||||
/// Flat armour reduction, occurs after percentage armour penetration.
|
||||
var/armour_penetration_flat = 0
|
||||
/// Percentage armour reduction, happens before flat armour reduction.
|
||||
var/armour_penetration_percentage = 0
|
||||
var/list/allowed = null //suit storage stuff.
|
||||
var/obj/item/uplink/hidden/hidden_uplink = null // All items can have an uplink hidden inside, just remember to add the triggers.
|
||||
|
||||
|
||||
@@ -112,9 +112,13 @@
|
||||
* * user - The attacking user
|
||||
*/
|
||||
/obj/item/melee/classic_baton/proc/on_non_silicon_stun(mob/living/target, mob/living/user)
|
||||
var/armour = target.run_armor_check("chest", armour_penetration = stamina_armour_pen) // returns a % of their chest melee armour
|
||||
var/factor = (100 - armour) / 100 // converts the % into a decimal
|
||||
target.adjustStaminaLoss(stamina_damage * factor)
|
||||
var/armour = target.run_armor_check("chest", armour_penetration_percentage = stamina_armour_pen) // returns their chest melee armour
|
||||
var/percentage_reduction = 0
|
||||
if(ishuman(target))
|
||||
percentage_reduction = (100 - ARMOUR_VALUE_TO_PERCENTAGE(armour)) / 100
|
||||
else
|
||||
percentage_reduction = (100 - armour) / 100 // converts the % into a decimal
|
||||
target.adjustStaminaLoss(stamina_damage * percentage_reduction)
|
||||
|
||||
/**
|
||||
* # Fancy Cane
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
/obj/item/grenade/frag/proc/embed_shrapnel(mob/living/carbon/human/H, amount)
|
||||
for(var/i = 0, i < amount, i++)
|
||||
if(prob(embed_prob - H.getarmor(null, BOMB)))
|
||||
if(prob(embed_prob - ARMOUR_VALUE_TO_PERCENTAGE(H.getarmor(null, BOMB))))
|
||||
var/obj/item/embedded/S = new embedded_type(src)
|
||||
H.hitby(S, skipcatch = 1)
|
||||
S.throwforce = 1
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
item_state = "scythe0"
|
||||
desc = "Ask not for whom the bell tolls..."
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
armour_penetration = 35
|
||||
armour_penetration_flat = 30
|
||||
slot_flags = SLOT_BACK
|
||||
sharp = TRUE
|
||||
attack_verb = list("chopped", "sliced", "cut", "reaped")
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
w_class_on = WEIGHT_CLASS_HUGE
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
flags = CONDUCT
|
||||
armour_penetration = 100
|
||||
armour_penetration_percentage = 100
|
||||
origin_tech = "combat=4;magnets=3"
|
||||
attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut")
|
||||
attack_verb_on = list()
|
||||
@@ -121,7 +121,8 @@
|
||||
hitsound = "swing_hit"
|
||||
embed_chance = 75
|
||||
embedded_impact_pain_multiplier = 10
|
||||
armour_penetration = 35
|
||||
armour_penetration_percentage = 50
|
||||
armour_penetration_flat = 10
|
||||
origin_tech = "combat=3;magnets=4;syndicate=4"
|
||||
block_chance = 50
|
||||
sharp = TRUE
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
throwforce = 10
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
block_chance = 50
|
||||
armour_penetration = 75
|
||||
armour_penetration_percentage = 75
|
||||
sharp = TRUE
|
||||
origin_tech = "combat=5"
|
||||
attack_verb = list("lunged at", "stabbed")
|
||||
@@ -116,7 +116,7 @@
|
||||
hitsound = 'sound/weapons/rapierhit.ogg'
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
force = 25
|
||||
armour_penetration = 50
|
||||
armour_penetration_flat = 50
|
||||
block_chance = 50
|
||||
///enchantment holder, gives it unique on hit effects.
|
||||
var/datum/enchantment/enchant = null
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
throw_speed = 1
|
||||
throw_range = 5
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
armour_penetration = 100
|
||||
armour_penetration_percentage = 100
|
||||
attack_verb = list("bludgeoned", "whacked", "disciplined")
|
||||
resistance_flags = FLAMMABLE
|
||||
|
||||
|
||||
@@ -226,7 +226,8 @@
|
||||
/obj/item/twohanded/fireaxe/energized
|
||||
desc = "Someone with a love for fire axes decided to turn this one into a high-powered energy weapon. Seems excessive."
|
||||
force_wielded = 35
|
||||
armour_penetration = 20
|
||||
armour_penetration_flat = 10
|
||||
armour_penetration_percentage = 30
|
||||
var/charge = 20
|
||||
var/max_charge = 20
|
||||
|
||||
@@ -279,7 +280,8 @@
|
||||
force_wielded = 34
|
||||
wieldsound = 'sound/weapons/saberon.ogg'
|
||||
unwieldsound = 'sound/weapons/saberoff.ogg'
|
||||
armour_penetration = 35
|
||||
armour_penetration_percentage = 50
|
||||
armour_penetration_flat = 10
|
||||
origin_tech = "magnets=4;syndicate=5"
|
||||
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
|
||||
block_chance = 75
|
||||
@@ -392,7 +394,7 @@
|
||||
force_wielded = 18
|
||||
throwforce = 20
|
||||
throw_speed = 4
|
||||
armour_penetration = 10
|
||||
armour_penetration_flat = 5
|
||||
materials = list(MAT_METAL = 1150, MAT_GLASS = 2075)
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
attack_verb = list("attacked", "poked", "jabbed", "torn", "gored")
|
||||
@@ -443,7 +445,7 @@
|
||||
force_unwielded = 11
|
||||
force_wielded = 20 //I have no idea how to balance
|
||||
throwforce = 22
|
||||
armour_penetration = 15 //Enhanced armor piercing
|
||||
armour_penetration_percentage = 15 //Enhanced armor piercing
|
||||
icon_prefix = "bone_spear"
|
||||
|
||||
//GREY TIDE
|
||||
@@ -576,7 +578,7 @@
|
||||
/obj/item/twohanded/required/chainsaw/doomslayer
|
||||
name = "OOOH BABY"
|
||||
desc = "<span class='warning'>VRRRRRRR!!!</span>"
|
||||
armour_penetration = 100
|
||||
armour_penetration_percentage = 100
|
||||
force_on = 30
|
||||
|
||||
/obj/item/twohanded/required/chainsaw/doomslayer/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
|
||||
@@ -602,7 +604,8 @@
|
||||
hitsound = null // Handled in the snowflaked attack proc
|
||||
wieldsound = 'sound/weapons/chainsawstart.ogg'
|
||||
hitsound = null
|
||||
armour_penetration = 35
|
||||
armour_penetration_percentage = 50
|
||||
armour_penetration_flat = 10
|
||||
origin_tech = "materials=6;syndicate=4"
|
||||
attack_verb = list("sawed", "cut", "hacked", "carved", "cleaved", "butchered", "felled", "timbered")
|
||||
sharp = TRUE
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//the essential proc to call when an obj must receive damage of any kind.
|
||||
/obj/proc/take_damage(damage_amount, damage_type = BRUTE, damage_flag = "", sound_effect = TRUE, attack_dir, armour_penetration = 0)
|
||||
/obj/proc/take_damage(damage_amount, damage_type = BRUTE, damage_flag = "", sound_effect = TRUE, attack_dir, armour_penetration_flat = 0, armour_penetration_percentage = 0)
|
||||
if(QDELETED(src))
|
||||
stack_trace("[src] taking damage after deletion")
|
||||
return
|
||||
@@ -7,7 +7,7 @@
|
||||
play_attack_sound(damage_amount, damage_type, damage_flag)
|
||||
if((resistance_flags & INDESTRUCTIBLE) || obj_integrity <= 0)
|
||||
return
|
||||
damage_amount = run_obj_armor(damage_amount, damage_type, damage_flag, attack_dir, armour_penetration)
|
||||
damage_amount = run_obj_armor(damage_amount, damage_type, damage_flag, attack_dir, armour_penetration_flat, armour_penetration_percentage)
|
||||
if(damage_amount < DAMAGE_PRECISION)
|
||||
return
|
||||
. = damage_amount
|
||||
@@ -20,7 +20,7 @@
|
||||
obj_destruction(damage_flag)
|
||||
|
||||
///returns the damage value of the attack after processing the obj's various armor protections
|
||||
/obj/proc/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir, armour_penetration = 0)
|
||||
/obj/proc/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir, armour_penetration_flat = 0, armour_penetration_percentage = 0)
|
||||
if(damage_flag == MELEE && damage_amount < damage_deflection)
|
||||
return 0
|
||||
switch(damage_type)
|
||||
@@ -32,7 +32,7 @@
|
||||
if(damage_flag)
|
||||
armor_protection = armor.getRating(damage_flag)
|
||||
if(armor_protection) //Only apply weak-against-armor/hollowpoint effects if there actually IS armor.
|
||||
armor_protection = clamp(armor_protection - armour_penetration, min(armor_protection, 0), 100)
|
||||
armor_protection = clamp((armor_protection * ((100 - armour_penetration_percentage) / 100)) - armour_penetration_flat, min(armor_protection, 0), 100)
|
||||
return round(damage_amount * (100 - armor_protection)*0.01, DAMAGE_PRECISION)
|
||||
|
||||
///the sound played when the obj is damaged.
|
||||
@@ -68,7 +68,7 @@
|
||||
playsound(src, P.hitsound, 50, TRUE)
|
||||
visible_message("<span class='danger'>[src] is hit by \a [P]!</span>")
|
||||
if(!QDELETED(src)) //Bullet on_hit effect might have already destroyed this object
|
||||
take_damage(P.damage, P.damage_type, P.flag, 0, turn(P.dir, 180), P.armour_penetration)
|
||||
take_damage(P.damage, P.damage_type, P.flag, 0, turn(P.dir, 180), P.armour_penetration_flat, P.armour_penetration_percentage)
|
||||
|
||||
///Called to get the damage that hulks will deal to the obj.
|
||||
/obj/proc/hulk_damage()
|
||||
@@ -94,10 +94,10 @@
|
||||
return
|
||||
take_damage(400, BRUTE, MELEE, 0, get_dir(src, B))
|
||||
|
||||
/obj/proc/attack_generic(mob/user, damage_amount = 0, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, armor_penetration = 0) //used by attack_alien, attack_animal, and attack_slime
|
||||
/obj/proc/attack_generic(mob/user, damage_amount = 0, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, armour_penetration_flat = 0, armour_penetration_percentage = 0) //used by attack_alien, attack_animal, and attack_slime
|
||||
user.do_attack_animation(src)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
return take_damage(damage_amount, damage_type, damage_flag, sound_effect, get_dir(src, user), armor_penetration)
|
||||
return take_damage(damage_amount, damage_type, damage_flag, sound_effect, get_dir(src, user), armour_penetration_flat, armour_penetration_percentage)
|
||||
|
||||
/obj/attack_alien(mob/living/carbon/alien/humanoid/user)
|
||||
if(attack_generic(user, 60, BRUTE, MELEE, 0))
|
||||
@@ -112,9 +112,9 @@
|
||||
if(M.environment_smash)
|
||||
play_soundeffect = 0
|
||||
if(M.obj_damage)
|
||||
. = attack_generic(M, M.obj_damage, M.melee_damage_type, MELEE, play_soundeffect, M.armour_penetration)
|
||||
. = attack_generic(M, M.obj_damage, M.melee_damage_type, MELEE, play_soundeffect, M.armour_penetration_flat, M.armour_penetration_percentage)
|
||||
else
|
||||
. = attack_generic(M, rand(M.melee_damage_lower,M.melee_damage_upper), M.melee_damage_type, MELEE, play_soundeffect, M.armour_penetration)
|
||||
. = attack_generic(M, rand(M.melee_damage_lower,M.melee_damage_upper), M.melee_damage_type, MELEE, play_soundeffect, M.armour_penetration_flat, M.armour_penetration_percentage)
|
||||
if(. && !play_soundeffect)
|
||||
playsound(src, 'sound/effects/meteorimpact.ogg', 100, TRUE)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user