FFTeam-TauntAggroFix icon

TauntAggroFix

Makes Taunted and Enraged enemies keep BaseAI.currentEnemy on the aggressor, so they attack instead of only walking toward them.

By FFTeam
Last updated a week ago
Total downloads 328
Total rating 0 
Categories Mods Libraries Server-side AI Generated
Dependency string FFTeam-TauntAggroFix-1.0.1
Dependants 1 other package depends on this package

This mod requires the following mods to function

bbepis-BepInExPack-5.4.2122 icon
bbepis-BepInExPack

Unified BepInEx all-in-one modding pack - plugin framework, detour library

Preferred version: 5.4.2122

README

TauntAggroFix

Makes taunt and Enrage pull enemy attacks, not just enemy movement.

Why

Vanilla EntityStates.TauntState only sets BaseAI.customTarget. BaseAI.EvaluateSingleSkillDriver uses customTarget for movement and aim while the Taunted buff is on. It never changes currentEnemy.

currentEnemy is the real attack target. Vanilla decoy code writes it directly:

baseAI.currentEnemy.gameObject = owner;

What this patch does

Adds a Harmony postfix to BaseAI.ManagedFixedUpdate.

While an enemy has the Taunted or TearGasBerserk buff, the patch:

  1. Reads customTarget for Taunt, or currentEnemy for Enrage.
  2. If the target is a projectile, resolves it to ProjectileController.owner.
  3. Checks the target is hostile.
  4. Writes currentEnemy.gameObject.
  5. Refreshes enemyAttention so the AI does not switch targets mid-taunt.

Server only.

Build

dotnet build -c Release

Install

Put TauntAggroFix.dll and manifest.json in BepInEx/plugins/TauntAggroFix/.