Class: Lich::Gemstone::Wounds
- Inherits:
-
CharacterStatus
- Object
- CharacterStatus
- Lich::Gemstone::Wounds
- Defined in:
- documented/gemstone/wounds.rb
Overview
Wounds class for tracking character wounds Wounds class for tracking character wounds
This class provides methods to access and manage the wounds of a character in the game. It includes methods for individual body parts, composite wounds, and overall wound levels.
Constant Summary collapse
- BODY_PARTS =
Body part accessor methods XML from Simutronics drives the structure of the wound naming (eg. leftEye) The following is a hash of the body parts and shorthand aliases created for more idiomatic Ruby A hash of body parts and their shorthand aliases. This constant drives the structure of the wound naming for various body parts.
{ leftEye: ['leye'], rightEye: ['reye'], head: [], neck: [], back: [], chest: [], abdomen: ['abs'], leftArm: ['larm'], rightArm: ['rarm'], rightHand: ['rhand'], leftHand: ['lhand'], leftLeg: ['lleg'], rightLeg: ['rleg'], leftFoot: ['lfoot'], rightFoot: ['rfoot'], nsys: ['nerves'] }.freeze
Class Method Summary collapse
-
.all_wounds ⇒ Hash<Symbol, Integer>
Helper method to get all wound levels Returns a hash of all body parts and their corresponding wound levels.
-
.arms ⇒ Integer?
Composite wound methods Returns the maximum wound level for both arms and hands.
- .left_arm ⇒ Object
-
.left_eye ⇒ Integer?
Alias snake_case methods for overachievers Returns the wound level for the left eye using snake_case.
- .left_foot ⇒ Object
- .left_hand ⇒ Object
- .left_leg ⇒ Object
-
.limbs ⇒ Integer?
Returns the maximum wound level for both arms, hands, and legs.
- .right_arm ⇒ Object
- .right_eye ⇒ Object
- .right_foot ⇒ Object
- .right_hand ⇒ Object
- .right_leg ⇒ Object
-
.torso ⇒ Integer?
Returns the maximum wound level for the torso including eyes, chest, abdomen, and back.
-
.wound_level(part) ⇒ Integer?
Helper method to get wound level for any body part Returns the wound level for a specified body part.
Methods inherited from CharacterStatus
fix_injury_mode, method_missing
Class Method Details
.all_wounds ⇒ Hash<Symbol, Integer>
Helper method to get all wound levels Returns a hash of all body parts and their corresponding wound levels.
131 132 133 134 |
# File 'documented/gemstone/wounds.rb', line 131 def all_wounds fix_injury_mode('both') XMLData.injuries.transform_values { |v| v['wound'] } end |
.arms ⇒ Integer?
Composite wound methods Returns the maximum wound level for both arms and hands.
74 75 76 77 78 79 80 81 82 |
# File 'documented/gemstone/wounds.rb', line 74 def arms fix_injury_mode('both') [ XMLData.injuries['leftArm']['wound'], XMLData.injuries['rightArm']['wound'], XMLData.injuries['leftHand']['wound'], XMLData.injuries['rightHand']['wound'] ].max end |
.left_arm ⇒ Object
60 |
# File 'documented/gemstone/wounds.rb', line 60 def left_arm; leftArm; end |
.left_eye ⇒ Integer?
Alias snake_case methods for overachievers Returns the wound level for the left eye using snake_case.
58 |
# File 'documented/gemstone/wounds.rb', line 58 def left_eye; leftEye; end |
.left_foot ⇒ Object
66 |
# File 'documented/gemstone/wounds.rb', line 66 def left_foot; leftFoot; end |
.left_hand ⇒ Object
62 |
# File 'documented/gemstone/wounds.rb', line 62 def left_hand; leftHand; end |
.left_leg ⇒ Object
64 |
# File 'documented/gemstone/wounds.rb', line 64 def left_leg; leftLeg; end |
.limbs ⇒ Integer?
Returns the maximum wound level for both arms, hands, and legs.
88 89 90 91 92 93 94 95 96 97 98 |
# File 'documented/gemstone/wounds.rb', line 88 def limbs fix_injury_mode('both') [ XMLData.injuries['leftArm']['wound'], XMLData.injuries['rightArm']['wound'], XMLData.injuries['leftHand']['wound'], XMLData.injuries['rightHand']['wound'], XMLData.injuries['leftLeg']['wound'], XMLData.injuries['rightLeg']['wound'] ].max end |
.right_arm ⇒ Object
61 |
# File 'documented/gemstone/wounds.rb', line 61 def right_arm; rightArm; end |
.right_eye ⇒ Object
59 |
# File 'documented/gemstone/wounds.rb', line 59 def right_eye; rightEye; end |
.right_foot ⇒ Object
67 |
# File 'documented/gemstone/wounds.rb', line 67 def right_foot; rightFoot; end |
.right_hand ⇒ Object
63 |
# File 'documented/gemstone/wounds.rb', line 63 def right_hand; rightHand; end |
.right_leg ⇒ Object
65 |
# File 'documented/gemstone/wounds.rb', line 65 def right_leg; rightLeg; end |
.torso ⇒ Integer?
Returns the maximum wound level for the torso including eyes, chest, abdomen, and back.
104 105 106 107 108 109 110 111 112 113 |
# File 'documented/gemstone/wounds.rb', line 104 def torso fix_injury_mode('both') [ XMLData.injuries['rightEye']['wound'], XMLData.injuries['leftEye']['wound'], XMLData.injuries['chest']['wound'], XMLData.injuries['abdomen']['wound'], XMLData.injuries['back']['wound'] ].max end |
.wound_level(part) ⇒ Integer?
Helper method to get wound level for any body part Returns the wound level for a specified body part.
121 122 123 124 |
# File 'documented/gemstone/wounds.rb', line 121 def wound_level(part) fix_injury_mode('both') XMLData.injuries[part.to_s] && XMLData.injuries[part.to_s]['wound'] end |