| | | 1 | | namespace RaidLoop.Client; |
| | | 2 | | |
| | | 3 | | public static class RaidPresentationCatalog |
| | | 4 | | { |
| | | 5 | | public static string GetEncounterDescription(string? encounterDescriptionKey, EncounterType encounterType, string? s |
| | | 6 | | { |
| | 20 | 7 | | if (!string.IsNullOrWhiteSpace(encounterDescriptionKey)) |
| | | 8 | | { |
| | 0 | 9 | | return encounterDescriptionKey switch |
| | 0 | 10 | | { |
| | 0 | 11 | | "combat_contact" => "Enemy contact on your position.", |
| | 0 | 12 | | "combat_hunter_contact" => "Hunter contact.", |
| | 0 | 13 | | "combat_extract_ambush" => "You are ambushed while moving between positions.", |
| | 0 | 14 | | "combat_mutual_contact" => "You and a patrol spot each other at the same moment.", |
| | 0 | 15 | | "loot_container" => "A searchable container appears.", |
| | 0 | 16 | | "extract_ready" => "You are near the extraction route.", |
| | 0 | 17 | | "extract_hold" => "Holding at extract.", |
| | 0 | 18 | | "neutral_travel" => "You move through the area carefully.", |
| | 0 | 19 | | _ => GetEncounterDescription(encounterType, serverDescription, extractHoldActive) |
| | 0 | 20 | | }; |
| | | 21 | | } |
| | | 22 | | |
| | 20 | 23 | | return GetEncounterDescription(encounterType, serverDescription, extractHoldActive); |
| | | 24 | | } |
| | | 25 | | |
| | | 26 | | public static string GetEncounterDescription(EncounterType encounterType, string? serverDescription, bool extractHol |
| | | 27 | | { |
| | 20 | 28 | | if (extractHoldActive) |
| | | 29 | | { |
| | 2 | 30 | | return "Holding at extract."; |
| | | 31 | | } |
| | | 32 | | |
| | 18 | 33 | | if (!string.IsNullOrWhiteSpace(serverDescription)) |
| | | 34 | | { |
| | 18 | 35 | | return serverDescription!; |
| | | 36 | | } |
| | | 37 | | |
| | 0 | 38 | | return encounterType switch |
| | 0 | 39 | | { |
| | 0 | 40 | | EncounterType.Combat => "Enemy contact on your position.", |
| | 0 | 41 | | EncounterType.Loot => "A searchable container appears.", |
| | 0 | 42 | | EncounterType.Extraction => "You are near the extraction route.", |
| | 0 | 43 | | EncounterType.Neutral => "You move through the area carefully.", |
| | 0 | 44 | | _ => string.Empty |
| | 0 | 45 | | }; |
| | | 46 | | } |
| | | 47 | | |
| | | 48 | | public static string GetEnemyLabel(string? serverEnemyName) |
| | | 49 | | { |
| | 20 | 50 | | if (string.IsNullOrWhiteSpace(serverEnemyName)) |
| | | 51 | | { |
| | 10 | 52 | | return string.Empty; |
| | | 53 | | } |
| | | 54 | | |
| | 10 | 55 | | return serverEnemyName!.Replace("Scav", "Scavenger", StringComparison.OrdinalIgnoreCase); |
| | | 56 | | } |
| | | 57 | | |
| | | 58 | | public static string GetEnemyLabel(string? enemyKey, string? serverEnemyName) |
| | | 59 | | { |
| | 20 | 60 | | if (!string.IsNullOrWhiteSpace(enemyKey)) |
| | | 61 | | { |
| | 0 | 62 | | return enemyKey switch |
| | 0 | 63 | | { |
| | 0 | 64 | | "scavenger" => "Scavenger", |
| | 0 | 65 | | "extract_hunter" => "Extract Hunter", |
| | 0 | 66 | | "guard" => "Guard", |
| | 0 | 67 | | _ => GetEnemyLabel(serverEnemyName) |
| | 0 | 68 | | }; |
| | | 69 | | } |
| | | 70 | | |
| | 20 | 71 | | return GetEnemyLabel(serverEnemyName); |
| | | 72 | | } |
| | | 73 | | |
| | | 74 | | public static string LocalizeLogEntry(string entry) |
| | | 75 | | { |
| | 21 | 76 | | if (string.IsNullOrWhiteSpace(entry)) |
| | | 77 | | { |
| | 0 | 78 | | return string.Empty; |
| | | 79 | | } |
| | | 80 | | |
| | 21 | 81 | | return entry.Replace("Scav", "Scavenger", StringComparison.OrdinalIgnoreCase); |
| | | 82 | | } |
| | | 83 | | } |