mr-ice / maptool-macros

place for maptool macros
2 stars 3 forks source link

Jerry reads armor.ac as "overridden by DNDBeyond", #312

Closed trey-kirk-sp closed 3 years ago

trey-kirk-sp commented 3 years ago
  1. Init 30957877
  2. Inspect the token properties:

image

armor.ac should be '4':

image

We captured the override value in the BasicToon, just mis-applied it somehow:

{
  "equippedArmor":   {
    "name": "Unarmored",
    "armorClass": 10,
    "armorTypeId": 0,
    "bonus": 0,
    "armorType": "None"
  },
  "equippedShield":   {
    "name": "Shield",
    "armorClass": 2,
    "armorTypeId": 4,
    "bonus": 0
  },
  "bonus": 0,
  "bonuses":   {
    "OverridePlusDex":     {
      "typeId": 4,
      "value": 4
    },
    "MagicBonus":     {
      "typeId": 2,
      "value": 2
    },
    "MiscBonus":     {
      "typeId": 3,
      "value": 3
    }
  }
}
trey-kirk-sp commented 3 years ago

Looks like I'm doing this intentionally to mark the ac + dex value is static:

[h, if (!json.isEmpty (overridePlusDex)), code: {
    <!-- This value overrides the base AC value plus dexterity. Other custom bonuses still apply -->
    <!-- So set this value to armor.ac and override the AC formula -->
    [overrideValue = json.get (overridePlusDex, "value")]
    [setProperty ("armor.ac", "overridden by DNDBeyond")]
    [setProperty ("AC", "{" + overrideValue + " + shield.ac + bonus.ac}")]
    <!-- and override the current acBonus, that value no longer applies -->
    [asBonus = 0]
}]

But this results in the AC value being calculated correctly. Looks like I have a typo for 'asBonus', tho. I should fix that with this issue. But I think I'm gonna leave the AC calculation stuff since this is all doing what I intended it to do. Kinda sucks, but I'm not sure of a better way to do it.

trey-kirk-sp commented 3 years ago

While you're at it, fix this. Jerry's Initiative object in the BasicToon is setting proficiency WAAAY wrong:

{
  "bonus": 6,
  "proficiency": 6
}