class BCDice::GameSystem::GeishaGirlwithKatana
Constants
- HELP_MESSAGE
ダイスボットの使い方
- ID
ゲームシステムの識別子
- NAME
ゲームシステム名
- SORT_KEY
ゲームシステム名の読みがな
Public Instance Methods
eval_game_system_specific_command(command)
click to toggle source
# File lib/bcdice/game_system/GeishaGirlwithKatana.rb, line 31 def eval_game_system_specific_command(command) output = nil if /^GL$/i =~ command return getChombaResultText() end unless /^GK(#(\d+))?$/i =~ command return output end chomba_counter = Regexp.last_match(2) if isChomba(chomba_counter) return getChombaResultText() end diceList = @randomizer.roll_barabara(3, 6).sort yakuResult = getYaku(diceList) unless yakuResult.nil? return getResultTextByDice(diceList, "【役】#{yakuResult}") end deme, zorome = getDemeZorome(diceList) if deme == 0 return getResultTextByDice(diceList, "失敗") end yp = (zorome == 1 ? " YPが1増加" : "") output = getResultTextByDice(diceList, "達成値#{deme}#{yp}") debug("getGGwKResult(command) result", output) return output end
getChombaResultText()
click to toggle source
# File lib/bcdice/game_system/GeishaGirlwithKatana.rb, line 76 def getChombaResultText() getResultText("チョムバ!!") end
getDemeZorome(diceList)
click to toggle source
# File lib/bcdice/game_system/GeishaGirlwithKatana.rb, line 96 def getDemeZorome(diceList) deme = 0 zorome = 0 if diceList[0] == diceList[1] deme = diceList[2] zorome = diceList[0] elsif diceList[1] == diceList[2] deme = diceList[0] zorome = diceList[1] end return deme, zorome end
getResultText(result)
click to toggle source
# File lib/bcdice/game_system/GeishaGirlwithKatana.rb, line 115 def getResultText(result) "(3B6) > #{result}" end
getResultTextByDice(diceList, result)
click to toggle source
# File lib/bcdice/game_system/GeishaGirlwithKatana.rb, line 111 def getResultTextByDice(diceList, result) getResultText("#{diceList.join(',')} > #{result}") end
getYaku(diceList)
click to toggle source
# File lib/bcdice/game_system/GeishaGirlwithKatana.rb, line 80 def getYaku(diceList) rule = { [1, 2, 3] => "自動失敗/自分の装甲効果無しでダメージを受けてしまう", [4, 5, 6] => "自動成功/敵の装甲を無視してダメージを与える", [1, 1, 1] => "10倍成功 YPが10増加/10倍ダメージ YPが10増加", [2, 2, 2] => "2倍成功/2倍ダメージ", [3, 3, 3] => "3倍成功/3倍ダメージ", [4, 4, 4] => "4倍成功/4倍ダメージ", [5, 5, 5] => "5倍成功/5倍ダメージ", [6, 6, 6] => "6倍成功/6倍ダメージ", } yaku = rule[diceList] return yaku end
isChomba(chomba_counter)
click to toggle source
# File lib/bcdice/game_system/GeishaGirlwithKatana.rb, line 67 def isChomba(chomba_counter) chomba_counter ||= 5 chomba_counter = chomba_counter.to_i chomba = @randomizer.roll_once(100) return (chomba <= chomba_counter) end