Class: BCDice::GameSystem::Chill3

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

Constant Summary collapse

ID =

ゲームシステムの識別子

'Chill3'
NAME =

ゲームシステム名

'Chill 3rd Edition'
SORT_KEY =

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

'ちる3'
HELP_MESSAGE =

ダイスボットの使い方

<<~INFO_MESSAGE_TEXT
  ・1D100で判定時に成否、Botchを判定
   例)1D100<=50
     Chill3 : (1D100<=50) > 55 > Botch
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



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

def result_1d100(total, dice_total, cmp_op, target)
  return nil if target == '?'
  return nil unless cmp_op == :<=

  # ゾロ目ならC-ResultかBotch
  tens = (dice_total / 10) % 10
  ones = dice_total % 10

  if tens == ones
    if (total > target) || (dice_total == 100) # 00は必ず失敗
      if target > 100 # 目標値が100を超えている場合は、00を振ってもBotchにならない
        return Result.failure("失敗")
      else
        return Result.fumble("Botch")
      end
    else
      return Result.critical("C成功")
    end
  elsif (total <= target) || (dice_total == 1) # 01は必ず成功
    if total <= (target / 2)
      return Result.success("H成功")
    else
      return Result.success("L成功")
    end
  else
    return Result.failure("失敗")
  end
end