FG Spreadshirt Swag

Thread: Always A Chance

  1. #1

    Always A Chance

    I have a problem, one of my players got this mythic ability. Is there any way to disable auto miss for rolled "1"s?

    6https://www.d20pfsrd.com/alternative-rule-systems/mythic/mythic-heroes/mythic-paths-paizo-inc/champion/champion-path-abilities/always-a-chance-ex/

    Thanks

    p.s. See that I can drag the attack roll. Was wondering if there is an automatic way, short of writing an extension. I talked to the player, and we decided on a re-roll instead. I think it would be more fun.
    Last edited by dellanx; October 5th, 2020 at 06:51.

    These are the modules and extensions created and/or taken over by dellanx for PFRPG.

    I had a lot of help and advice from many here at FG.

    Thank You!

  2. #2
    There's no way to disable; so the player will need to let the GM know to check the AC on 1 rolls.

    Regards,
    JPG

  3. #3
    Quote Originally Posted by Moon Wizard View Post
    There's no way to disable; so the player will need to let the GM know to check the AC on 1 rolls.

    Regards,
    JPG
    As I though, thanks!

    These are the modules and extensions created and/or taken over by dellanx for PFRPG.

    I had a lot of help and advice from many here at FG.

    Thank You!

  4. #4
    Never say never when there's always a chance

    I tweaked Kelrugem's FullOverlay Extension to add this for you (because that extension works with this file, is widely used, and changes are allowed)
    Just add "Always a Chance (Ex)" to the Class Features list of your player's character.

    EDIT: tweak code removed in favor of post #7 which also adds it for NPCs (the version attached to this #4 only adds it for PCs)
    Attached Files Attached Files
    Last edited by bmos; October 6th, 2020 at 12:46.

  5. #5
    Quote Originally Posted by bmos View Post
    Never say never when there's always a chance

    I tweaked Kelrugem's FullOverlay Extension to add this for you (because that extension works with this file, is widely used, and changes are allowed)
    Just put "Always a Chance (Ex)" in the Class Features list.

    For the future/reference/adding this to something else:

    in manager_action_attack.lua

    added (before function onAttack):
    Code:
    ---	This function checks for special abilities (bmos)
    function hasSpecialAbility(nodeChar, sSpecAbil)
    	if not sSpecAbil then
    		return false
    	end
    
    	local sLowerSpecAbil = string.lower(sSpecAbil)
    	
    	for _,vNode in pairs(DB.getChildren(nodeChar, 'specialabilitylist')) do
    		if string.lower(DB.getValue(vNode, 'name', '')) == sLowerSpecAbil then
    			return true
    		end
    	end
    	
    	return false
    end
    added (after section with comment "-- Get the crit threshold" and before "rAction.nFirstDie = 0;"):
    Code:
    	-- Check for Always a Chance (Ex) special ability (bmos)
    	local nodeChar
    	if bIsSourcePC then nodeChar = ActorManager.getCreatureNode(rSource) end
    	local bNoFumble = hasSpecialAbility(nodeChar, 'Always a Chance (Ex)')
    changed this:
    Code:
    	elseif rAction.nFirstDie == 1 then
    to this:
    Code:
    	elseif not bNoFumble and rAction.nFirstDie == 1 then
    bmos you are awesome. I also added your changed to Full OverlayPackage.ext

    Thanks!

    Always A Chance.jpg
    Attached Files Attached Files

    These are the modules and extensions created and/or taken over by dellanx for PFRPG.

    I had a lot of help and advice from many here at FG.

    Thank You!

  6. #6
    Quote Originally Posted by dellanx View Post
    bmos you are awesome. I also added your changed to Full OverlayPackage.ext

    Thanks!

    Always A Chance.jpg
    bmos is there a way to make it work for an NPC. If was in the "SA" block?

    Thanks

    SA Block Always A Chance.jpg
    Last edited by dellanx; October 6th, 2020 at 10:44.

    These are the modules and extensions created and/or taken over by dellanx for PFRPG.

    I had a lot of help and advice from many here at FG.

    Thank You!

  7. #7
    removed as there is a bug. see post 9 for new version.
    Last edited by bmos; October 11th, 2020 at 04:17.

  8. #8
    Quote Originally Posted by bmos View Post
    Certainly!

    here's that post again with NPC functionality also (and it no longer needs the " (Ex)"):

    Just put "Always a Chance" in the Class Features list for a PC or in SA (specialattacks) for an NPC.

    For the future/reference/adding this to something else:

    in manager_action_attack.lua

    added (before function onAttack):
    Code:
    ---	This function checks for special abilities (bmos)
    function hasSpecialAbility(nodeChar, sSpecAbil)
    	if not sSpecAbil then
    		return false
    	end
    
    	local sLowerSpecAbil = string.lower(sSpecAbil)
    	
    	for _,vNode in pairs(DB.getChildren(nodeChar, 'specialabilitylist')) do
    		local sSpecAbilName = string.lower(DB.getValue(vNode, 'name', ''))
    		if string.match(string.lower(sSpecAbilName), string.lower(sLowerSpecAbil)) then
    			return true
    		end
    	end
    	
    	return false
    end
    
    ---	This function checks for special attacks in an NPC (bmos)
    function hasSpecialAttack(nodeNPC, sSpecAtk)
    	if not sSpecAtk then
    		return false
    	end
    	
    	local sSpecAtks = DB.getValue(nodeNPC, 'specialattacks', '')
    	if string.match(string.lower(sSpecAtks), string.lower(sSpecAtk)) then
    		return true
    	end
    	
    	return false
    end
    added (after section with comment "-- Get the crit threshold" and before "rAction.nFirstDie = 0;"):
    Code:
    	-- Check for Always a Chance (Ex) special ability (bmos)
    	local nodeChar, nodeNPC
    	local bNoFumble = false
    	local sAaC = 'Always a Chance'
    	if bIsSourcePC then
    		nodeChar = ActorManager.getCreatureNode(rSource)
    		bNoFumble = hasSpecialAbility(nodeChar, sAaC)
    	else
    		nodeNPC = DB.findNode(rSource['sCTNode'])
    		bNoFumble = hasSpecialAttack(nodeNPC, sAaC)
    	end
    changed this:
    Code:
    	elseif rAction.nFirstDie == 1 then
    to this:
    Code:
    	elseif not bNoFumble and rAction.nFirstDie == 1 then
    I think that is it. Will check it tonight. Thank you bmos.

    p.s. confirmed it it works!
    Attached Files Attached Files
    Last edited by dellanx; October 6th, 2020 at 21:48.

    These are the modules and extensions created and/or taken over by dellanx for PFRPG.

    I had a lot of help and advice from many here at FG.

    Thank You!

  9. #9
    Quote Originally Posted by dellanx View Post
    I think that is it. Will check it tonight. Thank you bmos.

    p.s. confirmed it it works!
    I found one issue with it. A script error occurs when dragging damage for characters who forgot to target.

    here's that post again with the fix:

    Just put "Always a Chance" in the Class Features list for a PC or in SA (specialattacks) for an NPC.

    For the future/reference/adding this to something else:

    in manager_action_attack.lua

    added (before function onAttack):
    Code:
    ---	This function checks for special abilities (bmos)
    function hasSpecialAbility(nodeChar, sSpecAbil)
    	if not sSpecAbil then
    		return false
    	end
    
    	local sLowerSpecAbil = string.lower(sSpecAbil)
    	
    	for _,vNode in pairs(DB.getChildren(nodeChar, 'specialabilitylist')) do
    		local sSpecAbilName = string.lower(DB.getValue(vNode, 'name', ''))
    		if string.match(string.lower(sSpecAbilName), string.lower(sLowerSpecAbil)) then
    			return true
    		end
    	end
    	
    	return false
    end
    
    ---	This function checks for special attacks in an NPC (bmos)
    function hasSpecialAttack(nodeNPC, sSpecAtk)
    	if not sSpecAtk then
    		return false
    	end
    	
    	local sSpecAtks = DB.getValue(nodeNPC, 'specialattacks', '')
    	if string.match(string.lower(sSpecAtks), string.lower(sSpecAtk)) then
    		return true
    	end
    	
    	return false
    end
    added (after section with comment "-- Get the crit threshold" and before "rAction.nFirstDie = 0;"):
    Code:
    	-- Check for Always a Chance (Ex) special ability (bmos)
    	local nodeChar, nodeNPC
    	local bNoFumble = false
    	local sAaC = 'Always a Chance'
    	if bIsSourcePC then
    		nodeChar = ActorManager.getCreatureNode(rSource)
    		bNoFumble = hasSpecialAbility(nodeChar, sAaC)
    	elseif rSource then
    		nodeNPC = DB.findNode(rSource['sCTNode'])
    		bNoFumble = hasSpecialAttack(nodeNPC, sAaC)
    	end
    changed this:
    Code:
    	elseif rAction.nFirstDie == 1 then
    to this:
    Code:
    	elseif not bNoFumble and rAction.nFirstDie == 1 then

    See more information in this thread:
    https://www.fantasygrounds.com/forum...l=1#post557351
    Last edited by bmos; November 18th, 2020 at 00:07.

  10. #10
    Quote Originally Posted by bmos View Post
    I found one issue with it. A script error occurs when dragging damage for characters who forgot to target.

    here's that post again with the fix:

    Just put "Always a Chance" in the Class Features list for a PC or in SA (specialattacks) for an NPC.

    For the future/reference/adding this to something else:

    in manager_action_attack.lua

    added (before function onAttack):
    Code:
    ---	This function checks for special abilities (bmos)
    function hasSpecialAbility(nodeChar, sSpecAbil)
    	if not sSpecAbil then
    		return false
    	end
    
    	local sLowerSpecAbil = string.lower(sSpecAbil)
    	
    	for _,vNode in pairs(DB.getChildren(nodeChar, 'specialabilitylist')) do
    		local sSpecAbilName = string.lower(DB.getValue(vNode, 'name', ''))
    		if string.match(string.lower(sSpecAbilName), string.lower(sLowerSpecAbil)) then
    			return true
    		end
    	end
    	
    	return false
    end
    
    ---	This function checks for special attacks in an NPC (bmos)
    function hasSpecialAttack(nodeNPC, sSpecAtk)
    	if not sSpecAtk then
    		return false
    	end
    	
    	local sSpecAtks = DB.getValue(nodeNPC, 'specialattacks', '')
    	if string.match(string.lower(sSpecAtks), string.lower(sSpecAtk)) then
    		return true
    	end
    	
    	return false
    end
    added (after section with comment "-- Get the crit threshold" and before "rAction.nFirstDie = 0;"):
    Code:
    	-- Check for Always a Chance (Ex) special ability (bmos)
    	local nodeChar, nodeNPC
    	local bNoFumble = false
    	local sAaC = 'Always a Chance'
    	if bIsSourcePC then
    		nodeChar = ActorManager.getCreatureNode(rSource)
    		bNoFumble = hasSpecialAbility(nodeChar, sAaC)
    	elseif rSource then
    		nodeNPC = DB.findNode(rSource['sCTNode'])
    		bNoFumble = hasSpecialAttack(nodeNPC, sAaC)
    	end
    changed this:
    Code:
    	elseif rAction.nFirstDie == 1 then
    to this:
    Code:
    	elseif not bNoFumble and rAction.nFirstDie == 1 then
    That works. Thanks you bmos.
    Attached Files Attached Files

    These are the modules and extensions created and/or taken over by dellanx for PFRPG.

    I had a lot of help and advice from many here at FG.

    Thank You!

Thread Information

Users Browsing this Thread

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in