Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Help with macro for Cthulhu

January 21 (3 weeks ago)

Hi all

This is a macro I have to manage attack and damage rolls for Shotguns in Call of Cthulhu (in this case a particular model of shotgun). It is based on a macro created by someone that I just tampered with (apologies, not sure who the original author was, but not me).

The macro runs nicely: it first displays a menu to select the range (10m, 20m, 50m), and based on the range the damage roll is calculated accordingly (4d6, 2d6, and 1d6 respectively).

The issue is the damage calculation for extreme attack rolls. You may not be familiar with CoC, but when you roll 1/5th or less of the attack skill roll needed to it you deal extra damage. For shotguns as non-impaling weapons this is the maximum damage, no roll needed. This will then be 24hp at 10m, 12hp at 20m and 6hp at 50m

The issue is that I have no clue on how to configure extreme damage to be dependant on the initial range selected. Probably the range selection only applies to the normal damage section. The macro just defines an extreme damage of 24, irrespectively of the range selected.

Probably it is easy to solve, but I'm afraid my programming skills are limited.

if anyone could help that would be appreciated

This is the macro:

@{selected|token_name} 

@{selected|roll_whisper} &{template:callofcthulhu} {{name=@{selected|character_name}}} {{title=shotgun}} @{selected|roll_option} {{roll=[[1d100cs<1cf>100]]}},{{roll_type=[[1]]}},{{roll_target=[[floor(@{selected|rifle_shotgun}/@{selected|dice_toggle}}},{{roll_half=[[floor(@{selected|rifle_shotgun}/2)]]}},{{roll_fifth=[[floor(@{selected|rifle_shotgun}/5)]]}},{{roll_fifth_1=[[floor(@{selected|rifle_shotgun}/5)+1]]}},{{roll_malfunction=[[100]]}} {{weapon_name=12 gauge Shotgun 2 barrels}} {{weapon_damage=[[?{distance|10m, 4d6| 20m, 2d6| 50m, 1d6}]]}} {{weapon_damage_extreme=[[ 24 ]]}}{{weapon_range=10m | 20m | 50m}} {{weapon_attacks=1|2}} {{text=}} {{roll_bonus=[@{selected|translation_bonuspenalty}](~@{selected|character_id}|bonus)}}





January 21 (3 weeks ago)
GiGs
Pro
Sheet Author
API Scripter

would encoding it as a tag work?

 {{weapon_damage=[[?{distance|10m, 4d6[24]| 20m, 2d6[12]| 50m, 1d6[6]}]]}}
January 21 (3 weeks ago)

Try replacing

{{weapon_damage=[[?{distance|10m, 4d6| 20m, 2d6| 50m, 1d6}]]}} {{weapon_damage_extreme=[[ 24 ]]}}

with

{{weapon_damage=[[?{distance|10m, 4d6]]&rbrace;&rbrace; {{weapon_damage_extreme=[[ 24| 20m, 2d6]]&rbrace;&rbrace; {{weapon_damage_extreme=[[ 12| 50m, 1d6]]&rbrace;&rbrace; {{weapon_damage_extreme=[[ 6} ]]}}
January 21 (3 weeks ago)
timmaugh
Pro
API Scripter

Tricky, tricky, Tuo.

I'd forgotten about encoding part of the roll template into the query, too.

I sometimes get so used to being able to solve something with a script that I forget tricks like this!

Rather than adding stuff to the query, you could move the 'd6' out to the roll. Then your query is just a number you can multiply.

{{weapon_damage=[[?{distance|10m, 4| 20m, 2| 50m, 1}d6]]}} {{weapon_damage_extreme=[[ ?{distance}*6 ]]}}
January 22 (3 weeks ago)

Thank you all for the answers

Enconding it as a tag does not seem to work: o extreme damage is displayed

The other 2 options work like a dream

Thank you again