/** * ============================================================================================== * Modul: DTIM-ZEC MARS MISSION: COMPLETE MASTER CODE (DAMTP ACADEMIC STANDARD) * Datei: TLW_Mars_Kolonisirung.pde * Framework: Discrete Topological Information Matrix (DTIM-ZEC) * Version: 4.0.0 (Full Story Arc, Open-World Micro-Cosmos Transit & Browser-Safe AST) * Author: Jan Buehring & Adaptive Intelligence Synthesis Network (Google AI) * License: MIT License (Quellcode) / CC0 1.0 Universal (Dokumente, Handlung & Open Data) * Plattform: Processing 4.5.6 (Linux x64) & Processing.js (processing.min.js) * * Sequenz: * [Stage 0] : Prolog Bremen (07:30 Uhr) — Zeno-Stasis-Kammer, EVM-Venting & GEO-RES-4 Signal * [Stage 1] : Projekt Bielefeld (Reinraum B-3) — ALDI-Prinzip & Project: Zero Seed Montage * [Stage 2] : Topologischer Transit — Open-World Mikrokosmos, Bosonen-Kanone & Docking-Stationen * [Stage 3] : Mars Terraforming — Valles Marineris, Dipol-Knoten, Wasser & Enthalpie-Flora * [Stage 4] : Basisbau — DTIM-Energie, Schutzschild, Meteor-Abwehr & Döner/Ayran-ISRU * [Stage 5] : Kolonisation — Bevölkerung, Stasis-Handelsbalance & Fraktal-Zweitschiff * ============================================================================================== */ // ============================================================================================== // GLOBALE SYSTEM- & DESIGN-VARIABLEN (100% PROCESSING.JS-SICHER) // ============================================================================================== int stage = 0; int a11yTheme = 0; // 0: DTIM Standard (Schwarz/Blutrot/Nachtblau), 1: Farbenblind, 2: Max-Kontrast float missionMin = 450.0; // Startzeit 07:30 Uhr (450 Minuten) // ============================================================================================== // STAGE 0 VARIABLES: PROLOG BREMEN (DACHGESCHOSS & ZENO-KAMMER) // ============================================================================================== float money = 15.0; int contactsCount = 4; float zenoPhaseLock = 12.0; // 0 .. 100 % Phasen-Synchronisation (1.054 GHz) float chamberEntropy = 18.0; // 0 .. 100 % Lokale Entropie (muss via EVM abgeleitet werden) float viralMultiplier = 1.0; int pythonBots = 0; float pythonPrice = 30.0; int heleneProofs = 0; // Statische Randintegral-Filter (senken Entropie-Aufbau) float helenePrice = 75.0; int quadrupoleArrays = 0; // Bariumtitanat-Quadrupole (1.054 GHz) float quadPrice = 140.0; int recipientClass = 0; // 0: Open-Source xqskys.de, 1: Fachwelt & Barnaby, 2: Exodiplomatie/CNT ArrayList stage0Logs; float clickPulse0 = 0.0; boolean signalDetected = false; // ============================================================================================== // STAGE 1 VARIABLES: PROJEKT BIELEFELD (REINRAUM B-3 & ALDI-PRINZIP) // ============================================================================================== int rawMaterials = 40; // CNT-Aerogel-Schaum & YBCO-Einheiten float phaseSyncPos = 0.5; // 0.0 .. 1.0 Resonanz-Abgleich (15.625 kHz / 1.054 GHz) float phaseSyncVel = 0.011; int syncStreak = 0; int teamMaya = 0; // Exodiplomatie & Originären-Synchronisation int teamHelene = 0; // Statik-Kernel-Optimierung int teamVolker = 0; // 15.625 kHz Zeilentrafo-Taktung boolean part1Built = false; // 1. YBCO-Supraleiter-Gussring boolean part2Built = false; // 2. CNT-Aerogel-Schaum-Mantel (0.0 G) boolean part3Built = false; // 3. Bariumtitanat-Quadrupol-Fold-Drive boolean part4Built = false; // 4. Barnaby-Hilbert-Core & Void-Exo-Scanner ArrayList stage1Logs; // ============================================================================================== // STAGE 2 VARIABLES: OPEN-WORLD MIKROKOSMOS TRANSIT (BÜHRING-METRIK STARSHIP) // ============================================================================================== float WORLD_SIZE = 3200.0; float HALF_WORLD = 1600.0; float s2ShipX = 0.0; float s2ShipY = 0.0; float s2ShipVX = 0.0; float s2ShipVY = 0.0; float s2Angle = 0.0; float s2CamX = 0.0; float s2CamY = 0.0; int ladung = 15; int score = 0; int schild = 100; int isotopeCores = 1; float s2Time = 0.0; boolean gameOver = false; boolean sieg = false; // Andock-Stationen in Stage 2 float reactorX = 640.0; float reactorY = -580.0; float vaultX = -640.0; float vaultY = 580.0; float dockRadius = 96.0; int dockedStation = 0; float shieldRegenAccum = 0.0; // Bosonen-Kanone & Auto-Aim int activeWeapon = 1; // 1: Photon, 2: Gluon, 3: W-Boson, 4: Elektron boolean autoAim = true; float aimAngle = 0.0; float currentShotEv = 10.20; MicroAtom lockedTarget = null; String targetInfoText = "Sensoren scannen Mikrokosmos..."; float shockX = 0.0, shockY = 0.0, shockRadius = 0.0, shockIntensity = 0.0; ArrayList worldQuanta; ArrayList worldRifts; ArrayList worldAtoms; ArrayList worldShots; ArrayList worldRings; boolean keyUp = false, keyDown = false, keyLeft = false, keyRight = false; boolean mouseSteer = true; boolean s2BriefingOpen = true; String sectorName = "SEKTOR I (NW): WASSERSTOFF-NEBEL"; String logHeadline = "Bühring-Metrik-Ring aktiv: Sammle Quanta & lade den Fold-Drive auf 100%!"; String logSubtext = "Tasten [1-4] Bosonen wählen | [F] Isotope an Reaktor/Speicher umwandeln"; int logFlashTimer = 0; // ============================================================================================== // STAGE 3 VARIABLES: MARS TERRAFORMING (VALLES MARINERIS) // ============================================================================================== int zecEnergyWatts = 120; float marsPressure = 6.0; float marsTemp = -63.0; float marsWater = 0.5; float marsEnthalpyFlora = 0.0; int dipolNodes = 0; int bechResonators = 0; int regolithExtractors = 0; int enthalpyGreenhouses = 0; boolean marsTerraformed = false; // ============================================================================================== // STAGE 4 & 5 VARIABLES: BASISBAU & KOLONISATION (VALLES MARINERIS & ROADHOUSE) // ============================================================================================== float shipX = 0.0, shipY = 0.0; float velocityX = 0.0, velocityY = 0.0; float tlwEnergy = 90.0, maxEnergy = 400.0; ArrayList tokens; ArrayList particles; ArrayList fieldNodes; ArrayList projectiles; boolean colonistsArrived = false; float colonistCount = 0.0, satisfaction = 82.0, shipPoints = 0.0; boolean inRebellion = false, hasSecondShip = false; float ship2X = 0.0, ship2Y = 0.0, ship2Vx = 0.0, ship2Vy = 0.0; float supplyTimer = 0.0, stasisLuxurySupply = 0.0; int tradePolicy = 0; // 0: Legal Tech/Med & Ayran-Synthese, 1: Schattenmarkt-Balance float solarRisk = 0.0, meteorRisk = 0.0; boolean isSolarFlare = false, isMeteor = false; boolean solarWarning = false, meteorWarning = false; int warningTimer = 0, flareTimer = 0; float meteorX = 400.0, meteorY = -50.0, meteorSize = 60.0, meteorHP = 100.0; String activePopupTitle = "", activePopupText = ""; boolean showPopup = false, pauseForWarning = false; boolean coreBought = false; boolean shieldBought = false, shieldOn = false; boolean defenseBought = false, defenseOn = false; boolean isruBought = false; boolean autoShieldBought = false, autoDefenseBought = false; boolean autoIsruBought = false, autoIsruActive = false; float greenLevel = 0.0; float waterLevel = 0.0; boolean balanceReached = false; boolean aiUnlocked = false, aiActive = false; int manualTokensCollected = 0; TLWToken ship1Target = null, ship2Target = null; // ============================================================================================== // FARB-PALETTEN & PHYSIKALISCHE HILFSFUNKTIONEN // ============================================================================================== int getUiPalette(int theme, int role) { // role: 0=Bg, 1=PanelBg, 2=Blood/Primary, 3=Blue/Secondary, 4=Accent, 5=Text if (theme == 1) { // Farbenblind-Optimiert (Blau / Gold-Amber) if (role == 0) return color(5, 9, 17); if (role == 1) return color(11, 17, 29); if (role == 2) return color(180, 120, 10); if (role == 3) return color(10, 75, 130); if (role == 4) return color(251, 191, 36); return color(255, 255, 255); } if (theme == 2) { // Maximal-Kontrast if (role == 0) return color(0, 0, 0); if (role == 1) return color(0, 0, 0); if (role == 2) return color(0, 0, 0); if (role == 3) return color(0, 0, 0); if (role == 4) return color(255, 255, 0); return color(255, 255, 255); } // Standard: Tiefschwarz, Dunkles Blutrot, Dunkles Nachtblau, Helles Silbergrau if (role == 0) return color(6, 8, 14); if (role == 1) return color(13, 16, 26); if (role == 2) return color(122, 16, 38); if (role == 3) return color(18, 46, 98); if (role == 4) return color(225, 55, 85); return color(242, 246, 255); } int getEntityColor(int theme, int kind) { if (theme == 1) { if (kind == 1) return color(230, 159, 0); if (kind == 2) return color(195, 210, 230); if (kind == 3) return color(56, 189, 248); if (kind == 4) return color(253, 224, 71); if (kind == 5) return color(45, 212, 191); if (kind == 6) return color(244, 114, 182); if (kind == 7) return color(52, 211, 153); return color(245, 158, 11); } if (theme == 2) { if (kind == 8) return color(255, 0, 255); if (kind == 7) return color(0, 255, 255); return color(255, 255, 0); } if (kind == 1) return color(220, 42, 74); if (kind == 2) return color(185, 198, 220); if (kind == 3) return color(65, 145, 255); if (kind == 4) return color(255, 215, 55); if (kind == 5) return color(35, 215, 155); if (kind == 6) return color(205, 85, 235); if (kind == 7) return color(0, 255, 180); return color(255, 45, 65); } String formatMissionClock() { int totalM = int(missionMin) % 1440; int hh = totalM / 60; int mm = totalM % 60; String hStr = (hh < 10) ? ("0" + hh) : ("" + hh); String mStr = (mm < 10) ? ("0" + mm) : ("" + mm); return hStr + ":" + mStr + " Uhr"; } float calcShellEnergyEv(int Z, int electrons, int n) { if (Z <= 0) return -1.5; float zEff = 1.0; if (electrons <= 2) zEff = max(1.0, float(Z) - 0.30 * float(electrons - 1)); else zEff = max(1.15, float(Z) - 0.85 * float(electrons - 1)); return -13.6 * (zEff * zEff) / float(n * n); } float calcBetheWeizsaecker(int Z, int N) { int A = Z + N; if (A <= 1 || Z <= 0) return 0.0; float av = 15.8, as = 18.3, ac = 0.714, aa = 23.2, ap = 12.0; float Evol = av * A; float Esurf = as * pow(float(A), 2.0 / 3.0); float Ecoul = ac * Z * (Z - 1) / pow(float(A), 1.0 / 3.0); float Esym = aa * pow(float(A - 2 * Z), 2.0) / float(A); float Epair = 0.0; if (A % 2 == 0) { if (Z % 2 == 0 && N % 2 == 0) Epair = ap / sqrt(float(A)); else Epair = -ap / sqrt(float(A)); } return max(0.0, Evol - Esurf - Ecoul - Esym + Epair); } String getElementName(int Z) { if (Z == 0) return "Neutron"; if (Z == 1) return "Wasserstoff (H)"; if (Z == 2) return "Helium (He)"; if (Z == 3) return "Lithium (Li)"; if (Z == 6) return "Kohlenstoff (C-12)"; return "Kern Z=" + Z; } void drawStdButton(float x, float y, float w, float h, String label, int bgCol, boolean enabled) { if (a11yTheme == 2) { fill(0); if (enabled) stroke(255, 255, 0); else stroke(110); } else { if (enabled) { fill(bgCol); stroke(140, 175, 235); } else { fill(20, 24, 36); stroke(55, 65, 88); } } rect(x, y, w, h, 6); if (a11yTheme == 2) { if (enabled) fill(255, 255, 0); else fill(140); } else { if (enabled) fill(255); else fill(155, 168, 192); } textSize(12); textAlign(CENTER, CENTER); text(label, x + w * 0.5, y + h * 0.5); } // ============================================================================================== // SETUP & INITIALISIERUNG // ============================================================================================== void setup() { size(1100, 740); noSmooth(); frameRate(60); stage0Logs = new ArrayList(); stage1Logs = new ArrayList(); worldQuanta = new ArrayList(); worldRifts = new ArrayList(); worldAtoms = new ArrayList(); worldShots = new ArrayList(); worldRings = new ArrayList(); tokens = new ArrayList(); particles = new ArrayList(); fieldNodes = new ArrayList(); projectiles = new ArrayList(); addStage0Log("07:30 Bremen: Dachgeschoss-Werkbank online. 4 Bariumtitanat-Quadrupole bereit."); addStage0Log("07:38 Stasis-Test: Halbes Butterbrot in der Kammer bei 1.054 GHz eingefroren (0% Zerfall)."); addStage0Log("REGEL: Pulse die Quadrupole [SPACE] & leite Abwärme via EVM in den intergalaktischen Void!"); addStage1Log("09:15 Projekt Bielefeld (Reinraum B-3): Dr. Vance & Maya Lindemann öffnen das ALDI-Modul-Lab."); addStage1Log("11:30 Maya: 'Kein 20-Tonnen-Beschleuniger! Wir bauen den ZEC-1 Antrieb nach dem ALDI-Prinzip.'"); addStage1Log("12:35 Klassentreffen: Dr. Kumpfs Resonanz-Pendel — stimme die 15.625-kHz-Phase ab!"); initStage2(); initStage4(); } void initStage2() { s2ShipX = 0.0; s2ShipY = 0.0; s2ShipVX = 0.0; s2ShipVY = 0.0; s2Angle = 0.0; s2CamX = 0.0; s2CamY = 0.0; ladung = 15; score = 0; schild = 100; isotopeCores = 1; dockedStation = 0; shieldRegenAccum = 0.0; gameOver = false; sieg = false; worldQuanta.clear(); worldRifts.clear(); worldAtoms.clear(); worldShots.clear(); worldRings.clear(); for (int i = 0; i < 36; i++) { worldQuanta.add(new VacuumQuantum(random(-HALF_WORLD + 120, HALF_WORLD - 120), random(-HALF_WORLD + 120, HALF_WORLD - 120))); } for (int i = 0; i < 22; i++) { float rx = random(-HALF_WORLD + 160, HALF_WORLD - 160); float ry = random(-HALF_WORLD + 160, HALF_WORLD - 160); if (dist(0, 0, rx, ry) > 260.0 && dist(reactorX, reactorY, rx, ry) > 220.0 && dist(vaultX, vaultY, rx, ry) > 220.0) { worldRifts.add(new SingularityRift(rx, ry)); } } worldAtoms.add(new MicroAtom(250, -40, 1, 0, 1, false)); worldAtoms.add(new MicroAtom(330, 110, 1, 0, 0, false)); for (int i = 0; i < 26; i++) { float ax = random(-HALF_WORLD + 180, HALF_WORLD - 180); float ay = random(-HALF_WORLD + 180, HALF_WORLD - 180); if (dist(0, 0, ax, ay) < 220.0) continue; if (dist(reactorX, reactorY, ax, ay) < 170.0) continue; if (dist(vaultX, vaultY, ax, ay) < 170.0) continue; if (ax < 0 && ay < 0) { worldAtoms.add(new MicroAtom(ax, ay, 1, 0, (i % 2 == 0) ? 1 : 0, false)); } else if (ax >= 0 && ay < 0) { if (i % 2 == 0) worldAtoms.add(new MicroAtom(ax, ay, 1, 0, 0, false)); else worldAtoms.add(new MicroAtom(ax, ay, 0, 1, 0, false)); } else if (ax < 0 && ay >= 0) { worldAtoms.add(new MicroAtom(ax, ay, 3, 1, 2, true)); } else { if (i % 3 == 0) worldAtoms.add(new MicroAtom(ax, ay, 6, 6, 6, false)); else worldAtoms.add(new MicroAtom(ax, ay, 2, 2, 2, false)); } } } void initStage4() { tokens.clear(); fieldNodes.clear(); shipX = width / 2.0; shipY = (height - 150.0) / 2.0; for (int i = 0; i < 8; i++) { tokens.add(new TLWToken(random(60.0, width - 60.0), random(175.0, height - 185.0))); } for (int x = 40; x < width; x += 70) { for (int y = 165; y < height - 165; y += 70) { fieldNodes.add(new TLWFieldNode(float(x), float(y))); } } } void draw() { background(getUiPalette(a11yTheme, 0)); if (stage == 0) drawStage0_Prolog(); else if (stage == 1) drawStage1_Bielefeld(); else if (stage == 2) drawStage2_Transit(); else if (stage == 3) drawStage3_Terraforming(); else if (stage == 4) drawStage4_BaseBuilding(); else if (stage == 5) drawStage5_Colonists(); } // ============================================================================================== // STAGE 0: PROLOG — BREMEN DACHGESCHOSS, ZENO-STASIS & GEO-RES-4 SIGNAL // ============================================================================================== void drawStage0_Prolog() { missionMin += 0.012; // Automatisierte Knoten & Forschung if (frameCount % 60 == 0) { if (pythonBots > 0) { contactsCount += pythonBots * 2; zenoPhaseLock = min(100.0, zenoPhaseLock + pythonBots * 0.45); } if (quadrupoleArrays > 0) { float stabilityFactor = (chamberEntropy > 80.0) ? 0.35 : 1.0; zenoPhaseLock = min(100.0, zenoPhaseLock + quadrupoleArrays * 1.15 * stabilityFactor); chamberEntropy = min(100.0, chamberEntropy + quadrupoleArrays * max(0.3, 1.4 - heleneProofs * 0.35)); money += quadrupoleArrays * 4.50 * viralMultiplier; } if (recipientClass == 2 && viralMultiplier > 1.0) { money += 1.80 * viralMultiplier; } } if (zenoPhaseLock >= 65.0 && !signalDetected) { signalDetected = true; addStage0Log("08:12 ALARM: Satellit GEO-RES-4 (BSI/BND Quantum-Watch) erfasst Phasen-Inversion!"); addStage0Log("08:15 Drei schwarze Vans ohne Kennzeichen halten vor dem Bremer Dachgeschoss..."); } // 1. Top-Header (volle Breite 1060 px) fill(getUiPalette(a11yTheme, 1)); stroke(getUiPalette(a11yTheme, 4)); strokeWeight(1.5); rect(20, 16, width - 40, 64, 8); strokeWeight(1.0); fill(255); textSize(14); textAlign(LEFT, TOP); text("PROLOG: DIE GEOMETRIE DER STILLE — Bremen (" + formatMissionClock() + ")", 36, 26); fill(210, 225, 245); textSize(12); text("Fonds: " + nf(money, 1, 2) + " EUR | xqskys.de Knoten: " + contactsCount + " | Zeno-Lock (1.054 GHz): " + int(zenoPhaseLock) + "%", 36, 50); drawStdButton(width - 165, 28, 130, 38, a11yTheme == 0 ? "Sehhilfe [H]" : (a11yTheme == 1 ? "Farbenblind" : "Max-Kontrast"), getUiPalette(a11yTheme, 3), true); // 2. Linke Spalte: Zeno-Kammer Pulse, Fokus-Strategie & EVM-Void-Venting if (clickPulse0 > 0.0) clickPulse0 -= 0.08; fill(getUiPalette(a11yTheme, 2)); stroke(getUiPalette(a11yTheme, 4)); strokeWeight(1.5 + clickPulse0 * 2.0); rect(20, 92, 410, 126, 8); strokeWeight(1.0); fill(255); textSize(15); textAlign(CENTER, CENTER); text("QUADRUPOLE PULSEN & PREPRINT SENDEN", 225, 130); textSize(12); text("[Klick oder LEERTASTE] — Senkt Entropie im Stasis-Substrat", 225, 158); fill(255, 230, 140); text("+Zeno-Lock (1.054 GHz) | +xqskys.de Reichweite", 225, 186); // Fokus-Auswahl (3 Regeln aus der Handlung) fill(getUiPalette(a11yTheme, 1)); stroke(55, 70, 100); rect(20, 228, 410, 142, 8); fill(255); textSize(12); textAlign(LEFT, TOP); text("NETZWERK- & FORSCHUNGS-FOKUS:", 34, 238); drawOptionRow(34, 262, 382, 30, "1. Open-Source (xqskys.de +Virale Multiplikation)", recipientClass == 0); drawOptionRow(34, 298, 382, 30, "2. Fachwelt & Prof. Barnaby (+Forschungsfonds EUR)", recipientClass == 1); drawOptionRow(34, 334, 382, 30, "3. Exodiplomatie & CNT-Schaum (Fair-Trade-Garantie)", recipientClass == 2); // Regelsystem: Kammer-Entropie & EVM-Void-Venting fill(getUiPalette(a11yTheme, 1)); stroke(chamberEntropy > 75.0 ? color(255, 65, 85) : getUiPalette(a11yTheme, 4)); rect(20, 380, 410, 106, 8); fill(255); textSize(12); textAlign(LEFT, TOP); text("KAMMER-ENTROPIE (Zero-Net-Energy Constraint): " + int(chamberEntropy) + "%", 34, 390); fill(35, 42, 60); noStroke(); rect(34, 412, 382, 14, 3); fill(chamberEntropy > 75.0 ? color(235, 50, 75) : color(56, 189, 248)); rect(34, 412, map(chamberEntropy, 0, 100, 0, 382), 14, 3); drawStdButton(34, 436, 382, 38, "EVM-VOID-VENTING (Entropie in Void ableiten)", getUiPalette(a11yTheme, 3), chamberEntropy > 5.0); // 3. Rechte Spalte: Labor-Upgrades & Übergang nach Projekt Bielefeld fill(getUiPalette(a11yTheme, 1)); stroke(getUiPalette(a11yTheme, 4)); rect(446, 92, 634, 394, 8); fill(255); textSize(14); textAlign(LEFT, TOP); text("DACHGESCHOSS-LABOR & GITTER-AUTOMATION", 464, 104); drawUpgradeCard(464, 134, 598, 72, "1. Python Gitter-Scraper (xqskys.de P2P-Netz)", "Verteilt Preprints dezentral — kein Wissens-Dumping, stetiger Zeno-Lock.", pythonPrice, "Aktiv: " + pythonBots, money >= pythonPrice); drawUpgradeCard(464, 214, 598, 72, "2. Helenes Statik-Beweis-Filter (Randintegral dG)", "Eliminiert thermisches Rauschen (-35% Entropie-Aufbau pro Zyklus).", helenePrice, "Beweise: " + heleneProofs, money >= helenePrice); drawUpgradeCard(464, 294, 598, 72, "3. Bariumtitanat-Quadrupol-Array (Galinstan-gekühlt)", "Erhöht Gigahertz-Abfragerate & generiert Fair-Trade-Forschungsfonds.", quadPrice, "Arrays: " + quadrupoleArrays, money >= quadPrice); boolean readyStage1 = (zenoPhaseLock >= 100.0 || money >= 260.0); if (readyStage1) { drawStdButton(464, 382, 598, 86, "BSI/BND-KONVOI EINGETROFFEN! (Richtlinie 404)\nWEITER ZU KAPITEL 1: PROJEKT BIELEFELD (STAGE 1) >>", getUiPalette(a11yTheme, 2), true); } else { fill(18, 22, 34); stroke(60, 75, 105); rect(464, 382, 598, 86, 6); fill(210, 225, 245); textSize(12); textAlign(CENTER, CENTER); text("ZIEL FÜR DURCHBRUCH: Erreiche 100% Zeno-Lock (aktuell " + int(zenoPhaseLock) + "%)\noder 260 EUR Forschungsfonds (aktuell " + int(money) + " EUR)", 763, 425); } // 4. Unteres Logbuch: Live-Handlung fill(getUiPalette(a11yTheme, 1)); stroke(59, 110, 194); rect(20, 498, width - 40, 224, 8); fill(255); textSize(12); textAlign(LEFT, TOP); text("TERMINAL-PROTOKOLL & HANDLUNG (BREMEN -> GEO-RES-4):", 36, 508); textSize(11); for (int i = 0; i < stage0Logs.size(); i++) { fill(225, 235, 250); text((String) stage0Logs.get(i), 36, 532 + i * 18); } } void addStage0Log(String txt) { stage0Logs.add("> " + txt); if (stage0Logs.size() > 10) stage0Logs.remove(0); } // ============================================================================================== // STAGE 1: PROJEKT BIELEFELD — REINRAUM B-3, PHASEN-SYNC & ALDI-PRINZIP // ============================================================================================== void drawStage1_Bielefeld() { missionMin += 0.015; // Phasen-Oszillator bewegt sich (Volkers 15.625 kHz Referenz-Takt) float oscSpeed = phaseSyncVel * max(0.45, 1.0 - teamVolker * 0.14); phaseSyncPos += oscSpeed; if (phaseSyncPos > 1.0) { phaseSyncPos = 1.0; phaseSyncVel = -abs(phaseSyncVel); } if (phaseSyncPos < 0.0) { phaseSyncPos = 0.0; phaseSyncVel = abs(phaseSyncVel); } // Automatische Synthese durch Team if (frameCount % 60 == 0) { int autoGain = teamMaya * 4 + teamHelene * 6 + teamVolker * 8; if (autoGain > 0) rawMaterials += autoGain; } // 1. Top-Header fill(getUiPalette(a11yTheme, 1)); stroke(getUiPalette(a11yTheme, 4)); strokeWeight(1.5); rect(20, 16, width - 40, 64, 8); strokeWeight(1.0); fill(255); textSize(14); textAlign(LEFT, TOP); text("PROJEKT BIELEFELD (REINRAUM B-3) — Das ALDI-Prinzip & Project: Zero Seed", 36, 26); fill(210, 225, 245); textSize(12); text("CNT-Aerogel & YBCO-Vorrat: " + rawMaterials + " u | Sync-Streak: " + syncStreak + "x | Uhrzeit: " + formatMissionClock(), 36, 50); drawStdButton(width - 165, 28, 130, 38, a11yTheme == 0 ? "Sehhilfe [H]" : (a11yTheme == 1 ? "Farbenblind" : "Max-Kontrast"), getUiPalette(a11yTheme, 3), true); // 2. Linke Spalte: Originären-Synthesizer, Phasen-Tuner & Team fill(getUiPalette(a11yTheme, 2)); stroke(getUiPalette(a11yTheme, 4)); rect(20, 92, 410, 114, 8); fill(255); textSize(14); textAlign(CENTER, CENTER); text("ORIGINÄREN-SYNTHESIZER PULSEN", 225, 126); textSize(12); text("[Klick oder LEERTASTE] — Erzeugt CNT-Schaum & YBCO-Ringe", 225, 152); fill(255, 230, 140); text("Treffer im grünen Resonanzfenster = Doppelte Ausbeute!", 225, 178); // Regelsystem: 15.625 kHz Phasen-Synchronisation fill(getUiPalette(a11yTheme, 1)); stroke(59, 110, 194); rect(20, 216, 410, 96, 8); fill(255); textSize(12); textAlign(LEFT, TOP); text("PHASEN-TUNER (15.625 kHz / 1.054 GHz Resonanz):", 34, 226); // Balken & Zielzone (0.40 .. 0.60) fill(18, 22, 34); stroke(90, 110, 145); rect(34, 252, 382, 22, 4); fill(20, 135, 80); noStroke(); rect(34 + 382 * 0.38, 253, 382 * 0.24, 20, 3); float needleX = 34 + phaseSyncPos * 382; stroke(255, 230, 60); strokeWeight(3.0); line(needleX, 248, needleX, 278); strokeWeight(1.0); fill(215, 228, 248); textSize(11); text("Klicke auf Synthesizer, wenn die gelbe Nadel im grünen Fenster steht!", 34, 284); // Spezialisten-Team (Maya, Helene, Volker) fill(getUiPalette(a11yTheme, 1)); stroke(55, 70, 100); rect(20, 322, 410, 204, 8); fill(255); textSize(12); text("HIGH-TRUST TEAM EINBINDEN (Auto-Synthese):", 34, 332); drawStdButton(34, 356, 382, 46, "Maya Lindemann (Exodiplomatie: " + teamMaya + ") — 60 u", getUiPalette(a11yTheme, 3), rawMaterials >= 60); drawStdButton(34, 410, 382, 46, "Helene Vormann (Statik-Proof: " + teamHelene + ") — 110 u", getUiPalette(a11yTheme, 3), rawMaterials >= 110); drawStdButton(34, 464, 382, 46, "Volker (15.625 kHz Takt-Inverter: " + teamVolker + ") — 160 u", getUiPalette(a11yTheme, 3), rawMaterials >= 160); // 3. Rechte Spalte: ALDI-Modularbau der ZEC-1 ENDEAVOUR fill(getUiPalette(a11yTheme, 1)); stroke(getUiPalette(a11yTheme, 4)); rect(446, 92, 634, 434, 8); fill(255); textSize(14); textAlign(LEFT, TOP); text("MONTAGEHALLE: ZEC-1 ENDEAVOUR (DAS ALDI-PRINZIP)", 464, 104); drawPartCard(464, 134, 598, 72, "1. YBCO-Supraleiter-Gussring (Bühring-Metrik Heckring)", "Erzeugt den asymmetrischen Phasengradienten ohne Rückstoß-Treibstoff.", 120, part1Built); drawPartCard(464, 214, 598, 72, "2. CNT-Aerogel-Schaum-Mantel (0.0 G Trägheits-Entkopplung)", "Nanoröhren-Schaumstoff schirmt G-Kräfte ab — selbst der Kaffee bleibt ruhig.", 260, part2Built); drawPartCard(464, 294, 598, 72, "3. Bariumtitanat-Quadrupol-Fold-Drive", "Kürzt geodätische Graphdistanzen im Raum-Netzwerk auf Knopfdruck.", 450, part3Built); drawPartCard(464, 374, 598, 72, "4. Barnaby-Hilbert-Core & 3U-Void-Exo-Scanner", "Parallele Adjazenzmatrix-Navigation & Echtzeit-Sensorik für den Transit.", 700, part4Built); if (part1Built && part2Built && part3Built && part4Built) { drawStdButton(464, 456, 598, 58, "PROJECT: ZERO SEED FREIGEGEBEN! ZÜNDUNG & MIKROKOSMOS-TRANSIT (STAGE 2) >>", getUiPalette(a11yTheme, 2), true); } else { fill(18, 22, 34); stroke(60, 75, 105); rect(464, 456, 598, 58, 6); fill(210, 225, 245); textSize(12); textAlign(CENTER, CENTER); text("Montiere alle 4 spartanischen ALDI-Module für den Mars-Transit", 763, 485); } // 4. Unteres Logbuch: Reinraum B-3 fill(getUiPalette(a11yTheme, 1)); stroke(59, 110, 194); rect(20, 538, width - 40, 184, 8); fill(255); textSize(12); textAlign(LEFT, TOP); text("WERFT- & EXODIPLOMATIE-LOGBUCH (PROJEKT BIELEFELD):", 36, 548); textSize(11); for (int i = 0; i < stage1Logs.size(); i++) { fill(225, 235, 250); text((String) stage1Logs.get(i), 36, 570 + i * 18); } } void addStage1Log(String txt) { stage1Logs.add("> " + txt); if (stage1Logs.size() > 8) stage1Logs.remove(0); } // ============================================================================================== // STAGE 2: OPEN-WORLD MIKROKOSMOS TRANSIT (BÜHRING-METRIK STARSHIP & STATIONEN) // ============================================================================================== void drawStage2_Transit() { float shipScale = 1.0 + (ladung / 100.0) * 0.25; float rootFactor = 1.0 + sqrt(float(ladung)) * 0.14; if (!s2BriefingOpen && !gameOver && !sieg) { s2Time += 0.02; updateS2StarshipMotion(rootFactor); updateS2DockingStations(); updateS2SectorTelemetry(); if (shockIntensity > 0.0) { shockRadius += 12.0; shockIntensity -= 5.5; } updateS2AutoAimSensor(); updateS2WorldEntities(shipScale); } s2CamX = lerp(s2CamX, s2ShipX, 0.12); s2CamY = lerp(s2CamY, s2ShipY, 0.12); pushMatrix(); translate(width * 0.5 - s2CamX, (height - 135) * 0.5 - s2CamY); drawS2HexGrid(); drawS2SectorBounds(); drawS2DockingStations(); drawS2Shockwaves(); drawS2WorldEntities(); drawS2AutoAimLaser(); pushMatrix(); translate(s2ShipX, s2ShipY); rotate(s2Angle); scale(shipScale); drawStarshipMetricRing(0, 0); popMatrix(); popMatrix(); drawS2Waypoints(); drawS2PilotHUD(rootFactor); if (gameOver) { drawS2Overlay("HÜLLENKOLLAPS IM VAKUUM", "Zu viele Singularitäts-Risse getroffen. Klicke auf NEUSTART.", "TRANSIT NEUSTARTEN"); } else if (sieg) { drawS2Overlay("MARS-ORBIT ERREICHT! (100% FOLD-DRIVE LADUNG)", "Die Bühring-Metrik hat Valles Marineris erreicht. Bereit für Terraforming!", "WEITER ZU STAGE 3: MARS TERRAFORMING >>"); } else if (s2BriefingOpen) { drawS2BriefingModal(); } } void drawS2HexGrid() { int step = 44; int startX = floor((s2CamX - width * 0.6) / step) * step; int endX = ceil((s2CamX + width * 0.6) / step) * step; int startY = floor((s2CamY - height * 0.6) / step) * step; int endY = ceil((s2CamY + height * 0.6) / step) * step; for (int gx = startX; gx <= endX; gx += step) { for (int gy = startY; gy <= endY; gy += step) { float dx = s2ShipX - gx; float dy = s2ShipY - gy; float d = max(0.1, sqrt(dx * dx + dy * dy)); float compression = (d < 190.0) ? map(d, 0, 190, 20.0 * (ladung / 100.0), 0.0) : 0.0; float sDx = gx - shockX; float sDy = gy - shockY; float sDist = sqrt(sDx * sDx + sDy * sDy); float shockShift = 0.0; if (shockIntensity > 0.0 && abs(sDist - shockRadius) < 45.0) { shockShift = map(abs(sDist - shockRadius), 0, 45, 22.0 * (shockIntensity / 255.0), 0.0); } float denom = (sDist < 0.1) ? 1.0 : sDist; float px = gx + (dx / d) * compression + (sDx / denom) * shockShift; float py = gy + (dy / d) * compression + (sDy / denom) * shockShift; float glow = (shockIntensity > 0.0 && abs(sDist - shockRadius) < 55.0) ? map(abs(sDist - shockRadius), 0, 55, shockIntensity, 0.0) : 0.0; if (a11yTheme == 2) stroke(70 + glow * 0.6); else if (a11yTheme == 1) stroke(30 + glow * 0.5, 110 + glow * 0.4, 210, map(d, 0, 460, 46, 12)); else stroke(45 + glow * 0.6, 85 + glow * 0.3, 195, map(d, 0, 460, 48, 12)); strokeWeight(glow > 18.0 ? 1.5 : 1.0); noFill(); beginShape(); for (int i = 0; i < 6; i++) { float a = (PI / 3.0) * i + s2Time * 0.02; vertex(px + cos(a) * 22.0, py + sin(a) * 22.0); } endShape(CLOSE); } } strokeWeight(1.0); } void drawS2SectorBounds() { stroke(a11yTheme == 2 ? color(255) : color(179, 25, 56, 130)); strokeWeight(2.0); noFill(); rect(-HALF_WORLD, -HALF_WORLD, WORLD_SIZE, WORLD_SIZE); stroke(59, 110, 194, 65); line(-HALF_WORLD, 0, HALF_WORLD, 0); line(0, -HALF_WORLD, 0, HALF_WORLD); strokeWeight(1.0); } void updateS2DockingStations() { int prevDock = dockedStation; float dR = dist(s2ShipX, s2ShipY, reactorX, reactorY); float dV = dist(s2ShipX, s2ShipY, vaultX, vaultY); if (dR <= dockRadius) { dockedStation = 1; if (prevDock != 1) { pushPhysicsLog("ANGEDOCKT: DTIM-ZEC Fusions-Reaktor (Schild-Regeneration aktiv)", "Drücke [F] oder klicke unten auf 'ISOTOP FUSIONIEREN' (+25% Akku)!"); } if (schild < 100) { shieldRegenAccum += 0.30; if (shieldRegenAccum >= 1.0) { int addS = int(shieldRegenAccum); schild = min(100, schild + addS); shieldRegenAccum -= float(addS); } } } else if (dV <= dockRadius) { dockedStation = 2; if (prevDock != 2) { pushPhysicsLog("ANGEDOCKT: Quanten-Speicher & Vakuum-Kondensator (Schnell-Schild aktiv)", "Drücke [F] oder klicke auf 'QUANTEN-SYNTHESE' (+15% Akku & 3 Quanta)!"); } if (schild < 100) { shieldRegenAccum += 0.45; if (shieldRegenAccum >= 1.0) { int addS = int(shieldRegenAccum); schild = min(100, schild + addS); shieldRegenAccum -= float(addS); } } } else { dockedStation = 0; } } void convertS2IsotopeAtStation() { if (dockedStation == 0) return; if (isotopeCores <= 0) { pushPhysicsLog("Keine Isotope im Frachtraum!", "Stabilisiere Kerne mit W-Boson [3] oder fusioniere mit Gluon [2]!"); return; } isotopeCores--; if (dockedStation == 1) { float yieldMeV = calcBetheWeizsaecker(2, 2); ladung = constrain(ladung + 25, 0, 100); score += 300; shockX = reactorX; shockY = reactorY; shockRadius = 0.0; shockIntensity = 255.0; worldRings.add(new ShockRing(reactorX, reactorY, getEntityColor(a11yTheme, 4))); pushPhysicsLog("REAKTOR-FUSION! +" + nf(yieldMeV, 1, 2) + " MeV -> +25% Akku (Isotope: " + isotopeCores + ")", "Bethe-Weizsäcker-Bindungsenergie direkt in den Fold-Drive eingespeist!"); if (ladung >= 100) sieg = true; } else { ladung = constrain(ladung + 15, 0, 100); score += 220; shockX = vaultX; shockY = vaultY; shockRadius = 0.0; shockIntensity = 255.0; worldRings.add(new ShockRing(vaultX, vaultY, getEntityColor(a11yTheme, 7))); for (int k = 0; k < 3; k++) { float ang = s2Time + k * (TWO_PI / 3.0); worldQuanta.add(new VacuumQuantum(vaultX + cos(ang) * 135.0, vaultY + sin(ang) * 135.0)); } pushPhysicsLog("QUANTEN-SYNTHESE! +15% Akku & 3 Vakuum-Quanten erzeugt (Isotope: " + isotopeCores + ")", "Die Raumzeit-Welle drängt nahe Singularitäts-Risse zurück!"); if (ladung >= 100) sieg = true; } } void drawS2DockingStations() { int bloodAccent = getUiPalette(a11yTheme, 4); int blueAccent = getEntityColor(a11yTheme, 3); int goldCol = getEntityColor(a11yTheme, 4); int quantCol = getEntityColor(a11yTheme, 7); // Station 1: Fusions-Reaktor pushMatrix(); translate(reactorX, reactorY); noFill(); stroke(dockedStation == 1 ? goldCol : bloodAccent); strokeWeight(dockedStation == 1 ? 2.5 : 1.5); ellipse(0, 0, dockRadius * 2.0, dockRadius * 2.0); pushMatrix(); rotate(s2Time * 0.45); stroke(bloodAccent); fill(26, 10, 16); beginShape(); for (int i = 0; i < 8; i++) vertex(cos((TWO_PI / 8.0) * i) * 44.0, sin((TWO_PI / 8.0) * i) * 44.0); endShape(CLOSE); popMatrix(); noStroke(); fill(goldCol); ellipse(0, 0, 22 + sin(s2Time * 8.0) * 4.0, 22 + sin(s2Time * 8.0) * 4.0); fill(255); textSize(11); textAlign(CENTER, TOP); text("STATION I: FUSIONS-REAKTOR\n[Schild-Lader & +25% Akku/Isotop]", 0, dockRadius + 8); popMatrix(); if (dockedStation == 1) { stroke(goldCol); strokeWeight(2.5); line(reactorX, reactorY, s2ShipX, s2ShipY); strokeWeight(1.0); } // Station 2: Quanten-Speicher pushMatrix(); translate(vaultX, vaultY); noFill(); stroke(dockedStation == 2 ? quantCol : blueAccent); strokeWeight(dockedStation == 2 ? 2.5 : 1.5); ellipse(0, 0, dockRadius * 2.0, dockRadius * 2.0); pushMatrix(); rotate(-s2Time * 0.4); stroke(blueAccent); fill(10, 20, 38); beginShape(); for (int i = 0; i < 6; i++) vertex(cos((TWO_PI / 6.0) * i) * 46.0, sin((TWO_PI / 6.0) * i) * 46.0); endShape(CLOSE); popMatrix(); noStroke(); fill(quantCol); ellipse(0, 0, 22 + cos(s2Time * 8.0) * 4.0, 22 + cos(s2Time * 8.0) * 4.0); fill(255); textSize(11); textAlign(CENTER, TOP); text("STATION II: QUANTEN-SPEICHER\n[Schnell-Schild & Quanten-Synthese]", 0, dockRadius + 8); popMatrix(); if (dockedStation == 2) { stroke(quantCol); strokeWeight(2.5); line(vaultX, vaultY, s2ShipX, s2ShipY); strokeWeight(1.0); } } void drawS2Waypoints() { drawSingleWaypoint(reactorX, reactorY, "Reaktor", getUiPalette(a11yTheme, 4)); drawSingleWaypoint(vaultX, vaultY, "Speicher", getEntityColor(a11yTheme, 7)); } void drawSingleWaypoint(float wx, float wy, String label, int col) { float viewH = height - 135; float sx = width * 0.5 + (wx - s2CamX); float sy = viewH * 0.5 + (wy - s2CamY); if (sx >= 24 && sx <= width - 24 && sy >= 44 && sy <= viewH - 20) return; float dx = wx - s2ShipX; float dy = wy - s2ShipY; float dUnits = sqrt(dx * dx + dy * dy); float ang = atan2(dy, dx); float cx = constrain(sx, 52, width - 52); float cy = constrain(sy, 54, viewH - 24); fill(8, 10, 18, 225); stroke(col); rect(cx - 44, cy - 14, 88, 28, 4); fill(255); textSize(10); textAlign(CENTER, CENTER); text(label + " " + int(dUnits / 10.0) + "m", cx, cy); stroke(col); strokeWeight(2.0); line(cx + cos(ang) * 46, cy + sin(ang) * 16, cx + cos(ang) * 54, cy + sin(ang) * 22); strokeWeight(1.0); } void updateS2StarshipMotion(float rootFactor) { float maxSpeed = 4.4 * rootFactor; if (keyLeft) s2Angle -= 0.055; if (keyRight) s2Angle += 0.055; if (keyUp || keyDown) { mouseSteer = false; float thrust = keyUp ? 0.25 : -0.16; s2ShipVX += cos(s2Angle) * thrust; s2ShipVY += sin(s2Angle) * thrust; } else if (mouseSteer && mouseY < height - 135) { float screenShipX = width * 0.5 + (s2ShipX - s2CamX); float screenShipY = (height - 135) * 0.5 + (s2ShipY - s2CamY); float dx = mouseX - screenShipX; float dy = mouseY - screenShipY; float d = sqrt(dx * dx + dy * dy); if (d > 18.0) { float desiredAng = atan2(dy, dx); float diff = atan2(sin(desiredAng - s2Angle), cos(desiredAng - s2Angle)); s2Angle += diff * 0.12; float throttle = constrain((d - 18.0) / 140.0, 0.0, 1.0) * 0.22; s2ShipVX += cos(s2Angle) * throttle; s2ShipVY += sin(s2Angle) * throttle; } } s2ShipVX *= 0.95; s2ShipVY *= 0.95; float curSpd = sqrt(s2ShipVX * s2ShipVX + s2ShipVY * s2ShipVY); if (curSpd > maxSpeed) { s2ShipVX = (s2ShipVX / curSpd) * maxSpeed; s2ShipVY = (s2ShipVY / curSpd) * maxSpeed; } s2ShipX = constrain(s2ShipX + s2ShipVX, -HALF_WORLD + 60, HALF_WORLD - 60); s2ShipY = constrain(s2ShipY + s2ShipVY, -HALF_WORLD + 60, HALF_WORLD - 60); } void updateS2SectorTelemetry() { String nextSector; if (s2ShipX < 0 && s2ShipY < 0) nextSector = "SEKTOR I (NW): WASSERSTOFF-NEBEL — Quantensprünge mit Photon [1]"; else if (s2ShipX >= 0 && s2ShipY < 0) nextSector = "SEKTOR II (NO): FUSIONS-SCHMIEDE — Fusions-Reaktor & Gluon [2]"; else if (s2ShipX < 0 && s2ShipY >= 0) nextSector = "SEKTOR III (SW): ISOTOPEN-RISS — Quanten-Speicher & W-Boson [3]"; else nextSector = "SEKTOR IV (SO): KOHLENSTOFF-CLUSTER — Ionen stabilisieren [4]"; if (!nextSector.equals(sectorName)) { sectorName = nextSector; pushPhysicsLog("Sektor-Eintritt: " + sectorName, "Sensoren kalibriert · Auto-Aim berechnet passende Resonanz-Energien."); } } void updateS2AutoAimSensor() { lockedTarget = null; float bestD = 340.0; for (int i = 0; i < worldAtoms.size(); i++) { MicroAtom a = (MicroAtom) worldAtoms.get(i); if (a.destroyed) continue; float d = dist(s2ShipX, s2ShipY, a.x, a.y); if (d < bestD) { bestD = d; lockedTarget = a; } } if (autoAim && lockedTarget != null) { aimAngle = atan2(lockedTarget.y - s2ShipY, lockedTarget.x - s2ShipX); if (activeWeapon == 1) { if (lockedTarget.electrons > 0) { int curN = lockedTarget.excitedShell; if (curN < 3) { float e1 = calcShellEnergyEv(lockedTarget.protons, lockedTarget.electrons, curN); float e2 = calcShellEnergyEv(lockedTarget.protons, lockedTarget.electrons, curN + 1); currentShotEv = max(0.5, e2 - e1); targetInfoText = getElementName(lockedTarget.protons) + " | Sprung n=" + curN + "->" + (curN + 1) + ": " + nf(currentShotEv, 1, 2) + " eV"; } else { currentShotEv = abs(calcShellEnergyEv(lockedTarget.protons, lockedTarget.electrons, 3)); targetInfoText = getElementName(lockedTarget.protons) + " | Ionisation: " + nf(currentShotEv, 1, 2) + " eV"; } } else { currentShotEv = 13.6; targetInfoText = getElementName(lockedTarget.protons) + " (Ionisiert · kein Elektron)"; } } else if (activeWeapon == 2) { targetInfoText = getElementName(lockedTarget.protons) + " | Gluon-Fusion (Bindung: " + nf(calcBetheWeizsaecker(lockedTarget.protons, lockedTarget.neutrons), 1, 1) + " MeV)"; } else if (activeWeapon == 3) { targetInfoText = getElementName(lockedTarget.protons) + (lockedTarget.hostile ? " [INSTABIL] -> W-Boson erntet Isotop!" : " -> Schwache Wechselwirkung bereit"); } else { int q = lockedTarget.protons - lockedTarget.electrons; targetInfoText = getElementName(lockedTarget.protons) + " | Ladung: " + (q > 0 ? "+" + q : "" + q); } } else { aimAngle = s2Angle; targetInfoText = autoAim ? "Sensoren scannen Mikrokosmos..." : "Manuelles Zielen in Flugrichtung"; } } void drawS2AutoAimLaser() { if (!autoAim || lockedTarget == null) return; int wCol = getEntityColor(a11yTheme, activeWeapon == 1 ? 4 : (activeWeapon == 2 ? 5 : (activeWeapon == 3 ? 6 : 3))); stroke(wCol); strokeWeight(1.5); line(s2ShipX, s2ShipY, lockedTarget.x, lockedTarget.y); noFill(); ellipse(lockedTarget.x, lockedTarget.y, 76, 76); strokeWeight(1.0); } void drawStarshipMetricRing(float cx, float cy) { int ringCol = getEntityColor(a11yTheme, 7); stroke(ringCol); strokeWeight(2.5); fill(18, 28, 45); ellipse(cx - 26, cy, 18, 54); if (ladung > 0) { fill(red(ringCol), green(ringCol), blue(ringCol), 110 + sin(s2Time * 22.0) * 80); noStroke(); ellipse(cx - 26, cy, 8, 30); } fill(238, 243, 252); stroke(30, 42, 60); strokeWeight(1.5); beginShape(); vertex(cx - 32, cy - 10); vertex(cx + 38, cy - 8); vertex(cx + 104, cy); vertex(cx + 38, cy + 8); vertex(cx - 32, cy + 10); vertex(cx - 18, cy); endShape(CLOSE); fill(75, 88, 108); rect(cx - 14, cy - 16, 24, 4); rect(cx - 14, cy + 12, 24, 4); if (ladung > 45) { noFill(); stroke(getEntityColor(a11yTheme, 3)); arc(cx + 109, cy, 16, 16, -HALF_PI, HALF_PI); } strokeWeight(1.0); } void fireS2Weapon() { if (s2BriefingOpen || gameOver || sieg) return; float noseX = s2ShipX + cos(s2Angle) * 45.0; float noseY = s2ShipY + sin(s2Angle) * 45.0; int shotKind = 3; if (activeWeapon == 1) shotKind = 4; else if (activeWeapon == 2) shotKind = 5; else if (activeWeapon == 3) shotKind = 6; worldShots.add(new BosonProjectile(noseX, noseY, cos(aimAngle) * 10.5, sin(aimAngle) * 10.5, shotKind, currentShotEv, true)); } void updateS2WorldEntities(float shipScale) { for (int i = worldQuanta.size() - 1; i >= 0; i--) { VacuumQuantum q = (VacuumQuantum) worldQuanta.get(i); q.y += sin(s2Time * 3.0 + q.phase) * 0.45; if (dist(s2ShipX, s2ShipY, q.x, q.y) < 38.0 * shipScale) { shockX = q.x; shockY = q.y; shockRadius = 0.0; shockIntensity = 255.0; score += 50; ladung = constrain(ladung + 10, 0, 100); worldRings.add(new ShockRing(q.x, q.y, getEntityColor(a11yTheme, 7))); pushPhysicsLog("QUANT COLLAPSED! +10% Vakuum-Energie (Akku: " + ladung + "%)", "Der Bühring-Metrik-Ring absorbiert Nullpunkt-Information."); q.x = random(-HALF_WORLD + 140, HALF_WORLD - 140); q.y = random(-HALF_WORLD + 140, HALF_WORLD - 140); if (ladung >= 100) sieg = true; } } for (int i = 0; i < worldRifts.size(); i++) { SingularityRift r = (SingularityRift) worldRifts.get(i); r.x += cos(s2Time * 1.4 + r.phase) * 0.6; r.y += sin(s2Time * 1.7 + r.phase) * 0.6; if (shockIntensity > 40.0 && dist(r.x, r.y, shockX, shockY) < shockRadius + 60.0) { float pushAng = atan2(r.y - shockY, r.x - shockX); r.x = constrain(r.x + cos(pushAng) * 5.0, -HALF_WORLD + 100, HALF_WORLD - 100); r.y = constrain(r.y + sin(pushAng) * 5.0, -HALF_WORLD + 100, HALF_WORLD - 100); } if (dist(s2ShipX, s2ShipY, r.x, r.y) < 34.0 * shipScale) { schild = max(0, schild - 34); worldRings.add(new ShockRing(r.x, r.y, getEntityColor(a11yTheme, 8))); pushPhysicsLog("ANOMALIE-EINSCHLAG! Schild: " + schild + "% — Docke an Reaktor oder Speicher!", "Beide Stationen regenerieren dein Schild automatisch auf 100%."); r.x = s2ShipX + cos(s2Angle + PI) * 420.0 + random(-150, 150); r.y = s2ShipY + sin(s2Angle + PI) * 420.0 + random(-150, 150); if (schild <= 0) gameOver = true; } } for (int i = worldAtoms.size() - 1; i >= 0; i--) { MicroAtom a = (MicroAtom) worldAtoms.get(i); if (a.destroyed) { worldAtoms.remove(i); continue; } a.x += a.vx; a.y += a.vy; if (a.x < -HALF_WORLD + 90 || a.x > HALF_WORLD - 90) a.vx = -a.vx; if (a.y < -HALF_WORLD + 90 || a.y > HALF_WORLD - 90) a.vy = -a.vy; if (a.excitedShell > 1 && a.electrons > 0) { a.exciteTimer--; if (a.exciteTimer <= 0) { int oldN = a.excitedShell; a.excitedShell = 1; worldQuanta.add(new VacuumQuantum(a.x + random(-24, 24), a.y + random(-24, 24))); worldRings.add(new ShockRing(a.x, a.y, getEntityColor(a11yTheme, 4))); pushPhysicsLog("SPONTANE EMISSION! Elektron fällt n=" + oldN + " -> n=1 (+Vakuum-Quantum)", "Sammle das freigesetzte grüne Quantum ein!"); } } if (a.hostile && dist(s2ShipX, s2ShipY, a.x, a.y) < 380.0) { a.attackCooldown--; if (a.attackCooldown <= 0) { a.attackCooldown = 140; float ang = atan2(s2ShipY - a.y, s2ShipX - a.x); worldShots.add(new BosonProjectile(a.x, a.y, cos(ang) * 4.6, sin(ang) * 4.6, 8, 2.0, false)); } } } for (int i = worldShots.size() - 1; i >= 0; i--) { BosonProjectile s = (BosonProjectile) worldShots.get(i); s.x += s.vx; s.y += s.vy; s.life--; if (s.life <= 0) { worldShots.remove(i); continue; } if (!s.fromPlayer) { if (dist(s.x, s.y, s2ShipX, s2ShipY) < 26.0 * shipScale) { schild = max(0, schild - 15); worldRings.add(new ShockRing(s2ShipX, s2ShipY, getEntityColor(a11yTheme, 8))); pushPhysicsLog("ISOTOPEN-STRAHLUNG! Schild: " + schild + "%", "Nutze W-Boson [3] zur Stabilisierung!"); worldShots.remove(i); if (schild <= 0) gameOver = true; } continue; } boolean consumed = false; for (int j = 0; j < worldAtoms.size(); j++) { MicroAtom target = (MicroAtom) worldAtoms.get(j); if (!target.destroyed && dist(s.x, s.y, target.x, target.y) < 42.0) { handleS2BosonHit(s, target); consumed = true; break; } } if (consumed) worldShots.remove(i); } for (int i = worldRings.size() - 1; i >= 0; i--) { ShockRing r = (ShockRing) worldRings.get(i); r.r += 2.8; r.alpha -= 10; if (r.alpha <= 0) worldRings.remove(i); } } void handleS2BosonHit(BosonProjectile s, MicroAtom target) { if (s.kind == 4) { if (target.electrons > 0) { if (target.excitedShell < 3) { target.excitedShell++; target.exciteTimer = 110; score += 25; worldRings.add(new ShockRing(target.x, target.y, getEntityColor(a11yTheme, 3))); pushPhysicsLog("QUANTENSPRUNG! Schale n=" + target.excitedShell + " (" + nf(s.energyEv, 1, 2) + " eV)", "Spontane Emission folgt in Kürze!"); } else { target.electrons--; target.excitedShell = 1; score += 40; worldQuanta.add(new VacuumQuantum(target.x + 25, target.y)); worldRings.add(new ShockRing(target.x, target.y, getEntityColor(a11yTheme, 4))); pushPhysicsLog("PHOTO-IONISATION! Elektron aus " + getElementName(target.protons) + " gelöst!", "Positives Ion (+1) entstanden."); } } } else if (s.kind == 5) { MicroAtom partner = null; float bestD = 220.0; for (int k = 0; k < worldAtoms.size(); k++) { MicroAtom other = (MicroAtom) worldAtoms.get(k); if (other != target && !other.destroyed) { float d = dist(target.x, target.y, other.x, other.y); if (d < bestD) { bestD = d; partner = other; } } } if (partner != null) { target.protons += partner.protons; target.neutrons += partner.neutrons; target.electrons += partner.electrons; target.hostile = false; partner.destroyed = true; isotopeCores++; ladung = constrain(ladung + 10, 0, 100); score += 120; worldRings.add(new ShockRing(target.x, target.y, getEntityColor(a11yTheme, 5))); pushPhysicsLog("KERNFUSION! " + getElementName(target.protons) + " gebildet -> +1 Isotop geerntet!", "Isotope an Bord: " + isotopeCores); if (ladung >= 100) sieg = true; } } else if (s.kind == 6) { if (target.protons > 0) { target.protons--; target.neutrons++; target.hostile = false; isotopeCores++; score += 90; worldRings.add(new ShockRing(target.x, target.y, getEntityColor(a11yTheme, 6))); pushPhysicsLog("W-BOSON: p -> n + Positron + Neutrino (+1 Isotop geerntet!)", "Isotope an Bord: " + isotopeCores); } } else { if (target.protons > target.electrons) { target.electrons++; score += 45; ladung = constrain(ladung + 6, 0, 100); worldRings.add(new ShockRing(target.x, target.y, getEntityColor(a11yTheme, 3))); pushPhysicsLog("ELEKTRONEN-EINFANG! " + getElementName(target.protons) + " neutralisiert (+6% Akku)", "Elektrische Neutralität hergestellt."); if (ladung >= 100) sieg = true; } } } void drawS2WorldEntities() { int qCol = getEntityColor(a11yTheme, 7); for (int i = 0; i < worldQuanta.size(); i++) { VacuumQuantum q = (VacuumQuantum) worldQuanta.get(i); if (abs(q.x - s2CamX) > width * 0.6 || abs(q.y - s2CamY) > height * 0.6) continue; stroke(qCol); strokeWeight(1.8); fill(8, 30, 36); ellipse(q.x, q.y, 20, 20); noStroke(); fill(255); ellipse(q.x, q.y, 6, 6); } int rCol = getEntityColor(a11yTheme, 8); for (int i = 0; i < worldRifts.size(); i++) { SingularityRift r = (SingularityRift) worldRifts.get(i); if (abs(r.x - s2CamX) > width * 0.6 || abs(r.y - s2CamY) > height * 0.6) continue; stroke(rCol); strokeWeight(2.0); fill(35, 6, 14); ellipse(r.x, r.y, 26, 26); noStroke(); fill(rCol); ellipse(r.x, r.y, 10 + sin(s2Time * 12.0 + r.phase) * 4.0, 10 + sin(s2Time * 12.0 + r.phase) * 4.0); } int eCol = getEntityColor(a11yTheme, 3), pCol = getEntityColor(a11yTheme, 1), nCol = getEntityColor(a11yTheme, 2); for (int i = 0; i < worldAtoms.size(); i++) { MicroAtom a = (MicroAtom) worldAtoms.get(i); if (abs(a.x - s2CamX) > width * 0.65 || abs(a.y - s2CamY) > height * 0.65) continue; float shellR = 22.0 + a.excitedShell * 11.0; noFill(); stroke(a.hostile ? rCol : eCol); strokeWeight(1.2); ellipse(a.x, a.y, shellR * 2.0, shellR * 2.0); for (int e = 0; e < a.electrons; e++) { float ang = s2Time * 2.2 + (TWO_PI * e) / max(1, a.electrons); noStroke(); fill(eCol); ellipse(a.x + cos(ang) * shellR, a.y + sin(ang) * shellR, 8, 8); } int totalNuc = a.protons + a.neutrons; for (int k = 0; k < totalNuc; k++) { float offX = 0.0, offY = 0.0; if (totalNuc > 1) { float kAng = (TWO_PI * k) / float(totalNuc) + s2Time; offX = cos(kAng) * 6.5; offY = sin(kAng) * 6.5; } fill(k < a.protons ? pCol : nCol); stroke(255, 150); ellipse(a.x + offX, a.y + offY, 12, 12); } fill(245); textSize(10); textAlign(CENTER, TOP); text(getElementName(a.protons) + (a.hostile ? " [!]" : ""), a.x, a.y + shellR + 4); } for (int i = 0; i < worldShots.size(); i++) { BosonProjectile s = (BosonProjectile) worldShots.get(i); fill(getEntityColor(a11yTheme, s.kind)); stroke(255); ellipse(s.x, s.y, 11, 11); } strokeWeight(1.0); } void drawS2Shockwaves() { for (int i = 0; i < worldRings.size(); i++) { ShockRing r = (ShockRing) worldRings.get(i); noFill(); stroke(red(r.col), green(r.col), blue(r.col), r.alpha); strokeWeight(2.0); ellipse(r.x, r.y, r.r * 2.0, r.r * 2.0); } strokeWeight(1.0); } void drawS2PilotHUD(float rootFactor) { int hudTop = height - 135; fill(getUiPalette(a11yTheme, 1)); noStroke(); rect(0, 0, width, 34); stroke(getUiPalette(a11yTheme, 4)); line(0, 34, width, 34); fill(255); textSize(12); textAlign(LEFT, CENTER); text("STAGE 2: MIKROKOSMOS-TRANSIT — " + sectorName, 14, 17); textAlign(RIGHT, CENTER); text("Pos: (" + int(s2ShipX) + ", " + int(s2ShipY) + ") | v_TLW: " + nf(4.4 * rootFactor, 1, 2) + " c_eff", width - 14, 17); fill(getUiPalette(a11yTheme, 1)); noStroke(); rect(0, hudTop, width, 135); stroke(getUiPalette(a11yTheme, 4)); strokeWeight(2.0); line(0, hudTop, width, hudTop); strokeWeight(1.0); fill(255); textSize(11); textAlign(LEFT, TOP); text("SCORE: " + score, 16, hudTop + 10); text("SCHILD: " + schild + "%", 115, hudTop + 10); fill(getEntityColor(a11yTheme, 4)); text("ISOTOPE: " + isotopeCores, 215, hudTop + 10); fill(35, 42, 60); stroke(120, 145, 195); rect(305, hudTop + 9, 140, 15, 3); noStroke(); fill(getEntityColor(a11yTheme, 7)); rect(306, hudTop + 10, map(ladung, 0, 100, 0, 138), 13, 2); fill(255); text("FOLD-AKKU: " + ladung + "%", 455, hudTop + 10); drawS2WeaponBtn(16, hudTop + 34, 1, "[1] Photon", getEntityColor(a11yTheme, 4)); drawS2WeaponBtn(144, hudTop + 34, 2, "[2] Gluon", getEntityColor(a11yTheme, 5)); drawS2WeaponBtn(272, hudTop + 34, 3, "[3] W-Boson", getEntityColor(a11yTheme, 6)); drawS2WeaponBtn(400, hudTop + 34, 4, "[4] Elektron", getEntityColor(a11yTheme, 3)); if (dockedStation == 1) { drawStdButton(532, hudTop + 34, 412, 26, "[F] ISOTOP IM REAKTOR FUSIONIEREN (+25% AKKU)", getUiPalette(a11yTheme, 2), true); } else if (dockedStation == 2) { drawStdButton(532, hudTop + 34, 412, 26, "[F] QUANTEN-SYNTHESE AM SPEICHER (+15% & 3 QUANTA)", getUiPalette(a11yTheme, 3), true); } else { drawStdButton(532, hudTop + 34, 412, 26, "Stationen: Reaktor (NO) / Quanten-Speicher (SW)", color(24, 30, 44), false); } drawStdButton(660, hudTop + 7, 138, 22, autoAim ? "Auto-Aim [E]: AN" : "Auto-Aim [E]: AUS", autoAim ? color(20, 125, 75) : color(55, 65, 85), true); drawStdButton(806, hudTop + 7, 138, 22, a11yTheme == 0 ? "Sehhilfe [H]" : (a11yTheme == 1 ? "Farbenblind" : "Max-Kontrast"), getUiPalette(a11yTheme, 3), true); if (logFlashTimer > 0) logFlashTimer--; fill(a11yTheme == 2 ? color(0) : color(8, 10, 18)); stroke(logFlashTimer > 0 ? getUiPalette(a11yTheme, 4) : color(55, 68, 95)); rect(16, hudTop + 66, 928, 58, 5); fill(getEntityColor(a11yTheme, 4)); textSize(11); textAlign(LEFT, TOP); text("SENSOR-ZIEL: " + targetInfoText, 26, hudTop + 72); fill(255); textSize(12); text(logHeadline, 26, hudTop + 90); fill(200, 215, 240); textSize(11); text(logSubtext, 26, hudTop + 108); // Minimap-Radar unten rechts int mapSize = 115; int mapX = width - mapSize - 16; int mapY = hudTop + 10; fill(4, 6, 12); stroke(getUiPalette(a11yTheme, 4)); rect(mapX, mapY, mapSize, mapSize, 4); stroke(45, 60, 90); line(mapX + mapSize * 0.5, mapY, mapX + mapSize * 0.5, mapY + mapSize); line(mapX, mapY + mapSize * 0.5, mapX + mapSize, mapY + mapSize * 0.5); noStroke(); fill(getEntityColor(a11yTheme, 7)); for (int i = 0; i < worldQuanta.size(); i++) { VacuumQuantum q = (VacuumQuantum) worldQuanta.get(i); rect(map(q.x, -HALF_WORLD, HALF_WORLD, mapX + 3, mapX + mapSize - 3), map(q.y, -HALF_WORLD, HALF_WORLD, mapY + 3, mapY + mapSize - 3), 2, 2); } fill(getEntityColor(a11yTheme, 8)); for (int i = 0; i < worldRifts.size(); i++) { SingularityRift r = (SingularityRift) worldRifts.get(i); rect(map(r.x, -HALF_WORLD, HALF_WORLD, mapX + 3, mapX + mapSize - 3), map(r.y, -HALF_WORLD, HALF_WORLD, mapY + 3, mapY + mapSize - 3), 2, 2); } fill(getUiPalette(a11yTheme, 4)); rect(map(reactorX, -HALF_WORLD, HALF_WORLD, mapX + 5, mapX + mapSize - 5) - 3, map(reactorY, -HALF_WORLD, HALF_WORLD, mapY + 5, mapY + mapSize - 5) - 3, 6, 6); fill(getEntityColor(a11yTheme, 7)); ellipse(map(vaultX, -HALF_WORLD, HALF_WORLD, mapX + 5, mapX + mapSize - 5), map(vaultY, -HALF_WORLD, HALF_WORLD, mapY + 5, mapY + mapSize - 5), 6, 6); fill(255); ellipse(map(s2ShipX, -HALF_WORLD, HALF_WORLD, mapX + 4, mapX + mapSize - 4), map(s2ShipY, -HALF_WORLD, HALF_WORLD, mapY + 4, mapY + mapSize - 4), 5, 5); } void drawS2WeaponBtn(int bx, int by, int id, String label, int dotCol) { boolean sel = (activeWeapon == id); if (a11yTheme == 2) { fill(0); if (sel) stroke(255, 255, 0); else stroke(255); } else { if (sel) { fill(getUiPalette(a11yTheme, 2)); stroke(getUiPalette(a11yTheme, 4)); } else { fill(20, 25, 38); stroke(60, 75, 105); } } rect(bx, by, 122, 26, 4); fill(dotCol); stroke(255); ellipse(bx + 14, by + 13, 10, 10); fill(255); textSize(11); textAlign(LEFT, CENTER); text(label, bx + 25, by + 13); } void drawS2BriefingModal() { fill(4, 5, 12, 225); noStroke(); rect(0, 0, width, height); fill(getUiPalette(a11yTheme, 1)); stroke(getUiPalette(a11yTheme, 4)); strokeWeight(2.0); rect(200, 120, 700, 390, 8); strokeWeight(1.0); fill(getUiPalette(a11yTheme, 2)); noStroke(); rect(201, 121, 698, 42, 7); fill(255); textSize(16); textAlign(LEFT, CENTER); text("STAGE 2: TOPOLOGISCHER MARS-TRANSIT (MIKROKOSMOS-NAVIGATION)", 224, 142); fill(235, 240, 250); textSize(13); textAlign(LEFT, TOP); text("Die ZEC-1 Endeavour fliegt mit dem Bühring-Metrik-Ring durch den Raum-Graphen:\n\n" + "1. Sammle gruene Vakuum-Quanten & lade den Fold-Akku auf 100%.\n" + "2. Weiche roten Singularitaets-Rissen aus (sie verzerren die Raumzeit).\n" + "3. Nutze deine Elementarteilchen-Kanone (Tasten 1 bis 4):\n" + " [1] Photon: Quantensprung -> setzt neue Vakuum-Quanten frei!\n" + " [2] Gluon: Kernfusion -> erntet +1 Isotop!\n" + " [3] W-Boson: Stabilisiert instabile Kerne -> erntet +1 Isotop!\n" + " [4] Elektron: Neutralisiert Ionen (+6% Akku).\n" + "4. Docke an Reaktor (NO) oder Speicher (SW) an: Schild-Regeneration & [F] Umwandlung!", 224, 180); drawStdButton(430, 445, 240, 42, "FOLD-DRIVE STARTEN >>", getUiPalette(a11yTheme, 2), true); } void drawS2Overlay(String title, String sub, String btnLabel) { fill(4, 5, 12, 220); noStroke(); rect(0, 0, width, height - 135); fill(getUiPalette(a11yTheme, 1)); stroke(getUiPalette(a11yTheme, 4)); strokeWeight(2.0); rect(240, 175, 620, 220, 8); strokeWeight(1.0); fill(255); textSize(20); textAlign(CENTER, CENTER); text(title, width * 0.5, 222); fill(225, 235, 250); textSize(13); text(sub + "\nTransit-Score: " + score + " Punkte", width * 0.5, 275); drawStdButton(370, 330, 360, 42, btnLabel, getUiPalette(a11yTheme, 2), true); } // ============================================================================================== // STAGE 3: MARS TERRAFORMING (VALLES MARINERIS, ROADHOUSE & ENTHALPIE-FLORA) // ============================================================================================== void drawStage3_Terraforming() { if (frameCount % 60 == 0 && !marsTerraformed) { if (dipolNodes > 0) marsPressure = min(600.0, marsPressure + dipolNodes * 1.4); if (bechResonators > 0 && marsPressure > 40.0) marsTemp = min(16.0, marsTemp + bechResonators * 0.45); if (regolithExtractors > 0 && marsTemp > -12.0) marsWater = min(35.0, marsWater + regolithExtractors * 0.35); if (enthalpyGreenhouses > 0 && marsWater > 5.0) marsEnthalpyFlora = min(100.0, marsEnthalpyFlora + enthalpyGreenhouses * 1.1); zecEnergyWatts += 8 + dipolNodes * 3 + bechResonators * 4 + enthalpyGreenhouses * 5; if (marsPressure >= 500.0 && marsTemp >= 10.0 && marsWater >= 25.0 && marsEnthalpyFlora >= 50.0) { marsTerraformed = true; } } // Top-Header fill(getUiPalette(a11yTheme, 1)); stroke(getUiPalette(a11yTheme, 4)); rect(20, 16, width - 40, 56, 8); fill(255); textSize(15); textAlign(LEFT, CENTER); text("STAGE 3: MARS TERRAFORMING — Valles Marineris & Roadhouse-Sektor", 36, 44); drawStdButton(width - 165, 25, 130, 38, a11yTheme == 0 ? "Sehhilfe [H]" : (a11yTheme == 1 ? "Farbenblind" : "Max-Kontrast"), getUiPalette(a11yTheme, 3), true); // Linker Bereich: Mars-Visualisierung fill(getUiPalette(a11yTheme, 1)); stroke(59, 110, 194); rect(20, 86, 460, 634, 8); float marsR = map(marsWater, 0.5, 35.0, 185.0, 42.0); float marsG = map(marsEnthalpyFlora, 0.0, 100.0, 62.0, 165.0); float marsB = map(marsWater, 0.5, 35.0, 42.0, 210.0); fill(marsR, marsG, marsB); noStroke(); ellipse(250, 340, 310, 310); // Valles Marineris & Roadhouse-Marker auf dem Mars stroke(255, 215, 70); strokeWeight(2.0); line(175, 345, 325, 355); noStroke(); fill(255, 215, 70); ellipse(250, 350, 10, 10); fill(255); textSize(11); textAlign(CENTER, TOP); text("Valles Marineris Roadhouse", 250, 360); if (dipolNodes > 0) { noFill(); stroke(56, 189, 248, 150); strokeWeight(2.0); ellipse(250, 340, 355, 355); strokeWeight(1.0); } fill(220, 232, 250); textSize(12); textAlign(LEFT, TOP); text("PLANETARE TELEMETRIE:\n" + "• Atmosphärendruck: " + nf(marsPressure, 1, 1) + " / 500 mbar\n" + "• Temperatur: " + nf(marsTemp, 1, 1) + " / +10.0 °C\n" + "• Flüssiges Wasser: " + nf(marsWater, 1, 1) + " / 25.0 %\n" + "• Entropie-Enthalpie-Flora: " + int(marsEnthalpyFlora) + " / 50 %", 44, 545); // Rechter Bereich: Terraforming-Module float shopX = 496, shopY = 86, shopW = 584; fill(getUiPalette(a11yTheme, 1)); stroke(getUiPalette(a11yTheme, 4)); rect(shopX, shopY, shopW, 634, 8); fill(255); textSize(15); textAlign(LEFT, TOP); text("DTIM-ZEC TERRAFORMING-STEUERUNG", shopX + 20, shopY + 18); fill(255, 215, 70); textSize(13); text("Verfügbare ZEC-Leistung: " + zecEnergyWatts + " kW [LEERTASTE = +50 kW Impuls]", shopX + 20, shopY + 46); drawMarsTechCard(shopX + 20, shopY + 80, shopW - 40, 84, "1. Dipol-ZEC-Knoten (Magnetosphäre & Druck)", "Schützt die Mars-Atmosphäre vor Sonnenwind (benötigt für Erwärmung).", 100, "Aktiv: " + dipolNodes, zecEnergyWatts >= 100); drawMarsTechCard(shopX + 20, shopY + 176, shopW - 40, 84, "2. Bechzahl-Resonator (Polkappen-Sublimation)", "Taut CO2- & Wassereis auf (benötigt > 40 mbar Atmosphärendruck).", 220, "Aktiv: " + bechResonators, zecEnergyWatts >= 220 && marsPressure > 40.0); drawMarsTechCard(shopX + 20, shopY + 272, shopW - 40, 84, "3. Regolith-Synthese (Sub-Planck Katalyse -> Ozeane)", "Löst gebundenes Wasser aus Mars-Gestein (benötigt > -12 °C).", 380, "Aktiv: " + regolithExtractors, zecEnergyWatts >= 380 && marsTemp > -12.0); drawMarsTechCard(shopX + 20, shopY + 368, shopW - 40, 84, "4. Entropie-Enthalpie-Flora (Dunkel-Photosynthese)", "Nutzt Boden-Luft-Temperaturgefälle für O2 & Biomasse (benötigt > 5% Wasser).", 480, "Aktiv: " + enthalpyGreenhouses, zecEnergyWatts >= 480 && marsWater > 5.0); if (marsTerraformed) { drawStdButton(shopX + 20, shopY + 480, shopW - 40, 120, "MARS ERFOLGREICH TERRAFORMIERT!\nVALLES MARINERIS IST BEWOHNBAR -> BASISBAU STARTEN (STAGE 4) >>", getUiPalette(a11yTheme, 2), true); } else { fill(18, 22, 34); stroke(60, 75, 105); rect(shopX + 20, shopY + 480, shopW - 40, 120, 6); fill(215, 228, 248); textSize(12); textAlign(LEFT, TOP); text("ZIELWERTE FÜR STAGE 4 (BASISBAU):\n" + "• Druck >= 500 mbar • Temperatur >= +10 °C\n" + "• Wasser >= 25 % • Enthalpie-Flora >= 50 %\n" + "Tipp: Drücke LEERTASTE für manuelle ZEC-Energie-Impulse!", shopX + 36, shopY + 496); } } // ============================================================================================== // STAGE 4 & 5: BASISBAU & KOLONISATION (VALLES MARINERIS & STASIS-HANDEL) // ============================================================================================== void drawStage4_BaseBuilding() { drawTLWSpaceBackground(); for (int i = 0; i < tokens.size(); i++) ((TLWToken) tokens.get(i)).display(); if (!pauseForWarning) { updateAITargets(); updateShipMovement(); manageTokens(); updateEvents(); } updateParticles(); drawShip(shipX, shipY); drawAlarms(); drawHUD(4); drawStoryPopup(); if (isruBought) { drawStdButton(width * 0.5 - 210, 250, 420, 52, "BASIS & DÖNER/AYRAN-ISRU AKTIV -> KOLONISATION (STAGE 5) >>", getUiPalette(a11yTheme, 2), true); } } void drawStage5_Colonists() { drawTLWSpaceBackground(); for (int i = 0; i < tokens.size(); i++) ((TLWToken) tokens.get(i)).display(); if (!pauseForWarning && !balanceReached) { updateAITargets(); updateShipMovement(); updateSecondShip(); manageTokens(); updateGaiaSystem(); updateEvents(); updateColonistsAndSupply(); } updateParticles(); if (!balanceReached) { drawShip(shipX, shipY); drawSecondShip(); } else { shipX = lerp(shipX, width * 0.5 - 30.0, 0.05); shipY = lerp(shipY, height * 0.5 - 30.0, 0.05); ship2X = lerp(ship2X, width * 0.5 + 30.0, 0.05); ship2Y = lerp(ship2Y, height * 0.5 - 30.0, 0.05); drawShip(shipX, shipY); if (hasSecondShip) drawSecondShip(); } drawAlarms(); drawHUD(5); drawStoryPopup(); } void updateAITargets() { ship1Target = null; ship2Target = null; if (aiActive && tokens.size() > 0) { float minDist = 9999.0; for (int i = 0; i < tokens.size(); i++) { TLWToken t = (TLWToken) tokens.get(i); float d = dist(shipX, shipY, t.x, t.y); if (d < minDist) { minDist = d; ship1Target = t; } } } if (hasSecondShip && colonistCount >= 50.0 && tokens.size() > 0) { float minDist = 9999.0; for (int i = 0; i < tokens.size(); i++) { TLWToken t = (TLWToken) tokens.get(i); if (ship1Target != null && t == ship1Target && tokens.size() > 1) continue; float d = dist(ship2X, ship2Y, t.x, t.y); if (d < minDist) { minDist = d; ship2Target = t; } } } } void updateShipMovement() { float targetX = mouseX; float targetY = mouseY; if (aiActive && ship1Target != null) { targetX = ship1Target.x; targetY = ship1Target.y; } boolean isMoving = false; if (aiActive && dist(shipX, shipY, targetX, targetY) > 10.0) isMoving = true; if (!aiActive && mousePressed && mouseY > 155 && mouseY < height - 155) isMoving = true; if (isMoving && tlwEnergy > 0.2) { velocityX += (targetX - shipX) * 0.006; velocityY += (targetY - shipY) * 0.006; tlwEnergy -= 0.04; if (frameCount % 2 == 0) { particles.add(new Particle(shipX, shipY, -velocityX * 0.6 + random(-0.5, 0.5), -velocityY * 0.6 + random(-0.5, 0.5), color(56, 189, 248), 1)); } } velocityX *= 0.94; velocityY *= 0.94; shipX = constrain(shipX + velocityX, 30.0, width - 30.0); shipY = constrain(shipY + velocityY, 165.0, height - 165.0); } void updateSecondShip() { if (hasSecondShip && colonistCount >= 50.0 && ship2Target != null) { ship2Vx += (ship2Target.x - ship2X) * 0.004; ship2Vy += (ship2Target.y - ship2Y) * 0.004; ship2Vx *= 0.92; ship2Vy *= 0.92; ship2X = constrain(ship2X + ship2Vx, 30.0, width - 30.0); ship2Y = constrain(ship2Y + ship2Vy, 165.0, height - 165.0); } } void manageTokens() { int spawned = 0; for (int i = tokens.size() - 1; i >= 0; i--) { TLWToken t = (TLWToken) tokens.get(i); boolean collected = (dist(shipX, shipY, t.x, t.y) < 28.0); if (hasSecondShip && colonistCount >= 50.0 && dist(ship2X, ship2Y, t.x, t.y) < 28.0) collected = true; if (collected) { tlwEnergy = min(maxEnergy, tlwEnergy + 18.0); for (int k = 0; k < 5; k++) particles.add(new Particle(t.x, t.y, random(-3.0, 3.0), random(-3.0, 3.0), color(0, 255, 210), 2)); tokens.remove(i); spawned++; if (!aiUnlocked) { manualTokensCollected++; if (manualTokensCollected >= 5) { aiUnlocked = true; triggerStory("BARNABY-KI ONLINE", "Der Hilbert-Autopilot sammelt nun selbstständig Vakuum-Knoten!"); } } } } for (int i = 0; i < spawned; i++) { tokens.add(new TLWToken(random(60.0, width - 60.0), random(175.0, height - 185.0))); } } void updateGaiaSystem() { if (autoIsruBought && autoIsruActive) { if (waterLevel < 60.0 && shipPoints >= 20.0) { shipPoints -= 20.0; waterLevel += 12.0; } if (greenLevel < 60.0 && shipPoints >= 30.0) { shipPoints -= 30.0; greenLevel += 12.0; } } float energyDrain = 0.0; if (isruBought && greenLevel > 0.0) energyDrain += (greenLevel * 0.007); if (isruBought && waterLevel > 0.0) energyDrain += (waterLevel * 0.004); if (shieldOn) energyDrain += 0.14; if (defenseOn) energyDrain += 0.14; if (tlwEnergy >= energyDrain) { tlwEnergy -= energyDrain; } else { tlwEnergy = 0.0; shieldOn = false; defenseOn = false; if (greenLevel > 0.0) greenLevel -= 0.03; if (waterLevel > 0.0) waterLevel -= 0.03; } if (greenLevel >= 100.0 && waterLevel >= 100.0 && !balanceReached) { balanceReached = true; greenLevel = 100.0; waterLevel = 100.0; triggerStory("TOPOLOGISCHE BALANCE ERREICHT", "Valles Marineris trägt sich selbst! Die Zivilisation auf dem Mars floriert."); } } void updateColonistsAndSupply() { if (isruBought && !colonistsArrived) { supplyTimer += 0.06; if (supplyTimer >= 100.0) { colonistsArrived = true; colonistCount = 15.0; supplyTimer = 0.0; triggerStory("ERSTE SIEDLER GELANDET", "Die Kolonisten sind im Valles Marineris angekommen! Versorgung über Stasis-Frachter aktiv."); } } if (colonistsArrived) { supplyTimer += 0.05; if (supplyTimer >= 100.0) { supplyTimer = 0.0; colonistCount += 5.0; if (tradePolicy == 0) satisfaction = min(100.0, satisfaction + 15.0); else stasisLuxurySupply += 100.0; } float demand = 0.014 + (colonistCount * 0.0004); boolean waterOk = (waterLevel >= demand); boolean greenOk = (greenLevel >= demand); if (waterOk) waterLevel -= demand; else waterLevel = 0.0; if (greenOk) greenLevel -= demand; else greenLevel = 0.0; if (waterOk && greenOk) { if (tradePolicy == 1) { if (stasisLuxurySupply > 0.0) { stasisLuxurySupply -= (0.05 + colonistCount * 0.001); satisfaction = min(100.0, satisfaction + 0.08); } else { satisfaction = max(0.0, satisfaction - 0.14); } } else { satisfaction = min(100.0, satisfaction + 0.03); } if (satisfaction > 60.0) colonistCount += 0.03; } else { satisfaction = max(0.0, satisfaction - 0.1); if (satisfaction < 30.0 && colonistCount > 0.0) colonistCount -= 0.02; } if (!inRebellion) shipPoints += colonistCount * 0.012; if (satisfaction <= 15.0 && !inRebellion) { inRebellion = true; aiActive = false; triggerStory("UNRUHEN IN DER KOLONIE", "Wasser oder Nahrung knapp! Erhöhe Produktion oder aktiviere Stasis-Versorgung."); } else if (satisfaction > 35.0 && inRebellion) { inRebellion = false; } } } void updateEvents() { if (coreBought && !isSolarFlare && !solarWarning) solarRisk += 0.03; if (coreBought && !isMeteor && !meteorWarning) meteorRisk += 0.02; if (solarRisk > 100.0 && !solarWarning && !isSolarFlare) { solarWarning = true; warningTimer = 180; if (autoShieldBought && !shieldOn) shieldOn = true; } if (solarWarning) { warningTimer--; if (warningTimer <= 0) { solarWarning = false; isSolarFlare = true; flareTimer = 280; solarRisk = 0.0; } } if (meteorRisk > 100.0 && !meteorWarning && !isMeteor) { meteorWarning = true; warningTimer = 180; if (autoDefenseBought && !defenseOn) defenseOn = true; } if (meteorWarning) { warningTimer--; if (warningTimer <= 0) { meteorWarning = false; isMeteor = true; meteorRisk = 0.0; meteorX = random(120.0, width - 120.0); meteorY = 155.0; meteorHP = 100.0; } } if (isSolarFlare) { flareTimer--; if (!shieldOn && frameCount % 5 == 0) { if (tlwEnergy > 0.0) tlwEnergy -= 2.0; else { if (greenLevel > 0.0) greenLevel -= 0.5; if (waterLevel > 0.0) waterLevel -= 0.5; } } if (flareTimer <= 0) isSolarFlare = false; } if (isMeteor) { meteorY += 0.75; meteorX += sin(frameCount * 0.05) * 0.5; if (defenseOn && frameCount % 12 == 0 && tlwEnergy >= 1.5) { tlwEnergy -= 1.5; projectiles.add(new Projectile(shipX, shipY, meteorX, meteorY)); } for (int i = projectiles.size() - 1; i >= 0; i--) { Projectile p = (Projectile) projectiles.get(i); p.update(); p.display(); if (dist(p.x, p.y, meteorX, meteorY) < meteorSize * 0.5) { meteorHP -= 25.0; projectiles.remove(i); for (int k = 0; k < 5; k++) particles.add(new Particle(p.x, p.y, random(-2.0, 2.0), random(-2.0, 2.0), color(0, 255, 220), 2)); } else if (p.isOffScreen()) { projectiles.remove(i); } } fill(180, 60, 40); stroke(255, 120, 50); strokeWeight(2.0); ellipse(meteorX, meteorY, meteorSize, meteorSize); fill(40); noStroke(); rect(meteorX - 40.0, meteorY - 45.0, 80.0, 6.0, 2.0); fill(255, 50, 50); rect(meteorX - 40.0, meteorY - 45.0, map(meteorHP, 0.0, 100.0, 0.0, 80.0), 6.0, 2.0); if (meteorHP <= 0.0) isMeteor = false; if (meteorY > height - 150.0) { isMeteor = false; greenLevel = max(0.0, greenLevel - 20.0); waterLevel = max(0.0, waterLevel - 20.0); for (int k = 0; k < 20; k++) particles.add(new Particle(meteorX, meteorY, random(-5.0, 5.0), random(-5.0, 5.0), color(255, 100, 50), 2)); } } } void drawTLWSpaceBackground() { for (int i = 0; i < fieldNodes.size(); i++) { TLWFieldNode node = (TLWFieldNode) fieldNodes.get(i); float sx2 = hasSecondShip ? ship2X : shipX; float sy2 = hasSecondShip ? ship2Y : shipY; node.updateAndDisplay(shipX, shipY, sx2, sy2); } boolean flash = isSolarFlare || (solarWarning && frameCount % 10 < 5); if (flash) { fill(255, 120, 0, 40); noStroke(); rect(0, 150, width, height - 300); } fill(120, 45, 25); noStroke(); rect(0, height - 150, width, 150); fill(190, 75, 40); rect(0, height - 158, width, 8); if (waterLevel > 0.0) { fill(50, 150, 255, map(waterLevel, 0.0, 100.0, 0.0, 120.0)); rect(0, height - 150, width, 150); } if (greenLevel > 0.0) { float alphaGreen = map(greenLevel, 0.0, 100.0, 0.0, 255.0); fill(30, 150, 50, alphaGreen); rect(0, height - 150, width, 150); fill(50, 200, 70, alphaGreen); rect(0, height - 158, width, 8); } if (shieldOn) { noFill(); stroke(0, 200, 255, 110); strokeWeight(3.0); arc(width * 0.5, height - 150, width, 250, PI, TWO_PI); strokeWeight(1.0); } } void drawAlarms() { if ((solarWarning || meteorWarning) && frameCount % 20 < 10) { fill(255, 60, 75); textSize(22); textAlign(CENTER, CENTER); text("NOTFALL-ALARM IM SEKTOR!", width * 0.5, height * 0.5 - 40); } } void updateParticles() { for (int i = particles.size() - 1; i >= 0; i--) { Particle p = (Particle) particles.get(i); p.update(); p.display(); if (p.isDead()) particles.remove(i); } } void drawShip(float cx, float cy) { pushMatrix(); translate(cx, cy); rotate(atan2(velocityY, velocityX) + HALF_PI); fill(56, 189, 248); stroke(255); strokeWeight(1.5); triangle(0, -18, -12, 16, 12, 16); fill(225, 55, 85); ellipse(0, 2, 6, 6); popMatrix(); strokeWeight(1.0); } void drawSecondShip() { if (!hasSecondShip) return; pushMatrix(); translate(ship2X, ship2Y); if (colonistCount >= 50.0) { rotate(frameCount * 0.08); stroke(0, 255, 150); } else { rotate(frameCount * 0.01); stroke(225, 55, 85); } noFill(); strokeWeight(1.5); for (int i = 0; i < 3; i++) { rotate(TWO_PI / 3.0); triangle(0, -12, -10, 10, 10, 10); } popMatrix(); strokeWeight(1.0); } void drawHUD(int currentDrawStage) { fill(getUiPalette(a11yTheme, 1)); stroke(getUiPalette(a11yTheme, 4)); strokeWeight(1.5); rect(12, 10, width - 24, 142, 8); strokeWeight(1.0); // Energie-Balken fill(35, 42, 60); noStroke(); rect(24, 20, 165, 20, 4); fill(getUiPalette(a11yTheme, 4)); rect(24, 20, map(tlwEnergy, 0.0, maxEnergy, 0.0, 165.0), 20, 4); fill(255); textSize(11); textAlign(LEFT, CENTER); text("DTIM-ENERGIE: " + int(tlwEnergy) + "/" + int(maxEnergy), 30, 30); // KI-Sammler Knopf if (aiUnlocked) { int aiBg = inRebellion ? color(160, 30, 45) : (aiActive ? color(20, 130, 75) : color(55, 65, 85)); drawStdButton(198, 18, 122, 24, inRebellion ? "KI SABOTIERT" : (aiActive ? "Barnaby-KI: AN" : "Barnaby-KI: AUS"), aiBg, !inRebellion); } else { fill(200, 215, 240); textSize(11); text("KI lernt (" + manualTokensCollected + "/5)", 202, 30); } // Kolonisten & Fraktal-Schiff if (currentDrawStage == 5) { if (!colonistsArrived) { fill(255, 215, 70); textSize(12); text("KOLONISTEN-ANFLUG: " + int(supplyTimer) + "%", 334, 30); } else { fill(inRebellion ? color(255, 80, 95) : color(120, 255, 190)); textSize(12); text("POP: " + int(colonistCount) + " | ZUF: " + int(satisfaction) + "% | SP: " + int(shipPoints), 334, 30); if (!hasSecondShip) { drawStdButton(575, 18, 195, 24, "FRAKTAL-SCHIFF (500 SP)", getUiPalette(a11yTheme, 3), shipPoints >= 500.0 && colonistCount >= 50.0); } else { drawStdButton(575, 18, 195, 24, colonistCount >= 50.0 ? "FRAKTAL-SCHIFF: AKTIV" : "FRAKTAL: CREW < 50", color(20, 125, 75), false); } } } else { fill(195, 210, 235); textSize(11); text("STAGE 4: BASISBAU (Aktiviere alle 4 Module bis ISRU)", 334, 30); } drawStdButton(width - 152, 18, 124, 24, a11yTheme == 0 ? "Sehhilfe [H]" : (a11yTheme == 1 ? "Farbenblind" : "Max-Kontrast"), getUiPalette(a11yTheme, 3), true); // Zeile 2: Basis-Module fill(210, 225, 245); textSize(11); textAlign(LEFT, CENTER); text("BASIS:", 24, 60); drawStdButton(72, 49, 92, 22, coreBought ? "Kern: OK" : "Kern (50E)", coreBought ? color(20, 125, 75) : getUiPalette(a11yTheme, 3), !coreBought && tlwEnergy >= 50.0); drawStdButton(172, 49, 108, 22, !shieldBought ? "Schild (70E)" : (shieldOn ? "Schild: AN" : "Schild: AUS"), shieldOn ? color(20, 125, 75) : getUiPalette(a11yTheme, 3), true); drawStdButton(288, 49, 112, 22, !defenseBought ? "Abwehr (80E)" : (defenseOn ? "Abwehr: AN" : "Abwehr: AUS"), defenseOn ? color(20, 125, 75) : getUiPalette(a11yTheme, 3), true); drawStdButton(408, 49, 118, 22, isruBought ? "Döner/ISRU: OK" : "Döner-ISRU (90E)", isruBought ? color(20, 125, 75) : getUiPalette(a11yTheme, 2), !isruBought && tlwEnergy >= 90.0); if (isruBought) { drawStdButton(534, 49, 165, 22, autoShieldBought ? "AUTO-SCHILD: OK" : "Auto-Schild (200 SP)", autoShieldBought ? color(110, 45, 165) : color(40, 48, 68), !autoShieldBought && shipPoints >= 200.0); drawStdButton(707, 49, 165, 22, autoDefenseBought ? "AUTO-ABWEHR: OK" : "Auto-Abwehr (200 SP)", autoDefenseBought ? color(110, 45, 165) : color(40, 48, 68), !autoDefenseBought && shipPoints >= 200.0); } // Zeile 3: Wasser & Döner/Flora-Synthese if (isruBought) { fill(210, 225, 245); textAlign(LEFT, CENTER); text("ISRU:", 24, 90); drawStdButton(72, 79, 105, 22, "WASSER (15E)", color(18, 85, 165), tlwEnergy >= 15.0); fill(255); text(int(waterLevel) + "%", 184, 90); drawStdButton(226, 79, 125, 22, "DÖNER/FLORA (20E)", color(22, 125, 65), tlwEnergy >= 20.0); fill(255); text(int(greenLevel) + "%", 358, 90); drawStdButton(408, 79, 165, 22, !autoIsruBought ? "Auto-ISRU (150 SP)" : (autoIsruActive ? "AUTO-ISRU: AN" : "AUTO-ISRU: AUS"), autoIsruActive ? color(110, 45, 165) : color(40, 48, 68), true); if (greenLevel >= 10.0) { drawStdButton(581, 79, 165, 22, "Notverkauf -10% Flora", getUiPalette(a11yTheme, 2), true); } } // Zeile 4: Stasis-Logistik & Handel (Stage 5) if (currentDrawStage == 5 && colonistsArrived) { fill(210, 225, 245); textAlign(LEFT, CENTER); text("HANDEL:", 24, 120); drawStdButton(88, 109, 230, 22, tradePolicy == 0 ? "LEGAL: Tech, Med & Ayran" : "BALANCE: Stasis-Genuss-Taxe", tradePolicy == 0 ? color(20, 125, 75) : getUiPalette(a11yTheme, 2), true); drawStdButton(328, 109, 185, 22, "Express-Siedler (100 SP)", color(145, 105, 20), shipPoints >= 100.0); drawStdButton(521, 109, 185, 22, "Stasis-Versorgung (100 SP)", color(145, 105, 20), shipPoints >= 100.0); } // Gefahrenanzeige rechts textAlign(RIGHT, CENTER); textSize(11); fill(solarRisk > 75.0 ? color(255, 80, 95) : color(210, 225, 245)); text("SONNENSTURM: " + int(min(100.0, solarRisk)) + "%", width - 24, 62); fill(meteorRisk > 75.0 ? color(255, 80, 95) : color(210, 225, 245)); text("METEOR-RISIKO: " + int(min(100.0, meteorRisk)) + "%", width - 24, 86); textAlign(LEFT, TOP); } void drawStoryPopup() { if (!showPopup) return; fill(getUiPalette(a11yTheme, 1)); stroke(getUiPalette(a11yTheme, 4)); strokeWeight(2.0); rect(width * 0.5 - 260, height * 0.5 - 95, 520, 190, 8); strokeWeight(1.0); fill(getUiPalette(a11yTheme, 2)); noStroke(); rect(width * 0.5 - 259, height * 0.5 - 94, 518, 36, 7); fill(255); textSize(14); textAlign(CENTER, CENTER); text(activePopupTitle, width * 0.5, height * 0.5 - 76); fill(235, 242, 255); textSize(12); textAlign(CENTER, TOP); text(activePopupText, width * 0.5 - 230, height * 0.5 - 44, 460, 95); fill(255, 215, 70); text("[Klicken zum Fortfahren]", width * 0.5, height * 0.5 + 65); textAlign(LEFT, TOP); } void triggerStory(String title, String txt) { activePopupTitle = title; activePopupText = txt; showPopup = true; pauseForWarning = true; } // ============================================================================================== // KARTEN- & UI-HELFER (STAGE 0, 1 & 3) // ============================================================================================== void drawOptionRow(float x, float y, float w, float h, String label, boolean active) { if (active) { fill(getUiPalette(a11yTheme, 2)); stroke(getUiPalette(a11yTheme, 4)); } else { fill(20, 25, 38); stroke(55, 68, 95); } rect(x, y, w, h, 5); fill(255); textSize(12); textAlign(LEFT, CENTER); text(label, x + 12, y + h * 0.5); } void drawUpgradeCard(float x, float y, float w, float h, String title, String desc, float price, String status, boolean canAfford) { if (canAfford) { fill(getUiPalette(a11yTheme, 3)); stroke(120, 165, 235); } else { fill(18, 22, 34); stroke(52, 62, 85); } rect(x, y, w, h, 6); fill(255); textSize(13); textAlign(LEFT, TOP); text(title, x + 14, y + 8); fill(215, 228, 248); textSize(11); text(desc, x + 14, y + 28); fill(255, 215, 70); textSize(12); text("Kosten: " + nf(price, 1, 2) + " EUR", x + 14, y + 48); fill(255); textAlign(RIGHT, TOP); text(status, x + w - 14, y + 10); } void drawPartCard(float x, float y, float w, float h, String title, String desc, int cost, boolean built) { if (built) { fill(18, 85, 55); stroke(80, 235, 165); } else if (rawMaterials >= cost) { fill(getUiPalette(a11yTheme, 3)); stroke(120, 165, 235); } else { fill(18, 22, 34); stroke(52, 62, 85); } rect(x, y, w, h, 6); fill(255); textSize(13); textAlign(LEFT, TOP); text(title, x + 14, y + 8); fill(215, 228, 248); textSize(11); text(desc, x + 14, y + 28); if (built) { fill(130, 255, 195); text("STATUS: MONTIERT & PHASEN-VERRIEGELT", x + 14, y + 48); } else { fill(255, 215, 70); text("Materialbedarf: " + cost + " u CNT-Aerogel / YBCO", x + 14, y + 48); } } void drawMarsTechCard(float x, float y, float w, float h, String title, String desc, int cost, String status, boolean canAfford) { if (canAfford) { fill(getUiPalette(a11yTheme, 3)); stroke(120, 165, 235); } else { fill(18, 22, 34); stroke(52, 62, 85); } rect(x, y, w, h, 6); fill(255); textSize(13); textAlign(LEFT, TOP); text(title, x + 14, y + 10); fill(215, 228, 248); textSize(11); text(desc, x + 14, y + 32); fill(255, 215, 70); textSize(12); text("Leistung: " + cost + " kW", x + 14, y + 56); fill(255); textAlign(RIGHT, TOP); text(status, x + w - 14, y + 12); } // ============================================================================================== // BENUTZER-EINGABEN (MAUS & TASTATUR FÜR ALLE 6 STAGES) // ============================================================================================== void mouseMoved() { if (stage == 2 && !s2BriefingOpen && !gameOver && !sieg && mouseY < height - 135) { mouseSteer = true; } } void mousePressed() { // Globaler Sehhilfe-Knopf oben rechts in Stage 0, 1, 3, 4, 5 if (stage != 2 && mouseX >= width - 165 && mouseX <= width - 28 && mouseY >= 18 && mouseY <= 56) { a11yTheme = (a11yTheme + 1) % 3; return; } if (showPopup) { showPopup = false; pauseForWarning = false; return; } // -------------------- STAGE 0 INPUTS -------------------- if (stage == 0) { if (mouseX >= 20 && mouseX <= 430 && mouseY >= 92 && mouseY <= 218) { triggerStage0Pulse(); return; } if (mouseX >= 34 && mouseX <= 416) { if (mouseY >= 262 && mouseY <= 292) { recipientClass = 0; return; } if (mouseY >= 298 && mouseY <= 328) { recipientClass = 1; return; } if (mouseY >= 334 && mouseY <= 364) { recipientClass = 2; return; } } if (mouseX >= 34 && mouseX <= 416 && mouseY >= 436 && mouseY <= 474 && chamberEntropy > 5.0) { chamberEntropy = max(0.0, chamberEntropy - 32.0); zenoPhaseLock = min(100.0, zenoPhaseLock + 4.0); addStage0Log("EVM-Void-Venting: Überschüssige Entropie in den intergalaktischen Void abgeleitet!"); return; } if (mouseX >= 464 && mouseX <= 1062) { if (mouseY >= 134 && mouseY <= 206 && money >= pythonPrice) { money -= pythonPrice; pythonBots++; pythonPrice *= 1.4; addStage0Log("Python Gitter-Scraper auf xqskys.de aktiviert (" + pythonBots + " Instanzen)."); return; } if (mouseY >= 214 && mouseY <= 286 && money >= helenePrice) { money -= helenePrice; heleneProofs++; helenePrice *= 1.45; addStage0Log("Helenes statischer Randintegral-Beweis integriert — Entropie-Drift gesenkt!"); return; } if (mouseY >= 294 && mouseY <= 366 && money >= quadPrice) { money -= quadPrice; quadrupoleArrays++; quadPrice *= 1.5; addStage0Log("Neues Bariumtitanat-Quadrupol-Array (Galinstan-gekühlt) zugeschaltet!"); return; } boolean readyStage1 = (zenoPhaseLock >= 100.0 || money >= 260.0); if (readyStage1 && mouseY >= 382 && mouseY <= 468) { stage = 1; missionMin = 555.0; // 09:15 Uhr Projekt Bielefeld return; } } return; } // -------------------- STAGE 1 INPUTS -------------------- if (stage == 1) { if (mouseX >= 20 && mouseX <= 430 && mouseY >= 92 && mouseY <= 206) { triggerStage1Synthesizer(); return; } if (mouseX >= 34 && mouseX <= 416) { if (mouseY >= 356 && mouseY <= 402 && rawMaterials >= 60) { rawMaterials -= 60; teamMaya++; addStage1Log("Maya Lindemann synchronisiert Originären-Fertigungstoleranzen (< 10^-18 m)."); return; } if (mouseY >= 410 && mouseY <= 456 && rawMaterials >= 110) { rawMaterials -= 110; teamHelene++; addStage1Log("Helene Vormann optimiert den statischen Graph-Laplace-Kernel."); return; } if (mouseY >= 464 && mouseY <= 510 && rawMaterials >= 160) { rawMaterials -= 160; teamVolker++; addStage1Log("Volker kalibriert den 15.625-kHz-Zeilentrafo-Taktgeber (Null Jitter)."); return; } } if (mouseX >= 464 && mouseX <= 1062) { if (!part1Built && mouseY >= 134 && mouseY <= 206 && rawMaterials >= 120) { rawMaterials -= 120; part1Built = true; addStage1Log("1/4: YBCO-Supraleiter-Gussring (Bühring-Metrik Heckring) montiert!"); return; } if (!part2Built && mouseY >= 214 && mouseY <= 286 && rawMaterials >= 260) { rawMaterials -= 260; part2Built = true; addStage1Log("2/4: CNT-Aerogel-Schaum-Mantel (0.0 G Stasis-Zelle) montiert!"); return; } if (!part3Built && mouseY >= 294 && mouseY <= 366 && rawMaterials >= 450) { rawMaterials -= 450; part3Built = true; addStage1Log("3/4: Bariumtitanat-Quadrupol-Fold-Drive integriert!"); return; } if (!part4Built && mouseY >= 374 && mouseY <= 446 && rawMaterials >= 700) { rawMaterials -= 700; part4Built = true; addStage1Log("4/4: Barnaby-Hilbert-Core & 3U-Void-Exo-Scanner einsatzbereit!"); return; } if (part1Built && part2Built && part3Built && part4Built && mouseY >= 456 && mouseY <= 514) { stage = 2; initStage2(); return; } } return; } // -------------------- STAGE 2 INPUTS -------------------- if (stage == 2) { if (s2BriefingOpen) { if (mouseX >= 430 && mouseX <= 670 && mouseY >= 445 && mouseY <= 487) s2BriefingOpen = false; return; } if (gameOver) { if (mouseX >= 370 && mouseX <= 730 && mouseY >= 330 && mouseY <= 372) initStage2(); return; } if (sieg) { if (mouseX >= 370 && mouseX <= 730 && mouseY >= 330 && mouseY <= 372) stage = 3; return; } int hudTop = height - 135; if (mouseY >= hudTop) { if (mouseY >= hudTop + 34 && mouseY <= hudTop + 60) { if (mouseX >= 16 && mouseX <= 138) { activeWeapon = 1; return; } if (mouseX >= 144 && mouseX <= 266) { activeWeapon = 2; return; } if (mouseX >= 272 && mouseX <= 394) { activeWeapon = 3; return; } if (mouseX >= 400 && mouseX <= 522) { activeWeapon = 4; return; } if (mouseX >= 532 && mouseX <= 944 && dockedStation > 0) { convertS2IsotopeAtStation(); return; } } if (mouseY >= hudTop + 7 && mouseY <= hudTop + 29) { if (mouseX >= 660 && mouseX <= 798) { autoAim = !autoAim; return; } if (mouseX >= 806 && mouseX <= 944) { a11yTheme = (a11yTheme + 1) % 3; return; } } return; } if (mouseY > 34 && mouseY < hudTop && mouseButton == LEFT) fireS2Weapon(); return; } // -------------------- STAGE 3 INPUTS -------------------- if (stage == 3) { float shopX = 496, shopY = 86, shopW = 584; if (mouseX >= shopX + 20 && mouseX <= shopX + shopW - 20) { if (mouseY >= shopY + 80 && mouseY <= shopY + 164 && zecEnergyWatts >= 100) { zecEnergyWatts -= 100; dipolNodes++; return; } if (mouseY >= shopY + 176 && mouseY <= shopY + 260 && zecEnergyWatts >= 220 && marsPressure > 40.0) { zecEnergyWatts -= 220; bechResonators++; return; } if (mouseY >= shopY + 272 && mouseY <= shopY + 356 && zecEnergyWatts >= 380 && marsTemp > -12.0) { zecEnergyWatts -= 380; regolithExtractors++; return; } if (mouseY >= shopY + 368 && mouseY <= shopY + 452 && zecEnergyWatts >= 480 && marsWater > 5.0) { zecEnergyWatts -= 480; enthalpyGreenhouses++; return; } if (marsTerraformed && mouseY >= shopY + 480 && mouseY <= shopY + 600) { stage = 4; supplyTimer = 0.0; colonistsArrived = false; triggerStory("BASISBAU VALLES MARINERIS (STAGE 4)", "Mars ist terraformiert! Sammle DTIM-Knoten und fahre Kern, Schild, Abwehr & den Döner/Ayran-ISRU hoch."); return; } } return; } // -------------------- STAGE 4 & 5 INPUTS -------------------- if (stage == 4 || stage == 5) { if (aiUnlocked && !inRebellion && mouseX >= 198 && mouseX <= 320 && mouseY >= 18 && mouseY <= 42) { aiActive = !aiActive; return; } if (mouseX >= 72 && mouseX <= 164 && mouseY >= 49 && mouseY <= 71 && !coreBought && tlwEnergy >= 50.0) { tlwEnergy -= 50.0; coreBought = true; return; } if (mouseX >= 172 && mouseX <= 280 && mouseY >= 49 && mouseY <= 71) { if (!shieldBought && tlwEnergy >= 70.0) { tlwEnergy -= 70.0; shieldBought = true; shieldOn = true; } else if (shieldBought) shieldOn = !shieldOn; return; } if (mouseX >= 288 && mouseX <= 400 && mouseY >= 49 && mouseY <= 71) { if (!defenseBought && tlwEnergy >= 80.0) { tlwEnergy -= 80.0; defenseBought = true; defenseOn = true; } else if (defenseBought) defenseOn = !defenseOn; return; } if (mouseX >= 408 && mouseX <= 526 && mouseY >= 49 && mouseY <= 71 && !isruBought && tlwEnergy >= 90.0) { tlwEnergy -= 90.0; isruBought = true; return; } if (isruBought && mouseX >= 534 && mouseX <= 699 && mouseY >= 49 && mouseY <= 71 && !autoShieldBought && shipPoints >= 200.0) { shipPoints -= 200.0; autoShieldBought = true; return; } if (isruBought && mouseX >= 707 && mouseX <= 872 && mouseY >= 49 && mouseY <= 71 && !autoDefenseBought && shipPoints >= 200.0) { shipPoints -= 200.0; autoDefenseBought = true; return; } if (isruBought && mouseX >= 408 && mouseX <= 573 && mouseY >= 79 && mouseY <= 101) { if (!autoIsruBought && shipPoints >= 150.0) { shipPoints -= 150.0; autoIsruBought = true; autoIsruActive = true; } else if (autoIsruBought) autoIsruActive = !autoIsruActive; return; } if (isruBought && !balanceReached) { if (mouseX >= 72 && mouseX <= 177 && mouseY >= 79 && mouseY <= 101 && tlwEnergy >= 15.0) { tlwEnergy -= 15.0; waterLevel = min(100.0, waterLevel + 12.0); return; } if (mouseX >= 226 && mouseX <= 351 && mouseY >= 79 && mouseY <= 101 && tlwEnergy >= 20.0) { tlwEnergy -= 20.0; greenLevel = min(100.0, greenLevel + 12.0); return; } if (greenLevel >= 10.0 && mouseX >= 581 && mouseX <= 746 && mouseY >= 79 && mouseY <= 101) { greenLevel -= 10.0; tlwEnergy = min(maxEnergy, tlwEnergy + 45.0); return; } } if (stage == 4 && isruBought && mouseX >= width * 0.5 - 210 && mouseX <= width * 0.5 + 210 && mouseY >= 250 && mouseY <= 302) { stage = 5; supplyTimer = 0.0; colonistsArrived = false; triggerStory("KOLONISATION GESTARTET (STAGE 5)", "Die Siedler landen im Valles Marineris! Halte Wasser, Döner/Ayran-Synthese und Handelsbalance stabil."); return; } if (stage == 5 && colonistsArrived) { if (mouseX >= 88 && mouseX <= 318 && mouseY >= 109 && mouseY <= 131) { tradePolicy = (tradePolicy == 0) ? 1 : 0; return; } if (mouseX >= 328 && mouseX <= 513 && mouseY >= 109 && mouseY <= 131 && shipPoints >= 100.0) { shipPoints -= 100.0; colonistCount += 5.0; return; } if (mouseX >= 521 && mouseX <= 706 && mouseY >= 109 && mouseY <= 131 && shipPoints >= 100.0) { shipPoints -= 100.0; if (tradePolicy == 0) satisfaction = min(100.0, satisfaction + 15.0); else stasisLuxurySupply += 100.0; return; } if (!hasSecondShip && mouseX >= 575 && mouseX <= 770 && mouseY >= 18 && mouseY <= 42) { if (shipPoints >= 500.0 && colonistCount >= 50.0) { shipPoints -= 500.0; hasSecondShip = true; ship2X = width * 0.5; ship2Y = height * 0.5; } return; } } } } void triggerStage0Pulse() { clickPulse0 = 1.0; float damp = max(0.35, 1.0 - heleneProofs * 0.15); chamberEntropy = min(100.0, chamberEntropy + 7.5 * damp); float efficiency = (chamberEntropy > 80.0) ? 0.45 : 1.0; zenoPhaseLock = min(100.0, zenoPhaseLock + 4.2 * efficiency); contactsCount += int(random(2.0, 5.0)); if (recipientClass == 0) { viralMultiplier += 0.10; addStage0Log("Preprint auf xqskys.de geteilt -> Viraler P2P-Multiplikator: " + nf(viralMultiplier, 1, 2) + "x"); } else if (recipientClass == 1) { float grant = random(14.0, 32.0) * viralMultiplier; money += grant; addStage0Log("Prof. Barnaby (Cambridge) verifiziert den Hilbert-Kern: +" + nf(grant, 1, 2) + " EUR!"); } else { float grant = random(10.0, 24.0) * viralMultiplier; money += grant; chamberEntropy = max(0.0, chamberEntropy - 9.0); addStage0Log("CNT-Aerogel & Exodiplomatie-Kopplung: +" + nf(grant, 1, 2) + " EUR & Entropie gedämpft."); } } void triggerStage1Synthesizer() { boolean inSweetSpot = (phaseSyncPos >= 0.38 && phaseSyncPos <= 0.62); if (inSweetSpot) { syncStreak++; int yield = 32 + syncStreak * 6; rawMaterials += yield; addStage1Log("RESONANZ-TREFFER (" + syncStreak + "x)! Originären-Synthesizer liefert +" + yield + " u CNT-Aerogel!"); } else { syncStreak = 0; rawMaterials += 14; addStage1Log("Standard-Synthese (+14 u) — Triff das grüne 15.625-kHz-Fenster für doppelte Ausbeute!"); } } void keyPressed() { if (key == 'h' || key == 'H') { a11yTheme = (a11yTheme + 1) % 3; return; } if (stage == 0 && key == ' ') { triggerStage0Pulse(); return; } if (stage == 1 && key == ' ') { triggerStage1Synthesizer(); return; } if (stage == 3 && key == ' ') { zecEnergyWatts += 50; return; } if (stage == 2) { if (key == '1') activeWeapon = 1; if (key == '2') activeWeapon = 2; if (key == '3') activeWeapon = 3; if (key == '4') activeWeapon = 4; if (key == 'f' || key == 'F') convertS2IsotopeAtStation(); if (key == 'e' || key == 'E') autoAim = !autoAim; if (key == ' ') { if (s2BriefingOpen) s2BriefingOpen = false; else fireS2Weapon(); } if (key == 'w' || key == 'W') keyUp = true; if (key == 's' || key == 'S') keyDown = true; if (key == 'a' || key == 'A') keyLeft = true; if (key == 'd' || key == 'D') keyRight = true; if (key == CODED) { if (keyCode == UP) keyUp = true; if (keyCode == DOWN) keyDown = true; if (keyCode == LEFT) keyLeft = true; if (keyCode == RIGHT) keyRight = true; } } } void keyReleased() { if (key == 'w' || key == 'W') keyUp = false; if (key == 's' || key == 'S') keyDown = false; if (key == 'a' || key == 'A') keyLeft = false; if (key == 'd' || key == 'D') keyRight = false; if (key == CODED) { if (keyCode == UP) keyUp = false; if (keyCode == DOWN) keyDown = false; if (keyCode == LEFT) keyLeft = false; if (keyCode == RIGHT) keyRight = false; } } // ============================================================================================== // ENTITÄTEN-KLASSEN (STAGE 2, 4 & 5) // ============================================================================================== class VacuumQuantum { float x, y, phase; VacuumQuantum(float qx, float qy) { x = qx; y = qy; phase = random(TWO_PI); } } class SingularityRift { float x, y, phase; SingularityRift(float rx, float ry) { x = rx; y = ry; phase = random(TWO_PI); } } class MicroAtom { float x, y, vx, vy; int protons, neutrons, electrons, excitedShell, exciteTimer, attackCooldown; boolean hostile, destroyed; MicroAtom(float ax, float ay, int p, int n, int e, boolean isHostile) { x = ax; y = ay; vx = random(-0.4, 0.4); vy = random(-0.4, 0.4); protons = p; neutrons = n; electrons = e; excitedShell = 1; exciteTimer = 0; hostile = isHostile; attackCooldown = int(random(90, 180)); destroyed = false; } } class BosonProjectile { float x, y, vx, vy, energyEv; int kind, life; boolean fromPlayer; BosonProjectile(float sx, float sy, float svx, float svy, int k, float ev, boolean playerOwned) { x = sx; y = sy; vx = svx; vy = svy; kind = k; energyEv = ev; fromPlayer = playerOwned; life = 115; } } class ShockRing { float x, y, r; int col, alpha; ShockRing(float rx, float ry, int c) { x = rx; y = ry; r = 12.0; col = c; alpha = 240; } } class TLWFieldNode { float baseX, baseY; TLWFieldNode(float x, float y) { baseX = x; baseY = y; } void updateAndDisplay(float sx, float sy, float sx2, float sy2) { float x = baseX, y = baseY; float dShip1 = dist(x, y, sx, sy); float dShip2 = dist(x, y, sx2, sy2); if (dShip1 < 140.0) { float f = (140.0 - dShip1) * 0.12; x += cos(atan2(y - sy, x - sx)) * f; y += sin(atan2(y - sy, x - sx)) * f; } if (hasSecondShip && colonistCount >= 50.0 && dShip2 < 100.0) { float f = (100.0 - dShip2) * 0.15; x += cos(atan2(y - sy2, x - sx2)) * f; y += sin(atan2(y - sy2, x - sx2)) * f; } stroke(45, 85, 165, 75); point(x, y); if (baseX < width - 70 && baseY < height - 170) { stroke(38, 74, 140, 48); line(baseX, baseY, x, y); } } } class TLWToken { float x, y; TLWToken(float px, float py) { x = px; y = py; } void display() { noStroke(); fill(0, 255, 210, 75); ellipse(x, y, 22, 22); fill(0, 255, 210, 225); ellipse(x, y, 12, 12); fill(255); ellipse(x, y, 5, 5); } } class Projectile { float x, y, vx, vy; Projectile(float startX, float startY, float targetX, float targetY) { x = startX; y = startY; float angle = atan2(targetY - startY, targetX - startX); vx = cos(angle) * 14.0; vy = sin(angle) * 14.0; } void update() { x += vx; y += vy; } void display() { noStroke(); fill(225, 55, 85, 180); ellipse(x, y, 12, 22); fill(56, 189, 248); ellipse(x, y, 6, 14); fill(255); ellipse(x, y, 3, 8); } boolean isOffScreen() { return (x < 0 || x > width || y < 150 || y > height - 150); } } class Particle { float x, y, vx, vy, alpha; int col, type; Particle(float px, float py, float dirX, float dirY, int c, int t) { x = px; y = py; vx = dirX; vy = dirY; alpha = 255.0; col = c; type = t; } void update() { x += vx; y += vy; if (type == 1) alpha -= 16.0; else { vx *= 0.92; vy *= 0.92; alpha -= 12.0; } } void display() { noStroke(); fill(red(col), green(col), blue(col), alpha); float s = (type == 1) ? 4.0 : 6.0; ellipse(x, y, s, s); } boolean isDead() { return alpha <= 0.0; } }