docs(spec): 弹跳补充——命中循环跳过已访问敌人(防密集群重复命中)
This commit is contained in:
@@ -44,7 +44,16 @@
|
|||||||
```
|
```
|
||||||
|
|
||||||
### 2.5 命中弹跳(`bullet_manager._check_collision`)
|
### 2.5 命中弹跳(`bullet_manager._check_collision`)
|
||||||
在冷数据分支内、**pierce 处理之前**插入(伤害/状态/荷载已执行):
|
|
||||||
|
**(a) 命中选择跳过已访问**(`for entity_id in hits` 循环顶,距离检查之后、施伤之前):弹跳子弹停留在密集敌群时,若不跳过 `visited`,每帧命中选择可能重复命中同一敌人(bounce 恰在密集群最有价值)。故:
|
||||||
|
```gdscript
|
||||||
|
if _bullet_contexts.has(bullet_idx):
|
||||||
|
var vt = _bullet_contexts[bullet_idx].get("visited_targets", null)
|
||||||
|
if vt != null and entity_id in vt:
|
||||||
|
continue # 弹跳已命中过此敌:跳过,避免重复命中
|
||||||
|
```
|
||||||
|
|
||||||
|
**(b) 弹跳重定向**:在冷数据分支内、**pierce 处理之前**插入(伤害/状态/荷载已执行):
|
||||||
```gdscript
|
```gdscript
|
||||||
var bounce: int = int(cold.get("bounce_remaining", 0))
|
var bounce: int = int(cold.get("bounce_remaining", 0))
|
||||||
if bounce > 0:
|
if bounce > 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user