private void LoggingData(Player player)
        {
            Level level = player.SceneAs <Level>();

            if (level == null)
            {
                return;
            }

            // 传送到死亡地点练习时产生的死亡不记录
            if (teleportDeathInfo?.Room == level.Session.Level)
            {
                return;
            }

            Session session      = level.Session;
            Session cloneSession = session.DeepClone();

            long lostTime = SaveData.Instance.Time - lastTime;

            DeathInfo deathInfo = new DeathInfo {
                Chapter              = GetChapterName(session),
                Room                 = session.Level,
                LostTime             = lostTime,
                CauseOfDeath         = causeOfDeath,
                DeathPosition        = deathPosition,
                Area                 = cloneSession.Area,
                RespawnPoint         = (Vector2)cloneSession.RespawnPoint,
                Inventory            = cloneSession.Inventory,
                Flags                = cloneSession.Flags,
                LevelFlags           = cloneSession.LevelFlags,
                Strawberries         = cloneSession.Strawberries,
                DoNotLoad            = cloneSession.DoNotLoad,
                Keys                 = cloneSession.Keys,
                SummitGems           = cloneSession.SummitGems,
                FurthestSeenLevel    = cloneSession.FurthestSeenLevel,
                Time                 = cloneSession.Time,
                StartedFromBeginning = cloneSession.StartedFromBeginning,
                Deaths               = cloneSession.Deaths,
                Dashes               = cloneSession.Dashes,
                DashesAtLevelStart   = cloneSession.DashesAtLevelStart,
                DeathsInCurrentLevel = cloneSession.DeathsInCurrentLevel,
                InArea               = cloneSession.InArea,
                StartCheckpoint      = cloneSession.StartCheckpoint,
                FirstLevel           = cloneSession.FirstLevel,
                Cassette             = cloneSession.Cassette,
                HeartGem             = cloneSession.HeartGem,
                Dreaming             = cloneSession.Dreaming,
                ColorGrade           = cloneSession.ColorGrade,
                LightingAlphaAdd     = cloneSession.LightingAlphaAdd,
                BloomBaseAdd         = cloneSession.BloomBaseAdd,
                DarkRoomAlpha        = cloneSession.DarkRoomAlpha,
                CoreMode             = cloneSession.CoreMode,
                GrabbedGolden        = cloneSession.GrabbedGolden,
                HitCheckpoint        = cloneSession.HitCheckpoint,
            };

            SpeedrunToolModule.SaveData.Add(deathInfo);
            lastTime = SaveData.Instance.Time;
        }
 public void Clear()
 {
     teleportDeathInfo = null;
 }
 public void SetTeleportDeathInfo(DeathInfo deathInfo)
 {
     teleportDeathInfo = deathInfo;
 }
Пример #4
0
 public void Clear()
 {
     Died = false;
     teleportDeathInfo = null;
 }