Class: Lich::Gemstone::CharacterStatus
- Inherits:
-
Object
- Object
- Lich::Gemstone::CharacterStatus
- Defined in:
- documented/games.rb
Overview
Base class for character status tracking Base class for character status tracking Provides methods to manage character injuries and statuses
Class Method Summary collapse
-
.fix_injury_mode(mode = 'both') ⇒ void
Fixes the injury mode for the character.
-
.method_missing(_method_name = nil) ⇒ String
Handles missing methods for character status.
Class Method Details
.fix_injury_mode(mode = 'both') ⇒ void
This method returns an undefined value.
Fixes the injury mode for the character
697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 |
# File 'documented/games.rb', line 697 def fix_injury_mode(mode = 'both') # Default mode 'both' handles wounds (precedence) then scars case mode when 'scar', 'scars' unless XMLData.injury_mode == 1 Game._puts '_injury 1' 150.times { sleep 0.05; break if XMLData.injury_mode == 1 } end when 'wound', 'wounds' # future proof leaving in place, but this will likely not be used unless XMLData.injury_mode == 0 Game._puts '_injury 0' 150.times { sleep 0.05; break if XMLData.injury_mode == 0 } end when 'both' unless XMLData.injury_mode == 2 Game._puts '_injury 2' 150.times { sleep 0.05; break if XMLData.injury_mode == 2 } end else raise ArgumentError, "Invalid mode: #{mode}. Use 'scar', 'wound', or 'both'." end end |
.method_missing(_method_name = nil) ⇒ String
Handles missing methods for character status
724 725 726 727 728 |
# File 'documented/games.rb', line 724 def method_missing(_method_name = nil) result = Lich::Messaging.mono(Lich::Messaging.msg_format("bold", "#{self.name.split('::').last}: Invalid area, try one of these: arms, limbs, torso, #{XMLData.injuries.keys.join(', ')}")) # the _respond method used in Lich::Messaging returns nil upon success return result end |