Class: BCDice::GameSystem::NinjaSlayer2

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

Constant Summary collapse

ID =

ゲームシステムの識別子

"NinjaSlayer2"
NAME =

ゲームシステム名

"ニンジャスレイヤーTRPG 2版"
SORT_KEY =

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

"にんしやすれいやあTRPG2"
HELP_MESSAGE =
"- K{x1},{x2},...,{xn}\n\u96E3\u6613\u5EA6K([K]ids)\u306E\u6210\u529F\u5224\u5B9A({x1}B6>=2)\u3092\u3001\u30C0\u30A4\u30B9{x1}\u500B({x2}\uFF5E\u3092\u6307\u5B9A\u3057\u305F\u5834\u5408\u306F\u305D\u308C\u305E\u308C\u500B\u3005\u306B)\u3067\u5B9F\u884C\u3057\u307E\u3059\u3002\n\u5148\u982D\u306E\u6587\u5B57\u3092\u5909\u3048\u308B\u3053\u3068\u3067\u3001\u96E3\u6613\u5EA6E([E]asy),N([N]ormal),H([H]ard),U([U]ltra-hard)\u3082\u3057\u304F\u306FUH([U]ltra-[H]ard)\u3067\u3082\u5B9F\u884C\u53EF\u80FD\u3067\u3059\u3002(\u4EE5\u4E0B\u3082\u540C\u69D8)\n\n- K{x1},{x2},...,{xn}[>={y}]\nK{x1}\u306E\u30ED\u30FC\u30EB\u306E\u7D50\u679C\u3092\u4F7F\u3063\u3066\u3001[]\u5185\u3067\u6307\u5B9A\u3055\u308C\u305F\u6761\u4EF6\u3092\u6E80\u305F\u3059\u30C0\u30A4\u30B9\u306E\u500B\u6570\u3092\u8FFD\u52A0\u3067\u51FA\u529B\u3057\u307E\u3059\u3002\n\u5224\u5B9A\u5F0F\u306F\u300C>=\u300D\u306E\u4ED6\u306B\u300C>\u300D\u300C<=\u300D\u300C<\u300D\u300C=\u300D\u300C!=\u300D\u304C\u5229\u7528\u53EF\u80FD\u3067\u3059\u3002\n[=5][=6]\u306E\u3088\u3046\u306B\u8907\u6570\u8A18\u8FF0\u3059\u308B\u3053\u3068\u3067\u3001\u305D\u308C\u305E\u308C\u3067\u8FFD\u52A0\u5224\u5B9A\u304C\u53EF\u80FD\u3067\u3059\u3002\n\n- K{x1},{x2},...,{xn}[S] or K{x1},{x2},...,{xn}[S{y}]\n- K{x1},{x2},...,{xn}[C] or K{x1},{x2},...,{xn}[C{y}]\n\u3044\u305A\u308C\u3082K{x1},{x2},...,{xn}[>={y}]\u306E\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u3067\u3059\u3002({y}\u7701\u7565\u6642\u306F\u56FA\u5B9A\u50246\u3067\u51E6\u7406\u3057\u307E\u3059\u3002)\n\u51FA\u529B\u6642\u306E\u30C6\u30AD\u30B9\u30C8\u304C\u3001S\u306E\u5834\u5408\u306F\u300C\u30B5\u30C4\u30D0\u30C4\uFF01\u300D\u306B\u3001C\u306E\u5834\u5408\u306F\u300C\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\uFF01\u300D\u306B\u306A\u308A\u307E\u3059\u3002\n\u3053\u3061\u3089\u3082\u8907\u6570\u8A18\u8FF0\u3059\u308B\u3053\u3068\u3067\u3001\u305D\u308C\u305E\u308C\u3067\u8FFD\u52A0\u5224\u5B9A\u304C\u53EF\u80FD\u3067\u3059\u3002\n\n- SB or SB@{x}\n{x}(1-6/\u7701\u7565\u6642\u306Fd6)\u306B\u5BFE\u5FDC\u3057\u305F\u30B5\u30C4\u30D0\u30C4([S]atz-[B]atz)\u30FB\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u8868\u306E\u5185\u5BB9\u3092\u8FD4\u3057\u307E\u3059\u3002\n\n- WS{x}\n{x}(1-12/\u7701\u7565\u4E0D\u53EF)\u306B\u5BFE\u5FDC\u3059\u308B[W]as[s]hoi!\u5224\u5B9A(2d6<={x})\u3092\u884C\u3044\u307E\u3059\n\n- WSE or WSE@{x}\n{x}(1-6/\u7701\u7565\u6642\u306Fd6)\u306B\u5BFE\u5FDC\u3059\u308B\u6B7B\u795E\u306E\u30A8\u30F3\u30C8\u30EA\u30FC\u6C7A\u5B9A\u8868([W]as[s]hoi! [E]ntry)\u306E\u5185\u5BB9\u3092\u8FD4\u3057\u307E\u3059\u3002\n\n- NRS_E{x} or NRS_E{x}@{y} or NRS@{y}\n\u30C0\u30A4\u30B9{x}\u500B\u3067\u96E3\u6613\u5EA6[E]asy(>=3)\u306ENRS\u5224\u5B9A({x}\u7701\u7565\u6642\u306F\u30B9\u30AD\u30C3\u30D7)\u3092\u884C\u3044\u3001\u5931\u6557\u3057\u305F\u5834\u5408\u306F{y}(1\uFF5E7/\u7701\u7565\u6642\u306F\u96E3\u6613\u5EA6\u306B\u5FDC\u3058\u305F\u30C0\u30A4\u30B9\u76EE)\u306B\u5BFE\u5FDC\u3059\u308BNRS\u767A\u72C2\u8868\u3092\u8FD4\u3057\u307E\u3059\u3002\n\u300C_E\u300D\u90E8\u5206\u3092\u5909\u66F4\u3059\u308B\u3053\u3068\u3067\u3001\u96E3\u6613\u5EA6N,H,U,UH\u3067\u3082\u5229\u7528\u53EF\u80FD\u3067\u3059\u3002(K\u306F\u3042\u308A\u307E\u305B\u3093)\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

#eval_game_system_specific_command(command) ⇒ String?

Base::eval_game_system_specific_commandの実装

Parameters:

  • command (String)

Returns:

  • (String, nil)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/bcdice/game_system/NinjaSlayer2.rb', line 48

def eval_game_system_specific_command(command)
  # @debug = true
  debug("input: #{command}")

  begin
    case command
    when RE_JUDGE_DICEROLL
      # 2版用のダイス判定
      proc_result = proc_dice_2nd(Regexp.last_match)

      # 結果は文字列と達成値という形で受け取る
      if proc_result[1] > 0
        return Result.success(proc_result[0])
      else
        return Result.failure(proc_result[0])
      end
    else
      # ダイスでなければ定型文処理
      return proc_text(command)
    end
  rescue StandardError => e
    # 解析できずにエラーが出たら構文ミスと皆してnilを返す
    debug("#{e.message} \n#{e.backtrace}")
    return nil
  end
end