So I'm trying to make a macro to modify a token's properties based on an input value and properties from a second token.
Where am I going wrong in my code? (the only thing currently missing is the SS value which is from an input and will be added later
"SS|0|Spell Slot Level | TEXT | WIDTH=4")]
[H: abort(success)]
[h: '<!-- Notes -->']
[h: Clay = if(SS>2,strformat(
"Clay Armor: All BPS Damage is reduced by 3 (3rd Level Spell Slot)%n"
),"")]
[h: Resistance = if(SS>3,strformat(
"Magic Resistance: Adv on all Saves v. hostile spells/magic effects)%n"
),"")]
[h: Resolute = if(SS>4, strformat(
"Resolute Presence: Allies w/in 10' gain +3 to all Saves (does not stack with Paladin's Aura of Protection)%n"
),"")]
[h:Bonus = if(SS>4, 3, 0)]
[h: Colossi = if(SS>6, strformat(
"Colossi: Golem ignores difficult terrain, has a reach of 10', deals double damage to objects, and may cast Erupting Earth 3x before a long rest.%n"
),"")]
[h:Reach = if(SS>6, " (10')","")]
[h: '<!-- Get Master Properties -->']
[h: Master = getProperty("Owner")]
[h: PCLvl = getProperty("Level", Master)]
[h: PB = getProperty("Proficiency Bonus", Master)]
[h: Langs = getProperty("Languages", Master)]
[h: SABonus = getProperty("Spell Attack Bonus", Master)]
[h: '<!-- Variable Assignment/Math -->']
[h: SSBonus = if(SS>1, SS, 0)]
[h: AC = BaseAC+floor(SSBonus/2)]
[h: STR = STRMod+floor(SSBonus/2)]
[h: CON = CONMod+floor(SSBonus/2)]
[h: Athletics = PB+STR]
[h: StrSave = PB+STR+Bonus]
[h: ConSave = PB+CON+Bonus]
[h: ToHit = SABonus]
[h: '<!-- Update Token Properties -->']
[h: setProperty("HPMax", PCLvl*6 + (SS*3))]
[h: setProperty("HP", PCLvl*6 + (SS*3))]
[h: setProperty("Languages", Langs)]
[h: setProperty("AC", AC)]
[h: '<!-- Multi Attack -->']
[h: MultiMath1 = floor(SS/2)]
[h: Multi = if(MultiMath1 >3, 3,
if(MultiMath1 < 1, 1,
MultiMath1)
)]
[h: Multiattack = strFormat("{Multi}x Multi")]
[h: setProperty("Weapon1", Multiattack)]
[h: '<!-- Slam Damage -->']
[h: DMGAvg = 4+STR]
[h: MagicSlam = if(SS>2, "(Magical)","")]
[h: Slam = strFormat("+%{ToHit} To Hit%{Reach}; %{DMGAvg} (1d8+ %{STR})/B %{MagicSlam}")]
[h: setProperty("Weapon2", Slam)]
[h: '<!-- Update Notes -->']
[h: Notes = strFormat("%{Clay} %{Resistance} %{Resolute} %{Colossi}"]
[h: setNotes(Notes)]
[h, if(SS < 4), CODE:{
[h:setSize(0)]
}
]
[h, if(SS > 3 && SS < 7), CODE:{
[h:setSize(2)]
}
]
[h, if(SS > 6), CODE:{
[h:setSize(4)]
}
]```