Macro for 5e Elemental Adept (1s to 2s)

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
Wolfinton
Kobold
Posts: 3
Joined: Wed Feb 17, 2021 11:58 am

Macro for 5e Elemental Adept (1s to 2s)

Post by Wolfinton »

Hi, I'm currently running as 5e maptool campaign on Discord and one of my players has taken Elemental Adept. This feat allows the player to replace 1s on their dice roll with a 2.

I am currently using the following macro, but I think I am missing something which makes the macro not work. Theoretically when I roll a 6d3, it should result in 14 but it almost always averages out below that. 2s are definitely being replaced, but I think it is then stopping the dice rolling afterwards.

Any ideas would be so helpful.

Code: Select all

[H: Total = 0]
[H: DiceNumber = MOD]
[H: DiceSize = MOD]
[H: ExpertiseTriggered = 0]
[H, C(DiceNumber, ""), CODE: {
    [CurrentRoll = eval(strformat("d%{DiceSize}"))]
    [ExpertiseTriggered = if(CurrentRoll == 1, 1, ExpertiseTriggered)]
    [IF(ExpertiseTriggered): CurrentRoll = 2]
    [Total = Total + CurrentRoll]
    [ExpertiseTriggered = 0]
}]
[Total+5]  

User avatar
aliasmask
RPTools Team
Posts: 9023
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Macro for 5e Elemental Adept (1s to 2s)

Post by aliasmask »

I'm curious as to why your diceNumber and diceSize are the same number, MOD. But you're doing a lot of extra work for nothing here.

Code: Select all

[H: total = eval(strformat("%{diceNumber}d%{diceSize}r2 +5"))]

Wolfinton
Kobold
Posts: 3
Joined: Wed Feb 17, 2021 11:58 am

Re: Macro for 5e Elemental Adept (1s to 2s)

Post by Wolfinton »

aliasmask wrote:
Wed Feb 17, 2021 12:18 pm
I'm curious as to why your diceNumber and diceSize are the same number, MOD. But you're doing a lot of extra work for nothing here.

Code: Select all

[H: total = eval(strformat("%{diceNumber}d%{diceSize}r2 +5"))]
MOD allows the players to change each of the dice, so the same macro can be used for fireball and scorching ray (changing the dice value and amount of dice)

But wow that is...a lot simplier than what I had.

Thank you so much for that!!

Wolfinton
Kobold
Posts: 3
Joined: Wed Feb 17, 2021 11:58 am

Re: Macro for 5e Elemental Adept (1s to 2s)

Post by Wolfinton »

Although does this not reroll 2s instead of replacing 1s with 2s? Sorry if I'm wrong, not 100% on macros

User avatar
aliasmask
RPTools Team
Posts: 9023
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Macro for 5e Elemental Adept (1s to 2s)

Post by aliasmask »

Ah, that would be different, replace the "r" with "l" setting the lower bound to 2 instead of rerolling. You can find dice expressions in the wiki under Dice Expressions.

But I think you missed my point. If mod is 6, then you roll 6d6. If Mod is 8 then you roll 8d8. You need 2 different variables for sides and numDice.

Post Reply

Return to “Macros”