少年修仙传客户端代码仓库
client_Wu Xijin
2018-09-26 b6715584a46ed51a1765024d99b1e61e2d0d110f
3811 【前端】前期BOSS分线修改
2个文件已修改
69 ■■■■ 已修改文件
Fight/BossFakeLineUtility.cs 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/FindPrecious/FindPreciousModel.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/BossFakeLineUtility.cs
@@ -73,36 +73,45 @@
        LocalSave.SetString(key, time.ToString());
    }
    public bool TryGetBossKillTime(int npcId, out DateTime time)
    public bool IsBossKilledRecently(int npcId)
    {
        if (bossKillTimes.ContainsKey(npcId))
        FindPreciousModel.BossInfo bossInfo;
        var totalCd = 0;
        if (findPreciousModel.TryGetBossInfo(npcId, out bossInfo))
        {
            time = bossKillTimes[npcId];
            return true;
            totalCd = bossInfo.rebornTotalCd;
        }
        var key = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "_", npcId);
        var timeString = LocalSave.GetString(key);
        var tempTime = DateTime.Now;
        if (DateTime.TryParse(timeString, out tempTime))
        if (bossKillTimes.ContainsKey(npcId))
        {
            FindPreciousModel.BossInfo bossInfo;
            var totalCd = 0;
            if (findPreciousModel.TryGetBossInfo(npcId, out bossInfo))
            var killTime = bossKillTimes[npcId];
            if ((int)((DateTime.Now - killTime).TotalSeconds) < totalCd)
            {
                totalCd = bossInfo.rebornTotalCd;
            }
            if ((int)((DateTime.Now - tempTime).TotalSeconds) < totalCd)
            {
                time = tempTime;
                bossKillTimes[npcId] = tempTime;
                return true;
            }
        }
        time = DateTime.Now;
        var key = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "_", npcId);
        var timeString = LocalSave.GetString(key);
        if (string.IsNullOrEmpty(timeString))
        {
            return false;
        }
        else
        {
            var tempTime = DateTime.Now;
            if (DateTime.TryParse(timeString, out tempTime))
            {
                if ((int)((DateTime.Now - tempTime).TotalSeconds) < totalCd)
                {
                    bossKillTimes[npcId] = tempTime;
                    return true;
                }
            }
        }
        return false;
    }
}
System/FindPrecious/FindPreciousModel.cs
@@ -545,7 +545,14 @@
                            }
                            else
                            {
                                return IsAnyLineBossAlive();
                                if (BossFakeLineUtility.Instance.IsBossKilledRecently(bossId))
                                {
                                    return !IsAnyLineBossDead();
                                }
                                else
                                {
                                    return IsAnyLineBossAlive();
                                }
                            }
                        }
                    }
@@ -574,6 +581,19 @@
                return false;
            }
            bool IsAnyLineBossDead()
            {
                foreach (var item in lineToAlives)
                {
                    if (!item.Value)
                    {
                        return true;
                    }
                }
                return false;
            }
        }
        public struct BossSubscribe