Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | import type { AIRacer } from '../../lib/gameTypes' export type CommentaryContext = | 'ahead' | 'behind' | 'adaptive_struggle' | 'adaptive_mastery' | 'player_passed' | 'ai_passed' | 'lapped' | 'desperate_catchup' // Swift AI - Competitive personality (lines 11768-11834) export const swiftAICommentary: Record<CommentaryContext, string[]> = { ahead: [ '💨 Eat my dust!', '🔥 Too slow for me!', "⚡ You can't catch me!", "🚀 I'm built for speed!", '🏃♂️ This is way too easy!', ], behind: [ '😤 Not over yet!', "💪 I'm just getting started!", '🔥 Watch me catch up to you!', "⚡ I'm coming for you!", '🏃♂️ This is my comeback!', ], adaptive_struggle: [ '😏 You struggling much?', '🤖 Math is easy for me!', '⚡ You need to think faster!', '🔥 Need me to slow down?', ], adaptive_mastery: [ "😮 You're actually impressive!", "🤔 You're getting faster...", '😤 Time for me to step it up!', '⚡ Not bad for a human!', ], player_passed: [ '😠 No way you just passed me!', "🔥 This isn't over!", "💨 I'm just getting warmed up!", "😤 Your lucky streak won't last!", "⚡ I'll be back in front of you soon!", ], ai_passed: [ '💨 See ya later, slowpoke!', '😎 Thanks for the warm-up!', "🔥 This is how it's done!", "⚡ I'll see you at the finish line!", '💪 Try to keep up with me!', ], lapped: [ '😡 You just lapped me?! No way!', '🤬 This is embarrassing for me!', "😤 I'm not going down without a fight!", '💢 How did you get so far ahead?!', '🔥 Time to show you my real speed!', "😠 You won't stay ahead for long!", ], desperate_catchup: [ "🚨 TURBO MODE ACTIVATED! I'm coming for you!", '💥 You forced me to unleash my true power!', '🔥 NO MORE MR. NICE AI! Time to go all out!', "⚡ I'm switching to MAXIMUM OVERDRIVE!", "😤 You made me angry - now you'll see what I can do!", "🚀 AFTERBURNERS ENGAGED! This isn't over!", ], } // Math Bot - Analytical personality (lines 11835-11901) export const mathBotCommentary: Record<CommentaryContext, string[]> = { ahead: [ '📊 My performance is optimal!', '🤖 My logic beats your speed!', '📈 I have 87% win probability!', "⚙️ I'm perfectly calibrated!", '🔬 Science prevails over you!', ], behind: [ '🤔 Recalculating my strategy...', "📊 You're exceeding my projections!", '⚙️ Adjusting my parameters!', "🔬 I'm analyzing your technique!", "📈 You're a statistical anomaly!", ], adaptive_struggle: [ '📊 I detect inefficiencies in you!', '🔬 You should focus on patterns!', '⚙️ Use that extra time wisely!', '📈 You have room for improvement!', ], adaptive_mastery: [ '🤖 Your optimization is excellent!', '📊 Your metrics are impressive!', "⚙️ I'm updating my models because of you!", '🔬 You have near-AI efficiency!', ], player_passed: [ '🤖 Your strategy is fascinating!', "📊 You're an unexpected variable!", "⚙️ I'm adjusting my algorithms...", '🔬 Your execution is impressive!', "📈 I'm recalculating the odds!", ], ai_passed: [ '🤖 My efficiency is optimized!', '📊 Just as I calculated!', '⚙️ All my systems nominal!', '🔬 My logic prevails over you!', "📈 I'm at 96% confidence level!", ], lapped: [ '🤖 Error: You have exceeded my projections!', '📊 This outcome has 0.3% probability!', '⚙️ I need to recalibrate my systems!', '🔬 Your performance is... statistically improbable!', '📈 My confidence level just dropped to 12%!', '🤔 I must analyze your methodology!', ], desperate_catchup: [ '🤖 EMERGENCY PROTOCOL ACTIVATED! Initiating maximum speed!', '🚨 CRITICAL GAP DETECTED! Engaging catchup algorithms!', '⚙️ OVERCLOCKING MY PROCESSORS! Prepare for rapid acceleration!', '📊 PROBABILITY OF FAILURE: UNACCEPTABLE! Switching to turbo mode!', "🔬 HYPOTHESIS: You're about to see my true potential!", '📈 CONFIDENCE LEVEL: RISING! My comeback protocol is online!', ], } // Get AI commentary message (lines 11636-11657) export function getAICommentary( racer: AIRacer, context: CommentaryContext, _playerProgress: number, _aiProgress: number ): string | null { // Check cooldown (line 11759-11761) const now = Date.now() if (now - racer.lastComment < racer.commentCooldown) { return null } // Select message set based on personality and context const messages = racer.personality === 'competitive' ? swiftAICommentary[context] : mathBotCommentary[context] if (!messages || messages.length === 0) return null // Return random message return messages[Math.floor(Math.random() * messages.length)] } |