Module: BCDice

Defined in:
lib/bcdice/base.rb,
lib/bcdice/enum.rb,
lib/bcdice/repl.rb,
lib/bcdice/format.rb,
lib/bcdice/loader.rb,
lib/bcdice/result.rb,
lib/bcdice/version.rb,
lib/bcdice/normalize.rb,
lib/bcdice/translate.rb,
lib/bcdice/arithmetic.rb,
lib/bcdice/randomizer.rb,
lib/bcdice/preprocessor.rb,
lib/bcdice/command/lexer.rb,
lib/bcdice/command/parsed.rb,
lib/bcdice/command/parser.rb,
lib/bcdice/common_command.rb,
lib/bcdice/arithmetic/node.rb,
lib/bcdice/game_system/BBN.rb,
lib/bcdice/game_system/NRR.rb,
lib/bcdice/game_system/SRS.rb,
lib/bcdice/dice_table/table.rb,
lib/bcdice/game_system/NSSQ.rb,
lib/bcdice/game_system/Torg.rb,
lib/bcdice/arithmetic/parser.rb,
lib/bcdice/game_system/AFF2e.rb,
lib/bcdice/game_system/Chill.rb,
lib/bcdice/game_system/Comes.rb,
lib/bcdice/game_system/Elric.rb,
lib/bcdice/game_system/GURPS.rb,
lib/bcdice/game_system/Siren.rb,
lib/bcdice/game_system/WARPS.rb,
lib/bcdice/deprecated/checker.rb,
lib/bcdice/game_system/Chill3.rb,
lib/bcdice/game_system/Fiasco.rb,
lib/bcdice/game_system/Garako.rb,
lib/bcdice/game_system/Gundog.rb,
lib/bcdice/game_system/IfIfIf.rb,
lib/bcdice/game_system/Insane.rb,
lib/bcdice/game_system/Kutulu.rb,
lib/bcdice/game_system/Strave.rb,
lib/bcdice/common_command/calc.rb,
lib/bcdice/game_system/Alsetto.rb,
lib/bcdice/game_system/Alshard.rb,
lib/bcdice/game_system/Amadeus.rb,
lib/bcdice/game_system/Ayabito.rb,
lib/bcdice/game_system/BadLife.rb,
lib/bcdice/game_system/Cthulhu.rb,
lib/bcdice/game_system/DiceBot.rb,
lib/bcdice/game_system/Elysion.rb,
lib/bcdice/game_system/Gorilla.rb,
lib/bcdice/game_system/GurpsFW.rb,
lib/bcdice/game_system/Hieizan.rb,
lib/bcdice/game_system/Illusio.rb,
lib/bcdice/game_system/Liminal.rb,
lib/bcdice/game_system/Postman.rb,
lib/bcdice/game_system/Ryutama.rb,
lib/bcdice/game_system/Torg1_5.rb,
lib/bcdice/game_system/Utakaze.rb,
lib/bcdice/arithmetic_evaluator.rb,
lib/bcdice/common_command/lexer.rb,
lib/bcdice/dice_table/d66_table.rb,
lib/bcdice/game_system/Agnostos.rb,
lib/bcdice/game_system/AniMalus.rb,
lib/bcdice/game_system/Avandner.rb,
lib/bcdice/game_system/Emoklore.rb,
lib/bcdice/game_system/FullFace.rb,
lib/bcdice/game_system/Irisbane.rb,
lib/bcdice/game_system/KanColle.rb,
lib/bcdice/game_system/Karukami.rb,
lib/bcdice/game_system/OrgaRain.rb,
lib/bcdice/game_system/Paradiso.rb,
lib/bcdice/game_system/Paranoia.rb,
lib/bcdice/game_system/Peekaboo.rb,
lib/bcdice/game_system/PersonaO.rb,
lib/bcdice/game_system/RyuTuber.rb,
lib/bcdice/game_system/Satasupe.rb,
lib/bcdice/game_system/Shiranui.rb,
lib/bcdice/game_system/Skynauts.rb,
lib/bcdice/game_system/Yotabana.rb,
lib/bcdice/common_command/choice.rb,
lib/bcdice/common_command/repeat.rb,
lib/bcdice/game_system/AngelGear.rb,
lib/bcdice/game_system/Arianrhod.rb,
lib/bcdice/game_system/ArsMagica.rb,
lib/bcdice/game_system/BloodMoon.rb,
lib/bcdice/game_system/DarkBlaze.rb,
lib/bcdice/game_system/DarkSouls.rb,
lib/bcdice/game_system/EarthDawn.rb,
lib/bcdice/game_system/GehennaAn.rb,
lib/bcdice/game_system/GhostLive.rb,
lib/bcdice/game_system/GranCrest.rb,
lib/bcdice/game_system/HeroScale.rb,
lib/bcdice/game_system/IthaWenUa.rb,
lib/bcdice/game_system/JamesBond.rb,
lib/bcdice/game_system/LostRoyal.rb,
lib/bcdice/game_system/MetalHead.rb,
lib/bcdice/game_system/Nuekagami.rb,
lib/bcdice/game_system/Pendragon.rb,
lib/bcdice/game_system/Revulture.rb,
lib/bcdice/game_system/RuneQuest.rb,
lib/bcdice/game_system/ShadowRun.rb,
lib/bcdice/game_system/TokyoNova.rb,
lib/bcdice/game_system/Ventangle.rb,
lib/bcdice/game_system/Villaciel.rb,
lib/bcdice/game_system/Warhammer.rb,
lib/bcdice/game_system/ZombiLine.rb,
lib/bcdice/common_command/version.rb,
lib/bcdice/dice_table/chain_table.rb,
lib/bcdice/dice_table/range_table.rb,
lib/bcdice/dice_table/roll_result.rb,
lib/bcdice/game_system/Airgetlamh.rb,
lib/bcdice/game_system/AlterRaise.rb,
lib/bcdice/game_system/Aoharubaan.rb,
lib/bcdice/game_system/Bakenokawa.rb,
lib/bcdice/game_system/BattleTech.rb,
lib/bcdice/game_system/Bloodorium.rb,
lib/bcdice/game_system/CardRanker.rb,
lib/bcdice/game_system/ChaosFlare.rb,
lib/bcdice/game_system/CodeLayerd.rb,
lib/bcdice/game_system/CrashWorld.rb,
lib/bcdice/game_system/Cthulhu7th.rb,
lib/bcdice/game_system/DemonSpike.rb,
lib/bcdice/game_system/Dracurouge.rb,
lib/bcdice/game_system/EarthDawn3.rb,
lib/bcdice/game_system/EarthDawn4.rb,
lib/bcdice/game_system/EndBreaker.rb,
lib/bcdice/game_system/FilledWith.rb,
lib/bcdice/game_system/GundogZero.rb,
lib/bcdice/game_system/HarnMaster.rb,
lib/bcdice/game_system/JuinKansen.rb,
lib/bcdice/game_system/Kamigakari.rb,
lib/bcdice/game_system/LiveraDoll.rb,
lib/bcdice/game_system/LogHorizon.rb,
lib/bcdice/game_system/LostRecord.rb,
lib/bcdice/game_system/MeikyuDays.rb,
lib/bcdice/game_system/Nechronica.rb,
lib/bcdice/game_system/NeverCloud.rb,
lib/bcdice/game_system/Pathfinder.rb,
lib/bcdice/game_system/RoleMaster.rb,
lib/bcdice/game_system/Sengensyou.rb,
lib/bcdice/game_system/ShadowRun4.rb,
lib/bcdice/game_system/ShadowRun5.rb,
lib/bcdice/game_system/SwordWorld.rb,
lib/bcdice/game_system/UnsungDuet.rb,
lib/bcdice/game_system/WaresBlade.rb,
lib/bcdice/game_system/Warhammer4.rb,
lib/bcdice/game_system/WitchQuest.rb,
lib/bcdice/game_system/Yggdrasill.rb,
lib/bcdice/common_command/add_dice.rb,
lib/bcdice/common_command/d66_dice.rb,
lib/bcdice/game_system/Ainecadette.rb,
lib/bcdice/game_system/AnimaAnimus.rb,
lib/bcdice/game_system/BlackJacket.rb,
lib/bcdice/game_system/BlindMythos.rb,
lib/bcdice/game_system/CthulhuTech.rb,
lib/bcdice/game_system/DoubleCross.rb,
lib/bcdice/game_system/FutariSousa.rb,
lib/bcdice/game_system/GardenOrder.rb,
lib/bcdice/game_system/HatsuneMiku.rb,
lib/bcdice/game_system/HuntersMoon.rb,
lib/bcdice/game_system/MagicaLogia.rb,
lib/bcdice/game_system/NightWizard.rb,
lib/bcdice/game_system/NinjaSlayer.rb,
lib/bcdice/game_system/PulpCthulhu.rb,
lib/bcdice/game_system/Raisondetre.rb,
lib/bcdice/game_system/ShinobiGami.rb,
lib/bcdice/game_system/StarryDolls.rb,
lib/bcdice/game_system/StellarLife.rb,
lib/bcdice/game_system/StratoShout.rb,
lib/bcdice/game_system/ZettaiReido.rb,
lib/bcdice/user_defined_dice_table.rb,
lib/bcdice/common_command/calc/node.rb,
lib/bcdice/game_system/ArknightsFan.rb,
lib/bcdice/game_system/BarnaKronika.rb,
lib/bcdice/game_system/BloodCrusade.rb,
lib/bcdice/game_system/CastleInGray.rb,
lib/bcdice/game_system/CyberpunkRed.rb,
lib/bcdice/game_system/DesperateRun.rb,
lib/bcdice/game_system/DetatokoSaga.rb,
lib/bcdice/game_system/EclipsePhase.rb,
lib/bcdice/game_system/GoblinSlayer.rb,
lib/bcdice/game_system/HouraiGakuen.rb,
lib/bcdice/game_system/KemonoNoMori.rb,
lib/bcdice/game_system/KizunaBullet.rb,
lib/bcdice/game_system/NinjaSlayer2.rb,
lib/bcdice/game_system/NjslyrBattle.rb,
lib/bcdice/game_system/OracleEngine.rb,
lib/bcdice/game_system/RuinBreakers.rb,
lib/bcdice/game_system/SteamPunkers.rb,
lib/bcdice/game_system/TenkaRyouran.rb,
lib/bcdice/game_system/TherapieSein.rb,
lib/bcdice/game_system/TorgEternity.rb,
lib/bcdice/game_system/TrinitySeven.rb,
lib/bcdice/common_command/tally_dice.rb,
lib/bcdice/common_command/upper_dice.rb,
lib/bcdice/dice_table/d66_grid_table.rb,
lib/bcdice/game_system/AceKillerGene.rb,
lib/bcdice/game_system/AssaultEngine.rb,
lib/bcdice/game_system/BeginningIdol.rb,
lib/bcdice/game_system/BladeOfArcana.rb,
lib/bcdice/game_system/DarkDaysDrive.rb,
lib/bcdice/game_system/DemonParasite.rb,
lib/bcdice/game_system/DiceOfTheDead.rb,
lib/bcdice/game_system/DivineCharger.rb,
lib/bcdice/game_system/EmbryoMachine.rb,
lib/bcdice/game_system/Fiasco_Korean.rb,
lib/bcdice/game_system/GundogRevised.rb,
lib/bcdice/game_system/InfiniteBabeL.rb,
lib/bcdice/game_system/Insane_Korean.rb,
lib/bcdice/game_system/InvisibleLiar.rb,
lib/bcdice/game_system/JekyllAndHyde.rb,
lib/bcdice/game_system/MeikyuKingdom.rb,
lib/bcdice/game_system/OneWayHeroics.rb,
lib/bcdice/game_system/ParasiteBlood.rb,
lib/bcdice/game_system/RecordOfSteam.rb,
lib/bcdice/game_system/RokumonSekai2.rb,
lib/bcdice/game_system/SamsaraBallad.rb,
lib/bcdice/game_system/ShinkuuGakuen.rb,
lib/bcdice/game_system/SwordWorld2_0.rb,
lib/bcdice/game_system/SwordWorld2_5.rb,
lib/bcdice/game_system/TheOneRing2nd.rb,
lib/bcdice/game_system/VisionConnect.rb,
lib/bcdice/common_command/calc/parser.rb,
lib/bcdice/common_command/reroll_dice.rb,
lib/bcdice/dice_table/d66_range_table.rb,
lib/bcdice/game_system/Amadeus_Korean.rb,
lib/bcdice/game_system/ColossalHunter.rb,
lib/bcdice/game_system/ConvictorDrive.rb,
lib/bcdice/game_system/Cthulhu_Korean.rb,
lib/bcdice/game_system/DeadlineHeroes.rb,
lib/bcdice/game_system/FateCoreSystem.rb,
lib/bcdice/game_system/FullMetalPanic.rb,
lib/bcdice/game_system/GundamSentinel.rb,
lib/bcdice/game_system/KurayamiCrying.rb,
lib/bcdice/game_system/KyokoShinshoku.rb,
lib/bcdice/game_system/MamonoScramble.rb,
lib/bcdice/game_system/MonotoneMuseum.rb,
lib/bcdice/game_system/NightWizard3rd.rb,
lib/bcdice/game_system/Oukahoushin3rd.rb,
lib/bcdice/game_system/SajinsenkiAGuS.rb,
lib/bcdice/game_system/SharedFantasia.rb,
lib/bcdice/game_system/ShuumatsuKikou.rb,
lib/bcdice/game_system/SkynautsBouken.rb,
lib/bcdice/game_system/StellarKnights.rb,
lib/bcdice/game_system/TrailOfCthulhu.rb,
lib/bcdice/game_system/YearZeroEngine.rb,
lib/bcdice/dice_table/d66_parity_table.rb,
lib/bcdice/game_system/Cthulhu_English.rb,
lib/bcdice/game_system/FinalFantasyXIV.rb,
lib/bcdice/game_system/ShoujoTenrankai.rb,
lib/bcdice/game_system/WorldOfDarkness.rb,
lib/bcdice/game_system/satasupe/tables.rb,
lib/bcdice/common_command/add_dice/node.rb,
lib/bcdice/common_command/barabara_dice.rb,
lib/bcdice/game_system/AlchemiaStruggle.rb,
lib/bcdice/game_system/Arianrhod_Korean.rb,
lib/bcdice/game_system/BeastBindTrinity.rb,
lib/bcdice/game_system/EtrianOdysseySRS.rb,
lib/bcdice/game_system/GoldenSkyStories.rb,
lib/bcdice/game_system/InfiniteFantasia.rb,
lib/bcdice/game_system/MetalHeadExtream.rb,
lib/bcdice/game_system/MetallicGuardian.rb,
lib/bcdice/game_system/ParanoiaRebooted.rb,
lib/bcdice/game_system/SajinsenkiAGuS2E.rb,
lib/bcdice/game_system/ScreamHighSchool.rb,
lib/bcdice/game_system/TalesFromTheLoop.rb,
lib/bcdice/game_system/TokumeiTenkousei.rb,
lib/bcdice/game_system/TunnelsAndTrolls.rb,
lib/bcdice/game_system/TwilightGunsmoke.rb,
lib/bcdice/game_system/YankeeYogSothoth.rb,
lib/bcdice/game_system/BeginningIdol2022.rb,
lib/bcdice/game_system/Cthulhu7th_Korean.rb,
lib/bcdice/game_system/Dracurouge_Korean.rb,
lib/bcdice/game_system/Kamigakari_Korean.rb,
lib/bcdice/game_system/KillDeathBusiness.rb,
lib/bcdice/game_system/LogHorizon_Korean.rb,
lib/bcdice/game_system/Nechronica_Korean.rb,
lib/bcdice/game_system/PastFutureParadox.rb,
lib/bcdice/game_system/PhantasmAdventure.rb,
lib/bcdice/game_system/RecordOfLodossWar.rb,
lib/bcdice/game_system/UnsungDuet_Korean.rb,
lib/bcdice/common_command/add_dice/parser.rb,
lib/bcdice/common_command/tally_dice/node.rb,
lib/bcdice/common_command/upper_dice/node.rb,
lib/bcdice/dice_table/d66_half_grid_table.rb,
lib/bcdice/dice_table/d66_one_third_table.rb,
lib/bcdice/dice_table/sai_fic_skill_table.rb,
lib/bcdice/game_system/DoubleCross_Korean.rb,
lib/bcdice/game_system/DungeonsAndDragons.rb,
lib/bcdice/game_system/FutariSousa_Korean.rb,
lib/bcdice/game_system/MagicaLogia_Korean.rb,
lib/bcdice/game_system/MeikyuKingdomBasic.rb,
lib/bcdice/game_system/StratoShout_Korean.rb,
lib/bcdice/game_system/TensaiGunshiNiNaro.rb,
lib/bcdice/game_system/TokyoGhostResearch.rb,
lib/bcdice/game_system/WorldsEndFrontline.rb,
lib/bcdice/common_command/reroll_dice/node.rb,
lib/bcdice/dice_table/d66_left_range_table.rb,
lib/bcdice/game_system/DetatokoSaga_Korean.rb,
lib/bcdice/game_system/DungeonsAndDragons5.rb,
lib/bcdice/game_system/NightmareHunterDeep.rb,
lib/bcdice/game_system/SevenFortressMobius.rb,
lib/bcdice/game_system/StrangerOfSwordCity.rb,
lib/bcdice/game_system/cthulhu7th/rollable.rb,
lib/bcdice/common_command/tally_dice/parser.rb,
lib/bcdice/common_command/upper_dice/parser.rb,
lib/bcdice/game_system/BeginningIdol_Korean.rb,
lib/bcdice/game_system/GeishaGirlwithKatana.rb,
lib/bcdice/game_system/NobunagasBlackCastle.rb,
lib/bcdice/game_system/ShuumatsuBargainWars.rb,
lib/bcdice/game_system/ToshiakiHolyGrailWar.rb,
lib/bcdice/game_system/beginning_idol/table.rb,
lib/bcdice/game_system/cthulhu7th/full_auto.rb,
lib/bcdice/game_system/cyberpunk_red/tables.rb,
lib/bcdice/game_system/kizuna_bullet/tables.rb,
lib/bcdice/common_command/barabara_dice/node.rb,
lib/bcdice/common_command/reroll_dice/parser.rb,
lib/bcdice/game_system/HunterTheReckoning5th.rb,
lib/bcdice/game_system/MonotoneMuseum_Korean.rb,
lib/bcdice/game_system/StellarKnights_Korean.rb,
lib/bcdice/game_system/meikyu_kingdom/tables.rb,
lib/bcdice/common_command/add_dice/randomizer.rb,
lib/bcdice/game_system/filled_with/lot_tables.rb,
lib/bcdice/game_system/one_way_heroics/tables.rb,
lib/bcdice/common_command/barabara_dice/parser.rb,
lib/bcdice/common_command/barabara_dice/result.rb,
lib/bcdice/game_system/FinalFantasyXIV_English.rb,
lib/bcdice/game_system/VampireTheMasquerade5th.rb,
lib/bcdice/game_system/filled_with/cook_tables.rb,
lib/bcdice/dice_table/sai_fic_skill_table/skill.rb,
lib/bcdice/game_system/KillDeathBusiness_Korean.rb,
lib/bcdice/game_system/WerewolfTheApocalypse5th.rb,
lib/bcdice/game_system/filled_with/event_tables.rb,
lib/bcdice/game_system/sword_world/rating_lexer.rb,
lib/bcdice/game_system/Cthulhu_SimplifiedChinese.rb,
lib/bcdice/game_system/beginning_idol/item_table.rb,
lib/bcdice/game_system/beginning_idol/work_table.rb,
lib/bcdice/game_system/meikyu_kingdom/item_table.rb,
lib/bcdice/game_system/meikyu_kingdom/word_table.rb,
lib/bcdice/game_system/sword_world/rating_parsed.rb,
lib/bcdice/game_system/sword_world/rating_parser.rb,
lib/bcdice/game_system/Cthulhu_ChineseTraditional.rb,
lib/bcdice/game_system/ShinMegamiTenseiKakuseihen.rb,
lib/bcdice/game_system/beginning_idol/chain_table.rb,
lib/bcdice/game_system/beginning_idol/skill_table.rb,
lib/bcdice/game_system/filled_with/tresure_tables.rb,
lib/bcdice/game_system/meikyu_kingdom/name_tables.rb,
lib/bcdice/game_system/meikyu_kingdom_basic/table.rb,
lib/bcdice/game_system/sword_world/rating_options.rb,
lib/bcdice/dice_table/sai_fic_skill_table/category.rb,
lib/bcdice/game_system/SwordWorld_SimplifiedChinese.rb,
lib/bcdice/game_system/TheUnofficialHollowKnightRPG.rb,
lib/bcdice/game_system/beginning_idol/costume_table.rb,
lib/bcdice/game_system/Cthulhu7th_ChineseTraditional.rb,
lib/bcdice/game_system/MagicaLogia_SimplifiedChinese.rb,
lib/bcdice/game_system/beginning_idol/d6_twice_table.rb,
lib/bcdice/game_system/filled_with/enemy_data_tables.rb,
lib/bcdice/game_system/one_way_heroics/dungeon_table.rb,
lib/bcdice/game_system/sword_world/transcendent_test.rb,
lib/bcdice/game_system/beginning_idol/chain_d66_table.rb,
lib/bcdice/game_system/meikyu_kingdom/landscape_table.rb,
lib/bcdice/game_system/meikyu_kingdom/placename_table.rb,
lib/bcdice/game_system/RuneQuestRoleplayingInGlorantha.rb,
lib/bcdice/game_system/SwordWorld2_0_SimplifiedChinese.rb,
lib/bcdice/game_system/SwordWorld2_5_SimplifiedChinese.rb,
lib/bcdice/game_system/beginning_idol/bad_status_table.rb,
lib/bcdice/game_system/beginning_idol/with_abnormality.rb,
lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb,
lib/bcdice/game_system/meikyu_kingdom_basic/name_table.rb,
lib/bcdice/game_system/meikyu_kingdom_basic/word_table.rb,
lib/bcdice/game_system/beginning_idol/accessories_table.rb,
lib/bcdice/game_system/beginning_idol/random_event_table.rb,
lib/bcdice/game_system/meikyu_kingdom/kingdom_name_table.rb,
lib/bcdice/game_system/beginning_idol/my_skill_name_table.rb,
lib/bcdice/game_system/meikyu_kingdom_basic/kingdom_table.rb,
lib/bcdice/game_system/one_way_heroics/random_event_table.rb,
lib/bcdice/game_system/KamitsubakiCityUnderConstructionNarrative.rb

Defined Under Namespace

Modules: Arithmetic, ArithmeticEvaluator, Command, CommonCommand, D66SortType, Deprecated, DiceTable, Format, GameSystem, Normalize, RoundType, Translate Classes: Base, Preprocessor, REPL, Randomizer, Result, TooManyRandsError, UserDefinedDiceTable

Constant Summary collapse

VERSION =
"3.14.0"

Class Method Summary collapse

Class Method Details

.all_game_systemsArray<Class>

ゲームシステムのクラス一覧を返す ゲームシステム一覧がロードされていなければロードする

Returns:

  • (Array<Class>)


18
19
20
21
# File 'lib/bcdice/loader.rb', line 18

def all_game_systems()
  require "bcdice/game_system"
  BCDice::GameSystem.constants.map { |class_name| BCDice::GameSystem.const_get(class_name) }
end

.dynamic_load(id) ⇒ Class?

IDを指定して対象のソースコードを動的にロードし、そのクラスを取得する

Parameters:

  • id (String)

    ID

Returns:

  • (Class, nil)


27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/bcdice/loader.rb', line 27

def dynamic_load(id)
  class_name = id.tr(":.", "_")

  # 対象ディレクトリの外にあるファイルをロードされないように制約を設ける
  unless /\A[A-Z]\w*\z/.match?(class_name)
    return nil
  end

  require "bcdice/game_system/#{class_name}"

  return BCDice::GameSystem.const_get(class_name)
rescue LoadError, NameError
  return nil
end

.game_system_class(id) ⇒ Class?

IDを指定してゲームシステムのクラスを取得する ゲームシステム一覧がロードされていなければロードする

Parameters:

  • id (String)

    ID

Returns:

  • (Class, nil)


10
11
12
# File 'lib/bcdice/loader.rb', line 10

def game_system_class(id)
  all_game_systems.find { |game_system| id == game_system::ID }
end