PDA

View Full Version : Keen/Improved Critical Extension



darrenan
March 27th, 2016, 20:37
This is a very simple extension that lets you apply the "keen" effect to a PC or NPC. This effect will cause all attacks to have their critical threat range doubled.

NOTE: Not compatible with Mirror Image Handler extension. The keen functionality will be merged into Mirror Image Handler at some point, and the keen extension will be deprecated.

Files Modified:
scripts\manager_attack_action.lua

Date Version Comments
3/27/2016 1.0 First release.
11/04/2016 1.1 Updates for FG 3.2.0 release.
9/14/2017 1.1.1 Fix bug with iterative attacks reported by mr900rr.
9/19/2017 1.2 Compatibility with FG 3.2.2 release.
7/23/2019 1.21 Compatibility with FG 3.3.8 release.

28042

Sasmira
March 29th, 2016, 14:32
Hello,

I have added your extension but I don't see Keen effect in effect ...
Can you add some screenshots too ?

thx.
S

darrenan
March 29th, 2016, 19:09
Are you saying that you put the "keen" effect on a PC or NPC but it didn't double their threat range? Or were you expecting a spell or some other action to automatically add the effect?

The effect works like any other condition effect such as "prone", "blinded", etc. If you're the GM, you can add the effect directly via the combat tracker. If you're a player, you can add an effect action to a new or existing spell on your actions tab and either target yourself or your target to add the effect.

Maybe if you tell me what you have tried, or how you expect it to work, I can clear up any misconceptions and clarify how to make it work.

I will add a couple screenshots when I get home tonight.

Sasmira
March 29th, 2016, 19:52
Sorry my english isn't very good ...

When I open the Window's Effect, I don't see the effect with the name "keen" but if i create a new effect "keen" and add on a PC, he work fine.

After I play with the "Standard conditions" (appear in the campaign "Effects" list) (https://www.fantasygrounds.com/forums/showpost.php?p=115496&postcount=5) and I thought the extension created automatically, the effects in the effects window like "Standard Conditions module"

darrenan
March 29th, 2016, 20:03
This extension does not add anything to the effects window currently. I suppose I could look into doing that, but there doesn't seem to be a lot of value add to that since it's trivial to manually add a keen effect to that window.

Currently, this extension only modifies the ruleset code to check for existence of the effect and change the critical threat range when found. It's literally like 5-6 lines of new code.

darrenan
July 23rd, 2016, 20:01
This current version of this extension is compatible with 3.2.0.

darrenan
November 5th, 2016, 06:52
Version 1.1 which is compatible with the final release of 3.2.0.

darrenan
November 16th, 2016, 03:09
Current version should be 3.2.1 compatible.

darrenan
January 15th, 2017, 04:40
Current version is 3.2.2 compatible.

darrenan
April 14th, 2017, 21:36
Current version is 3.3.0 compatible.

mr900rr
September 14th, 2017, 05:58
When doing a full attack (attack with more then one attack roll) it is calculating weird causing crit range to be all over the place. For example with a dagger crit 19-20 on full attack it will sometime show 13 as a crit and not on others, works fine as long as only doing single attack.Looks like on attack 1 of full attack crit is doubled (17-20) and then its doubling that on attack 2 (13-20) then doubling again on attack 3 (5-20).

darrenan
September 14th, 2017, 06:54
I'll take a look, thanks for reporting the issue.

mr900rr
September 14th, 2017, 08:47
I think this will fix it by making our own variable and not directly changing the "rAction.crit" value and then moving up the original check into an "else" of your "if" statement.

if EffectManager.hasEffectCondition(rActor, "KEEN") then
if rAction.crit then
rActioncrit = 20 - ((20 - rAction.crit + 1) * 2) + 1;
else
rActioncrit = 19;
end
rRoll.sDesc = rRoll.sDesc .. " [CRIT " .. rActioncrit .. "]";
else
if rAction.crit and rAction.crit < 20 then
rRoll.sDesc = rRoll.sDesc .. " [CRIT " .. rAction.crit .. "]";
end
end


-- if rAction.crit and rAction.crit < 20 then
-- rRoll.sDesc = rRoll.sDesc .. " [CRIT " .. rAction.crit .. "]";
-- end

Hope the code shows up right, but it seems to work in mine, test it and let me know if you agree.

darrenan
September 14th, 2017, 17:24
I was actually trying to figure out if I could just set the correct .crit value when the roll action is created rather than dealing with it in getRoll. But if I can't, it looks like your solution should work. Feel free to modify your own local copy to get yourself unblocked if you need to. I probably won't get a new version posted until this weekend.

darrenan
September 15th, 2017, 03:27
Version 1.1.1 attached to post #1, fixes bug reported by mr900rr.

dellanx
September 20th, 2017, 01:39
I had problems with Keen extension in RFPG FG update V.3.3.2.

Thanks!

darrenan
September 20th, 2017, 03:53
Version 1.2 has been uploaded to post #1. This version addresses the breaking changes related to FG release 3.2.2.

dellanx
September 21st, 2017, 03:29
Version 1.2 has been uploaded to post #1. This version addresses the breaking changes related to FG release 3.2.2.

Awesome Thanks!

darrenan
December 17th, 2018, 17:38
NOTE: Not compatible with Mirror Image Handler extension. The keen functionality will be merged into Mirror Image Handler at some point, and the keen extension will be deprecated.

TrentLane
June 12th, 2019, 12:06
I ran across a weird glitch yesterday witht this extension, and I can't for the life of me figure out what went wrong.
Applied keen to PC in the CT and when I or the player roll directly from his charsheet, it applies correctly. But when the player uses the same attack from the shortcut bar it suddenly stops working. Deleted the shortcut and reapplied the atk to the shortcut bar from the sheet, but still shows the same behavior.
This happened to two players, and I can't figure out what went wrong, and I can't reproduce it. Every time I test it on my end, it works fine.
Any idea where the issue might be?

Edit: OK, I could reproduce this after all. When dragging the attack to the shortcut bar it defaults to whatever crit range is active atm. So dragging the attack without keen active defaults to the (in that case) 18 modifier. When rolling the attack from the bar; no matter if keen is active as an effect or not, it uses the crit modifier that applied when setting that shortcut. Don't know if it is supposed to work like this, but it's certainly not what I expected

LordEntrails
June 12th, 2019, 17:38
Remember, the shortcut bar makes a copy of the item/action, it does not make a link to it. So, just like you have to have keen active when you make the shortcut, the shortcut will not update when the original changes (i.e. on level up or other changes)

TrentLane
June 12th, 2019, 18:02
Remember, the shortcut bar makes a copy of the item/action, it does not make a link to it. So, just like you have to have keen active when you make the shortcut, the shortcut will not update when the original changes (i.e. on level up or other changes)

Didn't know that, thank you. I still assumed that the effect, when in the CT, applies when rolling even from a shortcut, same as power attack for example.

darrenan
July 23rd, 2019, 21:57
Version 1.21 compatible with FG v3.3.8 is now linked to post #1.

darrenan
August 7th, 2019, 20:32
Version 1.21 will be the last version of this extension that I will be releasing. I don't plan on maintaining this extension beyond FG v3.3.8. Anyone who wants to look at this extension for inspiration, inclusion in their own extension, or to move this extension forward in any way, has my 100% complete and total blessing!

Kelrugem
August 7th, 2019, 23:54
Version 1.21 will be the last version of this extension that I will be releasing. I don't plan on maintaining this extension beyond FG v3.3.8. Anyone who wants to look at this extension for inspiration, inclusion in their own extension, or to move this extension forward in any way, has my 100% complete and total blessing!

Thanks also for this extension and for the updates :)

Just wanted to mention to the others here, too, that I have incorporated your keen extension also in my advanced effects extension, https://www.fantasygrounds.com/forums/showthread.php?48977-Advanced-3-5e-and-Pathfinder-effects

If someone wants the extension with just the code of the keen effect in the future after new FG updates then tell me then I can upload an updated keen extension (whenever an update may be needed) :)

Bidmaron
August 8th, 2019, 05:00
Thanks to both of you!