public static void Postfix(Turret __instance, ref Text __result, VisibilityLevel visLevel) { if (__instance == null) { return; } /* * Turret.UnitName = return (this.TurretDef == null) ? "UNDEFINED" : this.TurretDef.Chassis.Description.Name -> * Turret.NickName = (this.TurretDef == null) ? "UNDEFINED" : this.TurretDef.Description.Name -> */ if (__instance.Combat.HostilityMatrix.IsLocalPlayerEnemy(__instance.team.GUID)) { string chassisName = __instance.UnitName; string fullName = __instance.Nickname; SensorScanType scanType = SensorLockHelper.CalculateSharedLock(__instance, null); if (scanType < SensorScanType.ArmorAndWeaponType) { bool hasVisualScan = VisualLockHelper.CanSpotTargetUsingCurrentPositions(ModState.LastPlayerActorActivated, __instance); if (hasVisualScan) { scanType = SensorScanType.ArmorAndWeaponType; } } Text response = CombatNameHelper.GetTurretOrVehicleDetectionLabel(visLevel, scanType, fullName, chassisName, false); __result = response; } }
public static void Postfix(Vehicle __instance, ref Text __result, VisibilityLevel visLevel) { if (__instance == null) { return; } ; /* * Vehicle.UnitName = VehicleDef.Chassis.Description.Name -> * Alacorn Mk.VI-P / vehicledef_ARES_CLAN / Demolisher II / Galleon GAL-102 * Vehicle.NickName = VehicleDef.Description.Name -> * Pirate Alacorn Gauss Carrier / Ares / Demolisher II` * VehicleDef.Description.Id -> * / / vehicledef_DEMOLISHER-II / vehicledef_GALLEON_GAL102 */ if (__instance.Combat.HostilityMatrix.IsLocalPlayerEnemy(__instance.team.GUID)) { string chassisName = __instance.UnitName; string fullName = __instance.Nickname; SensorScanType scanType = SensorLockHelper.CalculateSharedLock(__instance, null); if (scanType < SensorScanType.ArmorAndWeaponType) { bool hasVisualScan = VisualLockHelper.CanSpotTargetUsingCurrentPositions(ModState.LastPlayerActorActivated, __instance); if (hasVisualScan) { scanType = SensorScanType.ArmorAndWeaponType; } } Text response = CombatNameHelper.GetTurretOrVehicleDetectionLabel(visLevel, scanType, fullName, chassisName, true); __result = response; } }
public static void Postfix(Mech __instance, ref Text __result, VisibilityLevel visLevel) { if (__instance == null) { return; } /* * Mech.UnitName = MechDef.Chassis.Description.Name -> Shadow Hawk / Atlas / Marauder * Mech.Nickname = Mech.Description.Name -> Shadow Hawk SHD-2D / Atlas AS7-D / Marauder ANU-O * Mech.Description.UIName -> Shadow Hawk SHD-2D / Atlas AS7-D Danielle / Anand ANU-O */ string fullName = __instance.Description.UIName; if (__instance.Combat.HostilityMatrix.IsLocalPlayerEnemy(__instance.team.GUID)) { string chassisName = __instance.UnitName; string partialName = __instance.Nickname; SensorScanType scanType = SensorLockHelper.CalculateSharedLock(__instance, null); if (scanType < SensorScanType.ArmorAndWeaponType) { bool hasVisualScan = VisualLockHelper.CanSpotTargetUsingCurrentPositions(ModState.LastPlayerActorActivated, __instance); if (hasVisualScan) { scanType = SensorScanType.ArmorAndWeaponType; } } __result = CombatNameHelper.GetEnemyMechDetectionLabel(visLevel, scanType, fullName, partialName, chassisName); } else { string displayName = __instance.DisplayName; __result = CombatNameHelper.GetNonHostileMechDetectionLabel(__instance, fullName, displayName); } }