Class: BCDice::GameSystem::Airgetlamh

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

Constant Summary collapse

ID =

ゲームシステムの識別子

'Airgetlamh'
NAME =

ゲームシステム名

'朱の孤塔のエアゲトラム'
SORT_KEY =

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

'あけのことうのえあけとらむ'
HELP_MESSAGE =

ダイスボットの使い方

"\u3010Reg2.0\u300ETHE ANSWERER\u300F\uFF5E\u3011\n\u30FB\u8ABF\u67FB\u5224\u5B9A\uFF08\u6210\u529F\u6570\u3092\u8868\u793A\uFF09\uFF1A[n]AA[m]\n\u30FB\u547D\u4E2D\u5224\u5B9A\uFF08\u30C0\u30E1\u30FC\u30B8\u8868\u793A\uFF09\uFF1A[n]AA[m]*p[+t][Cx]\n\u3010\uFF5EReg1.1\u300E\u6607\u83EF\u300F\u3011\n\u30FB\u8ABF\u67FB\u5224\u5B9A\uFF08\u6210\u529F\u6570\u3092\u8868\u793A\uFF09\uFF1A[n]AL[m]\n\u30FB\u547D\u4E2D\u5224\u5B9A\uFF08\u30C0\u30E1\u30FC\u30B8\u8868\u793A\uFF09\uFF1A[n]AL[m]*p\n----------------------------------------\n[]\u5185\u306E\u30B3\u30DE\u30F3\u30C9\u306F\u7701\u7565\u53EF\u80FD\u3002\n\n\u300Cn\u300D\u3067\u30C0\u30A4\u30B9\u6570\uFF08\u653B\u6483\u56DE\u6570\uFF09\u3092\u6307\u5B9A\u3002\u7701\u7565\u6642\u306F\u300C2\u300D\u3002\n\u300Cm\u300D\u3067\u76EE\u6A19\u5024\u3092\u6307\u5B9A\u3002\u7701\u7565\u6642\u306F\u300C6\u300D\u3002\n\u300Cp\u300D\u3067\u5A01\u529B\u3092\u6307\u5B9A\u3002\u300C*\u300D\u306F\u300Cx\u300D\u3067\u4EE3\u7528\u53EF\u3002\n\u300C+t\u300D\u3067\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u30C8\u30EA\u30AC\u30FC\u3092\u6307\u5B9A\u3002\u7701\u7565\u53EF\u3002\n\u300CCx\u300D\u3067\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u5024\u3092\u6307\u5B9A\u3002\u7701\u7565\u6642\u306F\u300C1\u300D\u3001\u6700\u5927\u5024\u306F\u300C3\u300D\u3001\u300C0\u300D\u3067\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u7121\u3057\u3002\n\n\u653B\u6483\u529B\u6307\u5B9A\u3067\u547D\u4E2D\u5224\u5B9A\u3068\u306A\u308A\u3001\u6210\u529F\u6570\u3067\u306F\u306A\u304F\u3001\u30C0\u30E1\u30FC\u30B8\u3092\u7D50\u679C\u8868\u793A\u3057\u307E\u3059\u3002\n\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u30D2\u30C3\u30C8\u306E\u5206\u3060\u3051\u3001\u81EA\u52D5\u3067\u632F\u308A\u8DB3\u3057\u51E6\u7406\u3092\u884C\u3044\u307E\u3059\u3002\n\uFF08AL\u30B3\u30DE\u30F3\u30C9\u3067\u306F\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u51E6\u7406\u3092\u884C\u3044\u307E\u305B\u3093\uFF09\n\n\u3010\u66F8\u5F0F\u4F8B\u3011\n\u30FBAL \u2192 2d10\u3067\u76EE\u6A19\u50246\u306E\u8ABF\u67FB\u5224\u5B9A\u3002\n\u30FB5AA7*12 \u2192 5d10\u3067\u76EE\u6A19\u50247\u3001\u5A01\u529B12\u306E\u547D\u4E2D\u5224\u5B9A\u3002\n\u30FBAA7x28+5 \u2192 2d10\u3067\u76EE\u6A19\u50247\u3001\u5A01\u529B28\u3001\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u30C8\u30EA\u30AC\u30FC5\u306E\u547D\u4E2D\u5224\u5B9A\u3002\n\u30FB9aa5*10C2 \u2192 9d10\u3067\u76EE\u6A19\u50245\u3001\u5A01\u529B10\u3001\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u50242\u306E\u547D\u4E2D\u5224\u5B9A\u3002\n\u30FB15AAx4c0 \u2192 15d10\u3067\u76EE\u6A19\u50246\u3001\u5A01\u529B4\u3001\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u7121\u3057\u306E\u547D\u4E2D\u5224\u5B9A\u3002\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, prefixes_pattern, register_prefix, register_prefix_from_super_class, #sort_add_dice?, #sort_barabara_dice?

Methods included from Translate

#translate

Constructor Details

#initialize(command) ⇒ Airgetlamh



48
49
50
51
# File 'lib/bcdice/game_system/Airgetlamh.rb', line 48

def initialize(command)
  super(command)
  @sort_add_dice = true # ダイスのソート有
end

Instance Method Details

#checkRoll(diceCount, target, damage, criticalTrigger, criticalNumber) ⇒ Object



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/bcdice/game_system/Airgetlamh.rb', line 75

def checkRoll(diceCount, target, damage, criticalTrigger, criticalNumber)
  totalSuccessCount = 0
  totalCriticalCount = 0
  text = ""

  rollCount = diceCount

  while rollCount > 0
    diceArray = @randomizer.roll_barabara(rollCount, 10).sort
    diceText = diceArray.join(",")

    successCount = diceArray.count { |i| i <= target }
    criticalCount = diceArray.count { |i| i <= criticalNumber }

    totalSuccessCount += successCount
    totalCriticalCount += criticalCount

    text += "+" unless text.empty?
    text += "#{successCount}[#{diceText}]"

    rollCount = criticalCount
  end

  result = ""
  isDamage = (damage != 0)

  if isDamage
    totalDamage = totalSuccessCount * damage + totalCriticalCount * criticalTrigger

    result += "(#{diceCount}D10\<\=#{target}) > #{text} > Hits:#{totalSuccessCount}*#{damage}"
    result += " + Trigger:#{totalCriticalCount}*#{criticalTrigger}" if  criticalTrigger > 0
    result += " > #{totalDamage}ダメージ"
  else
    result += "(#{diceCount}D10\<\=#{target}) > #{text} > 成功数:#{totalSuccessCount}"
  end

  result += " / #{totalCriticalCount}クリティカル" if totalCriticalCount > 0

  return result
end

#eval_game_system_specific_command(command) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/bcdice/game_system/Airgetlamh.rb', line 53

def eval_game_system_specific_command(command)
  # AA/ALコマンド:調査判定, 成功判定
  if command =~ /(\d+)?A(A|L)(\d+)?((x|\*)(\d+)(\+(\d+))?)?(C(\d+))?$/i
    diceCount = (Regexp.last_match(1) || 2).to_i
    target = (Regexp.last_match(3) || 6).to_i
    damage = (Regexp.last_match(6) || 0).to_i

    if Regexp.last_match(2) == 'L' # 旧Ver対応
      criticalTrigger = 0
      criticalNumber = 0
    else
      criticalTrigger = (Regexp.last_match(8) || 0).to_i
      criticalNumber = (Regexp.last_match(10) || 1).to_i
    end
    criticalNumber = 3 if criticalNumber > 4

    return checkRoll(diceCount, target, damage, criticalTrigger, criticalNumber)
  end

  return nil
end