Sneak Attack + Weapon Skill

Forum rules
NO LONGER BEING MAINTAINED!
ciradan
Posts: 25
Joined: Fri Jul 27, 2012 7:47 pm

Re: Sneak Attack + Weapon Skill

Post by ciradan » Wed Dec 05, 2012 9:08 am

kjLotus wrote:right now SA applies (or should be applying, i'm just reading the code here)
There was a revision that fixed SA+WS a few months ago, and it actually worked with multi-hit WS back then.
I stopped playing somewhere around r1830-ish and it still worked then. I came back around r2020 wherre SA+WS were already broken.

Now it's broken and from what I see is that the SA effect merely gets "lost".
e.g.:
Normal Shark Bite deals 300 dmg
Normal SA deals 500
A SA+SB should be 800+, however it only deals about 300 dmg, like a normal SB.

I've looked at the log if maybe there were timing issues and the time between my SA and WS was enough for a single auto-attack, but it didn't show any high dmg auto-attack.
Using a WS while SA is in effect seems to just delete the status SA instead of applying it now.

hakusho
Posts: 49
Joined: Wed Nov 07, 2012 1:01 pm

Re: Sneak Attack + Weapon Skill

Post by hakusho » Wed Dec 05, 2012 9:20 am

Where in the source code can I find the part about SA? I only found the SA LUA file and that just applies the status effect.

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Sneak Attack + Weapon Skill

Post by kjLotus » Wed Dec 05, 2012 4:38 pm

ciradan wrote:
kjLotus wrote:right now SA applies (or should be applying, i'm just reading the code here)
There was a revision that fixed SA+WS a few months ago, and it actually worked with multi-hit WS back then.
I stopped playing somewhere around r1830-ish and it still worked then. I came back around r2020 wherre SA+WS were already broken.

Now it's broken and from what I see is that the SA effect merely gets "lost".
e.g.:
Normal Shark Bite deals 300 dmg
Normal SA deals 500
A SA+SB should be 800+, however it only deals about 300 dmg, like a normal SB.

I've looked at the log if maybe there were timing issues and the time between my SA and WS was enough for a single auto-attack, but it didn't show any high dmg auto-attack.
Using a WS while SA is in effect seems to just delete the status SA instead of applying it now.
sorry, i retract my earlier statement about it working - it looks like it only works with weaponskills where the canCrit flag is set (someone at some point may have changed it, i'd have to check when i get home later). it does give 100% accuracy on the first hit though, that i can guarantee (even though for some reason, the first hit as 95% chance to hit anyways - something else i intend to fix later)

i will definitely double check the application of the dexterity bonus, though (as THF main). it may not be correct either
hakusho wrote:Where in the source code can I find the part about SA? I only found the SA LUA file and that just applies the status effect.
SA interacts with WS in weaponskills.lua, doPhysicalWeaponSkill (or something) function. find the block for calculating damage of the first hit, you'll see the SA crit application is only inside an if(canCrit) block - meaning it never crits if the weaponskill is flagged as not crittable. ideally i'll move that (i don't even have to worry about elemental damage WS since it's the physical damage function and they aren't even implemented yet) so that canCrit has nothing to do with SA.

i don't have the line numbers sorry, as i'm on laptop at school

i will test the first MH hit critting under SA for all physical WS, and test the dex bonus being properly applied to said hit as a THF tomorrow

hakusho
Posts: 49
Joined: Wed Nov 07, 2012 1:01 pm

Re: Sneak Attack + Weapon Skill

Post by hakusho » Thu Dec 06, 2012 4:10 am

I'm totally out of my league here but this code snippet seems odd:

Code: Select all

if(isSneakValid and attacker:isBehind(target))then
                isSneakValid = false;
The first line checks the SA requirements but the second line sets isSneakValid to false if the SA requirements are fulfilled.
I've probably just taken this snippet out of context.

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Sneak Attack + Weapon Skill

Post by kjLotus » Thu Dec 06, 2012 5:15 pm

hakusho wrote:I'm totally out of my league here but this code snippet seems odd:

Code: Select all

if(isSneakValid and attacker:isBehind(target))then
                isSneakValid = false;
The first line checks the SA requirements but the second line sets isSneakValid to false if the SA requirements are fulfilled.
I've probably just taken this snippet out of context.
edit: oh, yep, that's right

that's why it's not working with thieves either (although for sub it was wrong in 2 places)

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Sneak Attack + Weapon Skill

Post by kjLotus » Thu Dec 06, 2012 6:31 pm

do test it next update, it should be working better now

hakusho
Posts: 49
Joined: Wed Nov 07, 2012 1:01 pm

Re: Sneak Attack + Weapon Skill

Post by hakusho » Fri Dec 07, 2012 2:47 am

Cool! Glad I could help. :)
Maybe I got some time to test it when I get back from work.

Post Reply