Joshua Stream Pre
  1. #1

    Effect: DMG:+2 If Failed To Confirm Critical

    Hello, All

    We have a house rule around our table that gives a +2 to damage on an unconfirmed critical. Is there a way to do this in effects that would be a permanent effect? I saw there was IF conditioning, but I'm not sure how to associate it.

    Thanks in advance!

    Todd

  2. #2
    Or, would it be smarter to modify the ruleset with an extension to add some house rules? (I've looked into it, but not sure I understand where to modify it).

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    26,504
    IF conditioning won't do this.

    You can apply a one-off effect for +2 damage after an unconfirmed critical.

    Or, yes, you could look into creating an extension. The issue is that the attack roll is separate from the damage roll.

    You'd need to add in an additional flag to indicate that you had an unconfirmed critical in scripts\manager_action_attack.lua - look for the setCritState function to see how this is done for a confirmed critical - it basically sets an entry in the aCritState LUA table.

    This table is checked in the scripts\manager_action_damage.lua file when damage is rolled - uses the ActionAttack.isCrit function to determine if there is a critical for the attacker and target pair. If so, then critical damage will be rolled.
    FG Con 16 Fantasy Grounds Online RPG Convention - Postponed New date To Be Confirmed.
    Register at www.fg-con.com for all the latest info.

    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  4. #4
    Thanks, Trenloe

    I did do an effect like you mentioned, so I at least have that.

    A couple of follow up questions, if I may. Sorry, lots of code spread over multiple locations that I don't fully understand. I dove into LUA some time back, but never fully understood it.

    Is the aCritState a global variable accessible by the manager_action_damage.lua? I would assume (because I haven't dug down that rabbit hole yet) that adding an additional field to the aCritState table (say, a boolean) wouldn't cause too much trouble. But if anything relies on that, then it could result in an incorrectly resolved critical.

    Is there a way for the modDamage to access the sResults or msgLong.icon to see if it is a "non-crit"? In reviewing the code, it seems like I can modify the applyAttack() to add another condition in the ELSE for the non-crit.

    If this is too technical, I can address it in the appropriate forum.

    Thanks!

    Todd

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    26,504
    Quote Originally Posted by tdewitt274 View Post
    Is the aCritState a global variable accessible by the manager_action_damage.lua?
    It's a global variable within the manager_action_attack.lua script file scope - which is the ActionAttack global script package.

    You can refer to that LUA table as ActionAttack.aCritState, or use the handler functions made to access that - isCrit or clearCritState.

    Quote Originally Posted by tdewitt274 View Post
    I would assume (because I haven't dug down that rabbit hole yet) that adding an additional field to the aCritState table (say, a boolean) wouldn't cause too much trouble. But if anything relies on that, then it could result in an incorrectly resolved critical.
    I wouldn't add to aCritState at all, make a new table and the handler functions - they'll be very similar to the three handlers at the bottom of manager_action_attack.lua - setCritState, clearCritState and isCrit.

    Don't modify these, create new ones so that you're not interfering with standard functionality for an actual critical. Create a new table called aCritNoConfirm (or whatever you want to call it) then copy the three functions and rename them to setCritNoConfirmState, clearCritNoConfirmState and isCritNoConfirm and modify to use the aCritNoConfirm table instead of aCritState.

    Then you can set this in the attack roll if a critical is not confirmed with setCritNoConfirmState(rSource, rTarget); and you could check the flag in manager_action_damage.lua using ActionAttack.isCritNoConfirm(rSource, rTarget)

    Quote Originally Posted by tdewitt274 View Post
    Is there a way for the modDamage to access the sResults or msgLong.icon to see if it is a "non-crit"? In reviewing the code, it seems like I can modify the applyAttack() to add another condition in the ELSE for the non-crit.
    Nope. Because the result of the attack action is completely separate from the damage action - that's why the crit flag is stored in the global script package ActionAttack during the attack roll to be accessed later from the DamageAction process.
    FG Con 16 Fantasy Grounds Online RPG Convention - Postponed New date To Be Confirmed.
    Register at www.fg-con.com for all the latest info.

    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  6. #6
    Thanks again, Trenloe

    I'll give your recommendation a try and see if I can figure it out.

    Thanks!

    Todd

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FGU Twitter Sweepstakes

Log in

Log in