Skip to content

Commit

Permalink
Merge pull request #585 from Faceless192x/update-Warhammer4
Browse files Browse the repository at this point in the history
失敗時のSL0表示を+0から-0に修正
  • Loading branch information
ysakasin authored Nov 23, 2022
2 parents 71532d4 + 1e70004 commit 1dc9cbe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/bcdice/game_system/Warhammer4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ def result_1d100(total, _dice_total, cmp_op, target)
end

sl_text = format("(SL%+d)", sl)
if (sl == 0) && (total > target)
sl_text = "(SL-0)"
end

result.text += "#{sl_text}#{result_detail(sl, total, target)}"

return result
Expand Down
2 changes: 1 addition & 1 deletion test/data/Warhammer4.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ rands = [
[[ test ]]
game_system = "Warhammer4"
input = "1D100<=10"
output = "(1D100<=10) > 19 > 失敗(SL+0) > 小失敗"
output = "(1D100<=10) > 19 > 失敗(SL-0) > 小失敗"
failure = true
rands = [
{ sides = 100, value = 19 }
Expand Down

0 comments on commit 1dc9cbe

Please sign in to comment.