More combat/gun/medical tweaks. (#8615)

This commit is contained in:
Matt Atlas
2020-04-19 14:28:33 +02:00
committed by GitHub
parent 7ef1c10f7a
commit d403ee314d
12 changed files with 132 additions and 90 deletions
@@ -27,7 +27,6 @@
..()
/mob/living/carbon/human/death(gibbed)
if(stat == DEAD)
return
@@ -64,7 +63,6 @@
callHook("death", list(src, gibbed))
if(!gibbed)
handle_organs()
if(species.death_sound)
playsound(loc, species.death_sound, 80, 1, 1)
@@ -75,7 +73,11 @@
if(wearing_rig)
wearing_rig.notify_ai("<span class='danger'>Warning: user death event. Mobility control passed to integrated intelligence system.</span>")
. = ..(gibbed,species.death_message, species.death_message_range)
. = ..(gibbed, species.death_message, species.death_message_range)
if(!gibbed) //We want to handle organs one last time to make sure that hearts don't report a positive pulse after death.
handle_organs()
handle_hud_list()
/mob/living/carbon/human/proc/ChangeToHusk()
@@ -1966,7 +1966,7 @@
if(!nervous_system_failure() && active_breaths)
visible_message("\The [src] jerks and gasps for breath!")
else
visible_message("\The [src] twitches a bit as \his heart restarts!")
visible_message("\The <b>[src]</b> twitches a bit as \his heart restarts!")
shock_stage = min(shock_stage, 100) // 120 is the point at which the heart stops.
if(getOxyLoss() >= 75)
setOxyLoss(75)
@@ -19,7 +19,6 @@
// Takes care of organ related updates, such as broken and missing limbs
/mob/living/carbon/human/proc/handle_organs()
number_wounds = 0
var/force_process = recheck_bad_external_organs()
+10 -3
View File
@@ -40,6 +40,7 @@
var/last_hit_zone = 0
var/force_down //determines if the affecting mob will be pinned to the ground
var/dancing //determines if assailant and affecting keep looking at each other. Basically a wrestling position
var/has_choked = FALSE //Used as a counter for choking people.
layer = SCREEN_LAYER
abstract = 1
@@ -136,9 +137,6 @@
hud.icon_state = "!reinforce"
if(state >= GRAB_AGGRESSIVE)
affecting.drop_l_hand()
affecting.drop_r_hand()
if(iscarbon(affecting))
handle_eye_mouth_covering(affecting, assailant, assailant.zone_sel.selecting)
@@ -149,6 +147,8 @@
affecting.Weaken(4)
if(state >= GRAB_NECK)
affecting.drop_l_hand()
affecting.drop_r_hand()
affecting.Stun(3)
if(isliving(affecting))
var/mob/living/L = affecting
@@ -159,9 +159,16 @@
affecting.Weaken(7) //Should keep you down unless you get help.
if(ishuman(affecting))
var/mob/living/carbon/human/A = affecting
var/obj/item/clothing/C = A.head
if(C && (C.item_flags & THICKMATERIAL))
return
if(!(A.species.flags & NO_BREATHE))
A.losebreath = max(A.losebreath + 3, 5)
A.adjustOxyLoss(3)
if(affecting.stat == CONSCIOUS)
if(do_mob(assailant, affecting, 150))
A.visible_message(SPAN_WARNING("[A] falls unconscious..."), FONT_LARGE(SPAN_DANGER("The world goes dark as you fall unconscious...")))
A.Paralyse(20)
adjust_position()
+4 -4
View File
@@ -43,11 +43,11 @@
/obj/item/organ/internal/proc/surgical_fix(mob/user)
if(damage > min_broken_damage)
var/scarring = damage/max_damage
scarring = 1 - 0.3 * scarring ** 2 // Between ~15 and 30 percent loss
var/scarring = damage / max_damage
scarring = 1 - 0.5 * scarring ** 2 // Between ~15 and 50 percent loss.
var/new_max_dam = Floor(scarring * max_damage)
if(new_max_dam < max_damage)
to_chat(user, "<span class='warning'>Not every part of [src] could be saved, some dead tissue had to be removed, making it more suspectable to damage in the future.</span>")
to_chat(user, SPAN_WARNING("Not every part of [src] could be saved; some dead tissue had to be removed, making it more susceptible to future damage."))
set_max_damage(new_max_dam)
heal_damage(damage)
@@ -123,4 +123,4 @@
if(!damage || BP_IS_ROBOTIC(src) || !owner || owner.chem_effects[CE_TOXIN] || owner.is_asystole())
return
if(damage < 0.1*max_damage)
heal_damage(0.1)
heal_damage(0.1)
+11 -8
View File
@@ -128,20 +128,20 @@
if(prob(1))
to_chat(owner, "<span class='warning'>You feel [pick("dizzy","woozy","faint")]...</span>")
damprob = owner.chem_effects[CE_STABLE] ? 30 : 60
if(!past_damage_threshold(2) && prob(damprob))
if(!past_damage_threshold(4) && prob(damprob))
take_internal_damage(1)
if(BLOOD_VOLUME_BAD to BLOOD_VOLUME_OKAY)
owner.eye_blurry = max(owner.eye_blurry,6)
damprob = owner.chem_effects[CE_STABLE] ? 40 : 80
if(!past_damage_threshold(4) && prob(damprob))
take_internal_damage(1)
if(!past_damage_threshold(6) && prob(damprob))
take_internal_damage(2)
if(!owner.paralysis && prob(10))
owner.Paralyse(rand(1,3))
to_chat(owner, "<span class='warning'>You feel extremely [pick("dizzy","woozy","faint")]...</span>")
if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD)
owner.eye_blurry = max(owner.eye_blurry,6)
damprob = owner.chem_effects[CE_STABLE] ? 60 : 100
if(!past_damage_threshold(6) && prob(damprob))
if(!past_damage_threshold(8) && prob(damprob))
take_internal_damage(1)
if(!owner.paralysis)
owner.Paralyse(3,5)
@@ -152,17 +152,20 @@
if(prob(damprob))
take_internal_damage(1)
if(prob(damprob))
take_internal_damage(1)
take_internal_damage(2)
..()
/obj/item/organ/internal/brain/take_internal_damage(var/damage, var/silent)
set waitfor = 0
if(damage >= (max_damage / 4))
damage *= 2
..()
if(damage >= (max_damage / 3)) //This probably won't be triggered by oxyloss or mercury. Probably.
if(damage >= (max_damage / 5)) //This probably won't be triggered by oxyloss or mercury. Probably.
var/damage_secondary = damage * 0.20
owner.eye_blurry += damage_secondary
owner.confused += damage_secondary * 2
owner.Weaken(round(damage, 1))
owner.Weaken(round(damage_secondary * 3, 1))
owner.adjustOxyLoss(damage)
if(prob(30))
addtimer(CALLBACK(src, .proc/brain_damage_callback, damage), rand(6, 20) SECONDS, TIMER_UNIQUE)
@@ -204,7 +207,7 @@
/obj/item/organ/internal/brain/surgical_fix(mob/user)
var/blood_volume = owner.get_blood_oxygenation()
if(blood_volume < BLOOD_VOLUME_SURVIVE)
if(blood_volume < BLOOD_VOLUME_BAD)
to_chat(user, "<span class='danger'>Parts of [src] didn't survive the procedure due to lack of air supply!</span>")
set_max_damage(Floor(max_damage - 0.25*damage))
heal_damage(damage)
+3 -6
View File
@@ -103,11 +103,8 @@
rupture()
var/safe_pressure_min = owner.species.breath_pressure // Minimum safe partial pressure of breathable gas in kPa
if(is_broken())
safe_pressure_min *= 1.5
else if(is_bruised())
safe_pressure_min *= 1.25
// Lung damage increases the minimum safe pressure.
safe_pressure_min *= 1 + rand(1,4) * damage/max_damage
var/safe_exhaled_max = 10
var/safe_toxins_max = 0.2
@@ -115,7 +112,7 @@
var/SA_sleep_min = 5
var/inhaled_gas_used = 0
var/breath_pressure = (breath.total_moles*R_IDEAL_GAS_EQUATION*breath.temperature)/(BREATH_VOLUME * owner.species.breath_vol_mul)
var/breath_pressure = (breath.total_moles * R_IDEAL_GAS_EQUATION * breath.temperature) / (BREATH_VOLUME * owner.species.breath_vol_mul)
var/inhaling
var/poison
+41 -56
View File
@@ -240,7 +240,8 @@
****************************************************/
/obj/item/organ/external/proc/is_damageable(var/additional_damage = 0)
return (vital || brute_dam + burn_dam + additional_damage < max_damage)
//Continued damage to vital organs can kill you, and robot organs don't count towards total damage so no need to cap them.
return (BP_IS_ROBOTIC(src) || brute_dam + burn_dam + additional_damage < max_damage * 4)
/obj/item/organ/external/take_damage(brute, burn, sharp, edge, used_weapon = null, list/forbidden_limbs = list(), damage_flags, var/silent)
if((brute <= 0) && (burn <= 0))
@@ -250,15 +251,51 @@
burn *= burn_mod
var/laser = (damage_flags & DAM_LASER)
add_pain(0.8*burn + 0.5*brute)
var/blunt = !!(brute && !sharp && !edge)
if(status & ORGAN_BROKEN && prob(40) && brute)
if(owner && (owner.can_feel_pain()))
owner.emote("scream") //getting hit on broken hand hurts
owner.emote(pick("scream", "groan")) //getting hit on broken hand hurts
if(used_weapon)
add_autopsy_data("[used_weapon]", brute + burn)
var/can_cut = (prob(brute*2) || sharp) && !(status & ORGAN_ROBOT)
var/spillover = 0
if(!is_damageable(brute + burn))
spillover = brute_dam + burn_dam + brute - max_damage
if(spillover > 0)
brute = max(brute - spillover, 0)
else
spillover = brute_dam + burn_dam + brute + burn - max_damage
if(spillover > 0)
burn = max(burn - spillover, 0)
handle_limb_gibbing(used_weapon, brute, burn)
if(brute_dam + brute > min_broken_damage && prob(brute_dam + brute * (1 + blunt)))
fracture()
if(brute)
var/to_create = BRUISE
if(can_cut)
to_create = CUT
//need to check sharp again here so that blunt damage that was strong enough to break skin doesn't give puncture wounds
if(sharp && !edge)
to_create = PIERCE
createwound(to_create, brute)
if(burn)
if(laser)
createwound(LASER, burn)
else
createwound(BURN, burn)
add_pain(0.8 * burn + 0.6 * brute)
//If there are still hurties to dispense
if (spillover)
owner.shock_stage += spillover * config.organ_damage_spillover_multiplier
// High brute damage or sharp objects may damage internal organs
if(length(internal_organs))
if(damage_internal_organs(brute, burn, sharp, damage_flags))
@@ -268,58 +305,6 @@
brute /= brute_div
burn /= 2
var/can_cut = (prob(brute*2) || sharp) && !(status & ORGAN_ROBOT)
// If the limbs can break, make sure we don't exceed the maximum damage a limb can take before breaking
// Non-vital organs are limited to max_damage. You can't kill someone by bludeonging their arm all the way to 200 -- you can
// push them faster into paincrit though, as the additional damage is converted into shock.
if(is_damageable(brute + burn) || !config.limbs_can_break)
if(brute)
if(can_cut)
if(sharp && !edge)
createwound(PIERCE, brute)
else
createwound(CUT, brute)
else
createwound(BRUISE, brute)
if(burn)
createwound(BURN, burn)
else
//If we can't inflict the full amount of damage, spread the damage in other ways
//How much damage can we actually cause?
var/can_inflict = max_damage * config.organ_health_multiplier - (brute_dam + burn_dam)
var/spillover = 0
if(can_inflict)
if(brute > 0)
//Inflict all brute damage we can
if(can_cut)
if(sharp && !edge)
createwound(PIERCE, min(brute,can_inflict))
else
createwound(CUT, min(brute,can_inflict))
else
createwound(BRUISE, min(brute,can_inflict))
var/temp = can_inflict
//How much more damage can we inflict
can_inflict = max(0, can_inflict - brute)
//How much brute damage is left to inflict
spillover += max(0, brute - temp)
if(burn > 0 && can_inflict)
//Inflict all burn damage we can
if(laser)
createwound(LASER, min(burn, can_inflict))
else
createwound(BURN, min(burn,can_inflict))
//How much burn damage is left to inflict
spillover += max(0, burn - can_inflict)
//If there are still hurties to dispense
if (spillover && owner)
owner.shock_stage += spillover * config.organ_damage_spillover_multiplier
handle_limb_gibbing(used_weapon,brute,burn)
// sync the organ's damage with its wounds
update_damages()
+1 -1
View File
@@ -245,7 +245,7 @@
if(BRUISE)
return /datum/wound/bruise
if(BURN)
if(BURN, LASER)
switch(damage)
if(50 to INFINITY)
return /datum/wound/burn/carbonised
+4 -4
View File
@@ -291,7 +291,7 @@
process_point_blank(projectile, user, target)
if(process_projectile(projectile, user, target, user.zone_sel.selecting, clickparams))
handle_post_fire(user, target, pointblank, reflex, i == burst)
handle_post_fire(user, target, pointblank, reflex, TRUE)
update_icon()
if(i < burst)
@@ -385,13 +385,13 @@
playsound(loc, 'sound/weapons/empty.ogg', 100, 1)
//called after successfully firing
/obj/item/gun/proc/handle_post_fire(mob/user, atom/target, var/pointblank=0, var/reflex=0, var/playemote = 1)
/obj/item/gun/proc/handle_post_fire(mob/user, atom/target, var/pointblank = FALSE, var/reflex = FALSE, var/playemote = TRUE)
if(silenced)
playsound(user, fire_sound, 10, 1)
else
playsound(user, fire_sound, 75, 1, 3, 0.5, 1)
if (playemote)
if(playemote)
if(reflex)
user.visible_message(
SPAN_DANGER("<b>\The [user] fires \the [src][pointblank ? " point blank at \the [target]" : ""] by reflex!</b>"),
@@ -414,7 +414,7 @@
if(ishuman(user) && user.invisibility == INVISIBILITY_LEVEL_TWO) //shooting will disable a rig cloaking device
var/mob/living/carbon/human/H = user
if(istype(H.back,/obj/item/rig))
if(istype(H.back, /obj/item/rig))
var/obj/item/rig/R = H.back
for(var/obj/item/rig_module/stealth_field/S in R.installed_modules)
S.deactivate()
+3 -3
View File
@@ -183,13 +183,13 @@
//hit messages
if(silenced)
to_chat(target_mob, "<span class='danger'>You've been hit in the [parse_zone(def_zone)] by \the [src]!</span>")
to_chat(target_mob, "<span class='danger'>You've been hit in the [parse_zone(def_zone)] by \a [src]!</span>")
else
target_mob.visible_message("<span class='danger'>\The [target_mob] is hit by \the [src] in the [parse_zone(def_zone)]!</span>", "<span class='danger'><font size='2'>You're hit by \the [src] in the [parse_zone(def_zone)]!</font></span>")//X has fired Y is now given by the guns so you cant tell who shot you if you could not see the shooter
target_mob.visible_message("<span class='danger'>\The [target_mob] is hit by \a [src] in the [parse_zone(def_zone)]!</span>", "<span class='danger'><font size=2>You are hit by \a [src] in the [parse_zone(def_zone)]!</font></span>")//X has fired Y is now given by the guns so you cant tell who shot you if you could not see the shooter
//admin logs
if(!no_attack_log)
if(istype(firer, /mob))
if(ismob(firer))
var/attacker_message = "shot with \a [src.type]"
var/victim_message = "shot with \a [src.type]"
@@ -0,0 +1,49 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################
# Your name.
author: MattAtlas
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- tweak: "Brain health will now decay faster in lower oxygenation levels."
- tweak: "Brute damage now inflicts slightly more pain."
- tweak: "Tweaked organ spillover damage code. This will probably have some effects on how damage is calculated, as the old one was not updated."
- tweak: "Brain scarring can now happen while below 60% blood oxygenation."
- tweak: "Scarring can now go up to reducing an organ's maximum health by 50%."
- tweak: "Blue grabs no longer make the grabbed person drop their held things."
- rscadd: "Choking people now starts a timer, at the end of which the afflicted person will go unconscious."
- bugfix: "Fixed hearts displaying a positive pulse after the person is dead."
- bugfix: "Fixed pointblank messages not displaying."