Exemple #1
0
 public MapPosition CurrentPosition()
 {
     if (IsEG2)
     {
         //SceneManager.ActionSceneInstance.GameState._currentPosition
         MapPosition map = SceneManagerEG2.Read <MapPosition>(Program, 0x4, 0x84, 0x58);
         map.ValidatePosition();
         return(map);
     }
     else
     {
         //SceneManager.ActionSceneInstance._currentLocation.RegionType
         //SceneManager.ActionSceneInstance._currentLocation.RegionPosition
         return(SceneManagerEG1.Read <MapPosition>(Program, -0xc, 0x90, 0x4));
     }
 }
Exemple #2
0
 public string RoomName()
 {
     if (IsEG2)
     {
         //SceneManager.ActionSceneInstance._currentSpeedrunSequenceId
         string roomName = SceneManagerEG2.Read(Program, 0x4, 0x7c, 0x0);
         if (string.IsNullOrEmpty(roomName))
         {
             //SceneManager.ActionSceneInstance.PositionTracker.SeqMap.Map[x,y]
             MapPosition pos = CurrentPosition();
             if (pos.X >= 0)
             {
                 int length = SceneManagerEG2.Read <int>(Program, 0x4, 0x5c, 0x7c, 0x8, 0xc);
                 roomName = SceneManagerEG2.Read(Program, 0x4, 0x5c, 0x7c, 0x8, 0x1c + (pos.X * length + pos.Y) * 0x20, 0x0);
             }
         }
         return(roomName);
     }
     else
     {
         return(SceneManagerEG1.Read <int>(Program, -0xc, 0x74, 0x8c).ToString());
     }
 }
Exemple #3
0
        private void CheckSplit(bool finalSplit, bool updateValues)
        {
            ShouldSplit = false;
            DateTime date = DateTime.Now;

            if (CurrentSplit == 0)
            {
                ShouldSplit = Memory.TitleShown() && Memory.TitleTextFadeTime() > 0;
            }
            else if (!Memory.IsEG2)
            {
                if (TotalSplits == 10 && !finalSplit)
                {
                    MapPosition mapPosition = Memory.CurrentPosition();
                    ShouldSplit  = mapPosition.X == 10 && lastIntValue != 10;
                    lastIntValue = mapPosition.X;
                }
                else
                {
                    bool enteredDoor = Memory.EnteredDoor();
                    ShouldSplit   = enteredDoor && !lastBoolValue && currentRoomState != 0;
                    lastBoolValue = enteredDoor;
                }

                if (ShouldSplit)
                {
                    deathTimer = date.AddSeconds(1.2);
                    return;
                }
            }
            else
            {
                if (!exitingLevel && date > deathTimer)
                {
                    bool enteredDoor = Memory.EnteredDoor();
                    int  extraCount  = Memory.OrbCount() + Memory.SecretRoomCount();
                    exitingLevel  = ((enteredDoor && !lastBoolValue) || (extraCount == lastIntValue + 1)) && currentRoomState != 0 && currentRoomState == lastRoomState;
                    lastBoolValue = enteredDoor;
                    lastIntValue  = extraCount;
                }

                ShouldSplit = exitingLevel && (finalSplit || Settings.SplitOnEnterPickup ? true : currentRoomState == 0 && lastRoomState != 0);

                if (ShouldSplit)
                {
                    exitingLevel = false;
                    deathTimer   = date.AddSeconds(3);
                    return;
                }
            }

            Paused = currentRoomState == 0 || Memory.IsPaused();

            if (Running && date <= deathTimer)
            {
                exitingLevel = false;
                ShouldSplit  = false;
            }
            else if (DateTime.Now > splitLate)
            {
                ShouldSplit = true;
                splitLate   = DateTime.MaxValue;
            }
        }