PDA

View Full Version : Always A Chance



dellanx
October 5th, 2020, 05:56
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/ (https://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.

Moon Wizard
October 5th, 2020, 06:50
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

dellanx
October 5th, 2020, 23:39
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!

bmos
October 6th, 2020, 02:42
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 (https://www.fantasygrounds.com/forums/showthread.php?62480-Always-A-Chance&p=547350&viewfull=1#post547350) (the version attached to this #4 only adds it for PCs)

dellanx
October 6th, 2020, 10:27
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):


--- 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;"):

-- 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:

elseif rAction.nFirstDie == 1 then
to this:

elseif not bNoFumble and rAction.nFirstDie == 1 then

bmos you are awesome. I also added your changed to Full OverlayPackage.ext

Thanks!

39984

dellanx
October 6th, 2020, 10:34
bmos you are awesome. I also added your changed to Full OverlayPackage.ext

Thanks!

39984

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

Thanks

39986

bmos
October 6th, 2020, 12:38
removed as there is a bug. see post 9 for new version (Combat Expertise; ATK: -3 melee; AC: 3 dodge, melee).

dellanx
October 6th, 2020, 13:01
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):

--- 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;"):

-- 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:

elseif rAction.nFirstDie == 1 then
to this:

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!

bmos
October 11th, 2020, 02:05
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):

--- 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;"):

-- 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:

elseif rAction.nFirstDie == 1 then
to this:

elseif not bNoFumble and rAction.nFirstDie == 1 then


See more information in this thread:
https://www.fantasygrounds.com/forums/showthread.php?63412-Hard-to-Kill-(Ex)-in-the-heat-of-battle-often-forgoten&p=557351&viewfull=1#post557351

dellanx
October 11th, 2020, 09:06
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):

--- 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;"):

-- 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:

elseif rAction.nFirstDie == 1 then
to this:

elseif not bNoFumble and rAction.nFirstDie == 1 then

That works. Thanks you bmos.