Class: BCDice::GameSystem::Aionia
- Defined in:
- lib/bcdice/game_system/Aionia.rb
Constant Summary collapse
- ID =
ゲームシステムの識別子
"Aionia"- NAME =
ゲームシステム名
"慈悲なきアイオニア"- SORT_KEY =
ゲームシステム名の読みがな
"しひなきあいおにあ"- HELP_MESSAGE =
"- \u6280\u80FD\u5224\u5B9A\uFF08\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u30FB\u30D5\u30A1\u30F3\u30D6\u30EB\u306A\u3057\uFF09\nAB{n}>={dif} n=10\u9762\u30C0\u30A4\u30B9\u306E\u6570\u3001dif=\u96E3\u6613\u5EA6\n- \u6280\u80FD\u5224\u5B9A\uFF08\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u30FB\u30D5\u30A1\u30F3\u30D6\u30EB\u3042\u308A\uFF09\nABT{n}>={dif} n=10\u9762\u30C0\u30A4\u30B9\u306E\u6570\u3001dif=\u96E3\u6613\u5EA6\n- \u30C0\u30E1\u30FC\u30B8\u30C1\u30A7\u30C3\u30AF\nDMG>={dif} dif=\u30C0\u30E1\u30FC\u30B8\u96E3\u6613\u5EA6\n\n\u203B \u6280\u80FD\u5224\u5B9A\u3001\u30C0\u30E1\u30FC\u30B8\u30C1\u30A7\u30C3\u30AF\u3068\u3082\u306B\u30C0\u30A4\u30B9\u7D50\u679C\u3001\u96E3\u6613\u5EA6\u306B\u5BFE\u3057\u3066\u56DB\u5247\u6F14\u7B97\uFF08+ - * /\uFF09\u3092\u7528\u3044\u305F\u8907\u6570\u30DC\u30FC\u30CA\u30B9\u3092\u542B\u3081\u308B\u3053\u3068\u304C\u53EF\u80FD\u3067\u3059\u3002\u8A08\u7B97\u7D50\u679C\u306E\u5C0F\u6570\u306F\u5207\u308A\u6368\u3066\u3089\u308C\u307E\u3059\u3002\n\n\u4F8B:AB2>=5 \uFF08\u4E00\u822C\u6280\u80FD\u3092\u6D3B\u7528\u3057\u3066\u96E3\u6613\u5EA65\u306E\u6280\u80FD\u5224\u5B9A\u3002 \u30AF\u30EA\u30D5\u30A1\u30F3\u306A\u3057\u3002\uFF09\n\u4F8B:ABT3>=15 \uFF08\u5C02\u9580\u6280\u80FD\u3092\u6D3B\u7528\u3057\u3066\u96E3\u6613\u5EA615\u306E\u6280\u80FD\u5224\u5B9A\u3002\u30AF\u30EA\u30D5\u30A1\u30F3\u3042\u308A\u3002\uFF09\n\u4F8B:AB1+1+2>=8 \uFF08\u4E00\u822C\u6280\u80FD\u3092\u6D3B\u7528\u305B\u305A\u96E3\u6613\u5EA68\u306E\u6280\u80FD\u5224\u5B9A\u3002 \u30DC\u30FC\u30CA\u30B9\u3068\u3057\u3066+1\u3068+2\u70B9\u306E\u88DC\u6B63\u3042\u308A\u3002 \u30AF\u30EA\u30D5\u30A1\u30F3\u306A\u3057\u3002\uFF09\n\u4F8B:ABT3-3>=10+2 \uFF08\u5C02\u9580\u6280\u80FD\u3092\u6D3B\u7528\u3057\u3066\u96E3\u6613\u5EA610+2\u306E\u6280\u80FD\u5224\u5B9A\u3002\u30DA\u30CA\u30EB\u30C6\u30A3\u3068\u3057\u3066-3\u70B9\u306E\u88DC\u6B63\u3042\u308A\u3002\u30AF\u30EA\u30D5\u30A1\u30F3\u3042\u308A\u3002\uFF09\n\u4F8B:ABT2>=4/8/12 \uFF08\u4E00\u822C\u6280\u80FD\u3092\u6D3B\u7528\u3057\u3066\u96E3\u6613\u5EA64/8/12\u306E\u6BB5\u968E\u7684\u306A\u6280\u80FD\u5224\u5B9A\u3002\u30AF\u30EA\u30D5\u30A1\u30F3\u3042\u308A\u3002\uFF09\n\u4F8B:DMG>=50 \uFF08\u96E3\u6613\u5EA650\u306E\u5224\u5B9A\u3002\uFF09\n\u4F8B:DMG>=20+50 \uFF08\u96E3\u6613\u5EA620+50\u306E\u5224\u5B9A\u3002\uFF09\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(command) ⇒ Object
- #roll_damage_check(command) ⇒ Object
- #roll_skills(command) ⇒ Object
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
Constructor Details
This class inherits a constructor from BCDice::Base
Instance Method Details
#eval_game_system_specific_command(command) ⇒ Object
36 37 38 |
# File 'lib/bcdice/game_system/Aionia.rb', line 36 def eval_game_system_specific_command(command) return roll_skills(command) || roll_damage_check(command) end |
#roll_damage_check(command) ⇒ Object
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/bcdice/game_system/Aionia.rb', line 137 def roll_damage_check(command) parser = Command::Parser.new("DMG", round_type: BCDice::RoundType::FLOOR).restrict_cmp_op_to(:>=) parsed = parser.parse(command) return nil unless parsed # 値の計算 dif = parsed.target_number return nil unless dif # ダイスロール dice_result = @randomizer.roll_once(100) # Result用変数宣言 is_success = false # 結果判定 if dice_result < (dif / 5) is_success = false second_result = @randomizer.roll_once(100) if second_result >= dif result_str = "失敗 > 弱点追加 > #{second_result} > 戦闘不能状態" else result_str = "失敗 > 弱点追加 > #{second_result} > 死亡状態" end elsif dice_result < (dif / 2) result_str = "失敗 > 弱点追加 > 戦闘不能状態" is_success = false elsif dice_result < dif result_str = "失敗 > 戦闘不能状態" is_success = false else result_str = "成功" is_success = true end Result.new.tap do |r| r.text = "(#{command}) > #{dice_result} > #{result_str}" r.success = is_success r.failure = !is_success end end |
#roll_skills(command) ⇒ Object
40 41 42 43 44 45 46 47 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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/bcdice/game_system/Aionia.rb', line 40 def roll_skills(command) m = %r{^AB(T?)(\d+)((?:[-+]\d+)*)>=(\d+(?:/\d+)*)((?:[-+]\d+)*)$}.match(command) return nil unless m # 値の取得 use_cf = m[1] != '' times = m[2].to_i # 値の計算 bonus = m[3] != '' ? Arithmetic.eval(m[3], RoundType::FLOOR) : 0 return nil unless bonus base_targets = m[4].split('/').map(&:to_i) target_bonus = m[5] != '' ? Arithmetic.eval(m[5], RoundType::FLOOR) : 0 return nil unless target_bonus targets = base_targets.map { |t| t + target_bonus } target = targets[0] min_target = targets.min max_target = targets.max # ダイスロール dice_list = @randomizer.(times, 10) dice_total = dice_list.sum total = dice_total + bonus # Result用変数宣言 is_success = false has_critical = false has_fumble = false # 結果判定 # 難易度が一つの場合 if targets.count == 1 if total >= target is_success = true if total >= target + 20 && use_cf result = 'クリティカル' has_critical = true elsif target <= times result = '自動成功' else result = '成功' end else is_success = false if dice_list.count(1) == times && use_cf result = 'ファンブル' has_fumble = true elsif target > 10 * times result = '自動失敗' else result = '失敗' end end # 段階的な難易度判定の場合 else if total >= min_target is_success = true if total >= max_target + 20 && use_cf result = 'クリティカル' has_critical = true elsif max_target <= times result = '自動成功' elsif total >= max_target result = '全成功' else times_suc = targets.count { |x| x <= total } result = "#{times_suc}段階成功" end else is_success = false if dice_list.count(1) == times && use_cf result = 'ファンブル' has_fumble = true elsif min_target > 10 * times result = '自動失敗' else result = '失敗' end end end # ボーナスがある場合の処理 bonus_text = m[3] bonus_result = m[3] == '' ? '' : "#{total} > " # Resultクラスに結果を入れる Result.new.tap do |r| r.text = "(#{command}) > #{dice_total}[#{dice_list.join(',')}]#{bonus_text} > #{bonus_result}#{result}" r.critical = has_critical r.fumble = has_fumble r.success = is_success r.failure = !is_success end end |