-
Notifications
You must be signed in to change notification settings - Fork 71
Soak #944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Soak #944
Changes from 128 commits
191c442
ccdb971
c3aaf6c
08d747a
a008f1b
9569ee7
8942be8
cbde8d3
f44fb5e
13740b6
be98f64
e71927f
745cd74
3420262
400f776
f3b321e
807f242
9d513c2
3bafb59
9aa1697
f87ef36
08a42f9
a94e736
8bcdc3f
6c654f7
09e7c8f
449c0c0
85f17aa
3d9f432
bf0f467
48966aa
7b71ea6
63128dd
5dc17b0
b001891
9db2909
a5d7177
ea38841
6de9afd
73e7e25
d20b255
f170dc9
822bca2
7783c1a
6414ab1
1c65555
b6560ee
f80f3bb
bfb142c
82fc4d4
0dd6b8e
8dd2c71
a3de37f
db780e8
847d791
15ea5cc
162498e
abfb959
f16d55a
d7db7c8
64bb20d
8bce751
e4898d5
ec8d815
a283ba4
2c46506
db9a2a7
07dc636
4bf9dea
df63699
22c84bf
583c931
afeccc1
a0e87b8
60098a4
3223c04
fe251f4
6c9a848
46f56f1
c07d96d
2d09b06
4d85362
2209af9
085e68f
8ea2b4f
cf87e0e
38fc884
d58dd47
88c2afd
8196ede
a1881e4
3d85cf2
51c0788
4db43d2
da82d0f
4909655
fbf61b4
e209264
988b17f
7f79e28
9109fd8
6a8e249
b7592b3
523c260
0e832b2
a4ef254
62d3049
e2c3354
33cb96f
480f9c4
6512c1c
b7f0f3c
e95eb97
e51b6e4
446050e
dca5f2d
d69b3a4
9dd6a23
61b033e
4714ac3
c21f7c5
44f6ef5
d448eb8
a6f93f3
49e9b35
acd2947
28f3b76
cc2adbe
981a27a
b45ca54
5d9a48c
816450a
aac0503
463e499
05ea5cf
9cc8bf8
24c7e6e
54d2886
0ea2abc
e7b1522
5286a82
844f046
0d41924
151d110
cddc28d
56c5638
295c9aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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, | ||
|
|
@@ -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 | ||
|
|
@@ -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. | ||
|
FalloutFalcon marked this conversation as resolved.
Outdated
|
||
| else | ||
| roll_used = soak_dice_lethal //Otherwise it's lethal damage. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this duplataces the effects of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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))) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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!")) | ||
|
Magisterium2022 marked this conversation as resolved.
Outdated
|
||
|
|
||
| return damage | ||
| // DARKPACK EDIT ADD END | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| soak_dice_aggravated = soak_fortitude.level | ||



Uh oh!
There was an error while loading. Please reload this page.