fix(alive): 存活判定改用引擎 s14j()(含 TELEPORT),死亡坦克稳定过滤

This commit is contained in:
TermiNexus committed 2026-10-20 13:02:03 +08:00
1 parent 8906ba6764
commit 781ba862b7
5 files changed
+82 -61

No files matched your search

@@ -298,29 +298,36 @@
return null;
}
// ===== 获取坦克状态值(Yjt 组件的 vzr_1.k3_1) =====
// 状态枚举:0=DEAD, 1=DEAD_PHANTOM, 2=SEMI_ACTIVE, 3=ACTIVE, 4=DISABLED
// Yjt 特征:有 azs_1(状态机)和 vzr_1(状态枚举)字段
function GetTankState(tank) {
if (!tank || !tank.qz1_1 || !tank.qz1_1.s2a_1) return -1;
var tankComp = null;
// ===== 坦克组件(lxt / TankComponent)=====
// 特征:有 k10c_1(状态枚举)与 p10c_1(fsm)
function GetTankComponent(tank) {
if (!tank || !tank.qz1_1 || !tank.qz1_1.s2a_1) return null;
var Found = null;
tank.qz1_1.s2a_1.forEach(function(valueList, key) {
if (tankComp) return;
if (Found) return;
try {
var comp = (valueList && typeof valueList.g1 === 'function') ? valueList.g1(0) : valueList;
if (comp && comp.p10c_1 && comp.k10c_1 !== undefined) tankComp = comp;
if (comp && comp.p10c_1 && comp.k10c_1 !== undefined) Found = comp;
} catch(e) {}
});
if (tankComp && tankComp.k10c_1) return tankComp.k10c_1.k3_1;
return -1;
return Found;
}
// 可见/战斗中的坦克 = ACTIVE(3) 或 SEMI_ACTIVE(2)
// 依据:引擎用 tankComponent.s14j()(= SEMI_ACTIVE || ACTIVE)决定该坦克节点是否渲染,
// 只认 ACTIVE 会漏掉半活跃状态(出生/过渡)的坦克
// ===== 获取坦克状态值 =====
// 状态枚举:0=DEAD, 1=DEAD_PHANTOM, 2=SEMI_ACTIVE, 3=ACTIVE, 4=DISABLED, 5=TELEPORT
function GetTankState(tank) {
var C = GetTankComponent(tank);
return (C && C.k10c_1) ? C.k10c_1.k3_1 : -1;
}
// 可见/战斗中的坦克:**直接调用引擎自己的判定 s14j()**
// module_87072: lxt.s14j() = Fmt(k10c_1) = SEMI_ACTIVE(2) || ACTIVE(3) || TELEPORT(5)
// 旧实现只认 2/3,会漏掉传送态;死亡态 0/1/4 会被正确排除
function IsTankAlive(tank) {
var C = GetTankComponent(tank);
try { if (C && typeof C.s14j === 'function') return !!C.s14j(); } catch (e) {}
var s = GetTankState(tank);
return s === 2 || s === 3;
return s === 2 || s === 3 || s === 5;
}
// ===== 获取坦克名称(yot 用户信息组件) =====
@@ -847,6 +854,7 @@
// 坦克状态:使用公共库(0=DEAD,1=DEAD_PHANTOM,2=SEMI_ACTIVE,3=ACTIVE,4=DISABLED)
var GetTankState = lib.GetTankState;
var GetTankHealth = lib.GetTankHealth;
var IsTankAlive = lib.IsTankAlive;
// ===== 获取坦克方向(Kkt 组件的 dzc_1) =====
function getTankDirection(tank) {
@@ -1433,11 +1441,10 @@
if (radarY < cy - radius) radarY = cy - radius;
if (radarY > cy + radius) radarY = cy + radius;
// 死亡判断(同 3D透视):可见坦克 = ACTIVE(3) 或 SEMI_ACTIVE(2);其余画红 ×
// 辅助:血量归零也视为死亡(状态字段偶有滞后)
// 死亡判断(同 3D透视):直接调用引擎的 s14j();血量归零也算死亡(状态偶有滞后)
var tankState = GetTankState(tank);
var hp = GetTankHealth(tank);
if ((tankState !== 2 && tankState !== 3) || (hp && hp.current <= 0)) {
if (!IsTankAlive(tank) || (hp && hp.current <= 0)) {
DrawDeadCross(radarX, radarY);
deadCount++;
continue;
@@ -2771,9 +2778,9 @@
var pos = GetTankPosition(tank); // 多级探测物理组件位置(字段名每个构建会平移)
if (!pos) continue;
var tankState = GetTankState(tank);
// 可见坦克 = ACTIVE(3) 或 SEMI_ACTIVE(2)(引擎 s14j() 判定),0/1/4 才跳过
if (tankState !== 2 && tankState !== 3) continue;
// 辅助判死:状态字段有时滞后一帧(爆毁动画期间仍是 ACTIVE),血量归零则不再画
// 直接调用引擎自己的可见性判定 s14j()(SEMI_ACTIVE / ACTIVE / TELEPORT 才画)
if (!IsTankAlive(tank)) continue;
// 辅助判死:状态字段有时滞后一帧(爆毁动画期间仍可见),血量归零则不再画
var hp = GetTankHealth(tank);
if (hp && hp.current <= 0) continue;
+27 -20
View File
@@ -298,29 +298,36 @@
return null;
}
// ===== 获取坦克状态值(Yjt 组件的 vzr_1.k3_1) =====
// 状态枚举:0=DEAD, 1=DEAD_PHANTOM, 2=SEMI_ACTIVE, 3=ACTIVE, 4=DISABLED
// Yjt 特征:有 azs_1(状态机)和 vzr_1(状态枚举)字段
function GetTankState(tank) {
if (!tank || !tank.qz1_1 || !tank.qz1_1.s2a_1) return -1;
var tankComp = null;
// ===== 坦克组件(lxt / TankComponent)=====
// 特征:有 k10c_1(状态枚举)与 p10c_1(fsm)
function GetTankComponent(tank) {
if (!tank || !tank.qz1_1 || !tank.qz1_1.s2a_1) return null;
var Found = null;
tank.qz1_1.s2a_1.forEach(function(valueList, key) {
if (tankComp) return;
if (Found) return;
try {
var comp = (valueList && typeof valueList.g1 === 'function') ? valueList.g1(0) : valueList;
if (comp && comp.p10c_1 && comp.k10c_1 !== undefined) tankComp = comp;
if (comp && comp.p10c_1 && comp.k10c_1 !== undefined) Found = comp;
} catch(e) {}
});
if (tankComp && tankComp.k10c_1) return tankComp.k10c_1.k3_1;
return -1;
return Found;
}
// 可见/战斗中的坦克 = ACTIVE(3) 或 SEMI_ACTIVE(2)
// 依据:引擎用 tankComponent.s14j()(= SEMI_ACTIVE || ACTIVE)决定该坦克节点是否渲染,
// 只认 ACTIVE 会漏掉半活跃状态(出生/过渡)的坦克
// ===== 获取坦克状态值 =====
// 状态枚举:0=DEAD, 1=DEAD_PHANTOM, 2=SEMI_ACTIVE, 3=ACTIVE, 4=DISABLED, 5=TELEPORT
function GetTankState(tank) {
var C = GetTankComponent(tank);
return (C && C.k10c_1) ? C.k10c_1.k3_1 : -1;
}
// 可见/战斗中的坦克:**直接调用引擎自己的判定 s14j()**
// module_87072: lxt.s14j() = Fmt(k10c_1) = SEMI_ACTIVE(2) || ACTIVE(3) || TELEPORT(5)
// 旧实现只认 2/3,会漏掉传送态;死亡态 0/1/4 会被正确排除
function IsTankAlive(tank) {
var C = GetTankComponent(tank);
try { if (C && typeof C.s14j === 'function') return !!C.s14j(); } catch (e) {}
var s = GetTankState(tank);
return s === 2 || s === 3;
return s === 2 || s === 3 || s === 5;
}
// ===== 获取坦克名称(yot 用户信息组件) =====
@@ -847,6 +854,7 @@
// 坦克状态:使用公共库(0=DEAD,1=DEAD_PHANTOM,2=SEMI_ACTIVE,3=ACTIVE,4=DISABLED)
var GetTankState = lib.GetTankState;
var GetTankHealth = lib.GetTankHealth;
var IsTankAlive = lib.IsTankAlive;
// ===== 获取坦克方向(Kkt 组件的 dzc_1) =====
function getTankDirection(tank) {
@@ -1433,11 +1441,10 @@
if (radarY < cy - radius) radarY = cy - radius;
if (radarY > cy + radius) radarY = cy + radius;
// 死亡判断(同 3D透视):可见坦克 = ACTIVE(3) 或 SEMI_ACTIVE(2);其余画红 ×
// 辅助:血量归零也视为死亡(状态字段偶有滞后)
// 死亡判断(同 3D透视):直接调用引擎的 s14j();血量归零也算死亡(状态偶有滞后)
var tankState = GetTankState(tank);
var hp = GetTankHealth(tank);
if ((tankState !== 2 && tankState !== 3) || (hp && hp.current <= 0)) {
if (!IsTankAlive(tank) || (hp && hp.current <= 0)) {
DrawDeadCross(radarX, radarY);
deadCount++;
continue;
@@ -2771,9 +2778,9 @@
var pos = GetTankPosition(tank); // 多级探测物理组件位置(字段名每个构建会平移)
if (!pos) continue;
var tankState = GetTankState(tank);
// 可见坦克 = ACTIVE(3) 或 SEMI_ACTIVE(2)(引擎 s14j() 判定),0/1/4 才跳过
if (tankState !== 2 && tankState !== 3) continue;
// 辅助判死:状态字段有时滞后一帧(爆毁动画期间仍是 ACTIVE),血量归零则不再画
// 直接调用引擎自己的可见性判定 s14j()(SEMI_ACTIVE / ACTIVE / TELEPORT 才画)
if (!IsTankAlive(tank)) continue;
// 辅助判死:状态字段有时滞后一帧(爆毁动画期间仍可见),血量归零则不再画
var hp = GetTankHealth(tank);
if (hp && hp.current <= 0) continue;
+3 -3
View File
@@ -1212,9 +1212,9 @@
var pos = GetTankPosition(tank); // 多级探测物理组件位置(字段名每个构建会平移)
if (!pos) continue;
var tankState = GetTankState(tank);
// 可见坦克 = ACTIVE(3) 或 SEMI_ACTIVE(2)(引擎 s14j() 判定),0/1/4 才跳过
if (tankState !== 2 && tankState !== 3) continue;
// 辅助判死:状态字段有时滞后一帧(爆毁动画期间仍是 ACTIVE),血量归零则不再画
// 直接调用引擎自己的可见性判定 s14j()(SEMI_ACTIVE / ACTIVE / TELEPORT 才画)
if (!IsTankAlive(tank)) continue;
// 辅助判死:状态字段有时滞后一帧(爆毁动画期间仍可见),血量归零则不再画
var hp = GetTankHealth(tank);
if (hp && hp.current <= 0) continue;
+21 -14
View File
@@ -83,29 +83,36 @@
return null;
}
// ===== 获取坦克状态值(Yjt 组件的 vzr_1.k3_1) =====
// 状态枚举:0=DEAD, 1=DEAD_PHANTOM, 2=SEMI_ACTIVE, 3=ACTIVE, 4=DISABLED
// Yjt 特征:有 azs_1(状态机)和 vzr_1(状态枚举)字段
function GetTankState(tank) {
if (!tank || !tank.qz1_1 || !tank.qz1_1.s2a_1) return -1;
var tankComp = null;
// ===== 坦克组件(lxt / TankComponent)=====
// 特征:有 k10c_1(状态枚举)与 p10c_1(fsm)
function GetTankComponent(tank) {
if (!tank || !tank.qz1_1 || !tank.qz1_1.s2a_1) return null;
var Found = null;
tank.qz1_1.s2a_1.forEach(function(valueList, key) {
if (tankComp) return;
if (Found) return;
try {
var comp = (valueList && typeof valueList.g1 === 'function') ? valueList.g1(0) : valueList;
if (comp && comp.p10c_1 && comp.k10c_1 !== undefined) tankComp = comp;
if (comp && comp.p10c_1 && comp.k10c_1 !== undefined) Found = comp;
} catch(e) {}
});
if (tankComp && tankComp.k10c_1) return tankComp.k10c_1.k3_1;
return -1;
return Found;
}
// 可见/战斗中的坦克 = ACTIVE(3) 或 SEMI_ACTIVE(2)
// 依据:引擎用 tankComponent.s14j()(= SEMI_ACTIVE || ACTIVE)决定该坦克节点是否渲染,
// 只认 ACTIVE 会漏掉半活跃状态(出生/过渡)的坦克
// ===== 获取坦克状态值 =====
// 状态枚举:0=DEAD, 1=DEAD_PHANTOM, 2=SEMI_ACTIVE, 3=ACTIVE, 4=DISABLED, 5=TELEPORT
function GetTankState(tank) {
var C = GetTankComponent(tank);
return (C && C.k10c_1) ? C.k10c_1.k3_1 : -1;
}
// 可见/战斗中的坦克:**直接调用引擎自己的判定 s14j()**
// module_87072: lxt.s14j() = Fmt(k10c_1) = SEMI_ACTIVE(2) || ACTIVE(3) || TELEPORT(5)
// 旧实现只认 2/3,会漏掉传送态;死亡态 0/1/4 会被正确排除
function IsTankAlive(tank) {
var C = GetTankComponent(tank);
try { if (C && typeof C.s14j === 'function') return !!C.s14j(); } catch (e) {}
var s = GetTankState(tank);
return s === 2 || s === 3;
return s === 2 || s === 3 || s === 5;
}
// ===== 获取坦克名称(yot 用户信息组件) =====
+4 -4
View File
@@ -33,7 +33,8 @@
// 坦克状态:使用公共库(0=DEAD,1=DEAD_PHANTOM,2=SEMI_ACTIVE,3=ACTIVE,4=DISABLED)
var GetTankState = lib.GetTankState;
var GetTankHealth = lib.GetTankHealth;
var GetTankHealth = lib.GetTankHealth;
var IsTankAlive = lib.IsTankAlive;
// ===== 获取坦克方向(Kkt 组件的 dzc_1) =====
function getTankDirection(tank) {
@@ -620,11 +621,10 @@
if (radarY < cy - radius) radarY = cy - radius;
if (radarY > cy + radius) radarY = cy + radius;
// 死亡判断(同 3D透视):可见坦克 = ACTIVE(3) 或 SEMI_ACTIVE(2);其余画红 ×
// 辅助:血量归零也视为死亡(状态字段偶有滞后)
// 死亡判断(同 3D透视):直接调用引擎的 s14j();血量归零也算死亡(状态偶有滞后)
var tankState = GetTankState(tank);
var hp = GetTankHealth(tank);
if ((tankState !== 2 && tankState !== 3) || (hp && hp.current <= 0)) {
if (!IsTankAlive(tank) || (hp && hp.current <= 0)) {
DrawDeadCross(radarX, radarY);
deadCount++;
continue;