class BCDice::GameSystem::DemonParasite
Constants
- HELP_MESSAGE
ダイスボットの使い方
- ID
ゲームシステムの識別子
- MALFUNCTION_TABLE
誤作動表
- MUTANT_TABLE
ミュータント衝動表
- NAME
ゲームシステム名
- NEW_URGE_TABLE
新衝動表
- ONIMITAMA_BATTLE_TABLE
鬼御魂(戦闘中)衝動表
- ONIMITAMA_OUT_OF_BATTLE_TABLE
鬼御魂(戦闘外)衝動表
- SORT_KEY
ゲームシステム名の読みがな
- URGE_TABLE
衝動表
Public Class Methods
new(command)
click to toggle source
Calls superclass method
BCDice::Base::new
# File lib/bcdice/game_system/DemonParasite.rb, line 33 def initialize(command) super(command) @sort_add_dice = true @d66_sort_type = D66SortType::NO_SORT end
Public Instance Methods
eval_game_system_specific_command(command)
click to toggle source
# File lib/bcdice/game_system/DemonParasite.rb, line 51 def eval_game_system_specific_command(command) return get_urge(command) end
get_urge(string)
click to toggle source
衝動表
# File lib/bcdice/game_system/DemonParasite.rb, line 56 def get_urge(string) m = /([NAMUC])?URGE\s*(\d+)/i.match(string) unless m return '1' end initialWord = m[1] urgelv = m[2].to_i case initialWord when nil title = "衝動表" urge = URGE_TABLE when "N" title = "新衝動表" urge = NEW_URGE_TABLE when "A" title = "誤作動表" urge = MALFUNCTION_TABLE when "M" title = "ミュータント衝動表" urge = MUTANT_TABLE when "U" title = "鬼御魂(戦闘外)衝動表" urge = ONIMITAMA_OUT_OF_BATTLE_TABLE when "C" title = "鬼御魂(戦闘中)衝動表" urge = ONIMITAMA_BATTLE_TABLE else # あり得ない文字 return '1' end if urgelv < 1 || urgelv > 5 return '衝動段階は1から5です' end dice_now = @randomizer.roll_sum(2, 6) resultText = urge[urgelv - 1][dice_now - 2] return "#{title}#{urgelv}-#{dice_now}:#{resultText}" end
result_nd6(_total, _dice_total, dice_list, _cmp_op, target)
click to toggle source
ゲーム別成功度判定(nD6)
# File lib/bcdice/game_system/DemonParasite.rb, line 41 def result_nd6(_total, _dice_total, dice_list, _cmp_op, target) if dice_list.count(1) >= 2 # 1の目が2個以上ならファンブル Result.fumble("致命的失敗") elsif dice_list.count(6) >= 2 # 6の目が2個以上あったらクリティカル Result.critical("効果的成功") elsif target == "?" Result.nothing end end