From 96f9603e89f9c12a3d7e0f3fc760224feb26c5f9 Mon Sep 17 00:00:00 2001 From: Shane Parker Date: Sun, 10 Jul 2022 21:03:36 -0400 Subject: [PATCH 1/5] Readme typos --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 92ad5f9..9022850 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,10 @@ The following targetable Effects have been added: * **[R1]TO[R2]: types** - Damage dealt by the bearer of this effect will treat R1 as R2 for any of the damage types, where R1 and R2 may be one of ABSORB, IGNORE, RESIST, or VULN. e.g. "IMMUNETORESIST: radiant" would cause the damage dealt by a paladin's divine smite to treat radiant immunity as radiant resistance instead. * **MAKEVULN: types** - Damage dealt by the bearer of this effect will treat a creature without any sort of resistance to the damage types as if they were vulnerable. e.g. "MAKEVULN: slashing" would cause a wraith to take double damage from magic swords, but still take half damage from nonmagical, unsilvered swords. * **REDUCE: n, types** - This functions exactly as RESIST: n, except it will also stack with normal resistance. -* **UNHEALABLE: (types)** - The bearer of this effect cannot benefit from any healing of the associated types. types is optional and may be any combination of "heal", "hitdice", and "rest", seperated by commas. If types is not provided, then all types of healing are prevented. +* **UNHEALABLE: (types)** - The bearer of this effect cannot benefit from any healing of the associated types. types is optional and may be any combination of "heal", "hitdice", and "rest", separated by commas. If types is not provided, then all types of healing are prevented. * **DMGMULT: n** - The bearer of this effect has all of their damage dealt multiplied by n. * **HEALMULT: n** - The bearer of this effect has all of their healing done multiplied by n. -* **HEALEDMULT: n, (types)** - The bearer of this effect has all of their healing received multiplied by n. types is optional and may be any combination of "heal", "hitdice", and "rest", seperated by commas. If types is not provided, then all types of healing are multiplied. +* **HEALEDMULT: n, (types)** - The bearer of this effect has all of their healing received multiplied by n. types is optional and may be any combination of "heal", "hitdice", and "rest", separated by commas. If types is not provided, then all types of healing are multiplied. ## Installation Download [BlissfulIgnorance.ext](https://github.com/MeAndUnique/BlissfulIgnorance/releases) and place in the extensions subfolder of the Fantasy Grounds data folder. From c882b348c88b7b8f804dbf6f2cd9a1e186090434 Mon Sep 17 00:00:00 2001 From: Michael Baird Date: Wed, 20 Jul 2022 14:42:54 -0700 Subject: [PATCH 2/5] updated applyDamage signature --- scripts/manager_action_damage_bi.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/manager_action_damage_bi.lua b/scripts/manager_action_damage_bi.lua index 5745ee2..8d6cfd0 100644 --- a/scripts/manager_action_damage_bi.lua +++ b/scripts/manager_action_damage_bi.lua @@ -328,7 +328,7 @@ function multiplyDamage(rSource, rTarget, rDamageOutput) rDamageOutput.nVal = math.max(math.floor(rDamageOutput.nVal * nMult), 1); end -function applyDamage(rSource, rTarget, bSecret, sDamage, nTotal) +function applyDamage(rSource, rTarget, vRollOrSecret, sDamage, nTotal) if string.match(sDamage, "%[RECOVERY") or string.match(sDamage, "%[HEAL") or nTotal < 0 then @@ -358,14 +358,14 @@ function applyDamage(rSource, rTarget, bSecret, sDamage, nTotal) end end - applyDamageOriginal(rSource, rTarget, bSecret, sDamage, nTotal); + applyDamageOriginal(rSource, rTarget, vRollOrSecret, sDamage, nTotal); end -function messageDamage(rSource, rTarget, bSecret, sDamageType, sDamageDesc, sTotal, sExtraResult) +function messageDamage(rSource, rTarget, vRollOrSecret, sDamageType, sDamageDesc, sTotal, sExtraResult) if nAbsorbed < 0 then local nDamage = nAbsorbed; nAbsorbed = 0; - ActionDamage.applyDamage(rSource, rTarget, bSecret, sDamageType, nDamage); + ActionDamage.applyDamage(rSource, rTarget, vRollOrSecret, sDamageType, nDamage); else if string.match(sDamageDesc, "%[UNHEALABLE") then if sExtraResult ~= "" then @@ -377,6 +377,6 @@ function messageDamage(rSource, rTarget, bSecret, sDamageType, sDamageDesc, sTot if sMult then sExtraResult = sExtraResult .. sMult; end - messageDamageOriginal(rSource, rTarget, bSecret, sDamageType, sDamageDesc, sTotal, sExtraResult); + messageDamageOriginal(rSource, rTarget, vRollOrSecret, sDamageType, sDamageDesc, sTotal, sExtraResult); end end \ No newline at end of file From 7eb93ec2699d7d7cc2dbec5d386ed696fa396d2c Mon Sep 17 00:00:00 2001 From: Michael Baird Date: Thu, 21 Jul 2022 12:14:09 -0700 Subject: [PATCH 3/5] unbox vRollOrSecret --- scripts/manager_action_damage_bi.lua | 34 +++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/scripts/manager_action_damage_bi.lua b/scripts/manager_action_damage_bi.lua index 8d6cfd0..575ed29 100644 --- a/scripts/manager_action_damage_bi.lua +++ b/scripts/manager_action_damage_bi.lua @@ -329,6 +329,11 @@ function multiplyDamage(rSource, rTarget, rDamageOutput) end function applyDamage(rSource, rTarget, vRollOrSecret, sDamage, nTotal) + if type(vRollOrSecret) == "table" then + sDamage = vRollOrSecret.sDesc; + nTotal = vRollOrSecret.nTotal; + end + if string.match(sDamage, "%[RECOVERY") or string.match(sDamage, "%[HEAL") or nTotal < 0 then @@ -361,11 +366,34 @@ function applyDamage(rSource, rTarget, vRollOrSecret, sDamage, nTotal) applyDamageOriginal(rSource, rTarget, vRollOrSecret, sDamage, nTotal); end -function messageDamage(rSource, rTarget, vRollOrSecret, sDamageType, sDamageDesc, sTotal, sExtraResult) +function messageDamage(rSource, rTarget, vRollOrSecret, sDamageText, sDamageDesc, sTotal, sExtraResult) + local bSecret, sDamageType, rRoll; + + if type(vRollOrSecret) == "table" then + rRoll = vRollOrSecret; + + bSecret = rRoll.bSecret; + sDamageType = rRoll.sType; + sDamageText = rRoll.sDamageText; + sDamageDesc = rRoll.sDesc; + sTotal = rRoll.nTotal; + sExtraResult = rRoll.sResults; + else + bSecret = vRollOrSecret; + + if sDamageText == "Recovery" then + sDamageType = "recovery"; + elseif (sDamageText == "Heal") or (sDamageText == "Temporary hit points") then + sDamageType = "heal"; + else + sDamageType = "damage"; + end + end + if nAbsorbed < 0 then local nDamage = nAbsorbed; nAbsorbed = 0; - ActionDamage.applyDamage(rSource, rTarget, vRollOrSecret, sDamageType, nDamage); + ActionDamage.applyDamage(rSource, rTarget, vRollOrSecret, sDamageText, nDamage); else if string.match(sDamageDesc, "%[UNHEALABLE") then if sExtraResult ~= "" then @@ -377,6 +405,6 @@ function messageDamage(rSource, rTarget, vRollOrSecret, sDamageType, sDamageDesc if sMult then sExtraResult = sExtraResult .. sMult; end - messageDamageOriginal(rSource, rTarget, vRollOrSecret, sDamageType, sDamageDesc, sTotal, sExtraResult); + messageDamageOriginal(rSource, rTarget, vRollOrSecret, sDamageText, sDamageDesc, sTotal, sExtraResult); end end \ No newline at end of file From 8e417653fd9ad3cdef96eaed9f94b9c31f468ca3 Mon Sep 17 00:00:00 2001 From: Shane Parker Date: Wed, 27 Jul 2022 21:59:37 -0400 Subject: [PATCH 4/5] Minor cleanup --- scripts/manager_action_damage_bi.lua | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/scripts/manager_action_damage_bi.lua b/scripts/manager_action_damage_bi.lua index 575ed29..0085675 100644 --- a/scripts/manager_action_damage_bi.lua +++ b/scripts/manager_action_damage_bi.lua @@ -367,27 +367,12 @@ function applyDamage(rSource, rTarget, vRollOrSecret, sDamage, nTotal) end function messageDamage(rSource, rTarget, vRollOrSecret, sDamageText, sDamageDesc, sTotal, sExtraResult) - local bSecret, sDamageType, rRoll; - if type(vRollOrSecret) == "table" then - rRoll = vRollOrSecret; - - bSecret = rRoll.bSecret; - sDamageType = rRoll.sType; + local rRoll = vRollOrSecret; sDamageText = rRoll.sDamageText; sDamageDesc = rRoll.sDesc; sTotal = rRoll.nTotal; sExtraResult = rRoll.sResults; - else - bSecret = vRollOrSecret; - - if sDamageText == "Recovery" then - sDamageType = "recovery"; - elseif (sDamageText == "Heal") or (sDamageText == "Temporary hit points") then - sDamageType = "heal"; - else - sDamageType = "damage"; - end end if nAbsorbed < 0 then From e5c3b504cae41b4651c7435a0e63ae9c1fc77623 Mon Sep 17 00:00:00 2001 From: Shane Parker Date: Thu, 28 Jul 2022 09:00:26 -0400 Subject: [PATCH 5/5] Adapted to new ActionManager redistance logic --- extension.xml | 1 + scripts/manager_action_damage_bi.lua | 146 ++----------------------- scripts/manager_actor_bi.lua | 154 +++++++++++++++++++++++++++ 3 files changed, 164 insertions(+), 137 deletions(-) create mode 100644 scripts/manager_actor_bi.lua diff --git a/extension.xml b/extension.xml index d8dda91..559f11f 100644 --- a/extension.xml +++ b/extension.xml @@ -39,6 +39,7 @@ SOFTWARE.