Class: BCDice::GameSystem::RuneQuest

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

Constant Summary collapse

ID =

ゲームシステムの識別子

'RuneQuest'
NAME =

ゲームシステム名

'ルーンクエスト'
SORT_KEY =

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

'るうんくえすと'
HELP_MESSAGE =

ダイスボットの使い方

<<~INFO_MESSAGE_TEXT
  クリティカル、エフェクティブ(効果的成功)、ファンブルの自動判定を行います。
INFO_MESSAGE_TEXT

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

#result_1d100(total, _dice_total, cmp_op, target) ⇒ Object

ゲーム別成功度判定(1d100)



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/bcdice/game_system/RuneQuest.rb', line 21

def result_1d100(total, _dice_total, cmp_op, target)
  return Result.nothing if target == '?'
  return nil unless cmp_op == :<=

  # RuneQuest QUICK-START RULESを元に修正
  # https://www.chaosium.com/content/FreePDFs/RuneQuest/CHA4027%20-%20RuneQuest%20Quickstart.pdf
  critical_value = (target.to_f / 20).round

  if (total <= 1) || (total <= critical_value)
    # 1は常に決定的成功
    Result.critical("決定的成功")
  elsif total >= 100
    # 100は常に致命的失敗
    Result.fumble("致命的失敗")
  elsif total <= (target.to_f / 5).round
    Result.success("効果的成功")
  elsif total <= target
    Result.success("成功")
  elsif total >= 95 + critical_value
    Result.fumble("致命的失敗")
  else
    Result.failure("失敗")
  end
end