Class: BCDice::GameSystem::Elric

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

Constant Summary collapse

ID =

ゲームシステムの識別子

'Elric'
NAME =

ゲームシステム名

'エルリック!'
SORT_KEY =

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

'えるりつく'
HELP_MESSAGE =

ダイスボットの使い方

"貫通、クリティカル、ファンブルの自動判定を行います。\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

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

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



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/bcdice/game_system/Elric.rb', line 19

def check_1D100(total, _dice_total, cmp_op, target)
  return '' if target == '?'
  return '' unless cmp_op == :<=

  # 1は常に貫通
  return " > 貫通" if total <= 1
  # 100は常に致命的失敗
  return " > 致命的失敗" if total >= 100

  return " > 決定的成功" if total <= (target / 5 + 0.9)
  return " > 成功" if total <= target
  return " > 致命的失敗" if (total >= 99) && (target < 100)

  return " > 失敗"
end