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
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
"use strict";
cc._RF.push(module, 'a3bcfwLWNVDC47bREKmNAmJ', 'battle_form_panel');
// Scripts/mod/battle/view/battle_form_panel.js
 
"use strict";
 
// --------------------------------------------------------------------
// @author: xxx@syg.com(必填, 创建模块的人员)
// @description:
//     这里是描述这个窗体的作用的
// <br/>Create: 2019-03-19 15:05:29
// --------------------------------------------------------------------
var PathTool = require("pathtool");
 
var BattleConst = require("battle_const");
 
var BattleEvent = require("battle_event");
 
var Battle_formPanel = cc.Class({
  "extends": BasePanel,
  ctor: function ctor() {
    this.prefabPath = PathTool.getPrefabPath("battle", "battle_form_view");
  },
  // 可以初始化声明一些变量的
  initConfig: function initConfig() {
    this.rleasePrefab = false;
    this.controller = require("battle_controller").getInstance();
    this.model = this.controller.getModel();
    this.arena_notice_num = 0; // 竞技场挑战次数达到才可以跳过
  },
  // 初始化一些配置数据,可以用于声明一些变量之类的
  initPanel: function initPanel() {
    this.form_container = this.seekChild("form_container");
    var left_btn = this.seekChild(this.form_container, "left_btn");
    var right_btn = this.seekChild(this.form_container, "right_btn");
    this.buff_btn = this.seekChild(this.form_container, "buff_btn");
    this.round_label = this.seekChild(this.form_container, "round_label", cc.Label); // 当前回合数
 
    this.left_icon = this.seekChild(left_btn, "icon", cc.Sprite); // 左边阵法图标
 
    this.right_icon = this.seekChild(right_btn, "icon", cc.Sprite); // 右边阵法图标
 
    this.left_camp_btn = this.seekChild(this.form_container, "left_camp_btn"); // 左边阵营图标
 
    this.right_camp_btn = this.seekChild(this.form_container, "right_camp_btn"); // 右边阵营图标
 
    this.left_name_label = this.seekChild(this.form_container, "left_name_label", cc.Label); // 左边名字
 
    this.right_name_label = this.seekChild(this.form_container, "right_name_label", cc.Label); // 右边名字
 
    this.form_container_Widget = this.form_container.getComponent(cc.Widget);
    this.left_camp_sprite = this.left_camp_btn.getComponent(cc.Sprite);
    this.right_camp_sprite = this.right_camp_btn.getComponent(cc.Sprite);
    this.speed_btn = this.seekChild("speed_btn"); // 速率
 
    this.speed_btn_label = this.seekChild(this.speed_btn, "Label", cc.Label);
    this.guilddun_node = this.seekChild("guilddun_node");
    this.showskill_node = this.seekChild("showskill_node"); // 主动技能展示
 
    this.skill_spine = this.seekChild(this.showskill_node, "spine", sp.Skeleton); // 技能特效
 
    this.skill_head_img = this.seekChild(this.showskill_node, "head", cc.Sprite); // 施法者头像
 
    this.skill_name = this.seekChild(this.showskill_node, "skill_name", cc.Label); // 技能文本
 
    this.pass_btn = this.seekChild("pass_btn"); // 跳过战斗
 
    this.exit_btn = this.seekChild("exit_btn"); // 退出战斗
 
    this.left_camp_top_nd = this.left_camp_btn.getChildByName("top_sp");
    this.left_camp_top_num = this.left_camp_top_nd.getChildByName("top_num_txt").getComponent(cc.Label);
    this.left_camp_bottom_nd = this.left_camp_btn.getChildByName("bottom_sp");
    this.left_camp_bottom_num = this.left_camp_bottom_nd.getChildByName("bottom_num_txt").getComponent(cc.Label);
    this.left_effect_nd = this.left_camp_btn.getChildByName("left_effect_nd");
    this.right_camp_top_nd = this.right_camp_btn.getChildByName("top_sp");
    this.right_camp_top_num = this.right_camp_top_nd.getChildByName("top_num_txt").getComponent(cc.Label);
    this.right_camp_bottom_nd = this.right_camp_btn.getChildByName("bottom_sp");
    this.right_camp_bottom_num = this.right_camp_bottom_nd.getChildByName("bottom_num_txt").getComponent(cc.Label);
    this.right_effect_nd = this.right_camp_btn.getChildByName("right_effect_nd");
  },
  // 注册事件监听的接口,不需要手动调用,如果是使用gcore.GlobalEvent监听,可以直接调用addGlobalEvent
  registerEvent: function registerEvent() {
    Utils.onTouchEnd(this.speed_btn, function () {
      if (this.model.checkIsCanChangeBattleSpeed()) {
        this.model.changeSpeed();
      }
    }.bind(this), 1);
    Utils.onTouchEnd(this.pass_btn, function () {
      if (this.arena_notice_num == 0) {
        this.controller.send20062();
      } else {
        message(cc.js.formatStr(Utils.TI18N("本赛季挑战%s次之后可跳过"), this.arena_notice_num));
      }
    }.bind(this), 1);
    Utils.onTouchEnd(this.left_camp_btn, function () {
      this.controller.openBattleCampView(true, this.left_halo_id);
    }.bind(this), 1);
    Utils.onTouchEnd(this.right_camp_btn, function () {
      this.controller.openBattleCampView(true, this.right_halo_id);
    }.bind(this), 1);
    Utils.onTouchEnd(this.exit_btn, function () {
      this.controller.csFightExit();
    }.bind(this), 1);
    this.buff_btn.on('click', function () {
      var battle_data = this.model.getCurBattleData();
      var left_name = battle_data.actor_role_name;
      var right_name = battle_data.target_role_name;
      var group = this.controller.getModel().getGroup();
 
      if (group == BattleConst.BattleGroupTypeConf.TYPE_GROUP_ENEMY && !this.controller.getWatchReplayStatus()) {
        left_name = data.target_role_name;
        right_name = data.actor_role_name;
      }
 
      this.controller.openBattleBuffInfoView(true, left_name, right_name);
    }, this);
  },
  // 改变速率
  setSpeed: function setSpeed(speed) {
    if (speed == null) {
      speed = 1;
    }
 
    this.speed_btn_label.string = "X" + speed; // 设置场景上的模型和特效的速率
 
    if (speed == 2) {
      this.model.setBattleTimeScale(false);
    } else {
      this.model.setBattleTimeScale(true);
    }
  },
  // 预制体加载完成之后,添加到对应主节点之后的回调可以设置一些数据了
  onShow: function onShow(combat_type) {
    if (combat_type == BattleConst.Fight_Type.Darma) {
      // 根据战斗类型不同,阵法位置不同
      this.form_container_Widget.bottom = 408;
      this.exit_btn.setPosition(595, 900);
    } else {
      this.form_container_Widget.bottom = 160;
      this.exit_btn.setPosition(646, 1150);
    }
 
    this.form_container_Widget.updateAlignment(); // 更新回合数
 
    if (this.update_round_num) {
      this.updateRound(this.update_round_num);
      this.update_round_num = null;
    } // 重置一些特殊显示
 
 
    this.initExtendShowStatus(); // 区分观战以及战斗状态等
 
    if (this.controller.getWatchReplayStatus() == false) {
      if (combat_type == BattleConst.Fight_Type.GuildDun) {
        this.addGuildBossUI(0);
      } else if (combat_type == BattleConst.Fight_Type.PK || combat_type == BattleConst.Fight_Type.HeroTestWar) {
        this.addExitBtnUI();
      } else if (combat_type == BattleConst.Fight_Type.LimitExercise) {
        //试炼之境
        this.addLimitExerciseBossFightUI();
      }
    } else {
      this.addExitBtnUI();
    } // 设置跳过按钮状态
 
 
    this.updatePassBtnStatus(combat_type); // 初始化显示,包括名字,阵容等数据,这个中途不会变化只做一次判断
 
    this.updateBaseInfo(); // 显示初始速率
 
    var speed = this.model.getSpeed();
    this.setSpeed(speed);
  },
  // 初始化一些特殊战斗需要显示的东西
  initExtendShowStatus: function initExtendShowStatus() {
    this.exit_btn.active = false;
    this.guilddun_node.active = false;
    this.guilddun_getlabel = null;
 
    if (this.star_panel) {
      this.star_panel.active = false;
    }
  },
  // 当前回合数
  updateRound: function updateRound(round) {
    if (this.round_label == null) {
      this.update_round_num = round;
    } else {
      var combat_type = this.model.getCombatType();
      if (combat_type == null || combat_type == BattleConst.Fight_Type.Nil) return;
      var config = Config.combat_type_data.data_fight_list[combat_type];
      if (!config) return;
      var total_round = config.max_action_count;
      this.round_label.string = cc.js.formatStr(Utils.TI18N("第%s/%s回合"), round, total_round);
      gcore.GlobalEvent.fire(BattleEvent.UPDATE_ROUND_NUM);
    }
  },
  //更新基础数据,不过在无尽试炼的时候需要额外调用一次 每波可能都不一样
  updateBaseInfo: function updateBaseInfo() {
    if (!this.root_wnd) return;
    var battle_data = this.model.getCurBattleData();
    if (!battle_data) return;
 
    if (battle_data.formation) {
      //更新左右阵法
      this.updateFormIcon(battle_data.formation);
    }
 
    if (battle_data.halo_list) {
      // 更新左右阵营
      this.updateHaloIcon(battle_data.halo_list);
    } // 判断左边是不是队友
 
 
    var left_is_friend = this.model.isFriend(BattleConst.Group_Type.Friend);
 
    if (left_is_friend == true) {
      this.left_name_label.string = battle_data.actor_role_name;
      this.right_name_label.string = battle_data.target_role_name;
    } else {
      this.left_name_label.string = battle_data.target_role_name;
      this.right_name_label.string = battle_data.actor_role_name;
    }
 
    this.buff_btn.opacity = 0;
    this.buff_btn.runAction(cc.fadeIn(0.7));
  },
  // 更新阵法
  updateFormIcon: function updateFormIcon(data_list) {
    if (data_list == null || Object.keys(data_list).length < 2) return;
    var left_form = null;
    var right_form = null;
    var left_is_friend = this.model.isFriend(BattleConst.Group_Type.Friend);
 
    if (left_is_friend) {
      // 如果group==1位队友,则去第一位,否则第二位
      left_form = data_list[1];
      right_form = data_list[2];
    } else {
      left_form = data_list[2];
      right_form = data_list[1];
    }
 
    if (left_form) {
      if (this.left_form_type != left_form.formation_type) {
        this.left_form_type = left_form.formation_type;
        var res_path = PathTool.getBattleFormIcon(this.left_form_type);
        this.loadRes(res_path, function (icon, res_object) {
          icon.spriteFrame = res_object;
        }.bind(this, this.left_icon));
      }
    }
 
    if (right_form) {
      if (this.right_form_type != right_form.formation_type) {
        this.right_form_type = right_form.formation_type;
        var res_path = PathTool.getBattleFormIcon(this.right_form_type);
        this.loadRes(res_path, function (icon, res_object) {
          icon.spriteFrame = res_object;
        }.bind(this, this.right_icon));
      }
    }
  },
  // 更新阵营
  updateHaloIcon: function updateHaloIcon(data_list) {
    if (data_list == null || Object.keys(data_list).length < 2) return;
    this.left_camp_top_nd.active = false;
    this.right_camp_bottom_nd.active = false;
    var left_camp = null;
    var right_camp = null;
 
    for (var key in data_list) {
      var info = data_list[key];
 
      if (info.group == 1) {
        left_camp = info.type;
      } else if (info.group == 2) {
        right_camp = info.type;
      }
    }
 
    var left_halo_id_list = [];
    var right_halo_id_list = []; // this.left_halo_id = left_camp.type;
    // this.right_halo_id = right_camp.type;
    // -- 兼容旧的录像数据,可能发过来的阵营光环id还是旧的,需要转换为新的id
 
    if (left_camp < 100) {
      left_halo_id_list = BattleConst.Old_Halo_Id_Change[left_camp] || [];
    } else {
      var left_id_1 = Math.floor(left_camp / 100);
      var left_id_2 = left_camp % 100;
 
      if (left_id_1 > 0) {
        left_halo_id_list.push(left_id_1);
      }
 
      if (left_id_2 > 0) {
        left_halo_id_list.push(left_id_2);
      }
    }
 
    if (right_camp < 100) {
      right_halo_id_list = BattleConst.Old_Halo_Id_Change[right_camp] || [];
    } else {
      var right_id_1 = Math.floor(right_camp / 100);
      var right_id_2 = right_camp % 100;
 
      if (right_id_1 > 0) {
        right_halo_id_list.push(right_id_1);
      }
 
      if (right_id_2 > 0) {
        right_halo_id_list.push(right_id_2);
      }
    }
 
    var BattleController = require("battle_controller");
 
    if (this.left_camp_btn) {
      var halo_res = PathTool.getUIIconPath("campicon", "campicon_1000");
      var halo_icon_config = BattleController.getInstance().getModel().getCampIconConfigByIds(left_halo_id_list);
      this.left_halo_id = left_halo_id_list;
 
      if (halo_icon_config && halo_icon_config.icon) {
        halo_res = PathTool.getUIIconPath("campicon", "campicon_" + halo_icon_config.icon);
        this.updateHaloEffect(this.left_effect_nd, true);
        var v = halo_icon_config.nums;
        var top_num = v[0];
        var bottom_num = v[1];
 
        if (top_num != null && top_num > 0) {
          this.left_camp_top_num.string = top_num;
          this.left_camp_top_nd.active = true;
        } else {
          this.left_camp_top_nd.active = false;
        }
 
        if (bottom_num != null && bottom_num > 0) {
          this.left_camp_bottom_num.string = bottom_num;
          this.left_camp_bottom_nd.active = true;
        } else {
          this.left_camp_bottom_nd.active = false;
        }
      } else {
        this.left_camp_top_nd.active = false;
        this.left_camp_bottom_nd.active = false;
        this.updateHaloEffect(this.left_effect_nd, false);
      }
 
      if (this.left_camp_res != halo_res) {
        this.left_camp_res = halo_res;
        this.loadRes(halo_res, function (res_object) {
          this.left_camp_sprite.spriteFrame = res_object;
        }.bind(this));
      }
    }
 
    if (this.right_camp_btn) {
      var halo_res = PathTool.getUIIconPath("campicon", "campicon_1000");
 
      var _halo_icon_config = BattleController.getInstance().getModel().getCampIconConfigByIds(right_halo_id_list);
 
      this.right_halo_id = right_halo_id_list;
 
      if (_halo_icon_config && _halo_icon_config.icon) {
        this.updateHaloEffect(this.right_effect_nd, true);
        halo_res = PathTool.getUIIconPath("campicon", "campicon_" + _halo_icon_config.icon);
        var _v = _halo_icon_config.nums;
        var _top_num = _v[0];
        var _bottom_num = _v[1];
 
        if (_top_num != null && _top_num > 0) {
          this.right_camp_top_num.string = _top_num;
          this.right_camp_top_nd.active = true;
        } else {
          this.right_camp_top_nd.active = false;
        }
 
        if (_bottom_num != null && _bottom_num > 0) {
          this.right_camp_bottom_num.string = _bottom_num;
          this.right_camp_bottom_nd.active = true;
        } else {
          this.right_camp_bottom_nd.active = false;
        }
      } else {
        this.updateHaloEffect(this.right_effect_nd, false);
        this.right_camp_bottom_nd.active = false;
        this.right_camp_top_nd.active = false;
      }
 
      if (this.right_camp_res != halo_res) {
        this.right_camp_res = halo_res;
        this.loadRes(halo_res, function (icon, res_object) {
          icon.spriteFrame = res_object;
        }.bind(this, this.right_camp_sprite));
      }
    }
  },
  updateHaloEffect: function updateHaloEffect(node, status) {
    if (status) {
      node.scale = 0.8;
      node.active = true;
      var effect_path = PathTool.getUIIconPath("common", "common_1101");
      this.loadRes(effect_path, function (effect_sp) {
        node.getComponent(cc.Sprite).spriteFrame = effect_sp;
      }.bind(this));
      var fadein_act = cc.fadeIn(0.6);
      var fadeout_act = cc.fadeOut(0.6);
      var halo_act = cc.sequence(fadein_act, fadeout_act);
      var halo_act2 = cc.repeatForever(halo_act);
      node.runAction(halo_act2);
    } else {
      node.active = false;
      node.stopAllActions();
    }
  },
  // 联盟BOSS的时候的伤害统计
  addGuildBossUI: function addGuildBossUI(total_hurt) {
    if (this.guilddun_getlabel == null) {
      this.guilddun_node.active = true;
      this.guilddun_getlabel = this.seekChild(this.guilddun_node, "get_label", cc.Label);
    }
 
    this.guilddun_getlabel.string = total_hurt;
  },
  getStarPanelUI: function getStarPanelUI(callFunc) {
    if (this.root_wnd) {
      if (!this.star_panel) {
        this.loadRes(PathTool.getPrefabPath("battle", "battle_star_panel"), function (cell) {
          this.star_panel = cell;
          this.root_wnd.addChild(cell);
          var star_list = {};
          var desc_txt_list = {};
 
          for (var i = 1; i < 4; ++i) {
            var star = this.star_panel.getChildByName("container").getChildByName("star_" + i);
 
            if (star) {
              star.active = false;
              star_list[i] = star;
            }
 
            var desc_txt = this.star_panel.getChildByName("container").getChildByName("star_desc_" + i).getComponent(cc.Label);
 
            if (desc_txt) {
              desc_txt.string = "";
              desc_txt_list[i] = desc_txt;
            }
          }
 
          callFunc(desc_txt_list, star_list);
        }.bind(this));
      } else {
        this.star_panel.active = true;
        var star_list = {};
        var desc_txt_list = {};
 
        for (var i = 1; i < 4; ++i) {
          var star = this.star_panel.getChildByName("container").getChildByName("star_" + i);
 
          if (star) {
            star.active = false;
            star_list[i] = star;
          }
 
          var desc_txt = this.star_panel.getChildByName("container").getChildByName("star_desc_" + i).getComponent(cc.Label);
 
          if (desc_txt) {
            desc_txt.string = "";
            desc_txt_list[i] = desc_txt;
          }
        }
 
        callFunc(desc_txt_list, star_list);
      }
    }
  },
  addLimitExerciseBossFightUI: function addLimitExerciseBossFightUI() {
    var callFunc = function (desc_txt_list, star_list) {
      if (desc_txt_list && star_list) {
        for (var i = 1; i < 4; ++i) {
          var star = this.star_panel.getChildByName("container").getChildByName("gary_star_" + i);
 
          if (star) {
            star.active = false;
          }
        }
 
        var battle_data = this.model.getCurBattleData();
        var dunge_data = battle_data.extra_args;
 
        if (dunge_data[0] && dunge_data[1] && dunge_data[2] && dunge_data[3]) {
          var round = dunge_data[0].param || 1;
          var diff = dunge_data[1].param || 1;
          var order_type = dunge_data[2].param || 1;
          var order_id = dunge_data[3].param || 1;
          var boss_list = Config.holiday_boss_new_data.data_change_boss_list;
 
          if (boss_list[round] && boss_list[round][diff] && boss_list[round][diff][order_type] && boss_list[round][diff][order_type][order_id]) {
            var config = boss_list[round][diff][order_type][order_id];
 
            if (config) {
              for (var _i = 1; _i <= 3; ++_i) {
                if (desc_txt_list[_i]) {
                  desc_txt_list[_i].node.x = -187;
 
                  if (_i == 1) {
                    desc_txt_list[_i].string = Utils.TI18N("关卡效果:");
                  } else {
                    if (config.add_skill_decs[_i - 2]) {
                      desc_txt_list[_i].string = config.add_skill_decs[_i - 2];
                    }
                  }
                }
              }
            }
          }
        }
      }
    }.bind(this);
 
    this.getStarPanelUI(callFunc);
  },
  // 观战等退出
  addExitBtnUI: function addExitBtnUI() {
    this.exit_btn.active = true;
  },
  // 跳过按钮状态
  updatePassBtnStatus: function updatePassBtnStatus(combat_type) {
    this.arena_notice_num = 0;
 
    if (combat_type == null || this.controller.getWatchReplayStatus()) {
      this.pass_btn.active = false;
      return;
    }
 
    var _config = Config.combat_type_data.data_fight_list[combat_type];
 
    if (_config == null || _config.is_skip != "true") {
      this.pass_btn.active = false;
      return;
    } // 如果是竞技场,则判断次数
 
 
    if (combat_type == BattleConst.Fight_Type.Arena) {
      var count = require("arena_controller").getInstance().getModel().getHadCombatNum(); // 当前已经挑战过的次数
 
 
      var arena_config = Config.arena_data.data_const.arena_skip_count;
 
      if (arena_config == null) {
        this.pass_btn.active = false;
        return;
      } else {
        if (count < arena_config.val) {
          // 这种情况下也需要显示,但是保留计算判断
          this.arena_notice_num = arena_config.val;
        }
      }
    }
 
    this.pass_btn.active = true;
  },
  // 单位主动技能喊招
  showActiveSkillName: function showActiveSkillName(attacker, callback) {
    if (attacker == null || attacker.skill_data == null) {
      if (callback) {
        callback();
      }
 
      return;
    }
 
    var battle_role = attacker.getRoleData();
 
    if (battle_role == null) {
      if (callback) {
        callback();
      }
 
      return;
    }
 
    if (attacker.temp_skill_bid != attacker.attacker_info.skill_bid) {
      attacker.temp_skill_bid = attacker.attacker_info.skill_bid;
      var action = PlayerAction.action_1;
 
      if (attacker.is_friend == true) {
        action = PlayerAction.action_2;
      } // 设置技能名字
 
 
      this.skill_name.string = attacker.skill_data.name; // 获取头像资源id,以及加载头像
 
      var object_type = battle_role.object_type;
      var object_bid = battle_role.object_bid;
      var head_icon = battle_role.face_id;
 
      if (battle_role.face_id == 0) {
        head_icon = battle_role.object_bid;
      }
 
      if (object_type == BattleConst.Unit_Type.Monster) {
        var config = Utils.getUnitConfig(object_bid);
 
        if (config) {
          head_icon = config.head_icon;
        }
      }
 
      var head_path = PathTool.getHeadRes(head_icon);
 
      if (this.skill_head_path != head_path) {
        this.skill_head_path = head_path;
        this.loadRes(head_path, function (sprite, res_object) {
          sprite.spriteFrame = res_object;
        }.bind(this, this.skill_head_img));
      }
 
      this.skill_head_img.node.stopAllActions();
      this.skill_name.node.stopAllActions();
      this.showskill_node.active = true;
      this.skill_head_img.node.x = -121; // -62
 
      this.skill_name.node.x = 190; // 34
 
      this.skill_head_img.node.opacity = 0;
      this.skill_name.node.opacity = 0; // 动作
 
      var action_fun = function () {
        var call_back_fun = cc.callFunc(function () {
          if (callback) {
            callback();
          }
        }.bind(this));
        var head_move_by = cc.moveTo(0.08, -62, 0);
        var head_fade_in = cc.fadeIn(0.1);
        var head_delay = cc.delayTime(0.3);
        var head_delay_2 = cc.delayTime(0.5);
        var head_over = cc.callFunc(function () {
          this.showskill_node.active = false;
        }.bind(this));
        this.skill_head_img.node.runAction(cc.sequence(cc.spawn(head_move_by, head_fade_in), head_delay, call_back_fun, head_delay_2, head_over));
        var label_move_to = cc.moveTo(0.08, 34, 0);
        var label_fade_in = cc.fadeIn(0.1);
        this.skill_name.node.runAction(cc.spawn(label_move_to, label_fade_in));
      }.bind(this); // 设置头像以及播放动作
 
 
      if (this.skill_spine.skeletonData != null) {
        this.skill_spine.setAnimation(0, action, false);
        action_fun();
      } else {
        var skill_eff_path = PathTool.getSpinePath("E31321");
        this.loadRes(skill_eff_path, function (spine, res_object) {
          spine.skeletonData = res_object;
          spine.setAnimation(0, action, false);
          action_fun();
        }.bind(this, this.skill_spine));
      }
    } else {
      if (callback) {
        callback();
      }
    }
  },
  // 面板设置不可见的回调,这里做一些不可见的屏蔽处理
  onHide: function onHide() {
    var ChatController = require("chat_controller");
 
    ChatController.getInstance().closeChatPanel();
    gcore.GlobalEvent.fire(BattleEvent.EXIT_FIGHT);
  },
  // 当面板从主节点释放掉的调用接口,需要手动调用,而且也一定要调用
  onDelete: function onDelete() {}
});
 
cc._RF.pop();