Skip to content

Commit

Permalink
Fixed moving recovery rate mod.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjayharvey committed Feb 27, 2016
1 parent 8bd242b commit 27fbbec
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions IEMod/Mods/RecoveryRate/mod_CharacterStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ private void UpdateNew()
{
return;
}
this.FatigueUpdate(Time.deltaTime * (float)WorldTime.Instance.GameSecondsPerRealSecond, this.IsMoving);
this.NoiseUpdate(Time.deltaTime);
this.DetectUpdate(Time.deltaTime);
this.TrapCooldownTimerUpdate(Time.deltaTime);
Expand Down Expand Up @@ -72,7 +71,7 @@ private void UpdateNew()
this.m_updateTracker = true;
if (this.OnClearStatusEffect != null)
{
this.OnClearStatusEffect(item);
this.OnClearStatusEffect(base.gameObject, item);
}
item.Reset();
}
Expand Down Expand Up @@ -133,11 +132,14 @@ private void UpdateNew()
for (int n = 0; n < this.m_statusEffects.Count; n++)
{
StatusEffect statusEffect1 = this.m_statusEffects[n];
if (statusEffect1.Stackable && !statusEffect1.HasBeenApplied)
if (statusEffect1.Stackable)
{
statusEffect1.ApplyEffect(base.gameObject);
if (!statusEffect1.HasBeenApplied)
{
statusEffect1.ApplyEffect(base.gameObject);
}
}
if (!statusEffect1.Stackable && !statusEffect1.IsSuspended && !statusEffect1.IsSuppressed)
else if (!statusEffect1.IsSuspended && !statusEffect1.IsSuppressed)
{
StatusEffect trackedEffect = this.GetTrackedEffect(statusEffect1.NonstackingEffectType, statusEffect1.GetStackingKey());
int num = this.m_statusEffects.IndexOf(trackedEffect);
Expand Down Expand Up @@ -167,7 +169,7 @@ private void UpdateNew()
if (current != null)
{
component = current.GetComponent<CharacterStats>();
if (!(component != null) || component.GetFatigueLevel() == CharacterStats.FatigueLevel.None)
if (!(component != null) || component.CurrentFatigueLevel == CharacterStats.FatigueLevel.None)
{
continue;
}
Expand All @@ -184,7 +186,7 @@ private void UpdateNew()
}
while (partyMemberAIs.Count > 0 && AfflictionData.Instance.TravelFatigueSoundTimer <= 0f)
{
PartyMemberAI partyMemberAI = partyMemberAIs[Random.Range(0, partyMemberAIs.Count)];
PartyMemberAI partyMemberAI = partyMemberAIs[OEIRandom.Index(partyMemberAIs.Count)];
this.PlayPartyMemberFatigueSound(partyMemberAI);
partyMemberAIs.Remove(partyMemberAI);
}
Expand All @@ -203,14 +205,12 @@ private void UpdateNew()
foreach (KeyValuePair<int, StatusEffect> value in mStackTracker.Value)
{
StatusEffect value1 = value.Value;
if (value1 != null)
if (value1 == null || value1.HasBeenApplied)
{
if (!value1.HasBeenApplied)
{
value1.Unsuppress();
value1.ApplyEffect(base.gameObject);
}
continue;
}
value1.Unsuppress();
value1.ApplyEffect(base.gameObject);
}
}
}
Expand Down Expand Up @@ -261,7 +261,7 @@ private void UpdateNew()
UIDebug.Instance.SetText("Character Stats Debug", this.GetCharacterStatsDebugOutput(), Color.cyan);
UIDebug.Instance.SetTextPosition("Character Stats Debug", 0.95f, 0.95f, UIWidget.Pivot.TopRight);
}
}
}
}
}
}
}

0 comments on commit 27fbbec

Please sign in to comment.