Class: BCDice::GameSystem::TherapieSein

Inherits:
Base
  • Object
show all
Defined in:
lib/bcdice/game_system/TherapieSein.rb

Constant Summary collapse

ID =

ゲームシステムの識別子

'TherapieSein'
NAME =

ゲームシステム名

'セラフィザイン'
SORT_KEY =

ゲームシステム名の読みがな

'せらふいさいん'
HELP_MESSAGE =

ダイスボットの使い方

"\u30FB\u4E00\u822C\u5224\u5B9A\uFF1ATS[n][\u00B1m][@t]\u3000\u3000[]\u5185\u306E\u30B3\u30DE\u30F3\u30C9\u306F\u7701\u7565\u53EF\u80FD\u3002\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u7121\u3002\n\u30FB\u6226\u95D8\u5224\u5B9A\uFF1AOP[n][\u00B1m][@t]\u3000\u3000[]\u5185\u306E\u30B3\u30DE\u30F3\u30C9\u306F\u7701\u7565\u53EF\u80FD\u3002\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u6709\u3002\n\n\u300Cn\u300D\u3067\u80FD\u529B\u5024\u4FEE\u6B63\u306A\u3069\u3092\u6307\u5B9A\u3002\n\u300C\u00B1m\u300D\u3067\u9054\u6210\u5024\u3078\u306E\u4FEE\u6B63\u5024\u3092\u8FFD\u52A0\u6307\u5B9A\u3002+5+1-3\u306E\u3088\u3046\u306B\u3001\u8907\u6570\u6307\u5B9A\u3082\u53EF\u80FD\u3067\u3059\u3002\n\u300C@t\u300D\u3067\u76EE\u6A19\u5024\u3092\u6307\u5B9A\u3002\u7701\u7565\u6642\u306F\u9054\u6210\u5024\u306E\u307F\u8868\u793A\u3001\u6307\u5B9A\u6642\u306F\u5224\u5B9A\u306E\u6B63\u5426\u3092\u8FFD\u52A0\u8868\u793A\u3002\n\n\u3010\u66F8\u5F0F\u4F8B\u3011\n\u30FBTS \u2192 \u30C0\u30A4\u30B9\u306E\u5408\u8A08\u5024\u3092\u9054\u6210\u5024\u3068\u3057\u3066\u8868\u793A\u3002\n\u30FBTS4 \u2192 \u30C0\u30A4\u30B9\u5408\u8A08+4\u3092\u9054\u6210\u5024\u8868\u793A\u3002\n\u30FBTS4-1 \u2192 \u30C0\u30A4\u30B9\u5408\u8A08+4-1\uFF08\u8A08+3\uFF09\u3092\u9054\u6210\u5024\u8868\u793A\u3002\n\u30FBTS2+1@10 \u2192 \u30C0\u30A4\u30B9\u5408\u8A08+2+1\uFF08\u8A08+3\uFF09\u306E\u9054\u6210\u5024\u3068\u3001\u5224\u5B9A\u306E\u6210\u5426\u3092\u8868\u793A\u3002\n\u30FBOP4+3+1 \u2192 \u30C0\u30A4\u30B9\u5408\u8A08+4+3+1\uFF08\u8A08+8\uFF09\u3092\u9054\u6210\u5024\uFF06\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u8868\u793A\u3002\n\u30FBOP3@12 \u2192 \u30C0\u30A4\u30B9\u5408\u8A08+3\u306E\u9054\u6210\u5024\uFF06\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u3001\u5224\u5B9A\u306E\u6210\u5426\u3092\u8868\u793A\u3002\n"

Instance Attribute Summary

Attributes inherited from Base

#d66_sort_type, #default_cmp_op, #default_target_number, #randomizer, #reroll_dice_reroll_threshold, #round_type, #sides_implicit_d, #upper_dice_reroll_threshold

Instance Method Summary collapse

Methods inherited from Base

#change_text, #check_result, command_pattern, #enable_debug, #enabled_d9?, #eval, eval, #grich_text, #initialize, prefixes_pattern, register_prefix, register_prefix_from_super_class, #sort_add_dice?, #sort_barabara_dice?

Methods included from Translate

#translate

Constructor Details

This class inherits a constructor from BCDice::Base

Instance Method Details

#checkRoll(hasCritical, modify, target) ⇒ Object



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/bcdice/game_system/TherapieSein.rb', line 55

def checkRoll(hasCritical, modify, target)
  dice_list = @randomizer.roll_barabara(2, 6)
  dice = dice_list.sum()
  diceText = dice_list.join(",")
  successValue = dice + modify

  modifyText = getValueText(modify)
  targetText = (target == 0 ? '' : ">=#{target}")

  result = "(2D6#{modifyText}#{targetText})"
  result += " > #{dice}(#{diceText})#{modifyText}"

  if hasCritical && (dice == 12)
    result += " > クリティカル!"
    return result
  end

  result += " > #{successValue}#{targetText}"

  return result if target == 0

  if successValue >= target
    result += " > 【成功】"
  else
    result += " > 【失敗】"
  end

  return result
end

#eval_game_system_specific_command(command) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/bcdice/game_system/TherapieSein.rb', line 35

def eval_game_system_specific_command(command)
  output =
    case command.upcase

    when /(TS|OP)(\d+)?(([+-]\d+)*)(@(\d+))?$/i
      hasCritical = (Regexp.last_match(1) == "OP")
      target = (Regexp.last_match(6) || 0).to_i
      modify = (Regexp.last_match(2) || 0).to_i
      modifyAddString = Regexp.last_match(3)

      modify_list = modifyAddString.scan(/[+-]\d+/) # 修正値を分割して配列へ
      modify_list.each { |i| modify += i.to_i }

      checkRoll(hasCritical, modify, target)

    end

  return output
end

#getValueText(value) ⇒ Object



85
86
87
88
89
90
# File 'lib/bcdice/game_system/TherapieSein.rb', line 85

def getValueText(value)
  return "" if value == 0
  return value.to_s if value < 0

  return "\+#{value}"
end