Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

カムズの追加 #282

Merged
merged 2 commits into from
Nov 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 },
]