Skip to content
Open

Soak #944

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 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
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
4 changes: 1 addition & 3 deletions code/__DEFINES/~darkpack/storyteller_stats.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Stat Flags
#define AFFECTS_HEALTH (1<<0)
#define AFFECTS_SPEED (1<<1)
#define AFFECTS_STATS (1<<2) // If the stat affects other stats, like courage or permanent willpower.
#define AFFECTS_STATS (1<<0) // If the stat affects other stats, like courage or permanent willpower.


#define STAT_FREEBIE_POINTS /datum/st_stat/freebie
Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ 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

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 ADDITION

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) // DARKPACK EDIT CHANGE - (soak)
. = ..()
if (. <= 0)
return
Expand Down
10 changes: 8 additions & 2 deletions code/modules/mob/living/carbon/damage_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
attack_direction = null,
attacking_item,
wound_clothing = TRUE,
)
soak_difficulty = 6,
unsoakable = FALSE,
) // DARKPACK EDIT CHANGE - (soak)

// Spread damage should always have def zone be null
if(spread_damage)
def_zone = null
Expand All @@ -35,6 +38,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,7 +52,9 @@
attack_direction = null,
attacking_item,
wound_clothing = TRUE,
)
soak_difficulty = 6,
unsoakable = FALSE,
) // DARKPACK EDIT CHANGE - (soak)

// Add relevant DR modifiers into blocked value to pass to parent
blocked += physiology?.damage_resistance
Expand Down
62 changes: 61 additions & 1 deletion 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,8 +35,14 @@
attack_direction = null,
attacking_item,
wound_clothing = TRUE,
)
soak_difficulty = 6,
unsoakable = FALSE,
) // DARKPACK EDIT CHANGE - (soak)
SHOULD_CALL_PARENT(TRUE)

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

var/damage_amount = damage
if(!forced)
damage_amount *= ((100 - blocked) / 100)
Expand Down Expand Up @@ -580,3 +588,55 @@
break
if(. && update_health)
updatehealth()

// DARKPACK EDIT ADD START - (soak)
/mob/living/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.
else
roll_used = soak_dice_lethal //Otherwise it's lethal damage.
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 * (1 TTRPG_DAMAGE))))
to_chat(src, span_warning("You stand firm and are able to absorb some of the damage!"))

return damage

/mob/living/proc/update_soak() //Pretty basic calculation for the average entity, soak is Bashing only using Stamina.
soak_dice_bashing = st_get_stat(STAT_STAMINA)
// DARKPACK EDIT ADD END
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) // DARKPACK EDIT CHANGE - (soak)
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 @@ -8,4 +8,3 @@

var/fakediablerist = FALSE
var/can_be_embraced = TRUE

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_shifter_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 Crinos-born. Adjustment will need to be added once Corax are in for their +2 bashing soak diff.
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.
soak_dice_aggravated = soak_fortitude.level
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,8 @@
//thaumaturgy & necro path stuff
var/research_points = 0
var/collected_souls = 0

// 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 @@ -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
Loading