|
@@ -12,13 +12,15 @@ import { BattleNodeBase } from './node/BattleNodeBase';
|
|
|
import { BattleControl } from './control/BattleControl';
|
|
|
import { BattleUtil } from './data/BattleUtil';
|
|
|
import { BattleEventManager } from './base/BattleEventManager';
|
|
|
-import { BattleEventData_EnemyBorn, BattleEventData_EnemyBuff, BattleEventData_EnemyDie, BattleEventData_EnemyHurt, BattleEventData_EnemyMove, BattleEventData_HeroAction, BattleEventData_HeroAttack, BattleEventData_Over, BattleEventTarget, BattleEventType } from './base/BattleEventUtil';
|
|
|
+import { BattleEventData_EnemyBorn, BattleEventData_EnemyBuff, BattleEventData_EnemyDie, BattleEventData_EnemyHurt, BattleEventData_EnemyMove, BattleEventData_HeroAction, BattleEventData_HeroAttack, BattleEventData_Over, BattleEventTarget, BattleEventType, EnemyActionType, TowerUUID } from './base/BattleEventUtil';
|
|
|
import { MapConf } from './conf/MapConf';
|
|
|
import { isValid } from 'cc';
|
|
|
import { HeroDataPool } from './data/HeroData';
|
|
|
import { StringUtil } from '../../../framework/util/StringUtil';
|
|
|
import { MaterialUtil } from '../../../framework/util/MaterialUtil';
|
|
|
import { BattlesConf } from './conf/BattlesConf';
|
|
|
+import { GameEvent } from '../../data/GameEvent';
|
|
|
+import { LoginManager, LoginMgr } from '../../common/LoginManager';
|
|
|
|
|
|
|
|
|
//地图比例尺 1:70
|
|
@@ -102,6 +104,8 @@ export class TowerUI extends BaseView {
|
|
|
|
|
|
@property({ type:[Node], tooltip: "统计节点" })
|
|
|
countList: Node[] = [];
|
|
|
+ @property({ type:[Node], tooltip: "boss节点" })
|
|
|
+ bossList: Node[] = [];
|
|
|
@property({ type: Label, tooltip: "精力统计" })
|
|
|
powerLabel: Label = null;
|
|
|
|
|
@@ -127,6 +131,7 @@ export class TowerUI extends BaseView {
|
|
|
private damageCountData:Map<number,number> = new Map();
|
|
|
private damageUpdateTime = 0;
|
|
|
|
|
|
+ private bossIndexMap:Map<number,number> = new Map();
|
|
|
|
|
|
battleControl: BattleControl = null;
|
|
|
//当前动画下标
|
|
@@ -148,7 +153,9 @@ export class TowerUI extends BaseView {
|
|
|
|
|
|
|
|
|
this.battleControl = BattleControl.GetInstance()
|
|
|
- BattleEventManager.instance.addEvent(BattleEventTarget.Update, this.updateDataEvent.bind(this), -1);
|
|
|
+ BattleEventManager.instance.addEvent(BattleEventTarget.Update, this.updateDataEvent.bind(this), TowerUUID);
|
|
|
+
|
|
|
+ Framework.event.addEvent(GameEvent.BossUpdate, this.bossUpdate.bind(this),this)
|
|
|
|
|
|
this.initPool()
|
|
|
}
|
|
@@ -162,7 +169,7 @@ export class TowerUI extends BaseView {
|
|
|
}
|
|
|
|
|
|
protected onDestroy() {
|
|
|
-
|
|
|
+ BattleEventManager.instance.removeEvent(TowerUUID)
|
|
|
}
|
|
|
|
|
|
protected update(dt: number): void {
|
|
@@ -996,20 +1003,39 @@ export class TowerUI extends BaseView {
|
|
|
this.damageCountData.set(typeID,value+valueOld)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
private onTouchButton(event: Event, customStr) {
|
|
|
let target: any = event.target;
|
|
|
- if (target.name == 'addHero-001') {
|
|
|
-
|
|
|
+ if (target.name == 'mask') {
|
|
|
+ Framework.layer.close(this);
|
|
|
|
|
|
- }else if (target.name == 'addHero-002') {
|
|
|
-
|
|
|
+ } else if (target.name == 'hanghui_btn') {
|
|
|
+ LoginMgr.sendPost('tavern', 'get', (data) => {
|
|
|
+ console.log(data);
|
|
|
+ }, {})
|
|
|
+ }
|
|
|
|
|
|
- }else if (target.name == 'addHero-003') {
|
|
|
-
|
|
|
+ }
|
|
|
|
|
|
- }else if (target.name == 'addHero-004') {
|
|
|
-
|
|
|
|
|
|
+
|
|
|
+ //{typeID:number,value:number}
|
|
|
+ private bossUpdate(data:EnemyActionType){
|
|
|
+ switch(data){
|
|
|
+ case EnemyActionType.Born:
|
|
|
+
|
|
|
+ break;
|
|
|
+ case EnemyActionType.Die:
|
|
|
+
|
|
|
+ break;
|
|
|
+ case EnemyActionType.Hurt:
|
|
|
+
|
|
|
+ break;
|
|
|
+ case EnemyActionType.Move:
|
|
|
+
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|