UserModel.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import { Tablemain_config } from "db://assets/module_basic/table/Tablemain_config";
  2. export class UserModel {
  3. money: number = 0;
  4. nickName: string = 'player'; //昵称
  5. //强制广告间隔次数
  6. forceAdCount: number = 0;
  7. //观看广告获得体力
  8. powerAddByAd: number = 0;
  9. //复活增加时间
  10. reviveAddTime: number = 0;
  11. //嘲讽间隔时间
  12. tauntIntervalTime: number = 0;
  13. //关卡剩余时间不足提示
  14. levelTimeLessTip: number = 0;
  15. //恢复体力时间 5s
  16. powerRecoverTime: number = 1;
  17. //自然恢复体力最大值
  18. powerMax: number = 1;
  19. //当前体力
  20. powerCurrent: number = 0;
  21. //情报免费次数
  22. radarFreeCount: number = 0;
  23. //侦探免费次数
  24. freeScreenShotCount: number = 0;
  25. //开镜后放大后倍率
  26. magnifyRate: number = 1;
  27. mainConfig:Tablemain_config = null;
  28. constructor() {
  29. this.mainConfig = new Tablemain_config();
  30. }
  31. initialize() {
  32. this.money = 0;
  33. this.powerCurrent = 1;
  34. this.powerRecoverTime = this.getPramById(5);
  35. this.powerMax = this.getPramById(4);
  36. this.radarFreeCount = this.getPramById(3);
  37. this.freeScreenShotCount = this.getPramById(2);
  38. this.powerAddByAd = this.getPramById(6);
  39. this.reviveAddTime = this.getPramById(7);
  40. this.tauntIntervalTime = this.getPramById(8);
  41. this.levelTimeLessTip = this.getPramById(9);
  42. this.magnifyRate = this.getPramById(10);
  43. }
  44. getPramById(id: number) {
  45. this.mainConfig.init(id);
  46. const param = this.mainConfig.param;
  47. return param
  48. }
  49. }