Class: BCDice::GameSystem::ShinMegamiTenseiKakuseihen

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

Constant Summary collapse

ID =

ゲームシステムの識別子

'ShinMegamiTenseiKakuseihen'
NAME =

ゲームシステム名

'真・女神転生TRPG 覚醒篇'
SORT_KEY =

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

'しんめかみてんせいTRPGかくせいへん'
HELP_MESSAGE =

ダイスボットの使い方

<<~INFO_MESSAGE_TEXT
  ・判定
  1D100<=(目標値) でスワップ・通常・逆スワップ判定を判定。
  威力ダイスは nU6[6] (nはダイス個数)でロール可能です。
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

#check_1D100(total, dice_total, cmp_op, target) ⇒ Object

ゲーム別成功度判定(1d100)



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/bcdice/game_system/ShinMegamiTenseiKakuseihen.rb', line 23

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

  dice1, dice2 = split_tens(dice_total)

  total1 = dice1 * 10 + dice2
  total2 = dice2 * 10 + dice1

  # ゾロ目
  isRepdigit = (dice1 == dice2)

  result = " > スワップ"
  result += getCheckResultText(target, [total1, total2].min, isRepdigit)
  result += "/通常"
  result += getCheckResultText(target, total % 100, isRepdigit)
  result += "/逆スワップ"
  result += getCheckResultText(target, [total1, total2].max, isRepdigit)

  return result
end

#getCheckResult(diff, total, isRepdigit) ⇒ Object



60
61
62
63
64
65
66
# File 'lib/bcdice/game_system/ShinMegamiTenseiKakuseihen.rb', line 60

def getCheckResult(diff, total, isRepdigit)
  if diff >= total
    return getSuccessResult(isRepdigit)
  end

  return getFailResult(isRepdigit)
end

#getCheckResultText(diff, total, isRepdigit) ⇒ Object



54
55
56
57
58
# File 'lib/bcdice/game_system/ShinMegamiTenseiKakuseihen.rb', line 54

def getCheckResultText(diff, total, isRepdigit)
  checkResult = getCheckResult(diff, total, isRepdigit)
  text = format("(%02d)", total) + checkResult
  return text
end

#getFailResult(isRepdigit) ⇒ Object



76
77
78
79
80
81
82
# File 'lib/bcdice/game_system/ShinMegamiTenseiKakuseihen.rb', line 76

def getFailResult(isRepdigit)
  if isRepdigit
    return "絶対失敗"
  end

  return "失敗"
end

#getSuccessResult(isRepdigit) ⇒ Object



68
69
70
71
72
73
74
# File 'lib/bcdice/game_system/ShinMegamiTenseiKakuseihen.rb', line 68

def getSuccessResult(isRepdigit)
  if isRepdigit
    return "絶対成功"
  end

  return "成功"
end

#split_tens(value) ⇒ Object



45
46
47
48
49
50
51
52
# File 'lib/bcdice/game_system/ShinMegamiTenseiKakuseihen.rb', line 45

def split_tens(value)
  value %= 100

  ones = value / 10
  tens = value % 10

  return [ones, tens]
end