Animal healing fix (#1162)

Fixes animal healing with food, which i broke a couple patches ago, and healing animals with medical kits, which has never really worked right

I tweaked the heal values on the kits slightly, this wont make much difference to healing humans, only to healing animals.
Also added a doafter thing to make it a tiny bit more involved.

Also adds a little text for animals to make it visible on examination if they're wounded
This commit is contained in:
NanakoAC
2016-11-18 22:03:43 +02:00
committed by skull132
parent 265b56d925
commit 182d4375be
3 changed files with 72 additions and 27 deletions
+19 -10
View File
@@ -10,8 +10,8 @@
var/heal_brute = 0
var/heal_burn = 0
/obj/item/stack/medical/attack(mob/living/carbon/M as mob, mob/user as mob)
if (!istype(M))
/obj/item/stack/medical/attack(mob/living/M as mob, mob/user as mob)
if (!istype(M) || istype(M, /mob/living/silicon))
user << "\red \The [src] cannot be applied to [M]!"
return 1
@@ -40,13 +40,21 @@
H.UpdateDamageIcon()
else
if (!M.bruteloss && !M.fireloss)
user << "<span class='notice'> [M] seems healthy, there are no wounds to treat! </span>"
return 1
M.heal_organ_damage((src.heal_brute/2), (src.heal_burn/2))
user.visible_message( \
"\blue [M] has been applied with [src] by [user].", \
"\blue You apply \the [src] to [M]." \
)
use(1)
"<span class = 'notice'> [user] starts applying \the [src] to [M].</span>", \
"<span class = 'notice'> You start applying \the [src] to [M].</span>" \
)
if (do_mob(user, M, 30))
M.heal_organ_damage((src.heal_brute/2), (src.heal_burn/2))
user.visible_message( \
"<span class = 'notice'> [M] has been applied with [src] by [user].</span>", \
"<span class = 'notice'> You apply \the [src] to [M].</span>" \
)
use(1)
M.updatehealth()
/obj/item/stack/medical/bruise_pack
@@ -55,6 +63,7 @@
desc = "Some sterile gauze to wrap around bloody stumps."
icon_state = "brutepack"
origin_tech = "biotech=1"
heal_brute = 4
/obj/item/stack/medical/bruise_pack/attack(mob/living/carbon/M as mob, mob/user as mob)
if(..())
@@ -96,7 +105,7 @@
gender = PLURAL
singular_name = "ointment"
icon_state = "ointment"
heal_burn = 1
heal_burn = 4
origin_tech = "biotech=1"
/obj/item/stack/medical/ointment/attack(mob/living/carbon/M as mob, mob/user as mob)
@@ -127,7 +136,7 @@
singular_name = "advanced trauma kit"
desc = "An advanced trauma kit for severe injuries."
icon_state = "traumakit"
heal_brute = 12
heal_brute = 8
origin_tech = "biotech=1"
/obj/item/stack/medical/advanced/bruise_pack/attack(mob/living/carbon/M as mob, mob/user as mob)
@@ -174,7 +183,7 @@
singular_name = "advanced burn kit"
desc = "An advanced treatment kit for severe burns."
icon_state = "burnkit"
heal_burn = 12
heal_burn = 8
origin_tech = "biotech=1"
@@ -142,6 +142,11 @@
user << "<span class='notice'>It looks hungry.</span>"
else if ((reagents.total_volume > 0 && nutrition > max_nutrition *0.75) || nutrition > max_nutrition *0.9)
user << "It looks full and contented."
if (health < maxHealth * 0.5)
user << "<span class='danger'>It looks badly wounded.</span>"
else if (health < maxHealth)
user << "<span class='warning'>It looks wounded.</span>"
/mob/living/simple_animal/Life()
..()
@@ -293,7 +298,16 @@
if (istype(current, /datum/reagent/nutriment))//If its food, it feeds us
var/datum/reagent/nutriment/N = current
nutrition += removed*N.nutriment_factor
health = min(health+(removed*N.regen_factor), maxHealth)
var/heal_amount = removed*N.regen_factor
if (bruteloss > 0)
var/n = min(heal_amount, bruteloss)
adjustBruteLoss(-n)
heal_amount -= n
if (fireloss && heal_amount)
var/n = min(heal_amount, fireloss)
adjustFireLoss(-n)
heal_amount -= n
updatehealth()
current.remove_self(removed)//If its not food, it just does nothing. no fancy effects
/mob/living/simple_animal/proc/can_eat()
@@ -373,22 +387,7 @@ mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj)
return
/mob/living/simple_animal/attackby(var/obj/item/O, var/mob/user)
if(istype(O, /obj/item/stack/medical))
user.changeNext_move(4)
if(stat != DEAD)
var/obj/item/stack/medical/MED = O
if(health < maxHealth)
if(MED.amount >= 1)
adjustBruteLoss(-MED.heal_brute)
MED.amount -= 1
if(MED.amount <= 0)
qdel(MED)
for(var/mob/M in viewers(src, null))
if ((M.client && !( M.blinded )))
M.show_message("<span class='notice'>[user] applies the [MED] on [src].</span>")
else
user << "<span class='notice'>\The [src] is dead, medical items won't bring \him back to life.</span>"
else if(istype(O, /obj/item/weapon/reagent_containers))
if(istype(O, /obj/item/weapon/reagent_containers) || istype(O, /obj/item/stack/medical))
..()
else if(meat_type && (stat == DEAD)) //if the animal has a meat, and if it is dead.