|
@@ -75,7 +75,7 @@ export class TornadoAIComponent extends TornadoComponent {
|
|
|
this.speed = this.attributeBonusMgr.getStormSunderSpeed(this.currentLv, true);
|
|
|
this.speed = Math.round((this.speed / 2) * 100) / 100;
|
|
|
// this.speed = this.speed * 0.5;//测试
|
|
|
- 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}`);
|
|
|
}
|
|
|
|
|
|
/** 选择 AI 行为 */
|
|
@@ -84,7 +84,7 @@ export class TornadoAIComponent extends TornadoComponent {
|
|
|
|
|
|
const move = Math.random() * 100 < this.moveProbability;
|
|
|
|
|
|
- console.log(`AI 行为判断:移动概率:${this.moveProbability} 是否移动:${move}`);
|
|
|
+ // console.log(`AI 行为判断:移动概率:${this.moveProbability} 是否移动:${move}`);
|
|
|
if (move) {
|
|
|
this.randomMove();
|
|
|
} else {
|
|
@@ -151,7 +151,7 @@ export class TornadoAIComponent extends TornadoComponent {
|
|
|
const isAI = targetTornado.ai;
|
|
|
if (this.currentLv > targetTornado.currentLv && !isAI) {
|
|
|
GameMgr.inst.isWin = false;
|
|
|
- console.log(`AI 触发碰撞到:${targetTornado.name} isAI:${isAI}`);
|
|
|
+ // console.log(`AI 触发碰撞到:${targetTornado.name} isAI:${isAI}`);
|
|
|
GameMgr.inst.setGameStatus(GameStatus.Revive);
|
|
|
}
|
|
|
}
|
|
@@ -213,13 +213,13 @@ export class TornadoAIComponent extends TornadoComponent {
|
|
|
/** 追击目标 */
|
|
|
private chaseTarget(target: Node) {
|
|
|
if (this.isChasing) return;
|
|
|
- console.log(`AI 追击目标-> ${target.name}}`);
|
|
|
+ // console.log(`AI 追击目标-> ${target.name}}`);
|
|
|
|
|
|
this.isChasing = true;
|
|
|
this.targetNode = target;
|
|
|
|
|
|
PathfindingManager.getInstance().followTarget(this, target, this.speed, () => {
|
|
|
- console.log(`AI 追击目标到达`);
|
|
|
+ // console.log(`AI 追击目标到达`);
|
|
|
this.cancelAction();
|
|
|
this.decideAction();
|
|
|
});
|
|
@@ -234,7 +234,7 @@ export class TornadoAIComponent extends TornadoComponent {
|
|
|
/** 逃离目标 */
|
|
|
private escapeFrom(target: Node) {
|
|
|
this.isEscaping = true;
|
|
|
- console.log(`AI 逃离行为 时长:${this.escapeDuration}`);
|
|
|
+ // console.log(`AI 逃离行为 时长:${this.escapeDuration}`);
|
|
|
|
|
|
// 计算最大可逃离距离 = 速度 * 持续时间
|
|
|
const maxDistance = this.speed * this.escapeDuration;
|
|
@@ -259,7 +259,7 @@ export class TornadoAIComponent extends TornadoComponent {
|
|
|
this.isEscaping = false;
|
|
|
this.targetNode = null;
|
|
|
Tween.stopAllByTarget(this.node);
|
|
|
- console.log(`AI 行为取消`);
|
|
|
+ // console.log(`AI 行为取消`);
|
|
|
}
|
|
|
|
|
|
protected onDestroy(): void {
|