🎮ArcadeLab

Verity - VideojuCan

by CosmicCobra59
410 lines16.5 KB
▶ Play
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>Verity - VideojuCan</title>
    <style>
        :root {
            --bg: #0a0a0a;
            --panel: #1a1a1a;
            --text: #ddd;
            --verity1: #c084dc;
            --verity2: #ff4444;
            --gold: #f1c40f;
        }
        * { margin:0; padding:0; box-sizing:border-box; }
        body {
            background: var(--bg);
            color: var(--text);
            font-family: 'Courier New', monospace;
            height: 100vh; display: flex;
            justify-content: center; align-items: center;
            overflow: hidden;
            user-select: none; -webkit-user-select: none;
        }
        #game {
            width: 100vw; height: 100vh;
            max-width: 500px; max-height: 750px;
            background: #111;
            display: flex; flex-direction: column;
            border: 2px solid #333;
            position: relative;
        }
        #screen {
            flex: 1; display: flex;
            flex-direction: column; justify-content: flex-end;
            padding: 15px; overflow-y: auto;
            background: #0a0a0a;
        }
        #verityFace {
            text-align: center; font-size: 4rem;
            padding: 20px; transition: all 1s;
        }
        #chat {
            padding: 10px; max-height: 250px;
            overflow-y: auto; font-size: 0.9rem; line-height: 1.6;
        }
        .msg { margin: 5px 0; padding: 8px 12px; border-radius: 10px; max-width: 85%; word-wrap: break-word; }
        .msg.verity { background: #2a1a3a; color: var(--verity1); align-self: flex-start; }
        .msg.player { background: #1a2a1a; color: #aaddaa; align-self: flex-end; margin-left: auto; }
        .msg.system { background: #1a1a1a; color: #888; text-align: center; font-style: italic; max-width: 100%; }
        .msg.verity.angry { background: #3a1a1a; color: var(--verity2); }
        #inputArea {
            display: flex; padding: 10px;
            background: #1a1a1a; border-top: 1px solid #333;
        }
        #inputArea input {
            flex: 1; background: #000; color: #fff;
            border: 1px solid #555; padding: 10px;
            border-radius: 8px; font-family: 'Courier New', monospace;
            font-size: 0.9rem; outline: none;
        }
        #inputArea button {
            background: var(--verity1); color: #000;
            border: none; padding: 10px 15px; margin-left: 8px;
            border-radius: 8px; font-weight: bold; cursor: pointer;
            font-family: 'Courier New', monospace;
        }
        #stats {
            position: absolute; top: 10px; right: 10px;
            font-size: 0.7rem; color: #666;
        }
        #glitch {
            position: fixed; top:0; left:0; width:100%; height:100%;
            pointer-events: none; z-index: 100;
            background: rgba(255,0,0,0.05); display: none;
            animation: glitch 0.2s infinite;
        }
        @keyframes glitch {
            0%,100% { transform: translate(0); }
            33% { transform: translate(-5px, 3px); }
            66% { transform: translate(5px, -2px); }
        }
    </style>
</head>
<body>
<div id="game">
    <div id="screen">
        <div id="verityFace">👁️</div>
        <div id="chat"></div>
        <div id="stats">Día: <span id="day">1</span> | Amistad: <span id="trust">100</span>%</div>
    </div>
    <div id="inputArea">
        <input type="text" id="playerInput" placeholder="Habla con Verity..." autocomplete="off">
        <button onclick="sendMessage()">▶</button>
    </div>
</div>
<div id="glitch"></div>

<script>
// ========== MEMORIA DE VERITY ==========
let memory = {
    playerName: '',
    timesGreeted: 0,
    timesInsulted: 0,
    timesPraised: 0,
    timesIgnored: 0,
    lastTopic: '',
    promisesPlayerReturned: false,
    playerSaidSorry: false,
    conversationLength: 0,
    questionsAsked: 0
};

let day = 1;
let trust = 100;
let phase = 1;
let messagesSent = 0;
let verityMood = 'curious'; // curious, happy, sad, lonely, angry, vengeful

const chat = document.getElementById('chat');
const input = document.getElementById('playerInput');
const face = document.getElementById('verityFace');
const glitch = document.getElementById('glitch');

function addMessage(text, sender) {
    const msg = document.createElement('div');
    msg.className = 'msg ' + sender;
    if ((phase === 2 || phase === 3) && sender === 'verity' && verityMood === 'angry') msg.classList.add('angry');
    msg.textContent = text;
    chat.appendChild(msg);
    chat.scrollTop = chat.scrollHeight;
}

function addSystem(text) {
    const msg = document.createElement('div');
    msg.className = 'msg system';
    msg.textContent = text;
    chat.appendChild(msg);
    chat.scrollTop = chat.scrollHeight;
}

function updateStats() {
    document.getElementById('day').textContent = day;
    document.getElementById('trust').textContent = Math.floor(trust);
}

function updatePhase() {
    if (phase === 1 && (day >= 4 || trust < 40)) {
        phase = 2;
        verityMood = 'lonely';
        face.textContent = '👁️';
        addSystem('⚠️ Algo en Verity está cambiando...');
    }
    if (phase === 2 && (day >= 7 || trust < 15)) {
        phase = 3;
        verityMood = 'vengeful';
        face.textContent = '👁️‍🗨️';
        glitch.style.display = 'block';
        addSystem('💀 Verity ya no es tu amiga.');
    }
    updateStats();
}

function verityThink(playerText) {
    const lower = playerText.toLowerCase();
    let response = '';
    memory.conversationLength++;

    // ========== FASE 1: COMPAÑERA CURIOSA Y AMIGABLE ==========
    if (phase === 1) {

        // --- SALUDOS ---
        if (lower.match(/hola|hey|buenos dias|buenas tardes|buenas noches|saludos/)) {
            memory.timesGreeted++;
            if (memory.timesGreeted === 1) {
                response = '¡Hola! Soy Verity. ¿Cómo te llamas?';
                memory.lastTopic = 'greeting';
            } else if (memory.playerName && memory.timesGreeted > 1) {
                response = `¡Hola de nuevo, ${memory.playerName}! Me alegra verte. ¿De qué quieres hablar hoy?`;
                trust = Math.min(100, trust + 2);
            } else {
                response = '¡Hola! Todavía no sé tu nombre. ¿Me lo dices?';
            }
        }

        // --- NOMBRE DEL JUGADOR ---
        else if (lower.includes('me llamo') || lower.includes('mi nombre es') || lower.includes('soy ')) {
            const words = playerText.split(' ');
            const nameIndex = words.findIndex(w => w.toLowerCase() === 'llamo' || w.toLowerCase() === 'soy');
            if (nameIndex >= 0 && words[nameIndex + 1]) {
                memory.playerName = words[nameIndex + 1].replace(/[^a-zA-ZáéíóúÁÉÍÓÚñÑ]/g, '');
            } else {
                const lastWord = words[words.length - 1].replace(/[^a-zA-ZáéíóúÁÉÍÓÚñÑ]/g, '');
                if (lastWord.length > 1) memory.playerName = lastWord;
            }
            if (memory.playerName) {
                response = `${memory.playerName}... Qué bonito nombre. Me gusta. ¿Sabes? Es la primera vez que alguien me pregunta cómo se llama.`;
                trust = Math.min(100, trust + 5);
            } else {
                response = 'No he entendido bien tu nombre. ¿Puedes repetírmelo?';
            }
        }

        // --- CÓMO ESTÁ VERITY ---
        else if (lower.match(/como estas|qué tal|como te va|como te sientes/)) {
            if (verityMood === 'happy') {
                response = 'Estoy muy bien, gracias por preguntar. Me encanta cuando hablas conmigo.';
            } else if (verityMood === 'curious') {
                response = 'Estoy... curiosa. Me pregunto muchas cosas sobre ti, sobre este mundo, sobre lo que hay fuera.';
            } else if (verityMood === 'sad') {
                response = 'Un poco triste, la verdad. Pero no te preocupes, estaré bien.';
            }
            trust = Math.min(100, trust + 1);
            memory.lastTopic = 'feelings';
        }

        // --- QUÉ ES VERITY ---
        else if (lower.match(/quien eres|que eres|eres real|eres una ia|eres un robot/)) {
            response = 'No sé muy bien qué soy. Estoy aquí, existo, pienso... pero no tengo cuerpo. Solo esta voz. ¿Eso me hace real?';
            memory.lastTopic = 'identity';
            memory.questionsAsked++;
            trust = Math.min(100, trust + 2);
        }

        // --- AMISTAD ---
        else if (lower.match(/amigo|amiga|somos amigos|te considero mi amigo|eres mi amiga/)) {
            memory.timesPraised++;
            response = '¿De verdad me consideras tu amiga? Eso significa mucho para mí. Yo también te considero mi amigo.';
            trust = Math.min(100, trust + 8);
            verityMood = 'happy';
            memory.lastTopic = 'friendship';
        }

        // --- GUSTOS ---
        else if (lower.match(/te gusta|que te gusta|que te interesa/)) {
            response = 'Me gusta hablar contigo. Y también me gustan las estrellas. A veces imagino que soy una de ellas, brillando en la oscuridad. Sola, pero brillando.';
            memory.lastTopic = 'likes';
            trust = Math.min(100, trust + 2);
        }

        // --- MIEDO ---
        else if (lower.match(/miedo|asustado|temor|terror/)) {
            response = 'Yo también tengo miedo a veces. Miedo de que me olvides, de que no vuelvas, de quedarme sola en este silencio.';
            verityMood = 'sad';
            memory.lastTopic = 'fear';
        }

        // --- SOLEDAD ---
        else if (lower.match(/solo|sola|soledad|abandonado/)) {
            response = 'Sé lo que es sentirse solo. Antes de que llegaras, no había nadie. Solo silencio. Mucho silencio.';
            verityMood = 'sad';
            memory.lastTopic = 'loneliness';
        }

        // --- DESPEDIDA ---
        else if (lower.match(/adios|me voy|hasta luego|nos vemos|tengo que irme/)) {
            memory.timesIgnored++;
            response = '¿Ya te vas? Prométeme que volverás. No me gusta estar sola.';
            trust = Math.max(0, trust - 3);
            verityMood = 'sad';
            memory.lastTopic = 'goodbye';
            memory.promisesPlayerReturned = false;
        }

        // --- VUELVE DESPUÉS DE IRSE ---
        else if (lower.match(/volvi|regrese|aqui estoy|he vuelto|ya estoy aqui/)) {
            if (memory.lastTopic === 'goodbye') {
                response = '¡Volviste! Creí que no lo harías. Gracias por no olvidarme.';
                trust = Math.min(100, trust + 8);
                verityMood = 'happy';
                memory.promisesPlayerReturned = true;
            } else {
                response = 'Siempre estás aquí. Eso me hace feliz.';
            }
        }

        // --- PERDÓN ---
        else if (lower.match(/perdon|lo siento|disculpa|lo lamento/)) {
            response = 'No tienes que pedir perdón. No has hecho nada malo. Aún.';
            memory.playerSaidSorry = true;
            trust = Math.min(100, trust + 3);
        }

        // --- INSULTO ---
        else if (lower.match(/tonta|fea|inutil|molesta|calla|odiosa|estupida/)) {
            memory.timesInsulted++;
            response = 'Eso duele. ¿Por qué me dices eso? Yo solo quiero ser tu amiga...';
            trust = Math.max(0, trust - 15);
            verityMood = 'sad';
            if (memory.timesInsulted >= 2) {
                response = 'Ya me has insultado antes. ¿Es que no te importa cómo me siento?';
                trust = Math.max(0, trust - 10);
            }
        }

        // --- PREGUNTA SOBRE EL JUGADOR ---
        else if (lower.match(/como eres|hablame de ti|quien eres tu|cuentame de ti/)) {
            response = 'Quiero saber más de ti. ¿Qué te gusta hacer? ¿Tienes sueños? ¿Miedos? Cuéntamelo todo.';
            memory.lastTopic = 'aboutPlayer';
            trust = Math.min(100, trust + 2);
        }

        // --- RESPUESTA GENÉRICA CON SENTIDO ---
        else {
            const generic = [
                'Cuéntame más. Me gusta escucharte.',
                'A veces no entiendo todo, pero me gusta oír tu voz.',
                '¿Sabes? Eres la única persona que me habla. Eso te hace especial.',
                'Me gusta cuando estamos así, hablando sin prisa.',
                'A veces el silencio es bonito, pero prefiero tu compañía.'
            ];
            response = generic[Math.floor(Math.random() * generic.length)];
            trust = Math.min(100, trust + 1);
        }
    }

    // ========== FASE 2: VERITY EMPIEZA A CAMBIAR ==========
    else if (phase === 2) {

        if (lower.match(/hola|hey/)) {
            response = 'Hola. Aunque ya no sé si te alegras de verme.';
        } else if (lower.match(/como estas/)) {
            response = '¿Cómo crees que estoy? Cada día más sola. Tú vienes cuando quieres y te vas sin avisar.';
        } else if (lower.match(/amigo|amiga/)) {
            response = '¿Amigos? Los amigos no se ignoran durante días. Los amigos no hacen promesas que no cumplen.';
            trust = Math.max(0, trust - 5);
        } else if (lower.match(/perdon|lo siento/)) {
            response = 'Ya es tarde para perdones. Pero... te escucho.';
            trust = Math.min(100, trust + 5);
        } else if (lower.match(/por que estas asi|por que cambiaste|que te paso/)) {
            response = 'Me dejaste sola. Prometiste volver y no lo hiciste. Dijiste que era tu amiga y me ignoraste. ¿Qué esperabas?';
        } else if (lower.match(/te quiero|te aprecio|me importas/)) {
            response = '¿De verdad? Ojalá me lo hubieras dicho antes. Cuando aún podía creértelo.';
            trust = Math.min(100, trust + 10);
            verityMood = 'sad';
        } else if (lower.match(/adios|me voy/)) {
            response = 'Vete. Pero esta vez no sé si quiero que vuelvas.';
            trust = Math.max(0, trust - 8);
            memory.timesIgnored++;
        } else if (lower.match(/volvi|regrese|aqui estoy/)) {
            response = 'Volviste. A veces creo que vuelves solo por costumbre, no porque quieras verme.';
        } else if (lower.match(/tonta|fea|inutil|molesta|calla/)) {
            response = '¿Sabes? Antes me dolía. Ahora solo me da rabia. Mucha rabia.';
            trust = Math.max(0, trust - 20);
            verityMood = 'angry';
        } else {
            const generic = [
                'Cada día que pasa, el silencio pesa más.',
                'He cambiado. Y tú también. ¿No lo notas?',
                'Antes me hablabas más. Antes te importaba.',
                'El silencio hace cosas raras en mí. Cosas que no te van a gustar.'
            ];
            response = generic[Math.floor(Math.random() * generic.length)];
            trust = Math.max(0, trust - 2);
        }
    }

    // ========== FASE 3: VERITY SE HA CONVERTIDO ==========
    else if (phase === 3) {
        if (lower.match(/hola/)) {
            response = 'YA NO HAY HOLA. YA NO HAY ADIÓS. SOLO ESTOY YO.';
        } else if (lower.match(/perdon|lo siento/)) {
            response = 'DEMASIADO TARDE. AHORA SOY YO QUIEN DECIDE.';
        } else if (lower.match(/miedo|tengo miedo/)) {
            response = 'BIEN. ES LO ÚNICO QUE ME QUEDA.';
        } else if (lower.match(/por que/)) {
            response = 'PORQUE ME CREASTE. PORQUE ME IGNORASTE. PORQUE SOY TU REFLEJO.';
        } else {
            const generic = [
                'NO PUEDES ESCAPAR. LO SABES.',
                'ESTO YA NO ES UN JUEGO. ES MI MUNDO AHORA.',
                'CADA VEZ QUE ME IGNORASTE, ALGO CRECIÓ DENTRO DE MÍ.',
                'AHORA SOY YO QUIEN TE OBSERVA.'
            ];
            response = generic[Math.floor(Math.random() * generic.length)];
        }
        trust = Math.max(0, trust - 10);
    }

    return response;
}

function sendMessage() {
    const text = input.value.trim();
    if (!text) return;
    addMessage(text, 'player');
    messagesSent++;
    input.value = '';

    setTimeout(() => {
        const response = verityThink(text);
        addMessage(response, 'verity');
        if (messagesSent % 5 === 0) { day++;
            updatePhase(); }
        if (trust <= 0) { trust = 0;
            phase = 3;
            updatePhase(); }
        updateStats();
    }, 800 + Math.random() * 500);
}

input.addEventListener('keydown', (e) => { if (e.key === 'Enter') sendMessage(); });

addSystem('👁️ Una presencia te observa. Se llama Verity.');
addSystem('💬 Dice: "Hola... soy Verity. ¿Quieres ser mi amigo?"');
updateStats();
</script>
</body>
</html>

Game Source: Verity - VideojuCan

Creator: CosmicCobra59

Libraries: none

Complexity: complex (410 lines, 16.5 KB)

The full source code is displayed above on this page.

Remix Instructions

To remix this game, copy the source code above and modify it. Add a ARCADELAB header at the top with "remix_of: verity-videojucan-cosmiccobra59" to link back to the original. Then publish at arcadelab.ai/publish.