using FairyGUI; using ET; using System.Collections.Generic; namespace GFGGame { public class RoleDataManager { public static bool powerTimeServerLock; public static long roleId; public static string roleName { get { return GameGlobal.zoneScene.GetComponent().GetCurrentRoleName(); } } public static int rechargeTotalMon { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.RechargeTotaMonthly); } } public static string slogan = ""; public static int headId = ConstItemID.HEADID; public static int headBorderId = ConstItemID.BORDERID; private static List _photoDatas = new List(); public static List photoDatas { get { return _photoDatas; } set { _photoDatas = value; } } // 佩戴徽章列表 private static List _badgeDatas = new List(); public static List badgeDatas { get { return _badgeDatas; } set { _badgeDatas = value; } } private static int _mainBgID; public static int mainBgID { get { return _mainBgID; } set { _mainBgID = value; } } public static int power { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.Power); } } public static int powerLimit { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.PowerLimit) + GameGlobal.myNumericComponent.GetAsInt(NumericType.MonthCardPowerLimitAdd); } } public static long gold { get { return ItemDataManager.GetItemNum(ConstItemID.GOLD); //GameGlobal.myNumericComponent.GetAsInt(NumericType.Gold); } } public static int exp { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.Exp); } } public static int lvl { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl); } } public static long diaP { get { return ItemDataManager.GetItemNum(ConstItemID.DIAMOND_PURPLE); // GameGlobal.myNumericComponent.GetAsInt(NumericType.DiamondP); } } public static long diaR { get { return ItemDataManager.GetItemNum(ConstItemID.DIAMOND_RED); //GameGlobal.myNumericComponent.GetAsInt(NumericType.DiamondR); } } public static int vipLv { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.VipLevel); } } public static int vipExp { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.VipExp); } } public static int DailyLiveness { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.DailyLiveness); } } public static int WeeklyLiveness { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.WeeklyLiveness); } } /// /// 今日竞技场可挑战次数 /// /// public static int ArenaFightTimes { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.ArenaFightTimes); } } /// /// 玩家竞技场最大挑战存储量 /// /// public static int ArenaMaxStorageNum { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.ArenaMaxStorageNum); } } /// /// 今日竞技场可购买挑战的次数 /// /// public static int ArenaBuyFightTimes { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.ArenaBuyFightTimes); } } /// /// 今日竞技场可刷新次数 /// /// public static int ArenaFreshTimes { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.ArenaFreshTimes); } } /// /// 今日竞技场可获取特殊奖励的次数 /// /// public static int ArenaTimesBonusSpecial { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.ArenaTimesBonusSpecial); } } /// ///类型一今日祈福次数 /// /// public static int LeagueType1PrayTimes { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.LeagueType1PrayTimes); } } /// ///类型二今日祈福次数 /// /// public static int LeagueType2PrayTimes { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.LeagueType2PrayTimes); } } /// ///类型三今日祈福次数 /// /// public static int LeagueType3PrayTimes { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.LeagueType3PrayTimes); } } /// /// 万水千山最大存储量 /// public static int WanShuiQianShanMaxStorageCount { get { return GameGlobal.myNumericComponent.GetAsInt(NumericType.WanShuiQianShanMaxStorageCount); } } public static bool CheckPowerFull() { return RoleDataManager.power >= powerLimit; } public static void InitServerData() { roleId = GameGlobal.zoneScene.GetComponent().CurrentRoleId; } /// /// 检测是否开通指定类型月卡 /// /// public static bool CheckIsMonthCardOpenByType(int monthCardType) { if (monthCardType == MonthCardType.Gold) { return TimeHelper.ServerNow() < GameGlobal.myNumericComponent.GetAsLong(NumericType.MonthCardGoldEndTime); } else if (monthCardType == MonthCardType.BlackGold) { return TimeHelper.ServerNow() < GameGlobal.myNumericComponent.GetAsLong(NumericType.MonthCardBlackGoldEndTime); } return true; } public static OtherRoleInfoData GetOtherRoleInfoData(OtherRoleInfoProto otherRoleInfo) { OtherRoleInfoData otherRoleInfoData = new OtherRoleInfoData(); otherRoleInfoData.roleId = otherRoleInfo.RoleId; otherRoleInfoData.headId = otherRoleInfo.HeadItemId; otherRoleInfoData.headBorderId = otherRoleInfo.HeadBorderItemId; otherRoleInfoData.roleName = otherRoleInfo.RoleName; otherRoleInfoData.roleLv = otherRoleInfo.RoleLvl; otherRoleInfoData.offlineTimeSec = otherRoleInfo.OfflineTimeSec; return otherRoleInfoData; } public static OtherRoleInfoData GetMineRoleInfoData() { OtherRoleInfoData otherRoleInfoData = new OtherRoleInfoData(); otherRoleInfoData.roleId = roleId; otherRoleInfoData.headId = headId; otherRoleInfoData.headBorderId = headBorderId; otherRoleInfoData.roleName = roleName; otherRoleInfoData.roleLv = lvl; return otherRoleInfoData; } private static int oldLvValue; public static void RoleLvUp(int oldValue) { oldLvValue = oldValue; Timers.inst.Remove(CheckUpLv); Timers.inst.Remove(OpenRoleLvUpView); Timers.inst.Add(0.2f, 0, CheckUpLv); CheckUpLv(null); } private static void CheckUpLv(object param) { if (GuideDataManager.currentGuideId > 0) return;//在新手引导中不弹 if (ViewManager.isViewOpen(typeof(FunctionOpenView).Name)) return;//等功能开启展示完成后再展示角色升级 if (ViewManager.isViewOpen(typeof(StoryFightSingleScoreView).Name)) return;//战斗界面关闭前不弹升级 if (InstanceZonesDataManager.isQuicklyFighting == true) return;//速刷中不弹 if (InstanceZonesDataManager.isResultFighting == true) return;//结算中经验进度结束前不弹 OpenRoleLvUpView(null); } private static void OpenRoleLvUpView(object param) { ViewManager.Show(oldLvValue); Timers.inst.Remove(CheckUpLv); } public static bool HaveBadge(int id) { return ItemDataManager.GetItemNum(id) > 0; } } }