Skip to content

v4.2.9

Choose a tag to compare

@Croebh Croebh released this 22 Feb 18:59
· 882 commits to master since this release
a1982cb

New Feature - Starred Operator in Draconic

  • The Starred operator is now available in Draconic, for all your func(*args, **kwargs) and other assignment needs (Thank you @Infinidoge  and @LazyDope!)
>>> # normal call with separate arguments
>>> {{range(3, 6)}}
[3, 4, 5]
>>> # call with arguments unpacked from a list
>>> {{args = [3, 6]}}
>>> {{range(*args)}}
[3, 4, 5]

>>> # normal call with separate kwargs
>>> {{vroll(dice="1d12+8", multiply=2, add=1)}}
3d12 (4, 9, 8) + 8 = `29`
>>> # call with kwargs unpacked from a dict
>>> {{dice_args = {"dice": "1d12+8", "multiply": 2, "add": 1} }}
>>> {{vroll(**dice_args)}}
3d12 (2, 11, 4) + 8 = `25`

Notable Difference
Assigning to a starred variable outside of a tuple or list in Python throws a SyntaxError, but is valid in Draconic:

Python

>>> *a = [1, 2, 3]
SyntaxError: starred assignment target must be in a list or tuple

Draconic

>>> {{*a = [1, 2, 3]}}
>>> {{a}}
[1, 2, 3]

Improvements

  • Adjust how long descriptions are handled in lookup embeds
  • Added .attacks and .buttons to SimpleEffect
  • Added include_total as an argument for parse_coins(), defaulting to True
  • Better handling of duplicate attacks, offhand weapons, and martial arts unarmed strike naming from DDB sheets
  • Renamed the counter for Rages as imported by Dicecloud v1, to match the expected counter name used by the actions (This may result in a second counter being named, sorry about that!)

Bug Fixes

  • Fixed displayName in Roll effects deleting itself after the first use
  • Various backend fixes and improvements