Class: Lich::Gemstone::Wounds
- Inherits:
-
Gemstone::CharacterStatus
- Object
- Gemstone::CharacterStatus
- Lich::Gemstone::Wounds
- Defined in:
- documented/gemstone/wounds.rb
Overview
Represents the character's wounds and injuries in the game.
This class provides methods to access and manage the wounds of various body parts.
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
{ 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, String, nil>
Returns a hash of all wounds for each body part.
-
.arms ⇒ String?
Returns the most severe wound among the arms and hands.
- .left_arm ⇒ Object
-
.left_eye ⇒ String?
Returns the wound for the left eye.
- .left_foot ⇒ Object
- .left_hand ⇒ Object
- .left_leg ⇒ Object
-
.limbs ⇒ String?
Returns the most severe wound among all limbs (arms and legs).
- .right_arm ⇒ Object
-
.right_eye ⇒ String?
Returns the wound for the right eye.
- .right_foot ⇒ Object
- .right_hand ⇒ Object
- .right_leg ⇒ Object
-
.torso ⇒ String?
Returns the most severe wound among the torso and head.
-
.wound_level(part) ⇒ String?
Returns the wound level for a specified body part.
Class Method Details
.all_wounds ⇒ Hash<Symbol, String, nil>
Returns a hash of all wounds for each body part.
112 113 114 115 |
# File 'documented/gemstone/wounds.rb', line 112 def all_wounds fix_injury_mode('both') XMLData.injuries.transform_values { |v| v['wound'] } end |
.arms ⇒ String?
Returns the most severe wound among the arms and hands.
65 66 67 68 69 70 71 72 73 |
# File 'documented/gemstone/wounds.rb', line 65 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
54 |
# File 'documented/gemstone/wounds.rb', line 54 def left_arm; leftArm; end |
.left_eye ⇒ String?
Returns the wound for the left eye.
50 |
# File 'documented/gemstone/wounds.rb', line 50 def left_eye; leftEye; end |
.left_foot ⇒ Object
60 |
# File 'documented/gemstone/wounds.rb', line 60 def left_foot; leftFoot; end |
.left_hand ⇒ Object
56 |
# File 'documented/gemstone/wounds.rb', line 56 def left_hand; leftHand; end |
.left_leg ⇒ Object
58 |
# File 'documented/gemstone/wounds.rb', line 58 def left_leg; leftLeg; end |
.limbs ⇒ String?
Returns the most severe wound among all limbs (arms and legs).
77 78 79 80 81 82 83 84 85 86 87 |
# File 'documented/gemstone/wounds.rb', line 77 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
55 |
# File 'documented/gemstone/wounds.rb', line 55 def right_arm; rightArm; end |
.right_eye ⇒ String?
Returns the wound for the right eye.
53 |
# File 'documented/gemstone/wounds.rb', line 53 def right_eye; rightEye; end |
.right_foot ⇒ Object
61 |
# File 'documented/gemstone/wounds.rb', line 61 def right_foot; rightFoot; end |
.right_hand ⇒ Object
57 |
# File 'documented/gemstone/wounds.rb', line 57 def right_hand; rightHand; end |
.right_leg ⇒ Object
59 |
# File 'documented/gemstone/wounds.rb', line 59 def right_leg; rightLeg; end |
.torso ⇒ String?
Returns the most severe wound among the torso and head.
91 92 93 94 95 96 97 98 99 100 |
# File 'documented/gemstone/wounds.rb', line 91 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) ⇒ String?
Returns the wound level for a specified body part.
105 106 107 108 |
# File 'documented/gemstone/wounds.rb', line 105 def wound_level(part) fix_injury_mode('both') XMLData.injuries[part.to_s] && XMLData.injuries[part.to_s]['wound'] end |