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 critical hits cause maximum damage #63

Closed phylll closed 5 months ago

phylll commented 2 years ago

House rule: critical hits that succeed (i.e. not defended with a critical success) cause maximum damage rather than the damage rolled by the attacker. For a weapon causing 1d6+2, for example, and an additional damage bonus of +1, each successful critical hit will cause 6+2+1=9 damage to the target.

Requires https://github.com/michael-buschbeck/mychs-macro-magic/issues/207

phylll commented 2 years ago

Implementation:

In m3mgdExchangeStoreAttack(), add to the section where attackDamage is stored:

!mmm     set maxDamage = maxRoll(script.weaponDamageExpr) + script.weaponDamageBonus
!mmm     if setattrmax(dataExchangeID, m3mgdAttrAttackDamage, maxDamage) == maxDamage
!mmm       set storeCounter = storeCounter + 1
!mmm     end if

defense can then pull this information and use it in case of a successful critical hit.

phylll commented 2 years ago

Blocked by https://github.com/michael-buschbeck/mychs-macro-magic/issues/207

phylll commented 5 months ago

Unblocked this by the most inelegant solution imaginable, see commit 615a8d39c6d0273f4a065b6e9c3d497e2987afd4

phylll commented 5 months ago

405ef3d701dc2c34ceeabcadf3c274c0f0a265c7 implements this more transparently, not during data pass-through as suggested above but during damage calculation in the attack scripts where the modified damage can be properly displayed to the players, as well.