phylll / mychs-macro-magic

A simple, sane, and friendly little scripting language for your Roll20 macros.
MIT License
0 stars 0 forks source link

Make combat data handovers more robust #64

Open phylll opened 2 years ago

phylll commented 2 years ago

Instead of a bunch of individual strings or string pairs (limited by what individual Roll20 char sheet attributes hold in their current and max fields), a more robust and versatile approach would store any type of attack (melee, ranged, magic, whatever) in a standardized but flexible struct.

Collecting across defense (✅), m3mgdDefenseDataTable() (✅) defendSnatch (✅), defendFrostball (✅), ANYTHING ELSE?, these fields are required:

Field Type current m3mgdExchange attribute Notes
attackerID tokenID (string) m3mgdAttrAttackerID
targetID tokenID (string) m3mgdAttrAttackTargetID
attackType string m3mgdAttrAttackType melee, ranged, or magic
[magicSpell] string m3mgdAttrAttackType.max
attackResult struct .roll int, total int, isSuccess bool, .isCritical bool m3mgdAttrAttackResult, m3mgdAttrAttackResult.max
attackDamageResult struct .roll int, total int m3mgdAttrAttackDamage, m3mgdAttrAttackDamageRoll
attackWeaponType string m3mgdAttrAttackWeaponType as listed in m3mgdValidAttackWeaponTypes
[attackWeaponSpecialEffect] string m3mgdAttrAttackWeaponType.max as handled by m3mgdWeaponSpecialEffect()
noDefense bool
defenseResult struct .roll int, total int, isSuccess bool, .isCritical bool, effEnduranceLoss int, effHealthLoss int, timeToDie int