Class: BCDice::GameSystem::Cthulhu::CompareResult
- Inherits:
 - 
      Object
      
        
- Object
 - BCDice::GameSystem::Cthulhu::CompareResult
 
 
- Includes:
 - Translate
 
- Defined in:
 - lib/bcdice/game_system/Cthulhu.rb
 
Instance Attribute Summary collapse
- 
  
    
      #broken  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute broken.
 - 
  
    
      #critical  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute critical.
 - 
  
    
      #failure  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute failure.
 - 
  
    
      #fumble  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute fumble.
 - 
  
    
      #special  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute special.
 - 
  
    
      #success  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute success.
 
Instance Method Summary collapse
- 
  
    
      #initialize(locale)  ⇒ CompareResult 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of CompareResult.
 - #text ⇒ Object
 - #to_result ⇒ Object
 
Methods included from Translate
Constructor Details
#initialize(locale) ⇒ CompareResult
Returns a new instance of CompareResult.
      130 131 132 133 134 135 136 137 138 139  | 
    
      # 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  | 
  
Instance Attribute Details
#broken ⇒ Object
Returns the value of attribute broken.
      128 129 130  | 
    
      # File 'lib/bcdice/game_system/Cthulhu.rb', line 128 def broken @broken end  | 
  
#critical ⇒ Object
Returns the value of attribute critical.
      128 129 130  | 
    
      # File 'lib/bcdice/game_system/Cthulhu.rb', line 128 def critical @critical end  | 
  
#failure ⇒ Object
Returns the value of attribute failure.
      128 129 130  | 
    
      # File 'lib/bcdice/game_system/Cthulhu.rb', line 128 def failure @failure end  | 
  
#fumble ⇒ Object
Returns the value of attribute fumble.
      128 129 130  | 
    
      # File 'lib/bcdice/game_system/Cthulhu.rb', line 128 def fumble @fumble end  | 
  
#special ⇒ Object
Returns the value of attribute special.
      128 129 130  | 
    
      # File 'lib/bcdice/game_system/Cthulhu.rb', line 128 def special @special end  | 
  
#success ⇒ Object
Returns the value of attribute success.
      128 129 130  | 
    
      # File 'lib/bcdice/game_system/Cthulhu.rb', line 128 def success @success end  | 
  
Instance Method Details
#text ⇒ Object
      141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159  | 
    
      # 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  |