Class: BCDice::GameSystem::Illusio
- Defined in:
- lib/bcdice/game_system/Illusio.rb
Constant Summary collapse
- ID =
ゲームシステムの識別子
'Illusio'- NAME =
ゲームシステム名
'晃天のイルージオ'- SORT_KEY =
ゲームシステム名の読みがな
'こうてんのいるうしお'- HELP_MESSAGE =
ダイスボットの使い方
"\u5224\u5B9A\uFF1A[n]IL(BNo)[P]\n\n[]\u5185\u306E\u30B3\u30DE\u30F3\u30C9\u306F\u7701\u7565\u53EF\u80FD\u3002\n\u300Cn\u300D\u3067\u30C0\u30A4\u30B9\u6570\u3092\u6307\u5B9A\u3002\u7701\u7565\u6642\u306F\u300C1\u300D\u3002\n(BNo)\u3067\u30D6\u30ED\u30C3\u30AF\u30CA\u30F3\u30D0\u30FC\u3092\u6307\u5B9A\u3002\u300C236\u300D\u306E\u3088\u3046\u306B\u8A18\u8FF0\u3002\u9806\u4E0D\u540C\u53EF\u3002\n\u30B3\u30DE\u30F3\u30C9\u672B\u306B\u300CP\u300D\u3092\u6307\u5B9A\u3067\u3001(BNo)\u306E\u30D1\u30EA\u30A3\u5224\u5B9A\u3002\uFF08\u4E00\u5FDC\u3001\u8907\u6570\u6307\u5B9A\u53EF\uFF09\n\n\u3010\u66F8\u5F0F\u4F8B\u3011\n\u30FB6IL236 \u2192 6d\u3067\u30D6\u30ED\u30C3\u30AF\u30CA\u30F3\u30D0\u30FC\u300C2,3,6\u300D\u306E\u5224\u5B9A\u3002\n\u30FBIL4512 \u2192 1d\u3067\u30D6\u30ED\u30C3\u30AF\u30CA\u30F3\u30D0\u30FC\u300C1,2,4,5\u300D\u306E\u5224\u5B9A\u3002\n\u30FB2IL1P \u2192 2d\u3067\u30D1\u30EA\u30A3\u30CA\u30F3\u30D0\u30FC\u300C1\u300D\u306E\u5224\u5B9A\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
- #check_roll(dice_count, block_no, is_parry) ⇒ Object
- #eval_game_system_specific_command(command) ⇒ Object
-
#initialize(command) ⇒ Illusio
constructor
A new instance of Illusio.
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) ⇒ Illusio
Returns a new instance of Illusio.
30 31 32 33 |
# File 'lib/bcdice/game_system/Illusio.rb', line 30 def initialize(command) super(command) @sort_add_dice = true # ダイスのソート有 end |
Instance Method Details
#check_roll(dice_count, block_no, is_parry) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/bcdice/game_system/Illusio.rb', line 50 def check_roll(dice_count, block_no, is_parry) dice_array = @randomizer.(dice_count, 6).sort dice_text = dice_array.join(',') result_array = [] success = 0 dice_array.each do |i| if block_no.count(i) > 0 result_array.push("×") else result_array.push(i) success += 1 end end block_text = block_no.join(',') block_text2 = is_parry ? "Parry" : "Block" result_text = result_array.join(',') result = "#{dice_count}D6(#{block_text2}:#{block_text}) > #{dice_text} > #{result_text} > " return "#{result}成功数:#{success}" unless is_parry if success < dice_count "#{result}パリィ成立! 次の非ダメージ2倍。" else "#{result}成功数:#{success} パリィ失敗" end end |
#eval_game_system_specific_command(command) ⇒ Object
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/bcdice/game_system/Illusio.rb', line 39 def eval_game_system_specific_command(command) m = command.match(/(\d+)?IL([1-6]{0,6})(P)?$/i) return nil unless m dice_count = (m[1] || 1).to_i block_no = (m[2] || "").each_char.map(&:to_i).uniq.sort is_parry = !m[3].nil? return check_roll(dice_count, block_no, is_parry) end |