GameModel.ts 22 KB

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