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

[Hunter:the Reckoning 5th] Desperation ダイスのリミット実装 #650

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/bcdice/game_system/HunterTheReckoning5th.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ def eval_game_system_specific_command(command)

desperaton_dice_pool = m[DESPERATION_DICE_INDEX]&.to_i
if desperaton_dice_pool
if desperaton_dice_pool > 5
return "Desperationダイス指定は5ダイスが最大です。"
end

desperaton_dice_text, desperaton_success_dice, desperaton_ten_dice, desperaton_botch_dice = make_dice_roll(desperaton_dice_pool)

ten_dice += desperaton_ten_dice
Expand Down
30 changes: 30 additions & 0 deletions test/data/HunterTheReckoning5th.toml
Original file line number Diff line number Diff line change
Expand Up @@ -792,3 +792,33 @@ rands = [
{ sides = 10, value = 6 },
{ sides = 10, value = 6 },
]

# 不正コマンド確認
# 5ダイスを超えるDesperationダイス
[[ test ]]
game_system = "HunterTheReckoning5th"
input = "3HRF6+6"
output = "Desperationダイス指定は5ダイスが最大です。"
rands = [
{ sides = 10, value = 4 },
{ sides = 10, value = 10 },
{ sides = 10, value = 10 },
{ sides = 10, value = 10 },
{ sides = 10, value = 3 },
{ sides = 10, value = 10 },
]

# 5ダイスちょうどのDesperationダイス
[[ test ]]
game_system = "HunterTheReckoning5th"
input = "3HRF1+5"
output = "(1D10+5D10) > [4]+[6,6,5,3,10] 成功数=3 難易度=3 差分=0:判定成功!"
success = true
rands = [
{ sides = 10, value = 4 },
{ sides = 10, value = 6 },
{ sides = 10, value = 6 },
{ sides = 10, value = 5 },
{ sides = 10, value = 3 },
{ sides = 10, value = 10 },
]
Loading