bcdice 3.0.0.pre.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (258) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +21 -0
  3. data/.github/.codecov.yaml +10 -0
  4. data/.github/workflows/coverage.yaml +21 -0
  5. data/.github/workflows/lint.yaml +13 -0
  6. data/.github/workflows/test.yml +20 -0
  7. data/.gitignore +14 -0
  8. data/.rubocop.yml +96 -0
  9. data/.rubocop_todo.yml +113 -0
  10. data/CHANGELOG.md +868 -0
  11. data/Gemfile +11 -0
  12. data/LICENSE +29 -0
  13. data/README.md +38 -0
  14. data/ROADMAP.md +30 -0
  15. data/Rakefile +118 -0
  16. data/bcdice.gemspec +27 -0
  17. data/bin/repl.rb +21 -0
  18. data/docs/README.txt +2028 -0
  19. data/docs/dicebot_sort_key.md +72 -0
  20. data/docs/how_to_make_dicebot.md +453 -0
  21. data/lib/bcdice.rb +8 -0
  22. data/lib/bcdice/arithmetic_evaluator.rb +167 -0
  23. data/lib/bcdice/base.rb +423 -0
  24. data/lib/bcdice/command_parser.rb +242 -0
  25. data/lib/bcdice/common_command.rb +23 -0
  26. data/lib/bcdice/common_command/add_dice.rb +54 -0
  27. data/lib/bcdice/common_command/add_dice/node.rb +488 -0
  28. data/lib/bcdice/common_command/add_dice/parser.rb +282 -0
  29. data/lib/bcdice/common_command/add_dice/randomizer.rb +48 -0
  30. data/lib/bcdice/common_command/barabara_dice.rb +57 -0
  31. data/lib/bcdice/common_command/calc.rb +39 -0
  32. data/lib/bcdice/common_command/choice.rb +35 -0
  33. data/lib/bcdice/common_command/d66_dice.rb +63 -0
  34. data/lib/bcdice/common_command/reroll_dice.rb +190 -0
  35. data/lib/bcdice/common_command/upper_dice.rb +165 -0
  36. data/lib/bcdice/common_command/version.rb +26 -0
  37. data/lib/bcdice/dice_table.rb +8 -0
  38. data/lib/bcdice/dice_table/chain_table.rb +33 -0
  39. data/lib/bcdice/dice_table/d66_grid_table.rb +26 -0
  40. data/lib/bcdice/dice_table/d66_range_table.rb +26 -0
  41. data/lib/bcdice/dice_table/d66_table.rb +34 -0
  42. data/lib/bcdice/dice_table/range_table.rb +267 -0
  43. data/lib/bcdice/dice_table/roll_result.rb +43 -0
  44. data/lib/bcdice/dice_table/sai_fic_skill_table.rb +32 -0
  45. data/lib/bcdice/dice_table/table.rb +35 -0
  46. data/lib/bcdice/enum.rb +15 -0
  47. data/lib/bcdice/format.rb +36 -0
  48. data/lib/bcdice/game_system.rb +187 -0
  49. data/lib/bcdice/game_system/AFF2e.rb +141 -0
  50. data/lib/bcdice/game_system/AceKillerGene.rb +55 -0
  51. data/lib/bcdice/game_system/Airgetlamh.rb +117 -0
  52. data/lib/bcdice/game_system/Alsetto.rb +124 -0
  53. data/lib/bcdice/game_system/Alshard.rb +27 -0
  54. data/lib/bcdice/game_system/AlterRaise.rb +282 -0
  55. data/lib/bcdice/game_system/Amadeus.rb +622 -0
  56. data/lib/bcdice/game_system/Amadeus_Korean.rb +501 -0
  57. data/lib/bcdice/game_system/AnimaAnimus.rb +96 -0
  58. data/lib/bcdice/game_system/Arianrhod.rb +50 -0
  59. data/lib/bcdice/game_system/ArsMagica.rb +149 -0
  60. data/lib/bcdice/game_system/Avandner.rb +101 -0
  61. data/lib/bcdice/game_system/BBN.rb +143 -0
  62. data/lib/bcdice/game_system/BadLife.rb +435 -0
  63. data/lib/bcdice/game_system/BarnaKronika.rb +188 -0
  64. data/lib/bcdice/game_system/BattleTech.rb +530 -0
  65. data/lib/bcdice/game_system/BeastBindTrinity.rb +348 -0
  66. data/lib/bcdice/game_system/BeginningIdol.rb +2527 -0
  67. data/lib/bcdice/game_system/BeginningIdol_Korean.rb +2378 -0
  68. data/lib/bcdice/game_system/BladeOfArcana.rb +252 -0
  69. data/lib/bcdice/game_system/BlindMythos.rb +460 -0
  70. data/lib/bcdice/game_system/BloodCrusade.rb +423 -0
  71. data/lib/bcdice/game_system/BloodMoon.rb +213 -0
  72. data/lib/bcdice/game_system/CardRanker.rb +249 -0
  73. data/lib/bcdice/game_system/ChaosFlare.rb +181 -0
  74. data/lib/bcdice/game_system/Chill.rb +163 -0
  75. data/lib/bcdice/game_system/Chill3.rb +52 -0
  76. data/lib/bcdice/game_system/CodeLayerd.rb +132 -0
  77. data/lib/bcdice/game_system/ColossalHunter.rb +569 -0
  78. data/lib/bcdice/game_system/CrashWorld.rb +81 -0
  79. data/lib/bcdice/game_system/Cthulhu.rb +252 -0
  80. data/lib/bcdice/game_system/Cthulhu7th.rb +767 -0
  81. data/lib/bcdice/game_system/Cthulhu7th_ChineseTraditional.rb +386 -0
  82. data/lib/bcdice/game_system/Cthulhu7th_Korean.rb +383 -0
  83. data/lib/bcdice/game_system/CthulhuTech.rb +263 -0
  84. data/lib/bcdice/game_system/Cthulhu_ChineseTraditional.rb +243 -0
  85. data/lib/bcdice/game_system/Cthulhu_Korean.rb +240 -0
  86. data/lib/bcdice/game_system/DarkBlaze.rb +207 -0
  87. data/lib/bcdice/game_system/DarkDaysDrive.rb +425 -0
  88. data/lib/bcdice/game_system/DarkSouls.rb +91 -0
  89. data/lib/bcdice/game_system/DeadlineHeroes.rb +583 -0
  90. data/lib/bcdice/game_system/DemonParasite.rb +524 -0
  91. data/lib/bcdice/game_system/DetatokoSaga.rb +310 -0
  92. data/lib/bcdice/game_system/DetatokoSaga_Korean.rb +310 -0
  93. data/lib/bcdice/game_system/DiceBot.rb +17 -0
  94. data/lib/bcdice/game_system/DiceOfTheDead.rb +111 -0
  95. data/lib/bcdice/game_system/DoubleCross.rb +373 -0
  96. data/lib/bcdice/game_system/DoubleCross_Korean.rb +371 -0
  97. data/lib/bcdice/game_system/Dracurouge.rb +1856 -0
  98. data/lib/bcdice/game_system/Dracurouge_Korean.rb +310 -0
  99. data/lib/bcdice/game_system/DungeonsAndDragons.rb +19 -0
  100. data/lib/bcdice/game_system/EarthDawn.rb +225 -0
  101. data/lib/bcdice/game_system/EarthDawn3.rb +275 -0
  102. data/lib/bcdice/game_system/EarthDawn4.rb +272 -0
  103. data/lib/bcdice/game_system/EclipsePhase.rb +51 -0
  104. data/lib/bcdice/game_system/Elric.rb +36 -0
  105. data/lib/bcdice/game_system/Elysion.rb +1213 -0
  106. data/lib/bcdice/game_system/EmbryoMachine.rb +227 -0
  107. data/lib/bcdice/game_system/EndBreaker.rb +132 -0
  108. data/lib/bcdice/game_system/EtrianOdysseySRS.rb +27 -0
  109. data/lib/bcdice/game_system/Fiasco.rb +123 -0
  110. data/lib/bcdice/game_system/Fiasco_Korean.rb +122 -0
  111. data/lib/bcdice/game_system/FilledWith.rb +1543 -0
  112. data/lib/bcdice/game_system/FullMetalPanic.rb +27 -0
  113. data/lib/bcdice/game_system/FutariSousa.rb +994 -0
  114. data/lib/bcdice/game_system/FutariSousa_Korean.rb +994 -0
  115. data/lib/bcdice/game_system/Garako.rb +559 -0
  116. data/lib/bcdice/game_system/GardenOrder.rb +451 -0
  117. data/lib/bcdice/game_system/GehennaAn.rb +136 -0
  118. data/lib/bcdice/game_system/GeishaGirlwithKatana.rb +120 -0
  119. data/lib/bcdice/game_system/GoblinSlayer.rb +168 -0
  120. data/lib/bcdice/game_system/GoldenSkyStories.rb +77 -0
  121. data/lib/bcdice/game_system/Gorilla.rb +44 -0
  122. data/lib/bcdice/game_system/GranCrest.rb +518 -0
  123. data/lib/bcdice/game_system/Gundog.rb +52 -0
  124. data/lib/bcdice/game_system/GundogRevised.rb +294 -0
  125. data/lib/bcdice/game_system/GundogZero.rb +261 -0
  126. data/lib/bcdice/game_system/Gurps.rb +403 -0
  127. data/lib/bcdice/game_system/GurpsFW.rb +2330 -0
  128. data/lib/bcdice/game_system/HarnMaster.rb +208 -0
  129. data/lib/bcdice/game_system/HatsuneMiku.rb +706 -0
  130. data/lib/bcdice/game_system/Hieizan.rb +48 -0
  131. data/lib/bcdice/game_system/HouraiGakuen.rb +270 -0
  132. data/lib/bcdice/game_system/HuntersMoon.rb +503 -0
  133. data/lib/bcdice/game_system/Illusio.rb +89 -0
  134. data/lib/bcdice/game_system/InfiniteFantasia.rb +51 -0
  135. data/lib/bcdice/game_system/Insane.rb +822 -0
  136. data/lib/bcdice/game_system/Insane_Korean.rb +773 -0
  137. data/lib/bcdice/game_system/IthaWenUa.rb +38 -0
  138. data/lib/bcdice/game_system/JamesBond.rb +45 -0
  139. data/lib/bcdice/game_system/Kamigakari.rb +394 -0
  140. data/lib/bcdice/game_system/Kamigakari_Korean.rb +428 -0
  141. data/lib/bcdice/game_system/KanColle.rb +938 -0
  142. data/lib/bcdice/game_system/KemonoNoMori.rb +258 -0
  143. data/lib/bcdice/game_system/KillDeathBusiness.rb +1420 -0
  144. data/lib/bcdice/game_system/KillDeathBusiness_Korean.rb +1510 -0
  145. data/lib/bcdice/game_system/KurayamiCrying.rb +49 -0
  146. data/lib/bcdice/game_system/LiveraDoll.rb +375 -0
  147. data/lib/bcdice/game_system/LogHorizon.rb +3567 -0
  148. data/lib/bcdice/game_system/LogHorizon_Korean.rb +1407 -0
  149. data/lib/bcdice/game_system/LostRecord.rb +30 -0
  150. data/lib/bcdice/game_system/LostRoyal.rb +242 -0
  151. data/lib/bcdice/game_system/MagicaLogia.rb +1148 -0
  152. data/lib/bcdice/game_system/MeikyuDays.rb +415 -0
  153. data/lib/bcdice/game_system/MeikyuKingdom.rb +466 -0
  154. data/lib/bcdice/game_system/MeikyuKingdomBasic.rb +269 -0
  155. data/lib/bcdice/game_system/MetalHead.rb +249 -0
  156. data/lib/bcdice/game_system/MetalHeadExtream.rb +917 -0
  157. data/lib/bcdice/game_system/MetallicGuardian.rb +31 -0
  158. data/lib/bcdice/game_system/MonotoneMuseum.rb +354 -0
  159. data/lib/bcdice/game_system/MonotoneMuseum_Korean.rb +304 -0
  160. data/lib/bcdice/game_system/Nechronica.rb +211 -0
  161. data/lib/bcdice/game_system/Nechronica_Korean.rb +160 -0
  162. data/lib/bcdice/game_system/NeverCloud.rb +74 -0
  163. data/lib/bcdice/game_system/NightWizard.rb +231 -0
  164. data/lib/bcdice/game_system/NightWizard3rd.rb +24 -0
  165. data/lib/bcdice/game_system/NightmareHunterDeep.rb +117 -0
  166. data/lib/bcdice/game_system/NinjaSlayer.rb +274 -0
  167. data/lib/bcdice/game_system/NjslyrBattle.rb +54 -0
  168. data/lib/bcdice/game_system/Nuekagami.rb +293 -0
  169. data/lib/bcdice/game_system/OneWayHeroics.rb +134 -0
  170. data/lib/bcdice/game_system/OracleEngine.rb +265 -0
  171. data/lib/bcdice/game_system/OrgaRain.rb +77 -0
  172. data/lib/bcdice/game_system/Oukahoushin3rd.rb +162 -0
  173. data/lib/bcdice/game_system/Paradiso.rb +323 -0
  174. data/lib/bcdice/game_system/Paranoia.rb +64 -0
  175. data/lib/bcdice/game_system/ParanoiaRebooted.rb +109 -0
  176. data/lib/bcdice/game_system/ParasiteBlood.rb +231 -0
  177. data/lib/bcdice/game_system/Pathfinder.rb +21 -0
  178. data/lib/bcdice/game_system/Peekaboo.rb +324 -0
  179. data/lib/bcdice/game_system/Pendragon.rb +39 -0
  180. data/lib/bcdice/game_system/PhantasmAdventure.rb +73 -0
  181. data/lib/bcdice/game_system/Postman.rb +185 -0
  182. data/lib/bcdice/game_system/PulpCthulhu.rb +184 -0
  183. data/lib/bcdice/game_system/Raisondetre.rb +171 -0
  184. data/lib/bcdice/game_system/RecordOfLodossWar.rb +58 -0
  185. data/lib/bcdice/game_system/RecordOfSteam.rb +149 -0
  186. data/lib/bcdice/game_system/RokumonSekai2.rb +110 -0
  187. data/lib/bcdice/game_system/RoleMaster.rb +24 -0
  188. data/lib/bcdice/game_system/RuneQuest.rb +47 -0
  189. data/lib/bcdice/game_system/RyuTuber.rb +266 -0
  190. data/lib/bcdice/game_system/Ryutama.rb +199 -0
  191. data/lib/bcdice/game_system/SRS.rb +348 -0
  192. data/lib/bcdice/game_system/SamsaraBallad.rb +111 -0
  193. data/lib/bcdice/game_system/Satasupe.rb +1173 -0
  194. data/lib/bcdice/game_system/ScreamHighSchool.rb +128 -0
  195. data/lib/bcdice/game_system/SevenFortressMobius.rb +34 -0
  196. data/lib/bcdice/game_system/ShadowRun.rb +26 -0
  197. data/lib/bcdice/game_system/ShadowRun4.rb +49 -0
  198. data/lib/bcdice/game_system/ShadowRun5.rb +80 -0
  199. data/lib/bcdice/game_system/SharedFantasia.rb +69 -0
  200. data/lib/bcdice/game_system/ShinMegamiTenseiKakuseihen.rb +85 -0
  201. data/lib/bcdice/game_system/ShinkuuGakuen.rb +506 -0
  202. data/lib/bcdice/game_system/ShinobiGami.rb +680 -0
  203. data/lib/bcdice/game_system/ShoujoTenrankai.rb +677 -0
  204. data/lib/bcdice/game_system/Skynauts.rb +324 -0
  205. data/lib/bcdice/game_system/SteamPunkers.rb +485 -0
  206. data/lib/bcdice/game_system/StellarKnights.rb +856 -0
  207. data/lib/bcdice/game_system/SterileLife.rb +452 -0
  208. data/lib/bcdice/game_system/StrangerOfSwordCity.rb +103 -0
  209. data/lib/bcdice/game_system/StratoShout.rb +316 -0
  210. data/lib/bcdice/game_system/StratoShout_Korean.rb +314 -0
  211. data/lib/bcdice/game_system/Strave.rb +223 -0
  212. data/lib/bcdice/game_system/SwordWorld.rb +491 -0
  213. data/lib/bcdice/game_system/SwordWorld2_0.rb +295 -0
  214. data/lib/bcdice/game_system/SwordWorld2_5.rb +121 -0
  215. data/lib/bcdice/game_system/TherapieSein.rb +93 -0
  216. data/lib/bcdice/game_system/TokumeiTenkousei.rb +96 -0
  217. data/lib/bcdice/game_system/TokyoGhostResearch.rb +122 -0
  218. data/lib/bcdice/game_system/TokyoNova.rb +19 -0
  219. data/lib/bcdice/game_system/Torg.rb +364 -0
  220. data/lib/bcdice/game_system/Torg1_5.rb +139 -0
  221. data/lib/bcdice/game_system/TorgEternity.rb +414 -0
  222. data/lib/bcdice/game_system/TrinitySeven.rb +364 -0
  223. data/lib/bcdice/game_system/TunnelsAndTrolls.rb +287 -0
  224. data/lib/bcdice/game_system/TwilightGunsmoke.rb +527 -0
  225. data/lib/bcdice/game_system/Utakaze.rb +153 -0
  226. data/lib/bcdice/game_system/VampireTheMasquerade5th.rb +132 -0
  227. data/lib/bcdice/game_system/Villaciel.rb +555 -0
  228. data/lib/bcdice/game_system/WARPS.rb +33 -0
  229. data/lib/bcdice/game_system/WaresBlade.rb +34 -0
  230. data/lib/bcdice/game_system/Warhammer.rb +336 -0
  231. data/lib/bcdice/game_system/WitchQuest.rb +275 -0
  232. data/lib/bcdice/game_system/WorldOfDarkness.rb +135 -0
  233. data/lib/bcdice/game_system/YankeeYogSothoth.rb +440 -0
  234. data/lib/bcdice/game_system/YearZeroEngine.rb +134 -0
  235. data/lib/bcdice/game_system/ZettaiReido.rb +142 -0
  236. data/lib/bcdice/game_system/meikyu_kingdom/item_table.rb +383 -0
  237. data/lib/bcdice/game_system/meikyu_kingdom/kingdom_name_table.rb +89 -0
  238. data/lib/bcdice/game_system/meikyu_kingdom/landscape_table.rb +196 -0
  239. data/lib/bcdice/game_system/meikyu_kingdom/name_tables.rb +223 -0
  240. data/lib/bcdice/game_system/meikyu_kingdom/placename_table.rb +214 -0
  241. data/lib/bcdice/game_system/meikyu_kingdom/tables.rb +610 -0
  242. data/lib/bcdice/game_system/meikyu_kingdom/word_table.rb +117 -0
  243. data/lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb +380 -0
  244. data/lib/bcdice/game_system/meikyu_kingdom_basic/kingdom_table.rb +184 -0
  245. data/lib/bcdice/game_system/meikyu_kingdom_basic/name_table.rb +417 -0
  246. data/lib/bcdice/game_system/meikyu_kingdom_basic/table.rb +912 -0
  247. data/lib/bcdice/game_system/meikyu_kingdom_basic/word_table.rb +121 -0
  248. data/lib/bcdice/game_system/one_way_heroics/dungeon_table.rb +67 -0
  249. data/lib/bcdice/game_system/one_way_heroics/random_event_table.rb +166 -0
  250. data/lib/bcdice/game_system/one_way_heroics/tables.rb +668 -0
  251. data/lib/bcdice/loader.rb +37 -0
  252. data/lib/bcdice/normalize.rb +38 -0
  253. data/lib/bcdice/preprocessor.rb +87 -0
  254. data/lib/bcdice/randomizer.rb +137 -0
  255. data/lib/bcdice/repl.rb +155 -0
  256. data/lib/bcdice/user_defined_dice_table.rb +153 -0
  257. data/lib/bcdice/version.rb +3 -0
  258. metadata +304 -0
@@ -0,0 +1,117 @@
1
+ module BCDice
2
+ module GameSystem
3
+ class MeikyuKingdom
4
+ # 単語表1(D66)
5
+ def mk_word_1_table(num)
6
+ table = [
7
+ [11, "魔法"],
8
+ [12, "おめかし"],
9
+ [13, "狭いところ"],
10
+ [14, "夜更かし"],
11
+ [15, "節約"],
12
+ [16, "会議"],
13
+ [22, "ヒゲ"],
14
+ [23, "孤独"],
15
+ [24, "自慢話"],
16
+ [25, "自分探し"],
17
+ [26, "異性"],
18
+ [33, "ヒラヒラした服"],
19
+ [34, "平穏な生活"],
20
+ [35, "自分語り"],
21
+ [36, "風呂"],
22
+ [44, "古いもの"],
23
+ [45, "頭が悪い人"],
24
+ [46, "暗闇"],
25
+ [55, "許嫁"],
26
+ [56, "民"],
27
+ [66, "バカ"],
28
+ ]
29
+ return get_table_by_number(num, table)
30
+ end
31
+
32
+ # 単語表2(D66)
33
+ def mk_word_2_table(num)
34
+ table = [
35
+ [11, "科学"],
36
+ [12, "読書"],
37
+ [13, "広いところ"],
38
+ [14, "早起き"],
39
+ [15, "ムダ"],
40
+ [16, "仕事"],
41
+ [22, "ハゲ"],
42
+ [23, "みんなで集まること"],
43
+ [24, "ナンパ"],
44
+ [25, "昔話"],
45
+ [26, "同性"],
46
+ [33, "武器の手入れ"],
47
+ [34, "戦争"],
48
+ [35, "人の噂"],
49
+ [36, "散髪"],
50
+ [44, "新しいもの"],
51
+ [45, "頭がよい人"],
52
+ [46, "光"],
53
+ [55, "親"],
54
+ [56, "王様"],
55
+ [66, "ホラ話"],
56
+ ]
57
+ return get_table_by_number(num, table)
58
+ end
59
+
60
+ # 単語表3(D66)
61
+ def mk_word_3_table(num)
62
+ table = [
63
+ [11, "子供"],
64
+ [12, "弱い人"],
65
+ [13, "処刑"],
66
+ [14, "叙事詩"],
67
+ [15, "煙草"],
68
+ [16, "病院"],
69
+ [22, "目立つこと"],
70
+ [23, "酒盛り"],
71
+ [24, "料理"],
72
+ [25, "武芸"],
73
+ [26, "田舎"],
74
+ [33, "自分の国"],
75
+ [34, "伝統"],
76
+ [35, "セレモニー"],
77
+ [36, "告げ口"],
78
+ [44, "自分の声"],
79
+ [45, "マヨネーズ"],
80
+ [46, "おせっかい"],
81
+ [55, "外国人"],
82
+ [56, "迷宮"],
83
+ [66, "ねこみみ"],
84
+ ]
85
+ return get_table_by_number(num, table)
86
+ end
87
+
88
+ # 単語表4(D66)
89
+ def mk_word_4_table(num)
90
+ table = [
91
+ [11, "年寄り"],
92
+ [12, "強い人"],
93
+ [13, "空想"],
94
+ [14, "冗談"],
95
+ [15, "クスリ"],
96
+ [16, "怪物"],
97
+ [22, "一騎打ち"],
98
+ [23, "賭け事"],
99
+ [24, "歌"],
100
+ [25, "勉強"],
101
+ [26, "都会"],
102
+ [33, "冒険"],
103
+ [34, "ダイナマイト大帝"],
104
+ [35, "悪事"],
105
+ [36, "言い訳"],
106
+ [44, "隣のキャラのジョブ"],
107
+ [45, "小鬼"],
108
+ [46, "謝ること"],
109
+ [55, "異種族"],
110
+ [56, "星"],
111
+ [66, "虫"],
112
+ ]
113
+ return get_table_by_number(num, table)
114
+ end
115
+ end
116
+ end
117
+ end
@@ -0,0 +1,380 @@
1
+ module BCDice
2
+ module GameSystem
3
+ class MeikyuKingdomBasic
4
+ WEAPON_ITEM_TABLE = DiceTable::D66Table.new(
5
+ "武具アイテム表",
6
+ D66SortType::ASC,
7
+ {
8
+ 11 => "だんびら",
9
+ 12 => "網(だんびら)",
10
+ 13 => "短剣",
11
+ 14 => "戦斧",
12
+ 15 => "盾",
13
+ 16 => "ホウキ",
14
+ 22 => "棘(だんびら)",
15
+ 23 => "鑓",
16
+ 24 => "石弓",
17
+ 25 => "甲冑",
18
+ 26 => "戦鎚",
19
+ 33 => "鎖(だんびら)",
20
+ 34 => "爆弾",
21
+ 35 => "鉄砲",
22
+ 36 => "大剣",
23
+ 44 => "大弓(だんびら)",
24
+ 45 => "徹甲弾",
25
+ 46 => "拳銃",
26
+ 55 => "手裏剣(だんびら)",
27
+ 56 => "大砲",
28
+ 66 => "籠手(だんびら)",
29
+ }
30
+ )
31
+
32
+ LIFE_ITEM_TABLE = DiceTable::D66Table.new(
33
+ "生活アイテム表",
34
+ D66SortType::ASC,
35
+ {
36
+ 11 => "鍋",
37
+ 12 => "家畜(鍋)",
38
+ 13 => "バックパック",
39
+ 14 => "クラッカー",
40
+ 15 => "がまぐち",
41
+ 16 => "マント",
42
+ 22 => "裁縫道具(鍋)",
43
+ 23 => "カード",
44
+ 24 => "エプロン",
45
+ 25 => "住民台帳",
46
+ 26 => "携帯電話",
47
+ 33 => "外套(鍋)",
48
+ 34 => "肖像画",
49
+ 35 => "衣装",
50
+ 36 => "山吹色のお菓子",
51
+ 44 => "鏡(鍋)",
52
+ 45 => "眼鏡",
53
+ 46 => "クレジットカード",
54
+ 55 => "召喚鍵(鍋)",
55
+ 56 => "魔道書",
56
+ 66 => "宝石(鍋)",
57
+ }
58
+ )
59
+
60
+ REST_ITEM_TABLE = DiceTable::D66Table.new(
61
+ "回復アイテム表",
62
+ D66SortType::ASC,
63
+ {
64
+ 11 => "チョコレート(お弁当)",
65
+ 12 => "砂糖菓子(お弁当)",
66
+ 13 => "特効薬",
67
+ 14 => "保存食",
68
+ 15 => "担架",
69
+ 16 => "お弁当(チョコレート)",
70
+ 22 => "バナナ(お弁当)",
71
+ 23 => "お酒",
72
+ 24 => "珈琲",
73
+ 25 => "フルコース",
74
+ 26 => "ポーション",
75
+ 33 => "魔素水(お弁当)",
76
+ 34 => "救急箱",
77
+ 35 => "強壮剤",
78
+ 36 => "迷宮保険",
79
+ 44 => "魔薬(お弁当)",
80
+ 45 => "科学調味料",
81
+ 46 => "惚れ薬",
82
+ 55 => "軟膏(お弁当)",
83
+ 56 => "復活薬",
84
+ 66 => "万能薬(お弁当)",
85
+ }
86
+ )
87
+
88
+ SEARCH_ITEM_TABLE = DiceTable::D66Table.new(
89
+ "探索アイテム表",
90
+ D66SortType::ASC,
91
+ {
92
+ 11 => "拷問具(星の欠片)",
93
+ 12 => "ロープ(星の欠片)",
94
+ 13 => "旗",
95
+ 14 => "お守り",
96
+ 15 => "星の欠片(拷問具)",
97
+ 16 => "パワーリスト",
98
+ 22 => "松明(星の欠片)",
99
+ 23 => "テント",
100
+ 24 => "楽器",
101
+ 25 => "工具",
102
+ 26 => "使い魔",
103
+ 33 => "迷宮迷彩(星の欠片)",
104
+ 34 => "乗騎",
105
+ 35 => "罠百科",
106
+ 36 => "迷宮防護服",
107
+ 44 => "聴診器(星の欠片)",
108
+ 45 => "地図",
109
+ 46 => "時計",
110
+ 55 => "飛行騎(星の欠片)",
111
+ 56 => "カボチャの馬車",
112
+ 66 => "もぐら棒(星の欠片)",
113
+ }
114
+ )
115
+
116
+ COMMON_ITEM_RANDOM_TABLE = DiceTable::ChainTable.new(
117
+ "コモンアイテムランダム決定表",
118
+ "1D4",
119
+ [
120
+ WEAPON_ITEM_TABLE,
121
+ LIFE_ITEM_TABLE,
122
+ REST_ITEM_TABLE,
123
+ SEARCH_ITEM_TABLE,
124
+ ]
125
+ )
126
+
127
+ NORMAL_RARE_ITEM_TABLE = DiceTable::D66GridTable.new(
128
+ "基本レア一般アイテム表",
129
+ [
130
+ ["愚者の冠", "香水", "煙玉", "悪名", "藁人形", "王妃の鏡"],
131
+ ["星籠", "転ばぬ先の杖", "悟りの書", "鉛の兵隊", "黄金の林檎", "百年茸"],
132
+ ["愚者の冠", "香水", "煙玉", "悪名", "藁人形", "王妃の鏡"],
133
+ ["星籠", "転ばぬ先の杖", "悟りの書", "鉛の兵隊", "黄金の林檎", "百年茸"],
134
+ ["操りロープ", "盗賊の七つ道具", "露眼鏡", "災厄王の遺物", "魔法の鞍", "琵琶"],
135
+ ["兎の足", "視肉", "衛星帯", "魔法の絨毯", "軍配", "聖杯"],
136
+ ]
137
+ )
138
+
139
+ ADVANCED_RARE_ITEM_TABLE = DiceTable::D66GridTable.new(
140
+ "上級レア一般アイテム表",
141
+ [
142
+ ["砂時計週報", "兵糧丸", "遊星葉書", "百科辞典", "夢枕", "蓄音機"],
143
+ ["砂時計週報", "兵糧丸", "遊星葉書", "百科辞典", "夢枕", "蓄音機"],
144
+ ["水晶球", "狭間の棺桶", "不思議なたまご", "魔法瓶", "不死鳥の羽飾り", "紅葫蘆"],
145
+ ["水晶球", "狭間の棺桶", "不思議なたまご", "魔法瓶", "不死鳥の羽飾り", "紅葫蘆"],
146
+ ["打ち出の小槌", "消火器", "滅びの予言書", "召魔鏡", "鉄仮面", "愛"],
147
+ ["打ち出の小槌", "消火器", "滅びの予言書", "召魔鏡", "鉄仮面", "愛"],
148
+ ]
149
+ )
150
+
151
+ RARE_ITEM_RANDOM_TABLE = DiceTable::ChainTable.new(
152
+ "レア一般アイテムランダム決定表",
153
+ "1D6",
154
+ [
155
+ NORMAL_RARE_ITEM_TABLE,
156
+ NORMAL_RARE_ITEM_TABLE,
157
+ NORMAL_RARE_ITEM_TABLE,
158
+ ADVANCED_RARE_ITEM_TABLE,
159
+ ADVANCED_RARE_ITEM_TABLE,
160
+ ADVANCED_RARE_ITEM_TABLE,
161
+ ]
162
+ )
163
+
164
+ NORMAL_RARE_WEAPON_ITEM_TABLE = DiceTable::D66GridTable.new(
165
+ "基本レア武具アイテム表",
166
+ [
167
+ ["蛍矢", "小麦粉", "喇叭銃", "まわし", "しゃべる剣", "大盾"],
168
+ ["王笏", "ぬいぐるみ", "魔杖", "獣の毛皮", "バカには見えない鎧", "ビキニアーマー"],
169
+ ["蛍矢", "小麦粉", "喇叭銃", "まわし", "しゃべる剣", "大盾"],
170
+ ["王笏", "ぬいぐるみ", "魔杖", "獣の毛皮", "バカには見えない鎧", "ビキニアーマー"],
171
+ ["チェインソード", "輝く者", "貪る者", "滅ぼす者", "機械の体", "刈り取る者"],
172
+ ["断ち切る者", "竜の鱗鎧", "射貫く者", "貫く者", "剥ぎ取る者", "王剣"],
173
+ ]
174
+ )
175
+
176
+ ADVANCED_RARE_WEAPON_ITEM_TABLE = DiceTable::D66GridTable.new(
177
+ "上級レア武具アイテム表",
178
+ [
179
+ ["虚弾", "小鬼の襟巻", "眼弾", "釣竿", "虹柱", "服従の鞭"],
180
+ ["虚弾", "小鬼の襟巻", "眼弾", "釣竿", "虹柱", "服従の鞭"],
181
+ ["星の杖", "聖印", "迷い傘", "邪眼", "徒手空拳", "隠れ兜"],
182
+ ["星の杖", "聖印", "迷い傘", "邪眼", "徒手空拳", "隠れ兜"],
183
+ ["太刀鋏", "破城槌", "黄金の鶴嘴", "ムラサマ", "君主の衣", "蒸気甲冑"],
184
+ ["太刀鋏", "破城槌", "黄金の鶴嘴", "ムラサマ", "君主の衣", "蒸気甲冑"],
185
+ ]
186
+ )
187
+
188
+ RARE_WEAPON_ITEM_RANDOM_TABLE = DiceTable::ChainTable.new(
189
+ "レア武具アイテムランダム決定表",
190
+ "1D6",
191
+ [
192
+ NORMAL_RARE_WEAPON_ITEM_TABLE,
193
+ NORMAL_RARE_WEAPON_ITEM_TABLE,
194
+ NORMAL_RARE_WEAPON_ITEM_TABLE,
195
+ ADVANCED_RARE_WEAPON_ITEM_TABLE,
196
+ ADVANCED_RARE_WEAPON_ITEM_TABLE,
197
+ ADVANCED_RARE_WEAPON_ITEM_TABLE,
198
+ ]
199
+ )
200
+
201
+ # デヴァイス・ファクトリー
202
+ def roll_device_factory_table(num)
203
+ item = ITEM_RANDOM_TABLE.roll(@randomizer).last_body
204
+ intro = "デヴァイス・ファクトリー表 (特性#{num}個) > ベースアイテム:#{item}(もしくは任意のアイテム)"
205
+
206
+ num = [0, num].max
207
+ feature_list = Array.new(num) { ITEM_FEATURES_TABLE.roll(randomizer) }
208
+ return [intro, *feature_list].join("\n")
209
+ end
210
+
211
+ # アイテムカテゴリ決定表 (1D6)
212
+ ITEM_RANDOM_TABLE = DiceTable::ChainTable.new(
213
+ "アイテムカテゴリ決定表",
214
+ "1D6",
215
+ [
216
+ WEAPON_ITEM_TABLE,
217
+ LIFE_ITEM_TABLE,
218
+ REST_ITEM_TABLE,
219
+ SEARCH_ITEM_TABLE,
220
+ RARE_ITEM_RANDOM_TABLE,
221
+ RARE_WEAPON_ITEM_RANDOM_TABLE,
222
+ ]
223
+ )
224
+
225
+ class ItemFeature
226
+ def initialize(name, type, items)
227
+ @name = name
228
+ @times, @sides = type.split("D", 2).map(&:to_i)
229
+ @items = items
230
+ end
231
+
232
+ def choice(randomizer)
233
+ dice = randomizer.roll_sum(@times, @sides)
234
+ index = dice - @times
235
+
236
+ chosen = @items[index]
237
+ chosen = chosen.choice(randomizer) if chosen.respond_to?(:choice)
238
+
239
+ return "[#{dice}]#{chosen}"
240
+ end
241
+ end
242
+
243
+ ITEM_POWER_TABLE = ItemFeature.new(
244
+ "神力決定表",
245
+ "1D6",
246
+ [
247
+ "才覚",
248
+ "魅力",
249
+ "探索",
250
+ "武勇",
251
+ "《器》",
252
+ "《回避値》",
253
+ ]
254
+ )
255
+
256
+ ITEM_JYUMON_TABLE = ItemFeature.new(
257
+ "呪紋決定表",
258
+ "2D6",
259
+ [
260
+ "ランダムに選んだモンスターカテゴリ1種のうち、【人類の敵】未習得かつ(2D6)レベル以下のモンスタースキル",
261
+ "便利スキルから好きなスキル1種",
262
+ "芸能スキルから好きなスキル1種",
263
+ "迷宮スキルから好きなスキル1種",
264
+ "星術スキルから好きなスキル1種",
265
+ "一般スキルから好きなスキル1種",
266
+ "召喚スキルから好きなスキル1種",
267
+ "科学スキルから好きなスキル1種",
268
+ "交渉スキルから好きなスキル1種",
269
+ "神官のクラススキルから好きなスキル1種",
270
+ "生まれ表を使用してランダムに決めたジョブのジョブスキル",
271
+ ]
272
+ )
273
+
274
+ ITEM_JYUKA_TABLE = ItemFeature.new(
275
+ "呪禍表",
276
+ "1D6",
277
+ [
278
+ "このアイテムを装備している限り「呪い3」の変調を受ける",
279
+ "このアイテムを装備している限り「肥満3」の変調を受ける",
280
+ "このアイテムを装備している限り「憤怒」の変調を受ける",
281
+ "このアイテムを装備している限り「毒2」の変調を受ける",
282
+ "このアイテムを装備している限り、条件を満たしても誰とも人間関係を結べない",
283
+ "このアイテムを装備している限り「散漫1」の変調を受ける",
284
+ ]
285
+ )
286
+
287
+ GENDER_TABLE = ItemFeature.new(
288
+ "性別決定表",
289
+ "1D6",
290
+ [
291
+ "性別が男であること",
292
+ "性別が女であること",
293
+ "性別が男であること",
294
+ "性別が女であること",
295
+ "性別が男であること",
296
+ "性別が女であること",
297
+ ]
298
+ )
299
+
300
+ ITEM_APTITUDE_TABLE = ItemFeature.new(
301
+ "適正表",
302
+ "1D6",
303
+ [
304
+ "ランダムなクラス1種であること",
305
+ "生まれ表でランダムに選んだジョブであること",
306
+ GENDER_TABLE,
307
+ "上級ジョブであること",
308
+ "モンスタースキルを修得していること",
309
+ "童貞、もしくは処女であること",
310
+ ]
311
+ )
312
+
313
+ ITEM_ATTRIBUTE_TABLE = ItemFeature.new(
314
+ "属性表",
315
+ "1D6",
316
+ [
317
+ "自然の力。10レベル以下の人間カテゴリのモンスターと重要NPC",
318
+ "幻夢の力。10レベル以下の異形と呪物カテゴリのモンスター",
319
+ "星炎の力。10レベル以下の魔獣と鬼族カテゴリのモンスター",
320
+ "暗黒の力。10レベル以下の妖精と天使カテゴリのモンスター",
321
+ "聖なる力。10レベル以下の死霊と深人カテゴリのモンスター",
322
+ "災厄の力。支配者として設定されているキャラクター",
323
+ ]
324
+ )
325
+
326
+ class ItemFeaturesTable
327
+ def initialize
328
+ @items = [
329
+ ["そのアイテムは「", ITEM_POWER_TABLE, "」の神力を宿す。"],
330
+ ["そのアイテムは寿命を持つ。寿命の値を決定する。\nさらに、", self],
331
+ ["そのアイテムは境界障壁を持つ。《HP》の値を決定する。"],
332
+ ["そのアイテムは銘を持つ。銘を決定する。"],
333
+ ["そのアイテムは合成具である。もう1つの機能は「", ITEM_RANDOM_TABLE, "」である。"],
334
+ ["そのアイテムにレベルがあれば、レベルを1点上昇する。\nレベルが設定されていなければ、", self],
335
+ ["そのアイテムは「", ITEM_JYUMON_TABLE, "」の呪紋を持つ。"],
336
+ ["そのアイテムは「", ITEM_JYUKA_TABLE, "」の呪禍を持つ。\nさらに、", self],
337
+ ["そのアイテムは高価だ。価格を設定する。"],
338
+ ["そのアイテムは「条件:", ITEM_APTITUDE_TABLE, "」の適正を持つ。\nさらに、", self],
339
+ ["そのアイテムは「", ITEM_ATTRIBUTE_TABLE, "」の属性を持つ。"],
340
+ ].freeze
341
+ end
342
+
343
+ def roll(randomizer)
344
+ dice = randomizer.roll_sum(2, 6)
345
+ index = dice - 2
346
+ chosen_row = @items[index]
347
+
348
+ string_list = chosen_row.map do |s|
349
+ case s
350
+ when String
351
+ s
352
+ when ItemFeature
353
+ s.choice(randomizer)
354
+ else
355
+ s.roll(randomizer)
356
+ end
357
+ end
358
+
359
+ return "特性[#{dice}]:#{string_list.join('')}"
360
+ end
361
+ end
362
+
363
+ ITEM_FEATURES_TABLE = ItemFeaturesTable.new().freeze
364
+
365
+ ITEM_TABLES = {
366
+ "WIT" => WEAPON_ITEM_TABLE,
367
+ "LIT" => LIFE_ITEM_TABLE,
368
+ "RIT" => REST_ITEM_TABLE,
369
+ "SIT" => SEARCH_ITEM_TABLE,
370
+ "CIR" => COMMON_ITEM_RANDOM_TABLE,
371
+ "NRUT" => NORMAL_RARE_ITEM_TABLE,
372
+ "ARUT" => ADVANCED_RARE_ITEM_TABLE,
373
+ "RUIR" => RARE_ITEM_RANDOM_TABLE,
374
+ "NRWT" => NORMAL_RARE_WEAPON_ITEM_TABLE,
375
+ "ARWT" => ADVANCED_RARE_WEAPON_ITEM_TABLE,
376
+ "RWIR" => RARE_WEAPON_ITEM_RANDOM_TABLE,
377
+ }.freeze
378
+ end
379
+ end
380
+ end