Class: BCDice::GameSystem::NightWizard::ParsedNW
- Defined in:
- lib/bcdice/game_system/NightWizard.rb
Instance Attribute Summary collapse
-
#base ⇒ Integer
判定の基礎値.
-
#modify_number ⇒ Integer
修正値.
Attributes inherited from Parsed
#active_modify_number, #cmp_op, #critical_numbers, #fumble_numbers, #prana, #target_number
Instance Method Summary collapse
-
#initialize(command) ⇒ ParsedNW
constructor
A new instance of ParsedNW.
-
#passive_modify_number ⇒ Integer
常に適用される修正値を返す.
- #to_s ⇒ String
Constructor Details
#initialize(command) ⇒ ParsedNW
Returns a new instance of ParsedNW.
91 92 93 94 |
# File 'lib/bcdice/game_system/NightWizard.rb', line 91 def initialize(command) super() @command = command end |
Instance Attribute Details
#base ⇒ Integer
Returns 判定の基礎値.
86 87 88 |
# File 'lib/bcdice/game_system/NightWizard.rb', line 86 def base @base end |
#modify_number ⇒ Integer
Returns 修正値.
89 90 91 |
# File 'lib/bcdice/game_system/NightWizard.rb', line 89 def modify_number @modify_number end |
Instance Method Details
#passive_modify_number ⇒ Integer
常に適用される修正値を返す
99 100 101 |
# File 'lib/bcdice/game_system/NightWizard.rb', line 99 def passive_modify_number @base + @modify_number end |
#to_s ⇒ String
104 105 106 107 108 109 110 111 |
# File 'lib/bcdice/game_system/NightWizard.rb', line 104 def to_s base = @base.zero? ? nil : @base modify_number = Format.modifier(@modify_number) active_modify_number = Format.modifier(@active_modify_number) dollar = @prana && "$#{@prana}" return "#{base}#{@command}#{modify_number}@#{@critical_numbers.join(',')}##{@fumble_numbers.join(',')}#{dollar}#{active_modify_number}#{@cmp_op}#{@target_number}" end |