Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
『守りたい人のために魔法を紡ぐTRPG キミトエール!』のダイスボットを作成しました。
rubocop追加済みです。git、githubともに初めてなので不備がありましたらご指摘お願いします。
書籍情報:https://bouken.jp/prod/ttrpg/754
〇実装内容
・判定
nKY6
ornKY10
の形式で実装しました。要求された判定とキャラクターのステータスによって判定ダイスの個数が変動し、かつ使用するダイスが6面もしくは10面ダイスとなるためnに入る数値でダイスの個数を、末尾の数値で使用するダイスを指定する形で実装しています。目標値は一律で4以上となるため、目標値の入力は省略しています。
4以上の出目が1つでもあれば判定は成功となり、1の目が出るとファンブル、6もしくは10(10面ダイスの場合はどちらが出てもよい)でスペシャルとなります。ファンブル時もほかに4以上の目があれば判定は成功となり、スペシャルとファンブルの両方が出た場合は共存しそれぞれを処理します。
・ランダム表
ファンブル表1つ、新しい出会い関連の表6つ、ランダム命名表8つを実装しました。新しい出会いとランダム命名表は一括振りのコマンドも実装しました。下記のとおりです。