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

[Insane] InsaneScpから暫定整理番号作成表を移植 #201

Merged
merged 1 commit into from
May 20, 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
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