phylll / mychs-macro-magic

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

Combat scripts should allow manual entry of rolls to reuse misconfigured rolls #61

Closed phylll closed 2 years ago

phylll commented 2 years ago

When an attack or defense roll is mistakenly configured and needs to be repeated, the same actual rolls (the dice results) should be used.

Special case: the GM sometimes simply wants to redo exactly the same roll, kind of the reverse use case, to e.g. get rid of an ill-timed critical result. A "reroll" button right next to the approval button could be the UI for the GM to repeat exactly the same roll with all modifiers, the same attacker and target and weapon with a single click.

phylll commented 2 years ago

Here's the combined (but trimmed for redundancies) customize block for a regular attack the rolls of which I might want to reuse:

!mmm customize
!mmm   set cOwnID="-Mvd7ekEU8e_h0LcB-BY"
!mmm   set cTargetID="@{target|Angriffsziel|token_id}"
!mmm   set cSemiManualModifiers=?{Standard-Angriffsmodifikatoren|Keine +/-0,?{Keine +/-0 +/-...|Echt keine +/-0,1|Von oben 70cm+ +2,2|Ziel liegt/ich stehe +4,3|Ziel wehrlos/überrascht +4,5|Ziel flieht panisch +4,7}|Spontan -4,?{Spontan -4 +/-...|Nix weiter +/-0,11|Von oben 70cm+ +2,22|Ziel liegt/ich stehe +4,33|Ziel wehrlos/überrascht +4,55|Ziel flieht panisch +4,77}|Überstürzt -6,?{Überstürzt -6 +/-...|Nix weiter +/-0,13|Von oben 70cm+ +2,26|Ziel liegt/ich stehe +4,39|Ziel wehrlos/überrascht +4,65|Ziel flieht panisch +4,91}|Völlig dunkel/geblendet -6,?{Völlig dunkel/geblendet -6 +/-...|Nix weiter +/-0,17|Von oben 70cm+ +2,34|Ziel liegt/ich stehe +4,51|Ziel wehrlos/überrascht +4,85|Ziel flieht panisch +4,119|Spontan -4,?{Keine +/-0 +/-...|Echt keine +/-0,187|Von oben 70cm+ +2,374|Ziel liegt/ich stehe +4,561|Ziel wehrlos/überrascht +4,935|Ziel flieht panisch +4,1309}|Überstürzt -6,?{Keine +/-0 +/-...|Echt keine +/-0,221|Von oben 70cm+ +2,442|Ziel liegt/ich stehe +4,663|Ziel wehrlos/überrascht +4,1105|Ziel flieht panisch +4,1547}} }
!mmm   set cManualModifiers=?{Weitere spezielle Angriffsmodifikatoren|0}
&{template} [[1d20]] {{}}
!mmm   set cAttackRoll=$[[0]]
!mmm   set cGMSilentMode=false
!mmm end customize
!mmm customize
!mmm   set cVerbose = true
!mmm   set cWeaponLabel = "Feuermal (Langschwert)"
!mmm   set cWeaponName = "Feuermal"
!mmm   set cWeaponType = "Einhandschwert"
!mmm   set cMagicExtraDamageMarker = "status_all_for_one"
!mmm   set cMagicExtraDamage = "1D6"
!mmm   set cMagicExtraDamageLabel = "✨🔥"
!mmm end customize
%{MacroSheet|meleeAttack}

Now, the only thing we need is to repeat the same through a button, while setting cAttackRoll statically to the previously rolled number (or roll(number)) and add similar parameters for the other rolls (primarily the damage roll but also the second sharpshooting roll etc.). Should be easy to implement.

For the reverse use case (keep everything but the rolls), the same applies: we need to regenerate the config block with the modifiers and target params set statically, and either redo (3D rolls for players) or leave the rolls to the main script. Piece of 🍰!

phylll commented 2 years ago

Reusing previous rolls is implemented for meleeAttack in 85732b38aa683eeae3d69fe894294fee148d0bc6 and, with some bugs fixed, for rangedAttack and defense, as well, by 41f70be4cdfdeb2e59c699870b026eda0d7946b5

phylll commented 2 years ago

Rerolling with constant modifiers, for the GM, implemented in eff8cb9f143df966f77b5ed4451829f2b08a829e