Class: BCDice::GameSystem::SRS::SRSRollNode

Inherits:
Struct
  • Object
show all
Defined in:
lib/bcdice/game_system/SRS.rb

Overview

成功判定コマンドのノード

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#critical_valueObject

Returns the value of attribute critical_value

Returns:

  • (Object)

    the current value of critical_value



175
176
177
# File 'lib/bcdice/game_system/SRS.rb', line 175

def critical_value
  @critical_value
end

#fumble_valueObject

Returns the value of attribute fumble_value

Returns:

  • (Object)

    the current value of fumble_value



175
176
177
# File 'lib/bcdice/game_system/SRS.rb', line 175

def fumble_value
  @fumble_value
end

#modifierObject

Returns the value of attribute modifier

Returns:

  • (Object)

    the current value of modifier



175
176
177
# File 'lib/bcdice/game_system/SRS.rb', line 175

def modifier
  @modifier
end

#target_valueObject

Returns the value of attribute target_value

Returns:

  • (Object)

    the current value of target_value



175
176
177
# File 'lib/bcdice/game_system/SRS.rb', line 175

def target_value
  @target_value
end

Instance Method Details

#to_sString

成功判定の文字列表記を返す

Returns:

  • (String)


180
181
182
183
184
185
# File 'lib/bcdice/game_system/SRS.rb', line 180

def to_s
  lhs = "2D6#{Format.modifier(modifier)}"
  expression = target_value ? "#{lhs}>=#{target_value}" : lhs

  return "#{expression}[#{critical_value},#{fumble_value}]"
end