STAR TREK 2d20
Page 1 of 2 12 Last
  1. #1

    damage reduction bug

    a player or monster with more then one type of DR (damage reduction shouldn't stack)
    DR 5/-
    DR 10 evil
    DR 15 silver
    is reading it as if it was DR 30
    we notice this when a 10th level barbarian (Invulnerable Rager) with DR 5/- was given the spell buff stoneskin DR 10 adamantine, the monster did 16 damage and he took 1 point of damage, this also affects the Invulnerable Rager when he takes nonlethal damage (DR 10 nonlethal damage), its stacking with its DR 5/-
    the rules for DR state that they don't stack

    Damage Reduction :
    Some magic creatures have the supernatural ability to instantly heal damage from weapons or ignore blows altogether as though they were invulnerable.

    The numerical part of a creature’s damage reduction (or DR) is the amount of damage the creature ignores from normal attacks. Usually, a certain type of weapon can overcome this reduction (see Overcoming DR). This information is separated from the damage reduction number by a slash. For example, DR 5/magic means that a creature takes 5 less points of damage from all weapons that are not magic. If a dash follows the slash, then the damage reduction is effective against any attack that does not ignore damage reduction.

    Whenever damage reduction completely negates the damage from an attack, it also negates most special effects that accompany the attack, such as injury poison, a monk’s stunning, and injury-based disease. Damage Reduction does not negate touch attacks, energy damage dealt along with an attack, or energy drains. Nor does it affect poisons or diseases delivered by inhalation, ingestion, or contact.

    Attacks that deal no damage because of the target’s damage reduction do not disrupt spells.

    Spells, spell-like abilities, and energy attacks (even non-magical fire) ignore damage reduction.

    Sometimes damage reduction represents instant healing. Sometimes it represents the creature’s tough hide or body. In either case, other characters can see that conventional attacks won’t work.

    If a creature has damage reduction from more than one source, the two forms of damage reduction do not stack. Instead, the creature gets the benefit of the best damage reduction in a given situation.

  2. #2
    Quote Originally Posted by Evion View Post
    a player or monster with more then one type of DR (damage reduction shouldn't stack)
    DR 5/-
    DR 10 evil
    DR 15 silver
    is reading it as if it was DR 30
    we notice this when a 10th level barbarian (Invulnerable Rager) with DR 5/- was given the spell buff stoneskin DR 10 adamantine, the monster did 16 damage and he took 1 point of damage, this also affects the Invulnerable Rager when he takes nonlethal damage (DR 10 nonlethal damage), its stacking with its DR 5/-
    the rules for DR state that they don't stack

    Damage Reduction :
    Some magic creatures have the supernatural ability to instantly heal damage from weapons or ignore blows altogether as though they were invulnerable.

    The numerical part of a creature’s damage reduction (or DR) is the amount of damage the creature ignores from normal attacks. Usually, a certain type of weapon can overcome this reduction (see Overcoming DR). This information is separated from the damage reduction number by a slash. For example, DR 5/magic means that a creature takes 5 less points of damage from all weapons that are not magic. If a dash follows the slash, then the damage reduction is effective against any attack that does not ignore damage reduction.

    Whenever damage reduction completely negates the damage from an attack, it also negates most special effects that accompany the attack, such as injury poison, a monk’s stunning, and injury-based disease. Damage Reduction does not negate touch attacks, energy damage dealt along with an attack, or energy drains. Nor does it affect poisons or diseases delivered by inhalation, ingestion, or contact.

    Attacks that deal no damage because of the target’s damage reduction do not disrupt spells.

    Spells, spell-like abilities, and energy attacks (even non-magical fire) ignore damage reduction.

    Sometimes damage reduction represents instant healing. Sometimes it represents the creature’s tough hide or body. In either case, other characters can see that conventional attacks won’t work.

    If a creature has damage reduction from more than one source, the two forms of damage reduction do not stack. Instead, the creature gets the benefit of the best damage reduction in a given situation.
    As a workaround you can do dr:5 and dr: 5 adamantine for your barbarian with stoneskin.
    It might be a reason It is not implementere in the game. For it to work the game has to apply its damage against each of the dr and then take the lowest, which requires some work

  3. #3
    I may be wrong but I think I recall it working "as intended" in the past (so far it almost never happened to me to have actors with more than one kind of DR at once)

  4. #4
    I just reviewed the damage automation code; and it's not something that was ever implemented. Probably because it happens so rarely.

    The code does already handle the case where damage reduction is applied across multiple damage components that are both resisted by the same DR effect, so that the DR is only applied once.

    It will have to be something I look at down the road a bit; because it requires rewriting the logic from scratch to make both scenarios work. I'll add to my list for future version improvements.

    Regards,
    JPG

  5. #5
    Could that maybe be fixed by the following code? (In manager_action_damage.lua replacing the whole DR function in line 946 to 978 (v. 3.3.8)) New stuff in blue

    Code:
    if not bHasEnergyType and (v + nLocalDamageAdjust) > 0 then
                local DRFix = {};
                local i = 1;
                local bMatchAND, nMatchAND, bMatchDMG, aClausesOR;
                
                local bApplyDR;
                for _,vDR in pairs(aDR) do
                    local kDR = table.concat(vDR.remainder, " ");
                    
                    if kDR == "" or kDR == "-" or kDR == "all" then
                        bApplyDR = true;
                    else
                        bApplyDR = true;
                        aClausesOR = decodeAndOrClauses(kDR);
                        if matchAndOrClauses(aClausesOR, aSrcDmgClauseTypes) then
                            bApplyDR = false;
                        end
                    end
    
                    if bApplyDR then
                        local nApplied = vDR.nApplied or 0;
                        if nApplied < vDR.mod then
                            local nChange = math.min((vDR.mod - nApplied), v + nLocalDamageAdjust);
                            vDR.nApplied = nApplied + nChange;
                            DRFix[i] = nChange;
                            i = i + 1;
                            bResist = true;
                        end
                    end
                end
                table.sort(DRFix);
                nLocalDamageAdjust = nLocalDamageAdjust - DRFix[#DRFix];
            end
    Especially the nLocalDamageAdjust-change is now outside the if-clause of bApplyDR

  6. #6
    (can somehow not edit my previous post)

    In my modding campaign that worked for some little testing; but I didn't test it for a lot of different situations. My idea was just to collect all damage changes coming from all DR effects in the vector DRFix, then (then after the for-loop) I sort them by their values with table.sort such that DRFix[#DRFix] should be the highest value in that table/vector and only that is now used for the change of nLocalDamageAdjust So nLocalDamageAdjust is not changed for each DR effect separately but at the end after the for-loop only taking the highest DR. That is at least my idea, not sure if implemented correctly But probably I oversee now some other special situation of DR-effects which is not correctly handled by that type of code
    Last edited by Kelrugem; June 3rd, 2019 at 23:50.

  7. #7
    You need to be very specific on which damage clauses are affected, so you can't do it after the fact like that. (If you "refund" to the wrong damage type clause, it could throw off any subsequent calculations done within this function or by an extension.) Like I said, it will need to be rewritten completely to account for overlaps both in damage clauses and damage reduction effects.

    Regards,
    JPG

  8. #8
    Quote Originally Posted by Moon Wizard View Post
    You need to be very specific on which damage clauses are affected, so you can't do it after the fact like that. (If you "refund" to the wrong damage type clause, it could throw off any subsequent calculations done within this function or by an extension.) Like I said, it will need to be rewritten completely to account for overlaps both in damage clauses and damage reduction effects.

    Regards,
    JPG
    aaah, okay, I understand Thanks for the answer

    EDIT: Indeed, just tested it, for subsequent rolls (like it happens for crits) some error happens
    Last edited by Kelrugem; June 4th, 2019 at 01:27.

  9. #9
    There is also a similar bug with "RESIST" etc. which is the reason why I mention it here As far as I can see effects like RESIST are not stacking but only in the "classes" of "specific damage types" or "all" or "[no mentioned dmg type]" but there is no connection between these with respect to stacking, i.e. e.g. RESIST: 2 all and RESIST: 1 fire results into resistance of 3 against fire. But that is even a rarer occasion, for completeness I wanted to mention that though (since it is nearly at the same place of the code)

    EDIT: One mistake, it is more like that RESIST: (N) [damage type] overwrites RESIST: (N) all which overwrites RESIST: (N), regardless of the number (N) (maybe I had some other effect on while testing that)
    Last edited by Kelrugem; June 16th, 2019 at 21:33.

  10. #10
    I just find now some other bug related to dmg types (therefore again this thread) Now it is a more common situation: VULN doesn't work correctly when there are normal energy types and energy types of critical rolls. See the attached picture: The Aboleth has vulnerability against acid damage and my wolf has some weapon with acid damage and also an effect describing e.g. acid burst. As you can see the vulnerability only increases the damage of one of the damage dice with the type acid. (In that case it was the one of the critical die, the normal acid die is not increased in its damage)

    I guess this is due to that the code checks if vulnerability is already applied to avoid doubled uses of vulnerability when one has vulnerability against more than one damage type etc. which is correct but the situation of critical damages has to be treated differently (isn't it?)

    PS: I am looking at that code because one of my extensions has a similar problem with damage types; this damage type stuff drives me crazy, I believe So many different special situations depending on which damage types occur...

    PPS: How one can embed a picture in a post such that it is shown directly in the post btw?
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in