mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Merge remote-tracking branch 'upstream/dev-freeze' into dev
This commit is contained in:
@@ -319,7 +319,7 @@ emp_act
|
||||
if (O.throw_source)
|
||||
var/distance = get_dist(O.throw_source, loc)
|
||||
miss_chance = max(15*(distance-2), 0)
|
||||
zone = get_zone_with_miss_chance(zone, src, miss_chance)
|
||||
zone = get_zone_with_miss_chance(zone, src, miss_chance, ranged_attack=1)
|
||||
|
||||
if(!zone)
|
||||
visible_message("\blue \The [O] misses [src] narrowly!")
|
||||
|
||||
@@ -532,7 +532,7 @@
|
||||
del(G)
|
||||
if(GRAB_NECK)
|
||||
//If the you move when grabbing someone then it's easier for them to break free. Same if the affected mob is immune to stun.
|
||||
if (((world.time - G.assailant.l_move_time < 20 || !L.stunned) && prob(15)) || prob(3))
|
||||
if (((world.time - G.assailant.l_move_time < 30 || !L.stunned) && prob(15)) || prob(3))
|
||||
L.visible_message("<span class='warning'>[L] has broken free of [G.assailant]'s headlock!</span>")
|
||||
del(G)
|
||||
if(resisting)
|
||||
|
||||
@@ -236,20 +236,26 @@ var/list/global/organ_rel_size = list(
|
||||
// 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)
|
||||
/proc/get_zone_with_miss_chance(zone, var/mob/target, var/miss_chance_mod = 0, var/ranged_attack=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
|
||||
if (zone in base_miss_chance)
|
||||
miss_chance = base_miss_chance[zone]
|
||||
miss_chance = max(miss_chance + miss_chance_mod, 0)
|
||||
if(prob(miss_chance))
|
||||
if(prob(70))
|
||||
return null
|
||||
return pick(base_miss_chance)
|
||||
|
||||
// you cannot miss if your target is prone or restrained
|
||||
if(target.buckled || target.lying)
|
||||
return zone
|
||||
// if your target is being grabbed aggressively by someone you cannot miss either
|
||||
if(!ranged_attack)
|
||||
for(var/obj/item/weapon/grab/G in target.grabbed_by)
|
||||
if(G.state >= GRAB_AGGRESSIVE)
|
||||
return zone
|
||||
|
||||
var/miss_chance = 10
|
||||
if (zone in base_miss_chance)
|
||||
miss_chance = base_miss_chance[zone]
|
||||
miss_chance = max(miss_chance + miss_chance_mod, 0)
|
||||
if(prob(miss_chance))
|
||||
if(prob(70))
|
||||
return null
|
||||
return pick(base_miss_chance)
|
||||
return zone
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user