Class: BCDice::GameSystem::NightWizard
- Defined in:
- lib/bcdice/game_system/NightWizard.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Parsed, Parsed2R6, ParsedNW
Constant Summary collapse
- ID =
ゲームシステムの識別子
'NightWizard'- NAME =
ゲームシステム名
'ナイトウィザード The 2nd Edition'- SORT_KEY =
ゲームシステム名の読みがな
'ないとういさあと2'- HELP_MESSAGE =
ダイスボットの使い方
"\u30FB\u5224\u5B9A\u7528\u30B3\u30DE\u30F3\u30C9\u3000(aNW+b@x#y$z+c)\n\u3000\u3000a : \u57FA\u672C\u5024\n\u3000\u3000b : \u5E38\u6642\u306B\u6E96\u3058\u308B\u7279\u6280\u306B\u3088\u308B\u88DC\u6B63\n\u3000\u3000c : \u5E38\u6642\u4EE5\u5916\u306E\u7279\u6280\u3001\u304A\u3088\u3073\u652F\u63F4\u52B9\u679C\u306B\u3088\u308B\u88DC\u6B63\uFF08\u30D5\u30A1\u30F3\u30D6\u30EB\u6642\u306B\u306F\u9069\u7528\u3055\u308C\u306A\u3044\uFF09\n\u3000\u3000x : \u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u5024\u306E\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF08\u7701\u7565\u6642 10\uFF09\n\u3000\u3000y : \u30D5\u30A1\u30F3\u30D6\u30EB\u5024\u306E\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF08\u7701\u7565\u6642 5\uFF09\n\u3000\u3000z : \u30D7\u30E9\u30FC\u30CA\u306B\u3088\u308B\u9054\u6210\u5024\u88DC\u6B63\u306E\u30D7\u30E9\u30FC\u30CA\u6D88\u8CBB\u6570\uFF08\u30D5\u30A1\u30F3\u30D6\u30EB\u6642\u306B\u306F\u9069\u7528\u3055\u308C\u306A\u3044\uFF09\n\u3000\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u5024\u3001\u30D5\u30A1\u30F3\u30D6\u30EB\u5024\u304C\u7121\u3044\u5834\u5408\u306F1\u308413\u306A\u3069\u306E\u3042\u308A\u5F97\u306A\u3044\u6570\u5024\u3092\u5165\u308C\u3066\u304F\u3060\u3055\u3044\u3002\n\u3000\u4F8B\uFF0912NW-5@7#2$3 1NW 50nw+5@7,10#2,5 50nw-5+10@7,10#2,5+15+25\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
- #eval_game_system_specific_command(string) ⇒ String?
-
#initialize(command) ⇒ NightWizard
constructor
A new instance of NightWizard.
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
Constructor Details
#initialize(command) ⇒ NightWizard
33 34 35 36 37 |
# File 'lib/bcdice/game_system/NightWizard.rb', line 33 def initialize(command) super(command) @nw_command = "NW" end |
Instance Method Details
#eval_game_system_specific_command(string) ⇒ String?
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/bcdice/game_system/NightWizard.rb', line 40 def eval_game_system_specific_command(string) cmd = parse_nw(string) || parse_2r6(string) unless cmd return nil end total, interim_expr, status = roll_nw(cmd) result = if cmd.cmp_op total.send(cmd.cmp_op, cmd.target_number) ? "成功" : "失敗" end sequence = [ "(#{cmd})", interim_expr, status, total.to_s, result, ].compact return sequence.join(" > ") end |