Class: BCDice::GameSystem::SharedFantasia
- Defined in:
- lib/bcdice/game_system/SharedFantasia.rb
Constant Summary collapse
- ID =
ゲームシステムの識別子
'SharedFantasia'
- NAME =
ゲームシステム名
'Shared†Fantasia'
- SORT_KEY =
ゲームシステム名の読みがな
'しえああとふあんたしあ'
- HELP_MESSAGE =
ダイスボットの使い方
<<~MESSAGETEXT 2D6の成功判定に 自動成功、自動失敗、致命的失敗、劇的成功 の判定があります。 SF/ST = 2D6のショートカット 例) SF+4>=9 : 2D6して4を足した値が9以上なら成功 MESSAGETEXT
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
#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
Constructor Details
This class inherits a constructor from BCDice::Base
Instance Method Details
#change_text(string) ⇒ Object
26 27 28 |
# File 'lib/bcdice/game_system/SharedFantasia.rb', line 26 def change_text(string) string.gsub(/SF/i, "2D6").gsub(/ST/i, "2D6") end |
#check_2D6(total, dice_total, _dice_list, cmp_op, target) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/bcdice/game_system/SharedFantasia.rb', line 30 def check_2D6(total, dice_total, _dice_list, cmp_op, target) return '' if target == '?' critical = false fumble = false if dice_total == 12 critical = true elsif dice_total == 2 fumble = true end totalValueBonus = 0 if cmp_op == :>= totalValueBonus = 1 end if [:>=, :>].include?(cmp_op) if (total + totalValueBonus) > target if critical return " > 自動成功(劇的成功)" elsif fumble return " > 自動失敗" else return " > 成功" end else if critical return " > 自動成功" elsif fumble return " > 自動失敗(致命的失敗)" else return " > 失敗" end end end end |