Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

詳細なダイスロール結果の出力 #4

Merged
merged 2 commits into from
Mar 29, 2020
Merged

詳細なダイスロール結果の出力 #4

merged 2 commits into from
Mar 29, 2020

Conversation

ysakasin
Copy link
Member

BCDice Ver2.04.00にて詳細なダイス出力に対応された。このPRでは、その機能に追従する。

内容

  • BCDice Ver2.04.00へのアップデート
  • BCDice#detailedRands を追加
    • BCDiceの CgiDiceBot#detailed_rand_results へのalias
    • 関数名はBCDice#randsの形式と統一した

実行ログ

// examples/test.ts

import BCDice from '..';
import '../lib/diceBot/Cthulhu7th';

const bcdice = new BCDice();
const [result, rands] = bcdice.roll('CC1', 'Cthulhu7th');

console.log(result);
console.log(rands);
console.log(bcdice.detailedRands)
$ npx ts-node examples/test.ts

Cthulhu7th : (1D100) ボーナス・ペナルティダイス[1] > 45, 85 > 45
[ [ 5, 10 ], [ 4, 10 ], [ 8, 10 ] ]
[
  { kind: 'normal', sides: 10, value: 5 },
  { kind: 'tens_d10', sides: 10, value: 40 },
  { kind: 'tens_d10', sides: 10, value: 80 }
]

Ref.

@ysakasin ysakasin requested a review from esnya March 27, 2020 10:12
Copy link
Member

@esnya esnya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@esnya esnya merged commit 3208e15 into master Mar 29, 2020
@esnya esnya deleted the detailed_rands branch March 29, 2020 08:34
gameName: diceBot.gameName,
gameName: diceBot.id,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここ id に変わっていますが何か理由がありますか?
(ダイスボットを選択するUIの表示が全部 id になってしまう気がして)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref. #5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants