Class: Lich::DragonRealms::DRCH::HealthResult
- Inherits:
-
Object
- Object
- Lich::DragonRealms::DRCH::HealthResult
- Defined in:
- documented/dragonrealms/commons/common-healing.rb
Overview
Represents the result of a health check, containing various health attributes.
Instance Attribute Summary collapse
-
#bleeders ⇒ Object
readonly
Returns the value of attribute bleeders.
-
#dead ⇒ Object
readonly
Returns the value of attribute dead.
-
#diseased ⇒ Object
readonly
Returns the value of attribute diseased.
-
#lodged ⇒ Object
readonly
Returns the value of attribute lodged.
-
#parasites ⇒ Object
readonly
Returns the value of attribute parasites.
-
#poisoned ⇒ Object
readonly
Returns the value of attribute poisoned.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#vitality ⇒ Object
readonly
Returns the value of attribute vitality.
-
#wounds ⇒ Object
readonly
Returns the value of attribute wounds.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #bleeding? ⇒ Boolean
- #has_tendable_bleeders? ⇒ Boolean
-
#initialize(wounds: {}, bleeders: {}, parasites: {}, lodged: {}, poisoned: false, diseased: false, score: 0, dead: false, vitality: 100) ⇒ HealthResult
constructor
A new instance of HealthResult.
- #injured? ⇒ Boolean
Constructor Details
#initialize(wounds: {}, bleeders: {}, parasites: {}, lodged: {}, poisoned: false, diseased: false, score: 0, dead: false, vitality: 100) ⇒ HealthResult
Returns a new instance of HealthResult.
447 448 449 450 451 452 453 454 455 456 457 458 459 |
# File 'documented/dragonrealms/commons/common-healing.rb', line 447 def initialize(wounds: {}, bleeders: {}, parasites: {}, lodged: {}, poisoned: false, diseased: false, score: 0, dead: false, vitality: 100) @wounds = wounds @bleeders = bleeders @parasites = parasites @lodged = lodged @poisoned = poisoned @diseased = diseased @score = score @dead = dead @vitality = vitality end |
Instance Attribute Details
#bleeders ⇒ Object (readonly)
Returns the value of attribute bleeders.
444 445 446 |
# File 'documented/dragonrealms/commons/common-healing.rb', line 444 def bleeders @bleeders end |
#dead ⇒ Object (readonly)
Returns the value of attribute dead.
444 445 446 |
# File 'documented/dragonrealms/commons/common-healing.rb', line 444 def dead @dead end |
#diseased ⇒ Object (readonly)
Returns the value of attribute diseased.
444 445 446 |
# File 'documented/dragonrealms/commons/common-healing.rb', line 444 def diseased @diseased end |
#lodged ⇒ Object (readonly)
Returns the value of attribute lodged.
444 445 446 |
# File 'documented/dragonrealms/commons/common-healing.rb', line 444 def lodged @lodged end |
#parasites ⇒ Object (readonly)
Returns the value of attribute parasites.
444 445 446 |
# File 'documented/dragonrealms/commons/common-healing.rb', line 444 def parasites @parasites end |
#poisoned ⇒ Object (readonly)
Returns the value of attribute poisoned.
444 445 446 |
# File 'documented/dragonrealms/commons/common-healing.rb', line 444 def poisoned @poisoned end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
444 445 446 |
# File 'documented/dragonrealms/commons/common-healing.rb', line 444 def score @score end |
#vitality ⇒ Object (readonly)
Returns the value of attribute vitality.
444 445 446 |
# File 'documented/dragonrealms/commons/common-healing.rb', line 444 def vitality @vitality end |
#wounds ⇒ Object (readonly)
Returns the value of attribute wounds.
444 445 446 |
# File 'documented/dragonrealms/commons/common-healing.rb', line 444 def wounds @wounds end |
Instance Method Details
#[](key) ⇒ Object
461 462 463 |
# File 'documented/dragonrealms/commons/common-healing.rb', line 461 def [](key) send(key.to_sym) end |
#bleeding? ⇒ Boolean
469 470 471 |
# File 'documented/dragonrealms/commons/common-healing.rb', line 469 def bleeding? bleeders.values.flatten.any?(&:bleeding?) end |
#has_tendable_bleeders? ⇒ Boolean
473 474 475 |
# File 'documented/dragonrealms/commons/common-healing.rb', line 473 def has_tendable_bleeders? bleeders.values.flatten.any?(&:tendable?) end |
#injured? ⇒ Boolean
465 466 467 |
# File 'documented/dragonrealms/commons/common-healing.rb', line 465 def injured? score > 0 end |