bcdice 3.1.3 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +186 -76
- data/README.md +3 -2
- data/i18n/BeginningIdol/ja_jp.yml +2806 -0
- data/i18n/BeginningIdol/ko_kr.yml +1400 -0
- data/i18n/Cthulhu/zh_hans.yml +11 -0
- data/i18n/KillDeathBusiness/ja_jp.yml +1 -1
- data/i18n/MagicaLogia/ja_jp.yml +1 -1
- data/i18n/MagicaLogia/zh_hans.yml +564 -0
- data/i18n/MonotoneMuseum/ko_kr.yml +526 -53
- data/i18n/StellarKnights/ja_jp.yml +498 -0
- data/i18n/StellarKnights/ko_kr.yml +498 -0
- data/i18n/zh_hans.yml +7 -0
- data/lib/bcdice/command/parsed.rb +11 -3
- data/lib/bcdice/command/parser.rb +179 -100
- data/lib/bcdice/common_command/add_dice.rb +1 -1
- data/lib/bcdice/common_command/barabara_dice/node.rb +2 -2
- data/lib/bcdice/common_command/barabara_dice/result.rb +6 -0
- data/lib/bcdice/common_command/calc.rb +1 -1
- data/lib/bcdice/common_command/choice.rb +82 -7
- data/lib/bcdice/common_command/tally_dice/node.rb +135 -0
- data/lib/bcdice/common_command/tally_dice/parser.rb +302 -0
- data/lib/bcdice/common_command/tally_dice.rb +19 -0
- data/lib/bcdice/common_command.rb +2 -0
- data/lib/bcdice/dice_table/d66_half_grid_table.rb +33 -0
- data/lib/bcdice/dice_table/d66_left_range_table.rb +29 -0
- data/lib/bcdice/dice_table/d66_one_third_table.rb +34 -0
- data/lib/bcdice/dice_table/d66_table.rb +5 -1
- data/lib/bcdice/dice_table.rb +3 -0
- data/lib/bcdice/game_system/AceKillerGene.rb +1 -1
- data/lib/bcdice/game_system/Ainecadette.rb +68 -0
- data/lib/bcdice/game_system/Airgetlamh.rb +1 -1
- data/lib/bcdice/game_system/Alsetto.rb +1 -1
- data/lib/bcdice/game_system/AlterRaise.rb +2 -2
- data/lib/bcdice/game_system/Amadeus.rb +110 -93
- data/lib/bcdice/game_system/AngelGear.rb +10 -5
- data/lib/bcdice/game_system/AnimaAnimus.rb +16 -9
- data/lib/bcdice/game_system/Aoharubaan.rb +91 -0
- data/lib/bcdice/game_system/Arianrhod.rb +6 -8
- data/lib/bcdice/game_system/AssaultEngine.rb +91 -0
- data/lib/bcdice/game_system/Avandner.rb +1 -1
- data/lib/bcdice/game_system/BadLife.rb +264 -289
- data/lib/bcdice/game_system/Bakenokawa.rb +244 -0
- data/lib/bcdice/game_system/BarnaKronika.rb +1 -1
- data/lib/bcdice/game_system/BattleTech.rb +109 -28
- data/lib/bcdice/game_system/BeastBindTrinity.rb +28 -12
- data/lib/bcdice/game_system/BeginningIdol.rb +118 -2392
- data/lib/bcdice/game_system/BeginningIdol_Korean.rb +10 -2312
- data/lib/bcdice/game_system/BladeOfArcana.rb +1 -1
- data/lib/bcdice/game_system/BlindMythos.rb +39 -38
- data/lib/bcdice/game_system/BloodCrusade.rb +6 -7
- data/lib/bcdice/game_system/BloodMoon.rb +9 -8
- data/lib/bcdice/game_system/CardRanker.rb +8 -7
- data/lib/bcdice/game_system/CastleInGray.rb +133 -0
- data/lib/bcdice/game_system/ChaosFlare.rb +21 -15
- data/lib/bcdice/game_system/Chill.rb +10 -10
- data/lib/bcdice/game_system/Chill3.rb +9 -9
- data/lib/bcdice/game_system/CodeLayerd.rb +39 -39
- data/lib/bcdice/game_system/ColossalHunter.rb +34 -47
- data/lib/bcdice/game_system/CrashWorld.rb +1 -1
- data/lib/bcdice/game_system/Cthulhu.rb +3 -3
- data/lib/bcdice/game_system/Cthulhu7th.rb +56 -18
- data/lib/bcdice/game_system/Cthulhu7th_ChineseTraditional.rb +1 -1
- data/lib/bcdice/game_system/Cthulhu7th_Korean.rb +1 -1
- data/lib/bcdice/game_system/Cthulhu_SimplifiedChinese.rb +60 -0
- data/lib/bcdice/game_system/DarkBlaze.rb +0 -11
- data/lib/bcdice/game_system/DarkDaysDrive.rb +8 -7
- data/lib/bcdice/game_system/DeadlineHeroes.rb +11 -10
- data/lib/bcdice/game_system/DemonParasite.rb +5 -13
- data/lib/bcdice/game_system/DesperateRun.rb +1 -1
- data/lib/bcdice/game_system/DoubleCross.rb +8 -1
- data/lib/bcdice/game_system/Dracurouge.rb +3 -2
- data/lib/bcdice/game_system/EclipsePhase.rb +14 -14
- data/lib/bcdice/game_system/Elric.rb +18 -14
- data/lib/bcdice/game_system/Elysion.rb +1 -1
- data/lib/bcdice/game_system/EmbryoMachine.rb +9 -8
- data/lib/bcdice/game_system/Emoklore.rb +25 -20
- data/lib/bcdice/game_system/FateCoreSystem.rb +117 -0
- data/lib/bcdice/game_system/Fiasco.rb +1 -1
- data/lib/bcdice/game_system/FilledWith.rb +4 -0
- data/lib/bcdice/game_system/FutariSousa.rb +12 -10
- data/lib/bcdice/game_system/GURPS.rb +17 -28
- data/lib/bcdice/game_system/Garako.rb +1 -1
- data/lib/bcdice/game_system/GardenOrder.rb +12 -7
- data/lib/bcdice/game_system/GeishaGirlwithKatana.rb +1 -1
- data/lib/bcdice/game_system/GoblinSlayer.rb +1 -1
- data/lib/bcdice/game_system/Gorilla.rb +2 -8
- data/lib/bcdice/game_system/GranCrest.rb +189 -417
- data/lib/bcdice/game_system/Gundog.rb +9 -8
- data/lib/bcdice/game_system/GundogRevised.rb +10 -9
- data/lib/bcdice/game_system/GundogZero.rb +1 -1
- data/lib/bcdice/game_system/GurpsFW.rb +16 -16
- data/lib/bcdice/game_system/HarnMaster.rb +19 -26
- data/lib/bcdice/game_system/HatsuneMiku.rb +1 -1
- data/lib/bcdice/game_system/Hieizan.rb +12 -21
- data/lib/bcdice/game_system/HouraiGakuen.rb +1 -1
- data/lib/bcdice/game_system/HuntersMoon.rb +5 -10
- data/lib/bcdice/game_system/InfiniteFantasia.rb +19 -17
- data/lib/bcdice/game_system/Insane.rb +13 -20
- data/lib/bcdice/game_system/Irisbane.rb +154 -0
- data/lib/bcdice/game_system/IthaWenUa.rb +8 -15
- data/lib/bcdice/game_system/JamesBond.rb +10 -10
- data/lib/bcdice/game_system/JekyllAndHyde.rb +1 -1
- data/lib/bcdice/game_system/Kamigakari.rb +1 -1
- data/lib/bcdice/game_system/KanColle.rb +4 -9
- data/lib/bcdice/game_system/Karukami.rb +84 -0
- data/lib/bcdice/game_system/KemonoNoMori.rb +26 -39
- data/lib/bcdice/game_system/KillDeathBusiness.rb +7 -15
- data/lib/bcdice/game_system/KurayamiCrying.rb +142 -3
- data/lib/bcdice/game_system/LiveraDoll.rb +254 -304
- data/lib/bcdice/game_system/LogHorizon.rb +10 -7
- data/lib/bcdice/game_system/MagicaLogia_SimplifiedChinese.rb +66 -0
- data/lib/bcdice/game_system/MeikyuDays.rb +10 -8
- data/lib/bcdice/game_system/MeikyuKingdom.rb +26 -26
- data/lib/bcdice/game_system/MeikyuKingdomBasic.rb +4 -3
- data/lib/bcdice/game_system/MetalHead.rb +12 -22
- data/lib/bcdice/game_system/MetalHeadExtream.rb +5 -5
- data/lib/bcdice/game_system/MonotoneMuseum.rb +8 -6
- data/lib/bcdice/game_system/MonotoneMuseum_Korean.rb +4 -4
- data/lib/bcdice/game_system/Nechronica.rb +63 -90
- data/lib/bcdice/game_system/NinjaSlayer.rb +6 -7
- data/lib/bcdice/game_system/NjslyrBattle.rb +8 -11
- data/lib/bcdice/game_system/OneWayHeroics.rb +1 -1
- data/lib/bcdice/game_system/Paradiso.rb +1 -1
- data/lib/bcdice/game_system/ParasiteBlood.rb +1 -1
- data/lib/bcdice/game_system/Peekaboo.rb +4 -9
- data/lib/bcdice/game_system/Pendragon.rb +7 -7
- data/lib/bcdice/game_system/PersonaO.rb +86 -0
- data/lib/bcdice/game_system/PhantasmAdventure.rb +8 -8
- data/lib/bcdice/game_system/Postman.rb +1 -1
- data/lib/bcdice/game_system/PulpCthulhu.rb +1 -1
- data/lib/bcdice/game_system/Raisondetre.rb +2 -2
- data/lib/bcdice/game_system/Revulture.rb +123 -0
- data/lib/bcdice/game_system/RuneQuest.rb +8 -8
- data/lib/bcdice/game_system/Ryutama.rb +1 -1
- data/lib/bcdice/game_system/SRS.rb +17 -16
- data/lib/bcdice/game_system/SamsaraBallad.rb +38 -11
- data/lib/bcdice/game_system/Satasupe.rb +32 -32
- data/lib/bcdice/game_system/ScreamHighSchool.rb +5 -5
- data/lib/bcdice/game_system/SharedFantasia.rb +19 -23
- data/lib/bcdice/game_system/ShinobiGami.rb +14 -6
- data/lib/bcdice/game_system/Skynauts.rb +103 -142
- data/lib/bcdice/game_system/SkynautsBouken.rb +228 -0
- data/lib/bcdice/game_system/StarryDolls.rb +318 -0
- data/lib/bcdice/game_system/SteamPunkers.rb +25 -7
- data/lib/bcdice/game_system/StellarKnights.rb +85 -706
- data/lib/bcdice/game_system/StellarKnights_Korean.rb +79 -0
- data/lib/bcdice/game_system/{SterileLife.rb → StellarLife.rb} +162 -226
- data/lib/bcdice/game_system/StratoShout.rb +8 -16
- data/lib/bcdice/game_system/Strave.rb +1 -1
- data/lib/bcdice/game_system/SwordWorld.rb +22 -9
- data/lib/bcdice/game_system/SwordWorld2_0.rb +22 -7
- data/lib/bcdice/game_system/SwordWorld2_5.rb +8 -2
- data/lib/bcdice/game_system/TalesFromTheLoop.rb +83 -0
- data/lib/bcdice/game_system/TherapieSein.rb +1 -1
- data/lib/bcdice/game_system/TokumeiTenkousei.rb +4 -3
- data/lib/bcdice/game_system/TokyoGhostResearch.rb +1 -1
- data/lib/bcdice/game_system/TorgEternity.rb +2 -2
- data/lib/bcdice/game_system/ToshiakiHolyGrailWar.rb +92 -0
- data/lib/bcdice/game_system/TrinitySeven.rb +279 -280
- data/lib/bcdice/game_system/TunnelsAndTrolls.rb +1 -1
- data/lib/bcdice/game_system/Utakaze.rb +53 -48
- data/lib/bcdice/game_system/Villaciel.rb +1 -1
- data/lib/bcdice/game_system/WARPS.rb +11 -9
- data/lib/bcdice/game_system/WaresBlade.rb +4 -9
- data/lib/bcdice/game_system/Warhammer.rb +15 -6
- data/lib/bcdice/game_system/Warhammer4.rb +15 -11
- data/lib/bcdice/game_system/WitchQuest.rb +1 -1
- data/lib/bcdice/game_system/YankeeYogSothoth.rb +4 -9
- data/lib/bcdice/game_system/YearZeroEngine.rb +40 -19
- data/lib/bcdice/game_system/Yggdrasill.rb +1 -1
- data/lib/bcdice/game_system/ZettaiReido.rb +20 -25
- data/lib/bcdice/game_system/beginning_idol/accessories_table.rb +31 -0
- data/lib/bcdice/game_system/beginning_idol/bad_status_table.rb +43 -0
- data/lib/bcdice/game_system/beginning_idol/chain_d66_table.rb +29 -0
- data/lib/bcdice/game_system/beginning_idol/chain_table.rb +37 -0
- data/lib/bcdice/game_system/beginning_idol/costume_table.rb +37 -0
- data/lib/bcdice/game_system/beginning_idol/d6_twice_table.rb +36 -0
- data/lib/bcdice/game_system/beginning_idol/item_table.rb +51 -0
- data/lib/bcdice/game_system/beginning_idol/my_skill_name_table.rb +44 -0
- data/lib/bcdice/game_system/beginning_idol/random_event_table.rb +31 -0
- data/lib/bcdice/game_system/beginning_idol/skill_table.rb +63 -0
- data/lib/bcdice/game_system/beginning_idol/table.rb +193 -0
- data/lib/bcdice/game_system/beginning_idol/with_abnormality.rb +74 -0
- data/lib/bcdice/game_system/beginning_idol/work_table.rb +57 -0
- data/lib/bcdice/game_system/meikyu_kingdom_basic/kingdom_table.rb +1 -1
- data/lib/bcdice/game_system/one_way_heroics/random_event_table.rb +4 -4
- data/lib/bcdice/game_system/sword_world/rating_parsed.rb +50 -7
- data/lib/bcdice/game_system/sword_world/rating_parser.rb +148 -107
- data/lib/bcdice/game_system/sword_world/transcendent_test.rb +26 -8
- data/lib/bcdice/game_system.rb +18 -1
- data/lib/bcdice/repl.rb +1 -1
- data/lib/bcdice/result.rb +26 -0
- data/lib/bcdice/version.rb +1 -1
- metadata +48 -6
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BCDice
|
|
4
|
+
module GameSystem
|
|
5
|
+
class BeginningIdol < Base
|
|
6
|
+
class ChainD66Table
|
|
7
|
+
# @param [String] name 表の名前
|
|
8
|
+
# @param [Array<Array<String, #roll>>] items 表の項目の配列
|
|
9
|
+
def initialize(name, items)
|
|
10
|
+
@name = name
|
|
11
|
+
@items = items.freeze
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# 表を振る
|
|
15
|
+
# @param randomizer [#roll_sum] ランダマイザ
|
|
16
|
+
# @return [String] 結果
|
|
17
|
+
def roll(randomizer)
|
|
18
|
+
dice = randomizer.roll_barabara(2, 6).sort
|
|
19
|
+
|
|
20
|
+
value = dice[0] * 10 + dice[1]
|
|
21
|
+
chosen = @items[value]
|
|
22
|
+
body = chosen.map { |item| item.respond_to?(:roll) ? item.roll(randomizer) : item }.join("\n")
|
|
23
|
+
|
|
24
|
+
return "#{@name}(#{value}) > #{body}"
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BCDice
|
|
4
|
+
module GameSystem
|
|
5
|
+
class BeginningIdol < Base
|
|
6
|
+
class ChainTable
|
|
7
|
+
# @param [String] name 表の名前
|
|
8
|
+
# @param [String] type 項目を選ぶときのダイスロールの方法 '1D6'など
|
|
9
|
+
# @param [Array<Array<String, #roll>>] items 表の項目の配列
|
|
10
|
+
def initialize(name, type, items)
|
|
11
|
+
@name = name
|
|
12
|
+
@items = items.freeze
|
|
13
|
+
|
|
14
|
+
m = /^(\d+)D(\d+)$/i.match(type)
|
|
15
|
+
unless m
|
|
16
|
+
raise ArgumentError, "Unexpected table type: #{type}"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
@times = m[1].to_i
|
|
20
|
+
@sides = m[2].to_i
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# 表を振る
|
|
24
|
+
# @param randomizer [#roll_sum] ランダマイザ
|
|
25
|
+
# @return [String] 結果
|
|
26
|
+
def roll(randomizer)
|
|
27
|
+
value = randomizer.roll_sum(@times, @sides)
|
|
28
|
+
index = value - @times
|
|
29
|
+
chosen = @items[index]
|
|
30
|
+
body = chosen.map { |item| item.respond_to?(:roll) ? item.roll(randomizer) : item }.join("\n")
|
|
31
|
+
|
|
32
|
+
return "#{@name}(#{value}) > #{body}"
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BCDice
|
|
4
|
+
module GameSystem
|
|
5
|
+
class BeginningIdol < Base
|
|
6
|
+
class CostumeTable
|
|
7
|
+
def self.from_i18n(key, locale)
|
|
8
|
+
table = I18n.t(key, locale: locale)
|
|
9
|
+
new(table[:name], table[:items])
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# @param name [String]
|
|
13
|
+
# @param items [Hash{Integer => String}]
|
|
14
|
+
def initialize(name, items)
|
|
15
|
+
@name = name
|
|
16
|
+
@items = items
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# @param randomizer [Randomizer]
|
|
20
|
+
# @return [String]
|
|
21
|
+
def roll(randomizer)
|
|
22
|
+
value = randomizer.roll_d66(D66SortType::ASC)
|
|
23
|
+
"#{@name}(#{value}) > #{@items[value]}"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# @return [DiceTable::D66Table]
|
|
27
|
+
def brand_only()
|
|
28
|
+
DiceTable::D66Table.new(
|
|
29
|
+
@name,
|
|
30
|
+
D66SortType::ASC,
|
|
31
|
+
@items.transform_values { |e| e.split("\n").first }
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BCDice
|
|
4
|
+
module GameSystem
|
|
5
|
+
class BeginningIdol < Base
|
|
6
|
+
class D6TwiceTable
|
|
7
|
+
# @param key [String]
|
|
8
|
+
# @param locale [Symbol]
|
|
9
|
+
# @return [D6TwiceTable]
|
|
10
|
+
def self.from_i18n(key, locale)
|
|
11
|
+
table = I18n.t(key, locale: locale)
|
|
12
|
+
new(table[:name], table[:items1], table[:items2])
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# @param name [String]
|
|
16
|
+
# @param items1 [Array<String>]
|
|
17
|
+
# @param items2 [Array<String>]
|
|
18
|
+
def initialize(name, items1, items2)
|
|
19
|
+
@name = name
|
|
20
|
+
@items1 = items1
|
|
21
|
+
@items2 = items2
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# @param [Randomizer]
|
|
25
|
+
# @return [String]
|
|
26
|
+
def roll(randomizer)
|
|
27
|
+
value1, value2 = randomizer.roll_barabara(2, 6)
|
|
28
|
+
chosen1 = @items1[value1 - 1]
|
|
29
|
+
chosen2 = @items2[value2 - 1]
|
|
30
|
+
|
|
31
|
+
"#{@name}[#{value1},#{value2}] > #{chosen1}#{chosen2}"
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BCDice
|
|
4
|
+
module GameSystem
|
|
5
|
+
class BeginningIdol < Base
|
|
6
|
+
class ItemTable
|
|
7
|
+
def initialize(locale)
|
|
8
|
+
@locale = locale
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def roll_command(randomizer, command)
|
|
12
|
+
m = /^IT(\d+)?$/.match(command)
|
|
13
|
+
unless m
|
|
14
|
+
return nil
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
roll_counts = m[1]&.to_i || 1
|
|
18
|
+
return roll(randomizer, roll_counts)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# @param randomizer [BCDice::Randomizer]
|
|
22
|
+
# @param counts [Integer]
|
|
23
|
+
def roll(randomizer, roll_counts = 1)
|
|
24
|
+
if roll_counts == 0
|
|
25
|
+
return nil
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
table = I18n.t("BeginningIdol.item_table", locale: @locale)
|
|
29
|
+
|
|
30
|
+
dice_list = randomizer.roll_barabara(roll_counts, 6).sort
|
|
31
|
+
grouped = dice_list.group_by(&:itself)
|
|
32
|
+
|
|
33
|
+
item_list = grouped.map do |dice, list|
|
|
34
|
+
item = table[:items][dice - 1]
|
|
35
|
+
if grouped.size != 1
|
|
36
|
+
item = format(table[:emph], item: item)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
if dice_list.size == grouped.size
|
|
40
|
+
item
|
|
41
|
+
else
|
|
42
|
+
format(table[:counting], item: item, count: list.size)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
return "#{table[:name]} > [#{dice_list.join(',')}] > #{item_list.join(table[:sep])}"
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BCDice
|
|
4
|
+
module GameSystem
|
|
5
|
+
class BeginningIdol < Base
|
|
6
|
+
class MySkillNameTable
|
|
7
|
+
# @param locale [Symbol]
|
|
8
|
+
# @return [MySkillNameTable]
|
|
9
|
+
def initialize(locale)
|
|
10
|
+
@locale = locale
|
|
11
|
+
|
|
12
|
+
article = DiceTable::Table.from_i18n("BeginningIdol.MS.subtables.article", locale)
|
|
13
|
+
describe = DiceTable::D66Table.from_i18n("BeginningIdol.MS.subtables.describe", locale)
|
|
14
|
+
scene = DiceTable::D66Table.from_i18n("BeginningIdol.MS.subtables.scene", locale)
|
|
15
|
+
material = DiceTable::D66Table.from_i18n("BeginningIdol.MS.subtables.material", locale)
|
|
16
|
+
action = DiceTable::D66Table.from_i18n("BeginningIdol.MS.subtables.action", locale)
|
|
17
|
+
@chains = [
|
|
18
|
+
[describe, scene, material],
|
|
19
|
+
[describe, scene, action],
|
|
20
|
+
[describe, material, action],
|
|
21
|
+
[scene, material, action],
|
|
22
|
+
[describe, scene, article],
|
|
23
|
+
[material, action, article],
|
|
24
|
+
].freeze
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# @param randomizer [BCDice::Randomizer]
|
|
28
|
+
# @return [String]
|
|
29
|
+
def roll(randomizer)
|
|
30
|
+
index = randomizer.roll_once(6)
|
|
31
|
+
chosens = @chains[index - 1].map { |t| t.roll(randomizer) }
|
|
32
|
+
|
|
33
|
+
dice = chosens.map { |chosen| chosen.table_name + chosen.value.to_s }
|
|
34
|
+
|
|
35
|
+
name = I18n.t("BeginningIdol.MS.name", locale: @locale)
|
|
36
|
+
skill_name_format = I18n.t("BeginningIdol.MS.formats", locale: @locale)[index - 1]
|
|
37
|
+
skill_name = format(skill_name_format, *chosens.map(&:body))
|
|
38
|
+
|
|
39
|
+
"#{name} > [#{index},#{dice.join(',')}] > #{skill_name}"
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BCDice
|
|
4
|
+
module GameSystem
|
|
5
|
+
class BeginningIdol < Base
|
|
6
|
+
class RandomEventTable
|
|
7
|
+
# @param locale [Symbol]
|
|
8
|
+
# @return [MySkillNameTable]
|
|
9
|
+
def initialize(locale)
|
|
10
|
+
@locale = locale
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# @param randomizer [BCDice::Randomizer]
|
|
14
|
+
# @return [String]
|
|
15
|
+
def roll(randomizer)
|
|
16
|
+
first_index = randomizer.roll_once(6)
|
|
17
|
+
d66_index = randomizer.roll_d66(D66SortType::NO_SORT)
|
|
18
|
+
|
|
19
|
+
i18n_key = first_index.even? ? "BeginningIdol.RE.on_event" : "BeginningIdol.RE.off_event"
|
|
20
|
+
table = I18n.t(i18n_key, locale: @locale)
|
|
21
|
+
name = I18n.t("BeginningIdol.RE.name", locale: @locale)
|
|
22
|
+
result_format = I18n.t("BeginningIdol.RE.format", locale: @locale)
|
|
23
|
+
|
|
24
|
+
chosen = table[:items][d66_index]
|
|
25
|
+
|
|
26
|
+
return "#{name} > (1D6) > #{first_index}\n#{table[:name]} > [#{d66_index}] > #{format(result_format, event: chosen[0], page: chosen[1])}"
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BCDice
|
|
4
|
+
module GameSystem
|
|
5
|
+
class BeginningIdol < Base
|
|
6
|
+
class SkillTable < DiceTable::SaiFicSkillTable
|
|
7
|
+
def roll(randomizer)
|
|
8
|
+
roll_command(randomizer, "RTT")
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
class SkillGetTable < DiceTable::Table
|
|
13
|
+
def self.from_i18n(key, skill_table, locale)
|
|
14
|
+
table = I18n.t(key, locale: locale)
|
|
15
|
+
new(table[:name], table[:type], table[:items], skill_table, locale)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def initialize(name, type, items, skill_table, locale)
|
|
19
|
+
super(name, type, items)
|
|
20
|
+
@skill_table = skill_table
|
|
21
|
+
|
|
22
|
+
skill_get_table = I18n.t("BeginningIdol.skill_get_table", locale: locale)
|
|
23
|
+
@reroll_reg = Regexp.new(skill_get_table[:reroll_reg])
|
|
24
|
+
@reroll = skill_get_table[:reroll]
|
|
25
|
+
@secondary_name = skill_get_table[:secondary_name]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def roll(randomizer)
|
|
29
|
+
chosen = super(randomizer)
|
|
30
|
+
|
|
31
|
+
m = @reroll_reg.match(chosen.body)
|
|
32
|
+
unless m
|
|
33
|
+
return chosen
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
reroll_category = m.captures
|
|
37
|
+
body = chosen.body + "\n"
|
|
38
|
+
loop do
|
|
39
|
+
skill = @skill_table.roll_skill(randomizer)
|
|
40
|
+
body += "#{@secondary_name} > [#{skill.category_dice},#{skill.row_dice}] > #{skill}"
|
|
41
|
+
unless reroll_category.include?(skill.category_name)
|
|
42
|
+
break
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
body += " > #{@reroll}\n"
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
DiceTable::RollResult.new(chosen.table_name, chosen.value, body)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
class SkillHometown
|
|
53
|
+
def initialize(skill_table)
|
|
54
|
+
@skill_name = skill_table
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def roll(randomizer)
|
|
58
|
+
@skill_name.roll_command(randomizer, "AT6")
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bcdice/game_system/beginning_idol/chain_table"
|
|
4
|
+
require "bcdice/game_system/beginning_idol/chain_d66_table"
|
|
5
|
+
require "bcdice/game_system/beginning_idol/bad_status_table"
|
|
6
|
+
require "bcdice/game_system/beginning_idol/random_event_table"
|
|
7
|
+
require "bcdice/game_system/beginning_idol/my_skill_name_table"
|
|
8
|
+
require "bcdice/game_system/beginning_idol/d6_twice_table"
|
|
9
|
+
require "bcdice/game_system/beginning_idol/item_table"
|
|
10
|
+
require "bcdice/game_system/beginning_idol/costume_table"
|
|
11
|
+
require "bcdice/game_system/beginning_idol/accessories_table"
|
|
12
|
+
require "bcdice/game_system/beginning_idol/with_abnormality"
|
|
13
|
+
require "bcdice/game_system/beginning_idol/work_table"
|
|
14
|
+
require "bcdice/game_system/beginning_idol/skill_table"
|
|
15
|
+
|
|
16
|
+
module BCDice
|
|
17
|
+
module GameSystem
|
|
18
|
+
class BeginningIdol < Base
|
|
19
|
+
class << self
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
def translate_skill_table(locale)
|
|
23
|
+
SkillTable.from_i18n(
|
|
24
|
+
"BeginningIdol.skill_table",
|
|
25
|
+
locale,
|
|
26
|
+
rtt: "AT",
|
|
27
|
+
rttn: ["AT1", "AT2", "AT3", "AT4", "AT5", "AT6"]
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def translate_tables(locale)
|
|
32
|
+
costume_challenge_girls = CostumeTable.from_i18n("BeginningIdol.tables.DT", locale)
|
|
33
|
+
costume_road_to_prince = CostumeTable.from_i18n("BeginningIdol.tables.RC", locale)
|
|
34
|
+
costume_fortune_stars = CostumeTable.from_i18n("BeginningIdol.tables.FC", locale)
|
|
35
|
+
|
|
36
|
+
bland = ChainTable.new(
|
|
37
|
+
I18n.t("BeginningIdol.ACB.name", locale: locale),
|
|
38
|
+
"1D6",
|
|
39
|
+
[
|
|
40
|
+
[I18n.t("BeginningIdol.ACB.items.challenge_girls", locale: locale), costume_challenge_girls.brand_only()],
|
|
41
|
+
[I18n.t("BeginningIdol.ACB.items.challenge_girls", locale: locale), costume_challenge_girls.brand_only()],
|
|
42
|
+
[I18n.t("BeginningIdol.ACB.items.road_to_prince", locale: locale), costume_road_to_prince.brand_only()],
|
|
43
|
+
[I18n.t("BeginningIdol.ACB.items.road_to_prince", locale: locale), costume_road_to_prince.brand_only()],
|
|
44
|
+
[I18n.t("BeginningIdol.ACB.items.fortune_stars", locale: locale), costume_fortune_stars.brand_only()],
|
|
45
|
+
[I18n.t("BeginningIdol.ACB.items.fortune_stars", locale: locale), costume_fortune_stars.brand_only()],
|
|
46
|
+
]
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
bad_status_table = BadStatusTable.new(locale)
|
|
50
|
+
|
|
51
|
+
skill_table = translate_skill_table(locale)
|
|
52
|
+
|
|
53
|
+
rare_skill_table = DiceTable::Table.from_i18n("BeginningIdol.rare_skill_table", locale)
|
|
54
|
+
|
|
55
|
+
item_table = ItemTable.new(locale)
|
|
56
|
+
|
|
57
|
+
tn = ChainTable.new(
|
|
58
|
+
I18n.t("BeginningIdol.TN.name", locale: locale),
|
|
59
|
+
"1D6",
|
|
60
|
+
I18n.t("BeginningIdol.TN.items", locale: locale).dup.tap { |items| items[3].push(skill_table) }
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
cg = ChainTable.new(
|
|
64
|
+
I18n.t("BeginningIdol.CG.name", locale: locale),
|
|
65
|
+
"1D6",
|
|
66
|
+
I18n.t("BeginningIdol.CG.items", locale: locale).map.with_index do |item, index|
|
|
67
|
+
if [3, 4].include?(index)
|
|
68
|
+
[item, item_table]
|
|
69
|
+
else
|
|
70
|
+
[item]
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
gg = ChainD66Table.new(
|
|
76
|
+
I18n.t("BeginningIdol.GG.name", locale: locale),
|
|
77
|
+
I18n.t("BeginningIdol.GG.items", locale: locale).to_h do |index, value|
|
|
78
|
+
chain =
|
|
79
|
+
if [23, 24, 25].include?(index)
|
|
80
|
+
[value, rare_skill_table]
|
|
81
|
+
elsif index == 56
|
|
82
|
+
[value, item_table]
|
|
83
|
+
else
|
|
84
|
+
[value]
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
[index, chain]
|
|
88
|
+
end
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
ha = ChainD66Table.new(
|
|
92
|
+
I18n.t("BeginningIdol.HA.name", locale: locale),
|
|
93
|
+
I18n.t("BeginningIdol.HA.items", locale: locale).dup.tap { |items| items[22].push(SkillHometown.new(skill_table)) }
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
{
|
|
97
|
+
"DT" => costume_challenge_girls,
|
|
98
|
+
"RC" => costume_road_to_prince,
|
|
99
|
+
"FC" => costume_fortune_stars,
|
|
100
|
+
"ACB" => bland,
|
|
101
|
+
"TN" => tn,
|
|
102
|
+
"CG" => cg,
|
|
103
|
+
"GG" => gg,
|
|
104
|
+
"HA" => ha,
|
|
105
|
+
"CBT" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.CBT", locale),
|
|
106
|
+
"RCB" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.RCB", locale),
|
|
107
|
+
"HBT" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.HBT", locale),
|
|
108
|
+
"RHB" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.RHB", locale),
|
|
109
|
+
"RU" => DiceTable::Table.from_i18n("BeginningIdol.tables.RU", locale),
|
|
110
|
+
"SIP" => DiceTable::Table.from_i18n("BeginningIdol.tables.SIP", locale),
|
|
111
|
+
"BU" => DiceTable::Table.from_i18n("BeginningIdol.tables.BU", locale),
|
|
112
|
+
"HW" => DiceTable::Table.from_i18n("BeginningIdol.tables.HW", locale),
|
|
113
|
+
"FL" => DiceTable::Table.from_i18n("BeginningIdol.tables.FL", locale),
|
|
114
|
+
"MSE" => DiceTable::Table.from_i18n("BeginningIdol.tables.MSE", locale),
|
|
115
|
+
"ST" => DiceTable::Table.from_i18n("BeginningIdol.tables.ST", locale),
|
|
116
|
+
"FST" => DiceTable::Table.from_i18n("BeginningIdol.tables.FST", locale),
|
|
117
|
+
"BWT" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.BWT", locale),
|
|
118
|
+
"LWT" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.LWT", locale),
|
|
119
|
+
"TWT" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.TWT", locale),
|
|
120
|
+
"CWT" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.CWT", locale),
|
|
121
|
+
"SU" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.SU", locale),
|
|
122
|
+
"WI" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.WI", locale),
|
|
123
|
+
"NA" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.NA", locale),
|
|
124
|
+
"GA" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.GA", locale),
|
|
125
|
+
"BA" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.BA", locale),
|
|
126
|
+
"WT" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.WT", locale),
|
|
127
|
+
"VA" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.VA", locale),
|
|
128
|
+
"MU" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.MU", locale),
|
|
129
|
+
"DR" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.DR", locale),
|
|
130
|
+
"VI" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.VI", locale),
|
|
131
|
+
"SP" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.SP", locale),
|
|
132
|
+
"CHR" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.CHR", locale),
|
|
133
|
+
"PAR" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.PAR", locale),
|
|
134
|
+
"SW" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.SW", locale),
|
|
135
|
+
"AN" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.AN", locale),
|
|
136
|
+
"MOV" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.MOV", locale),
|
|
137
|
+
"FA" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.FA", locale),
|
|
138
|
+
"BVT" => DiceTable::Table.from_i18n("BeginningIdol.tables.BVT", locale),
|
|
139
|
+
"LVT" => DiceTable::Table.from_i18n("BeginningIdol.tables.LVT", locale),
|
|
140
|
+
"TVT" => DiceTable::Table.from_i18n("BeginningIdol.tables.TVT", locale),
|
|
141
|
+
"CVT" => DiceTable::Table.from_i18n("BeginningIdol.tables.CVT", locale),
|
|
142
|
+
"BST" => DiceTable::Table.from_i18n("BeginningIdol.tables.BST", locale),
|
|
143
|
+
"LST" => DiceTable::Table.from_i18n("BeginningIdol.tables.LST", locale),
|
|
144
|
+
"TST" => DiceTable::Table.from_i18n("BeginningIdol.tables.TST", locale),
|
|
145
|
+
"CST" => DiceTable::Table.from_i18n("BeginningIdol.tables.CST", locale),
|
|
146
|
+
"BPT" => DiceTable::Table.from_i18n("BeginningIdol.tables.BPT", locale),
|
|
147
|
+
"LPT" => DiceTable::Table.from_i18n("BeginningIdol.tables.LPT", locale),
|
|
148
|
+
"TPT" => DiceTable::Table.from_i18n("BeginningIdol.tables.TPT", locale),
|
|
149
|
+
"CPT" => DiceTable::Table.from_i18n("BeginningIdol.tables.CPT", locale),
|
|
150
|
+
"BIT" => DiceTable::Table.from_i18n("BeginningIdol.tables.BIT", locale),
|
|
151
|
+
"LIT" => DiceTable::Table.from_i18n("BeginningIdol.tables.LIT", locale),
|
|
152
|
+
"TIT" => DiceTable::Table.from_i18n("BeginningIdol.tables.TIT", locale),
|
|
153
|
+
"CIT" => DiceTable::Table.from_i18n("BeginningIdol.tables.CIT", locale),
|
|
154
|
+
"CHO" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.CHO", locale),
|
|
155
|
+
"SCH" => DiceTable::Table.from_i18n("BeginningIdol.tables.SCH", locale),
|
|
156
|
+
"WCH" => DiceTable::Table.from_i18n("BeginningIdol.tables.WCH", locale),
|
|
157
|
+
"NCH" => DiceTable::Table.from_i18n("BeginningIdol.tables.NCH", locale),
|
|
158
|
+
"GCH" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.GCH", locale),
|
|
159
|
+
"PCH" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.PCH", locale),
|
|
160
|
+
"LUR" => D6TwiceTable.from_i18n("BeginningIdol.tables.LUR", locale),
|
|
161
|
+
"SUR" => D6TwiceTable.from_i18n("BeginningIdol.tables.SUR", locale),
|
|
162
|
+
"WUR" => D6TwiceTable.from_i18n("BeginningIdol.tables.WUR", locale),
|
|
163
|
+
"NUR" => D6TwiceTable.from_i18n("BeginningIdol.tables.NUR", locale),
|
|
164
|
+
"GUR" => D6TwiceTable.from_i18n("BeginningIdol.tables.GUR", locale),
|
|
165
|
+
"BUR" => D6TwiceTable.from_i18n("BeginningIdol.tables.BUR", locale),
|
|
166
|
+
"ACE" => DiceTable::D66Table.from_i18n("BeginningIdol.tables.ACE", locale),
|
|
167
|
+
"ACT" => translate_accessories_table(locale),
|
|
168
|
+
"MS" => MySkillNameTable.new(locale),
|
|
169
|
+
"RE" => RandomEventTable.new(locale),
|
|
170
|
+
"SH" => D66WithAbnormality.from_i18n("BeginningIdol.tables.SH", bad_status_table, locale),
|
|
171
|
+
"MO" => D66WithAbnormality.from_i18n("BeginningIdol.tables.MO", bad_status_table, locale),
|
|
172
|
+
"SEA" => D66WithAbnormality.from_i18n("BeginningIdol.tables.SEA", bad_status_table, locale),
|
|
173
|
+
"SPA" => D66WithAbnormality.from_i18n("BeginningIdol.tables.SPA", bad_status_table, locale),
|
|
174
|
+
"LN" => TableWithAbnormality.from_i18n("BeginningIdol.tables.LN", bad_status_table, locale),
|
|
175
|
+
"SGT" => SkillGetTable.from_i18n("BeginningIdol.tables.SGT", skill_table, locale),
|
|
176
|
+
"RS" => SkillGetTable.from_i18n("BeginningIdol.tables.RS", skill_table, locale),
|
|
177
|
+
}
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
TABLES = translate_tables(:ja_jp)
|
|
182
|
+
|
|
183
|
+
BAD_STATUS_TABLE = BadStatusTable.new(:ja_jp)
|
|
184
|
+
|
|
185
|
+
LOCAL_WORK_TABLE = translate_local_work_table(:ja_jp)
|
|
186
|
+
ITEM_TABLE = ItemTable.new(:ja_jp)
|
|
187
|
+
|
|
188
|
+
SKILL_TABLE = translate_skill_table(:ja_jp)
|
|
189
|
+
|
|
190
|
+
register_prefix(TABLES.keys)
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BCDice
|
|
4
|
+
module GameSystem
|
|
5
|
+
class BeginningIdol < Base
|
|
6
|
+
module WithAbnormality
|
|
7
|
+
def replace_abnormality(chosen, randomizer)
|
|
8
|
+
reg = Regexp.new(I18n.t("BeginningIdol.abnormality.regexp", locale: @locale))
|
|
9
|
+
m = reg.match(chosen.body)
|
|
10
|
+
unless m
|
|
11
|
+
return chosen
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
abno_count = kanji_to_i(m[1])
|
|
15
|
+
unless abno_count
|
|
16
|
+
return chosen
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
text = @bad_status_table.roll(randomizer, abno_count)
|
|
20
|
+
new_body = chosen.body.sub(reg, text)
|
|
21
|
+
|
|
22
|
+
return DiceTable::RollResult.new(chosen.table_name, chosen.value, new_body)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def kanji_to_i(kanji)
|
|
26
|
+
list = I18n.t("BeginningIdol.abnormality.num_map", locale: @locale)
|
|
27
|
+
list.find_index(kanji)&.succ
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
class D66WithAbnormality < DiceTable::D66Table
|
|
32
|
+
include WithAbnormality
|
|
33
|
+
|
|
34
|
+
def self.from_i18n(key, bad_status_table, locale)
|
|
35
|
+
table = I18n.t(key, locale: locale)
|
|
36
|
+
sort_type = D66SortType.const_get(table[:d66_sort_type])
|
|
37
|
+
|
|
38
|
+
new(table[:name], sort_type, table[:items], bad_status_table, locale)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(name, sort_type, items, bad_status_table, locale)
|
|
42
|
+
super(name, sort_type, items)
|
|
43
|
+
@bad_status_table = bad_status_table
|
|
44
|
+
@locale = locale
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def roll(randomizer)
|
|
48
|
+
chosen = super(randomizer)
|
|
49
|
+
replace_abnormality(chosen, randomizer)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
class TableWithAbnormality < DiceTable::Table
|
|
54
|
+
include WithAbnormality
|
|
55
|
+
|
|
56
|
+
def self.from_i18n(key, bad_status_table, locale)
|
|
57
|
+
table = I18n.t(key, locale: locale)
|
|
58
|
+
new(table[:name], table[:type], table[:items], bad_status_table, locale)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def initialize(name, type, items, bad_status_table, locale)
|
|
62
|
+
super(name, type, items)
|
|
63
|
+
@bad_status_table = bad_status_table
|
|
64
|
+
@locale = locale
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def roll(randomizer)
|
|
68
|
+
chosen = super(randomizer)
|
|
69
|
+
replace_abnormality(chosen, randomizer)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BCDice
|
|
4
|
+
module GameSystem
|
|
5
|
+
class BeginningIdol < Base
|
|
6
|
+
class WorkWithChanceTable < DiceTable::D66Table
|
|
7
|
+
def self.from_i18n(key, locale)
|
|
8
|
+
table = I18n.t(key, locale: locale)
|
|
9
|
+
sort_type = D66SortType.const_get(table[:d66_sort_type])
|
|
10
|
+
|
|
11
|
+
new(table[:name], sort_type, table[:items], locale)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def initialize(name, sort_type, items, locale)
|
|
15
|
+
super(name, sort_type, items)
|
|
16
|
+
@regexp = Regexp.new(I18n.t("BeginningIdol.with_chance.regexp", locale: locale))
|
|
17
|
+
@off = I18n.t("BeginningIdol.with_chance.off_text", locale: locale)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def roll_command(randomizer, command)
|
|
21
|
+
m = /^LO([1-6]{1,2})?$/.match(command)
|
|
22
|
+
unless m
|
|
23
|
+
return nil
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
roll(randomizer, m[1]&.to_i)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def roll(randomizer, chance = nil)
|
|
30
|
+
chosen = super(randomizer)
|
|
31
|
+
unless chance
|
|
32
|
+
return chosen
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
m = @regexp.match(chosen.body)
|
|
36
|
+
if m && m[1].to_i >= chance
|
|
37
|
+
DiceTable::RollResult.new(chosen.table_name, chosen.value, @off)
|
|
38
|
+
elsif m
|
|
39
|
+
DiceTable::RollResult.new(chosen.table_name, chosen.value, chosen.body.sub(@regexp, ""))
|
|
40
|
+
else
|
|
41
|
+
chosen
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
class << self
|
|
47
|
+
private
|
|
48
|
+
|
|
49
|
+
def translate_local_work_table(locale)
|
|
50
|
+
WorkWithChanceTable.from_i18n("BeginningIdol.local_work", locale)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
register_prefix("LO")
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -112,7 +112,7 @@ module BCDice
|
|
|
112
112
|
[3, "あなたの国は、英雄が用いた武具の伝説が残っている。レア武具アイテムの中からランダムに1種を選ぶ。そのレアアイテムのレシピを持っている。【王宮】のある部屋に、そのレア武具アイテムの名前を記入すること。"],
|
|
113
113
|
[4, "あなたの国は、有名な職人たちが揃う工業国家である。コモンアイテムを作成するとき、それらのアイテムを作成するための必要国力が1点高いものとして扱う。"],
|
|
114
114
|
[5, "あなたの国は、質実剛健な兵士たちが揃っている。その国のキャラクターは、《配下》最大値が1人上昇する(最大2人まで上昇する。3回目以降は振り直すこと)。"],
|
|
115
|
-
[6, "あなたの国は、過去に列強に臣従し、いまでも友好的な関係を築いている。(1D6)を振ること。1ならダイナマイト帝国、2なら千年王朝、3ならメトロ汗国、4
|
|
115
|
+
[6, "あなたの国は、過去に列強に臣従し、いまでも友好的な関係を築いている。(1D6)を振ること。1ならダイナマイト帝国、2なら千年王朝、3ならメトロ汗国、4ならハグルマ資本主義神聖共和国との関係が「友好」になる。5や6なら振り直すこと。また、その列強の列強系施設1軒を獲得する。"],
|
|
116
116
|
]
|
|
117
117
|
return get_table_by_number(num, table)
|
|
118
118
|
end
|