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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
"use strict";
cc._RF.push(module, 'a68ecDm0gpMlZTTcZLCXXsG', 'hero_upgrade_star_fuse_window');
// Scripts/mod/hero/view/hero_upgrade_star_fuse_window.js
 
"use strict";
 
// --------------------------------------------------------------------
// @author: xxx@syg.com(必填, 创建模块的人员)
// @description:
//     这里是描述这个窗体的作用的
// <br/>Create: 2019-03-01 17:30:23
// --------------------------------------------------------------------
var PathTool = require("pathtool");
 
var HeroConst = require("hero_const");
 
var BaseRole = require("baserole");
 
var HeroEvent = require("hero_event");
 
var HeroController = require("hero_controller");
 
var HeroCalculate = require("hero_calculate");
 
var Hero_upgrade_star_fuseWindow = cc.Class({
  "extends": BaseView,
  ctor: function ctor() {
    this.prefabPath = PathTool.getPrefabPath("hero", "hero_upgrade_star_fuse_window");
    this.viewTag = SCENE_TAG.ui; //该窗体所属ui层级,全屏ui需要在ui层,非全屏ui在dialogue层,这个要注意
 
    this.win_type = WinType.Full; //是否是全屏窗体  WinType.Full, WinType.Big, WinType.Mini, WinType.Tips
 
    this.ctrl = arguments[0];
    this.model = this.ctrl.getModel();
  },
  // 初始化一些配置数据,可以用于声明一些变量之类的
  initConfig: function initConfig() {
    this.attr_list = {
      "1": "atk",
      "2": "hp",
      "3": "def",
      "4": "speed"
    };
    this.cur_camp = 0;
    this.dic_other_selected = {}; // 记录已选id
 
    this.heroBid = 0; //跳转过来 
  },
  // 预制体加载完成之后的回调,可以在这里捕获相关节点或者组件
  openCallBack: function openCallBack() {
    var _this = this;
 
    this.camp_node_nd = this.seekChild("camp_node");
    this.img_select_nd = this.seekChild("img_select");
    this.hero_list_nd = this.seekChild("hero_list");
    this.no_vedio_image_nd = this.seekChild("no_vedio_image");
    this.synthesis_btn_nd = this.seekChild("synthesis_btn");
    this.explain_btn_nd = this.seekChild("explain_btn"); // star
 
    this.star_containder_nd = this.seekChild("star_containder");
    this.star_item_nd = this.seekChild("star_item"); // info
 
    this.camp_icon_sp = this.seekChild("camp_icon", cc.Sprite);
    this.name_lb = this.seekChild("name", cc.Label);
    this.hero_camp_bg_sp = this.seekChild("hero_camp_bg", cc.Sprite);
    this.hero_background_sp = this.seekChild("hero_background", cc.Sprite);
    this.mode_node_nd = this.seekChild("mode_node");
    this.level_txt_lb = this.seekChild("level_txt", cc.Label);
    this.look_btn_nd = this.seekChild("look_btn");
    this.btn_red_nd = this.seekChild("btn_red");
    this.background = this.seekChild("background");
    this.background.scale = FIT_SCALE;
    this.hero_model = new BaseRole();
    this.hero_model.setParent(this.mode_node_nd);
    this.camp_btns = {};
 
    for (var camp_i = 0; camp_i < 6; camp_i++) {
      this.camp_btns[camp_i] = this.camp_node_nd.getChildByName("camp_btn" + camp_i);
      this.camp_btns[camp_i].camp_tag = camp_i;
      var camp_sp = this.camp_btns[camp_i].getComponent(cc.Sprite);
      this.camp_btns[camp_i].on(cc.Node.EventType.TOUCH_END, this.didClickCamp, this);
    }
 
    this.attr_lbs = {};
 
    for (var attr_i = 1; attr_i <= 4; attr_i++) {
      this.attr_lbs[attr_i] = this.seekChild("attr_label" + attr_i, cc.Label);
    }
 
    this.hero_items = {};
 
    var _loop = function _loop(hero_i) {
      item_scale = 1;
      if (hero_i > 1) item_scale = 0.8;
      hero_root = _this.seekChild("hero_root_" + hero_i);
      hero_item = ItemsPool.getInstance().getItem("hero_exhibition_item");
      hero_item.setParent(hero_root);
      hero_item.setScale(item_scale);
      hero_item.setExtendData({
        from_type: HeroConst.ExhibitionItemType.eUpStar,
        scale: item_scale
      });
      hero_item.show();
      hero_item.addCallBack(function (item) {
        this.onClickHeroItem(item, hero_i);
      }.bind(_this)); // hero_item.addCallBack(this.onClickHeroItem.bind(this));
 
      _this.hero_items[hero_i] = hero_item;
    };
 
    for (var hero_i = 1; hero_i <= 4; hero_i++) {
      var item_scale;
      var hero_root;
      var hero_item;
 
      _loop(hero_i);
    }
 
    this.synthesis_btn_nd.on(cc.Node.EventType.TOUCH_END, this.onClickSynBtn.bind(this), this);
    this.look_btn_nd.on(cc.Node.EventType.TOUCH_END, this.onClickLookBtn, this);
    this.explain_btn_nd.on(cc.Node.EventType.TOUCH_END, this.onClickExplainBtn, this);
    this.initHeroList();
  },
  // 注册事件监听的接口,不需要手动调用,如果是使用gcore.GlobalEvent监听,可以直接调用addGlobalEvent
  registerEvent: function registerEvent() {
    // 新增英雄
    this.addGlobalEvent(HeroEvent.Hero_Data_Add, function () {
      this.updateWidgets();
      this.updateCamp(true);
    }.bind(this)); // 删除英雄
 
    this.addGlobalEvent(HeroEvent.Del_Hero_Event, function (hero_list) {
      this.updateWidgets();
      this.updateCamp(true);
    }.bind(this)); // 升星成功
 
    this.addGlobalEvent(HeroEvent.Hero_Data_Update, function (hero_vo) {
      this.updateWidgets();
    }.bind(this));
  },
  // 预制体加载完成之后,添加到对应主节点之后的回调,也就是一个窗体的正式入口,可以设置一些数据了
  openRootWnd: function openRootWnd(params) {
    this.hero_vo = params;
 
    if (params) {
      this.heroBid = params.bid;
    }
 
    this.updateCamp();
    this.updateWidgets();
  },
  // 关闭窗体回调,需要在这里调用该窗体所属controller的close方法没用于置空该窗体实例对象
  closeCallBack: function closeCallBack() {
    this.cleanSelects();
    if (this.item_scrollview) this.item_scrollview.deleteMe();
    this.item_scrollview = null;
 
    if (this.hero_model) {
      this.hero_model.deleteMe();
      this.hero_model = null;
    }
 
    if (this.hero_items) {
      for (var i in this.hero_items) {
        if (this.hero_items[i]) {
          this.hero_items[i].deleteMe();
          this.hero_items[i] = null;
        }
      }
 
      this.hero_items = null;
    }
 
    this.ctrl.openHeroUpgradeStarFuseWindow(false);
  },
  cleanSelects: function cleanSelects() {
    for (var select_i in this.dic_other_selected) {
      var heros = this.dic_other_selected[select_i];
 
      for (var hero_i in heros) {
        heros[hero_i].is_ui_select = false;
        heros[hero_i].is_ui_lock = false;
      }
    }
  },
  updateWidgets: function updateWidgets() {
    if (!this.hero_vo) this.hero_vo = this.fuse_list[0];
    if (!this.hero_vo) return;
    this.hero_cfg = this.hero_vo.base_config; // 背景
 
    var camp_type = this.hero_vo.camp_type || HeroConst.CampType.eWater;
    var bg_res = PathTool.getUIIconPath("bigbg/hero", HeroConst.CampBgRes[camp_type]);
 
    if (!this.bg_res || this.bg_res !== bg_res) {
      this.loadRes(bg_res, function (bg_sf) {
        this.hero_background_sp.spriteFrame = bg_sf;
      }.bind(this));
      this.bg_res = bg_res;
    } // 阵容背景
 
 
    var camp_bg_path = PathTool.getUIIconPath("bigbg/hero", HeroConst.CampBottomBgRes[camp_type]);
    this.loadRes(camp_bg_path, function (camp_bg_sf) {
      this.hero_camp_bg_sp.spriteFrame = camp_bg_sf;
    }.bind(this)); // 动画
 
    this.hero_model.setData(BaseRole.type.partner, this.hero_vo, PlayerAction.show, true);
    this.updateStars(this.hero_vo.star);
    this.name_lb.string = this.hero_cfg.name; // fuse_data.camp_type
    // cc.log("HHHHHHHHHHHHHHHHHHHHH");
    // cc.log(this.hero_cfg);
 
    var camp_res = PathTool.getHeroCampRes(this.hero_cfg.camp_type);
    var common_res_path = PathTool.getUIIconPath("common", camp_res);
    this.loadRes(common_res_path, function (sf_obj) {
      this.camp_icon_sp.spriteFrame = sf_obj;
    }.bind(this)); // 属性
 
    var attr_key = this.hero_vo.bid + "_" + this.hero_vo.star;
    var show_list = this.model.getHeroPokedexByBid(attr_key);
 
    if (show_list) {
      this.level_txt_lb.string = Utils.TI18N("等级:" + show_list.lev);
 
      for (var attr_i in this.attr_list) {
        this.attr_lbs[attr_i].string = show_list[this.attr_list[attr_i]];
      }
    } // 合成材料
 
 
    this.updateHeroItems();
    this.show_hero_vo = this.model.getHeroPokedexByBid(this.hero_vo.bid + "_" + this.hero_vo.star); // this.updateCamp();
 
    this.updateCampRedpoint();
  },
  updateHeroItems: function updateHeroItems() {
    this.dic_other_selected = {};
    this.hero_item_data_list = {}; // 指定的 {10402,4,1} : 10402: 表示bid, 4: 表示星级 1:表示数量
 
    var expend1 = this.hero_vo.star_config.expend1; // 指定的 {10402,4,1} : 10402: 表示bid, 4: 表示星级 1:表示数量
 
    var expend2 = this.hero_vo.star_config.expend2; // 随机的 {1,4,2} : 1 表示阵营  4: 表示星级 2表示数量
 
    var expend3 = this.hero_vo.star_config.expend3;
    var conditions_list = this.conditions_list = {};
    var expend_index = 1;
 
    for (var expend_i in expend1) {
      this.dic_other_selected[expend_index] = [];
      this.hero_item_data_list[expend_index] = this.getHeroData(expend1[expend_i][0], expend1[expend_i][1], expend1[expend_i][2], null, expend_index);
      conditions_list[expend_index] = {};
      conditions_list[expend_index][expend1[expend_i][0]] = {};
      conditions_list[expend_index][expend1[expend_i][0]][expend1[expend_i][1]] = expend1[expend_i][2];
      expend_index++;
    }
 
    for (var expend_i in expend2) {
      this.dic_other_selected[expend_index] = [];
      this.hero_item_data_list[expend_index] = this.getHeroData(expend2[expend_i][0], expend2[expend_i][1], expend2[expend_i][2], null, expend_index);
      conditions_list[expend_index] = {};
      conditions_list[expend_index][expend2[expend_i][0]] = {};
      conditions_list[expend_index][expend2[expend_i][0]][expend2[expend_i][1]] = expend2[expend_i][2];
      expend_index++;
    }
 
    for (var expend_i in expend3) {
      this.dic_other_selected[expend_index] = [];
      this.hero_item_data_list[expend_index] = this.getHeroData(null, expend3[expend_i][1], expend3[expend_i][2], expend3[expend_i][0], expend_index);
      conditions_list[expend_index] = {};
      conditions_list[expend_index][expend3[expend_i][0]] = {};
      conditions_list[expend_index][expend3[expend_i][0]][expend3[expend_i][1]] = expend3[expend_i][2];
      expend_index++;
    }
 
    for (var hero_item_i in this.hero_items) {
      var hero_vo = this.hero_item_data_list[hero_item_i];
 
      if (hero_vo) {
        this.hero_items[hero_item_i].setVisible(true);
        this.hero_items[hero_item_i].setData(hero_vo);
 
        if (hero_vo.bid === 0) {
          // 随机卡头像
          var default_head_id = this.model.getRandomHeroHeadByQuality(hero_vo.star);
          var default_head_path = PathTool.getIconPath("item", default_head_id);
          this.hero_items[hero_item_i].setDefaultHead(default_head_path);
        }
      } else {
        this.hero_items[hero_item_i].setVisible(false);
      }
    }
 
    this.initHeroListByMatchInfo(conditions_list);
    this.updateCentreHeroItemRedPoint();
  },
  getHeroData: function getHeroData(bid, star, count, camp_type, need_index) {
    // 模拟 hero_vo 需要的数据
    var data = {};
    data.star = star || 0;
    data.count = count || 0;
    data.need_index = need_index;
    data.select_count = this.dic_other_selected[need_index].length;
    data.lev = cc.js.formatStr("%s/%s", data.select_count, count);
    data.head_gray = true;
 
    if (!bid) {
      data.bid = 0; //表示随机卡
 
      data.camp_type = camp_type;
    } else {
      var base_config = Config.partner_data.data_partner_base[bid];
 
      if (base_config) {
        data.bid = bid;
        data.camp_type = base_config.camp_type;
      } else {
        return null;
      }
    } // 当前选中的英雄列表 [id] == hero_vo 模式
 
 
    data.dic_select_list = {};
    return data;
  },
  didClickCamp: function didClickCamp(event) {
    var cur_camp = event.target.camp_tag;
    if (cur_camp === this.cur_camp) return;
    this.cur_camp = cur_camp;
    this.img_select_nd.parent = this.camp_btns[cur_camp];
    this.updateCamp();
  },
  initHeroList: function initHeroList() {
    var CommonScrollView = require("common_scrollview");
 
    var scroll_view_size = cc.size(this.hero_list_nd.width, this.hero_list_nd.height);
    var setting = {
      item_class: "hero_exhibition_item",
      // 单元类
      start_x: 0,
      // 第一个单元的X起点
      space_x: 0,
      // x方向的间隔
      start_y: 0,
      // 第一个单元的Y起点
      space_y: 0,
      // y方向的间隔
      item_width: 125,
      // 单元的尺寸width
      item_height: 150,
      // 单元的尺寸height
      col: 5,
      // 列数,作用于垂直滚动类型
      once_num: 5,
      need_dynamic: true
    };
    this.item_scrollview = new CommonScrollView();
    this.item_scrollview.createScroll(this.hero_list_nd, cc.v2(0, 0), ScrollViewDir.vertical, ScrollViewStartPos.top, scroll_view_size, setting, cc.v2(0.5, 0.5));
  },
  onClickHeroExhibiton: function onClickHeroExhibiton(hero_item) {
    if (hero_item && hero_item.data) {
      if (!this.hero_vo || this.hero_vo.bid != hero_item.data.bid) {
        this.cleanSelects();
        this.hero_vo = hero_item.data;
        this.updateWidgets();
      }
    }
  },
  updateCamp: function updateCamp(is_select) {
    this.fuse_list = this.model.getStarFuseList(this.cur_camp);
 
    if (this.fuse_list.length > 0) {
      this.no_vedio_image_nd.active = false;
    } else {
      this.no_vedio_image_nd.active = true;
    }
 
    for (var hero_i = 0; hero_i < this.fuse_list.length; ++hero_i) {
      HeroCalculate.getInstance().checkSingleStarFuseRedPoint(this.fuse_list[hero_i]);
    } // 排序
 
 
    var hero_sort = function hero_sort(role_vo1, role_vo2) {
      var proportion1 = role_vo2.total_count / role_vo2.need_count;
      var proportion2 = role_vo1.total_count / role_vo1.need_count;
 
      if (proportion1 === proportion2) {
        if (role_vo2.camp_type === role_vo1.camp_type) {
          if (role_vo2.star == role_vo1.star) {
            return role_vo1.bid - role_vo2.bid;
          } else {
            return role_vo1.star - role_vo2.star;
          }
        } else {
          return role_vo1.camp_type - role_vo2.camp_type;
        }
      } else {
        return proportion1 - proportion2;
      }
    };
 
    this.fuse_list.sort(hero_sort); // 设置第一英雄为选中
 
    if (!is_select) {
      if (this.heroBid) {
        for (var i = 0; i < this.fuse_list.length; ++i) {
          if (this.fuse_list[i].bid == this.heroBid) {
            this.hero_vo = this.fuse_list[i];
            break;
          }
        }
 
        this.heroBid = 0;
      } else {
        var cur_hero = this.fuse_list[0];
 
        if (!this.hero_vo || this.hero_vo.bid != cur_hero.bid) {
          this.hero_vo = cur_hero;
        }
      }
 
      this.updateWidgets();
    }
 
    this.item_scrollview.setData(this.fuse_list, this.onClickHeroExhibiton.bind(this), {
      can_click: true,
      from_type: HeroConst.ExhibitionItemType.eHeroFuse
    });
  },
  updateStars: function updateStars(star_num) {
    var star_res = "";
    var star_scal = 1;
    this.star_containder_nd.removeAllChildren();
    this.star_containder_nd.width = 0;
 
    if (star_num > 0 && star_num <= 5) {
      star_res = "common_90074";
    } else if (star_num > 5 && star_num <= 9) {
      star_num = star_num - 5;
      star_res = "common_90075";
    } else if (star_num > 9) {
      star_num = 1;
      star_res = "common_90073";
      star_scal = 1.2;
    }
 
    for (var star_i = 0; star_i < star_num; star_i++) {
      var star_nd = cc.instantiate(this.star_item_nd);
      star_nd.scale = star_scal;
      var star_sp = star_nd.getComponent(cc.Sprite);
      var common_res_path = PathTool.getUIIconPath("common", star_res);
      this.loadRes(common_res_path, function (star_sp, sf_obj) {
        star_sp.spriteFrame = sf_obj;
      }.bind(this, star_sp));
      this.star_containder_nd.addChild(star_nd);
    }
  },
  onClickHeroItem: function onClickHeroItem(hero_item, index) {
    cc.log(index);
    this.ctrl.openHeroUpgradeStarSelectPanel(true, hero_item.data, this.dic_other_selected, 1, index == 1, this.updateNeedHero.bind(this));
  },
  // 更新英雄材料
  updateNeedHero: function updateNeedHero(select_info) {
    this.dic_other_selected = select_info;
    this.updateSelectInfo();
    this.updateCentreHeroItemRedPoint();
  },
  updateSelectInfo: function updateSelectInfo(select_info) {
    for (var dic_i in this.dic_other_selected) {
      var cur_item_data = this.hero_item_data_list[dic_i];
      cur_item_data.select_count = this.dic_other_selected[dic_i].length;
      cur_item_data.lev = cc.js.formatStr("%s/%s", cur_item_data.select_count, cur_item_data.count);
 
      if (this.dic_other_selected[dic_i].length > 0) {
        cur_item_data.head_gray = false;
      } else {
        cur_item_data.head_gray = true;
      }
 
      this.hero_items[dic_i].setData(cur_item_data);
    }
  },
  // 英雄材料
  isHeroEnough: function isHeroEnough() {
    for (var need_i in this.hero_item_data_list) {
      if (this.hero_item_data_list[need_i].select_count < this.hero_item_data_list[need_i].count) return false;
    }
 
    return true;
  },
  // 整理合成数据
  getNeedHeroInfo: function getNeedHeroInfo() {
    var hero_list = [];
    var random_list = [];
 
    for (var need_i in this.hero_item_data_list) {
      if (need_i > 1) {
        var need_data = this.hero_item_data_list[need_i];
        var select_vos = this.dic_other_selected[need_i];
 
        for (var hero_i in select_vos) {
          var hero_data = {};
          hero_data.partner_id = select_vos[hero_i].partner_id;
 
          if (need_data.bid === 0) {
            random_list.push(hero_data);
          } else {
            hero_list.push(hero_data);
          }
        }
      }
    }
 
    return {
      hero_list: hero_list,
      random_list: random_list
    };
  },
  onClickSynBtn: function onClickSynBtn() {
    // var request_data = this.getNeedHeroInfo();
    // var syn_partner_id = this.dic_other_selected[1][0].partner_id;
    if (!this.isHeroEnough()) {
      message(Utils.TI18N("所需材料不足"));
    } else {
      var request_data = this.getNeedHeroInfo();
      var syn_partner_id = this.dic_other_selected[1][0].partner_id;
 
      if (syn_partner_id) {
        this.ctrl.sender11005(syn_partner_id, request_data.hero_list, request_data.random_list);
      }
    }
  },
  onClickLookBtn: function onClickLookBtn() {
    cc.log(this.hero_vo);
    HeroController.getInstance().openHeroTipsPanel(true, this.show_hero_vo, true);
  },
  onClickExplainBtn: function onClickExplainBtn(event) {
    var tip_des = Config.partner_data.data_partner_const.game_rule2.desc;
 
    require("tips_controller").getInstance().showCommonTips(tip_des, event.touch.getLocation());
  },
  initHeroListByMatchInfo: function initHeroListByMatchInfo(conditions_list) {
    this.dic_other_selected;
    this.hero_item_data_list; // var hero_list = this.model.getHeroList();
    // this.conditions_hero_list = {};
    // for (var hero_i in hero_list) {
    //     var hero = hero_list[hero_i];
    //     for (var conditions_i in conditions_list) {
    //         var conditions = conditions_list[conditions_i];
    //         if (!this.conditions_hero_list[conditions_i])
    //             this.conditions_hero_list[conditions_i] = []
    //         if (this.hero_item_data_list[conditions_i].bid == 0) {
    //             // 表示随机卡 0表示全部阵营
    //             if (conditions[0]) {
    //                 if (conditions[0][hero.star]) {
    //                     this.conditions_hero_list[conditions_i].push(hero);
    //                 }
    //             } else {
    //                 if (conditions[hero.camp_type] && conditions[hero.camp_type][hero.star])
    //                     this.conditions_hero_list[conditions_i].push(hero);
    //             }
    //         } else {
    //             // 指定卡
    //             if (conditions[hero.bid] && conditions[hero.bid][hero.star])
    //                 this.conditions_hero_list[conditions_i].push(hero);
    //         }
    //     }
    // }
    // cc.log(this.conditions_hero_list);
  },
  // 更新阵容红点
  updateCampRedpoint: function updateCampRedpoint() {},
  // 计算
  updateCentreHeroItemRedPoint: function updateCentreHeroItemRedPoint() {
    // 中间合成按钮红点
    // addRedPointToNodeByStatus(this.synthesis_btn, is_btn_redpoint, 6, 6)
    var can_compose = true;
 
    for (var item_i in this.hero_item_data_list) {
      var is_red = false;
      var item_info = this.hero_item_data_list[item_i];
 
      if (item_info.count != item_info.select_count) {
        can_compose = false;
        is_red = this.haveCanSelect(this.hero_item_data_list[item_i]);
      }
 
      this.hero_items[item_i].showRedPoint(is_red);
    }
 
    if (can_compose) {
      this.btn_red_nd.active = true;
    } else {
      this.btn_red_nd.active = false;
    }
  },
  haveCanSelect: function haveCanSelect(select_hero) {
    var all_hero_list = this.model.getAllHeroArray();
    this.hero_list = [];
 
    if (select_hero.bid === 0) {
      // 不是指定英雄
      for (var hero_i = 0; hero_i < all_hero_list.length; ++hero_i) {
        if (all_hero_list[hero_i].camp_type === select_hero.camp_type || select_hero.camp_type === 0) {
          if (all_hero_list[hero_i].star === select_hero.star && (!this.cur_hero_vo || all_hero_list[hero_i].partner_id !== this.cur_hero_vo.partner_id)) {
            if (!this.isOtherSelect(all_hero_list[hero_i])) this.hero_list.push(all_hero_list[hero_i]);
          }
        }
      }
    } else {
      // 指定英雄
      for (var hero_i = 0; hero_i < all_hero_list.length; ++hero_i) {
        if (all_hero_list[hero_i].bid === select_hero.bid && (!this.cur_hero_vo || all_hero_list[hero_i].partner_id !== this.cur_hero_vo.partner_id)) {
          if (all_hero_list[hero_i].star === select_hero.star) {
            if (!this.isOtherSelect(all_hero_list[hero_i])) this.hero_list.push(all_hero_list[hero_i]);
          }
        }
      }
    } // 是否已经选择
 
 
    for (var hero_i = 0; hero_i < this.hero_list.length; ++hero_i) {
      for (var select_i in this.dic_other_selected) {
        for (var select_hero_i in this.dic_other_selected[select_i]) {
          if (this.dic_other_selected[select_i][select_hero_i].partner_id == this.hero_list[hero_i].partner_id) {
            // this.hero_list.shift(hero_i, 1);
            this.hero_list[hero_i].is_ui_select = true;
            continue;
          }
        }
      }
    }
 
    var num = 0;
 
    for (var hero_i = 0; hero_i < this.hero_list.length; ++hero_i) {
      if (!this.hero_list[hero_i].is_ui_select) num++;
    }
 
    if (num >= select_hero.count) return true;
    return false; // 是否已经上阵或者已经锁定
    // for (var hero_i in this.hero_list) {
    //     if (this.hero_list[hero_i].is_in_form || this.hero_list[hero_i].is_lock) {
    //         this.hero_list[hero_i].is_ui_lock = true;
    //     }
    // }
  },
  isOtherSelect: function isOtherSelect(hero_vo) {
    for (var select_i in this.dic_other_selected) {
      for (var hero_i in this.dic_other_selected[select_i]) {
        var cur_hero_vo = this.dic_other_selected[select_i][hero_i];
 
        if (hero_vo.partner_id === cur_hero_vo.partner_id) {
          return true;
        }
      }
    }
 
    return false;
  }
});
 
cc._RF.pop();