decreaseThreat 减少对目标角色的仇恨值
decreaseThreat
类型: MethodDeclaration
所属类: TargetManager
定义位置: actor.ts
描述
减少对目标角色的仇恨值
参数 actor: 目标角色
参数 threat: 减少的仇恨值
参数
| 参数名 | 类型 | 描述 | 默认值 | 
|---|---|---|---|
| actor | Actor | - | - | 
| threat | number | - | - | 
返回值
类型: void
源代码
位置: 第 5108 行
public decreaseThreat(actor: Actor, threat: number): void {
    const index = this.targets.indexOf(actor)
    if (index !== -1) {
      // 如果存在目标角色,减少仇恨值
      this.threats[index] = Math.max(this.threats[index] - threat, 0)
    }
  }
文档生成时间:2025/7/21 20:53:38