Skip to content

Commit

Permalink
Fixed: Performance optimizations; Fix heal as damage
Browse files Browse the repository at this point in the history
  • Loading branch information
rhagelstrom committed Oct 27, 2022
1 parent 923687f commit 8e94b6f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Arcane Ward

**Current Version:** 1.10
**Updated::** 09/19/22
**Updated::** 10/27/22

Arcane Ward is Fantasy Grounds extension for 5E that automates the School of Abjuration trait Arcane Ward. Also mostly automates legacy NPCs with the trait Arcane Ward. This extension also helps automate and track spell/pact slot usage. This extension is useful even if no one in the party is an Abjuration Wizard.

Expand Down
4 changes: 2 additions & 2 deletions extension.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<root release="3.0" version="3">
<announcement text="Arcane Ward v1.10\rby Ryan Hagelstrom\rContribution Zarestia 2022" font="emotefont" icon="ArcaneWard"/>
<announcement text="Arcane Ward v1.11\rby Ryan Hagelstrom\rContribution Zarestia 2022" font="emotefont" icon="ArcaneWard"/>
<properties>
<!-- Loadorder has to be 141 to sit between CA and SAI -->
<loadorder>141</loadorder>
<name>Feature: Arcane Ward</name>
<version>1.10</version>
<version>1.11</version>
<author>Ryan Hagelstrom</author>
<description>Automates Arcane Ward Trait</description>
<ruleset>
Expand Down
14 changes: 8 additions & 6 deletions scripts/arcane_ward.lua
Original file line number Diff line number Diff line change
Expand Up @@ -260,19 +260,21 @@ end


function customApplyDamage(rSource, rTarget, rRoll)
if not rSource or not rTarget or not rRoll then
if not rSource or not rTarget or not rRoll or rRoll.sType ~= "damage" then
return applyDamage(rSource, rTarget, rRoll)
end
-- Get the effects on source, determine. is arcane ward. determine source
local aArcaneWardEffects = getEffectsByType(rTarget, "ARCANEWARD")
if next(aArcaneWardEffects) then
local ctEntries = CombatManager.getCombatantNodes()
for _, nodeCT in pairs(ctEntries) do
local rActor = ActorManager.resolveActor(nodeCT)
if hasArcaneWard(rActor) then
for _, rEffect in pairs(aArcaneWardEffects) do
if rEffect.source_name == rActor.sCTNode then
arcaneWard(rSource, rActor, rRoll)
if not CombatManager.isCTHidden(nodeCT) then
local rActor = ActorManager.resolveActor(nodeCT)
if hasArcaneWard(rActor) then
for _, rEffect in pairs(aArcaneWardEffects) do
if rEffect.source_name == rActor.sCTNode then
arcaneWard(rSource, rActor, rRoll)
end
end
end
end
Expand Down

0 comments on commit 8e94b6f

Please sign in to comment.