Class: BCDice::GameSystem::KemonoNoMori

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

Direct Known Subclasses

KemonoNoMori_Korean

Constant Summary collapse

ID =

ゲームシステムの識別子

'KemonoNoMori'
NAME =

ゲームシステム名

'獸ノ森'
SORT_KEY =

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

'けもののもり'
HELP_MESSAGE =

ダイスボットの使い方

<<~MESSAGETEXT
  ・行為判定(成功度自動算出)(P119): KAx[±y]
  ・継続判定(成功度+1固定): KCx[±y]
     x=目標値
     y=目標値への修正(任意) x+y-z のように複数指定可能
       例1)KA7+3 → 目標値7にプラス3の修正を加えた行為判定
       例2)KC6 → 目標値6の継続判定
  ・罠動作チェック+獲物表(P163): CTR
     罠ごとに1D12を振り、12が出た場合には生き物が罠を動作させ、その影響を受けている。
  ・各種表(基本ルールブック)
    ・大失敗表(P120): FT
    ・能力値ランダム決定表(P121): RST
    ・ランダム所要時間表(P122): RTT
    ・ランダム消耗表(P122): RET
    ・ランダム天気表(P128): RWT
    ・ランダム天気持続表(P128): RWDT
    ・ランダム遮蔽物表(屋外)(P140): ROMT
    ・ランダム遮蔽物表(屋内)(P140): RIMT
    ・逃走体験表(P144): EET
    ・食材採集表(P157): GFT
    ・水採集表(P157): GWT
    ・白の魔石効果表(P186): WST
  ・部位ダメージ関連の表(参照先ページはリプレイ&データブック「嚙神ノ宴」のもの)
    ・人間部位表(P216): HPT
    ・部位ダメージ段階表(P217): PDT
    ・四足動物部位表(P225): QPT
    ・無足動物部位表(P225): APT
    ・二足動物部位表(P226): TPT
    ・鳥部位表(P226): BPT
    ・頭足動物部位表(P227): CPT
    ・昆虫部位表(P227): IPT
    ・蜘蛛部位表(P228): SPT
MESSAGETEXT
TABLES =
translate_tables(:ja_jp).freeze

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_1D12(command, is_action_judge) ⇒ Object



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

def check_1D12(command, is_action_judge)
  debug('獸ノ森の1d12判定')
  m = /K[AC](\d[-+\d]*)/.match(command)
  return nil unless m

  # 修正込みの目標値を計算
  target_total = ArithmeticEvaluator.eval(m[1])
  debug('target_total', target_total)

  # 行為判定の成功度は [目標値の10の位の数+1]
  # 継続判定の成功度は固定で+1
  success_degree = is_action_judge ? target_total / 10 + 1 : 1

  dice_total = @randomizer.roll_once(12)
  debug('dice_total, target_total, success_degree = ', dice_total, target_total, success_degree)

  if dice_total == 12
    Result.fumble("(1D12<=#{target_total}) > #{dice_total}#{translate('KemonoNoMori.fumble')}")
  elsif dice_total == 11
    Result.critical("(1D12<=#{target_total}) > #{dice_total}#{translate('KemonoNoMori.critical', success_degree: success_degree)}")
  elsif dice_total <= target_total
    Result.success("(1D12<=#{target_total}) > #{dice_total}#{translate('KemonoNoMori.success', success_degree: success_degree)}")
  else
    Result.failure("(1D12<=#{target_total}) > #{dice_total}#{translate('failure')}")
  end
end

#eval_game_system_specific_command(command) ⇒ Object



53
54
55
56
57
58
59
60
61
# File 'lib/bcdice/game_system/KemonoNoMori.rb', line 53

def eval_game_system_specific_command(command)
  case command
  when /KA\d[-+\d]*/ then check_1D12(command, true)
  when /KC\d[-+\d]*/ then check_1D12(command, false)
  when 'CTR' then get_trap_result()
  when 'EET' then get_escape_experience_table_result(command)
  else roll_tables(command, self.class::TABLES)
  end
end

#get_escape_experience_table_result(command) ⇒ Object



105
106
107
108
109
# File 'lib/bcdice/game_system/KemonoNoMori.rb', line 105

def get_escape_experience_table_result(command)
  escape_experience = roll_tables(command, self.class::TABLES)
  escape_duration = @randomizer.roll_once(12)
  Result.new("#{escape_experience} (#{translate('KemonoNoMori.reappear', hours: escape_duration)})")
end

#get_trap_resultObject



90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/bcdice/game_system/KemonoNoMori.rb', line 90

def get_trap_result()
  tra_check_num = @randomizer.roll_once(12)
  unless tra_check_num == 12
    return Result.new(translate('KemonoNoMori.trap_not_activated', check_num: tra_check_num))
  end

  chase_num = @randomizer.roll_once(12)
  chase_key = case chase_num
              when 1..4  then 'KemonoNoMori.trap_activated_small'
              when 5..8  then 'KemonoNoMori.trap_activated_large'
              when 9..12 then 'KemonoNoMori.trap_activated_human'
              end
  Result.new(translate(chase_key, check_num: tra_check_num, chase_num: chase_num))
end