Class: BCDice::GameSystem::NjslyrBattle

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

Constant Summary collapse

ID =

ゲームシステムの識別子

'NjslyrBattle'
NAME =

ゲームシステム名

'NJSLYRBATTLE'
SORT_KEY =

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

'にんしやすれいやあはとる'
HELP_MESSAGE =

ダイスボットの使い方

<<~INFO_MESSAGE_TEXT
  ・カラテロール
  2d6<=(カラテ点)
  例)2d6<=5
  (2D6<=5) > 2[1,1] > 2 > 成功 重点 3 溜まる
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_2D6(total, _dice_total, dice_list, cmp_op, target) ⇒ Object

ゲーム別成功度判定(2D6)



24
25
26
27
28
29
# File 'lib/bcdice/game_system/NjslyrBattle.rb', line 24

def check_2D6(total, _dice_total, dice_list, cmp_op, target)
  return '' if target == '?'
  return '' if cmp_op != :<=

  return success_text(total, target) + juuten(dice_list)
end

#juuten(dice_list) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/bcdice/game_system/NjslyrBattle.rb', line 39

def juuten(dice_list)
  juuten = dice_list.count(1) + dice_list.count(6)

  if dice_list[0] == dice_list[1]
    juuten += 1
  end

  if juuten > 0
    " 重点 #{juuten} 溜まる"
  else
    ""
  end
end

#success_text(total, target) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/bcdice/game_system/NjslyrBattle.rb', line 31

def success_text(total, target)
  if total <= target
    " > 成功"
  else
    " > 失敗"
  end
end