GameModel.ts 22 KB

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