Merge pull request #13394 from DeltaFire15/attack-runtime-fixes
Some bodypart-related fixes
This commit is contained in:
@@ -269,8 +269,8 @@
|
||||
to_chat(user, "<span class='notice'>[M] is at full health.</span>")
|
||||
return FALSE
|
||||
user.visible_message("<span class='green'>[user] applies \the [src] on [M].</span>", "<span class='green'>You apply \the [src] on [M].</span>")
|
||||
return heal_carbon(M, user, heal_brute, heal_burn)
|
||||
|
||||
M.heal_bodypart_damage(heal_brute)
|
||||
return TRUE
|
||||
to_chat(user, "<span class='warning'>You can't heal [M] with \the [src]!</span>")
|
||||
|
||||
/obj/item/stack/medical/ointment
|
||||
|
||||
@@ -1379,6 +1379,9 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
|
||||
var/obj/item/bodypart/affecting = target.get_bodypart(ran_zone(user.zone_selected))
|
||||
|
||||
if(!affecting) //Maybe the bodypart is missing? Or things just went wrong..
|
||||
affecting = target.get_bodypart(BODY_ZONE_CHEST) //target chest instead, as failsafe. Or hugbox? You decide.
|
||||
|
||||
var/miss_chance = 100//calculate the odds that a punch misses entirely. considers stamina and brute damage of the puncher. punches miss by default to prevent weird cases
|
||||
if(attackchain_flags & ATTACK_IS_PARRY_COUNTERATTACK)
|
||||
miss_chance = 0
|
||||
@@ -1594,6 +1597,10 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
|
||||
/datum/species/proc/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, mob/living/carbon/human/H, attackchain_flags = NONE, damage_multiplier = 1)
|
||||
var/totitemdamage = H.pre_attacked_by(I, user) * damage_multiplier
|
||||
|
||||
if(!affecting) //Something went wrong. Maybe the limb is missing?
|
||||
affecting = H.get_bodypart(BODY_ZONE_CHEST) //If the limb is missing, or something went terribly wrong, just hit the chest instead
|
||||
|
||||
// Allows you to put in item-specific reactions based on species
|
||||
if(user != H)
|
||||
var/list/block_return = list()
|
||||
@@ -1605,8 +1612,6 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
return 0
|
||||
|
||||
var/hit_area
|
||||
if(!affecting) //Something went wrong. Maybe the limb is missing?
|
||||
affecting = H.bodyparts[1]
|
||||
|
||||
hit_area = affecting.name
|
||||
var/def_zone = affecting.body_zone
|
||||
|
||||
Reference in New Issue
Block a user