Skip to content

Commit

Permalink
カムズの追加
Browse files Browse the repository at this point in the history
  • Loading branch information
raa0121 committed Nov 5, 2020
1 parent 8e78db3 commit 20129fe
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
14 changes: 14 additions & 0 deletions i18n/Comes/ja_jp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ja_jp:
Comes:
table:
PT:
name: 判定ペナルティ表
type: 1D6
items:
- 恐ろしい目に合う。『恐怖』を与える。
- 今見ているものを理解できない。『混乱』を与える。
- 我を忘れて見とれてしまう。『魅了』を与える。
- 思わぬ遠回りをしてしまう。『疲労』を与える。
- 大きな失態を演じてしまう。『負傷』を与える。
- 別の困難が立ちはだかる。新たに判定を行わせる。

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
44 changes: 44 additions & 0 deletions lib/bcdice/game_system/Comes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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
@enabled_d66 = true
@d66_sort_type = D66SortType::ASC
end

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

def self.translate_tables(locale)
{
"PT" => DiceTable::Table.from_i18n("Comes.table.PT", locale),
}
end

TABLES = translate_tables(:ja_jp)

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 20129fe

Please sign in to comment.