mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-13 16:13:49 +01:00
Fixes robotic organs causing pain messages
Also fixes pain() not checking if the species has NO_PAIN.
This commit is contained in:
@@ -175,15 +175,16 @@ var/list/organ_cache = list()
|
||||
W.time_inflicted = world.time
|
||||
|
||||
/obj/item/organ/proc/take_damage(amount, var/silent=0)
|
||||
if(src.robotic == 2)
|
||||
if(src.status & ORGAN_ROBOT)
|
||||
src.damage += (amount * 0.8)
|
||||
else
|
||||
src.damage += amount
|
||||
|
||||
if(owner && parent_organ)
|
||||
var/obj/item/organ/external/parent = owner.get_organ(parent_organ)
|
||||
if(parent && !silent)
|
||||
owner.custom_pain("Something inside your [parent.name] hurts a lot.", 1)
|
||||
//only show this if the organ is not robotic
|
||||
if(owner && parent_organ)
|
||||
var/obj/item/organ/external/parent = owner.get_organ(parent_organ)
|
||||
if(parent && !silent)
|
||||
owner.custom_pain("Something inside your [parent.name] hurts a lot.", 1)
|
||||
|
||||
/obj/item/organ/proc/robotize() //Being used to make robutt hearts, etc
|
||||
robotic = 2
|
||||
|
||||
@@ -8,7 +8,10 @@ mob/var/next_pain_time = 0
|
||||
// partname is the name of a body part
|
||||
// amount is a num from 1 to 100
|
||||
mob/living/carbon/proc/pain(var/partname, var/amount, var/force, var/burning = 0)
|
||||
if(stat >= 2) return
|
||||
if(stat >= 1)
|
||||
return
|
||||
if(species && species.flags & NO_PAIN)
|
||||
return
|
||||
if(analgesic > 40)
|
||||
return
|
||||
if(world.time < next_pain_time && !force)
|
||||
@@ -48,10 +51,10 @@ mob/living/carbon/proc/pain(var/partname, var/amount, var/force, var/burning = 0
|
||||
// message is the custom message to be displayed
|
||||
// flash_strength is 0 for weak pain flash, 1 for strong pain flash
|
||||
mob/living/carbon/human/proc/custom_pain(var/message, var/flash_strength)
|
||||
if(stat >= 1) return
|
||||
|
||||
if(species && species.flags & NO_PAIN) return
|
||||
|
||||
if(stat >= 1)
|
||||
return
|
||||
if(species && species.flags & NO_PAIN)
|
||||
return
|
||||
if(reagents.has_reagent("tramadol"))
|
||||
return
|
||||
if(reagents.has_reagent("oxycodone"))
|
||||
@@ -79,7 +82,7 @@ mob/living/carbon/human/proc/handle_pain()
|
||||
var/maxdam = 0
|
||||
var/obj/item/organ/external/damaged_organ = null
|
||||
for(var/obj/item/organ/external/E in organs)
|
||||
if(E.status & ORGAN_DEAD) continue
|
||||
if(E.status & (ORGAN_DEAD|ORGAN_ROBOT)) continue
|
||||
var/dam = E.get_damage()
|
||||
// make the choice of the organ depend on damage,
|
||||
// but also sometimes use one of the less damaged ones
|
||||
@@ -91,6 +94,7 @@ mob/living/carbon/human/proc/handle_pain()
|
||||
|
||||
// Damage to internal organs hurts a lot.
|
||||
for(var/obj/item/organ/I in internal_organs)
|
||||
if(I.status & (ORGAN_DEAD|ORGAN_ROBOT)) continue
|
||||
if(I.damage > 2) if(prob(2))
|
||||
var/obj/item/organ/external/parent = get_organ(I.parent_organ)
|
||||
src.custom_pain("You feel a sharp pain in your [parent.name]", 1)
|
||||
|
||||
Reference in New Issue
Block a user