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



207
208
209
# File 'lib/bcdice/game_system/SRS.rb', line 207

def critical_value
  @critical_value
end

#fumble_valueObject

Returns the value of attribute fumble_value

Returns:

  • (Object)

    the current value of fumble_value



207
208
209
# File 'lib/bcdice/game_system/SRS.rb', line 207

def fumble_value
  @fumble_value
end

#modifierObject

Returns the value of attribute modifier

Returns:

  • (Object)

    the current value of modifier



207
208
209
# File 'lib/bcdice/game_system/SRS.rb', line 207

def modifier
  @modifier
end

#target_valueObject

Returns the value of attribute target_value

Returns:

  • (Object)

    the current value of target_value



207
208
209
# File 'lib/bcdice/game_system/SRS.rb', line 207

def target_value
  @target_value
end

Instance Method Details

#to_sString

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

Returns:

  • (String)


212
213
214
215
216
217
# File 'lib/bcdice/game_system/SRS.rb', line 212

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

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