Simple West End Games Ghostbusters Roll Macro

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
Meldovni
Kobold
Posts: 1
Joined: Wed Sep 28, 2016 12:02 pm

Simple West End Games Ghostbusters Roll Macro

Post by Meldovni »

I did a forum search and didn't see one already done, so I'm posting the one I made, because I wanted to share it. I'm sure it had basis on something else, but don't remember what I cobbled it together from.

Code: Select all

<!-- Bring up the dice pool prompt to fill the pool variable and let it be smoothly canceled. -->
[h:query=input("pool|1|Dice Pool|Text|")]
[h:abort(query)]

<!-- Lower the dice pool by 1 to make room for the ghost die. -->
[h:pool=pool -1]

<!-- Collect pool rolls individually for later reporting and add them up. -->
[h: listOfRolls = ""]
[h: sum = 0]
[h, count(pool), code: {
    [t: r = roll(1, 6)]
    [h: sum = sum+r]
    [h: listOfRolls = listAppend(listOfRolls, r," + ")]
}]

<!-- Add the ghost die back in and derive the final roll total. -->
[h:ghost=1d6-1]

<!-- Determine if a ghost is rolled, output text, and total it all. -->
[h,if(ghost == 0): output="You rolled a ghost!"; output=""]
[h,if(ghost == 0): GDC="#FF5555"; GDC="#55FF55"]
[h: sum = sum+ghost]
You rolled <b style="background-color:#eeeeee;"> [r: listOfRolls] </b>
+
<b style="background-color:[r: GDC];">[t:ghost]</b> = [r: sum].
<br><b style="background-color:#FF5555;">[r:output]</b>

Post Reply

Return to “Macros”