Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/GameLogic/Attributes/MonsterAttributeHolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ public float GetValueOfAttribute(AttributeDefinition attributeDefinition)
return attribute.Value;
}

// A spawn area can override the maximum health of its npc (e.g. the blood castle gate
// and statue, or summoned monsters). AttackableNpcBase.Initialize starts them off with
// that health, so the maximum has to be reported accordingly. Otherwise every
// percentage-based readout divides the real health by the unrelated, usually much higher
// value of the monster definition.
if (attributeDefinition == Stats.MaximumHealth
&& this._monster.SpawnArea.MaximumHealthOverride is { } maximumHealthOverride)
{
return maximumHealthOverride;
}

if (this._statAttributes.TryGetValue(attributeDefinition, out float value))
{
return value;
Expand Down