From 1fd82223e61d179b3ec6a6efe715761222ee7103 Mon Sep 17 00:00:00 2001 From: SAKATA Sinji Date: Sun, 26 Mar 2023 18:59:00 +0900 Subject: [PATCH] =?UTF-8?q?=E8=8B=B1=E9=9B=84=E3=81=AE=E5=B0=BA=E5=BA=A6?= =?UTF-8?q?=20=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/bcdice/game_system.rb | 1 + lib/bcdice/game_system/HeroScale.rb | 837 +++++++++++++++++++++ test/data/HeroScale.toml | 1078 +++++++++++++++++++++++++++ 3 files changed, 1916 insertions(+) create mode 100644 lib/bcdice/game_system/HeroScale.rb create mode 100644 test/data/HeroScale.toml diff --git a/lib/bcdice/game_system.rb b/lib/bcdice/game_system.rb index 29b58f586..bad12e613 100644 --- a/lib/bcdice/game_system.rb +++ b/lib/bcdice/game_system.rb @@ -100,6 +100,7 @@ require "bcdice/game_system/GurpsFW" require "bcdice/game_system/HarnMaster" require "bcdice/game_system/HatsuneMiku" +require "bcdice/game_system/HeroScale" require "bcdice/game_system/Hieizan" require "bcdice/game_system/HouraiGakuen" require "bcdice/game_system/HuntersMoon" diff --git a/lib/bcdice/game_system/HeroScale.rb b/lib/bcdice/game_system/HeroScale.rb new file mode 100644 index 000000000..06864de0c --- /dev/null +++ b/lib/bcdice/game_system/HeroScale.rb @@ -0,0 +1,837 @@ +# frozen_string_literal: true + +module BCDice + module GameSystem + class HeroScale < Base + # ゲームシステムの識別子 + ID = 'HeroScale' + + # ゲームシステム名 + NAME = '英雄の尺度' + + # ゲームシステム名の読みがな + SORT_KEY = 'えいゆうのしやくと' + + HELP_MESSAGE = <<~TEXT + 同人TRPGシステム『英雄の尺度』用ダイスボット。 + 基本ルールブック+サプリメント対応。仮称は非対応。 + コマンド一覧は以下の通り。*添え字で内容は[]。†がついていたら添え字必須。 + 5hs4 超越 + 5hs4,b 肉体の超越 + 5hs4,s,* 科学の超越[†達成値への加算値] + 5hs4,p 激情の超越 + 4hs6 加護 + 4hs6,s 選択の加護 + 4hs6,p 安寧の加護 + 4hs6,r 逆転の加護 + 3hs8,*,* 契約[奉納の出目1,奉納の出目2] + 3hs8,a,*,* 享受の契約[†受諾出目1][†受諾出目2] + 3hs8,e,* 収奪の契約[†取得出目] + 3hs8,b 燃焼の契約 + 3hs8,o,*,* 奉納の契約[奉納の出目1,奉納の出目2] + 2hs20 呪い + 2hs20,r 歪曲の呪い + 2hs20,c 崩壊の呪い + 2hs20,d 破滅の呪い + 3hs10 異物 + 3hs10,i 模造の異物 + 3hs10,m,* 混血の異物[追加振り基準出目(初期値10)] + 3hs10,b,* 彼方の異物[追加振り停止基準値(初期値666)] + 1hs60 報い + 1hs60,d 堕落の報い + 1hs60,o 忘却の報い + 1hs60,s,* 封印の報い[出目への係数] + 12hs2 同化 + 12hs2,m,*,*,*,*,*,*,*,* 怪物の同化[*d2,*d4,*d6,*d8,*d10,*d12,*d20,*d60] + 12hs2,t,* [†2の枚数宣言] + 12hs2,c,* 法則の同化[†1の枚数宣言] + 1hs12 下位存在 + 2hs12 中位存在 + 2hs12,t 変遷の中位存在 + 2hs12,c 偶然の中位存在 + 2hs12,g,* 萌芽の上位存在[加算値] + 3hs12 上位存在 + 3hs12,g 大神の上位存在 + 3hs12,h 神性の上位存在 + 3hs12,w 魔性の上位存在 + 3hs12,m 悪意の上位存在 + 3hs12,s,* 大罪の上位存在[†確定する目標値] + 3hs12,d 破壊の上位存在 + 3hs12,a 懊悩の上位存在 + 3hs12,o 試練の上位存在 + 3hs12,c 創造の上位存在 + 3hs12,e 元素の上位存在 + *hs* 乗算ロール + TEXT + + register_prefix('\d+HS\d+') + + def eval_game_system_specific_command(command) + return select_origin(command) + end + + private + + def select_origin(command) + order = command.split(",") + + case order[0] + when "5HS4" + return origin_great(order) + when "4HS6" + return origin_protection(order) + when "3HS8" + return origin_vow(order) + when "2HS20" + return origin_curse(order) + when "3HS10" + return origin_stranger(order) + when "1HS60" + return origin_karma(order) + when "12HS2" + return origin_absorption(order) + when "1HS12" + return origin_normal() + when "2HS12" + return origin_unique(order) + when "3HS12" + return origin_omnipotent(order) + else + message = order[0] + dice = order[0].rpartition("HS") + if dice.length > 2 && dice[0] =~ /^\d+$/ && dice[2] =~ /^\d+$/ + natural_result = @randomizer.roll_barabara(dice[0].to_i, dice[2].to_i) + total = results_multiplication(natural_result) + message += " > #{total}[#{natural_result.join(',')}]" + return message + else + return nil + end + end + end + + # 超越 + def origin_great(order) + natural_result = @randomizer.roll_barabara(5, 4) + case order[1] + when "P" + message = fate_passion(natural_result) + when "S" + message = fate_science(natural_result, order) + when "B" + message = fate_body(natural_result) + else + total = results_multiplication(natural_result) + message = "超越 > #{total}[#{natural_result.join(',')}]" + end + return message + end + + def fate_passion(natural_result) + modified_result = [] + number_of_1 = natural_result.count(1) + natural_result.each do |result| + modified_result << result + number_of_1 + end + subtotal = results_multiplication(natural_result) + total = results_multiplication(modified_result) + message = "激情の超越 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + def fate_science(natural_result, order) + subtotal = results_multiplication(natural_result) + if order.length > 2 && order[2] =~ /^\d+$/ + if order[2].to_i < 1024 + total = subtotal + order[2].to_i + message = "科学の超越 > #{subtotal}[#{natural_result.join(',')}] > #{total}" + if total > 1023 + message += "(科学臨界)" + end + else + message = "エラー:科学力が1024を超えています。" + end + else + message = "エラー:科学力を設定してください。" + end + return message + end + + def fate_body(natural_result) + modified_result = natural_result.dup + modified_result.each do |result| + if result == 4 + modified_result << @randomizer.roll_once(4) + end + end + subtotal = results_multiplication(natural_result) + total = results_multiplication(modified_result) + message = "肉体の超越 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + # 加護 + def origin_protection(order) + natural_result = @randomizer.roll_barabara(4, 6) + case order[1] + when "R" + message = fate_reversal(natural_result) + when "P" + message = fate_peace(natural_result) + when "S" + message = fate_choice(natural_result) + else + total = results_multiplication(natural_result) + message = "加護 > #{total}[#{natural_result.join(',')}]" + end + return message + end + + def fate_reversal(natural_result) + modified_result = [] + natural_result.each do |result| + if result < 4 + result = 7 - result + end + modified_result << result + end + subtotal = results_multiplication(natural_result) + total = results_multiplication(modified_result) + message = "逆転の加護 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + def fate_peace(natural_result) + subtotal = results_multiplication(natural_result) + total = subtotal + 250 + message = "安寧の加護 > #{subtotal}[#{natural_result.join(',')}] > #{total}" + return message + end + + def fate_choice(natural_result) + modified_result = natural_result.dup + modified_result.concat(@randomizer.roll_barabara(3, 6)) + even_total = 1 + odd_total = 1 + modified_result.each do |result| + if result.even? + even_total *= result + else + odd_total *= result + end + end + if even_total > odd_total + total = even_total + else + total = odd_total + end + subtotal = results_multiplication(natural_result) + message = "選択の加護 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + # 契約 + def origin_vow(order) + natural_result = @randomizer.roll_barabara(3, 8) + case order[1] + when "O" + message = fate_offering(natural_result, order) + when "B" + message = fate_burning(natural_result) + when "E" + message = fate_exploitation(natural_result, order) + when "A" + message = fate_acceptance(natural_result, order) + else + subtotal = results_multiplication(natural_result) + if order.length > 2 && order[1] =~ /^\d+$/ && order[2] =~ /^\d+$/ + modified_result = natural_result.dup + modified_result << order[1].to_i + modified_result << order[2].to_i + total = results_multiplication(modified_result) + message = "契約 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + else + message = "契約 > #{subtotal}[#{natural_result.join(',')}]" + end + end + return message + end + + def fate_offering(natural_result, order) + subtotal = results_multiplication(natural_result) + if order.length > 3 && order[2] =~ /^\d+$/ && order[3] =~ /^\d+$/ + modified_result = natural_result.dup + modified_result << order[2].to_i + modified_result << order[3].to_i + total = results_multiplication(modified_result) + message = "奉納の契約 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + else + message = "奉納の契約 > #{subtotal}[#{natural_result.join(',')}]" + end + offering_result = natural_result.dup + offering_result.sort!.reverse!.shift(1) + message += "(奉納:#{offering_result.join(',')})" + return message + end + + def fate_burning(natural_result) + subtotal = results_multiplication(natural_result) + total = subtotal * 6 + message = "燃焼の契約 > #{subtotal}[#{natural_result.join(',')}] > #{total}" + return message + end + + def fate_exploitation(natural_result, order) + subtotal = results_multiplication(natural_result) + if order.length > 2 && order[2] =~ /^\d+$/ + modified_result = natural_result.dup + modified_result[modified_result.index(modified_result.min)] = order[2].to_i + total = results_multiplication(modified_result) + message = "収奪の契約 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + else + message = "エラー:収奪数を指定してください。" + end + return message + end + + def fate_acceptance(natural_result, order) + subtotal = results_multiplication(natural_result) + if order.length > 3 && order[2] =~ /^\d+$/ && order[3] =~ /^\d+$/ + change_result = natural_result.min(2) + modified_result = natural_result.dup + modified_result[modified_result.index(change_result[0])] = order[2].to_i + modified_result[modified_result.index(change_result[1])] = order[3].to_i + total = results_multiplication(modified_result) + message = "享受の契約 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + else + message = "エラー:享受数を指定してください。" + end + return message + end + + # 呪い + def origin_curse(order) + natural_result = @randomizer.roll_barabara(2, 20) + case order[1] + when "R" + message = fate_ruin(natural_result) + when "C" + message = fate_collapse(natural_result) + when "D" + message = fate_distortion(natural_result) + else + total = results_multiplication(natural_result) + message = "呪い > #{total}[#{natural_result.join(',')}]" + end + return message + end + + def fate_ruin(natural_result) + modified_result = natural_result.dup + modified_result.concat(@randomizer.roll_barabara(2, 20)) + total = 1 + modified_result.each do |result| + if result > 10 + total *= result + end + end + subtotal = results_multiplication(natural_result) + message = "破滅の呪い > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + def fate_collapse(natural_result) + modified_result = natural_result.dup + collapse_result = result_raoundup(natural_result[natural_result.index(natural_result.max)]) + if modified_result[0] == modified_result[1] + modified_result[0] = collapse_result + modified_result[1] = collapse_result + modified_result << collapse_result + modified_result << collapse_result + else + modified_result[natural_result.index(natural_result.max)] = collapse_result + modified_result.insert(natural_result.index(natural_result.max), collapse_result) + end + subtotal = results_multiplication(natural_result) + total = results_multiplication(modified_result) + message = "崩壊の呪い > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + def fate_distortion(natural_result) + modified_result = natural_result.dup + + if modified_result[0] == modified_result[1] + modified_result[0] += 13 + modified_result[1] += 13 + else + modified_result[natural_result.index(natural_result.min)] += 13 + end + subtotal = results_multiplication(natural_result) + total = results_multiplication(modified_result) + message = "歪曲の呪い > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + # 異物 + def origin_stranger(order) + natural_result = @randomizer.roll_barabara(3, 10) + natural_result = stranger_effection(natural_result) + case order[1] + when "I" + message = fate_imitation(natural_result) + when "M" + message = fate_mixed(natural_result, order) + when "B" + message = fate_beyond(natural_result, order) + else + total = results_multiplication(natural_result) + message = "異物 > #{total}[#{natural_result.join(',')}]" + end + return message + end + + def fate_imitation(natural_result) + modified_result = natural_result.dup + modified_result.sort! + modified_result[0] = (modified_result[0] + modified_result[1] * 10) == 0 ? 100 : (modified_result[0] + modified_result[1] * 10) + modified_result[1] = modified_result[2] + modified_result.delete_at(2) + subtotal = results_multiplication(natural_result) + total = results_multiplication(modified_result) + message = "模造の異物 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + def fate_mixed(natural_result, order) + subtotal = results_multiplication(natural_result) + if order.length > 2 && order[2] =~ /^\d+$/ + mixed_score = order[2].to_i + else + mixed_score = 1 + end + modified_result = natural_result.dup + if mixed_score <= natural_result.min + modified_result << @randomizer.roll_once(12) + total = results_multiplication(modified_result) + message = "混血の異物 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}](追加振り)" + else + modified_result[natural_result.index(natural_result.min)] = 10 + total = results_multiplication(modified_result) + message = "混血の異物 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}](10置換)" + end + return message + end + + def fate_beyond(natural_result, order) + modified_result = natural_result.dup + subtotal = results_multiplication(natural_result) + total = subtotal + beyond_limit = 666 + if order.length > 2 && order[2] =~ /^\d+$/ && (order[2].to_i < 666) + beyond_limit = order[2].to_i + end + while total != 0 && total <= beyond_limit + modified_result << @randomizer.roll_d9 + total = results_multiplication(modified_result) + end + message = "彼方の異物 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + # 報い + def origin_karma(order) + natural_result = @randomizer.roll_barabara(1, 60) + case order[1] + when "D" + message = fate_depravity(natural_result) + when "O" + message = fate_oblivion(natural_result) + when "S" + message = fate_sealed(natural_result, order) + else + total = results_multiplication(natural_result) + message = "報い > #{total}[#{natural_result.join(',')}]" + end + return message + end + + def fate_depravity(natural_result) + subtotal = results_multiplication(natural_result) + modified_result = natural_result.dup + depravity_num1 = natural_result[0] % 10 + depravity_num10 = natural_result[0] / 10 + if depravity_num10 > 1 + modified_result << depravity_num10 + end + if depravity_num1 > 1 + modified_result << depravity_num1 + end + total = results_multiplication(modified_result) + message = "堕落の報い > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + def fate_oblivion(natural_result) + modified_result = natural_result.dup + modified_result << @randomizer.roll_once(60) + subtotal = results_multiplication(natural_result) + total = results_multiplication(modified_result) / 2 + message = "忘却の報い > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + def fate_sealed(natural_result, order) + modified_result = natural_result.dup + subtotal = results_multiplication(natural_result) + sealed_break = 1 + if order.length > 2 && order[2] =~ /^\d+$/ + sealed_break = order[2].to_i + end + modified_result[0] *= sealed_break + total = subtotal * sealed_break + message = "封印の報い > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + if total <= 30 + sealed_break *= 4 + message += "(封印解除成功:#{sealed_break})" + elsif total <= 60 + sealed_break *= 2 + message += "(封印解除成功:#{sealed_break})" + else + message += "(封印解除失敗:#{sealed_break})" + end + return message + end + + # 同化 + def origin_absorption(order) + natural_result = @randomizer.roll_barabara(12, 2) + case order[1] + when "M" + message = fate_monster(natural_result, order) + when "T" + message = fate_treasure(natural_result, order) + when "C" + message = fate_concept(natural_result, order) + else + total = results_multiplication(natural_result) + message = "同化 > #{total}[#{natural_result.join(',')}]" + end + return message + end + + def fate_monster(_natural_result, order) + modified_result = [] + if order.length > 9 && order[2] =~ /^\d+$/ && order[3] =~ /^\d+$/ && order[4] =~ /^\d+$/ && order[5] =~ /^\d+$/ && order[6] =~ /^\d+$/ && order[7] =~ /^\d+$/ && order[8] =~ /^\d+$/ && order[9] =~ /^\d+$/ + if order[2].to_i > 0 + modified_result.concat(@randomizer.roll_barabara(order[2].to_i, 2)) + end + if order[3].to_i > 0 + modified_result.concat(@randomizer.roll_barabara(order[3].to_i, 4)) + end + if order[4].to_i > 0 + modified_result.concat(@randomizer.roll_barabara(order[4].to_i, 6)) + end + if order[5].to_i > 0 + modified_result.concat(@randomizer.roll_barabara(order[5].to_i, 8)) + end + count_of_10 = order[6].to_i + while count_of_10 > 0 + modified_result << @randomizer.roll_d9 + count_of_10 -= 1 + end + if order[7].to_i > 0 + modified_result.concat(@randomizer.roll_barabara(order[7].to_i, 12)) + end + if order[8].to_i > 0 + modified_result.concat(@randomizer.roll_barabara(order[8].to_i, 20)) + end + if order[9].to_i > 0 + modified_result.concat(@randomizer.roll_barabara(order[9].to_i, 60)) + end + total = results_multiplication(modified_result) + subtotal = modified_result.sum + message = "怪物の同化 > #{total}[#{modified_result.join(',')}] 浸蝕値:#{subtotal}" + if [2, 4, 6, 8, 10, 12, 20, 60].include?(subtotal) + message += "(変異進行)" + end + if modified_result.include?(1) + message += "(人間性喪失)" + end + else + message = "エラー:変異状態を指定してください。" + end + return message + end + + def fate_treasure(natural_result, order) + modified_result = natural_result.dup + subtotal = results_multiplication(natural_result) + total = subtotal + if order.length > 2 && order[2] =~ /^\d+$/ + treasure_point = order[2].to_i + if modified_result.count(2) >= treasure_point + total *= treasure_point + message = "秘宝の同化 > #{subtotal}[#{natural_result.join(',')}] > #{total}(同調成功)" + else + message = "秘宝の同化 > #{subtotal}[#{natural_result.join(',')}] > #{total}(同調失敗)" + end + else + message = "エラー:解放率を指定してください。" + end + return message + end + + def fate_concept(natural_result, order) + modified_result = natural_result.dup + subtotal = results_multiplication(natural_result) + if order.length > 2 && order[2] =~ /^\d+$/ + existence_scale = order[2].to_i + if existence_scale > 12 + existence_scale = 12 + end + modified_result.fill(2, 0, existence_scale) + total = results_multiplication(modified_result) + message = "概念の同化 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + else + message = "エラー:事象強度を指定してください。" + end + return message + end + + # 下位存在 + def origin_normal() + natural_result = @randomizer.roll_barabara(1, 12) + total = results_multiplication(natural_result) + message = "下位存在 > #{total}[#{natural_result.join(',')}]" + return message + end + + # 中位存在 + def origin_unique(order) + natural_result = @randomizer.roll_barabara(2, 12) + case order[1] + when "G" + message = fate_growth(natural_result, order) + when "T" + message = fate_transition(natural_result) + when "C" + message = fate_chance(natural_result) + else + total = results_multiplication(natural_result) + message = "中位存在 > #{total}[#{natural_result.join(',')}]" + end + return message + end + + def fate_growth(natural_result, order) + subtotal = results_multiplication(natural_result) + total = subtotal + if order.length > 2 && order[2] =~ /^\d+$/ + total += order[2].to_i + message = "萌芽の中位存在 > #{subtotal}[#{natural_result.join(',')}] > #{total}" + else + message = "萌芽の中位存在 > #{subtotal}[#{natural_result.join(',')}]" + end + growth_level = order[2].to_i + 50 + message += "(成長段階:#{growth_level})" + return message + end + + def fate_transition(natural_result) + modified_result = natural_result.dup + modified_result << @randomizer.roll_d9 + subtotal = results_multiplication(natural_result) + total = results_multiplication(modified_result) + message = "変遷の中位存在 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + def fate_chance(natural_result) + modified_result = natural_result.dup + subtotal = results_multiplication(natural_result) + total = results_multiplication(modified_result) + if modified_result[0] == modified_result[1] + total *= 24 + message = "偶然の中位存在 > #{subtotal}[#{natural_result.join(',')}] > #{total}" + else + message = "偶然の中位存在 > #{subtotal}[#{natural_result.join(',')}]" + end + return message + end + + # 上位存在 + def origin_omnipotent(order) + natural_result = @randomizer.roll_barabara(3, 12) + + case order[1] + when "G" + message = fate_god(natural_result) + when "H" + message = fate_holy(natural_result) + when "W" + message = fate_wicked(natural_result) + when "M" + message = fate_malice(natural_result) + when "S" + message = fate_sin(natural_result, order) + when "D" + message = fate_destruction(natural_result) + when "A" + message = fate_anguish(natural_result) + when "O" + message = fate_ordeal(natural_result) + when "C" + message = fate_creation(natural_result) + when "E" + message = fate_element() + else + total = results_multiplication(natural_result) + message = "上位存在 > #{total}[#{natural_result.join(',')}]" + end + + return message + end + + def fate_god(natural_result) + modified_result = [] + natural_result.each do |result| + modified_result << result + 3 + end + subtotal = results_multiplication(natural_result) + total = results_multiplication(modified_result) + message = "大神の上位存在 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + def fate_holy(natural_result) + modified_result = [] + natural_result.each do |result| + modified_result << result + 1 + end + subtotal = results_multiplication(natural_result) + total = results_multiplication(modified_result) + message = "神性の上位存在 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + def fate_wicked(natural_result) + subtotal = results_multiplication(natural_result) + total = subtotal + 120 + message = "魔性の上位存在 > #{subtotal}[#{natural_result.join(',')}] > #{total}" + return message + end + + def fate_malice(natural_result) + subtotal = results_multiplication(natural_result) + total = subtotal * 2 + message = "悪意の上位存在 > #{subtotal}[#{natural_result.join(',')}] > #{total}" + return message + end + + def fate_sin(natural_result, order) + subtotal = results_multiplication(natural_result) + total = subtotal + if order.length > 2 && order[2] =~ /^\d+$/ + message = "大罪の上位存在 > #{subtotal}[#{natural_result.join(',')}]" + sin_weight = order[2].to_i + sin_count = 0 + while sin_count < 3 && total < sin_weight + modified_result = @randomizer.roll_barabara(3, 12) + total = results_multiplication(modified_result) + message += " > #{total}[#{modified_result.join(',')}]" + sin_count += 1 + end + else + message = "エラー:罪の重さを指定してください。" + end + return message + end + + def fate_destruction(natural_result) + modified_result = natural_result.dup + modified_result << @randomizer.roll_once(12) + subtotal = results_multiplication(natural_result) + total = results_multiplication(modified_result) - 300 + message = "破壊の上位存在 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + def fate_anguish(natural_result) + modified_result = [] + natural_result.each do |result| + if result < 7 + result = 7 + end + modified_result << result + end + subtotal = results_multiplication(natural_result) + total = results_multiplication(modified_result) + message = "懊悩の上位存在 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + def fate_ordeal(natural_result) + modified_result = [] + natural_result.each do |result| + if result < 9 + result = 9 + end + modified_result << result + end + subtotal = results_multiplication(natural_result) + total = results_multiplication(modified_result) + message = "試練の上位存在 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + def fate_creation(natural_result) + modified_result = natural_result.dup + temporary_result = natural_result.dup + temporary_result.sort! + modified_result << temporary_result[1] + subtotal = results_multiplication(natural_result) + total = results_multiplication(modified_result) + message = "創造の上位存在 > #{subtotal}[#{natural_result.join(',')}] > #{total}[#{modified_result.join(',')}]" + return message + end + + def fate_element() + modified_result = [] + modified_result << @randomizer.roll_once(4) + modified_result << @randomizer.roll_once(6) + modified_result << @randomizer.roll_once(8) + modified_result << @randomizer.roll_once(12) + modified_result << @randomizer.roll_once(20) + total = results_multiplication(modified_result) + message = "元素の上位存在 > #{total}[#{modified_result.join(',')}]" + return message + end + + # 汎用 + def results_multiplication(result_list) + total = 1 + result_list.each do |result| + total *= result + end + return total + end + + def stranger_effection(result_list) + stranger_list = [] + result_list.each do |result| + stranger_list << result - 1 + end + return stranger_list + end + + def result_raoundup(result) + if result.even? + return result / 2 + else + return result / 2 + 1 + end + end + end + end +end diff --git a/test/data/HeroScale.toml b/test/data/HeroScale.toml new file mode 100644 index 000000000..9b708aa74 --- /dev/null +++ b/test/data/HeroScale.toml @@ -0,0 +1,1078 @@ +[[ test ]] +game_system = "HeroScale" +input = "5HS4" +output = "超越 > 24[1,2,3,4,1]" +rands = [ + { sides = 4, value = 1 }, + { sides = 4, value = 2 }, + { sides = 4, value = 3 }, + { sides = 4, value = 4 }, + { sides = 4, value = 1 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "5hs4,p" +output = "激情の超越 > 24[1,2,3,4,1] > 1080[3,4,5,6,3]" +rands = [ + { sides = 4, value = 1 }, + { sides = 4, value = 2 }, + { sides = 4, value = 3 }, + { sides = 4, value = 4 }, + { sides = 4, value = 1 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "5hs4,s" +output = "エラー:科学力を設定してください。" +rands = [ + { sides = 4, value = 1 }, + { sides = 4, value = 2 }, + { sides = 4, value = 3 }, + { sides = 4, value = 4 }, + { sides = 4, value = 1 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "5hs4,s,xx" +output = "エラー:科学力を設定してください。" +rands = [ + { sides = 4, value = 1 }, + { sides = 4, value = 2 }, + { sides = 4, value = 3 }, + { sides = 4, value = 4 }, + { sides = 4, value = 1 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "5hs4,s,1024" +output = "エラー:科学力が1024を超えています。" +rands = [ + { sides = 4, value = 1 }, + { sides = 4, value = 2 }, + { sides = 4, value = 3 }, + { sides = 4, value = 4 }, + { sides = 4, value = 1 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "5hs4,s,999" +output = "科学の超越 > 24[1,2,3,4,1] > 1023" +rands = [ + { sides = 4, value = 1 }, + { sides = 4, value = 2 }, + { sides = 4, value = 3 }, + { sides = 4, value = 4 }, + { sides = 4, value = 1 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "5hs4,s,1000" +output = "科学の超越 > 24[1,2,3,4,1] > 1024(科学臨界)" +rands = [ + { sides = 4, value = 1 }, + { sides = 4, value = 2 }, + { sides = 4, value = 3 }, + { sides = 4, value = 4 }, + { sides = 4, value = 1 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "5hs4,b" +output = "肉体の超越 > 24[1,2,3,4,1] > 24[1,2,3,4,1,1]" +rands = [ + { sides = 4, value = 1 }, + { sides = 4, value = 2 }, + { sides = 4, value = 3 }, + { sides = 4, value = 4 }, + { sides = 4, value = 1 }, + { sides = 4, value = 1 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "5hs4,b" +output = "肉体の超越 > 8[1,2,1,4,1] > 64[1,2,1,4,1,4,2]" +rands = [ + { sides = 4, value = 1 }, + { sides = 4, value = 2 }, + { sides = 4, value = 1 }, + { sides = 4, value = 4 }, + { sides = 4, value = 1 }, + { sides = 4, value = 4 }, + { sides = 4, value = 2 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "4hs6" +output = "加護 > 24[1,2,3,4]" +rands = [ + { sides = 6, value = 1 }, + { sides = 6, value = 2 }, + { sides = 6, value = 3 }, + { sides = 6, value = 4 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "4hs6,r" +output = "逆転の加護 > 24[1,2,3,4] > 480[6,5,4,4]" +rands = [ + { sides = 6, value = 1 }, + { sides = 6, value = 2 }, + { sides = 6, value = 3 }, + { sides = 6, value = 4 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "4hs6,p" +output = "安寧の加護 > 24[1,2,3,4] > 274" +rands = [ + { sides = 6, value = 1 }, + { sides = 6, value = 2 }, + { sides = 6, value = 3 }, + { sides = 6, value = 4 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "4hs6,s" +output = "選択の加護 > 24[1,2,3,4] > 8[1,2,3,4,1,1,1]" +rands = [ + { sides = 6, value = 1 }, + { sides = 6, value = 2 }, + { sides = 6, value = 3 }, + { sides = 6, value = 4 }, + { sides = 6, value = 1 }, + { sides = 6, value = 1 }, + { sides = 6, value = 1 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "4hs6,s" +output = "選択の加護 > 24[1,2,3,4] > 9[1,2,3,4,1,1,3]" +rands = [ + { sides = 6, value = 1 }, + { sides = 6, value = 2 }, + { sides = 6, value = 3 }, + { sides = 6, value = 4 }, + { sides = 6, value = 1 }, + { sides = 6, value = 1 }, + { sides = 6, value = 3 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs8" +output = "契約 > 12[2,2,3]" +rands = [ + { sides = 8, value = 2 }, + { sides = 8, value = 2 }, + { sides = 8, value = 3 }, +] + + +[[ test ]] +game_system = "HeroScale" +input = "3hs8,5,2" +output = "契約 > 12[2,2,3] > 120[2,2,3,5,2]" +rands = [ + { sides = 8, value = 2 }, + { sides = 8, value = 2 }, + { sides = 8, value = 3 }, +] + + +[[ test ]] +game_system = "HeroScale" +input = "3hs8,o" +output = "奉納の契約 > 12[2,2,3](奉納:2,2)" +rands = [ + { sides = 8, value = 2 }, + { sides = 8, value = 2 }, + { sides = 8, value = 3 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs8,o,2,5" +output = "奉納の契約 > 12[2,2,3] > 120[2,2,3,2,5](奉納:2,2)" +rands = [ + { sides = 8, value = 2 }, + { sides = 8, value = 2 }, + { sides = 8, value = 3 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs8,b" +output = "燃焼の契約 > 12[2,2,3] > 72" +rands = [ + { sides = 8, value = 2 }, + { sides = 8, value = 2 }, + { sides = 8, value = 3 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs8,e,25" +output = "収奪の契約 > 4[2,2,1] > 100[2,2,25]" +rands = [ + { sides = 8, value = 2 }, + { sides = 8, value = 2 }, + { sides = 8, value = 1 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs8,e" +output = "エラー:収奪数を指定してください。" +rands = [ + { sides = 8, value = 2 }, + { sides = 8, value = 2 }, + { sides = 8, value = 2 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs8,a,3,4" +output = "享受の契約 > 4[2,2,1] > 24[4,2,3]" +rands = [ + { sides = 8, value = 2 }, + { sides = 8, value = 2 }, + { sides = 8, value = 1 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs8,a" +output = "エラー:享受数を指定してください。" +rands = [ + { sides = 8, value = 2 }, + { sides = 8, value = 2 }, + { sides = 8, value = 2 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "2hs20" +output = "呪い > 24[2,12]" +rands = [ + { sides = 20, value = 2 }, + { sides = 20, value = 12 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "2hs20,r" +output = "破滅の呪い > 24[2,12] > 12[2,12,2,7]" +rands = [ + { sides = 20, value = 2 }, + { sides = 20, value = 12 }, + { sides = 20, value = 2 }, + { sides = 20, value = 7 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "2hs20,c" +output = "崩壊の呪い > 24[2,12] > 72[2,6,6]" +rands = [ + { sides = 20, value = 2 }, + { sides = 20, value = 12 }, +] + + +[[ test ]] +game_system = "HeroScale" +input = "2hs20,c" +output = "崩壊の呪い > 22[2,11] > 72[2,6,6]" +rands = [ + { sides = 20, value = 2 }, + { sides = 20, value = 11 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "2hs20,c" +output = "崩壊の呪い > 4[2,2] > 1[1,1,1,1]" +rands = [ + { sides = 20, value = 2 }, + { sides = 20, value = 2 }, +] + + +[[ test ]] +game_system = "HeroScale" +input = "2hs20,d" +output = "歪曲の呪い > 4[2,2] > 225[15,15]" +rands = [ + { sides = 20, value = 2 }, + { sides = 20, value = 2 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "2hs20,d" +output = "歪曲の呪い > 2[1,2] > 28[14,2]" +rands = [ + { sides = 20, value = 1 }, + { sides = 20, value = 2 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs10" +output = "異物 > 0[0,1,9]" +rands = [ + { sides = 10, value = 1 }, + { sides = 10, value = 2 }, + { sides = 10, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs10,i" +output = "模造の異物 > 0[0,1,9] > 90[10,9]" +rands = [ + { sides = 10, value = 1 }, + { sides = 10, value = 2 }, + { sides = 10, value = 10 }, +] + + +[[ test ]] +game_system = "HeroScale" +input = "3hs10,i" +output = "模造の異物 > 0[0,0,9] > 900[100,9]" +rands = [ + { sides = 10, value = 1 }, + { sides = 10, value = 1 }, + { sides = 10, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs10,m" +output = "混血の異物 > 0[0,0,9] > 0[10,0,9](10置換)" +rands = [ + { sides = 10, value = 1 }, + { sides = 10, value = 1 }, + { sides = 10, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs10,m,2" +output = "混血の異物 > 18[1,2,9] > 180[10,2,9](10置換)" +rands = [ + { sides = 10, value = 2 }, + { sides = 10, value = 3 }, + { sides = 10, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs10,m,2" +output = "混血の異物 > 90[5,2,9] > 1080[5,2,9,12](追加振り)" +rands = [ + { sides = 10, value = 6 }, + { sides = 10, value = 3 }, + { sides = 10, value = 10 }, + { sides = 12, value = 12 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs10,b" +output = "彼方の異物 > 0[0,0,9] > 0[0,0,9]" +rands = [ + { sides = 10, value = 1 }, + { sides = 10, value = 1 }, + { sides = 10, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs10,b,500" +output = "彼方の異物 > 0[0,0,9] > 0[0,0,9]" +rands = [ + { sides = 10, value = 1 }, + { sides = 10, value = 1 }, + { sides = 10, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs10,b" +output = "彼方の異物 > 729[9,9,9] > 729[9,9,9]" +rands = [ + { sides = 10, value = 10 }, + { sides = 10, value = 10 }, + { sides = 10, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs10,b" +output = "彼方の異物 > 81[1,9,9] > 729[1,9,9,9]" +rands = [ + { sides = 10, value = 2 }, + { sides = 10, value = 10 }, + { sides = 10, value = 10 }, + { sides = 10, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs10,b,20" +output = "彼方の異物 > 81[1,9,9] > 81[1,9,9]" +rands = [ + { sides = 10, value = 2 }, + { sides = 10, value = 10 }, + { sides = 10, value = 10 }, + { sides = 10, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "1hs60" +output = "報い > 12[12]" +rands = [ + { sides = 60, value = 12 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "1hs60,d" +output = "堕落の報い > 12[12] > 24[12,2]" +rands = [ + { sides = 60, value = 12 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "1hs60,d" +output = "堕落の報い > 22[22] > 88[22,2,2]" +rands = [ + { sides = 60, value = 22 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "1hs60,d" +output = "堕落の報い > 20[20] > 40[20,2]" +rands = [ + { sides = 60, value = 20 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "1hs60,o" +output = "忘却の報い > 20[20] > 600[20,60]" +rands = [ + { sides = 60, value = 20 }, + { sides = 60, value = 60 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "1hs60,s" +output = "封印の報い > 20[20] > 20[20](封印解除成功:4)" +rands = [ + { sides = 60, value = 20 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "1hs60,s" +output = "封印の報い > 40[40] > 40[40](封印解除成功:2)" +rands = [ + { sides = 60, value = 40 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "1hs60,s,2" +output = "封印の報い > 20[20] > 40[40](封印解除成功:4)" +rands = [ + { sides = 60, value = 20 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "1hs60,s,2" +output = "封印の報い > 40[40] > 80[80](封印解除失敗:2)" +rands = [ + { sides = 60, value = 40 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "12hs2" +output = "同化 > 64[1,1,1,1,1,1,2,2,2,2,2,2]" +rands = [ + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "12hs2,m" +output = "エラー:変異状態を指定してください。" +rands = [ + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "12hs2,m,12,0,0,0,0,0,0,0" +output = "怪物の同化 > 64[1,1,1,1,1,1,2,2,2,2,2,2] 浸蝕値:18(人間性喪失)" +rands = [ + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "12hs2,m,1,1,0,0,0,0,0,0" +output = "怪物の同化 > 8[2,4] 浸蝕値:6(変異進行)" +rands = [ + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 4, value = 4 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "12hs2,m,1,1,0,1,0,0,0,0" +output = "怪物の同化 > 4[1,4,1] 浸蝕値:6(変異進行)(人間性喪失)" +rands = [ + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 1 }, + { sides = 4, value = 4 }, + { sides = 8, value = 1 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "12hs2,m,0,1,1,1,1,1,1,1" +output = "怪物の同化 > 0[4,6,8,0,12,20,60] 浸蝕値:110" +rands = [ + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 4, value = 4 }, + { sides = 6, value = 6 }, + { sides = 8, value = 8 }, + { sides = 10, value = 1 }, + { sides = 12, value = 12 }, + { sides = 20, value = 20 }, + { sides = 60, value = 60 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "12hs2,t" +output = "エラー:解放率を指定してください。" +rands = [ + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "12hs2,t,7" +output = "秘宝の同化 > 64[1,1,1,1,1,1,2,2,2,2,2,2] > 64(同調失敗)" +rands = [ + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "12hs2,t,6" +output = "秘宝の同化 > 64[1,1,1,1,1,1,2,2,2,2,2,2] > 384(同調成功)" +rands = [ + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "12hs2,c,6" +output = "概念の同化 > 64[1,1,1,1,1,1,2,2,2,2,2,2] > 4096[2,2,2,2,2,2,2,2,2,2,2,2]" +rands = [ + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "12hs2,c" +output = "エラー:事象強度を指定してください。" +rands = [ + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 1 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, + { sides = 2, value = 2 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "1hs12" +output = "下位存在 > 2[2]" +rands = [ + { sides = 12, value = 2 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "2hs12" +output = "中位存在 > 24[2,12]" +rands = [ + { sides = 12, value = 2 }, + { sides = 12, value = 12 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "2hs12,g" +output = "萌芽の中位存在 > 24[2,12](成長段階:50)" +rands = [ + { sides = 12, value = 2 }, + { sides = 12, value = 12 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "2hs12,g,50" +output = "萌芽の中位存在 > 24[2,12] > 74(成長段階:100)" +rands = [ + { sides = 12, value = 2 }, + { sides = 12, value = 12 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "2hs12,t" +output = "変遷の中位存在 > 24[2,12] > 0[2,12,0]" +rands = [ + { sides = 12, value = 2 }, + { sides = 12, value = 12 }, + { sides = 10, value = 1 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "2hs12,c" +output = "偶然の中位存在 > 24[2,12]" +rands = [ + { sides = 12, value = 2 }, + { sides = 12, value = 12 }, +] + + +[[ test ]] +game_system = "HeroScale" +input = "2hs12,c" +output = "偶然の中位存在 > 1[1,1] > 24" +rands = [ + { sides = 12, value = 1 }, + { sides = 12, value = 1 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12" +output = "上位存在 > 24[3,2,4]" +rands = [ + { sides = 12, value = 3 }, + { sides = 12, value = 2 }, + { sides = 12, value = 4 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,g" +output = "大神の上位存在 > 24[3,2,4] > 210[6,5,7]" +rands = [ + { sides = 12, value = 3 }, + { sides = 12, value = 2 }, + { sides = 12, value = 4 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,h" +output = "神性の上位存在 > 24[3,2,4] > 60[4,3,5]" +rands = [ + { sides = 12, value = 3 }, + { sides = 12, value = 2 }, + { sides = 12, value = 4 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,w" +output = "魔性の上位存在 > 24[3,2,4] > 144" +rands = [ + { sides = 12, value = 3 }, + { sides = 12, value = 2 }, + { sides = 12, value = 4 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,m" +output = "悪意の上位存在 > 24[3,2,4] > 48" +rands = [ + { sides = 12, value = 3 }, + { sides = 12, value = 2 }, + { sides = 12, value = 4 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,s" +output = "エラー:罪の重さを指定してください。" +rands = [ + { sides = 12, value = 3 }, + { sides = 12, value = 2 }, + { sides = 12, value = 4 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,s,20" +output = "大罪の上位存在 > 24[3,2,4]" +rands = [ + { sides = 12, value = 3 }, + { sides = 12, value = 2 }, + { sides = 12, value = 4 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,s,30" +output = "大罪の上位存在 > 24[3,2,4] > 36[3,3,4]" +rands = [ + { sides = 12, value = 3 }, + { sides = 12, value = 2 }, + { sides = 12, value = 4 }, + { sides = 12, value = 3 }, + { sides = 12, value = 3 }, + { sides = 12, value = 4 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,s,40" +output = "大罪の上位存在 > 24[3,2,4] > 36[3,3,4] > 90[3,3,10]" +rands = [ + { sides = 12, value = 3 }, + { sides = 12, value = 2 }, + { sides = 12, value = 4 }, + { sides = 12, value = 3 }, + { sides = 12, value = 3 }, + { sides = 12, value = 4 }, + { sides = 12, value = 3 }, + { sides = 12, value = 3 }, + { sides = 12, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,s,100" +output = "大罪の上位存在 > 24[3,2,4] > 36[3,3,4] > 90[3,3,10] > 300[3,10,10]" +rands = [ + { sides = 12, value = 3 }, + { sides = 12, value = 2 }, + { sides = 12, value = 4 }, + { sides = 12, value = 3 }, + { sides = 12, value = 3 }, + { sides = 12, value = 4 }, + { sides = 12, value = 3 }, + { sides = 12, value = 3 }, + { sides = 12, value = 10 }, + { sides = 12, value = 3 }, + { sides = 12, value = 10 }, + { sides = 12, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,s,400" +output = "大罪の上位存在 > 24[3,2,4] > 36[3,3,4] > 90[3,3,10] > 300[3,10,10]" +rands = [ + { sides = 12, value = 3 }, + { sides = 12, value = 2 }, + { sides = 12, value = 4 }, + { sides = 12, value = 3 }, + { sides = 12, value = 3 }, + { sides = 12, value = 4 }, + { sides = 12, value = 3 }, + { sides = 12, value = 3 }, + { sides = 12, value = 10 }, + { sides = 12, value = 3 }, + { sides = 12, value = 10 }, + { sides = 12, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,d" +output = "破壊の上位存在 > 24[3,2,4] > -228[3,2,4,3]" +rands = [ + { sides = 12, value = 3 }, + { sides = 12, value = 2 }, + { sides = 12, value = 4 }, + { sides = 12, value = 3 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,a" +output = "懊悩の上位存在 > 24[3,2,4] > 343[7,7,7]" +rands = [ + { sides = 12, value = 3 }, + { sides = 12, value = 2 }, + { sides = 12, value = 4 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,a" +output = "懊悩の上位存在 > 60[3,2,10] > 490[7,7,10]" +rands = [ + { sides = 12, value = 3 }, + { sides = 12, value = 2 }, + { sides = 12, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,o" +output = "試練の上位存在 > 24[3,2,4] > 729[9,9,9]" +rands = [ + { sides = 12, value = 3 }, + { sides = 12, value = 2 }, + { sides = 12, value = 4 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,o" +output = "試練の上位存在 > 60[3,2,10] > 810[9,9,10]" +rands = [ + { sides = 12, value = 3 }, + { sides = 12, value = 2 }, + { sides = 12, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,c" +output = "創造の上位存在 > 60[3,2,10] > 180[3,2,10,3]" +rands = [ + { sides = 12, value = 3 }, + { sides = 12, value = 2 }, + { sides = 12, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,c" +output = "創造の上位存在 > 40[2,2,10] > 80[2,2,10,2]" +rands = [ + { sides = 12, value = 2 }, + { sides = 12, value = 2 }, + { sides = 12, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,c" +output = "創造の上位存在 > 1000[10,10,10] > 10000[10,10,10,10]" +rands = [ + { sides = 12, value = 10 }, + { sides = 12, value = 10 }, + { sides = 12, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,e" +output = "元素の上位存在 > 100[1,1,1,10,10]" +rands = [ + { sides = 12, value = 10 }, + { sides = 12, value = 10 }, + { sides = 12, value = 10 }, + { sides = 4, value = 1 }, + { sides = 6, value = 1 }, + { sides = 8, value = 1 }, + { sides = 12, value = 10 }, + { sides = 20, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "3hs12,x" +output = "上位存在 > 1000[10,10,10]" +rands = [ + { sides = 12, value = 10 }, + { sides = 12, value = 10 }, + { sides = 12, value = 10 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "2hs8" +output = "2HS8 > 8[1,8]" +rands = [ + { sides = 8, value = 1 }, + { sides = 8, value = 8 }, +] + +[[ test ]] +game_system = "HeroScale" +input = "aahs8" +output = "" +rands = [] + +[[ test ]] +game_system = "HeroScale" +input = "3hs" +output = "" +rands = []