Archived
1
0
Fork 0

Update dice.py

This commit is contained in:
Nattiden 2023-02-25 11:16:04 +08:00 committed by GitHub
parent 926c4ee786
commit 1fbeb39221
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,6 +41,8 @@ def GetDiceArgs(dice: str):
diceType = midstrs[0] diceType = midstrs[0]
if 'K' in midstrs[1]: if 'K' in midstrs[1]:
advantage = midstrs[2].replace('L', '-') advantage = midstrs[2].replace('L', '-')
if not len(advantage.removeprefix('-')):
advantage += '1' #K/KL后没有值默认为1
# 语法合法检定 # 语法合法检定
if not diceCount.isdigit(): if not diceCount.isdigit():
return '无效的骰子数量:' + diceCount return '无效的骰子数量:' + diceCount