UserModel.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. console.log('获取到的magnifyRate:',this.magnifyRate)
  44. }
  45. getPramById(id: number) {
  46. this.mainConfig.init(id);
  47. const param = this.mainConfig.param;
  48. return param
  49. }
  50. }