Repository navigation
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| CodeStyle | 2 minor |
🟢 Metrics 35 complexity
Metric Results Complexity 35
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
| await this.MagicEffectList.ClearAllEffectsProducingSpecificStatAsync(Stats.IsAsleep).ConfigureAwait(false); | ||
| } | ||
|
|
||
| this.Attributes[Stats.CurrentHealth] -= this.Attributes[Stats.HealthLossAfterHit]; |
| if (target?.Attributes?[Stats.IsDinorantEquipped] > 0) | ||
| { | ||
| healthLossAfterDealtHit += this.Attributes[Stats.TargetHasDinorantHealthToll]; | ||
| } |
| this.GameConfiguration.GlobalBaseAttributeValues.Add(hitShockDamageThreshold); | ||
|
|
||
| var targetHasDinorantHealthToll = this.Context.CreateNew<ConstValueAttribute>(1f, Stats.TargetHasDinorantHealthToll.GetPersistent(this.GameConfiguration), AggregateType.AddRaw); | ||
| this.GameConfiguration.GlobalBaseAttributeValues.Add(targetHasDinorantHealthToll); |
There was a problem hiding this comment.
| result.AttributeCombinations.Add(this.CreateAttributeRelationship(Stats.FenrirBaseDmg, 1.0f / 7, Stats.TotalEnergy)); | ||
|
|
||
| result.AttributeCombinations.Add(this.CreateAttributeRelationship(Stats.HealthLossAfterDealtHit, 3, Stats.IsWingEquipped)); | ||
|
|
| (Stats.AttackDamageIncrease, 1.3f, AggregateType.Multiplicate)); | ||
| (Stats.IsImpEquipped, 1.0f, AggregateType.AddRaw), | ||
| (Stats.AttackDamageIncrease, 1.3f, AggregateType.Multiplicate), | ||
| (Stats.HealthLossAfterDealtHit, 3.0f, AggregateType.AddRaw)); |
| (Stats.DamageReceiveDecrement, 0.9f, AggregateType.Multiplicate), | ||
| (Stats.AttackDamageIncrease, 1.15f, AggregateType.Multiplicate)); | ||
| (Stats.AttackDamageIncrease, 1.15f, AggregateType.Multiplicate), | ||
| (Stats.HealthLossAfterDealtHit, 1.0f, AggregateType.AddRaw)); |
| (Stats.MovementSpeed, MovementSpeedConstants.HorseOrFenrirMovementSpeed, AggregateType.Maximum), | ||
| (Stats.MovementSpeedUnderwater, MovementSpeedConstants.HorseOrFenrirMovementSpeed, AggregateType.Maximum)); | ||
| (Stats.MovementSpeedUnderwater, MovementSpeedConstants.HorseOrFenrirMovementSpeed, AggregateType.Maximum), | ||
| (Stats.HealthLossAfterHit, 1.0f, AggregateType.AddRaw)); |
There was a problem hiding this comment.
| this.AddAttributeRelationship(SkillNumber.DarkSide, Stats.SkillHealthLossAfterDealtHit, 4.0f, Stats.IsImpEquipped); | ||
| this.AddAttributeRelationship(SkillNumber.Charge, Stats.SkillHealthLossAfterDealtHit, 4.0f, Stats.IsImpEquipped); | ||
| this.AddAttributeRelationship(SkillNumber.ChainDrive, Stats.SkillHealthLossAfterDealtHit, 4.0f, Stats.IsImpEquipped); | ||
| this.AddAttributeRelationship(SkillNumber.DragonSlasher, Stats.SkillHealthLossAfterDealtHit, 100.0f, Stats.IsImpEquipped); |
| this.AddAttributeRelationship(SkillNumber.DarkSide, Stats.SkillHealthLossAfterDealtHit, 4.0f, Stats.IsWingEquipped); | ||
| this.AddAttributeRelationship(SkillNumber.Charge, Stats.SkillHealthLossAfterDealtHit, 4.0f, Stats.IsWingEquipped); | ||
| this.AddAttributeRelationship(SkillNumber.ChainDrive, Stats.SkillHealthLossAfterDealtHit, 4.0f, Stats.IsWingEquipped); | ||
| this.AddAttributeRelationship(SkillNumber.DragonSlasher, Stats.SkillHealthLossAfterDealtHit, 100.0f, Stats.IsWingEquipped); |
sven-n
left a comment
There was a problem hiding this comment.
Thanks for the hit tolls, and for linking the sources per value. The update plugins for 0.75, 0.95d and Season 6 are there, too. A few things before it can go in:
-
Two initialization tests fail (built on current master):
SmallWingsDataTest.NewDatabaseContainsSmallWingsAsync SmallWingsDataTest.UpdateAddsSmallWingsToExistingDatabaseAsync System.InvalidOperationException : Sequence contains no matching element at SmallWingsDataTest.AssertSmallWing ... line 96: GetPowerUp(item, Stats.CanFly)The wings now get
IsWingEquippedinstead of a directCanFlypower-up, and the small wings copy that. IfCanFlynow comes from an attribute combination ofIsWingEquipped, please updateSmallWingsDataTestaccordingly, check that the small wings still let a character enter Icarus, and decide whether they should cost health per hit like the other wings (that's a behaviour change for them, too). -
Dying from your own hit:
AfterHitTargetAsyncused to keep at least 1 HP (Math.Max(..., 1)). Now the health loss for dealing a hit can kill the attacker (OnDeathAsync(null)with an emptyDeathInformation). Is that what the original does? If so, please say so in the description, with the source; if not, please keep the clamp. Either way, a test for it would be good. -
Renamed stat meaning: the GUID
D84A719B…keeps its meaning ("health loss after hitting a target"), so the persisted data is fine. But the C# propertyStats.HealthLossAfterHitnow means a different stat (after getting hit), while the old meaning moved toHealthLossAfterDealtHit. Plugins or code which useStats.HealthLossAfterHitwould silently change their behaviour. Please give the new stat a new name (e.g.HealthLossAfterReceivedHit), and keepHealthLossAfterHitfor the old one (or rename it with an[Obsolete]forwarder). -
The description is one line. For a change to the damage handling, please describe what changes for players (which items and skills cost health, and when) and how you tested it.
The Web test failure PacketsAreShownInChronologicalOrder in the same run is a flaky test, unrelated to this PR.
Generated by Claude Code
|
sven-n
left a comment
There was a problem hiding this comment.
Thanks for implementing the missing hit tolls! I have a question about how much item-specific state we need in the attribute model. In general, I would prefer items to declare the effects they cause, and combat code to consume the resulting attributes without knowing which exact item produced them.
IsWingEquippedseems justified: the wing toll differs by character class (1 vs. 3 HP), and this attribute is also used forCanFly. A class-dependent relationship makes sense here.IsImpEquippedis less clear-cut: I see why it is used for the Rage Fighter's skill-specific tolls, which cannot be represented by a single constant item toll. However, could we express this more generically as a skill-dependent equipment effect instead of introducing an Imp-specific flag?TargetHasDinorantHealthTollseems unnecessary: the toll is currently a global attribute of the attacker, activated whentarget.Attributes[Stats.IsDinorantEquipped] > 0. Could the Dinorant itself provide a numeric attribute on the defender, such asHealthTollInflictedOnAttacker? Then the hit logic could simply usehealthLossAfterDealtHit += target?.Attributes?[Stats.HealthTollInflictedOnAttacker] ?? 0;. This would keep the value on the item, remove the Dinorant-specific condition fromPlayer, and support other equipment with similar effects.IsDinorantEquippedcan of course stay for its existing uses elsewhere.
One related question: should a skill-specific toll replace the entire accumulated HealthLossAfterDealtHit value? If two items contribute tolls (for example, wings and a Dinorant), replacing the whole sum with SkillHealthLossAfterDealtHit could drop one of those contributions. I suggest tests covering equipment combinations and skill-specific tolls to confirm the intended behavior.
Overall, I think IsWingEquipped has a good reason to exist, but would especially like to see the target Dinorant toll expressed directly as an item attribute.
Adds the missing health tolls from both dealt and received hits:
Players can now die while attacking when health pool is exhausted.