class BCDice::GameSystem::Cthulhu::CompareResult
Attributes
broken[RW]
critical[RW]
failure[RW]
fumble[RW]
special[RW]
success[RW]
Public Class Methods
new(locale)
click to toggle source
# File lib/bcdice/game_system/Cthulhu.rb, line 130 def initialize(locale) @locale = locale @success = false @failure = false @critical = false @fumble = false @special = false @broke = false end
Public Instance Methods
text()
click to toggle source
# File lib/bcdice/game_system/Cthulhu.rb, line 141 def text if critical && special translate("Cthulhu.critical_special") elsif critical translate("Cthulhu.critical") elsif special translate("Cthulhu.special") elsif success translate("success") elsif broken && fumble "#{translate('Cthulhu.fumble')}/#{translate('Cthulhu.broken')}" elsif broken translate("Cthulhu.broken") elsif fumble translate("Cthulhu.fumble") elsif failure translate("failure") end end
to_result()
click to toggle source
# File lib/bcdice/game_system/Cthulhu.rb, line 161 def to_result Result.new.tap do |r| r.success = success r.failure = failure r.critical = critical r.fumble = fumble end end