Class: BCDice::GameSystem::NightWizard::ParsedNW

Inherits:
Parsed
  • Object
show all
Defined in:
lib/bcdice/game_system/NightWizard.rb

Instance Attribute Summary collapse

Attributes inherited from Parsed

#active_modify_number, #cmp_op, #critical_numbers, #fumble_numbers, #prana, #target_number

Instance Method Summary collapse

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

#baseInteger

Returns 判定の基礎値.

Returns:

  • (Integer)

    判定の基礎値



86
87
88
# File 'lib/bcdice/game_system/NightWizard.rb', line 86

def base
  @base
end

#modify_numberInteger

Returns 修正値.

Returns:

  • (Integer)

    修正値



89
90
91
# File 'lib/bcdice/game_system/NightWizard.rb', line 89

def modify_number
  @modify_number
end

Instance Method Details

#passive_modify_numberInteger

常に適用される修正値を返す

Returns:

  • (Integer)


99
100
101
# File 'lib/bcdice/game_system/NightWizard.rb', line 99

def passive_modify_number
  @base + @modify_number
end

#to_sString

Returns:

  • (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