Is it possible to scale an attack by Enemy Dodge Reduction?

Discussion in 'Modding' started by d3ward, Jul 24, 2014.

  1. d3ward

    d3ward Member

    Just for fun, I'm trying to create a skilltree mod that involves firing a gun of sorts. The idea is that I want the gun to be a damage spell on a cooldown timer, and I want the gun to become more powerful as the character levels up. For aesthetic reasons, I want the gun to do more damage as the player's Enemy Dodge Reduction goes up: more accurate with the gun means more damage.

    However, I appear to be doing something wrong, or else the game does not seem to support scaling to EDR. My test-code for the gun spell is as follows:

    Code:
    <spell name="Shoot Gun" type="missile" >
            <effect type="damage" blasting="5" blastingF="0.5" primaryScale="9" />
            <anim sprite="sprites/sfx/flame_buff_loop/flame_buff_loop" frames="6" framerate="50" sfx="flame" />
        </spell>
    Ideally, this would mean the gun deals 5 blasting damage with an additional 1 point of blasting damage for every two points of EDR (PrimaryScale 9) the player has. However, when I tested this spell out in game, this spell does a whopping 55 damage per shot, even though my EDR is pretty low starting out!

    If I change the blastingF scale to 0.05 instead of 0.5, the damage per shot is 10 blasting instead of 55, which is closer to what I want... But regardless, whether I use 0.5 or 0.05, the damage does not scale as my EDR goes up. It is either a flat 55 or a flat 10.

    Has anyone been able to scale a spell to EDR? And if so, what am I doing wrong?

    Thanks in advance!
     
  2. Kaidelong

    Kaidelong Member

    You put down `primaryScale="9"` instead of `secondaryScale="9"`. I think that should actually scale to Wizard Level but in fact it seems to be defaulting to 100, which is what Dredmor does when it doesn't know what you're talking of. 5 + 100*0.5 = 55. Change that `primaryScale` to a `secondaryScale` and you should be good to go.
     
  3. d3ward

    d3ward Member

    Ah, gotcha. Thanks Kaidelong! I'll give this a try after work today and post my results back here.
     
  4. d3ward

    d3ward Member

    Yep, that did the trick. Thanks!