Class: BCDice::GameSystem::SRS

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

Defined Under Namespace

Modules: ClassMethods Classes: SRSRollNode

Constant Summary collapse

ID =

ゲームシステムの識別子

'SRS'
NAME =

ゲームシステム名

'スタンダードRPGシステム'
SORT_KEY =

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

'すたんたあとRPGしすてむ'
HELP_MESSAGE_1 =
"\u30FB\u5224\u5B9A\n\u3000\u30FB\u901A\u5E38\u5224\u5B9A\uFF1A2D6+m>=t[c,f]\n\u3000\u3000\u4FEE\u6B63\u5024m\u3001\u76EE\u6A19\u5024t\u3001\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u5024c\u3001\u30D5\u30A1\u30F3\u30D6\u30EB\u5024f\u3067\u5224\u5B9A\u30ED\u30FC\u30EB\u3092\u884C\u3044\u307E\u3059\u3002\n\u3000\u3000\u4FEE\u6B63\u5024\u3001\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u5024\u3001\u30D5\u30A1\u30F3\u30D6\u30EB\u5024\u306F\u7701\u7565\u53EF\u80FD\u3067\u3059\uFF08[]\u3054\u3068\u7701\u7565\u53EF\uFF09\u3002\n\u3000\u3000\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u5024\u3001\u30D5\u30A1\u30F3\u30D6\u30EB\u5024\u306E\u65E2\u5B9A\u5024\u306F\u3001\u305D\u308C\u305E\u308C12\u30012\u3067\u3059\u3002\n\u3000\u3000\u81EA\u52D5\u6210\u529F\u3001\u81EA\u52D5\u5931\u6557\u3001\u6210\u529F\u3001\u5931\u6557\u3092\u81EA\u52D5\u8868\u793A\u3057\u307E\u3059\u3002\n\n\u3000\u3000\u4F8B) 2d6>=10\u3000\u3000\u3000\u3000\u3000\u4FEE\u6B63\u50240\u3001\u76EE\u6A19\u502410\u3067\u5224\u5B9A\n\u3000\u3000\u4F8B) 2d6+2>=10\u3000\u3000\u3000\u3000\u4FEE\u6B63\u5024+2\u3001\u76EE\u6A19\u502410\u3067\u5224\u5B9A\n\u3000\u3000\u4F8B) 2d6+2>=10[11]\u3000\u3000\u2191\u3092\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u502411\u3067\u5224\u5B9A\n\u3000\u3000\u4F8B) 2d6+2>=10[12,4]\u3000\u2191\u3092\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u502412\u3001\u30D5\u30A1\u30F3\u30D6\u30EB\u50244\u3067\u5224\u5B9A\n"
HELP_MESSAGE_2 =
"\u3000\u30FB\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u304A\u3088\u3073\u30D5\u30A1\u30F3\u30D6\u30EB\u306E\u307F\u306E\u5224\u5B9A\uFF1A2D6+m[c,f]\n\u3000\u3000\u76EE\u6A19\u5024\u3092\u6307\u5B9A\u305B\u305A\u3001\u4FEE\u6B63\u5024m\u3001\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u5024c\u3001\u30D5\u30A1\u30F3\u30D6\u30EB\u5024f\u3067\u5224\u5B9A\u30ED\u30FC\u30EB\u3092\u884C\u3044\u307E\u3059\u3002\n\u3000\u3000\u4FEE\u6B63\u5024\u3001\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u5024\u3001\u30D5\u30A1\u30F3\u30D6\u30EB\u5024\u306F\u7701\u7565\u53EF\u80FD\u3067\u3059\uFF08[]\u306F\u7701\u7565\u4E0D\u53EF\uFF09\u3002\n\u3000\u3000\u81EA\u52D5\u6210\u529F\u3001\u81EA\u52D5\u5931\u6557\u3092\u81EA\u52D5\u8868\u793A\u3057\u307E\u3059\u3002\n\n\u3000\u3000\u4F8B) 2d6[]\u3000\u3000\u3000\u3000\u4FEE\u6B63\u50240\u3001\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u502412\u3001\u30D5\u30A1\u30F3\u30D6\u30EB\u50242\u3067\u5224\u5B9A\n\u3000\u3000\u4F8B) 2d6+2[11]\u3000\u3000\u4FEE\u6B63\u5024+2\u3001\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u502411\u3001\u30D5\u30A1\u30F3\u30D6\u30EB\u50242\u3067\u5224\u5B9A\n\u3000\u3000\u4F8B) 2d6+2[12,4]\u3000\u4FEE\u6B63\u5024+2\u3001\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u502412\u3001\u30D5\u30A1\u30F3\u30D6\u30EB\u50244\u3067\u5224\u5B9A\n"
HELP_MESSAGE_3 =
"\u30FBD66\u30C0\u30A4\u30B9\u3042\u308A\uFF08\u5165\u308C\u66FF\u3048\u306A\u3057)\n"
DEFAULT_HELP_MESSAGE =

既定のダイスボット説明文

"#{HELP_MESSAGE_1}\n#{HELP_MESSAGE_2}\n#{HELP_MESSAGE_3}"
HELP_MESSAGE =
DEFAULT_HELP_MESSAGE
DEFAULT_CRITICAL_VALUE =

既定のクリティカル値

12
DEFAULT_FUMBLE_VALUE =

既定のファンブル値

2
SRS_ROLL_WITH_TARGET_VALUE_RE =

目標値あり成功判定の正規表現

/\A2D6([-+][-+\d]+)?>=(\d+)(?:\[(\d+)?(?:,(\d+))?\])?\z/.freeze
SRS_ROLL_WITHOUT_TARGET_VALUE_RE =

目標値なし成功判定の正規表現

/\A2D6([-+][-+\d]+)?\[(\d+)?(?:,(\d+))?\]\z/.freeze
SRS_ROLL_DEFAULT_THRESHOLDS =

既定の閾値指定表記

"[#{DEFAULT_CRITICAL_VALUE},#{DEFAULT_FUMBLE_VALUE}]"

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

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

Methods included from Translate

#translate

Constructor Details

#initialize(command) ⇒ SRS

ダイスボットを初期化する



173
174
175
176
177
178
179
180
181
182
# File 'lib/bcdice/game_system/SRS.rb', line 173

def initialize(command)
  super(command)

  # 式、出目ともに送信する

  # バラバラロール(Bコマンド)でソートする
  @sort_add_dice = true
  # D66ダイスあり(出目をソートしない)
  @d66_sort_type = D66SortType::NO_SORT
end

Class Method Details

.aliases_re_for_srs_roll_with_target_valuenil

目標値あり成功判定のエイリアスコマンドの正規表現を返す

Returns:

  • (nil)


158
159
160
# File 'lib/bcdice/game_system/SRS.rb', line 158

def aliases_re_for_srs_roll_with_target_value
  nil
end

.aliases_re_for_srs_roll_without_target_valuenil

目標値なし成功判定のエイリアスコマンドの正規表現を返す

Returns:

  • (nil)


164
165
166
# File 'lib/bcdice/game_system/SRS.rb', line 164

def aliases_re_for_srs_roll_without_target_value
  nil
end

.help_messageString

ダイスボットの説明文を返す

Returns:

  • (String)

    既定のダイスボット説明文



152
153
154
# File 'lib/bcdice/game_system/SRS.rb', line 152

def help_message
  DEFAULT_HELP_MESSAGE
end

.inherited(subclass) ⇒ void

This method returns an undefined value.

クラスが継承されたときに行う処理



144
145
146
147
148
# File 'lib/bcdice/game_system/SRS.rb', line 144

def inherited(subclass)
  subclass
    .extend(ClassMethods)
    .clear_aliases_for_srs_roll
end

Instance Method Details

#eval_game_system_specific_command(command) ⇒ String?

固有のダイスロールコマンドを実行する

Parameters:

  • command (String)

    入力されたコマンド

Returns:

  • (String, nil)

    ダイスロールコマンドの実行結果



223
224
225
226
227
228
229
230
231
# File 'lib/bcdice/game_system/SRS.rb', line 223

def eval_game_system_specific_command(command)
  alias_replaced_with_2d6 = replace_alias_for_srs_roll_with_2d6(command)

  if (node = parse(alias_replaced_with_2d6))
    return execute_srs_roll(node)
  end

  return nil
end

#help_messageString

ダイスボットの説明文を返す

Returns:

  • (String)


186
187
188
# File 'lib/bcdice/game_system/SRS.rb', line 186

def help_message
  self.class.help_message
end