Skip to content

Commit

Permalink
Merge pull request #201 from bcdice/insane_scp
Browse files Browse the repository at this point in the history
[Insane] InsaneScpから暫定整理番号作成表を移植
  • Loading branch information
ysakasin authored May 20, 2020
2 parents 56969ac + 34a1214 commit 20aec91
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 1,175 deletions.
49 changes: 48 additions & 1 deletion src/diceBot/Insane.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ class Insane < DiceBot
遭遇表 都市 (ECT) 山林 (EMT) 海辺 (EAT)/反応表 RET
残業ホラースケープ表 OHT/残業電話表 OPT/残業シーン表 OWT
社名決定表1 CNT1/社名決定表2 CNT2/社名決定表3 CNT3
暫定整理番号作成表 IRN
・D66ダイスあり
INFO_MESSAGE_TEXT

setPrefixes([
'ST', 'HJST', 'MTST', 'DVST', 'DT', 'BT', 'PT', 'FT', 'JT', 'BET', 'RTT', 'TVT', 'TET', 'TPT', 'TST', 'TKT', 'TMT',
'CHT', 'VHT', 'IHT', 'RHT', 'MHT', 'LHT', 'ECT', 'EMT', 'EAT', 'OPT', 'OHT', 'OWT', 'CNT1', 'CNT2', 'CNT3', 'RET'
'CHT', 'VHT', 'IHT', 'RHT', 'MHT', 'LHT', 'ECT', 'EMT', 'EAT', 'OPT', 'OHT', 'OWT', 'CNT1', 'CNT2', 'CNT3', 'RET', 'IRN'
])

def initialize
Expand Down Expand Up @@ -175,6 +176,9 @@ def rollDiceCommand(command)
when 'RET'
type = '反応表'
output, total_n = get_reaction_scene_table
when 'IRN'
type = '暫定整理番号作成'
output, total_n = get_interim_reference_number
end

return "#{type}(#{total_n}) > #{output}"
Expand Down Expand Up @@ -764,4 +768,47 @@ def get_reaction_scene_table
]
return get_table_by_2d6(table)
end

# 暫定整理番号作成表
def get_interim_reference_number
table = [
[11, '1'],
[12, '2'],
[13, '3'],
[14, '4'],
[15, '5'],
[16, '6'],
[22, 'G'],
[23, 'I'],
[24, 'J'],
[25, 'K'],
[26, 'O'],
[33, 'P'],
[34, 'Q'],
[35, 'S'],
[36, 'T'],
[44, 'U'],
[45, 'V'],
[46, 'X'],
[55, 'Y'],
[56, 'Z'],
[66, '-'],
]

number, total_n = roll(1, 6)
counts = 3
if number <= 4
counts = number + 5
elsif number == 5
counts = 4
end

output = ''
counts.times do
character, number = get_table_by_d66_swap(table)
output += character
total_n += ",#{number}"
end
return output, total_n
end
end
Loading

0 comments on commit 20aec91

Please sign in to comment.