Skip to content
Open

Soak #944

Show file tree
Hide file tree
Changes from 128 commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
191c442
Update carbon.dm
Magisterium2022 Apr 3, 2026
ccdb971
Update carbon_defines.dm
Magisterium2022 Apr 3, 2026
c3aaf6c
Update human.dm
Magisterium2022 Apr 3, 2026
08d747a
Update _species.dm
Magisterium2022 Apr 3, 2026
a008f1b
Update damage_procs.dm
Magisterium2022 Apr 3, 2026
9569ee7
Update damage_procs.dm
Magisterium2022 Apr 3, 2026
8942be8
Update carbon.dm
Magisterium2022 Apr 3, 2026
cbde8d3
Update human.dm
Magisterium2022 Apr 3, 2026
f44fb5e
Merge branch 'DarkPack13:master' into soak
Magisterium2022 Apr 19, 2026
13740b6
Update human.dm
Magisterium2022 Apr 19, 2026
be98f64
Update human.dm
Magisterium2022 Apr 19, 2026
e71927f
Update transformation.dm
Magisterium2022 Apr 19, 2026
745cd74
Update damage_procs.dm
Magisterium2022 Apr 19, 2026
3420262
Update roll_subtypes.dm
Magisterium2022 Apr 19, 2026
400f776
Update transformation.dm
Magisterium2022 Apr 19, 2026
f3b321e
Update new_player.dm
Magisterium2022 Apr 19, 2026
807f242
Update carbon.dm
Magisterium2022 Apr 19, 2026
9d513c2
Update human.dm
Magisterium2022 Apr 19, 2026
3bafb59
Update damage_procs.dm
Magisterium2022 Apr 19, 2026
9aa1697
Update carbon.dm
Magisterium2022 Apr 19, 2026
f87ef36
Merge branch 'DarkPack13:master' into soak
Magisterium2022 Apr 20, 2026
08a42f9
Update human.dm
Magisterium2022 Apr 20, 2026
a94e736
Update embracing.dm
Magisterium2022 Apr 20, 2026
8bcdc3f
Update silver_damage.dm
Magisterium2022 Apr 20, 2026
6c654f7
Update damage_procs.dm
Magisterium2022 Apr 20, 2026
09e7c8f
Update human.dm
Magisterium2022 Apr 20, 2026
449c0c0
Merge branch 'DarkPack13:master' into soak
Magisterium2022 Apr 20, 2026
85f17aa
Update kindred_splat.dm
Magisterium2022 Apr 20, 2026
3d9f432
Update ghoul_splat.dm
Magisterium2022 Apr 20, 2026
bf0f467
Update gaining_splats.dm
Magisterium2022 Apr 20, 2026
48966aa
Update gaining_splats.dm
Magisterium2022 Apr 20, 2026
7b71ea6
Update fera_splat.dm
Magisterium2022 Apr 20, 2026
63128dd
Update kindred_splat.dm
Magisterium2022 Apr 20, 2026
5dc17b0
Update ghoul_splat.dm
Magisterium2022 Apr 20, 2026
b001891
Update fera_splat.dm
Magisterium2022 Apr 20, 2026
9db2909
Update ticker.dm
Magisterium2022 Apr 20, 2026
a5d7177
Update code/modules/mob/living/carbon/human/_species.dm
Magisterium2022 Apr 21, 2026
ea38841
Update modular_darkpack/master_files/code/modules/mob/living/carbon/h…
Magisterium2022 Apr 21, 2026
6de9afd
Update modular_darkpack/master_files/code/modules/mob/living/carbon/h…
Magisterium2022 Apr 21, 2026
73e7e25
Update code/modules/mob/living/carbon/damage_procs.dm
Magisterium2022 Apr 21, 2026
d20b255
Update modular_darkpack/master_files/code/modules/mob/living/carbon/h…
Magisterium2022 Apr 21, 2026
f170dc9
Update code/modules/mob/living/carbon/damage_procs.dm
Magisterium2022 Apr 21, 2026
822bca2
Merge branch 'master' into soak
Magisterium2022 Apr 22, 2026
7783c1a
Merge branch 'master' into soak
Magisterium2022 Apr 28, 2026
6414ab1
Update carbon_defines.dm
Magisterium2022 Apr 28, 2026
1c65555
Merge branch 'DarkPack13:master' into soak
Magisterium2022 Apr 29, 2026
b6560ee
Update quietus.dm
Magisterium2022 Apr 29, 2026
f80f3bb
Update thanatosis.dm
Magisterium2022 Apr 29, 2026
bfb142c
Update possession_datums.dm
Magisterium2022 Apr 29, 2026
82fc4d4
Update levinbolt.dm
Magisterium2022 Apr 29, 2026
0dd6b8e
Update levinbolt.dm
Magisterium2022 Apr 29, 2026
8dd2c71
Update lure_of_flames.dm
Magisterium2022 Apr 29, 2026
a3de37f
Update scorptions_touch.dm
Magisterium2022 Apr 29, 2026
db780e8
Update damage_procs.dm
Magisterium2022 Apr 29, 2026
847d791
Update levinbolt.dm
Magisterium2022 Apr 29, 2026
15ea5cc
Update lure_of_flames.dm
Magisterium2022 Apr 29, 2026
162498e
Update levinbolt.dm
Magisterium2022 Apr 29, 2026
abfb959
Update levinbolt.dm
Magisterium2022 Apr 29, 2026
f16d55a
Update lure_of_flames.dm
Magisterium2022 Apr 29, 2026
d7db7c8
Update damage_procs.dm
Magisterium2022 Apr 29, 2026
64bb20d
Update _species.dm
Magisterium2022 Apr 29, 2026
8bce751
Update recalculate_max_health.dm
Magisterium2022 Apr 29, 2026
e4898d5
Update __socialrole.dm
Magisterium2022 Apr 29, 2026
ec8d815
Update fortitude.dm
Magisterium2022 Apr 29, 2026
a283ba4
Delete modular_darkpack/modules/powers/code/discipline/fortitude/fort…
Magisterium2022 Apr 29, 2026
2c46506
Update tgstation.dme
Magisterium2022 Apr 29, 2026
db9a2a7
Update fortitude.dm
Magisterium2022 Apr 29, 2026
07dc636
Update modular_darkpack/master_files/code/modules/mob/living/carbon/h…
Magisterium2022 Apr 30, 2026
4bf9dea
Update modular_darkpack/master_files/code/modules/mob/living/carbon/h…
Magisterium2022 Apr 30, 2026
df63699
Merge branch 'master' into soak
Magisterium2022 May 1, 2026
22c84bf
Merge branch 'master' into soak
Magisterium2022 May 1, 2026
583c931
Update mob_procs.dm
Magisterium2022 May 1, 2026
afeccc1
Update mob_procs.dm
Magisterium2022 May 1, 2026
a0e87b8
Update mob_procs.dm
Magisterium2022 May 1, 2026
60098a4
Update ticker.dm
Magisterium2022 May 1, 2026
3223c04
Update ticker.dm
Magisterium2022 May 1, 2026
fe251f4
Merge branch 'master' into soak
Magisterium2022 May 2, 2026
6c9a848
Merge branch 'master' into soak
Magisterium2022 May 3, 2026
46f56f1
Update combat.dm
Magisterium2022 May 3, 2026
c07d96d
Update baton.dm
Magisterium2022 May 3, 2026
2d09b06
Update combat_eyestab.dm
Magisterium2022 May 3, 2026
4d85362
Update combat_pistol_whip.dm
Magisterium2022 May 3, 2026
2209af9
Update combat.dm
Magisterium2022 May 3, 2026
085e68f
Update thanatosis.dm
Magisterium2022 May 4, 2026
8ea2b4f
Merge branch 'master' into soak
Magisterium2022 May 4, 2026
cf87e0e
Update new_player.dm
Magisterium2022 May 4, 2026
38fc884
Update _species.dm
Magisterium2022 May 4, 2026
d58dd47
Update quietus.dm
Magisterium2022 May 4, 2026
88c2afd
Update modular_darkpack/modules/npc/code/human/socialroles/__socialro…
Magisterium2022 May 4, 2026
8196ede
Merge branch 'master' into soak
Magisterium2022 May 4, 2026
a1881e4
Delete modular_darkpack/modules/storyteller_stats/code/mob_affecting_…
Magisterium2022 May 4, 2026
3d85cf2
Update mob_procs.dm
Magisterium2022 May 4, 2026
51c0788
Update tgstation.dme
Magisterium2022 May 4, 2026
4db43d2
Merge branch 'master' into soak
Magisterium2022 May 5, 2026
da82d0f
Update damage_procs.dm
Magisterium2022 May 5, 2026
4909655
Update thanatosis.dm
Magisterium2022 May 5, 2026
fbf61b4
Update levinbolt.dm
Magisterium2022 May 5, 2026
e209264
Update lure_of_flames.dm
Magisterium2022 May 5, 2026
988b17f
Update damage_procs.dm
Magisterium2022 May 5, 2026
7f79e28
Update damage_procs.dm
Magisterium2022 May 5, 2026
9109fd8
Update levinbolt.dm
Magisterium2022 May 5, 2026
6a8e249
Update lure_of_flames.dm
Magisterium2022 May 5, 2026
b7592b3
Update liver.dm
Magisterium2022 May 5, 2026
523c260
Update mob_damage.dm
Magisterium2022 May 5, 2026
0e832b2
Update combat_blocking.dm
Magisterium2022 May 5, 2026
a4ef254
Update tail_wag.dm
Magisterium2022 May 5, 2026
62d3049
Merge branch 'DarkPack13:master' into soak
Magisterium2022 May 5, 2026
e2c3354
Update explosion_action.dm
Magisterium2022 May 5, 2026
33cb96f
Update hulk.dm
Magisterium2022 May 5, 2026
480f9c4
Update human_through_recycler.dm
Magisterium2022 May 5, 2026
6512c1c
Update medical_wounds.dm
Magisterium2022 May 5, 2026
b7f0f3c
Update damage_procs.dm
Magisterium2022 May 5, 2026
e95eb97
Update roll_subtypes.dm
Magisterium2022 May 5, 2026
e51b6e4
Update robot_defense.dm
Magisterium2022 May 5, 2026
446050e
Update goliath.dm
Magisterium2022 May 5, 2026
dca5f2d
Update human.dm
Magisterium2022 May 6, 2026
d69b3a4
Update visceratika.dm
Magisterium2022 May 6, 2026
9dd6a23
Update human.dm
Magisterium2022 May 6, 2026
61b033e
Update damage_procs.dm
Magisterium2022 May 6, 2026
4714ac3
Update silver_damage.dm
Magisterium2022 May 6, 2026
c21f7c5
Update damage_procs.dm
Magisterium2022 May 6, 2026
44f6ef5
Update damage_procs.dm
Magisterium2022 May 6, 2026
d448eb8
Merge branch 'master' into soak
Magisterium2022 May 7, 2026
a6f93f3
Update silver_damage.dm
Magisterium2022 May 7, 2026
49e9b35
Update human.dm
Magisterium2022 May 8, 2026
acd2947
Merge branch 'master' into soak
Magisterium2022 May 8, 2026
28f3b76
Update possession_datums.dm
Magisterium2022 May 8, 2026
cc2adbe
Update scorptions_touch.dm
Magisterium2022 May 8, 2026
981a27a
FIXES
FalloutFalcon May 8, 2026
b45ca54
yea
FalloutFalcon May 8, 2026
5d9a48c
yea
FalloutFalcon May 8, 2026
816450a
Merge branch 'DarkPack13:master' into soak
Magisterium2022 May 8, 2026
aac0503
Merge pull request #11 from FalloutFalcon/soak-pr-fixes
Magisterium2022 May 8, 2026
463e499
Update human.dm
Magisterium2022 May 8, 2026
05ea5cf
Update silver_damage.dm
Magisterium2022 May 8, 2026
9cc8bf8
Update damage_procs.dm
Magisterium2022 May 8, 2026
24c7e6e
Update damage_procs.dm
Magisterium2022 May 8, 2026
54d2886
Update damage_procs.dm
Magisterium2022 May 8, 2026
0ea2abc
Update human.dm
Magisterium2022 May 8, 2026
e7b1522
Update carbon_defines.dm
Magisterium2022 May 8, 2026
5286a82
Update living_defines.dm
Magisterium2022 May 8, 2026
844f046
Merge branch 'DarkPack13:master' into soak
Magisterium2022 May 9, 2026
0d41924
Update ticker.dm
Magisterium2022 May 9, 2026
151d110
Update new_player.dm
Magisterium2022 May 9, 2026
cddc28d
Merge branch 'master' into soak
Magisterium2022 May 9, 2026
56c5638
Merge branch 'DarkPack13:master' into soak
Magisterium2022 May 10, 2026
295c9aa
Update human.dm
Magisterium2022 May 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@ SUBSYSTEM_DEF(ticker)

iter_human.increment_scar_slot()
iter_human.load_persistent_scars()

iter_human.load_guestbook() // DARKPACK EDIT ADD
iter_human.update_soak() // DARKPACK EDIT ADDITION
Comment thread
Magisterium2022 marked this conversation as resolved.

if(!iter_human.hardcore_survival_score)
continue
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/dead/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@

humanc.increment_scar_slot()
humanc.load_persistent_scars()

humanc.load_guestbook() // DARKPACK EDIT ADD
humanc.update_soak() // DARKPACK EDIT ADD

if(GLOB.curse_of_madness_triggered)
give_madness(humanc, GLOB.curse_of_madness_triggered)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
. += span_info("Someone appears to have attached a saddle to this one.")

// Goliaths can summon tentacles more frequently as they take damage, scary.
/mob/living/basic/mining/goliath/apply_damage(damage, damagetype, def_zone, blocked, forced, spread_damage, wound_bonus, exposed_wound_bonus, sharpness, attack_direction, attacking_item, wound_clothing)
/mob/living/basic/mining/goliath/apply_damage(damage, damagetype, def_zone, blocked, forced, spread_damage, wound_bonus, exposed_wound_bonus, sharpness, attack_direction, attacking_item, wound_clothing, soak_difficulty = 6, unsoakable = FALSE)
. = ..()
if (. <= 0)
return
Expand Down
6 changes: 6 additions & 0 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
living_flags &= ~STOP_OVERLAY_UPDATE_BODY_PARTS

register_context()
update_soak() // DARKPACK EDIT ADDITION

GLOB.carbon_list += src
ADD_TRAIT(src, TRAIT_CAN_HOLD_ITEMS, INNATE_TRAIT) // Carbons are assumed to be innately capable of having arms, we check their arms count instead
Expand Down Expand Up @@ -1413,3 +1414,8 @@
if (overeatduration >= 200 SECONDS)
to_chat(src, span_danger("You suddenly feel blubbery!"))
add_traits(list(TRAIT_FAT, TRAIT_OFF_BALANCE_TACKLER), OBESITY)

// DARKPACK EDIT START
/mob/living/carbon/proc/update_soak() //Pretty basic calculation for the average person/being, soak is Bashing only using Stamina.
soak_dice_bashing = st_get_stat(STAT_STAMINA)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see if you cant just hook this into the setting of stamina instead. As this mostly doesnt account for any temp buffs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since stamina is adjusted by the same stat adjustment var as anything else, I'd need to attach it to every temp buff.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find the st_get_stat method and if(arg == STAT_STAMINA)...? also, doesnt st_get_stat have an 'include bonus dice' arg, and temp buffs give bonus dice, so you can just make this include_bonus = true, which, include_bonus = TRUE might be the default arg, so...

do some testing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bonus dice are already included by default, that came up in initial testing, and is also demonstrated in the video below, where you can see the soak bonus accommodates the Crinos form extra Stamina. This also works for ghouls and kindred with Fortitude. st_get_stat updates it on demand, but if I wanted it to automatically adjust to change with stamina bonuses, I'd likely need to attach it into st_set_stat and st_set_stat_mod.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do this.

Image

and mabye this.

Image

Copy link
Copy Markdown
Contributor Author

@Magisterium2022 Magisterium2022 May 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added for updating on modifier being granted. There's not really any current situations where you'd see a permanent point change in-round, given that editing your character sheet isn't possible, but it's potentially useful for futureproofing, I suppose.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, it looks like all of those cases will already be covered by the proc's addition to modifier updates as-is, so that'd be unnecessary. Otherwise, all changes implemented.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its not really about fixing all CURRENT cases. Your code needs to be robust enough that other additions that tweak stamina doesnt require the dev know specificly that they need to call this snowflake proc to ensure stamina is updated.
Like i said, you should be hooking this directly into the change of stamina itself, (like with an on_point_change proc i suggested) to ensure it works robustly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's tied into update_modifiers_from_stats, which is called by all adjustments currently, and should theoretically be called by all future ones.

// DARKPACK EDIT END
57 changes: 57 additions & 0 deletions code/modules/mob/living/carbon/damage_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
attack_direction = null,
attacking_item,
wound_clothing = TRUE,
soak_difficulty = 6,
unsoakable = FALSE,
)

if(!forced && unsoakable == FALSE) //If the damage isn't forced and isn't unsoakable, run it through the soak proc.
damage = soak_roll(damage, damagetype, def_zone, sharpness, attacking_item, soak_difficulty)

// Spread damage should always have def zone be null
if(spread_damage)
def_zone = null
Expand All @@ -35,6 +41,7 @@
var/species_mod = (100 - dna.species.damage_modifier) / 100
return ..() * species_mod


/mob/living/carbon/human/apply_damage(
damage = 0,
damagetype = BRUTE,
Expand All @@ -48,6 +55,8 @@
attack_direction = null,
attacking_item,
wound_clothing = TRUE,
soak_difficulty = 6,
unsoakable = FALSE,
)

// Add relevant DR modifiers into blocked value to pass to parent
Expand Down Expand Up @@ -390,3 +399,51 @@
updatehealth()
if(update)
update_damage_overlays()
// DARKPACK EDIT ADD START - (soak)
/mob/living/carbon/proc/soak_roll(
damage = 0,
damagetype = BRUTE,
def_zone = null,
sharpness = NONE,
attacking_item,
soak_difficulty = 6)

var/roll_used = soak_dice_bashing
switch(damagetype)
if(BRUTE)
if(isprojectile(attacking_item))
if(get_kindred_splat(src) && !def_zone == HEAD)
roll_used = soak_dice_bashing //Kindred take bullets as bashing unless they're to the head.
Comment thread
FalloutFalcon marked this conversation as resolved.
Outdated
else
roll_used = soak_dice_lethal //Otherwise it's lethal damage.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this duplataces the effects of

/datum/splat/vampire/kindred/proc/damage_resistance(datum/source, list/damage_mods, damage_amount, damagetype, def_zone, sharpness, attack_direction, obj/item/attacking_item)
	SIGNAL_HANDLER

	// Kindred take half "bashing" damage, which is normally blunt damage but includes pointy things like bullets because they're undead
	if ((damagetype == BRUTE) && (sharpness != SHARP_EDGED))
		damage_mods += 0.5

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, kindred take half bashing damage still, post-soak.

else if(!sharpness == NONE)
roll_used = soak_dice_lethal //Sharp or piercing objects deal lethal to every splat.
else
roll_used = soak_dice_bashing //Everything else should take Bashing.
if(BURN)
roll_used = soak_dice_aggravated //Burning is always Agg.
if(TOX)
roll_used = soak_dice_lethal //Poisons can vary from Bashing to Lethal, but the vast majority are Lethal.
if(OXY)
roll_used = 0 //Oxygen damage is applied automatically and cannot be soaked.
if(STAMINA)
roll_used = soak_dice_bashing //Stamina damage is a little weird, but as per exhaustion rules for rituals and the like, you can soak it like Bashing. Not too sure about it though.
if(BRAIN)
roll_used = soak_dice_lethal //Not many situations where you'd take direct brain damage really, but it'd be lethal in this case.
if(AGGRAVATED)
roll_used = soak_dice_aggravated //Well, obviously.

if(roll_used < 1)
return damage //Skip the roll if it can't be soaked. Covers negative numbers too, in case of edge cases.

var/datum/storyteller_roll/soak/soak_roll = new()

soak_roll.difficulty = soak_difficulty //Overrides difficulty for adjustments when soak difficulty is different.
var/successes = soak_roll.st_roll(src, src, roll_used)

if(successes > 0)
damage = (max(0, damage - (successes * 10)))
Copy link
Copy Markdown
Contributor

@TheCarnalest TheCarnalest Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will (with a high enough soak rating to consistently get 1 or more successes) completely nullify repeated small amounts of damage.

One thing to consider: in the TTRPG, someone shooting you multiple times in a single round with a machine gun or something (see: Automatic Fire and Three-Round Burst, V20 Core p. 278) is going to count as a single attack that can only be soaked once. Any shotgun that shoots out multiple pellets will similarly just be one attack. With this, every single bullet/pellet is going to have its own soak roll that will probably eliminate all of the damage it's going to deal.

While this may seem like a step towards TTRPG accuracy, it introduces a bunch of issues related to the fact that we can't retroactively group damage sources and soak them together like you can in a TTRPG.

Another major issue is fire. While you'd need a high level of Fortitude to reliably soak it, fire doesn't deal that much damage per tick and I imagine much of it could be nullified by soaking every fire tick. Toxins suffer from the same fate.

A year or so ago I was thinking about how soaking could be implemented and I ended up deciding that it's best to simply leave it as armor or health bonuses. V5 also went this route with how Stamina nowadays just increases your health pool

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As currently, it's below a health level as defined in the bloodheal code. You can set the actual amount to be soaked to whatever you deem appropriate, if ticking small damage is a concern.

to_chat(src, span_warning("You stand firm and are able to absorb some of the damage!"))
Comment thread
Magisterium2022 marked this conversation as resolved.
Outdated

return damage
// DARKPACK EDIT ADD END
6 changes: 5 additions & 1 deletion code/modules/mob/living/carbon/human/_species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,11 @@ GLOBAL_LIST_EMPTY(features_by_species)

human_who_gained_species.living_flags &= ~STOP_OVERLAY_UPDATE_BODY_PARTS

//we don't allow it to update during species transition, so update it now
Comment thread
Magisterium2022 marked this conversation as resolved.
//we don't allow it to update during species transition, so update it now
// DARKPACK EDIT ADD START - (soak)
human_who_gained_species.update_soak() //Updates Soak values.
// DARKPACK EDIT ADD END
Comment thread
Magisterium2022 marked this conversation as resolved.
Outdated

human_who_gained_species.hud_used?.screen_objects[HUD_MOB_HEALTHDOLL]?.update_appearance()

/**
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/damage_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* * attack_direction - Direction of the attack from the attacker to [src].
* * attacking_item - Item that is attacking [src].
* * wound_clothing - If this should cause damage to clothing.
* * soak_difficulty - The difficulty of soaking an attack. Base is 6, adjusted by some unique effects, rare disciplines, and more. Only reference this if you've used the proper path and checked iscarbon() for apply_damage() or it'll throw up errors.
* * unsoakable - Whether an attack is soakable or not. By default off, some damage types and specific effects are unsoakable.
*
* Returns the amount of damage dealt.
*/
Expand All @@ -33,6 +35,8 @@
attack_direction = null,
attacking_item,
wound_clothing = TRUE,
soak_difficulty = 6,
unsoakable = FALSE,
)
SHOULD_CALL_PARENT(TRUE)
var/damage_amount = damage
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/silicon/robot/robot_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ GLOBAL_LIST_INIT(blacklisted_borg_hats, typecacheof(list( //Hats that don't real
. = TRUE
return ..() || .

/mob/living/silicon/robot/apply_damage(damage, damagetype, def_zone, blocked, forced, spread_damage, wound_bonus, exposed_wound_bonus, sharpness, attack_direction, attacking_item, wound_clothing)
/mob/living/silicon/robot/apply_damage(damage, damagetype, def_zone, blocked, forced, spread_damage, wound_bonus, exposed_wound_bonus, sharpness, attack_direction, attacking_item, wound_clothing, soak_difficulty = 6, unsoakable = FALSE)
var/mob/living/silicon/robot/borg = src
var/obj/item/shield_module/shield = locate() in borg
if(!shield)
Expand Down
1 change: 1 addition & 0 deletions code/modules/unit_tests/baton.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/datum/unit_test/baton/Run()
var/mob/living/carbon/human/consistent/secoff = EASY_ALLOCATE()
var/mob/living/carbon/human/consistent/tider = EASY_ALLOCATE()
tider.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Avoids reading as broken because damage was soaked.
Comment thread
Magisterium2022 marked this conversation as resolved.
ADD_TRAIT(secoff, TRAIT_PERFECT_ATTACKER, TRAIT_SOURCE_UNIT_TESTS)

var/obj/item/melee/baton/stun_baton = allocate(baton_type)
Expand Down
9 changes: 9 additions & 0 deletions code/modules/unit_tests/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var/mob/living/carbon/human/victim = allocate(/mob/living/carbon/human/consistent)

puncher.st_set_stat(STAT_STRENGTH, 1) // DARKPACK EDIT ADD
victim.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Avoids reading as broken because damage was soaked.
// Avoid all randomness in tests
ADD_TRAIT(puncher, TRAIT_PERFECT_ATTACKER, INNATE_TRAIT)

Expand All @@ -16,6 +17,9 @@
var/mob/living/carbon/human/victim = allocate(/mob/living/carbon/human/consistent)
var/obj/item/storage/toolbox/toolbox = allocate(/obj/item/storage/toolbox)


victim.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Avoids reading as broken because damage was soaked.

tider.put_in_active_hand(toolbox, forced = TRUE)
tider.set_combat_mode(TRUE)
victim.attackby(toolbox, tider)
Expand All @@ -27,6 +31,8 @@
var/mob/living/carbon/human/victim = allocate(/mob/living/carbon/human/consistent)
var/obj/item/weldingtool/welding_tool = allocate(/obj/item/weldingtool)

victim.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Prevents potential issue with soak absorbing hit and causing this to fail to runtime properly.

attacker.put_in_active_hand(welding_tool, forced = TRUE)
attacker.set_combat_mode(TRUE)

Expand Down Expand Up @@ -106,6 +112,7 @@

/datum/unit_test/self_punch/Run()
var/mob/living/carbon/human/dummy = allocate(/mob/living/carbon/human/consistent)
dummy.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Avoids reading as broken because damage was soaked.
ADD_TRAIT(dummy, TRAIT_PERFECT_ATTACKER, TRAIT_SOURCE_UNIT_TESTS)
dummy.set_combat_mode(TRUE)
dummy.ClickOn(dummy)
Expand All @@ -119,6 +126,7 @@
var/mob/living/carbon/human/victim = allocate(/mob/living/carbon/human/consistent)
ADD_TRAIT(attacker, TRAIT_PERFECT_ATTACKER, TRAIT_SOURCE_UNIT_TESTS)
ADD_TRAIT(attacker, TRAIT_HANDS_BLOCKED, TRAIT_SOURCE_UNIT_TESTS)
victim.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Prevents potential issue with soak absorbing hit and causing this to fail to runtime properly.
attacker.set_combat_mode(TRUE)
attacker.ClickOn(victim)
TEST_ASSERT_EQUAL(victim.get_brute_loss(), 0, "Victim took brute damage from being punched by a handcuffed attacker")
Expand All @@ -133,6 +141,7 @@
/datum/unit_test/handcuff_bite/Run()
var/mob/living/carbon/human/attacker = allocate(/mob/living/carbon/human/consistent)
var/mob/living/carbon/human/victim = allocate(/mob/living/carbon/human/consistent)
victim.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Avoids reading as broken because damage was soaked.
ADD_TRAIT(attacker, TRAIT_PERFECT_ATTACKER, TRAIT_SOURCE_UNIT_TESTS)
ADD_TRAIT(attacker, TRAIT_HANDS_BLOCKED, TRAIT_SOURCE_UNIT_TESTS)
attacker.set_combat_mode(TRUE)
Expand Down
2 changes: 2 additions & 0 deletions code/modules/unit_tests/combat_blocking.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
victim.put_in_active_hand(chair, forced = TRUE)
attacker.set_combat_mode(TRUE)
ADD_TRAIT(attacker, TRAIT_PERFECT_ATTACKER, TRAIT_SOURCE_UNIT_TESTS)
victim.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Prevents potential issue with soak absorbing hit and causing this to fail to runtime properly.

click_wrapper(attacker, victim)
TEST_ASSERT_EQUAL(victim.get_brute_loss(), 0, "Victim took damage from being punched despite having a 100% block chance chair in their hands.")
Expand All @@ -24,6 +25,7 @@
victim.put_in_active_hand(shield, forced = TRUE)
attacker.set_combat_mode(TRUE)
ADD_TRAIT(attacker, TRAIT_PERFECT_ATTACKER, TRAIT_SOURCE_UNIT_TESTS)
victim.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Prevents potential issue with soak absorbing hit and causing this to fail to runtime properly.

click_wrapper(attacker, victim)
TEST_ASSERT_EQUAL(victim.get_brute_loss(), 0, "Victim took damage from being punched despite having a 100% block chance shield in their hands.")
Expand Down
2 changes: 2 additions & 0 deletions code/modules/unit_tests/combat_eyestab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
var/mob/living/carbon/human/consistent/victim = EASY_ALLOCATE()
var/obj/item/screwdriver/stabber = EASY_ALLOCATE()

victim.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Avoids reading as broken because damage was soaked.

attacker.zone_selected = BODY_ZONE_PRECISE_EYES
attacker.put_in_active_hand(stabber, forced = TRUE)

Expand Down
1 change: 1 addition & 0 deletions code/modules/unit_tests/combat_pistol_whip.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

attacker.put_in_active_hand(gun, forced = TRUE)
victim.forceMove(locate(attacker.x + 1, attacker.y, attacker.z))
victim.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Avoids reading as broken because damage was soaked.

var/expected_ammo = gun.magazine.max_ammo + 1
// These assertions are just here because I don't understand gun code
Expand Down
4 changes: 4 additions & 0 deletions code/modules/unit_tests/explosion_action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
var/mob/living/simple_animal/test_simple_animal = allocate(/mob/living/simple_animal)
test_simple_animal.maxHealth = MAX_LIVING_HEALTH
test_simple_animal.health = MAX_LIVING_HEALTH
test_simple_animal.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Avoids reading as broken because damage was soaked.

EX_ACT(test_simple_animal, EXPLODE_NONE) // should do nothing.
TEST_ASSERT_EQUAL(test_simple_animal.health, MAX_LIVING_HEALTH, "EX_ACT() with EXPLODE_NONE severity should not affect the health of a simple animal! Something has gone terribly wrong!")
Expand Down Expand Up @@ -62,6 +63,8 @@
var/mob/living/carbon/alien/test_alien = allocate(/mob/living/carbon/alien)
test_alien.maxHealth = MAX_LIVING_HEALTH
test_alien.health = MAX_LIVING_HEALTH
test_alien.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Avoids reading as broken because damage was soaked.


EX_ACT(test_alien, EXPLODE_NONE) // should do nothing.
read_alien_damages(test_alien)
Expand All @@ -84,6 +87,7 @@

// Let's check to make sure the armor system works as expected. Corgi dogs are the only one that have this implemented on the basic level, so let's use that.
var/mob/living/basic/pet/dog/corgi/test_dog = set_up_test_dog()
test_dog.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Avoids reading as broken because damage was soaked.

// those two items should give us a 100% armor rating, so let's test that to make sure it works (all ex_act checks should now be prob(100)), no room for error.
EX_ACT(test_dog, EXPLODE_LIGHT) // should do 20 damage (basic animals do a prob() check based on the armor rating, and divide the expected brute loss by 1.5).
Expand Down
1 change: 1 addition & 0 deletions code/modules/unit_tests/hulk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
var/mob/living/carbon/human/hulk = allocate(/mob/living/carbon/human/consistent)
var/mob/living/carbon/human/dummy = allocate(/mob/living/carbon/human/consistent)

dummy.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Avoids reading as broken because damage was soaked.

RegisterSignal(dummy, COMSIG_ATOM_HULK_ATTACK, PROC_REF(hulk_sig_fire))
RegisterSignal(dummy, COMSIG_ATOM_ATTACK_HAND, PROC_REF(hand_sig_fire))
Expand Down
2 changes: 2 additions & 0 deletions code/modules/unit_tests/human_through_recycler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
var/turf/open/stage = get_turf(chewer)
assistant.forceMove(stage) // put the assistant in the recycler, to ensure that the recycler still registers incoming input.

assistant.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Avoids reading as broken because damage was soaked.

// okay, let's first test the basics of how an emagged recycler should operate
TEST_ASSERT_NULL(QDELETED(assistant), "Assistant was deleted by the emagged recycler!") // The assistant should not be deleted by the recycler.
if(assistant.stat < UNCONSCIOUS)
Expand Down
2 changes: 2 additions & 0 deletions code/modules/unit_tests/liver.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
TEST_ASSERT_EQUAL(mrbones.has_reagent(/datum/reagent/toxin/bonehurtingjuice), FALSE, "Skeleton somehow has bone hurting juice before drinking")
TEST_ASSERT_EQUAL(mrbones.has_reagent(/datum/reagent/consumable/milk), FALSE, "Skeleton somehow has milk before drinking")

mrbones.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Avoids reading as broken because damage was soaked.

// Test bone hurting juice reactions

mrbones.reagents.add_reagent(bonehurting, 40)
Expand Down
1 change: 1 addition & 0 deletions code/modules/unit_tests/medical_wounds.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/// This test is used to make sure a flesh-and-bone base human can suffer all the types of wounds, and that suffering more severe wounds removes and replaces the lesser wound. Also tests that [/mob/living/carbon/proc/fully_heal] removes all wounds
/datum/unit_test/test_human_base/Run()
var/mob/living/carbon/human/victim = allocate(/mob/living/carbon/human/consistent)
victim.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Avoids reading as broken because damage was soaked.

/// the limbs have no wound resistance like the chest and head do, so let's go with the r_arm
var/obj/item/bodypart/tested_part = victim.get_bodypart(BODY_ZONE_R_ARM)
Expand Down
1 change: 1 addition & 0 deletions code/modules/unit_tests/mob_damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
SSmobs.pause()
var/mob/living/carbon/human/dummy = allocate(/mob/living/carbon/human/consistent)
dummy.maxHealth = 200 // tank mode
dummy.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Avoids reading as broken because damage was soaked.

/* The sanity tests: here we make sure that:
1) That damage procs are returning the expected values. They should be returning the actual amount of damage taken/healed.
Expand Down
1 change: 1 addition & 0 deletions code/modules/unit_tests/tail_wag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
var/mob/living/carbon/human/dummy = allocate(/mob/living/carbon/human/consistent)
var/obj/item/organ/tail/cat/dummy_tail = allocate(/obj/item/organ/tail/cat)
dummy_tail.Insert(dummy, special = TRUE, movement_flags = DELETE_IF_REPLACED)
dummy.st_set_stat(STAT_STAMINA, 0) // DARKPACK EDIT ADD //Avoids reading as broken because damage was soaked.

// SANITY TEST

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@
var/fakediablerist = FALSE
var/can_be_embraced = TRUE

///The number of dice available to soak bashing, lethal, and aggravated damage
var/soak_dice_bashing = 0
var/soak_dice_lethal = 0
var/soak_dice_aggravated = 0

Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,34 @@


. = ..()

/mob/living/carbon/human/update_soak() //Fairly complex list here. Kindred can soak lethal with Stamina, and Agg with Fortitude. Garou can soak everything in every form except their breed form, in which they can only soak Lethal and Bashing.
. = ..()
if(get_kindred_splat(src))
soak_dice_bashing = st_get_stat(STAT_STAMINA) //Stamina already has the Fortitude bonus added for Bashing and Lethal.
soak_dice_lethal = st_get_stat(STAT_STAMINA)
soak_dice_aggravated = 0 //Reset it beforehand in case you had leftover agg dice.
var/datum/discipline/soak_visceratika = get_discipline(/datum/discipline/visceratika)
var/datum/discipline/soak_fortitude = get_discipline(/datum/discipline/fortitude)
if(soak_visceratika && soak_visceratika.level >= 4)
soak_dice_aggravated += 1 //1 Agg and Lethal soak, 2 Bashing from Armour of Terra.
soak_dice_lethal += 1
soak_dice_bashing += 2
if(soak_fortitude)
soak_dice_aggravated += soak_fortitude.level

if(get_garou_splat(src))
soak_dice_bashing = st_get_stat(STAT_STAMINA)
soak_dice_lethal = st_get_stat(STAT_STAMINA)
var/datum/splat/werewolf/shifter/shifter_splat = get_shifter_splat(src)
if(shifter_splat.is_breed_form() && (shifter_splat.get_breed_form_species() != /datum/species/human/shifter/war)) //Garou don't soak Agg in breed form except for
soak_dice_aggravated = 0
return
soak_dice_aggravated = st_get_stat(STAT_STAMINA)

if(get_ghoul_splat(src))
var/datum/discipline/soak_fortitude = src.get_discipline(/datum/discipline/fortitude)
if(!soak_fortitude)
return
soak_dice_lethal = soak_fortitude.level //Ghouls can soak lethal and agg via fortitude.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ghouls & Revenants page 42 means they should get lethal soak via stamina.

Image

soak_dice_aggravated = soak_fortitude.level
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,6 @@
fully_replace_character_name(name, real_name)


maxHealth = round(initial(maxHealth)+(initial(maxHealth)/3)*(st_get_stat(STAT_STAMINA)))
health = round(initial(health)+(initial(health)/3)*(st_get_stat(STAT_STAMINA)))
last_health = health

is_criminal = socialrole.is_criminal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
if(mortal.mind)
vamp.mind = mortal.mind

vamp.adjust_brute_loss(50)
vamp.apply_damage(50)
vamp.visible_message(span_danger("[vamp] suddenly convulses violently and falls into what appears to be a coma!"))
to_chat(vamp, span_boldwarning("The psychic shock of your host's death sends you into torpor!"))
vamp.torpor(DAMAGE_TRAIT)
Expand Down
Loading