Class: BCDice::GameSystem::KemonoNoMori

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

Constant Summary collapse

ID =

ゲームシステムの識別子

'KemonoNoMori'
NAME =

ゲームシステム名

'獸ノ森'
SORT_KEY =

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

'けもののもり'
HELP_MESSAGE =

ダイスボットの使い方

"\u30FB\u884C\u70BA\u5224\u5B9A(\u6210\u529F\u5EA6\u81EA\u52D5\u7B97\u51FA)(P119): KAx[\u00B1y]\n\u30FB\u7D99\u7D9A\u5224\u5B9A(\u6210\u529F\u5EA6+1\u56FA\u5B9A): KCx[\u00B1y]\n   x=\u76EE\u6A19\u5024\n   y=\u76EE\u6A19\u5024\u3078\u306E\u4FEE\u6B63(\u4EFB\u610F) x+y-z \u306E\u3088\u3046\u306B\u8907\u6570\u6307\u5B9A\u53EF\u80FD\n     \u4F8B1\uFF09KA7+3 \u2192 \u76EE\u6A19\u50247\u306B\u30D7\u30E9\u30B93\u306E\u4FEE\u6B63\u3092\u52A0\u3048\u305F\u884C\u70BA\u5224\u5B9A\n     \u4F8B2\uFF09KC6 \u2192 \u76EE\u6A19\u50246\u306E\u7D99\u7D9A\u5224\u5B9A\n\u30FB\u7F60\u52D5\u4F5C\u30C1\u30A7\u30C3\u30AF+\u7372\u7269\u8868(P163): CTR\n   \u7F60\u3054\u3068\u306B1D12\u3092\u632F\u308A\u300112\u304C\u51FA\u305F\u5834\u5408\u306B\u306F\u751F\u304D\u7269\u304C\u7F60\u3092\u52D5\u4F5C\u3055\u305B\u3001\u305D\u306E\u5F71\u97FF\u3092\u53D7\u3051\u3066\u3044\u308B\u3002\n\u30FB\u5404\u7A2E\u8868\uFF08\u57FA\u672C\u30EB\u30FC\u30EB\u30D6\u30C3\u30AF\uFF09\n  \u30FB\u5927\u5931\u6557\u8868(P120): FT\n  \u30FB\u80FD\u529B\u5024\u30E9\u30F3\u30C0\u30E0\u6C7A\u5B9A\u8868(P121): RST\n  \u30FB\u30E9\u30F3\u30C0\u30E0\u6240\u8981\u6642\u9593\u8868(P122): RTT\n  \u30FB\u30E9\u30F3\u30C0\u30E0\u6D88\u8017\u8868(P122): RET\n  \u30FB\u30E9\u30F3\u30C0\u30E0\u5929\u6C17\u8868(P128): RWT\n  \u30FB\u30E9\u30F3\u30C0\u30E0\u5929\u6C17\u6301\u7D9A\u8868(P128): RWDT\n  \u30FB\u30E9\u30F3\u30C0\u30E0\u906E\u853D\u7269\u8868\uFF08\u5C4B\u5916\uFF09(P140): ROMT\n  \u30FB\u30E9\u30F3\u30C0\u30E0\u906E\u853D\u7269\u8868\uFF08\u5C4B\u5185\uFF09(P140): RIMT\n  \u30FB\u9003\u8D70\u4F53\u9A13\u8868(P144): EET\n  \u30FB\u98DF\u6750\u63A1\u96C6\u8868(P157): GFT\n  \u30FB\u6C34\u63A1\u96C6\u8868(P157): GWT\n  \u30FB\u767D\u306E\u9B54\u77F3\u52B9\u679C\u8868(P186): WST\n\u30FB\u90E8\u4F4D\u30C0\u30E1\u30FC\u30B8\u95A2\u9023\u306E\u8868\uFF08\u53C2\u7167\u5148\u30DA\u30FC\u30B8\u306F\u30EA\u30D7\u30EC\u30A4&\u30C7\u30FC\u30BF\u30D6\u30C3\u30AF\u300C\u5699\u795E\u30CE\u5BB4\u300D\u306E\u3082\u306E\uFF09\n  \u30FB\u4EBA\u9593\u90E8\u4F4D\u8868(P216): HPT\n  \u30FB\u90E8\u4F4D\u30C0\u30E1\u30FC\u30B8\u6BB5\u968E\u8868(P217): PDT\n  \u30FB\u56DB\u8DB3\u52D5\u7269\u90E8\u4F4D\u8868(P225): QPT\n  \u30FB\u7121\u8DB3\u52D5\u7269\u90E8\u4F4D\u8868(P225): APT\n  \u30FB\u4E8C\u8DB3\u52D5\u7269\u90E8\u4F4D\u8868(P226): TPT\n  \u30FB\u9CE5\u90E8\u4F4D\u8868(P226): BPT\n  \u30FB\u982D\u8DB3\u52D5\u7269\u90E8\u4F4D\u8868(P227): CPT\n  \u30FB\u6606\u866B\u90E8\u4F4D\u8868(P227): IPT\n  \u30FB\u8718\u86DB\u90E8\u4F4D\u8868(P228): SPT\n"
TABLES =
{
  'FT' => DiceTable::RangeTable.new(
    '大失敗表',
    '1D12',
    [
      [1..3, '【余裕】が3点減少する(最低0まで)'],
      [4..5, 'ランダムな荷物1個が落ちて行方不明になる(大失敗したエリアのアイテム調査で見つけることが可能)'],
      [6..7, 'ランダムな荷物1個が破壊される'],
      [8..9, 'ランダム天気表(RWT)を使用し、結果をターンの終了まで適用する'],
      [10,   'ランダムな準備している小道具1個が破壊される'],
      [11,   '着装している防具が破壊される'],
      [12,   '準備している武器が破壊される'],
    ]
  ),
  'RST' => DiceTable::RangeTable.new(
    '能力値ランダム決定表',
    '1D12',
    [
      [1..2,   '【移動】'],
      [3..4,   '【格闘】'],
      [5..6,   '【射撃】'],
      [7..8,   '【製作】'],
      [9..10,  '【察知】'],
      [11..12, '【自制】'],
    ]
  ),
  'RTT' => DiceTable::RangeTable.new(
    'ランダム所要時間表',
    '1D12',
    [
      [1..3,   '2'],
      [4..6,   '3'],
      [7..9,   '4'],
      [10..12, '5'],
    ]
  ),
  'RET' => DiceTable::RangeTable.new(
    'ランダム消耗表',
    '1D12',
    [
      [1..3,   '0'],
      [4..6,   '1'],
      [7..9,   '2'],
      [10..12, '4'],
    ]
  ),
  'RWT' => DiceTable::RangeTable.new(
    'ランダム天気表',
    '1D12',
    [
      [1..2,   '濃霧'],
      [3..4,   '大雨'],
      [5..6,   '雷雨'],
      [7..8,   '強風'],
      [9..10,  '酷暑'],
      [11..12, '極寒'],
    ]
  ),
  'RWDT' => DiceTable::RangeTable.new(
    'ランダム天気持続表',
    '1D12',
    [
      [1..2,   '1ターン'],
      [3..4,   '3ターン'],
      [5..6,   '6ターン'],
      [7..8,   '24ターン'],
      [9..10,  '72ターン'],
      [11..12, '156ターン'],
    ]
  ),
  'ROMT' => DiceTable::RangeTable.new(
    'ランダム遮蔽物表(屋外)',
    '1D12',
    [
      [1..2,   '【藪】耐久度3,軽減値1,特殊効果:コンタクト内のキャラクターに対する射撃攻撃判定に-1の修正を付加'],
      [3..5,   '【木】耐久度5,軽減値2,特殊効果:コンタクト内のキャラクターに対する射撃攻撃判定に-1の修正を付加'],
      [6..8,   '【大木】耐久度7,軽減値3,特殊効果:コンタクト内のキャラクターに対する射撃攻撃判定に-2の修正を付加'],
      [9..10,  '【岩】耐久度6,軽減値4,特殊効果:コンタクト内のキャラクターに対する射撃攻撃判定に-1の修正を付加/コンタクト内で行われる格闘攻撃のダメージ+1'],
      [11..12, '【岩壁】耐久度8,軽減値4,特殊効果:コンタクト内のキャラクターに対する射撃攻撃判定に-2の修正を付加/コンタクト内で行われる格闘攻撃のダメージ+2'],
    ]
  ),
  'RIMT' => DiceTable::RangeTable.new(
    'ランダム遮蔽物表(屋内)',
    '1D12',
    [
      [1..4,  '【木材の壁】耐久度4,軽減値2,特殊効果:コンタクト内のキャラクターに対する射撃攻撃判定に-1の修正を付加'],
      [5..8,  '【木材の扉】耐久度4,軽減値2,特殊効果:コンタクト内のキャラクターに対する射撃攻撃判定に-1、接触判定と突撃判定に-2の修正を付加'],
      [9..12, '【木製家具】耐久度3,軽減値2,特殊効果:コンタクト内で行われる格闘攻撃のダメージ+1'],
    ]
  ),
  'EET' => DiceTable::RangeTable.new(
    '逃走体験表',
    '1D12',
    [
      [1..3,   '【余裕】が0になる'],
      [4..6,   '任意の【絆】を合計2点減少する'],
      [7..9,   '全ての荷物を失う(逃走したエリアに配置され、調査で発見可能)'],
      [10..12, '全ての武器と防具と小道具と荷物を失う(逃走したエリアに配置され、調査で発見可能)'],
    ]
  ),
  'GFT' => DiceTable::RangeTable.new(
    '食材採集表',
    '1D12',
    [
      [1..2,  '食べられる根(栄養価:2)'],
      [3..5,  '食べられる草(栄養価:3)'],
      [6..8,  '食べられる実(栄養価:5)'],
      [9..10, '小型動物(栄養価:10)'],
      [11,    '大型動物(栄養価:40)'],
      [12,    '気持ち悪い虫(栄養価:1)'],
    ]
  ),
  'GWT' => DiceTable::RangeTable.new(
    '水採集表',
    '1D12',
    [
      [1..6,  '汚水'],
      [7..11, '飲料水'],
      [12,    '毒水'],
    ]
  ),
  'WST' => DiceTable::Table.new(
    '白の魔石効果表',
    '1D12',
    [
      '役に立たないものの色を変える',
      '役に立たないものを大きくする',
      '役に立たないものを小さくする',
      '役に立たないものを保存する',
      '役に立たないものを復元する',
      '役に立たないものを召喚する',
      '役に立たないものを動かす',
      '役に立たないものを増やす',
      '役に立たないものを貼り付ける',
      '役に立たないものを作り出す',
      '小型動物を召喚する',
      '大型動物を召喚する',
    ]
  ),
  'HPT' => DiceTable::RangeTable.new(
    '人間部位表',
    '1D12',
    [
      [1..2,  '右腕部'],
      [3..4,  '左腕部'],
      [5..6,  '右脚部'],
      [7..8,  '左脚部'],
      [9..11, '胴部'],
      [12,    '頭部'],
    ]
  ),
  'PDT' => DiceTable::RangeTable.new(
    '部位ダメージ段階表',
    '1D12',
    [
      [1..6,  '軽傷'],
      [7..10, '重傷'],
      [11,    '破壊'],
      [12,    '喪失'],
    ]
  ),
  'QPT' => DiceTable::RangeTable.new(
    '四足動物部位表',
    '1D12',
    [
      [1..2,    '異形'],
      [3,       '武器'],
      [4,       '右前脚部'],
      [5,       '左前脚部'],
      [6,       '右後脚部'],
      [7,       '左後脚部'],
      [8..10,   '胴部'],
      [11..12,  '頭部'],
    ]
  ),
  'APT' => DiceTable::RangeTable.new(
    '無足動物部位表',
    '1D12',
    [
      [1..3,    '異形'],
      [4..6,    '武器'],
      [7..10,   '胴部'],
      [11..12,  '頭部'],
    ]
  ),
  'TPT' => DiceTable::RangeTable.new(
    '二足動物部位表',
    '1D12',
    [
      [1,     '異形'],
      [2,     '武器'],
      [3,     '右腕部'],
      [4,     '左腕部'],
      [5..6,  '右脚部'],
      [7..8,  '左脚部'],
      [9..11, '胴部'],
      [12,    '頭部'],
    ]
  ),
  'BPT' => DiceTable::RangeTable.new(
    '鳥部位表',
    '1D12',
    [
      [1,     '異形'],
      [2,     '武器'],
      [3..4,  '右翼(右腕部)'],
      [5..6,  '左翼(左腕部)'],
      [7,     '右脚部'],
      [8,     '左脚部'],
      [9..11, '胴部'],
      [12,    '頭部'],
    ]
  ),
  'CPT' => DiceTable::RangeTable.new(
    '頭足動物部位表',
    '1D12',
    [
      [1,     '異形'],
      [2,     '武器'],
      [3,     '右腕部'],
      [4,     '左腕部'],
      [5..7,  '右脚部'],
      [8..10, '左脚部'],
      [11,    '胴部'],
      [12,    '頭部'],
    ]
  ),
  'IPT' => DiceTable::RangeTable.new(
    '昆虫部位表',
    '1D12',
    [
      [1..2,    '異形'],
      [3,       '武器'],
      [4,       '右前脚部'],
      [5,       '左前脚部'],
      [6,       '右中脚部'],
      [7,       '左中脚部'],
      [8,       '右後脚部'],
      [9,       '左後脚部'],
      [10..11,  '胴部'],
      [12,      '頭部'],
    ]
  ),
  'SPT' => DiceTable::RangeTable.new(
    '蜘蛛部位表',
    '1D12',
    [
      [1,   '異形'],
      [2,   '武器'],
      [3,   '右第一脚部'],
      [4,   '左第一脚部'],
      [5,   '右第二脚部'],
      [6,   '左第二脚部'],
      [7,   '右第三脚部'],
      [8,   '左第三脚部'],
      [9,   '右第四脚部'],
      [10,  '左第四脚部'],
      [11,  '胴部'],
      [12,  '頭部'],
    ]
  ),
}.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} > 大失敗")
  elsif dice_total == 11
    Result.critical("(1D12<=#{target_total}) > #{dice_total} > 大成功(成功度+#{success_degree}, 次の継続判定の目標値を10に変更)")
  elsif dice_total <= target_total
    Result.success("(1D12<=#{target_total}) > #{dice_total} > 成功(成功度+#{success_degree})")
  else
    Result.failure("(1D12<=#{target_total}) > #{dice_total} > 失敗")
  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, 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, TABLES)
  escape_duration = @randomizer.roll_once(12)
  Result.new("#{escape_experience} (再登場: #{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("罠動作チェック(1D12) > #{tra_check_num} > 罠は動作していなかった")
  end

  chase_num = @randomizer.roll_once(12)
  chase = case chase_num
          when 1, 2, 3, 4 then '小型動物'
          when 5, 6, 7, 8 then '大型動物'
          when 9, 10, 11, 12 then '人間の放浪者'
          end
  Result.new("罠動作チェック(1D12) > #{tra_check_num} > 罠が動作していた! > 獲物表(#{chase_num}) > #{chase}が罠にかかっていた")
end