Code: Select all
[COUNT(numberOfHits, ""),CODE:
{
<br>
[h: didCrit = 0]
[h: hitLocation = 1d100]
[h: critDamage = ""]
[h:switchToken(targetName)]
[h: armor = if(hitLocation >= 1 && hitLocation <= 10, armorHead, armor)]
[h: armor = if(hitLocation >= 11 && hitLocation <= 20, armorRightArm, armor)]
[h: armor = if(hitLocation >= 21 && hitLocation <= 30, armorLeftArm, armor)]
[h: armor = if(hitLocation >= 31 && hitLocation <= 70, armorBody, armor)]
[h: armor = if(hitLocation >= 71 && hitLocation <= 85, armorRightLeg, armor)]
[h: armor = if(hitLocation >= 86 && hitLocation <= 100, armorLeftLeg, armor)]
[h: clearRolls()]
[h: penetration = armor - weaponPen]
[h:switchToken(currentT)]
[h: damageByWeapon = eval(getProperty("Weapon1Damage"))]
[r: rollList = getRolled()]
[r: listContains(rollList, 10)]
[r: didCrit = if(listContains(getRolled(), 10) > 0, 1, didCrit)]
[h: remainingArmor = if(penetration > 0, penetration, 0)]
<!-- output -->
[h:switchToken(targetName)]
[r: "The "]
[r: weaponName]
[r: " deals "]
<b><font color="blue">[r: damageByWeapon - (remainingArmor + TB)]</color></b>
[r: " "]
<b><font color="green">[r: damageType]</color></b>
[r: " to target's "]
[r: if((hitLocation >= 1 && hitLocation <= 10),"head.","")]
[r: if((hitLocation >= 11 && hitLocation <= 20),"right arm.","")]
[r: if((hitLocation >= 21 && hitLocation <= 30),"left arm.","")]
[r: if((hitLocation >= 31 && hitLocation <= 70),"body.","")]
[r: if((hitLocation >= 71 && hitLocation <= 85),"right leg.","")]
[r: if((hitLocation >= 86 && hitLocation <= 100),"left leg.","")]
[h: critPreText = "Sadly, there was no Righteous Fury"]
[h: critPostText = " in this attack."]
[h, if(didCrit == true), code:
{
[h: critDamage = roll(1, 5)]
[h: critPreText = "The " + weaponName + " also deals "]
[h: critPostText = " critical " + damageType + " to target's "]
[h: critPostText = if((hitLocation >= 1 && hitLocation <= 10), critPostText + "head.",critPostText)]
[h: critPostText = if((hitLocation >= 11 && hitLocation <= 20), critPostText + "right arm.",critPostText)]
[h: critPostText = if((hitLocation >= 21 && hitLocation <= 30), critPostText + "left arm.",critPostText)]
[h: critPostText = if((hitLocation >= 31 && hitLocation <= 70), critPostText + "body.",critPostText)]
[h: critPostText = if((hitLocation >= 71 && hitLocation <= 85), critPostText + "right leg.",critPostText)]
[h: critPostText = if((hitLocation >= 86 && hitLocation <= 100), critPostText + "left leg.",critPostText)]
};{""}]
<br>
[r: critPreText]
<b><font color="red">[r: critDamage]</color></b>
[r: critPostText]
}]
the first few numbers before the sentence are just giving me a view as to what is being seen.
[10, 6] = numbers rolled on 2d10
first 0 = number of 10's in the list
second 0 = should be one if there are any 10's in the list.