Skip to content

Commit

Permalink
detatoko-darkness: クラス・ポジションのデータを追加
Browse files Browse the repository at this point in the history
ポジションを追加する際、ルルブ掲載のページ数を出力しないようにした
  • Loading branch information
koi-chan committed Jan 20, 2017
1 parent 1ec9ac4 commit 484637f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 41 deletions.
42 changes: 19 additions & 23 deletions lib/rgrb/plugin/trpg/detatoko/gamedatas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,35 +78,31 @@ class Generator
'商人' => 14,
'占い師' => 15,
# ダークネス
'' => '',
'' => '',
'' => ''
'ニンジャ' => 0,
'貴族' => 3,
'死霊' => 8
}

# ポジション
POSITIONS = {
:pc => {
:pages => 0,
:contents => [
'冒険者', '凡人', '夢追い', '神話の住人', '負け犬',
'守護者', '悪党', 'カリスマ', '修羅', '遊び人', '従者',
'正体不明', '迷い子', '生ける伝説', '罪人', '傷追人',
'型破り', '裏の住人'
]
},
:npc => {
:pages => 0,
:contents => [
'裏切者', '帝王', '悪の化身', '黒幕', '災厄', '侵略者'
]
},
:dark => {
:pages => 0,
:contents => [
:pc => [
# フロンティア
'冒険者', '凡人', '夢追い', '神話の住人', '負け犬',
'守護者', '悪党', 'カリスマ', '修羅', '遊び人', '従者',
'正体不明', '迷い子', '生ける伝説', '罪人', '傷追人',
'型破り', '裏の住人'
],
:npc => [
# フロンティア
'裏切者', '帝王', '悪の化身', '黒幕', '災厄', '侵略者',
# ダークネス
'妨害者', '影', '愚物', '慈母', '世界', 'いわくつき'
],
:dark => [
# ダークネス
'悪の華', '堕落者', '幹部', 'トリックスター', '無能', '支配者',
'狂的天才', '必要悪', '外道', '野獣', '死の使い', '破滅の因子'
]
}
]
}
end
end
Expand Down
16 changes: 5 additions & 11 deletions lib/rgrb/plugin/trpg/detatoko/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,13 @@ def character_class
end

# ポジションを1つ選ぶ
# @param [Symbol] type PC用か、NPC用か
# @param [Symbol] type 用途
# @option type :pc PC のポジション
# @option type :npc NPC のポジション
# @option type :dark 悪のポジション
# @return [String]
def position(type)
result, page = case type
when :pc
[@random.rand(POSITIONS[:pc].size), 42]
when :npc
[@random.rand(POSITIONS[:npc].size), 68]
when :dark
[@random.rand(POSITIONS[:dark].size), 46]
end

"#{POSITIONS[type][result]} (フロンティアp.#{result + page})"
POSITIONS[type].sample
end

# 1行キャラシを出力する
Expand Down
12 changes: 5 additions & 7 deletions lib/rgrb/plugin/trpg/detatoko/irc_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,15 @@ def character_class(m)
# ポジションを1つ選ぶ
# @return [void]
def position(m, type)
header = "#{@header}[#{m.user.nick}]<PCポジション>: "
type = case type
insert, type = case type
when ''
:pc
['PC', :pc]
when 'n', '敵'
header[-10, 0] = '敵N'
:npc
['敵NPC', :npc]
when 'd', '悪'
header[-10, 0] = '悪の'
:dark
['悪の', :dark]
end
header = "#{@header}[#{m.user.nick}]<#{insert}ポジション>: "
message = @generator.position(type)
m.target.send(header + message, true)
end
Expand Down

0 comments on commit 484637f

Please sign in to comment.