difenduandada
2024-12-31 34abe6963b344c882358274957f4b992456fee40
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
"use strict";
cc._RF.push(module, 'bf36fCSxdRFY7OOT091JucG', 'limitexercise_model');
// Scripts/mod/limitexercise/limitexercise_model.js
 
"use strict";
 
// --------------------------------------------------------------------
// @author: xxx@syg.com(必填, 创建模块的人员)
// @description:
//      这里填写详细说明,主要填写该模块的功能简要
// <br/>Create: 2019-09-09 19:11:57
// --------------------------------------------------------------------
var LimitexerciseModel = cc.Class({
  "extends": BaseClass,
  ctor: function ctor() {},
  properties: {},
  initConfig: function initConfig() {},
  // --轮次
  getCurrentRound: function getCurrentRound() {
    if (this.limitexercise_data && this.limitexercise_data.round) {
      var round_data = Config.holiday_boss_new_data.data_round_list;
 
      if (round_data && round_data[this.limitexercise_data.round]) {
        return round_data[this.limitexercise_data.round].unit_round;
      }
    }
 
    return 1;
  },
  setLimitExerciseData: function setLimitExerciseData(data) {
    this.limitexercise_data = data;
  },
  setChangeCount: function setChangeCount(count, buy_count) {
    if (this.limitexercise_data && this.limitexercise_data.count != null && this.limitexercise_data.buy_count != null) {
      this.limitexercise_data.count = count;
      this.limitexercise_data.buy_count = buy_count;
    }
  },
  setHeroUseId: function setHeroUseId(data) {
    this.hero_use_list = {};
 
    for (var i = 0; i < data.length; ++i) {
      var v = data[i];
      this.hero_use_list[v.id] = v.count;
    }
  },
  getHeroUseId: function getHeroUseId(id) {
    if (this.hero_use_list && this.hero_use_list[id]) {
      return this.hero_use_list[id];
    }
 
    return 0;
  },
  //难度
  getCurrentDiff: function getCurrentDiff() {
    if (this.limitexercise_data) {
      return this.limitexercise_data.difficulty || 1;
    }
 
    return 1;
  },
  //正在挑战的关卡id
  getCurrentChangeID: function getCurrentChangeID() {
    if (this.limitexercise_data) {
      return this.limitexercise_data.order || 1;
    }
 
    return 1;
  },
  //当前关卡的血量
  getCurrentBossHp: function getCurrentBossHp() {
    if (this.limitexercise_data) {
      return this.limitexercise_data.hp_per || 0;
    }
 
    return null;
  },
  //宝箱状态
  getBoxStatus: function getBoxStatus() {
    if (this.limitexercise_data) {
      return this.limitexercise_data.status || 0;
    }
 
    return 0;
  },
  //关卡类型
  getCurrentType: function getCurrentType() {
    if (this.limitexercise_data) {
      return this.limitexercise_data.order_type || 0;
    }
 
    return null;
  },
  //获取今日购买次数
  getDayBuyCount: function getDayBuyCount() {
    if (this.limitexercise_data) {
      return this.limitexercise_data.buy_count || 0;
    }
 
    return 0;
  },
  //剩余挑战次数
  getReaminCount: function getReaminCount() {
    if (this.limitexercise_data) {
      return this.limitexercise_data.count || 0;
    }
 
    return 0;
  },
  //获取基本数据
  getLimitExerciseData: function getLimitExerciseData() {
    if (this.limitexercise_data) {
      return this.limitexercise_data;
    }
 
    return null;
  }
});
 
cc._RF.pop();