Thread: PFRPG Ammunition Manager
-
December 6th, 2020, 17:42 #11
Ammunition Manager v1.9 now automates blind-fight's re-roll-on-miss function for players and NPCs.
The special circumstance of blink is not included in the automation at this time.
EDIT: this is not quite right by the rules. will continue working on it.
Kelrugem, perhaps you can bring this into your extension?
I add my special ability search function:
Code:--- This function checks NPCs and PCs for special abilities. local function hasSpecialAbility(rActor, sSearchString, bFeat, bTrait, bSpecialAbility, bEffect) if not rActor or not sSearchString then return false end local nodeActor = rActor.sCreatureNode; if bEffect and EffectManager35E.hasEffectCondition(rActor, sSearchString) then return true end local sSearchString = string.lower(sSearchString); local sSearchString = string.gsub(sSearchString, '%-', '%%%-'); if ActorManager.isPC(nodeActor) then if bFeat then for _,vNode in pairs(DB.getChildren(nodeActor .. '.featlist')) do local sFeatName = StringManager.trim(DB.getValue(vNode, 'name', ''):lower()); if sFeatName and string.match(sFeatName, sSearchString .. ' %d+', 1) or string.match(sFeatName, sSearchString, 1) then return true end end end if bTrait then for _,vNode in pairs(DB.getChildren(nodeActor .. '.traitlist')) do local sTraitName = StringManager.trim(DB.getValue(vNode, 'name', ''):lower()); if sTraitName and string.match(sTraitName, sSearchString .. ' %d+', 1) or string.match(sTraitName, sSearchString, 1) then return true end end end if bSpecialAbility then for _,vNode in pairs(DB.getChildren(nodeActor .. '.specialabilitylist')) do local sSpecialAbilityName = StringManager.trim(DB.getValue(vNode, 'name', ''):lower()); if sSpecialAbilityName and string.match(sSpecialAbilityName, sSearchString .. ' %d+', 1) or string.match(sSpecialAbilityName, sSearchString, 1) then return true end end end else local sSpecialQualities = string.lower(DB.getValue(nodeActor .. '.specialqualities', '')); local sSpecAtks = string.lower(DB.getValue(nodeActor .. '.specialattacks', '')); local sFeats = string.lower(DB.getValue(nodeActor .. '.feats', '')); if bFeat and string.find(sFeats, sSearchString) then return true elseif bSpecialAbility and (string.find(sSpecAtks, sSearchString) or string.find(sSpecialQualities, sSearchString)) then return true end end return false end
Code:if nTotal <= nMissChance then rMessage.text = rMessage.text .. " [MISS]"; removeVar = true; if rTarget then rMessage.icon = "roll_attack_miss"; ActionAttack.clearCritState(rSource, rTarget); -- KEL Adding Save Overlay if rRoll.actionStuffForOverlay == "true" then TokenManager2.setSaveOverlay(ActorManager.getCTNode(rTarget), -3); end -- END else rMessage.icon = "roll_attack"; end else
Code:if nTotal <= nMissChance and hasSpecialAbility(rSource, "Blind-Fight", true, false, false, true) then -- bmos adding blind-fight if string.match(rMessage.text, "%[BLIND%-FIGHT%]") or string.match(rMessage.text, "%[ATTACK.*%((%w+)%)%]") ~= 'M' or (EffectManager35E.hasEffect(rTarget, "Incorporeal") and not EffectManager35E.hasEffect(rSource, "Incorporeal")) then rMessage.text = rMessage.text .. " [MISS]"; removeVar = true; if rTarget then rMessage.icon = "roll_attack_miss"; ActionAttack.clearCritState(rSource, rTarget); -- KEL Adding Save Overlay if rRoll.actionStuffForOverlay == "true" then TokenManager2.setSaveOverlay(ActorManager.getCTNode(rTarget), -3); end -- END else rMessage.icon = "roll_attack"; end else rMessage.text = rMessage.text .. " [MISS]"; removeVar = true; if nMissChance > 0 then local aMissChanceDice = { "d100" }; if not UtilityManager.isClientFGU() then table.insert(aMissChanceDice, "d10"); end local rMissChanceRoll = { sType = "misschance", sDesc = string.gsub(rMessage.text, " %[MISS%]", "") .. " [BLIND-FIGHT]", aDice = aMissChanceDice, nMod = 0, fullattack = rRoll.fullattack, actionStuffForOverlay = rRoll.actionStuffForOverlay }; ActionsManager.roll(rSource, rTarget, rMissChanceRoll); -- KEL compatibility test with mirror image handler else rMessage.icon = "roll_attack"; end end -- end bmos adding blind-fight elseif nTotal <= nMissChance then rMessage.text = rMessage.text .. " [MISS]"; removeVar = true; if rTarget then rMessage.icon = "roll_attack_miss"; ActionAttack.clearCritState(rSource, rTarget); -- KEL Adding Save Overlay if rRoll.actionStuffForOverlay == "true" then TokenManager2.setSaveOverlay(ActorManager.getCTNode(rTarget), -3); end -- END else rMessage.icon = "roll_attack"; end else
Last edited by bmos; December 7th, 2020 at 00:27.
-
December 6th, 2020, 17:50 #12My extensions for 3.5e and Pathfinder
Bug reports please here
-
December 6th, 2020, 18:26 #13
Careful as miss chance coming from incorporeality is not checked twice, and anyways only from melee (i can't read "melee" in the code, but it's also true I mostly can't understand much from in there XD)
-
December 6th, 2020, 18:55 #14
Last edited by bmos; December 6th, 2020 at 18:59.
-
December 6th, 2020, 20:21 #15
not that I know... I know Kelrugem made a "ghost touch" effect. For mage armor, I just "AC: 4 armor; IFT: TYPE (incorporeal); AC: 4 melee". The bad part is that the +4 applies against spells too.
I just tried a bunch of things, but I haven't yet been able to apply "incorporeal" to PC attacks
-
December 6th, 2020, 20:33 #16
When you are incorporeal (having that effect), then your attacks are treated as incorporeal rather change IFT: TYPE(incorporeal) to IFT: incorporeal (I think the former doesn't even work)
But just write AC: 4 armor actually (when it is not an incorporeal touch attack), incorporeal is not that automated in 3.5e in FG It just adds the miss chance but it does not ignore armor, natural armor and shield bonus types, that you still need to do manually So, until that is automated, armor bonus types are still applied and so you do not need such a complicated effect (because most incorporeal creatures do touch attacks such that one does not need that automation of AC stuff; so, accounting for touch attacks while not for spells is difficult with an effect. So, you can keep your effect, AC: 4 armor; IFT: incorporeal; AC: 4 melee, to account for touch attacks but you still need to do a lot of stuff manually for incorporeality)
I had once a "ghost" type of AC in my extension, I can add it back, seemingly it is needed for such situations
EDIT: Additionally, you could declare your incorporeal attack as touch, but may lead to a problem when the defender is also incorporeal I would need to look more closely into that, I never had anything incorporeal going on at the momentLast edited by Kelrugem; December 6th, 2020 at 21:03.
My extensions for 3.5e and Pathfinder
Bug reports please here
-
December 6th, 2020, 21:35 #17
IFT: TYPE checks for anything on the "type" string, so for a devil which has "Outsider (evil, fire, baatezu)" would trigger either or all the "IFT: TYPE (outsider)", "IFT: TYPE (evil)", "IFT: TYPE (fire)", and "IFT: TYPE (baatezu)". Also remember that in 3.5 an "evil outsider" is different than "outsider with an evil alignment"
A ghost touch armor would be useful, but kinda nasty to differentiate when you have to consider armor and shield the same way as natural armor is: FG doesn't differentiate "natural armor" from "enhancement bonus to natural armor": a character with a +1 amulet of natural armor AND having a +3 bonus to its own base natural armor forces you to script the effect as "+4 armor, natural" for it to work (adding the item bonus AND the already present +3 base)
-
December 6th, 2020, 21:44 #18
Yeah, I just looked, indeed incorporeal is also a type which can be checked Though most creatures with that type also have that condition, so, not a difference most time
About AC: Yes, one may need multiple types of armor maybe as for damage types, or simply to ghost types (the natural natural armor type is normally never changed (besides increasing HD), so, one can just treat it as misc. bonus most of the time at least I do not know of any spell or circumstance in combat where the actual naturl AC is important )
EDIT: But maybe shift the discussion, if still needed, somewhere else; poor Ammunition Manager cluttered with thatMy extensions for 3.5e and Pathfinder
Bug reports please here
-
December 7th, 2020, 00:32 #19
Add NIFTAG: spell before the IFT section, perhaps?
Yeah, there's definitely something in code for [INCORPOREAL] attacks but it might only be for NPCs. I have updated the code in that comment so that if both attacker and defender have incorporeal condition than it rolls again for blind fight as this seems to be the most reasonable ruling.Last edited by bmos; December 7th, 2020 at 11:55.
-
December 7th, 2020, 00:45 #20
cool, thanks a lot
My extensions for 3.5e and Pathfinder
Bug reports please here
Thread Information
Users Browsing this Thread
There are currently 2 users browsing this thread. (0 members and 2 guests)
Bookmarks