I have a spell macro using powercards. The intent is to have the macro calculate the save of the target and then apply the effect, whcih is +1 to the target's A.C. I am using castles & crusades which essentially has two target numbers, 12 and 18, depending on if an attribute is a prime or not. This spell depends on the target failing its save against illusion. Overall the macro works very well, except it applies the chatsetattr effect twice. I need it to be applied if the target fails based on prime or not status of intelligence.
This is my code.
!power {{
--bgcolor|#1c4587
--erowbg|F1F1D4
--orowbg|#b6d7a8
--name|Dragon Armor
--tokenid|@{selected|token_image}
--emote|**Anáil nathrach, ortha bháis is beatha, do chéal déanaimh**
--leftsub|**R:** T **CT:** 1 **D:** @{selected|Spell-Strength} Minute(s) **C:** VSM
--Effect:| The spell places the illusion of plate armor on **@{target|token_name}**. **@{target|token_name}** moves and sounds like they have plate armor, but are not encumbered by the illusion.
--Result:| If Save is failed, **@{target|token_name}** increase their Armor Class by [[ 1 ]]!
--@{target|token_name} Save Roll:| [[ [$Save] 1d20 +2 +@{target|IntelligenceMod} + @{target|Level} + @{target|Protection} + ?{Challenge Level|0} -@{selected|Spell-Strength} ]] **Prime:** @{target|IntelligencePrime}
--soundfx|_audio,play,nomenu|charm of making
--?? @{target|IntelligencePrime} == Yes AND $Save >= 12 ?? Success: | You have **MADE** your save!
--?? @{target|IntelligencePrime} == No AND $Save >= 18 ?? Success: | You have **MADE** your save!
--?? @{target|IntelligencePrime} == Yes AND $Save <= 11 ?? Failure: | You have **FAILED** your save!
--?? @{target|IntelligencePrime} == No AND $Save <= 17 ?? Failure: | You have **FAILED** your save!
--?? @{target|IntelligencePrime} == Yes AND $Save <= 11 ??api_setattr|_name @{target|token_name} _mod _A.C.|1 _silent
--?? @{target|IntelligencePrime} == No AND $Save <= 17 ??api_setattr|_name @{target|token_name} _mod _A.C.|1
--api_setattr|_name @{selected|token_name} _mod _numspells_1|-1
--Spell Inventory: |**@{selected|token_name}** has [[ @{selected|numspells_1} -1 ]] 1st level spell(s) remaining!
}}
This is how it looks.