|
@@ -76,7 +76,7 @@ export class TornadoAIComponent extends TornadoComponent {
|
|
this.attack = this.attributeBonusMgr.getStormSunderAttack(this.currentLv, true);
|
|
this.attack = this.attributeBonusMgr.getStormSunderAttack(this.currentLv, true);
|
|
this.speed = this.attributeBonusMgr.getStormSunderSpeed(this.currentLv, true);
|
|
this.speed = this.attributeBonusMgr.getStormSunderSpeed(this.currentLv, true);
|
|
this.speed = Math.round((this.speed / 2) * 100) / 100;
|
|
this.speed = Math.round((this.speed / 2) * 100) / 100;
|
|
- this.speed = this.speed * 1.2;//测试
|
|
|
|
|
|
+ // this.speed = this.speed * 1.2;//测试
|
|
// console.log(`移动时长:${this.moveDuration} 逃离时长:${this.escapeDuration} 追击时长:${this.chaseDuration} 追击AI概率:${this.chaseAIProbability} 追击玩家概率:${this.chasePlayerProbability} 移动概率:${this.moveProbability}`);
|
|
// console.log(`移动时长:${this.moveDuration} 逃离时长:${this.escapeDuration} 追击时长:${this.chaseDuration} 追击AI概率:${this.chaseAIProbability} 追击玩家概率:${this.chasePlayerProbability} 移动概率:${this.moveProbability}`);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -125,7 +125,7 @@ export class TornadoAIComponent extends TornadoComponent {
|
|
}, this.moveDuration);
|
|
}, this.moveDuration);
|
|
}
|
|
}
|
|
|
|
|
|
- protected override onTriggerEnter(event: ITriggerEvent): void {
|
|
|
|
|
|
+ protected onTriggerEnter(event: ITriggerEvent): void {
|
|
if (event.otherCollider.getGroup() === 1 << 2) {
|
|
if (event.otherCollider.getGroup() === 1 << 2) {
|
|
this.unscheduleAllCallbacks();
|
|
this.unscheduleAllCallbacks();
|
|
this.isChasing = false;
|
|
this.isChasing = false;
|
|
@@ -136,9 +136,33 @@ export class TornadoAIComponent extends TornadoComponent {
|
|
this.setPositionByObstacle(event, () => {
|
|
this.setPositionByObstacle(event, () => {
|
|
this.decideAction();
|
|
this.decideAction();
|
|
});
|
|
});
|
|
|
|
+ } else if (event.otherCollider.getGroup() === 1 << 3) {
|
|
|
|
+ if (event.otherCollider.node.name == 'radiusTigger') return;
|
|
|
|
+
|
|
|
|
+ const otherCollider = event.otherCollider;
|
|
|
|
+ const targetTornado = otherCollider.node.parent.getComponent(TornadoComponent);
|
|
|
|
+ if (!targetTornado) return;
|
|
|
|
+
|
|
|
|
+ if (event.selfCollider.node.name == 'RigibodyStorm') {
|
|
|
|
+ if (event.otherCollider.node.name == 'RigibodyStorm') {
|
|
|
|
+ const isAI = targetTornado.ai;
|
|
|
|
+ if (this.currentLv > targetTornado.currentLv) {
|
|
|
|
+ if (!isAI) {
|
|
|
|
+ GameMgr.inst.isWin = false;
|
|
|
|
+ GameMgr.inst.setGameStatus(GameStatus.Revive);
|
|
|
|
+ } else {
|
|
|
|
+ this.onKilledHandler(targetTornado);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ protected onKilledHandler(targetTornado: TornadoComponent): void {
|
|
|
|
+ super.onKilledHandler(targetTornado);
|
|
|
|
+ }
|
|
|
|
+
|
|
protected onTriggerStay(event: ITriggerEvent): void {
|
|
protected onTriggerStay(event: ITriggerEvent): void {
|
|
if (GameMgr.inst.getGameStatus() != GameStatus.Playing) return;
|
|
if (GameMgr.inst.getGameStatus() != GameStatus.Playing) return;
|
|
super.onTriggerStay(event);
|
|
super.onTriggerStay(event);
|
|
@@ -148,16 +172,6 @@ export class TornadoAIComponent extends TornadoComponent {
|
|
const targetTornado = otherCollider.node.parent.getComponent(TornadoComponent);
|
|
const targetTornado = otherCollider.node.parent.getComponent(TornadoComponent);
|
|
if (!targetTornado) return;
|
|
if (!targetTornado) return;
|
|
|
|
|
|
- // const distance = Vec3.distance(this.node.worldPosition, otherCollider.node.worldPosition);
|
|
|
|
- // if (distance < 0.2) {
|
|
|
|
- // const isAI = targetTornado.ai;
|
|
|
|
- // if (this.currentLv > targetTornado.currentLv && !isAI) {
|
|
|
|
- // GameMgr.inst.isWin = false;
|
|
|
|
- // // console.log(`AI 触发碰撞到:${targetTornado.name} isAI:${isAI}`);
|
|
|
|
- // GameMgr.inst.setGameStatus(GameStatus.Revive);
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
if (event.selfCollider.node.name == 'RigibodyStorm') {
|
|
if (event.selfCollider.node.name == 'RigibodyStorm') {
|
|
if (event.otherCollider.node.name == 'RigibodyStorm') {
|
|
if (event.otherCollider.node.name == 'RigibodyStorm') {
|
|
const distance = Vec3.distance(event.selfCollider.node.worldPosition, otherCollider.node.worldPosition);
|
|
const distance = Vec3.distance(event.selfCollider.node.worldPosition, otherCollider.node.worldPosition);
|