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

#result_2d6(total, _dice_total, dice_list, cmp_op, target) ⇒ Object

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



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

def result_2d6(total, _dice_total, dice_list, cmp_op, target)
  return Result.nothing if target == "?"
  return nil if cmp_op != :<=

  result = (total <= target ? Result.success("成功") : Result.failure("失敗"))
  result.text += juuten(dice_list)

  return result
end