Skip to content

Commit

Permalink
Updated some functions to 3.01 version that weren't breaking but also…
Browse files Browse the repository at this point in the history
… weren't working right (movement speed and new version popups).
  • Loading branch information
tjayharvey committed Feb 27, 2016
1 parent f5037a4 commit a78deac
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 23 deletions.
20 changes: 1 addition & 19 deletions IEMod/Mods/FastSneak/mod_PartyMemberAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,25 +181,7 @@ public void UpdateNew()
}

bool flag = ((Stealth.IsInStealthMode(base.gameObject) && !fastSneakActive) || mod_Player.WalkMode);
float desiredSpeed = (!flag ? this.m_mover.GetRunSpeed() : this.m_mover.GetWalkSpeed());
GameObject[] selectedPartyMembers = PartyMemberAI.SelectedPartyMembers;
for (int i = 0; i < (int)selectedPartyMembers.Length; i++)
{
GameObject gameObject = selectedPartyMembers[i];
if (!(gameObject == null) && !(gameObject == base.gameObject) && flag == Stealth.IsInStealthMode(gameObject))
{
Mover mover = gameObject.GetComponent<Mover>();
if (((!Stealth.IsInStealthMode(gameObject) || fastSneakActive) ? mover.GetRunSpeed() : mover.GetWalkSpeed()) < desiredSpeed)
{
desiredSpeed = mover.DesiredSpeed;
}
}
}
if (desiredSpeed < 1.5f)
{
desiredSpeed = 2f;
}
this.m_mover.UseCustomSpeed(desiredSpeed);
this.m_mover.UseCustomSpeed((!flag ? 4f : 2f));
}
}
}
Expand Down
43 changes: 39 additions & 4 deletions IEMod/Mods/OnLevelLoad/mod_GameState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,19 @@ public void mod_FinalizeLevelLoad() {
{
FogOfWar.Instance.WaitForFogUpdate();
}
AutosaveIfAllowed();
GameState.Autosave();
}
}
GameState.NewGame = false;
if (this.CurrentMap != null && this.CouldAccessStashOnLastMap != this.CurrentMap.GetCanAccessStash() && !GameState.Option.GetOption(GameOption.BoolOption.DONT_RESTRICT_STASH))
{
if (!this.CurrentMap.GetCanAccessStash())
{
UISystemMessager.Instance.PostMessage(GUIUtils.GetText(1565), Color.white);
UISystemMessager.Instance.PostMessage(GUIUtils.GetText(1566), Color.white);
}
else
{
UISystemMessager.Instance.PostMessage(GUIUtils.GetText(1566), Color.white);
UISystemMessager.Instance.PostMessage(GUIUtils.GetText(1565), Color.white);
}
}
GameState.NumSceneLoads = GameState.NumSceneLoads + 1;
Expand All @@ -139,6 +139,10 @@ public void mod_FinalizeLevelLoad() {
if (this.CurrentMap != null && this.CurrentMap.IsValidOnMap("px1"))
{
GameState.Instance.HasEnteredPX1 = true;
if (GameGlobalVariables.HasStartedPX2())
{
this.HasEnteredPX2 = true;
}
}
// in here you can place something like if (CurrentMap.SceneName == "AR_0011_Dyrford_Tavern_02") make_an_NPC; or change_NPC's_stats;
// added this code
Expand All @@ -163,6 +167,37 @@ public void mod_FinalizeLevelLoad() {
Debug.LogException(exception);
GameState.ReturnToMainMenuFromError();
}
}
if (!this.RetroactiveSpellMasteryChecked)
{
for (int i = 0; i < (int)PartyMemberAI.PartyMembers.Length; i++)
{
if (PartyMemberAI.PartyMembers[i] != null)
{
CharacterStats component = PartyMemberAI.PartyMembers[i].GetComponent<CharacterStats>();
if (component)
{
if (component.MaxMasteredAbilitiesAllowed() > component.GetNumMasteredAbilities())
{
UIWindowManager.ShowMessageBox(UIMessageBox.ButtonStyle.OK, GUIUtils.GetText(2252), GUIUtils.GetText(2303));
break;
}
}
}
}
this.RetroactiveSpellMasteryChecked = true;
}
if (GameUtilities.HasPX2() && GameState.LoadedGame)
{
if (GameGlobalVariables.HasFinishedPX1())
{
QuestManager.Instance.StartPX2Umbrella();
}
else if (!this.HasNotifiedPX2Installation)
{
UIWindowManager.ShowMessageBox(UIMessageBox.ButtonStyle.OK, string.Empty, GUIUtils.GetText(2438));
this.HasNotifiedPX2Installation = true;
}
}
}
}
}

0 comments on commit a78deac

Please sign in to comment.