Class: BCDice::GameSystem::HunterTheReckoning5th

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

Constant Summary collapse

ID =

ゲームシステムの識別子

'HunterTheReckoning5th'
NAME =

ゲームシステム名

'Hunter: The Reckoning 5th Edition'
SORT_KEY =

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

'はんあたされこにんく5'
HELP_MESSAGE =

ダイスボットの使い方

<<~MESSAGETEXT
  ・判定コマンド(nHRFx+x)
    注意:難易度は必要成功数を表す

    難易度指定:成功数のカウント、判定成功と失敗、Critical処理、Critical Win、Total Failureのチェックを行う
               (Desperationダイスがある場合)OverreachとDespairの発生チェックを行う
    例) (難易度)HRF(通常ダイス)+(Desperationダイス)
        (難易度)HRF(通常ダイス)

    難易度省略:成功数のカウント、判定失敗、Critical処理、Total Failure、(Desperationダイスがある場合)Despairチェックを行う
                判定成功、Overreachのチェックを行わない
                Critical Win、(Desperationダイスがある場合)Despair、Overreachのヒントを出力
    例) HRF(通常ダイス)+(Desperationダイス)
        HRF(通常ダイス)

    難易度0指定:全てのチェックを行わない
    例) 0HRF(通常ダイス)+(Desperationダイス)
        0HRF(通常ダイス)

MESSAGETEXT
DIFFICULTY_INDEX =
1
DICE_POOL_INDEX =
3
DESPERATION_DICE_INDEX =
5
NOT_CHECK_SUCCESS =

難易度に指定可能な特殊値

-1 # 判定成功にかかわるチェックを行わない(判定失敗に関わるチェックは行う)

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

#eval_game_system_specific_command(command) ⇒ Object



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
# File 'lib/bcdice/game_system/HunterTheReckoning5th.rb', line 47

def eval_game_system_specific_command(command)
  m = /\A(\d+)?(HRF)(\d+)(\+(\d+))?$/.match(command)
  unless m
    return ''
  end

  dice_pool = m[DICE_POOL_INDEX].to_i
  dice_text, success_dice, ten_dice, = make_dice_roll(dice_pool)
  result_text = "(#{dice_pool}D10"

  desperaton_dice_pool = m[DESPERATION_DICE_INDEX]&.to_i
  if desperaton_dice_pool
    if desperaton_dice_pool > 5
      return "Desperationダイス指定は5ダイスが最大です。"
    end

    desperaton_dice_text, desperaton_success_dice, desperaton_ten_dice, desperaton_botch_dice = make_dice_roll(desperaton_dice_pool)

    ten_dice += desperaton_ten_dice
    success_dice += desperaton_success_dice

    result_text = "#{result_text}+#{desperaton_dice_pool}D10) > [#{dice_text}]+[#{desperaton_dice_text}] "
  else
    desperaton_ten_dice = 0
    desperaton_botch_dice = 0
    result_text = "#{result_text}) > [#{dice_text}] "
  end

  success_dice += get_critical_success(ten_dice)

  difficulty = m[DIFFICULTY_INDEX] ? m[DIFFICULTY_INDEX].to_i : NOT_CHECK_SUCCESS

  return get_roll_result(result_text, success_dice, ten_dice, desperaton_ten_dice, desperaton_botch_dice, difficulty)
end