kill杀死不生成尸体(可用版本)
This commit is contained in:
1 parent
11ed9214ce
commit
23598ed3dd
5 files changed
+125
-8
No files matched your search
+8
@@ -37,6 +37,10 @@ from ....BlueFoxTools.ToolsConfig import LevelId
|
||||
# ---- 尸体生成延迟(秒): 死亡 1.5 秒后才生成尸体方块, 不会刚死瞬间就出现 ----
|
||||
GEN_DELAY = 1.5
|
||||
|
||||
# ---- 只有"被玩家攻击"死的才算: 近战=entity_attack, 远程(弓箭等)=projectile。
|
||||
# 排除 kill/指令(self_destruct) 以及摔/溺/火/爆炸等非玩家攻击的死亡。 ----
|
||||
ATTACK_CAUSES = {"entity_attack", "projectile"}
|
||||
|
||||
|
||||
class DeadmobGeneratorService(object):
|
||||
"""
|
||||
@@ -63,6 +67,10 @@ class DeadmobGeneratorService(object):
|
||||
attackerId = args.get("attacker") or args.get("attackedByEntId")
|
||||
if not killedId or not attackerId:
|
||||
return
|
||||
# 必须是"玩家攻击"死亡(近战 entity_attack / 远程 projectile)。
|
||||
# 排除 kill/指令(self_destruct) 及摔/溺/火等一切非玩家攻击的死亡。
|
||||
if args.get("cause") not in ATTACK_CAUSES:
|
||||
return
|
||||
# 解析"由玩家击杀": 近战 attacker 就是玩家; 远程 attacker 是抛射物, 取其发射者
|
||||
if not self._resolvePlayerAttacker(attackerId):
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user