Skill calculation fixes, tweaks, antag and brain damage modifiers. (#12302)
* Skill calculation fixes, tweaks, antag and brain damage modifiers. * Experience through patience. * Priority Fix etcetera.
This commit is contained in:
@@ -51,6 +51,12 @@
|
||||
var/datum/brain_trauma/BT = X
|
||||
BT.owner = owner
|
||||
BT.on_gain()
|
||||
if(damage > BRAIN_DAMAGE_MILD)
|
||||
var/datum/skill_modifier/S
|
||||
ADD_SKILL_MODIFIER_BODY(/datum/skill_modifier/brain_damage, null, C, S)
|
||||
if(damage > BRAIN_DAMAGE_SEVERE)
|
||||
var/datum/skill_modifier/S
|
||||
ADD_SKILL_MODIFIER_BODY(/datum/skill_modifier/heavy_brain_damage, null, C, S)
|
||||
|
||||
//Update the body's icon so it doesnt appear debrained anymore
|
||||
C.update_hair()
|
||||
@@ -66,6 +72,8 @@
|
||||
if((!QDELETED(src) || C) && !no_id_transfer)
|
||||
transfer_identity(C)
|
||||
if(C)
|
||||
REMOVE_SKILL_MODIFIER_BODY(/datum/skill_modifier/brain_damage, null, C)
|
||||
REMOVE_SKILL_MODIFIER_BODY(/datum/skill_modifier/heavy_brain_damage, null, C)
|
||||
C.update_hair()
|
||||
|
||||
/obj/item/organ/brain/prepare_eat()
|
||||
@@ -219,31 +227,6 @@
|
||||
Insert(C)
|
||||
else
|
||||
..()
|
||||
/* TO BE REMOVED, KEPT IN CASE OF BUGS
|
||||
/obj/item/organ/brain/proc/get_brain_damage()
|
||||
var/brain_damage_threshold = max_integrity * BRAIN_DAMAGE_INTEGRITY_MULTIPLIER
|
||||
var/offset_integrity = obj_integrity - (max_integrity - brain_damage_threshold)
|
||||
. = round((1 - (offset_integrity / brain_damage_threshold)) * BRAIN_DAMAGE_DEATH, DAMAGE_PRECISION)
|
||||
|
||||
/obj/item/organ/brain/proc/adjust_brain_damage(amount, maximum)
|
||||
var/adjusted_amount
|
||||
if(amount >= 0 && maximum)
|
||||
var/brainloss = get_brain_damage()
|
||||
var/new_brainloss = clamp(brainloss + amount, 0, maximum)
|
||||
if(brainloss > new_brainloss) //brainloss is over the cap already
|
||||
return 0
|
||||
adjusted_amount = new_brainloss - brainloss
|
||||
else
|
||||
adjusted_amount = amount
|
||||
|
||||
adjusted_amount = round(adjusted_amount * BRAIN_DAMAGE_INTEGRITY_MULTIPLIER, DAMAGE_PRECISION)
|
||||
if(adjusted_amount)
|
||||
if(adjusted_amount >= DAMAGE_PRECISION)
|
||||
take_damage(adjusted_amount)
|
||||
else if(adjusted_amount <= -DAMAGE_PRECISION)
|
||||
obj_integrity = min(max_integrity, obj_integrity-adjusted_amount)
|
||||
. = adjusted_amount
|
||||
*/
|
||||
|
||||
/obj/item/organ/brain/applyOrganDamage(var/d, var/maximum = maxHealth)
|
||||
. = ..()
|
||||
@@ -261,18 +244,28 @@
|
||||
. = ..()
|
||||
//if we're not more injured than before, return without gambling for a trauma
|
||||
if(damage <= prev_damage)
|
||||
if(damage < prev_damage && owner)
|
||||
if(prev_damage > BRAIN_DAMAGE_MILD && damage <= BRAIN_DAMAGE_MILD)
|
||||
REMOVE_SKILL_MODIFIER_BODY(/datum/skill_modifier/brain_damage, null, owner)
|
||||
if(prev_damage > BRAIN_DAMAGE_SEVERE && damage <= BRAIN_DAMAGE_SEVERE)
|
||||
REMOVE_SKILL_MODIFIER_BODY(/datum/skill_modifier/heavy_brain_damage, null, owner)
|
||||
return
|
||||
damage_delta = damage - prev_damage
|
||||
if(damage > BRAIN_DAMAGE_MILD)
|
||||
if(prob(damage_delta * (1 + max(0, (damage - BRAIN_DAMAGE_MILD)/100)))) //Base chance is the hit damage; for every point of damage past the threshold the chance is increased by 1% //learn how to do your bloody math properly goddamnit
|
||||
gain_trauma_type(BRAIN_TRAUMA_MILD)
|
||||
if(prev_damage <= BRAIN_DAMAGE_MILD && owner)
|
||||
var/datum/skill_modifier/S
|
||||
ADD_SKILL_MODIFIER_BODY(/datum/skill_modifier/brain_damage, null, owner, S)
|
||||
if(damage > BRAIN_DAMAGE_SEVERE)
|
||||
if(prob(damage_delta * (1 + max(0, (damage - BRAIN_DAMAGE_SEVERE)/100)))) //Base chance is the hit damage; for every point of damage past the threshold the chance is increased by 1%
|
||||
if(prob(20))
|
||||
gain_trauma_type(BRAIN_TRAUMA_SPECIAL)
|
||||
else
|
||||
gain_trauma_type(BRAIN_TRAUMA_SEVERE)
|
||||
|
||||
if(prev_damage <= BRAIN_DAMAGE_SEVERE && owner)
|
||||
var/datum/skill_modifier/S
|
||||
ADD_SKILL_MODIFIER_BODY(/datum/skill_modifier/heavy_brain_damage, null, owner, S)
|
||||
if (owner)
|
||||
if(owner.stat < UNCONSCIOUS) //conscious or soft-crit
|
||||
var/brain_message
|
||||
|
||||
Reference in New Issue
Block a user