diff --git a/lib/bcdice/game_system/StellarKnights.rb b/lib/bcdice/game_system/StellarKnights.rb index 36cc0adf0..356619123 100644 --- a/lib/bcdice/game_system/StellarKnights.rb +++ b/lib/bcdice/game_system/StellarKnights.rb @@ -95,12 +95,15 @@ def eval_game_system_specific_command(command) # @param [Integer | nil] defence # @param [String] dice_change_text # @param [String] command - # @return [String] + # @return [Result, String] def resolute_action(num_dices, defence, dice_change_text, command) dices = @randomizer.roll_barabara(num_dices, 6).sort dice_text = dices.join(",") output = "(#{command}) > #{dice_text}" + if dices.empty? + return output + "ダイスが 0 個です(アタック判定が発生しません)" + end # FAQによると、ダイスの置き換えは宣言された順番に適用されていく dice_change_rules = parse_dice_change_rules(dice_change_text) diff --git a/test/data/StellarKnights.toml b/test/data/StellarKnights.toml index e2b7008fd..ea7934152 100644 --- a/test/data/StellarKnights.toml +++ b/test/data/StellarKnights.toml @@ -9,6 +9,12 @@ rands = [ { sides = 6, value = 4 }, ] +[[ test ]] +game_system = "StellarKnights" +input = "0SK" +output = "(0SK) > ダイスが 0 個です(アタック判定が発生しません)" +rands = [] + [[ test ]] game_system = "StellarKnights" input = "5SK3" @@ -33,6 +39,12 @@ rands = [ { sides = 6, value = 2 }, ] +[[ test ]] +game_system = "StellarKnights" +input = "0SK6" +output = "(0SK6) > ダイスが 0 個です(アタック判定が発生しません)" +rands = [] + [[ test ]] game_system = "StellarKnights" input = "3SK,1>6" @@ -81,6 +93,18 @@ rands = [ { sides = 6, value = 6 }, ] +[[ test ]] +game_system = "StellarKnights" +input = "0SK,1>6" +output = "(0SK,1>6) > ダイスが 0 個です(アタック判定が発生しません)" +rands = [] + +[[ test ]] +game_system = "StellarKnights" +input = "0SK4,1>6" +output = "(0SK4,1>6) > ダイスが 0 個です(アタック判定が発生しません)" +rands = [] + [[ test ]] game_system = "StellarKnights" input = "TT"