Skip to content

Commit

Permalink
カムズの追加 (#282)
Browse files Browse the repository at this point in the history
* カムズの追加

* カムズの脱i18n化と不要なinitalizeの削除
  • Loading branch information
raa0121 authored Nov 8, 2020
1 parent cccc6b6 commit b20987a
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/bcdice/game_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
require "bcdice/game_system/Chill3"
require "bcdice/game_system/CodeLayerd"
require "bcdice/game_system/ColossalHunter"
require "bcdice/game_system/Comes"
require "bcdice/game_system/CrashWorld"
require "bcdice/game_system/Cthulhu"
require "bcdice/game_system/Cthulhu7th"
Expand Down
50 changes: 50 additions & 0 deletions lib/bcdice/game_system/Comes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# frozen_string_literal: true

module BCDice
module GameSystem
class Comes < Base
# ゲームシステムの識別子
ID = 'Comes'

# ゲームシステム名
NAME = 'カムズ'

# ゲームシステム名の読みがな
SORT_KEY = 'かむす'

# ダイスボットの使い方
HELP_MESSAGE = <<~INFO_MESSAGE_TEXT
・各種表
 判定ペナルティ表 PT
INFO_MESSAGE_TEXT

def initialize(command)
super(command)

@sort_add_dice = true
@d66_sort_type = D66SortType::ASC
end

def eval_game_system_specific_command(command)
return roll_tables(command, self.class::TABLES)
end

TABLES = {
'PT' => DiceTable::Table.new(
'判定ペナルティ表',
'1D6',
[
'恐ろしい目に合う。『恐怖』を与える。',
'今見ているものを理解できない。『混乱』を与える。',
'我を忘れて見とれてしまう。『魅了』を与える。',
'思わぬ遠回りをしてしまう。『疲労』を与える。',
'大きな失態を演じてしまう。『負傷』を与える。',
'別の困難が立ちはだかる。新たに判定を行わせる。',
]
)
}.freeze

register_prefix(TABLES.keys)
end
end
end
15 changes: 15 additions & 0 deletions test/data/Comes.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[[ test ]]
game_system = "Comes"
input = "PT"
output = "判定ペナルティ表(1) > 恐ろしい目に合う。『恐怖』を与える。"
rands = [
{ sides = 6, value = 1 },
]

[[ test ]]
game_system = "Comes"
input = "PT"
output = "判定ペナルティ表(6) > 別の困難が立ちはだかる。新たに判定を行わせる。"
rands = [
{ sides = 6, value = 6 },
]

0 comments on commit b20987a

Please sign in to comment.