mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-21 20:11:04 +01:00
Helmet Headbutt Protection (#19531)
This makes headbutting correctly check for the head armour, to determine whether it's possible to knock someone unconscious. Head armour will now prevent you from being knocked unconscious by a headbutt, unless the attacker has more head armour than you. (e.g. breacher hardsuit vs corporate helmet) You can also knock yourself unconscious by headbutting someone with more head armour than you.
This commit is contained in:
@@ -100,16 +100,17 @@
|
||||
if(isunathi(attacker))
|
||||
damage += 5
|
||||
|
||||
var/obj/item/clothing/hat = attacker.head
|
||||
if(istype(hat))
|
||||
damage += hat.force * 3
|
||||
|
||||
target.apply_damage(damage, DAMAGE_BRUTE, BP_HEAD)
|
||||
attacker.apply_damage(10, DAMAGE_BRUTE, BP_HEAD)
|
||||
|
||||
if(armor < 25 && target.headcheck(BP_HEAD) && prob(damage))
|
||||
var/targetarmor = 100 * target.get_blocked_ratio(BP_HEAD, DAMAGE_BRUTE, damage = damage)
|
||||
var/attackerarmor = 100 * attacker.get_blocked_ratio(BP_HEAD, DAMAGE_BRUTE, damage = damage)
|
||||
if((targetarmor < 25 || targetarmor < attackerarmor) && target.headcheck(BP_HEAD) && prob(damage))
|
||||
target.apply_effect(20, PARALYZE)
|
||||
target.visible_message(SPAN_DANGER("[target] [target.species.knockout_message]"))
|
||||
if(attackerarmor < targetarmor && attacker.headcheck(BP_HEAD) && prob(damage))
|
||||
attacker.apply_effect(20, PARALYZE)
|
||||
attacker.visible_message(SPAN_DANGER("[attacker] [attacker.species.knockout_message]"))
|
||||
|
||||
playsound(attacker.loc, /singleton/sound_category/swing_hit_sound, 25, 1, -1)
|
||||
attacker.attack_log += text("\[[time_stamp()]\] <span class='warning'>Headbutted [target.name] ([target.ckey])</span>")
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
author: Crosarius
|
||||
|
||||
delete-after: True
|
||||
|
||||
changes:
|
||||
- qol: "Helmets now protect against being knocked unconscious by a headbutt, unless the person headbutting has a better helmet."
|
||||
- qol: "Headbutting someone who is wearing a helmet can knock yourself out, instead of them."
|
||||
Reference in New Issue
Block a user