import GameMgr from "../Mgr/GameMgr"; import Common5 from "../../Platform/th/Common5"; import EventMgr from "../Event/EventMgr"; import { ryw_Event } from "../Event/EventEnum"; import DayUnlock from "../Mgr/DayUnlock"; // import TaskManager from "../../Scripts/JuQingChat/TaskManager"; // import { GameProgressDataProperty_xpz } from "../../Scripts/XiPanZi/NewDataManage_xpz"; // import { GOODS_NUMBER } from "../../Scripts/bagLayer/BagGoodsManager"; export enum RoomBtnIndexEnum { room,//回家 xuexiao,//学校 touzirenjia,//投资人家 qianzong,//钱总 yiyuan,//医院 fushijiazu,//傅氏家族 huigongsi,//回公司 haibian,//去海边 anjia,//去安家 longjia,//去龙家 yaoshanguan,//药膳馆 paimaihang,//拍卖行 gushuyajia,//顾书雅家 } export class LevelFlag { public level: number = 0; public flag: number[] = []; } export class UserData { } //游戏数据,为保持版本兼容,建议不要删除和修改字段名 export class UserGameData { public lastOnlineTime: number = 0; public firstIn: boolean = true; public firstInNew: boolean = true; public uuid: string = ''; public userId = ""; public otherPlatformUserID = ""; public dayUnlock: any = {}; public headImg: string = "headImg1"; public chatImgIndex: number = 1 public headImgUnlock: Array = ["headImg1"]; public money: number = 5000; /**need备份finish*/ public userIQ: number = 50; /**need备份finish*/ public yuanBao: number = 0; public day: number = 1; /**need备份finish*/ public timeHour: number = 0; public timeMin: number = 0; public isNewDay: boolean = false; //实际的一天 public lastOnlineTimestamp: number = 0; public proper_TiLi: number = 50; //体力 /**need备份finish*/ public proper_NaoLi: number = 50; //脑力 /**need备份finish*/ public curGameLevelIndex: number = 0; //当前游戏关卡索引 /**need备份finish*/ // public saiCheFreeNum:number = 3;//免费赛车次数 // public laJiFreeNum:number = 3;//免费翻垃圾次数 // public FanLajiTimeStamp = 0; // public bingHuFreeNum:number = 5;//免费冰壶次数 // public jlbFreeNum: number = 5;//免费俱乐部次数 // public jlbStepIndex: number = 0;//免费俱乐部次数 // public jlbShengji: boolean = false;//免费俱乐部次数 // public jlbZnNum:number = 0;//俱乐部职能 // public jlbewZnNum: number = 0;//俱乐部职能 public pmcFreeNum: number = 5;//免费拍卖场次数 // public BingHuTimeStamp = 0; public dadianListGame = [] // public isKuaiDiKaiQi = [] // public kuaiDiMangHeNum:number = 4;//免费快递盲盒数量 // public ChongWuMangHeNum: number = 4;//免费快递盲盒数量 // public kuaiDiMangHeFirstIn = false public bagGoodsList = []; /**need备份finish*/ // 地摊模块 public ditan_data = [] //地摊卖出物品 public ditanSaleGoodsIndex = 0 //狩猎场-弓箭广告次数 // public shouLiChang_gongJianAd = 0 // //狩猎场-猎枪广告次数 // public shouLiChang_lieQiangAd = 0 // //狩猎场-网广告次数 // public shouLiChang_wangAd = 0 // public taofenArray = {tanhuang:0, xichen:0} // public diaoyuNum:number = 0 public shouHuoJiList = [] public paimaiList = [] public levelNum_Array: Array = []; /**need备份finish*/ public levelNum: number = 0;//当前关卡 public successLevels = []; /**need备份finish*/ public wordGameAnswerUnlock: Array = [];//侦探笔记游戏当前是否看答案,0没看,1看了提示,2看了答案 public levelNum_Word_Array: Array = []; // 钓鱼模块 // public diaoyu_data = [] public curJuQingUnLockIndex: string = 'DH_1'//当前解锁的剧情索引 /**need备份finish*/ public curUnLockMainTaskInfo = {}//当前解锁的主任务信息 /**need备份finish*/ public recodeMainTaskInfo = {} public curUnLockSubTaskInfo = {}//当前解锁的主任务信息 /**need备份finish*/ public chatRecordData = {}//记录玩家的聊天记录 每个jsonName下记录dayIndexStr或eventIndexStr /**need备份finish*/ public saveGameProgressData_nls = null public isFinishCeBianLanAward: boolean = false//是否领取过侧边栏奖励 public daoyeGoodList = [] /**need备份finish*/ public daoyeJiaoHuo = false public daoyeShuaXin = 0 public daoyeIndex = 0//商人0,1 /**need备份finish*/ // public FengWeiHotelList = [] // public FengWeiEarnMoney = {earnMoney:0, xiaofei:0}//显示使用 // public FengWeiZhaopin = {isZhaoPin:false, zhaopinLevel:0}// // public fengWeiGirlSpineStr = '' // public naiNaiStatus = 0//0初始状态,1去医院了,2病好了 // public nianHuoExistIdTab = []//年货存在id public canInterGameList = [] /**need备份finish*/ // public userHeTong = { /**need备份finish*/ // buyMengChongGuan: false, buyFengHuangZuYu: false, buyChuShouDaLou: false, // buyFengTouDaSha: false, buyPeiXunLou: false, buyClub: false, buyPaiMaiHang: false, buyBaiMaHuiSuo: false, buyMeiZhuang: false, buyWaiXing: false, buyWangShiChanYe: false, buyXiuXianNongZhuang: false // } // public jianZaoLeftTime = 720 // public isOpenYanHua = false public firstStepIndex = 0 /**need备份finish*/ public unLockGameNameTab = [] public gameGuideStepIndex = 0 /**need备份finish*/ //股票 public curSaveStockDay: number = -1//当前保存的股票对应天数 public tomorrowStockData: any = {}//提前透露的股票数据 public stocksData: any = {} public myStockData: any = {} /**need备份finish*/ public stockFreeNum: number = 4 public meiNvZhaoMuData = []//美女招募信息 // public industryList = [] // public provideMoneyArray:{ titleStr:string,titleType: number; qiankuanMoney: number; xuhuanMoney: number; shengyuDay: number; isTodayHuanwan: boolean; isHuanwan: boolean;}[] = [ // ] // public BaoweiData = {buildBlood:1000000000, zhiyuanPeople:1, isQianYue:false}//保卫战 //古董 // public todayAntiqueIdList:{isBuy:boolean, goodId:number,jiandingChishu:number}[] = []; // // public appraisalIndex:number = 5; // // public roomGoodStatus: number = 0//0全破旧 1清理过 2修完窗户 /**need备份finish*/ // public YunshiChallenge = 0; // public sanXianGuiDongFreeNum:number = 5;//免费三仙归洞次数 // public sanXianGuiDongVDTime:number = 0;//免费三仙归洞看视频次数 //房产 // public curSaveFangChanDay:number = -1//当前保存的股票对应天数 // public tomorrowFangChanData:any = {}//提前透露的股票数据 // public FangChansData:any = {} // public myFangChanData:any = {} // public isStartTask505 = false // public treeUnlockIndex: number = 1 /**need备份finish*/ // public ChongFanHaoMenTimes: number = 86400 /**need备份finish*/ // public ChongFanHaoMenPeriod:number = 0//重返豪门阶段 // public jieSuoBaseIQ = {} // public sanXianGuiDongRateIndex:number = 0//三仙归洞概率索引 public curTaskIndex: number = 0//当前任务index,非taskId /**need备份finish*/ public shouYiMoneyCount = {} /**need备份finish*/ public guWanShiChangIndex = 0//古玩市场 public nixiHetongNum: { isqianshu: boolean, heTongId: number }[] = [] public kaiKuangFreeNum: number = 3;//免费开矿数量 public kaikuangNum: number = 0 public curDayMountingArr = [] //当天可以开采的山峰 public curTaskKaiKuangID = [0, 0] //0下标是当前任务开采的矿id,1下标是当前任务需要采集的数量 // public autoHeChangLeftTime = 0 public isChongFanHaoMen = false // public autoHeChangYuanbao = 0 public jinBiYuanBaoShowStatus = 0 public isNeedJiuGuanGuide = true public chaChangList = [] public chaChangZhaoMuData = { unLockTab: [], zhaoMuTime: 0, zhaoMuBeiShu: 1 } // public isFinishTask540 = false//用于记录上一次最后的任务,衔接后续更新剧情任务 // public yeLianChangZhaoMuData = {unLockTab:[],zhaoMuTime:0,zhaoMuBeiShu:1} // public baiCaoJiList = [] // public guShuList = [] // public baiCaoJiShuoMingUnlock = false // public newRoomStatus:number = 0 // public xiaoYanZhanChangStatus:number = 0 // public isFinishTask546 = false//用于记录上一次最后的任务,衔接后续更新剧情任务 public jiaLiGongFreeNum: number = 1 // public qingWangLingBaoXiangStatus = [] // public qingQangLingFreeNum:number = 4 // public isFinishTask556 = false//用于记录上一次最后的任务,衔接后续更新剧情任务 // public isFinishFKSC = false//是否完成过疯狂诗词(只能加一次智商) // public isFinishTask567 = false//用于记录上一次最后的任务,衔接后续更新剧情任务 public xpzGuideStep: number = 0;//洗盘子引导 public isPropChuiZiFree: boolean = true//锤子道具是否免费 public isPropLiuXingFree: boolean = true//流行道具是否免费 // public saveGameProgressData_xpz: GameProgressDataProperty_xpz = null /**need备份finish*/ public SendPZIndex = 2 // public kaiGongSiLevelArray = [0, 0, 0, 0, 0, 0, 0, 0] /**need备份finish*/ // public kaiGongSiLockArray = [0, 0, 0, 0, 0, 0, 0, 0] //有没有证件开公司 /**need备份finish*/ // public yinshitouziArray = [0, 0, 0, 0, 0] /**need备份finish*/ // public youTingInfo = [] /**need备份finish*/ public meiRongYuanFreeNum: number = 5;//美容院免费次数 // public qunYingJiuDianLockArray = []//群英酒店解锁状态 /**need备份finish*/ // 外星种菜模块 public caicha_data = [] //称号 public chenghao_data = [0] public buyBuildings: { buildId: number, buildName: string }[] = [] public yiMaJiangLockArray = []//移麻将解锁状态 public finishTaskId = [0, 0] //前面是任务id, 后面是任务完成状态0/1 /**need备份*/ // public finishZhiNengTaskId = [] /**need备份*/ public meiZhuangUnLock = [-1, -1] public caiDanStatusTab = [0, 0, 0]//彩蛋触发索引 public qieLevel: number = 0; //企鹅关卡 /**need备份*/ //黄金渔夫 public huangjinGouTime = 0; public saveFishDataList = []; public generateFishQuantity = 3; //刷新海域次数,暂不使用 public showFishDataList = []; public showFishQuantity = 4; //展览馆的展位 //植树造林 public treeLevel = 1; /**need备份*/ public roomBtnIndex = 0 /**need备份*/ public CaiShangChallengeNum: number = 3; // public CaiShangChallengeVD: number = 0; // public CaiShangChallenge = 0; public baDaCaiXiUnlockStatus = { /**need备份*/ ShiPingChang: false, YaoShan: false, YiYao: false, WenYu: false, JingRong: false, WeiLai: false, DianZi: false, WangLuo: false, } public baDaCaiXiLevelInfo = [] /**need备份*/ public isZhuiJiaTouZiArr = [] /**need备份finish*/ public liXianTime = 0 public maoYiFenHongTimes = 3 // 钓鱼模块 public diaoyu_data = [] //古董 public todayAntiqueIdList: { isBuy: boolean, goodId: number, jiandingChishu: number }[] = []; // public appraisalIndex: number = 5; // public curDayWaterArr = []//当天可以抽水的水坑 public cishanchoujiangNum: number = 3; public cishanchoujiangTime: number = 0; } export default class User { public static code_custom: string = ""; public static openId_custom: string = ""; public static token_custom: string = null; public static nickName_custom: string = ""; public static gender_custom: number = 0; public static get isLogin_custom() { return (User.code_custom != "") || (User.token_custom != ""); } private static readonly _gameData_custom: UserGameData = new UserGameData(); public static getSaveData_custom(): string { User._gameData_custom.dayUnlock = DayUnlock.getData(); return JSON.stringify(User._gameData_custom); } public static TT() { User._gameData_custom.levelNum = 0; User._gameData_custom.levelNum_Array = []; User._gameData_custom.successLevels = []; GameMgr.getInstance_custom().saveGameData_custom(); } /** * 测试用途 */ public static testInitUser_custom() { } public static initiUser_custom(data) { console.log("***************************** User initUser ************************************** "); console.log(data); // console.log((new Date()).getTime()); if (data == null) { Common5.isNewUser = true; } else { } if (data && 0 != data) { User._gameData_custom.levelNum = User.verify(data.levelNum, 0); User._gameData_custom.lastOnlineTime = User.verify(data.lastOnlineTime, -1) User._gameData_custom.lastOnlineTimestamp = User.verify(data.lastOnlineTimestamp, new Date().getTime()) User._gameData_custom.curGameLevelIndex = User.verify(data.curGameLevelIndex, 0); User._gameData_custom.proper_TiLi = User.verify(data.proper_TiLi, 0); User._gameData_custom.proper_NaoLi = User.verify(data.proper_NaoLi, 0); User._gameData_custom.otherPlatformUserID = User.verify(data.otherPlatformUserID, ""); Common5.lixianTime = new Date().getTime() - User._gameData_custom.lastOnlineTimestamp DayUnlock.initData(User.verify(data.dayUnlock, {})) /**增加文字游戏模式 */ if (null != data.levelNum_Word_Array) { let levelNum_Word_Array: Array = data.levelNum_Word_Array; for (let i = 0; i < levelNum_Word_Array.length; ++i) { User._gameData_custom.levelNum_Word_Array.push(levelNum_Word_Array[i]); } } if (null != data.wordGameAnswerUnlock) { let wordGameAnswerUnlock: Array = data.wordGameAnswerUnlock; for (let i = 0; i < wordGameAnswerUnlock.length; ++i) { let find = false; for (let j = 0; j < User._gameData_custom.wordGameAnswerUnlock.length; j++) { if (User._gameData_custom.wordGameAnswerUnlock[j].level == wordGameAnswerUnlock[i].level) { find = true; break; } } if (!find) { User._gameData_custom.wordGameAnswerUnlock.push(wordGameAnswerUnlock[i]); } } } if (null != data.headImgUnlock) { User._gameData_custom.headImgUnlock = data.headImgUnlock; } if (null != data.money) { User._gameData_custom.money = data.money; } if (null != data.userIQ) { User._gameData_custom.userIQ = data.userIQ; } if (null != data.yuanBao) { User._gameData_custom.yuanBao = data.yuanBao; } // if (null != data.saiCheFreeNum) { // User._gameData_custom.saiCheFreeNum = data.saiCheFreeNum // } if (null != data.day) { User._gameData_custom.day = data.day; } if (null != data.timeHour) { User._gameData_custom.timeHour = data.timeHour; } if (null != data.timeMin) { User._gameData_custom.timeMin = data.timeMin; } if (null != data.firstIn) { User._gameData_custom.firstIn = data.firstIn; } if (null != data.firstInNew) { User._gameData_custom.firstInNew = data.firstInNew; } if (null != data.uuid) { User._gameData_custom.uuid = data.uuid; } if (null != data.dadianListGame) { User._gameData_custom.dadianListGame = data.dadianListGame; } if (null != data.saveGameProgressData_nls) { User._gameData_custom.saveGameProgressData_nls = data.saveGameProgressData_nls; } // if (null != data.bingHuFreeNum) { // User._gameData_custom.bingHuFreeNum = data.bingHuFreeNum // } // if (null != data.jlbFreeNum) { // User._gameData_custom.jlbFreeNum = data.jlbFreeNum // } // if (null != data.jlbStepIndex) { // User._gameData_custom.jlbStepIndex = data.jlbStepIndex // } // if (null != data.jlbShengji) { // User._gameData_custom.jlbShengji = data.jlbShengji // } // if (null != data.jlbZnNum) { // User._gameData_custom.jlbZnNum = data.jlbZnNum // } // if (null != data.jlbewZnNum) { // User._gameData_custom.jlbewZnNum = data.jlbewZnNum // } if (null != data.pmcFreeNum) { User._gameData_custom.pmcFreeNum = data.pmcFreeNum } // if (null != data.laJiFreeNum) { // User._gameData_custom.laJiFreeNum = data.laJiFreeNum // } // 种菜模块 if (null != data.caicha_data) { User._gameData_custom.caicha_data = data.caicha_data } if (null != data.buyBuildings) { User._gameData_custom.buyBuildings = data.buyBuildings; } // if (null != data.FanLajiTimeStamp) { // User._gameData_custom.FanLajiTimeStamp = data.FanLajiTimeStamp // } // if (null != data.BingHuTimeStamp) { // User._gameData_custom.BingHuTimeStamp = data.BingHuTimeStamp // } // if (null != data.isKuaiDiKaiQi){ // User._gameData_custom.isKuaiDiKaiQi = data.isKuaiDiKaiQi; // } // if (null != data.kuaiDiMangHeNum) { // User._gameData_custom.kuaiDiMangHeNum = data.kuaiDiMangHeNum // } // if (null != data.ChongWuMangHeNum) { // User._gameData_custom.ChongWuMangHeNum = data.ChongWuMangHeNum // } // if (null != data.kuaiDiMangHeFirstIn) { // User._gameData_custom.kuaiDiMangHeFirstIn = data.kuaiDiMangHeFirstIn // } if (null != data.userId) { User._gameData_custom.userId = data.userId; } if (null != data.bagGoodsList) { let bagGoodsList = data.bagGoodsList; User._gameData_custom.bagGoodsList = bagGoodsList } if (null != data.ditanSaleGoodsIndex) { User._gameData_custom.ditanSaleGoodsIndex = data.ditanSaleGoodsIndex; } // 地摊模块 if (null != data.ditan_data) { User._gameData_custom.ditan_data = data.ditan_data; } // if (null != data.shouLiChang_gongJianAd){ // User._gameData_custom.shouLiChang_gongJianAd = data.shouLiChang_gongJianAd; // } // if (null != data.shouLiChang_lieQiangAd){ // User._gameData_custom.shouLiChang_lieQiangAd = data.shouLiChang_lieQiangAd; // } // if (null != data.shouLiChang_wangAd){ // User._gameData_custom.shouLiChang_wangAd = data.shouLiChang_wangAd; // } // if (null != data.taofenArray) { // User._gameData_custom.taofenArray = data.taofenArray // } // if (null != data.diaoyuNum) { // User._gameData_custom.diaoyuNum = data.diaoyuNum // } if (null != data.shouHuoJiList) { User._gameData_custom.shouHuoJiList = data.shouHuoJiList; } if (null != data.paimaiList) { User._gameData_custom.paimaiList = data.paimaiList; } if (null != data.daoyeGoodList) { User._gameData_custom.daoyeGoodList = data.daoyeGoodList; } if (null != data.daoyeJiaoHuo) { User._gameData_custom.daoyeJiaoHuo = data.daoyeJiaoHuo; } if (null != data.daoyeShuaXin) { User._gameData_custom.daoyeShuaXin = data.daoyeShuaXin; } if (null != data.daoyeIndex) { User._gameData_custom.daoyeIndex = data.daoyeIndex; } if (null != data.headImg) { User._gameData_custom.headImg = data.headImg; } if (null != data.chatImgIndex) { User._gameData_custom.chatImgIndex = data.chatImgIndex; } if (null != data.levelNum_Array) { let levelNum_Array: Array = data.levelNum_Array; for (let i = 0; i < Common5.addGameArr.length; ++i) { let sum = levelNum_Array[i]; if (sum == 0 || sum == 1) { User._gameData_custom.levelNum_Array[i] = sum; // if (User.getLeveNum_custom() >= i) { // User.setLevelAryy_custom(i, true); // // User._gameData_custom.levelNum_Array[i] = 1; // } } else { User._gameData_custom.levelNum_Array[i] = 0; } } // User._gameData_custom.levelNum_Array[0] = 1; } else { for (let index = 0; index < Common5.addGameArr.length; index++) { User._gameData_custom.levelNum_Array[index] = User.getLeveNum_custom() <= index ? 1 : 0; } // User._gameData_custom.levelNum_Array[0] = 1; } if (null != data.successLevels) { User._gameData_custom.successLevels = data.successLevels; } // 钓鱼模块 // if(null != data.diaoyu_data){ // User._gameData_custom.diaoyu_data = data.diaoyu_data; // } if (null != data.curJuQingUnLockIndex) { User._gameData_custom.curJuQingUnLockIndex = data.curJuQingUnLockIndex } if (null != data.curUnLockMainTaskInfo) { User._gameData_custom.curUnLockMainTaskInfo = data.curUnLockMainTaskInfo } if (null != data.recodeMainTaskInfo) { User._gameData_custom.recodeMainTaskInfo = data.recodeMainTaskInfo } if (null != data.curUnLockSubTaskInfo) { User._gameData_custom.curUnLockSubTaskInfo = data.curUnLockSubTaskInfo } if (null != data.chatRecordData) { User._gameData_custom.chatRecordData = data.chatRecordData; } if (null != data.isFinishCeBianLanAward) { User._gameData_custom.isFinishCeBianLanAward = data.isFinishCeBianLanAward; } // if (null != data.FengWeiHotelList) { // User._gameData_custom.FengWeiHotelList = data.FengWeiHotelList // } // if (null != data.FengWeiEarnMoney) { // User._gameData_custom.FengWeiEarnMoney = data.FengWeiEarnMoney // } // if (null != data.FengWeiZhaopin) { // User._gameData_custom.FengWeiZhaopin = data.FengWeiZhaopin // } // if (null != data.fengWeiGirlSpineStr) { // User._gameData_custom.fengWeiGirlSpineStr = data.fengWeiGirlSpineStr // } // if (null != data.naiNaiStatus) { // User._gameData_custom.naiNaiStatus = data.naiNaiStatus // } // if (null != data.nianHuoExistIdTab) { // User._gameData_custom.nianHuoExistIdTab = data.nianHuoExistIdTab // } if (null != data.canInterGameList) { User._gameData_custom.canInterGameList = data.canInterGameList } // if (null != data.userHeTong) { // User._gameData_custom.userHeTong = data.userHeTong // } // if (null != data.jianZaoLeftTime) { // User._gameData_custom.jianZaoLeftTime = data.jianZaoLeftTime // } // if (null != data.isOpenYanHua) { // User._gameData_custom.isOpenYanHua = data.isOpenYanHua // } if (null != data.firstStepIndex) { User._gameData_custom.firstStepIndex = data.firstStepIndex } if (null != data.gameGuideStepIndex) { User._gameData_custom.gameGuideStepIndex = data.gameGuideStepIndex } if (null != data.unLockGameNameTab) { User._gameData_custom.unLockGameNameTab = data.unLockGameNameTab } if (null != data.curSaveStockDay) { User._gameData_custom.curSaveStockDay = data.curSaveStockDay; } if (null != data.tomorrowStockData) { User._gameData_custom.tomorrowStockData = data.tomorrowStockData; } if (null != data.stocksData) { User._gameData_custom.stocksData = data.stocksData; } if (null != data.myStockData) { User._gameData_custom.myStockData = data.myStockData; } if (null != data.stockFreeNum) { User._gameData_custom.stockFreeNum = data.stockFreeNum; } if (null != data.meiNvZhaoMuData) { User._gameData_custom.meiNvZhaoMuData = data.meiNvZhaoMuData } // if (null != data.industryList){ // User._gameData_custom.industryList = data.industryList; // } //更新欠款 // if (null != data.provideMoneyArray) { // let provideMoneyArray = data.provideMoneyArray; // User._gameData_custom.provideMoneyArray = provideMoneyArray // } // if (null != data.BaoweiData) { // User._gameData_custom.BaoweiData = data.BaoweiData // } // //古玩市场更新 // if (null != data.todayAntiqueIdList) { // let todayAntiqueIdList = data.todayAntiqueIdList; // User._gameData_custom.todayAntiqueIdList = todayAntiqueIdList // } // if (null != data.appraisalIndex) { // let appraisalIndex = data.appraisalIndex; // User._gameData_custom.appraisalIndex = appraisalIndex // } // if (null != data.roomGoodStatus) { // let roomGoodStatus = data.roomGoodStatus; // User._gameData_custom.roomGoodStatus = roomGoodStatus // } // if (null != data.YunshiChallenge) { // User._gameData_custom.YunshiChallenge = data.YunshiChallenge // } // if (null != data.sanXianGuiDongFreeNum) { // User._gameData_custom.sanXianGuiDongFreeNum = data.sanXianGuiDongFreeNum // } // if (null != data.sanXianGuiDongVDTime) { // User._gameData_custom.sanXianGuiDongVDTime = data.sanXianGuiDongVDTime // } // if (null != data.curSaveFangChanDay){ // User._gameData_custom.curSaveFangChanDay = data.curSaveFangChanDay; // } // if (null != data.tomorrowFangChanData){ // User._gameData_custom.tomorrowFangChanData = data.tomorrowFangChanData; // } // if (null != data.FangChansData){ // User._gameData_custom.FangChansData = data.FangChansData; // } // if (null != data.myFangChanData){ // User._gameData_custom.myFangChanData = data.myFangChanData; // } // if (null != data.isStartTask505){ // User._gameData_custom.isStartTask505 = data.isStartTask505; // } // if (null != data.treeUnlockIndex) { // User._gameData_custom.treeUnlockIndex = data.treeUnlockIndex; // } // if (null != data.ChongFanHaoMenTimes) { // User._gameData_custom.ChongFanHaoMenTimes = data.ChongFanHaoMenTimes; // } // if (null != data.ChongFanHaoMenPeriod){ // User._gameData_custom.ChongFanHaoMenPeriod = data.ChongFanHaoMenPeriod; // } // if (null != data.jieSuoBaseIQ) { // User._gameData_custom.jieSuoBaseIQ = data.jieSuoBaseIQ; // } // if (null != data.sanXianGuiDongRateIndex){ // User._gameData_custom.sanXianGuiDongRateIndex = data.sanXianGuiDongRateIndex; // } if (null != data.curTaskIndex) { User._gameData_custom.curTaskIndex = data.curTaskIndex; } if (null != data.shouYiMoneyCount) { User._gameData_custom.shouYiMoneyCount = data.shouYiMoneyCount; } if (null != data.guWanShiChangIndex) { User._gameData_custom.guWanShiChangIndex = data.guWanShiChangIndex; } if (null != data.nixiHetongNum) { User._gameData_custom.nixiHetongNum = data.nixiHetongNum } if (null != data.kaiKuangFreeNum) { User._gameData_custom.kaiKuangFreeNum = data.kaiKuangFreeNum } if (null != data.kaikuangNum) { User._gameData_custom.kaikuangNum = data.kaikuangNum } if (null != data.curDayMountingArr) { User._gameData_custom.curDayMountingArr = data.curDayMountingArr } if (null != data.curTaskKaiKuangID) { User._gameData_custom.curTaskKaiKuangID = data.curTaskKaiKuangID } // if (null != data.autoHeChangLeftTime) { // User._gameData_custom.autoHeChangLeftTime = data.autoHeChangLeftTime // } if (null != data.isChongFanHaoMen) { User._gameData_custom.isChongFanHaoMen = data.isChongFanHaoMen } // if (null != data.autoHeChangYuanbao) { // User._gameData_custom.autoHeChangYuanbao = data.autoHeChangYuanbao // } if (null != data.jinBiYuanBaoShowStatus) { User._gameData_custom.jinBiYuanBaoShowStatus = data.jinBiYuanBaoShowStatus } if (null != data.isNeedJiuGuanGuide) { User._gameData_custom.isNeedJiuGuanGuide = data.isNeedJiuGuanGuide } if (null != data.chaChangList) { User._gameData_custom.chaChangList = data.chaChangList } if (null != data.chaChangZhaoMuData) { User._gameData_custom.chaChangZhaoMuData = data.chaChangZhaoMuData } // if (null != data.isFinishTask540) { // User._gameData_custom.isFinishTask540 = data.isFinishTask540 // } // if (null != data.yeLianChangZhaoMuData) { // User._gameData_custom.yeLianChangZhaoMuData = data.yeLianChangZhaoMuData // } // if (null != data.baiCaoJiList) { // User._gameData_custom.baiCaoJiList = data.baiCaoJiList // } // if (null != data.guShuList) { // User._gameData_custom.guShuList = data.guShuList // } // if (null != data.baiCaoJiShuoMingUnlock) { // User._gameData_custom.baiCaoJiShuoMingUnlock = data.baiCaoJiShuoMingUnlock // } // if (null != data.newRoomStatus) { // User._gameData_custom.newRoomStatus = data.newRoomStatus // } // if (null != data.xiaoYanZhanChangStatus) { // User._gameData_custom.xiaoYanZhanChangStatus = data.xiaoYanZhanChangStatus // } // if (null != data.isFinishTask546) { // User._gameData_custom.isFinishTask546 = data.isFinishTask546 // } if (null != data.jiaLiGongFreeNum) { User._gameData_custom.jiaLiGongFreeNum = data.jiaLiGongFreeNum } // if (null != data.qingWangLingBaoXiangStatus) { // User._gameData_custom.qingWangLingBaoXiangStatus = data.qingWangLingBaoXiangStatus // } // if (null != data.qingQangLingFreeNum) { // User._gameData_custom.qingQangLingFreeNum = data.qingQangLingFreeNum // } // if (null != data.isFinishTask556) { // User._gameData_custom.isFinishTask556 = data.isFinishTask556 // } // if (null != data.isFinishFKSC) { // User._gameData_custom.isFinishFKSC = data.isFinishFKSC // } // if (null != data.isFinishTask567) { // User._gameData_custom.isFinishTask567 = data.isFinishTask567 // } if (null != data.xpzGuideStep) { User._gameData_custom.xpzGuideStep = data.xpzGuideStep; } if (null != data.isPropChuiZiFree) { User._gameData_custom.isPropChuiZiFree = data.isPropChuiZiFree; } if (null != data.isPropLiuXingFree) { User._gameData_custom.isPropLiuXingFree = data.isPropLiuXingFree; } // if (null != data.saveGameProgressData_xpz) { // User._gameData_custom.saveGameProgressData_xpz = data.saveGameProgressData_xpz; // } if (null != data.SendPZIndex) { User._gameData_custom.SendPZIndex = data.SendPZIndex; } // if (null != data.kaiGongSiLevelArray) { // User._gameData_custom.kaiGongSiLevelArray = data.kaiGongSiLevelArray // } // if (null != data.kaiGongSiLockArray) { // User._gameData_custom.kaiGongSiLockArray = data.kaiGongSiLockArray // } // if (null != data.yinshitouziArray) { // User._gameData_custom.yinshitouziArray = data.yinshitouziArray // } // if (null != data.youTingInfo) { // User._gameData_custom.youTingInfo = data.youTingInfo // } if (null != data.meiRongYuanFreeNum) { User._gameData_custom.meiRongYuanFreeNum = data.meiRongYuanFreeNum } // if (null != data.qunYingJiuDianLockArray) { // User._gameData_custom.qunYingJiuDianLockArray = data.qunYingJiuDianLockArray // } if (null != data.chenghao_data) { User._gameData_custom.chenghao_data = data.chenghao_data; } if (null != data.yiMaJiangLockArray) { User._gameData_custom.yiMaJiangLockArray = data.yiMaJiangLockArray } if (null != data.finishTaskId) { User._gameData_custom.finishTaskId = data.finishTaskId } // if (null != data.finishZhiNengTaskId) { // User._gameData_custom.finishZhiNengTaskId = data.finishZhiNengTaskId // } if (null != data.meiZhuangUnLock) { User._gameData_custom.meiZhuangUnLock = data.meiZhuangUnLock } if (null != data.caiDanStatusTab) { User._gameData_custom.caiDanStatusTab = data.caiDanStatusTab } if (null != data.qieLevel) { User._gameData_custom.qieLevel = data.qieLevel; } if (null != data.huangjinGouTime) { User._gameData_custom.huangjinGouTime = data.huangjinGouTime } if (null != data.saveFishDataList) { User._gameData_custom.saveFishDataList = data.saveFishDataList } if (null != data.generateFishQuantity) { User._gameData_custom.generateFishQuantity = data.generateFishQuantity } if (null != data.showFishDataList) { User._gameData_custom.showFishDataList = data.showFishDataList } if (null != data.showFishQuantity) { User._gameData_custom.showFishQuantity = data.showFishQuantity } if (null != data.treeLevel) { User._gameData_custom.treeLevel = data.treeLevel } if (null != data.roomBtnIndex) { User._gameData_custom.roomBtnIndex = data.roomBtnIndex } if (null != data.CaiShangChallengeNum) { User._gameData_custom.CaiShangChallengeNum = data.CaiShangChallengeNum } if (null != data.CaiShangChallengeVD) { User._gameData_custom.CaiShangChallengeVD = data.CaiShangChallengeVD } if (null != data.CaiShangChallenge) { User._gameData_custom.CaiShangChallenge = data.CaiShangChallenge } if (null != data.baDaCaiXiUnlockStatus) { User._gameData_custom.baDaCaiXiUnlockStatus = data.baDaCaiXiUnlockStatus } if (null != data.baDaCaiXiLevelInfo) { User._gameData_custom.baDaCaiXiLevelInfo = data.baDaCaiXiLevelInfo } if (null != data.isZhuiJiaTouZiArr) { User._gameData_custom.isZhuiJiaTouZiArr = data.isZhuiJiaTouZiArr } if (null != data.liXianTime) { User._gameData_custom.liXianTime = data.liXianTime } if (null != data.maoYiFenHongTimes) { User._gameData_custom.maoYiFenHongTimes = data.maoYiFenHongTimes } // 钓鱼模块 if (null != data.diaoyu_data) { User._gameData_custom.diaoyu_data = data.diaoyu_data; } //古玩市场更新 if (null != data.todayAntiqueIdList) { let todayAntiqueIdList = data.todayAntiqueIdList; User._gameData_custom.todayAntiqueIdList = todayAntiqueIdList } if (null != data.appraisalIndex) { let appraisalIndex = data.appraisalIndex; User._gameData_custom.appraisalIndex = appraisalIndex } if (null != data.curDayWaterArr) { User._gameData_custom.curDayWaterArr = data.curDayWaterArr } //慈善抽奖 if (null != data.cishanchoujiangNum) { User._gameData_custom.cishanchoujiangNum = data.cishanchoujiangNum } if (null != data.cishanchoujiangTime) { User._gameData_custom.cishanchoujiangTime = data.cishanchoujiangTime } if (User.getLastOnlineTime() != (new Date()).getDay()) { console.log("ly+++++++++++++ 第二天了", User.getLastOnlineTime(), (new Date()).getDay()); User._gameData_custom.dadianListGame = [] // User._gameData_custom.bingHuFreeNum = 5 // User._gameData_custom.jlbFreeNum = 5 // User._gameData_custom.jlbStepIndex = 0 // User._gameData_custom.jlbShengji = false User._gameData_custom.pmcFreeNum = 5 // User._gameData_custom.laJiFreeNum = 3 // User._gameData_custom.FanLajiTimeStamp = 0 User._gameData_custom.shouHuoJiList = [] User._gameData_custom.paimaiList = [] // User._gameData_custom.BingHuTimeStamp = 0 // User._gameData_custom.isKuaiDiKaiQi = [] // User._gameData_custom.kuaiDiMangHeNum = 4 // User._gameData_custom.ChongWuMangHeNum = 4 // User._gameData_custom.saiCheFreeNum = 3 User._gameData_custom.nixiHetongNum = [] User._gameData_custom.isFinishCeBianLanAward = false User._gameData_custom.appraisalIndex = 5//鉴定次数 User._gameData_custom.todayAntiqueIdList = [] // User._gameData_custom.sanXianGuiDongFreeNum = 5 // User._gameData_custom.sanXianGuiDongVDTime = 0 User._gameData_custom.kaiKuangFreeNum = 3 User._gameData_custom.curDayMountingArr = [] User._gameData_custom.curTaskKaiKuangID = [0, 0] User._gameData_custom.chaChangList = [] // User._gameData_custom.baiCaoJiList = [] // User._gameData_custom.guShuList = [] User._gameData_custom.jiaLiGongFreeNum = 1 // User._gameData_custom.qingQangLingFreeNum = 4 User._gameData_custom.meiRongYuanFreeNum = 5 User._gameData_custom.saveFishDataList = [] User._gameData_custom.generateFishQuantity = 3 User._gameData_custom.CaiShangChallengeNum = 3 User._gameData_custom.CaiShangChallengeVD = 0 User._gameData_custom.curDayWaterArr = [] //DayUnlock.initData({}); } User.setLastOnlineTime((new Date()).getDay()); User.setLastOnlineTimestamp(new Date().getTime()); } else { DayUnlock.initData({}); //todo:处理没有获取到玩家数据的情况 User.setLastOnlineTime((new Date()).getDay()); User.setLastOnlineTimestamp(new Date().getTime()); } } public static subBagGoodsList(goodId, goodIdNum = 1) { let goodLists = User._gameData_custom.bagGoodsList for (let i = 0; i < goodLists.length; i++) { if (goodId == goodLists[i].goodId) { goodLists[i].goodNum -= goodIdNum if (goodLists[i].goodNum <= 0) { goodLists.splice(i, 1) } break } } //console.log('背包删除物品后',goodLists) GameMgr.getInstance_custom().saveGameData_custom(); } public static addBagGoodsList(tab) { let isExist = false let goodLists = User._gameData_custom.bagGoodsList for (let i = 0; i < goodLists.length; i++) { if (tab.goodId == goodLists[i].goodId) { goodLists[i].goodNum += tab.goodNum isExist = true break } } if (!isExist) { User._gameData_custom.bagGoodsList.push(tab) } GameMgr.getInstance_custom().saveGameData_custom(); } public static getBagGoodsList() { return User._gameData_custom.bagGoodsList; } public static setBagGoodsList(goodList, save = true) { User._gameData_custom.bagGoodsList = goodList; if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static setDadianListGame(key, value) { User._gameData_custom.dadianListGame[key] = value; GameMgr.getInstance_custom().saveGameData_custom(); } public static getDadianListGame() { return User._gameData_custom.dadianListGame; } //ditan_data 地摊模块 public static setDitanData(ditan_data, save = true) { User._gameData_custom.ditan_data = ditan_data; if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getDitanData() { return User._gameData_custom.ditan_data; } // public static setTaofenArray(Array,save=true){ // User._gameData_custom.taofenArray = Array // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getTaofenArray(){ // return User._gameData_custom.taofenArray // } /////////疯狂逆袭 public static setUUID(num: string) { User._gameData_custom.uuid = num; GameMgr.getInstance_custom().saveGameData_custom(true); } public static getUUID(): string { return User._gameData_custom.uuid; } public static setFirstIn(first: boolean) { console.log(first, 'setFirstIn') User._gameData_custom.firstIn = first; GameMgr.getInstance_custom().saveGameData_custom(); } public static getFirstIn() { return User._gameData_custom.firstIn; } public static setFirstInNew(first: boolean) { console.log(first, 'setFirstIn') User._gameData_custom.firstInNew = first; GameMgr.getInstance_custom().saveGameData_custom(); } public static getFirstInNew() { return User._gameData_custom.firstInNew; } public static setHeadImg(img: string) { User._gameData_custom.headImg = img; GameMgr.getInstance_custom().saveGameData_custom(); } public static getHeadImg() { return User._gameData_custom.headImg; } public static setChatImgIndex(index) { User._gameData_custom.chatImgIndex = index; GameMgr.getInstance_custom().saveGameData_custom(); } public static getChatImgIndex() { return User._gameData_custom.chatImgIndex; } public static setMoney(money: number, save = true) { console.log(money, 'setMoney++++++++++==') if (typeof (money) !== 'undefined' && typeof (money) === 'number' && !isNaN(money)) { User._gameData_custom.money = money; if (save) GameMgr.getInstance_custom().saveGameData_custom(); } } public static getMoney() { return User._gameData_custom.money; } public static setUserIQ(iq: number, save = true) { if (typeof (iq) !== 'undefined' && typeof (iq) === 'number' && !isNaN(iq)) { User._gameData_custom.userIQ = iq; if (save) GameMgr.getInstance_custom().saveGameData_custom(); } // TaskManager.checkIsFinish635() // TaskManager.checkIsFinish647() } public static setUserIQAdd(peopleIQ: number, selectGameNum) { // console.log('selectGameNum+++++++++++======') let allSuccess = User.getSuccessLevels() let isTongguan = false for (let i = 0; i < allSuccess.length; i++) { if (selectGameNum == allSuccess[i]) { isTongguan = true } } if (typeof (peopleIQ) !== 'undefined' && typeof (peopleIQ) === 'number' && !isNaN(peopleIQ) && isTongguan == false) { User._gameData_custom.userIQ += peopleIQ; GameMgr.getInstance_custom().saveGameData_custom(); EventMgr.emitEvent_custom(ryw_Event.updatePeopleIQ, peopleIQ); // TaskManager.checkIsFinish635() // TaskManager.checkIsFinish647() return true } else { return false } } public static getUserIQ() { return User._gameData_custom.userIQ; } public static setYuanBao(yuanBao: number, save = true) { //console.log(money, 'setMoney++++++++++==') if (typeof (yuanBao) !== 'undefined' && typeof (yuanBao) === 'number' && !isNaN(yuanBao)) { User._gameData_custom.yuanBao = yuanBao; if (save) GameMgr.getInstance_custom().saveGameData_custom(); } } public static getYuanBao() { return User._gameData_custom.yuanBao; } public static setFinishCeBianLanAward(bFinish) { User._gameData_custom.isFinishCeBianLanAward = bFinish GameMgr.getInstance_custom().saveGameData_custom(); } public static getFinishCeBianLanAward() { return User._gameData_custom.isFinishCeBianLanAward; } public static setHeadImgUnlock(img: string) { User._gameData_custom.headImgUnlock.push(img); GameMgr.getInstance_custom().saveGameData_custom(); } public static getHeadImgUnlock() { return User._gameData_custom.headImgUnlock; } public static setTime(hour, min) { User._gameData_custom.timeHour = hour; User._gameData_custom.timeMin = min; GameMgr.getInstance_custom().saveGameData_custom(); } public static getTimeHour() { return User._gameData_custom.timeHour; } public static getTimeMin() { return User._gameData_custom.timeMin; } public static setDay(day, save = true) { User._gameData_custom.day = day; if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getDay() { return User._gameData_custom.day; } public static setDitanSaleGoodsIndex(num) { User._gameData_custom.ditanSaleGoodsIndex += num; GameMgr.getInstance_custom().saveGameData_custom(); } public static getDitanSaleGoodsIndex() { return User._gameData_custom.ditanSaleGoodsIndex; } /////////疯狂逆袭 public static setLastOnlineTime(dayNum: number) { User._gameData_custom.lastOnlineTime = dayNum; GameMgr.getInstance_custom().saveGameData_custom(); } public static getLastOnlineTime(): number { return User._gameData_custom.lastOnlineTime; } public static setLastOnlineTimestamp(shijiancuo: number) { User._gameData_custom.lastOnlineTimestamp = shijiancuo; GameMgr.getInstance_custom().saveGameData_custom(); } public static getLastOnlineTimestamp(): number { return User._gameData_custom.lastOnlineTimestamp; } public static setCurGameLevelIndex(curGameLevelIndex: number) { User._gameData_custom.curGameLevelIndex = curGameLevelIndex; GameMgr.getInstance_custom().saveGameData_custom(); } public static getCurGameLevelIndex(): number { return User._gameData_custom.curGameLevelIndex; } public static setProper_TiLi(num: number, save = true) { User._gameData_custom.proper_TiLi = num; if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getProper_TiLi(): number { return User._gameData_custom.proper_TiLi; } public static setProper_NaoLi(num: number, save = true) { User._gameData_custom.proper_NaoLi = num; if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getProper_NaoLi(): number { return User._gameData_custom.proper_NaoLi; } // public static setBingHuFreeNum(num){ // User._gameData_custom.bingHuFreeNum = num // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getBingHuFreeNum(){ // return User._gameData_custom.bingHuFreeNum; // } // public static setJLBFreeNum(num) { // User._gameData_custom.jlbFreeNum = num // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getjlbFreeNum() { // return User._gameData_custom.jlbFreeNum; // } // public static setJLBStepNum(num) { // User._gameData_custom.jlbStepIndex = num // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getjlbStepNum() { // return User._gameData_custom.jlbStepIndex; // } // public static setJLBShengji(shengji) { // User._gameData_custom.jlbShengji = shengji // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getjlbShengji() { // return User._gameData_custom.jlbShengji; // } // public static setJLBZnNum(num){ // User._gameData_custom.jlbZnNum = num // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getjlbZnNum(){ // return User._gameData_custom.jlbZnNum; // } // public static setJLBewZnNum(num) { // User._gameData_custom.jlbewZnNum = num // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getjlbewZnNum() { // return User._gameData_custom.jlbewZnNum; // } public static setPMCFreeNum(num) { User._gameData_custom.pmcFreeNum = num GameMgr.getInstance_custom().saveGameData_custom(); } public static getPMCFreeNum() { return User._gameData_custom.pmcFreeNum; } // public static setLaJiFreeNum(num){ // User._gameData_custom.laJiFreeNum = num // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getLaJiFreeNum(){ // return User._gameData_custom.laJiFreeNum; // } // public static setFanLajiTimeStamp(num){ // User._gameData_custom.FanLajiTimeStamp = num // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getFanLajiTimeStamp(){ // return User._gameData_custom.FanLajiTimeStamp; // } // public static setBingHuTimeStamp(num){ // User._gameData_custom.BingHuTimeStamp = num // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getBingHuTimeStamp(){ // return User._gameData_custom.BingHuTimeStamp; // } // public static initKuaiDiKaiQi(length){ // let tab = User._gameData_custom.isKuaiDiKaiQi // for(var i=0;i { let unlocked = new Array(); for (let i = 0; i < Common5.addGameArr.length; ++i) { if (!User._gameData_custom.levelNum_Array[i]) { unlocked.push(0) } else { unlocked.push(User._gameData_custom.levelNum_Array[i]); } } // unlocked[0] = 1; return unlocked; } /**关卡解锁 */ public static setLevelAryy_custom(id, isUseInit = false) { //console.error(id, '关卡解锁') User._gameData_custom.levelNum_Array[id] = 1; GameMgr.getInstance_custom().saveGameData_custom(); } //关卡覆盖 public static setLevelAryy_Cover(data, save = true) { User._gameData_custom.levelNum_Array = data; if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getUnlockLevel() { let levelArray = User._gameData_custom.levelNum_Array; let _unlock = 0 for (let i = 0; i < levelArray.length; i++) { if (levelArray[i] == 1) { _unlock++ } } return _unlock } public static getSuccessLevels() { return User._gameData_custom.successLevels; } public static setSuccessLevelsCover(data, save = true) { User._gameData_custom.successLevels = data; if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static setSuccessLevels(level) { for (let i = 0; i < User._gameData_custom.successLevels.length; i++) { if (level == User._gameData_custom.successLevels[i]) { return; } } // if(window['tt']){ // TTAPI.setImRankData(User._gameData_custom.successLevels.length) // } User._gameData_custom.successLevels.push(level); // TTAPI.setImRankData(User._gameData_custom.successLevels.length) GameMgr.getInstance_custom().saveGameData_custom(); } //获取侦探笔记解锁标志,1提示解锁,2答案解锁 public static getUnlockWordgameAnswer(level) { for (let i = 0; i < User._gameData_custom.wordGameAnswerUnlock.length; i++) { if (User._gameData_custom.wordGameAnswerUnlock[i].level == level) { return User._gameData_custom.wordGameAnswerUnlock[i].flag; } } return 0; } //侦探笔记解锁标志,1提示解锁,2答案解锁 public static unlockWordgameAnswer(level, subLevel, unlockFlag) { let find = false for (let i = 0; i < User._gameData_custom.wordGameAnswerUnlock.length; i++) { if (User._gameData_custom.wordGameAnswerUnlock[i].level == level) { find = true; User._gameData_custom.wordGameAnswerUnlock[i].flag[subLevel] = unlockFlag; GameMgr.getInstance_custom().saveGameData_custom(); return; } } let lf = new LevelFlag(); lf.flag[subLevel] = unlockFlag; lf.level = level; User._gameData_custom.wordGameAnswerUnlock.push(lf); GameMgr.getInstance_custom().saveGameData_custom(); } public static setlevelNum_Word_Array_custom(level: number) { User._gameData_custom.levelNum_Word_Array[level] = 1; GameMgr.getInstance_custom().saveGameData_custom(); } public static getlevelNum_Word_Array_custom(): Array { let word = new Array(); for (let i = 0; i < Common5.addGameArr.length; ++i) { if (!User._gameData_custom.levelNum_Word_Array[i]) { word.push(0) } else { word.push(User._gameData_custom.levelNum_Word_Array[i]); } } //word[0] = 1; return word; } // public static setSaiCheFreeNum(num){ // User._gameData_custom.saiCheFreeNum = num // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getSaiCheFreeNum(){ // return User._gameData_custom.saiCheFreeNum; // } public static setCurJuQingUnLockIndex(indexStr, save = true) { User._gameData_custom.curJuQingUnLockIndex = indexStr console.log(indexStr, '剧情+++++++++++++解锁') if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getCurJuQingUnLockIndex() { return User._gameData_custom.curJuQingUnLockIndex; } public static setCurUnLockMainTaskInfo(taskInfo, save = true) { User._gameData_custom.curUnLockMainTaskInfo = taskInfo if (taskInfo.Id == 0) { User._gameData_custom.recodeMainTaskInfo['IsFinish'] = taskInfo.IsFinish } else { this.setRecodeMainTaskInfo(taskInfo) } if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getCurUnLockMainTaskInfo() { return User._gameData_custom.curUnLockMainTaskInfo; } public static setRecodeMainTaskInfo(taskInfo) { User._gameData_custom.recodeMainTaskInfo = taskInfo //GameMgr.getInstance_custom().saveGameData_custom(); } public static getRecodeMainTaskInfo() { return User._gameData_custom.recodeMainTaskInfo; } public static setChenghaoData(chenghaoData) { User._gameData_custom.chenghao_data = chenghaoData; GameMgr.getInstance_custom().saveGameData_custom(); } public static getChenghaoData() { return User._gameData_custom.chenghao_data; } public static setCurUnLockSubTaskInfo(taskInfo, save = true) { User._gameData_custom.curUnLockSubTaskInfo = taskInfo if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getCurUnLockSubTaskInfo() { return User._gameData_custom.curUnLockSubTaskInfo; } //为保证与配置的chatPerson.json同步,比对文件(便于配置删除后缓存也需删除情况) public static initChatRecordData() { } public static setChatRecordData(jsonName, indexStr, isFinish, save = true) { if (!User._gameData_custom.chatRecordData[jsonName]) { User._gameData_custom.chatRecordData[jsonName] = [] } let tab = User._gameData_custom.chatRecordData[jsonName] let isInClude = false for (var i = 0; i < tab.length; i++) { if (tab[i].indexStr == indexStr) { isInClude = true tab[i].isFinish = isFinish break } } if (!isInClude) { tab.push({ indexStr: indexStr, isFinish: isFinish }) } if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getAllChatRecordData() { return User._gameData_custom.chatRecordData; } public static checkIsIncludeIndexStr(jsonName, indexStr) { let tab = User._gameData_custom.chatRecordData[jsonName] if (tab) { for (var i = 0; i < tab.length; i++) { if (tab[i].indexStr == indexStr) { return true } } } return false } public static getSaveGameProgressData_nls() { return User._gameData_custom.saveGameProgressData_nls; } public static setSaveGameProgressData_nls(data) { User._gameData_custom.saveGameProgressData_nls = data GameMgr.getInstance_custom().saveGameData_custom(); } /** * 数据校验 * @param data 校验的数据 * @param defaultValue 默认值 */ public static verify(data: any, defaultValue: any) { if (data !== undefined) { return data; } return defaultValue; } // diaoyu_data 钓鱼模块 // public static setDiaoyuData(diaoyu_data,save=true) { // User._gameData_custom.diaoyu_data = diaoyu_data; // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getDiaoyuData() { // return User._gameData_custom.diaoyu_data; // } // public static setFengWeiHotelList(array,save=true){ // User._gameData_custom.FengWeiHotelList = array // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getFengWeiHotelList(){ // return User._gameData_custom.FengWeiHotelList // } // public static setFengWeiEarnMoney(array){ // User._gameData_custom.FengWeiEarnMoney = array // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getFengWeiEarnMoney(){ // return User._gameData_custom.FengWeiEarnMoney // } // public static setFengWeiZhaopin(array){ // User._gameData_custom.FengWeiZhaopin = array // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getFengWeiZhaopin(){ // return User._gameData_custom.FengWeiZhaopin // } // public static setFengWeiGirlSpineStr(str){ // User._gameData_custom.fengWeiGirlSpineStr = str // GameMgr.getInstance_custom().saveGameData_custom(); // EventMgr.emitEvent_custom(ryw_Event.refreshFengWeiGirlSpine,str); // } // public static getFengWeiGirlSpineStr(){ // return User._gameData_custom.fengWeiGirlSpineStr // } // public static setNaiNaiStatus(num,save=true){ // User._gameData_custom.naiNaiStatus = num // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getNaiNaiStatus(){ // return User._gameData_custom.naiNaiStatus // } // public static setNianHuoExistIdTab(id,save=true){ // let tab = User._gameData_custom.nianHuoExistIdTab // if(tab.indexOf(id) > -1){ // }else{ // tab.push(id) // } // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getNianHuoExistIdTab(){ // return User._gameData_custom.nianHuoExistIdTab // } public static setCanInterGameList(gameType, save = true) { if (User._gameData_custom.canInterGameList.indexOf(gameType) < 0) { User._gameData_custom.canInterGameList.push(gameType) } if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getCanInterGameList() { return User._gameData_custom.canInterGameList } public static setCanInterGameListArray(array) { User._gameData_custom.canInterGameList = array } // public static setUserHeTong(userHeTong, save = true) { // User._gameData_custom.userHeTong = userHeTong // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getUserHeTong() { // return User._gameData_custom.userHeTong // } // public static getJianZaoLeftTimes(){ // return User._gameData_custom.jianZaoLeftTime // } // public static setJianZaoLeftTimes(leftTime){ // User._gameData_custom.jianZaoLeftTime = leftTime // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static finishJianZao(){ // User._gameData_custom.jianZaoLeftTime = 0 // User._gameData_custom.userHeTong.isBuildChiTangFinish = true // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static updateJianZaoTime(){ // User._gameData_custom.jianZaoLeftTime -= 1 // if(User._gameData_custom.jianZaoLeftTime <= 0){ // User._gameData_custom.jianZaoLeftTime = 0 // User._gameData_custom.userHeTong.isBuildChiTangFinish = true // } // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static setIsOpenYanHua(bShow){ // User._gameData_custom.isOpenYanHua = bShow // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getIsOpenYanHua(){ // return User._gameData_custom.isOpenYanHua // } public static setUserId(userId) { console.log("setUserId", userId) User._gameData_custom.userId = userId; GameMgr.getInstance_custom().saveGameData_custom(); } public static getUserId() { console.log("getUserId", User._gameData_custom.userId) return User._gameData_custom.userId } public static setOtherplatformUserid(otn) { User._gameData_custom.otherPlatformUserID = otn; GameMgr.getInstance_custom().saveGameData_custom(); } public static getOtherplatformUserid() { return User._gameData_custom.otherPlatformUserID; } public static setFirstStepIndex(step, save = true) { User._gameData_custom.firstStepIndex = step; if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getFirstStepIndex() { console.log('新手引导索引值===', User._gameData_custom.firstStepIndex) return User._gameData_custom.firstStepIndex; } public static setGameGuideStepIndex(step, save = true) { User._gameData_custom.gameGuideStepIndex = step; if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getGameGuideStepIndex() { console.log('游戏引导索引值===', User._gameData_custom.gameGuideStepIndex) return User._gameData_custom.gameGuideStepIndex; } public static addUnLockGameNameTab(gameName) { if (User._gameData_custom.unLockGameNameTab.indexOf(gameName) < 0) { User._gameData_custom.unLockGameNameTab.push(gameName) } GameMgr.getInstance_custom().saveGameData_custom(); EventMgr.emitEvent_custom(ryw_Event.RefreshUnLockGame); } public static subUnLockGameNameTab(gameName) { let tab = User._gameData_custom.unLockGameNameTab if (tab.indexOf(gameName) > -1) { tab.splice(tab.indexOf(gameName), 1) } GameMgr.getInstance_custom().saveGameData_custom(); EventMgr.emitEvent_custom(ryw_Event.RefreshUnLockGame); } public static getUnLockGameNameTab() { return User._gameData_custom.unLockGameNameTab; } public static setCurSaveStockDay(curDay) { //console.log("保存全部股票数据==",stockConfig) User._gameData_custom.curSaveStockDay = curDay } public static getCurSaveStockDay() { return User._gameData_custom.curSaveStockDay; } public static setTomorrowStockData(stockConfig) { //console.log("保存全部股票数据==",stockConfig) User._gameData_custom.tomorrowStockData = stockConfig } public static getTomorrowStockData() { return User._gameData_custom.tomorrowStockData; } public static setStocksData(stockConfig) { //console.log("保存全部股票数据==",stockConfig) User._gameData_custom.stocksData = stockConfig } public static getStocksData() { return User._gameData_custom.stocksData; } public static setMyStockData(myStockConfig) { //console.log("保存我的股票数据==",myStockConfig) let stockName = myStockConfig.stockName if (!User._gameData_custom.myStockData[myStockConfig.stockName]) { User._gameData_custom.myStockData[stockName] = {} } User._gameData_custom.myStockData[stockName]["stockName"] = myStockConfig.stockName User._gameData_custom.myStockData[stockName]["buyPrice"] = myStockConfig.buyPrice User._gameData_custom.myStockData[stockName]["prossess"] = myStockConfig.prossess } public static getMyStockData() { return User._gameData_custom.myStockData; } public static setMyStockDatCovre(myStockData, save = true) { User._gameData_custom.myStockData = myStockData; if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getStockFreeNum() { return User._gameData_custom.stockFreeNum; } public static setStockFreeNum(num) { User._gameData_custom.stockFreeNum = num; GameMgr.getInstance_custom().saveGameData_custom(); } public static getCiShanChouJiangNum() { return User._gameData_custom.cishanchoujiangNum; } public static setCiShanChouJiangNum(num) { User._gameData_custom.cishanchoujiangNum = num; GameMgr.getInstance_custom().saveGameData_custom(); } public static getCiShanChouJiangTime() { return User._gameData_custom.cishanchoujiangTime; } public static setCiShanChouJiangTime(num) { User._gameData_custom.cishanchoujiangTime = num; GameMgr.getInstance_custom().saveGameData_custom(); } //caicha_data 种菜模块 public static setCaiChaData(caicha_data) { // console.error(caicha_data, 'caicha_data+++++++++====') User._gameData_custom.caicha_data = caicha_data; GameMgr.getInstance_custom().saveGameData_custom(); } public static getCaiChaData() { return User._gameData_custom.caicha_data; } public static setBuyBuildings(buyBuildings) { User._gameData_custom.buyBuildings = buyBuildings; GameMgr.getInstance_custom().saveGameData_custom(); } public static getBuyBuildings() { return User._gameData_custom.buyBuildings; } /** * * @param maxNum 总数 * @param id 游戏标识 * @param unLockTab 已解锁人物索引 * @param zhaoMuTime 增加的招募时间 * @param zhaoMuBeiShu 当前招募倍数 */ public static setMeiNvZhaoMuData(maxNum, id, unLockTab, zhaoMuTime, zhaoMuBeiShu) { let tab = User._gameData_custom.meiNvZhaoMuData // let maxTime = 0 for (var i = 0; i < maxNum; i++) { if (!tab[i] || tab[i].length == 0) { tab[i] = {} tab[i].unLockTab = [] tab[i].zhaoMuTime = 0 tab[i].zhaoMuBeiShu = 1 } } tab[id].unLockTab = unLockTab tab[id].zhaoMuTime = zhaoMuTime tab[id].zhaoMuBeiShu = zhaoMuBeiShu User._gameData_custom.meiNvZhaoMuData = tab GameMgr.getInstance_custom().saveGameData_custom(); } public static getMeiNvZhaoMuData(maxNum) { let tab = User._gameData_custom.meiNvZhaoMuData for (var i = 0; i < maxNum; i++) { if (!tab[i] || tab[i].length == 0) { tab[i] = {} tab[i].unLockTab = [] tab[i].zhaoMuTime = 0 tab[i].zhaoMuBeiShu = 1 } } return User._gameData_custom.meiNvZhaoMuData; } public static updateZhaoMuTime(maxNum) { let tab = User._gameData_custom.meiNvZhaoMuData for (var i = 0; i < maxNum; i++) { if (!tab[i] || tab[i].length == 0) { tab[i] = {} tab[i].unLockTab = [] tab[i].zhaoMuTime = 0 tab[i].zhaoMuBeiShu = 1 } if (tab[i].zhaoMuTime <= 0) { tab[i].unLockTab = [] tab[i].zhaoMuTime = 0 tab[i].zhaoMuBeiShu = 1 } else { tab[i].zhaoMuTime -= 1 } } User._gameData_custom.meiNvZhaoMuData = tab // GameMgr.getInstance_custom().saveGameData_custom(); } // public static setIndustryList(list,save=true) { // User._gameData_custom.industryList = list // if(save){ // GameMgr.getInstance_custom().saveGameData_custom(); // } // } // public static getIndustryList() { // return User._gameData_custom.industryList; // } // public static updateProvideMoneyArray() { // for(let i = User._gameData_custom.provideMoneyArray.length-1; i>=0; i--){ // let config = User._gameData_custom.provideMoneyArray[i] // if(config.isHuanwan){ // User._gameData_custom.provideMoneyArray.splice(i,1) // } // } // //console.log(User._gameData_custom.provideMoneyArray,'2====updateProvideMoneyArray=====') // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static setProvideMoneyArray(obj) { // User._gameData_custom.provideMoneyArray.push(obj) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getProvideMoneyArray() { // return User._gameData_custom.provideMoneyArray; // } // public static clearProvideMoneyArray() { // User._gameData_custom.provideMoneyArray =[]; // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static setBaoweiData(BaoweiData,save=true){ // User._gameData_custom.BaoweiData = BaoweiData // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getBaoweiData(){ // return User._gameData_custom.BaoweiData // } //鉴定次数appraisalIndex // public static setAppraisalIndex(cishu){ // User._gameData_custom.appraisalIndex = cishu; // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getAppraisalIndex(){ // return User._gameData_custom.appraisalIndex; // } // public static setTodayAntiqueIdList(list){ // User._gameData_custom.todayAntiqueIdList = list; // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getTodayAntiqueIdList(){ // return User._gameData_custom.todayAntiqueIdList; // } // public static setRoomGoodStatus(num, save = true) { // User._gameData_custom.roomGoodStatus = num; // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getRoomGoodStatus() { // return User._gameData_custom.roomGoodStatus; // } // public static setYunshiChallenge(YunshiChallenge){ // User._gameData_custom.YunshiChallenge = YunshiChallenge // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getYunshiChallenge(){ // return User._gameData_custom.YunshiChallenge; // } // public static setSanXianGuiDongFreeNum(num){ // User._gameData_custom.sanXianGuiDongFreeNum = num // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getSanXianGuiDongFreeNum(){ // return User._gameData_custom.sanXianGuiDongFreeNum; // } // public static setSanXianGuiDongVDTime(num){ // User._gameData_custom.sanXianGuiDongVDTime = num // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getSanXianGuiDongVDTime(){ // return User._gameData_custom.sanXianGuiDongVDTime; // } // public static setCurSaveFangChanDay(curDay){ // //console.log("保存全部股票数据==",FangChanConfig) // User._gameData_custom.curSaveFangChanDay = curDay // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getCurSaveFangChanDay() { // return User._gameData_custom.curSaveFangChanDay; // } // public static setTomorrowFangChanData(FangChanConfig){ // //console.log("保存全部股票数据==",FangChanConfig) // User._gameData_custom.tomorrowFangChanData = FangChanConfig // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getTomorrowFangChanData() { // return User._gameData_custom.tomorrowFangChanData; // } // public static setFangChansData(FangChanConfig){ // //console.log("保存全部股票数据==",FangChanConfig) // User._gameData_custom.FangChansData = FangChanConfig // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getFangChansData() { // return User._gameData_custom.FangChansData; // } // public static setMyFangChanData(myFangChanConfig,save=true){ // //console.log("保存我的股票数据==",myFangChanConfig) // let FangChanName = myFangChanConfig.FangChanName // if(!User._gameData_custom.myFangChanData[myFangChanConfig.FangChanName]){ // User._gameData_custom.myFangChanData[FangChanName] = {} // } // User._gameData_custom.myFangChanData[FangChanName]["FangChanName"] = myFangChanConfig.FangChanName // User._gameData_custom.myFangChanData[FangChanName]["buyPrice"] = myFangChanConfig.buyPrice // User._gameData_custom.myFangChanData[FangChanName]["prossess"] = myFangChanConfig.prossess // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getMyFangChanData() { // return User._gameData_custom.myFangChanData; // } // public static setIsStartTask505(bTrue){ // User._gameData_custom.isStartTask505 = bTrue // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getIsStartTask505() { // return User._gameData_custom.isStartTask505; // } // public static setTreeUnlockIndex(num, save = true) { // User._gameData_custom.treeUnlockIndex = num // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getTreeUnlockIndex() { // return User._gameData_custom.treeUnlockIndex; // } // public static setChongFanHaoMenTimes(num, save = true) { // User._gameData_custom.ChongFanHaoMenTimes = num // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getChongFanHaoMenTimes() { // return User._gameData_custom.ChongFanHaoMenTimes; // } // public static setChongFanHaoMenPeriod(num){ // User._gameData_custom.ChongFanHaoMenPeriod = num // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getChongFanHaoMenPeriod() { // return User._gameData_custom.ChongFanHaoMenPeriod; // } // public static setJieSuoBaseIQ(typeStr, num) { // let tab = User._gameData_custom.jieSuoBaseIQ // tab[typeStr] = num // User._gameData_custom.jieSuoBaseIQ = tab // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getJieSuoBaseIQ(typeStr) { // let tab = User._gameData_custom.jieSuoBaseIQ // let num = tab[typeStr] // return num // } // public static getALlJieSuoBaseIQ() { // return User._gameData_custom.jieSuoBaseIQ // } // public static setALlJieSuoBaseIQ(tab, save = true) { // User._gameData_custom.jieSuoBaseIQ = tab // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static setSanXianGuiDongRateIndex(num){ // User._gameData_custom.sanXianGuiDongRateIndex = num // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getSanXianGuiDongRateIndex() { // return User._gameData_custom.sanXianGuiDongRateIndex; // } //设置当前任务索引(用于计算玩法还需多少任务解锁) public static setCurTaskIndex(num) { User._gameData_custom.curTaskIndex = num GameMgr.getInstance_custom().saveGameData_custom(); } public static getCurTaskIndex() { return User._gameData_custom.curTaskIndex; } //玩法累计产生收益 public static addShouYiMoneyCount(gameStr, num) { let tab = User._gameData_custom.shouYiMoneyCount if (!tab[gameStr]) { tab[gameStr] = 0 } tab[gameStr] += num // GameMgr.getInstance_custom().saveGameData_custom(); } public static setShouYiMoneyCount(gameStr, num) { let tab = User._gameData_custom.shouYiMoneyCount tab[gameStr] = num GameMgr.getInstance_custom().saveGameData_custom(); } public static getShouYiMoneyCount(gameStr) { let tab = User._gameData_custom.shouYiMoneyCount if (!tab[gameStr]) { tab[gameStr] = 0 } return tab[gameStr] } public static getAllGameShouYi() { return User._gameData_custom.shouYiMoneyCount } public static setAllGameShouYi(tab, save = true) { User._gameData_custom.shouYiMoneyCount = tab if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getGuWanShiChangIndex() { return User._gameData_custom.guWanShiChangIndex } public static setGuWanShiChangIndex(index, save = true) { User._gameData_custom.guWanShiChangIndex = index if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static setNixiHetongNumArray(num) { User._gameData_custom.nixiHetongNum = num GameMgr.getInstance_custom().saveGameData_custom(); } public static getNixiHetongNumArray() { return User._gameData_custom.nixiHetongNum; } public static setKaiKuangFreeNum(num) { User._gameData_custom.kaiKuangFreeNum = num GameMgr.getInstance_custom().saveGameData_custom(); } public static getKaiKuangFreeNum() { return User._gameData_custom.kaiKuangFreeNum; } public static setKaikuangNum(kaikuangNum) { User._gameData_custom.kaikuangNum += kaikuangNum; GameMgr.getInstance_custom().saveGameData_custom(); } public static getKaikuangNum() { return User._gameData_custom.kaikuangNum } public static setCurDayMountingArr(arr) { User._gameData_custom.curDayMountingArr = arr; GameMgr.getInstance_custom().saveGameData_custom(); } public static getCurDayMountingArr() { return User._gameData_custom.curDayMountingArr } public static setCurTaskKaiKuangID(arr) { User._gameData_custom.curTaskKaiKuangID = arr; GameMgr.getInstance_custom().saveGameData_custom(); } public static getCurTaskKaiKuangID() { return User._gameData_custom.curTaskKaiKuangID } public static setCurDayWaterArr(arr) { User._gameData_custom.curDayWaterArr = arr; //GameMgr.getInstance_custom().saveGameData_custom(); } public static getCurDayWaterArr() { return User._gameData_custom.curDayWaterArr } // public static setAutoHeChangLeftTime(leftTime,save=true){ // User._gameData_custom.autoHeChangLeftTime = leftTime; // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getAutoHeChangLeftTime(){ // return User._gameData_custom.autoHeChangLeftTime // } // public static setAutoHeChangYuanbao(autoHeChangYuanbao,save=true){ // User._gameData_custom.autoHeChangYuanbao = autoHeChangYuanbao; // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getAutoHeChangYuanbao(){ // return User._gameData_custom.autoHeChangYuanbao // } public static setIsChongFanHaoMen(bTrue, save = true) { User._gameData_custom.isChongFanHaoMen = bTrue; if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getIsChongFanHaoMen() { return User._gameData_custom.isChongFanHaoMen } public static setJinBiYuanBaoShowStatus(status, save = true) { User._gameData_custom.jinBiYuanBaoShowStatus = status; EventMgr.emitEvent_custom(ryw_Event.updateJinBiYuanBaoStatus); if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getJinBiYuanBaoShowStatus() { return User._gameData_custom.jinBiYuanBaoShowStatus } public static setIsNeedJiuGuanGuide(bTrue) { User._gameData_custom.isNeedJiuGuanGuide = bTrue; GameMgr.getInstance_custom().saveGameData_custom(); } public static getIsNeedJiuGuanGuide() { return User._gameData_custom.isNeedJiuGuanGuide } public static setChaChangList(list) { User._gameData_custom.chaChangList = list GameMgr.getInstance_custom().saveGameData_custom(); } public static getChaChangList() { return User._gameData_custom.chaChangList; } public static setChaChangZhaoMuData(unLockTab, zhaoMuTime, zhaoMuBeiShu) { let tab = User._gameData_custom.chaChangZhaoMuData tab.unLockTab = unLockTab tab.zhaoMuTime = zhaoMuTime tab.zhaoMuBeiShu = zhaoMuBeiShu User._gameData_custom.chaChangZhaoMuData = tab GameMgr.getInstance_custom().saveGameData_custom(); } public static getChaChangZhaoMuData() { return User._gameData_custom.chaChangZhaoMuData; } public static updateChaChangZhaoMuTime() { let tab = User._gameData_custom.chaChangZhaoMuData if (tab.zhaoMuTime <= 0) { tab.zhaoMuTime = 0 tab.unLockTab = [] tab.zhaoMuBeiShu = 1 } else { tab.zhaoMuTime -= 1 } User._gameData_custom.chaChangZhaoMuData = tab // GameMgr.getInstance_custom().saveGameData_custom(); } // public static setIsFinishTask540(bTrue,save=true){ // User._gameData_custom.isFinishTask540 = bTrue; // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getIsFinishTask540(){ // return User._gameData_custom.isFinishTask540 // } // public static setYeLianChangZhaoMuData(unLockTab,zhaoMuTime,zhaoMuBeiShu){ // let tab = User._gameData_custom.yeLianChangZhaoMuData // tab.unLockTab = unLockTab // tab.zhaoMuTime = zhaoMuTime // tab.zhaoMuBeiShu = zhaoMuBeiShu // User._gameData_custom.yeLianChangZhaoMuData = tab // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getYeLianChangZhaoMuData(){ // return User._gameData_custom.yeLianChangZhaoMuData; // } // public static updateYeLianChangZhaoMuTime(){ // let tab = User._gameData_custom.yeLianChangZhaoMuData // if(tab.zhaoMuTime <= 0){ // tab.zhaoMuTime = 0 // tab.unLockTab = [] // tab.zhaoMuBeiShu = 1 // }else{ // tab.zhaoMuTime -= 1 // } // User._gameData_custom.yeLianChangZhaoMuData = tab // // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static setBaiCaoJiList(list){ // User._gameData_custom.baiCaoJiList = list // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getBaiCaoJiList(){ // return User._gameData_custom.baiCaoJiList; // } // public static setGuShuList(list){ // User._gameData_custom.guShuList = list // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getGuShuList(){ // return User._gameData_custom.guShuList; // } // public static setBaiCaoJiShuoMingUnlock(bLock,save=true){ // User._gameData_custom.baiCaoJiShuoMingUnlock = bLock // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getBaiCaoJiShuoMingUnlock(){ // return User._gameData_custom.baiCaoJiShuoMingUnlock; // } // public static setNewRoomStatus(num,save=true){ // User._gameData_custom.newRoomStatus = num; // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getNewRoomStatus(){ // return User._gameData_custom.newRoomStatus; // } // public static setXiaoYanZhanChangStatus(num,save=true){ // User._gameData_custom.xiaoYanZhanChangStatus = num; // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getXiaoYanZhanChangStatus(){ // return User._gameData_custom.xiaoYanZhanChangStatus; // } // public static setIsFinishTask546(bTrue,save=true){ // User._gameData_custom.isFinishTask546 = bTrue; // if (save) // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getIsFinishTask546(){ // return User._gameData_custom.isFinishTask546 // } public static setJiaLiGongFreeNum(num) { User._gameData_custom.jiaLiGongFreeNum = num; GameMgr.getInstance_custom().saveGameData_custom(); } public static getJiaLiGongFreeNum() { return User._gameData_custom.jiaLiGongFreeNum } // public static setQingWangLingBaoXiangStatus(maxLength,id,bStatus){ // let tab = User._gameData_custom.qingWangLingBaoXiangStatus // for(let i=0;i= 0) { // } else { // tab.push(id) // } // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static setZhiNengTaskId(info) { // User._gameData_custom.finishZhiNengTaskId = info // GameMgr.getInstance_custom().saveGameData_custom(); // } // public static getCurZhiNengTaskId() { // //0或者1 // return User._gameData_custom.finishZhiNengTaskId // } public static setMeiZhuangUnLock(id, num) { let tab = User._gameData_custom.meiZhuangUnLock tab[id] = num GameMgr.getInstance_custom().saveGameData_custom(); } public static getMeiZhuangUnLock() { return User._gameData_custom.meiZhuangUnLock } public static setCaiDanStatus(id, index) { let tab = User._gameData_custom.caiDanStatusTab tab[id] = index GameMgr.getInstance_custom().saveGameData_custom(); } public static getCaiDanStatus(id) { let tab = User._gameData_custom.caiDanStatusTab if (!tab[id]) { tab[id] = 0 } return tab[id] } public static setAllCaiDanStatus(arr) { User._gameData_custom.caiDanStatusTab = arr GameMgr.getInstance_custom().saveGameData_custom(); } public static getAllCaiDanStatus() { return User._gameData_custom.caiDanStatusTab } public static setQieLevel(level: number, save = true) { User._gameData_custom.qieLevel = level; if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getQieLevel() { return User._gameData_custom.qieLevel; } public static setHuangjinGouTime(huangjinGouTime) { User._gameData_custom.huangjinGouTime = huangjinGouTime } public static getHuangjinGouTime() { return User._gameData_custom.huangjinGouTime } public static updateHuangjinGouTime() { if (User._gameData_custom.huangjinGouTime > 0) { User._gameData_custom.huangjinGouTime -= 1 } } public static setFishDataAndGentQuat(list, num = -1, save = true) { User._gameData_custom.saveFishDataList = list; //console.log("设置鱼的数据", list); if (num != -1) { User._gameData_custom.generateFishQuantity = num; //console.log("设置鱼的数量", num); } //if (save) //GameMgr.getInstance_custom().saveGameData_custom(); } public static getSaveFishDataList() { return User._gameData_custom.saveFishDataList } public static getGenerateFishQuantity() { return User._gameData_custom.generateFishQuantity } public static setShowFishDataList(list, save = true) { User._gameData_custom.showFishDataList = list; //if (save) //GameMgr.getInstance_custom().saveGameData_custom(); } public static setShowFishQuantity(num, save = true) { User._gameData_custom.showFishQuantity = num; //if (save) //GameMgr.getInstance_custom().saveGameData_custom(); } public static getShowFishDataList() { return User._gameData_custom.showFishDataList } public static getShowFishQuantity() { return User._gameData_custom.showFishQuantity } public static setTreeLevel(num, save = true) { User._gameData_custom.treeLevel = num; if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getTreeLevel() { return User._gameData_custom.treeLevel; } public static setRoomBtnIndex(index) { User._gameData_custom.roomBtnIndex = index; GameMgr.getInstance_custom().saveGameData_custom(); } public static getRoomBtnIndex() { return User._gameData_custom.roomBtnIndex } public static setCaiShangChallengeVD(CaiShangChallengeVD) { User._gameData_custom.CaiShangChallengeVD = CaiShangChallengeVD; GameMgr.getInstance_custom().saveGameData_custom(); } public static getCaiShangChallengeVD() { return User._gameData_custom.CaiShangChallengeVD; } public static setCaiShangChallengeNum(CaiShangChallengeNum) { User._gameData_custom.CaiShangChallengeNum = CaiShangChallengeNum; GameMgr.getInstance_custom().saveGameData_custom(); } public static getCaiShangChallengeNum() { return User._gameData_custom.CaiShangChallengeNum; } public static setCaiShangChallenge(CaiShangChallenge) { User._gameData_custom.CaiShangChallenge = CaiShangChallenge GameMgr.getInstance_custom().saveGameData_custom(); } public static getCaiShangChallenge() { return User._gameData_custom.CaiShangChallenge; } public static setBaDaCaiXiUnlockStatus(tab) { User._gameData_custom.baDaCaiXiUnlockStatus = tab GameMgr.getInstance_custom().saveGameData_custom(); } public static getBaDaCaiXiUnlockStatus() { return User._gameData_custom.baDaCaiXiUnlockStatus; } public static setBaDaCaiXiInfo(info) { User._gameData_custom.baDaCaiXiLevelInfo = info GameMgr.getInstance_custom().saveGameData_custom(); } public static setBaDaCaiXiLevelInfo(id, level) { let tab = User._gameData_custom.baDaCaiXiLevelInfo for (let i = 0; i < 8; i++) { if (!tab[i]) { tab[i] = { level: 1 } } } tab[id].level = level GameMgr.getInstance_custom().saveGameData_custom(); } public static getBaDaCaiXiLevelInfo() { let tab = User._gameData_custom.baDaCaiXiLevelInfo for (let i = 0; i < 8; i++) { if (!tab[i]) { tab[i] = { level: 1 } } } return tab; } public static addIsZhuiJiaTouZiArr(index) { if (User._gameData_custom.isZhuiJiaTouZiArr.indexOf(index) < 0) { User._gameData_custom.isZhuiJiaTouZiArr.push(index) } GameMgr.getInstance_custom().saveGameData_custom(); } public static getIsZhuiJiaTouZiArr(index) { if (User._gameData_custom.isZhuiJiaTouZiArr.indexOf(index) < 0) { return false } else { return true } } public static setLiXianTime(num) { User._gameData_custom.liXianTime = num GameMgr.getInstance_custom().saveGameData_custom(); } public static getLiXianTime() { return User._gameData_custom.liXianTime; } public static setMaoYiFenHongTimes(num) { User._gameData_custom.maoYiFenHongTimes = num GameMgr.getInstance_custom().saveGameData_custom(); } public static getMaoYiFenHongTimes() { return User._gameData_custom.maoYiFenHongTimes; } // diaoyu_data 钓鱼模块 public static setDiaoyuData(diaoyu_data, save = true) { User._gameData_custom.diaoyu_data = diaoyu_data; if (save) GameMgr.getInstance_custom().saveGameData_custom(); } public static getDiaoyuData() { return User._gameData_custom.diaoyu_data; } public static restartGame() { console.log('restartGame') User._gameData_custom.dadianListGame.length = 0 // User._gameData_custom.lastOnlineTime = (new Date()).getDay() User._gameData_custom.headImg = "headImg1"; User._gameData_custom.chatImgIndex = 1 User._gameData_custom.headImgUnlock = ["headImg1"]; User._gameData_custom.money = 5000 User._gameData_custom.userIQ = 50 User._gameData_custom.yuanBao = 0 User._gameData_custom.day = 1 User._gameData_custom.timeHour = 0 User._gameData_custom.timeMin = 0 User._gameData_custom.isNewDay = false User._gameData_custom.curGameLevelIndex = 0; User._gameData_custom.proper_TiLi = 50; User._gameData_custom.proper_NaoLi = 50; User._gameData_custom.firstIn = true; User._gameData_custom.firstInNew = false; User._gameData_custom.bagGoodsList.length = 0 // User._gameData_custom.bingHuFreeNum = 5; // User._gameData_custom.jlbFreeNum = 5; // User._gameData_custom.jlbStepIndex = 0; User._gameData_custom.pmcFreeNum = 5; // User._gameData_custom.laJiFreeNum = 3; // User._gameData_custom.FanLajiTimeStamp = 0; // User._gameData_custom.BingHuTimeStamp = 0; // User._gameData_custom.isKuaiDiKaiQi.length = 0 // User._gameData_custom.kuaiDiMangHeNum = 4; // User._gameData_custom.ChongWuMangHeNum = 4; User._gameData_custom.ditan_data.length = 0 // User._gameData_custom.kuaiDiMangHeFirstIn = false; User._gameData_custom.ditanSaleGoodsIndex = 0 // User._gameData_custom.shouLiChang_gongJianAd = 0 // User._gameData_custom.shouLiChang_lieQiangAd = 0 // User._gameData_custom.shouLiChang_wangAd = 0 // User._gameData_custom.taofenArray = {tanhuang:0, xichen:0} // User._gameData_custom.diaoyuNum = 0 User._gameData_custom.shouHuoJiList.length = 0 User._gameData_custom.paimaiList.length = 0 // User._gameData_custom.saiCheFreeNum = 3; // User._gameData_custom.diaoyu_data.length = 0; User._gameData_custom.curJuQingUnLockIndex = 'DH_1' User._gameData_custom.curUnLockMainTaskInfo = {} User._gameData_custom.recodeMainTaskInfo = {} User._gameData_custom.curUnLockSubTaskInfo = {} User._gameData_custom.chatRecordData = {} User._gameData_custom.saveGameProgressData_nls = null User._gameData_custom.isFinishCeBianLanAward = false User._gameData_custom.daoyeGoodList.length = 0 User._gameData_custom.daoyeJiaoHuo = false User._gameData_custom.daoyeShuaXin = 0 User._gameData_custom.daoyeIndex = 0 // User._gameData_custom.FengWeiHotelList = []; // User._gameData_custom.FengWeiEarnMoney = {earnMoney:0, xiaofei:0}//显示使用 // User._gameData_custom.FengWeiZhaopin = {isZhaoPin:false, zhaopinLevel:0}// // User._gameData_custom.fengWeiGirlSpineStr = '' // User._gameData_custom.naiNaiStatus = 0 // User._gameData_custom.nianHuoExistIdTab = [] User._gameData_custom.levelNum_Array.length = 0 User._gameData_custom.levelNum = 0 User._gameData_custom.successLevels.length = 0 User._gameData_custom.wordGameAnswerUnlock.length = 0 User._gameData_custom.levelNum_Word_Array.length = 0 DayUnlock.resetData(); User._gameData_custom.dayUnlock = {} User._gameData_custom.canInterGameList.length = 0 // User._gameData_custom.userHeTong = { // buyMengChongGuan: false, buyFengHuangZuYu: false, buyChuShouDaLou: false, buyFengTouDaSha: false, buyPeiXunLou: false, // buyClub: false, buyPaiMaiHang: false, buyBaiMaHuiSuo: false, buyMeiZhuang: false, buyWaiXing: false, buyWangShiChanYe: false, buyXiuXianNongZhuang: false // } // User._gameData_custom.jianZaoLeftTime = 720 // User._gameData_custom.isOpenYanHua = false User._gameData_custom.firstStepIndex = 0 User._gameData_custom.gameGuideStepIndex = 0 User._gameData_custom.unLockGameNameTab = [] User._gameData_custom.curSaveStockDay = -1; User._gameData_custom.tomorrowStockData = {} User._gameData_custom.stocksData = {} User._gameData_custom.myStockData = {} User._gameData_custom.stockFreeNum = 4 // User._gameData_custom.industryList.length = 0 // User._gameData_custom.provideMoneyArray = [ // // {titleStr:'欠款',titleType:0, qiankuanMoney:5000000, xuhuanMoney:10000, shengyuDay:500, isTodayHuanwan:false, isHuanwan:false}, // // {titleStr:'小舅妈',titleType:0, qiankuanMoney:150000, xuhuanMoney:0, shengyuDay:0, isTodayHuanwan:false, isHuanwan:false}, // // {titleStr:'大姑妈',titleType:0, qiankuanMoney:100000, xuhuanMoney:0, shengyuDay:0, isTodayHuanwan:false, isHuanwan:false}, // // {titleStr:'三姨',titleType:0, qiankuanMoney:200000, xuhuanMoney:0, shengyuDay:0, isTodayHuanwan:false, isHuanwan:false}, // // {titleStr:'表妹',titleType:0, qiankuanMoney:150000, xuhuanMoney:0, shengyuDay:0, isTodayHuanwan:false, isHuanwan:false}, // ] // User._gameData_custom.BaoweiData = {buildBlood:1000000000, zhiyuanPeople:1,isQianYue:false} User._gameData_custom.todayAntiqueIdList = []; // User._gameData_custom.appraisalIndex = 5; // // User._gameData_custom.roomGoodStatus = 0 // User._gameData_custom.YunshiChallenge = 0 // User._gameData_custom.sanXianGuiDongFreeNum = 5; // User._gameData_custom.sanXianGuiDongVDTime = 0 // User._gameData_custom.curSaveFangChanDay = -1; // User._gameData_custom.tomorrowFangChanData = {} // User._gameData_custom.FangChansData = {} // User._gameData_custom.myFangChanData = {} // User._gameData_custom.isStartTask505 = false User._gameData_custom.meiNvZhaoMuData = [] // User._gameData_custom.treeUnlockIndex = 1 // User._gameData_custom.ChongFanHaoMenTimes = 86400 // User._gameData_custom.ChongFanHaoMenPeriod = 0 // User._gameData_custom.jieSuoBaseIQ = {} // User._gameData_custom.sanXianGuiDongRateIndex = 0 User._gameData_custom.curTaskIndex = 0 User._gameData_custom.shouYiMoneyCount = {} User._gameData_custom.guWanShiChangIndex = 0 User._gameData_custom.nixiHetongNum = [] User._gameData_custom.kaiKuangFreeNum = 3; User._gameData_custom.kaikuangNum = 0 User._gameData_custom.curDayMountingArr = [] // User._gameData_custom.autoHeChangLeftTime = 0 // User._gameData_custom.autoHeChangYuanbao = 0 User._gameData_custom.isChongFanHaoMen = false User._gameData_custom.jinBiYuanBaoShowStatus = 0 User._gameData_custom.isNeedJiuGuanGuide = true User._gameData_custom.chaChangList = [] User._gameData_custom.chaChangZhaoMuData = { unLockTab: [], zhaoMuTime: 0, zhaoMuBeiShu: 1 } // User._gameData_custom.isFinishTask540 = false // User._gameData_custom.yeLianChangZhaoMuData = {unLockTab:[],zhaoMuTime:0,zhaoMuBeiShu:1} // User._gameData_custom.baiCaoJiList = [] // User._gameData_custom.guShuList = [] // User._gameData_custom.baiCaoJiShuoMingUnlock = false // User._gameData_custom.newRoomStatus = 0 // User._gameData_custom.xiaoYanZhanChangStatus = 0 // User._gameData_custom.isFinishTask546 = false User._gameData_custom.jiaLiGongFreeNum = 1 // User._gameData_custom.qingWangLingBaoXiangStatus = [] // User._gameData_custom.qingQangLingFreeNum = 4 // User._gameData_custom.isFinishTask556 = false // User._gameData_custom.isFinishFKSC = false // User._gameData_custom.isFinishTask567 = false User._gameData_custom.xpzGuideStep = 0 User._gameData_custom.isPropChuiZiFree = true User._gameData_custom.isPropLiuXingFree = true // User._gameData_custom.saveGameProgressData_xpz = null User._gameData_custom.SendPZIndex = 3 // User._gameData_custom.kaiGongSiLevelArray = [0, 0, 0, 0, 0, 0, 0, 0] // User._gameData_custom.kaiGongSiLockArray = [0, 0, 0, 0, 0, 0, 0, 0] // User._gameData_custom.yinshitouziArray = [0, 0, 0, 0, 0] // User._gameData_custom.youTingInfo = [] User._gameData_custom.meiRongYuanFreeNum = 5 // User._gameData_custom.qunYingJiuDianLockArray = [] User._gameData_custom.caicha_data = []; User._gameData_custom.buyBuildings = []; User._gameData_custom.yiMaJiangLockArray = [] User._gameData_custom.finishTaskId = [0, 0] //前面是任务id, 后面是任务完成状态0/1 // User._gameData_custom.finishZhiNengTaskId = [] // User._gameData_custom.jlbewZnNum = 0 User._gameData_custom.meiZhuangUnLock = [-1, -1] User._gameData_custom.caiDanStatusTab = [0, 0, 0] User._gameData_custom.qieLevel = 0 User._gameData_custom.huangjinGouTime = 0 User._gameData_custom.saveFishDataList = [] User._gameData_custom.generateFishQuantity = 3 User._gameData_custom.showFishDataList = [] User._gameData_custom.showFishQuantity = 4 User._gameData_custom.treeLevel = 1 User._gameData_custom.roomBtnIndex = 0 User._gameData_custom.CaiShangChallengeNum = 3 User._gameData_custom.CaiShangChallengeVD = 0 User._gameData_custom.CaiShangChallenge = 0 User._gameData_custom.baDaCaiXiUnlockStatus = { /**need备份*/ ShiPingChang: false, YaoShan: false, YiYao: false, WenYu: false, JingRong: false, WeiLai: false, DianZi: false, WangLuo: false, } User._gameData_custom.baDaCaiXiLevelInfo = [] User._gameData_custom.isZhuiJiaTouZiArr = [] User._gameData_custom.liXianTime = 0 User._gameData_custom.maoYiFenHongTimes = 3 User._gameData_custom.diaoyu_data.length = 0; User._gameData_custom.curDayWaterArr = [] User._gameData_custom.cishanchoujiangNum = 3; User._gameData_custom.cishanchoujiangTime = 0; GameMgr.getInstance_custom().saveGameData_custom(); } }