Playr10 Posted September 30, 2020 Share Posted September 30, 2020 This is the condition's code, while it works perfectly fine on cards, it seems to start higher than 10% per stack and exponentially decrease on NPCS. When stacks are at 20, the attack deals exactly 4x damage. I want each stack to only add 10% to damage (ex: 4 stacks = 140% damage, 2 = 120%) event_handlers = { [ BATTLE_EVENT.CALC_DAMAGE ] = function( self, card, target, dmgt ) if card.owner == self.owner then dmgt:ModifyDamage( math.round( dmgt.max_damage * (1+(0.1*self.stacks))), math.round( dmgt.max_damage * (1+(0.1*self.stacks))), self ) end end, } Link to comment https://forums.kleientertainment.com/forums/topic/122146-weird-damage-calculation/ Share on other sites More sharing options...
u lil nerd Posted September 30, 2020 Share Posted September 30, 2020 So that would technically be 40% more damage right? What I'm seeing in your code is 140% more damage on top of the damage you will already be doing, you can probably fix it if you do: dmgt:AddDamage( math.round( dmgt.max_damage * (0.1*self.stacks)), math.round( dmgt.max_damage * (0.1*self.stacks)), self ) dmgt.max_damage is already 100% of the damage, (0.1*self.stacks) will add 40% more damage to that assuming self.stacks == 4 Basically just remove the 1+ Link to comment https://forums.kleientertainment.com/forums/topic/122146-weird-damage-calculation/#findComment-1376226 Share on other sites More sharing options...
Playr10 Posted September 30, 2020 Author Share Posted September 30, 2020 No, it's not a 140% increase in damage, it's 140% damage total. I'd know if it doubled damage if enemies started off doing 110% more damage than usual, plus as I said before, it was exponentially decreasing in % increase per stack. I was going to get a video to show you, but my code inexplicably started working, so I'll take it. It might have been creature/character/racial traits interfering, but I find that unlikely since I tested this on several different enemies. edit: plus, if this were true, my cards would be dealing double damage with 1 stack Link to comment https://forums.kleientertainment.com/forums/topic/122146-weird-damage-calculation/#findComment-1376228 Share on other sites More sharing options...
RageLeague Posted September 30, 2020 Share Posted September 30, 2020 Also, you used two max_damage when modifying the damage values. The first parameter is supposed to be the increase in min damage, while the second is the increase in max damage. Link to comment https://forums.kleientertainment.com/forums/topic/122146-weird-damage-calculation/#findComment-1376235 Share on other sites More sharing options...
Playr10 Posted September 30, 2020 Author Share Posted September 30, 2020 I guess that might explain why my cards lost their minimum damage Link to comment https://forums.kleientertainment.com/forums/topic/122146-weird-damage-calculation/#findComment-1376237 Share on other sites More sharing options...
RageLeague Posted September 30, 2020 Share Posted September 30, 2020 you can also set the priority of your event to something like EVENT_PRIORITY_MULTIPLIER, which is a constant that equals 200. It is always after addition, and before setters and clamps. maybe that will get rid of some uncertainties in your condition Link to comment https://forums.kleientertainment.com/forums/topic/122146-weird-damage-calculation/#findComment-1376241 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.