GameModel.ts 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. import { director, _decorator } from 'cc';
  2. import BufferManager from '../../engines/buffers/BufferManager';
  3. import IBuffer from '../../engines/buffers/IBuffer';
  4. import { DataModel } from '../../engines/models/DataModel';
  5. import { DataModelEventType } from '../../engines/models/DataModelEventType';
  6. import { NoticeManager } from '../../engines/notices/NoticeManager';
  7. import { PlatformManager } from '../../Platform/PlatformManager';
  8. import { branchIdType } from '../../Platform/WeChat/branchIdType';
  9. import { WeChatPlatform } from '../../Platform/WeChat/WeChatPlatform';
  10. import AccelerateBuffer from '../buffers/AccelerateBuffer';
  11. import AutoSyntheticBuffer from '../buffers/AutoSyntheticBuffer';
  12. import GameConfigManager from './GameConfigManager';
  13. import { GamePropertys } from './GamePropertys';
  14. import { WeaponCell } from './weapons/WeaponCell';
  15. const { ccclass, property } = _decorator;
  16. export class GameModel extends DataModel {
  17. /**
  18. * 武器格子列表
  19. */
  20. private __weaponCells: WeaponCell[] = [];
  21. /**
  22. * 购买记录
  23. */
  24. private __buyHistory: Map<number, number> = new Map<number, number>();
  25. /**
  26. * 上次空投的时间点
  27. */
  28. lastDropBoxTime:number=0;
  29. constructor() {
  30. super();
  31. }
  32. /**
  33. * 设置默认属性
  34. */
  35. SetDefaultPropertys(): void {
  36. //7日登录
  37. this.signGetRecord=[0,0,0,0,0,0,0];
  38. //第一天
  39. this.signDay=1;
  40. //默认关卡
  41. this.currentLevel = 1;
  42. //默认栅栏
  43. this.currentFenceId = 30001;
  44. //默认最大已合成枪ID
  45. this.synthesisMaxWeaponId = 10101;
  46. this.gold = 0;
  47. this.diamond = 0;
  48. //12个默认格子
  49. let weaponCell: WeaponCell;
  50. for (let index = 0; index < 12; index++) {
  51. weaponCell = new WeaponCell();
  52. weaponCell.cellId = index;
  53. weaponCell.weaponId = index < 2 ? 10101 : -1;
  54. weaponCell.lastOutputTime = 0;
  55. this.__weaponCells.push(weaponCell);
  56. }
  57. //默认武器
  58. this.currentWeaponCellId=this.__weaponCells[0].cellId;
  59. //保存到本地
  60. this.SaveToLoacl();
  61. }
  62. private lastTime: number = 0;
  63. /**
  64. * 计算收益
  65. */
  66. CheckEarnings(): void {
  67. let currentTime: number = director.getCurrentTime();
  68. if (currentTime - this.lastTime < this.earningTime) {
  69. return;
  70. }
  71. this.lastTime = currentTime;
  72. let fullEarnings: number = this.fullEarnings;
  73. if (fullEarnings > 0) {
  74. console.log("产出金币:" + fullEarnings);
  75. this.gold += fullEarnings * (this.earningTime / 1000);
  76. }
  77. if (this.DataChanged) {
  78. this.SaveToLoacl();
  79. }
  80. }
  81. /**
  82. * 每秒总收益
  83. */
  84. get fullEarnings(): number {
  85. let result: number = 0;
  86. this.__weaponCells.forEach(weaponCell => {
  87. if (weaponCell.weaponId >= 0) {
  88. result += weaponCell.weaponConfig.earnings;
  89. }
  90. });
  91. return result;
  92. }
  93. /**
  94. * 收益计算间隔
  95. */
  96. get earningsInterval(): number {
  97. return GameConfigManager.getGlobalValue("earningsInterval");
  98. }
  99. /**
  100. * 收益间隔时间
  101. */
  102. get earningTime(): number {
  103. let bufferList: IBuffer[] = BufferManager.GetBufferGroup("Accelerate");
  104. if (bufferList == null || bufferList.length == 0) {
  105. return this.earningsInterval;
  106. }
  107. let buffer: AccelerateBuffer = bufferList[0] as AccelerateBuffer;
  108. return this.earningsInterval * buffer.rate;
  109. }
  110. /**
  111. * 自动合成武器
  112. */
  113. public AutoSynthetic(max: number = 1): void {
  114. let a: WeaponCell;
  115. let b: WeaponCell;
  116. let synIndex: number = 0;
  117. for (let aIndex = 0; aIndex < this.weaponCells.length; aIndex++) {
  118. a = this.weaponCells[aIndex];
  119. if (a.weaponId < 0 || GameConfigManager.WeaponIsMaxLevel(a.weaponId)) {
  120. continue;
  121. }
  122. for (let bIndex = aIndex + 1; bIndex < this.weaponCells.length; bIndex++) {
  123. b = this.weaponCells[bIndex];
  124. if (b.weaponId < 0 || GameConfigManager.WeaponIsMaxLevel(b.weaponId)) {
  125. continue;
  126. }
  127. //可以合成
  128. if (a.weaponId == b.weaponId) {
  129. this.SynthesisWeapon(a.cellId, b.cellId);
  130. synIndex++;
  131. //如果大于最大数
  132. if (synIndex >= max) {
  133. return;
  134. }
  135. }
  136. }
  137. }
  138. }
  139. private DataChanged: boolean;
  140. DispatchEvent(key: string, data?: any): void {
  141. super.DispatchEvent(key, data);
  142. this.DataChanged = true;
  143. }
  144. get currentWeaponId(): number {
  145. if(this.currentWeaponCell==null){
  146. return -1;
  147. }
  148. return this.currentWeaponCell.weaponId;
  149. }
  150. /**
  151. * 合成武器
  152. * @param sourceCellId
  153. * @param targetCellId
  154. */
  155. public SynthesisWeapon(sourceCellId: number, targetCellId: number): void {
  156. let sourceCell: WeaponCell = this.FindCell(sourceCellId);
  157. let targetCell: WeaponCell = this.FindCell(targetCellId);
  158. if (sourceCell.weaponId != targetCell.weaponId) {
  159. console.error("要合成的武器ID不同!");
  160. return;
  161. }
  162. if (GameConfigManager.WeaponIsMaxLevel(sourceCell.weaponId)) {
  163. console.error("武器已到达最高等级!");
  164. }
  165. let newWeaponId: number = GameConfigManager.GetNextLevelWeaponId(sourceCell.weaponId);
  166. //删除
  167. sourceCell.weaponId = -1;
  168. targetCell.weaponId = newWeaponId;
  169. targetCell.lastOutputTime = director.getCurrentTime();
  170. //对比新枪和老记录的合成枪
  171. let newWeaponConfig = GameConfigManager.GetWeaponConfig(newWeaponId);
  172. let synthesisMaxWeaponConfig = GameConfigManager.GetWeaponConfig(this.synthesisMaxWeaponId);
  173. //新记录
  174. if (newWeaponConfig.level > synthesisMaxWeaponConfig.level) {
  175. this.synthesisMaxWeaponId = newWeaponId;
  176. }
  177. //打点合成最高等级的枪
  178. let weChat = PlatformManager.impl as WeChatPlatform;
  179. if (weChat instanceof WeChatPlatform) {
  180. let level = synthesisMaxWeaponConfig.level;
  181. if (newWeaponConfig.level > synthesisMaxWeaponConfig.level) {
  182. level = newWeaponConfig.level;
  183. }
  184. weChat.branchAnalytics(branchIdType.Synthetic, String(level))
  185. }
  186. if(this.currentWeaponCell!=null){
  187. if(this.currentWeaponCell==sourceCell){
  188. this.currentWeaponCellId=-1;
  189. }else if(this.currentWeaponCell==targetCell){
  190. this.DispatchEvent(DataModelEventType.PROPERTY_CHANGED, GamePropertys.currentWeaponCellId);
  191. }
  192. if(this.currentWeaponCell==null){
  193. this.EquipWeapon(targetCell);
  194. return;
  195. }else if(this.currentWeaponCell.weaponConfig && newWeaponConfig.level > this.currentWeaponCell.weaponConfig.level){//如果比手上的好
  196. this.EquipWeapon(targetCell);
  197. return;
  198. }
  199. }
  200. this.DispatchEvent(DataModelEventType.PROPERTY_CHANGED, GamePropertys.WeaponCell);
  201. }
  202. /**
  203. * 添加一个武器到武器格子
  204. * @param cellId
  205. * @param weaponID
  206. */
  207. public AddWeapon(cellId: number, weaponID: number): void {
  208. for (let index = 0; index < this.__weaponCells.length; index++) {
  209. const element = this.__weaponCells[index];
  210. if (element.cellId == cellId) {
  211. element.weaponId = weaponID;
  212. element.lastOutputTime = director.getCurrentTime();
  213. this.DispatchEvent(DataModelEventType.PROPERTY_CHANGED, GamePropertys.WeaponCell);
  214. return;
  215. }
  216. }
  217. }
  218. /**
  219. * 删除武器
  220. * @param cellId
  221. */
  222. public RemoveWeapon(cellId: number): void {
  223. let cell:WeaponCell=this.FindCell(cellId);
  224. cell.weaponId=-1;
  225. if(cell==this.currentWeaponCell){
  226. this.currentWeaponCellId=-1;
  227. }
  228. this.DispatchEvent(DataModelEventType.PROPERTY_CHANGED, GamePropertys.WeaponCell);
  229. }
  230. /**
  231. * 装配武器
  232. * @param weaponId
  233. */
  234. public EquipWeapon(sourceCell:WeaponCell): void {
  235. this.currentWeaponCellId=sourceCell.cellId;
  236. this.DispatchEvent(DataModelEventType.PROPERTY_CHANGED, GamePropertys.WeaponCell);
  237. }
  238. /**
  239. * 武器空槽位置
  240. */
  241. public get WeaponEmptyCellCount(): number {
  242. let count: number = 0;
  243. this.__weaponCells.forEach(element => {
  244. if (element.weaponId < 0) {
  245. count++;
  246. }
  247. });
  248. return count;
  249. }
  250. /**
  251. * 寻找武器空槽位
  252. */
  253. public FindWeaponEmptyCell(): WeaponCell {
  254. for (let index = 0; index < this.__weaponCells.length; index++) {
  255. const element = this.__weaponCells[index];
  256. if (element.weaponId < 0) {
  257. return element;
  258. }
  259. }
  260. return null;
  261. }
  262. /**
  263. * 当前快捷可购买的武器
  264. */
  265. public get CurrentQuickBuyWeaponId(): number {
  266. return GameConfigManager.GetQuickBuyWeaponId(this.synthesisMaxWeaponId);
  267. }
  268. /**
  269. * 查询购买价格
  270. * @param weapon
  271. */
  272. public GetQuickBuyPrice(): number {
  273. return this.GetWeaponBuyPrice(this.CurrentQuickBuyWeaponId);
  274. }
  275. /**
  276. * 查询购买价格
  277. * @param weaponId
  278. */
  279. public GetWeaponBuyPrice(weaponId: number): number {
  280. //已购买的次数
  281. let buyCount: number = this.GetBuyCount(weaponId);
  282. let weaponConfig: any = GameConfigManager.GetWeaponConfig(weaponId);
  283. //价格
  284. let price: number = weaponConfig.consumeGold;
  285. //系数
  286. let coefficient: number = weaponConfig.coefficient;
  287. if (buyCount < 0) {
  288. buyCount = 0;
  289. }
  290. return Math.floor(price * Math.pow(coefficient, buyCount));
  291. }
  292. /**
  293. * 已购买次数
  294. * @param weaponId
  295. */
  296. public GetBuyCount(weaponId: number): number {
  297. let buyCount: number = 0;
  298. if (this.__buyHistory.has(weaponId)) {
  299. buyCount = this.__buyHistory.get(weaponId);
  300. }
  301. return buyCount;
  302. }
  303. /**
  304. * 购买武器
  305. * @param type 0 金币购买 1钻石购买 2视频购买
  306. * @param weaponId
  307. */
  308. public BuyWeapon(type: number, weaponId: number): boolean {
  309. let price: number;
  310. let weaponConfig: any
  311. //找到空槽位
  312. let weaponCell: WeaponCell = this.FindWeaponEmptyCell();
  313. if (weaponCell == null) {
  314. NoticeManager.ShowPrompt("没有空槽位了!");
  315. return false;
  316. }
  317. if (type == 0) {
  318. price = this.GetWeaponBuyPrice(weaponId);
  319. if (this.gold < price) {
  320. NoticeManager.ShowPrompt("金币不足,不能购买武器!");
  321. return false;
  322. }
  323. //扣钱
  324. let currentGold: number = this.gold;
  325. currentGold -= price;
  326. if (currentGold < 0) {
  327. currentGold = 0;
  328. }
  329. this.gold = currentGold;
  330. //记录购买次数
  331. weaponConfig = GameConfigManager.GetWeaponConfig(weaponId);
  332. let buyCount: number = this.GetBuyCount(weaponId);
  333. buyCount++;
  334. if (buyCount > weaponConfig.frequencyLimit) {
  335. buyCount = weaponConfig.frequencyLimit;
  336. }
  337. this.__buyHistory.set(weaponId, buyCount);
  338. } else if (type == 1) {
  339. let weaponConfig: any = GameConfigManager.GetWeaponConfig(weaponId);
  340. price = weaponConfig.consumeDiamond;
  341. if (this.diamond < price) {
  342. NoticeManager.ShowPrompt("宝石不足,不能购买武器!");
  343. return false;
  344. }
  345. //扣钱
  346. let currentDiamond: number = this.gold;
  347. currentDiamond -= price;
  348. if (currentDiamond < 0) {
  349. currentDiamond = 0;
  350. }
  351. this.diamond = currentDiamond;
  352. }
  353. //发货
  354. this.AddWeapon(weaponCell.cellId, weaponId);
  355. return true;
  356. }
  357. /**
  358. * 通过武器槽ID查找
  359. * @param id
  360. */
  361. public FindCell(id: number): WeaponCell {
  362. for (let index = 0; index < this.__weaponCells.length; index++) {
  363. const element = this.__weaponCells[index];
  364. if (element.cellId == id) {
  365. return element;
  366. }
  367. }
  368. return null;
  369. }
  370. /**
  371. * 武器格子列表
  372. */
  373. public get weaponCells(): WeaponCell[] {
  374. return this.__weaponCells;
  375. }
  376. protected OnReadByLocal(data: any): void {
  377. //7日登录
  378. let date:Date=new Date();
  379. if(date.getTime()-this.lastSignTime>24*60*60*1000){
  380. this.signDay++;
  381. this.lastSignTime=date.getTime();
  382. }
  383. let currentTime: number = director.getCurrentTime();
  384. //武器格子
  385. let weaponCells: any[] = data.weaponCells;
  386. this.__weaponCells = [];
  387. let weaponCell: WeaponCell;
  388. if (weaponCells != null) {
  389. weaponCells.forEach(element => {
  390. weaponCell = new WeaponCell();
  391. for (const key in element) {
  392. if (Object.prototype.hasOwnProperty.call(element, key) && Object.prototype.hasOwnProperty.call(weaponCell, key)) {
  393. const item = element[key];
  394. weaponCell[key] = item;
  395. }
  396. }
  397. weaponCell.lastOutputTime = currentTime;
  398. this.__weaponCells.push(weaponCell);
  399. });
  400. }
  401. //当前武器格
  402. if(this.currentWeaponCellId>0){
  403. this.currentWeaponCell.lastOutputTime = currentTime;
  404. }
  405. //自动合成Buffer剩余时间
  406. if (data.autoSynthesisTime > 0) {
  407. let buffer: AutoSyntheticBuffer = new AutoSyntheticBuffer("AutoSynthesis", data.autoSynthesisTime);
  408. BufferManager.RunBuffer(buffer);
  409. }
  410. //加速Buffer
  411. if (data.accelerateTime > 0) {
  412. let buffer: AccelerateBuffer = new AccelerateBuffer("Accelerate", data.accelerateTime);
  413. BufferManager.RunBuffer(buffer);
  414. }
  415. }
  416. protected OnSaveToLocal(data: any): void {
  417. data.weaponCells = this.__weaponCells;
  418. //自动合成Buffer剩余时间
  419. let buffers: IBuffer[] = BufferManager.GetBufferGroup("AutoSynthesis");
  420. if (buffers != null && buffers.length > 0) {
  421. let buffer: IBuffer = buffers[0];
  422. data.autoSynthesisTime = buffer.GetTimeRemaining();
  423. } else {
  424. data.autoSynthesisTime = 0;
  425. }
  426. //加速Buffer
  427. buffers = BufferManager.GetBufferGroup("Accelerate");
  428. if (buffers != null && buffers.length > 0) {
  429. let accelerateBuffer: AccelerateBuffer = buffers[0] as AccelerateBuffer;
  430. data.accelerateTime = accelerateBuffer.GetTimeRemaining();
  431. } else {
  432. data.accelerateTime = 0;
  433. }
  434. }
  435. /**
  436. * 领取记录
  437. */
  438. get signGetRecord():number[]{
  439. return this.GetProperty(GamePropertys.signGetRecord);
  440. }
  441. set signGetRecord(value:number[]){
  442. this.SetProperty(GamePropertys.signGetRecord,value);
  443. }
  444. /**
  445. * 自动领取奖励
  446. */
  447. AutoSignAward():void{
  448. let index:number=this.GetSignAwardIndex();
  449. this.GetSignAward(index+1);
  450. }
  451. /**
  452. * 领取奖励
  453. * @param day 1-7
  454. */
  455. private GetSignAward(day:number):void{
  456. if(day<1||day>7){
  457. throw new Error("7日索引范围必须在1-7");
  458. }
  459. let state:number=this.GetSignAwardByDay(day);
  460. if(state>0){
  461. throw new Error("重复领取")
  462. }
  463. let list:number[]=this.signGetRecord;
  464. list[day-1]=1;
  465. this.DispatchEvent(DataModelEventType.PROPERTY_CHANGED,GamePropertys.signGetRecord);
  466. //发放奖励
  467. let config:any=GameConfigManager.GetSignConfig(day);
  468. //0.金币 1.钻石 2.枪 3.栅栏
  469. switch (config.type) {
  470. case 0:
  471. this.gold+=config.number;
  472. NoticeManager.ShowPrompt("金币+"+config.number);
  473. break;
  474. case 1:
  475. this.diamond+=config.number;
  476. NoticeManager.ShowPrompt("钻石+"+config.number);
  477. break;
  478. case 2:
  479. let cell:WeaponCell=this.FindWeaponEmptyCell();
  480. if(cell!=null){
  481. this.AddWeapon(cell.cellId,config.number);
  482. }
  483. break;
  484. case 3:
  485. this.currentFenceId=config.number;
  486. break;
  487. }
  488. }
  489. /**
  490. * 获取7日登录领取状态
  491. * @param day 1-7
  492. */
  493. GetSignAwardByDay(day:number):number{
  494. if(day>7){
  495. throw new Error("超出7天")
  496. }
  497. return this.signGetRecord[day-1];
  498. }
  499. /**
  500. * 获取领取奖励的天数索引
  501. */
  502. GetSignAwardIndex():number{
  503. for (let index = 0; index < this.signDay; index++) {
  504. if(this.GetSignAwardByDay(index+1)==0){
  505. let config:any=GameConfigManager.GetSignConfig(index+1);
  506. //0.金币 1.钻石 2.枪 3.栅栏
  507. switch (config.type) {
  508. case 2:
  509. if(this.WeaponEmptyCellCount>0){
  510. return index;
  511. }else{
  512. NoticeManager.ShowPrompt("武器槽没有空位了!");
  513. }
  514. break;
  515. default:
  516. return index;
  517. }
  518. }
  519. }
  520. return -1;
  521. }
  522. private static instance: GameModel;
  523. public static get single(): GameModel {
  524. if (this.instance == null) {
  525. this.instance = new GameModel();
  526. }
  527. return this.instance;
  528. }
  529. /**
  530. * 当前武器格子
  531. */
  532. get currentWeaponCell():WeaponCell{
  533. return this.FindCell(this.currentWeaponCellId);
  534. }
  535. /**
  536. * 当前武器槽ID
  537. */
  538. get currentWeaponCellId(): number {
  539. return this.GetProperty(GamePropertys.currentWeaponCellId);
  540. }
  541. /**
  542. * 当前武器槽ID
  543. */
  544. set currentWeaponCellId(value:number) {
  545. this.SetProperty(GamePropertys.currentWeaponCellId,value);
  546. }
  547. /**
  548. * 自动合成Buffer剩余时间
  549. */
  550. get autoSynthesisTime(): number {
  551. return this.GetProperty(GamePropertys.autoSynthesisTime);
  552. }
  553. /**
  554. * 加速Buffer剩余时间
  555. */
  556. get accelerateTime(): number {
  557. return this.GetProperty(GamePropertys.accelerateTime);
  558. }
  559. /**
  560. * 当前关卡
  561. */
  562. get currentLevel(): number {
  563. return this.GetProperty(GamePropertys.currentLevel);
  564. }
  565. set currentLevel(value: number) {
  566. this.SetProperty(GamePropertys.currentLevel, value);
  567. }
  568. /**
  569. * 试用栅栏ID
  570. */
  571. trialFenceId: number = -1;
  572. /**
  573. * 当前栅栏ID
  574. */
  575. get currentFenceId(): number {
  576. return this.GetProperty(GamePropertys.currentFenceId);
  577. }
  578. set currentFenceId(value: number) {
  579. this.SetProperty(GamePropertys.currentFenceId, value);
  580. }
  581. /**
  582. * 栅栏ID (包括试用)
  583. */
  584. get fenceId(): number {
  585. if (this.trialFenceId > 0) {
  586. return this.trialFenceId;
  587. }
  588. return this.currentFenceId;
  589. }
  590. /**
  591. * 金币
  592. */
  593. get gold(): number {
  594. return this.GetProperty(GamePropertys.gold);
  595. }
  596. set gold(value: number) {
  597. this.SetProperty(GamePropertys.gold, value);
  598. }
  599. /**
  600. * 积分
  601. */
  602. get integral(): number {
  603. return this._interal
  604. }
  605. private _interal: number;
  606. set integral(value: number) {
  607. this._interal = value;
  608. this.DispatchEvent(DataModelEventType.PROPERTY_CHANGED, GamePropertys.integral);
  609. }
  610. /**
  611. * 钻石
  612. */
  613. get diamond(): number {
  614. return this.GetProperty(GamePropertys.diamond);
  615. }
  616. set diamond(value: number) {
  617. this.SetProperty(GamePropertys.diamond, value);
  618. }
  619. /**
  620. * 击杀数量
  621. */
  622. get killCount(): number {
  623. return this.GetProperty(GamePropertys.killCount);
  624. }
  625. set killCount(value: number) {
  626. this.SetProperty(GamePropertys.killCount, value);
  627. }
  628. /**
  629. * 怒气值
  630. */
  631. get angerCount(): number {
  632. return this.GetProperty(GamePropertys.angerCount);
  633. }
  634. set angerCount(value: number) {
  635. this.SetProperty(GamePropertys.angerCount, value);
  636. }
  637. /**
  638. * 当前最大合成等级
  639. */
  640. get synthesisMaxWeaponId(): number {
  641. return this.GetProperty(GamePropertys.synthesisMaxWeaponId);
  642. }
  643. set synthesisMaxWeaponId(value: number) {
  644. this.SetProperty(GamePropertys.synthesisMaxWeaponId, value);
  645. }
  646. /**
  647. * 登录天数
  648. */
  649. get signDay():number{
  650. return this.GetProperty(GamePropertys.signDay);
  651. }
  652. /**
  653. * 登录天数
  654. */
  655. set signDay(value:number){
  656. this.SetProperty(GamePropertys.signDay,value);
  657. }
  658. /**
  659. * 上次登录日期
  660. */
  661. get lastSignTime():number{
  662. return this.GetProperty(GamePropertys.lastSignTime);
  663. }
  664. /**
  665. * 登录天数
  666. */
  667. set lastSignTime(value:number){
  668. this.SetProperty(GamePropertys.lastSignTime,value);
  669. }
  670. }