Skip to content
Open
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
1 change: 1 addition & 0 deletions lib/bcdice/game_system/Arianrhod.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Arianrhod < Base
def initialize(command)
super(command)

@randomizer = BCDice::Randomizer.new(upper_limit_dice_times: 10000)
@sort_add_dice = true
@d66_sort_type = D66SortType::NO_SORT
end
Expand Down
8 changes: 6 additions & 2 deletions lib/bcdice/randomizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ class Randomizer

UPPER_LIMIT_RANDS = 10000

def initialize
def initialize(upper_limit_dice_times: UPPER_LIMIT_DICE_TIMES)
@rand_results = []
@detailed_rand_results = []
@upper_limit_dice_times = upper_limit_dice_times
end

# @return [Array<Array<(Integer, Integer)>>] ダイスの出目一覧
Expand All @@ -19,6 +20,9 @@ def initialize
# @return [Array<DetailedRandResult>]
attr_reader :detailed_rand_results

# @return [Integer] ダイスの振れる最大個数
attr_reader :upper_limit_dice_times

# 実行したダイスロールの詳細
# @!attribute [rw] kind
# @return [Symbol]
Expand All @@ -38,7 +42,7 @@ def roll_barabara(times, sides)
raise TooManyRandsError
end

if times <= 0 || times > UPPER_LIMIT_DICE_TIMES
if times <= 0 || times > @upper_limit_dice_times
return []
end

Expand Down
Loading
Loading