Armor/Damage Changes

- Fixes armor RNG killing for thrown items.
- Kidan no longer act like they have a built-in riot shield (50 -
damage/3)% chance to ignore damage, but take 20% less brute
consistently.
- Entirely missing with a projectile or melee attack is impossible, but
you are more likely to hit a part you were not aiming at. (Ports tg
ran_zone proc and axes current get_zone_with_miss_chance proc).
- Removes some snowflake code for lightning projectiles (Power Glove
traitor item uses these).
This commit is contained in:
DZD
2015-01-17 22:33:47 -05:00
parent 0820364e27
commit f1eb7971e1
5 changed files with 25 additions and 107 deletions
+12 -60
View File
@@ -172,72 +172,24 @@ proc/hasorgans(A)
// If "chest" was passed in as zone, then on a "miss" will return "head", "l_arm", or "r_arm"
// Do not use this if someone is intentionally trying to hit a specific body part.
// Use get_zone_with_miss_chance() for that.
/proc/ran_zone(zone, probability)
zone = check_zone(zone)
if(!probability) probability = 90
if(probability == 100) return zone
/proc/ran_zone(zone, probability = 80)
if(zone == "chest")
if(prob(probability)) return "chest"
var/t = rand(1, 9)
switch(t)
if(1 to 3) return "head"
if(4 to 6) return "l_arm"
if(7 to 9) return "r_arm"
if(prob(probability * 0.75)) return zone
return "chest"
// Emulates targetting a specific body part, and miss chances
// May return null if missed
// miss_chance_mod may be negative.
/proc/get_zone_with_miss_chance(zone, var/mob/target, var/miss_chance_mod = 0)
zone = check_zone(zone)
// you can only miss if your target is standing and not restrained
if(!target.buckled && !target.lying)
var/miss_chance = 10
switch(zone)
if("head")
miss_chance = 40
if("l_leg")
miss_chance = 20
if("r_leg")
miss_chance = 20
if("l_arm")
miss_chance = 20
if("r_arm")
miss_chance = 20
if("l_hand")
miss_chance = 50
if("r_hand")
miss_chance = 50
if("l_foot")
miss_chance = 50
if("r_foot")
miss_chance = 50
miss_chance = max(miss_chance + miss_chance_mod, 0)
if(prob(miss_chance))
if(prob(70))
return null
else
var/t = rand(1, 10)
switch(t)
if(1) return "head"
if(2) return "l_arm"
if(3) return "r_arm"
if(4) return "chest"
if(5) return "l_foot"
if(6) return "r_foot"
if(7) return "l_hand"
if(8) return "r_hand"
if(9) return "l_leg"
if(10) return "r_leg"
if(prob(probability))
return zone
var/t = rand(1, 18) // randomly pick a different zone, or maybe the same one
switch(t)
if(1) return "head"
if(2) return "chest"
if(3 to 6) return "l_arm"
if(7 to 10) return "r_arm"
if(11 to 14) return "l_leg"
if(15 to 18) return "r_leg"
return zone
/proc/stars(n, pr)
if (pr == null)
pr = 25