internal static void UpdateIndicators(ActorClassIconElement classIcon, TacticalActorBase actor) { if (classIcon?.MainClassIconMask == null) { return; } if (defaultColor == null) { defaultColor = classIcon.MainClassIconMask.color; locatedColor = toColor(Mod.Config.locatedColor); revealedColor = toColor(Mod.Config.revealedColor); alertedColor = toColor(Mod.Config.alertedColor); } Color color = defaultColor.Value; if (enemyFactions.Contains(actor.TacticalFaction.Vision)) { if (actor.AIActor?.IsAlerted ?? false) { color = alertedColor; } } else if (!actor.IsDead) { if (enemyFactions.Where(facVis => facVis.IsRevealed(actor)).Any()) { color = revealedColor; } else if (enemyFactions.Where(facVis => facVis.IsLocated(actor)).Any()) { color = locatedColor; } } UpdateIndicator(classIcon, color); }
private static bool Prefix(TacticalActorBase fromActor, ref bool __result) { if (fromActor?.IsDead == true) { __result = false; return(false); } return(true); }
private static bool isAngleOK(TacticalActor shooter, TacticalActorBase target, float reactionAngleCos) { if (reactionAngleCos > 0.99) { return(true); } Vector3 targetForward = target.transform.TransformDirection(Vector3.forward); Vector3 targetToShooter = (shooter.Pos - target.Pos).normalized; float angleCos = Vector3.Dot(targetForward, targetToShooter); return(Utl.GreaterThanOrEqualTo(angleCos, reactionAngleCos)); }
private static bool Prefix(TacticalActorBase fromActor) { if (fromActor is ItemContainer) { // Avoid being detected by the root of a destroyed "egg" InventoryComponent inventory = fromActor.Inventory; if (inventory.Items.Count <= 0) { return(false); } } return(true); }