Now only player must kill drifter and added onDeathStabilityRecovery existance check
This commit is contained in:
@ -22,14 +22,13 @@ internal class TemporalStabilityPatches
|
|||||||
|
|
||||||
var tempest = api.ModLoader.GetModSystem<TemporalTempestLightModSystem>();
|
var tempest = api.ModLoader.GetModSystem<TemporalTempestLightModSystem>();
|
||||||
|
|
||||||
if (!system.StormData.nowStormActive) return;
|
if (!system.StormData.nowStormActive || !entity.Properties.Attributes.Exists) return;
|
||||||
|
|
||||||
var entityIsNotDrifter =
|
|
||||||
entity.Properties.Attributes["onDeathStabilityRecovery"].AsFloat(0) <= 0;
|
|
||||||
var damageSourceIsDrifter =
|
|
||||||
(damageSource.CauseEntity?.Properties?.Attributes["onDeathStabilityRecovery"]?.AsFloat(0) ?? 0) > 0;
|
|
||||||
|
|
||||||
if (entityIsNotDrifter || damageSourceIsDrifter) return;
|
var targetIsDrifter =
|
||||||
|
entity.Properties.Attributes["onDeathStabilityRecovery"].AsFloat(0) > 0;
|
||||||
|
var damageSourceIsPlayer = damageSource.SourceEntity is EntityPlayer;
|
||||||
|
|
||||||
|
if (!targetIsDrifter || !damageSourceIsPlayer) return;
|
||||||
|
|
||||||
system.StormData.stormActiveTotalDays -= tempest.CurrentStormDurationReduction;
|
system.StormData.stormActiveTotalDays -= tempest.CurrentStormDurationReduction;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user