Skip to content
Open
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
24 changes: 24 additions & 0 deletions i18n/Irisbane/ja_jp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ja_jp:
Irisbane:
zero_dice_count: "判定数が 0 です"
success_dice_count: "成功ダイス数 %{count}"
attack_power: "× 攻撃力 %{power}"
damage: "ダメージ %{damage}"
damage_with_mod: "ダメージ %{damage}%{operator}%{mod_value}"

SceneSituation:
name: "シチュエーション"
"1_3":
- "【日常】何一つ変わることの無い日々の一幕。移ろい易い世界では、それはとても大切である。"
- "【準備】何かを為すための用意をする一幕。情報収集、買物遠征、やるべきことは一杯だ。"
- "【趣味】自分の時間を、有効活用している一幕。必要に追われていない分、心は軽く晴れやかだ。"
- "【喫茶】一息入れ、嗜好品を嗜む時の一幕。穏やかな空気は、だが、往々にして変わりやすい。"
- "【鍛錬】体を鍛え、心を養う修練の一幕。己さえ良ければ、その方法も何だって良い。"
- "【職務】役割の元、仕事に精を出す時の一幕。目的が何であれ、為すべきことに変わりはない。"
"4_6":
- "【移動】何処かから何処かへと向かう一幕。進んでいるなら、手段も目的地も関係あるまい。"
- "【墓前】故人が眠る場所へと赴く一幕。共に眠ることだけは無いように。"
- "【操作】何かを操り、望みを果たしている一幕。運転にせよ何にせよ、脇見には注意が必要だ。"
- "【食事】何かを糧とし、己の力を蓄える一幕。行動すれば消耗する。腹が減っては何とやらだ。"
- "【休息】日々の合間の、憩いの一幕。「何もしない」というのも、立派な行いである。"
- "【夢幻】現実に存在しない何かへと耽る一幕。時間帯に関わらず、何時かは必ず覚めるだろう。"
24 changes: 24 additions & 0 deletions i18n/Irisbane/ko_kr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ko_kr:
Irisbane:
zero_dice_count: "판정 수가 0입니다"
success_dice_count: "성공 주사위 수 %{count}"
attack_power: "× 공격력 %{power}"
damage: "대미지 %{damage}"
damage_with_mod: "대미지 %{damage}%{operator}%{mod_value}"

SceneSituation:
name: "시추에이션"
"1_3":
- "【일상】아무것도 변하지 않는 일상의 한 장면. 변화하기 쉬운 세계에서는 그것이 매우 소중하다."
- "【준비】무언가를 하기 위한 채비를 하는 한 장면. 정보 수집, 쇼핑 원정, 해야 할 일은 가득하다."
- "【취미】자신의 시간을 유효하게 활용하는 한 장면. 쫓기지 않는 만큼 마음이 가볍고 상쾌하다."
- "【카페】한숨 돌리며 기호품을 즐기는 한 장면. 온화한 공기는 그러나 왕왕 변하기 쉽다."
- "【단련】몸을 단련하고 마음을 기르는 수련의 한 장면. 자신만 괜찮다면 그 방법도 무엇이든 좋다."
- "【직무】역할에 따라 일에 힘쓰는 한 장면. 목적이 무엇이든 해야 할 일에는 변함이 없다."
"4_6":
- "【이동】어딘가에서 어딘가로 향하는 한 장면. 나아가고 있다면 수단도 목적지도 상관없다."
- "【묘전】고인이 잠든 장소를 찾는 한 장면. 함께 잠드는 일만은 없도록."
- "【조작】무언가를 다루며 소원을 이루는 한 장면. 운전이든 무엇이든 딴 곳을 보는 것은 주의가 필요하다."
- "【식사】무언가를 양식으로 삼아 자신의 힘을 비축하는 한 장면. 행동하면 소모된다. 배고프면 아무것도 안 된다."
- "【휴식】나날의 틈새, 쉬어 가는 한 장면. '아무것도 하지 않는다'는 것도 훌륭한 행동이다."
- "【몽환】현실에 존재하지 않는 무언가에 빠지는 한 장면. 시간대에 상관없이 언젠가는 반드시 깨어날 것이다."
1 change: 1 addition & 0 deletions lib/bcdice/game_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
require "bcdice/game_system/Insane_Korean"
require "bcdice/game_system/InvisibleLiar"
require "bcdice/game_system/Irisbane"
require "bcdice/game_system/Irisbane_Korean"
require "bcdice/game_system/IthaWenUa"
require "bcdice/game_system/JamesBond"
require "bcdice/game_system/JekyllAndHyde"
Expand Down
54 changes: 24 additions & 30 deletions lib/bcdice/game_system/Irisbane.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def eval_game_system_specific_command(command)
if (m = ATTACK_ROLL_REG.match(command))
roll_attack(m[2], m[3], m[4], m[6], m[7])
else
roll_tables(command, TABLES)
roll_tables(command, self.class::TABLES)
end
end

Expand All @@ -73,7 +73,7 @@ def roll_attack(power_expression, dice_count_expression, border_expression, modi
command = make_command_text(power, dice_count, border, modification_operator, modification_value)

if dice_count <= 0
return "#{command} > 判定数が 0 です"
return "#{command} > #{translate('Irisbane.zero_dice_count')}"
end

dices = @randomizer.roll_barabara(dice_count, 6).sort
Expand All @@ -84,17 +84,17 @@ def roll_attack(power_expression, dice_count_expression, border_expression, modi
message_elements = []
message_elements << command
message_elements << dices.join(',')
message_elements << "成功ダイス数 #{success_dice_count}"
message_elements << "× 攻撃力 #{power}" if success_dice_count > 0
message_elements << translate('Irisbane.success_dice_count', count: success_dice_count)
message_elements << translate('Irisbane.attack_power', power: power) if success_dice_count > 0

if success_dice_count > 0
if modification_operator && modification_value
message_elements << "ダメージ #{damage}#{modification_operator}#{modification_value}"
message_elements << translate('Irisbane.damage_with_mod', damage: damage, operator: modification_operator, mod_value: modification_value)
damage = parse_operator(modification_operator).call(damage, modification_value)
damage = 0 if damage < 0
message_elements << damage.to_s
else
message_elements << "ダメージ #{damage}"
message_elements << translate('Irisbane.damage', damage: damage)
end
end

Expand All @@ -119,30 +119,24 @@ def parse_operator(operator)
end
end

TABLES = {
"SceneSituation" => DiceTable::D66LeftRangeTable.new(
"シチュエーション",
BCDice::D66SortType::NO_SORT,
[
[1..3, [
"【日常】何一つ変わることの無い日々の一幕。移ろい易い世界では、それはとても大切である。",
"【準備】何かを為すための用意をする一幕。情報収集、買物遠征、やるべきことは一杯だ。",
"【趣味】自分の時間を、有効活用している一幕。必要に追われていない分、心は軽く晴れやかだ。",
"【喫茶】一息入れ、嗜好品を嗜む時の一幕。穏やかな空気は、だが、往々にして変わりやすい。",
"【鍛錬】体を鍛え、心を養う修練の一幕。己さえ良ければ、その方法も何だって良い。",
"【職務】役割の元、仕事に精を出す時の一幕。目的が何であれ、為すべきことに変わりはない。",
]],
[4..6, [
"【移動】何処かから何処かへと向かう一幕。進んでいるなら、手段も目的地も関係あるまい。",
"【墓前】故人が眠る場所へと赴く一幕。共に眠ることだけは無いように。",
"【操作】何かを操り、望みを果たしている一幕。運転にせよ何にせよ、脇見には注意が必要だ。",
"【食事】何かを糧とし、己の力を蓄える一幕。行動すれば消耗する。腹が減っては何とやらだ。",
"【休息】日々の合間の、憩いの一幕。“何もしない”というのも、立派な行いである。",
"【夢幻】現実に存在しない何かへと耽る一幕。時間帯に関わらず、何時かは必ず覚めるだろう。",
]],
]
),
}.transform_keys(&:upcase).freeze
class << self
private

def translate_tables(locale)
{
"SCENESITUATION" => DiceTable::D66LeftRangeTable.new(
I18n.t('Irisbane.SceneSituation.name', locale: locale),
BCDice::D66SortType::NO_SORT,
[
[1..3, I18n.t('Irisbane.SceneSituation.1_3', locale: locale)],
[4..6, I18n.t('Irisbane.SceneSituation.4_6', locale: locale)],
]
),
}
end
end

TABLES = translate_tables(:ja_jp).freeze

ALIAS = {
"SSi" => "SceneSituation",
Expand Down
52 changes: 52 additions & 0 deletions lib/bcdice/game_system/Irisbane_Korean.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# frozen_string_literal: true

require 'bcdice/game_system/Irisbane'

module BCDice
module GameSystem
class Irisbane_Korean < Irisbane
# ゲームシステムの識別子
ID = 'Irisbane:Korean'

# ゲームシステム名
NAME = '눈 돌리지 않는 이리스베인'

# ゲームシステム名の読みがな
SORT_KEY = '国際化:Korean:눈 돌리지 않는 이리스베인'

# ダイスボットの使い方
HELP_MESSAGE = <<~HELP
■공격 판정( ATTACKx@y<=z )
x: 공격력
y: 판정 수
z: 목표값
(※ ATTACK 은 ATK 또는 AT 로 줄여 쓸 수 있습니다)
예) ATTACK2@3<=5
예) ATK10@2<=4
예) AT8@3<=2

위 x y z 에는 각각 사칙연산을 지정할 수 있습니다.
예) ATTACK2+7@3*2<=5-1

□공격 판정의 데미지 증감( ATTACKx@y<=z[+a] ATTACKx@y<=z[-a])
말미에 [+a] 또는 [-a] 를 지정하면 최종 데미지를 증감할 수 있습니다.
a: 증감량
예) ATTACK2@3<=5[+10]
예) ATK10@2<=4[-8]
예) AT8@3<=2[-8+5]

■시추에이션(p115)
SceneSituation, SSi
HELP

def initialize(command)
super(command)
@locale = :ko_kr
end

TABLES = translate_tables(:ko_kr).freeze

register_prefix_from_super_class()
end
end
end
Loading