This commit is contained in:
2026-01-16 02:43:46 +01:00
parent bc2225ad64
commit 3ae8d39f9c
218 changed files with 87850 additions and 353 deletions

View File

@@ -266,6 +266,83 @@ class VisualEnhancementSystem {
return { overlay: fogOverlay, particles: fogParticles };
}
// ========== NOIR & PSYCHOLOGICAL EFFECTS (AA) ==========
createVignette() {
// Noir Vignette - Dark corners, focus on center
const width = this.scene.cameras.main.width;
const height = this.scene.cameras.main.height;
const vignette = this.scene.add.graphics();
vignette.setScrollFactor(0);
vignette.setDepth(9000); // Very high depth (UI)
const radius = Math.max(width, height) * 0.8;
// Create a texture for the gradient simply because fillRadialGradient acts weird with alpha sometimes,
// but let's try standard Phaser gradient first.
// Actually, for a pure vignette, a black overlay with a distinct "hole" is often better.
vignette.fillGradientStyle(0x000000, 0x000000, 0x000000, 0x000000, 0, 0, 1, 1);
// Fallback: use a simple texture method if gradient fails, but let's stick to a robust approach:
// Use a black rectangle with a 'mask' or a pre-made vignette png?
// Let's use a code-generated texture for performance and strict control.
const canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
const ctx = canvas.getContext('2d');
const grd = ctx.createRadialGradient(width / 2, height / 2, width * 0.2, width / 2, height / 2, width * 0.7);
grd.addColorStop(0, "rgba(0,0,0,0)");
grd.addColorStop(1, "rgba(0,0,0,0.85)"); // Dark noir edges
ctx.fillStyle = grd;
ctx.fillRect(0, 0, width, height);
// Add texture to Phaser
if (this.scene.textures.exists('vignette_texture')) {
this.scene.textures.remove('vignette_texture');
}
this.scene.textures.addCanvas('vignette_texture', canvas);
const sprite = this.scene.add.sprite(width / 2, height / 2, 'vignette_texture');
sprite.setScrollFactor(0);
sprite.setDepth(9000);
sprite.setAlpha(0.9);
this.vignette = sprite;
return sprite;
}
createAmnesiaBlur() {
// "The Awakening" - Full screen blur that slowly clears
// Uses Phaser 3 PostFX
if (!this.scene.cameras.main.postFX) return;
const blur = this.scene.cameras.main.postFX.addBlur(1, 2, 2, 1); // High strength start
// Tween to clear
this.scene.tweens.add({
targets: blur,
strength: 0,
duration: 4000, // 4 seconds awakening
ease: 'Power2',
onComplete: () => {
this.scene.cameras.main.postFX.remove(blur);
}
});
// Also fade in generic brightness
this.scene.cameras.main.setAlpha(0);
this.scene.tweens.add({
targets: this.scene.cameras.main,
alpha: 1,
duration: 2000,
ease: 'Linear'
});
}
// ========== LIGHTING SYSTEM ==========
initLightingSystem() {