// ==UserScript== // @name Diamond Engine // @namespace http://tampermonkey.net/ // @version 1.0 // @description The Diamond Engine is connected to Drawaria.online's stories and is designed for Decorations. It's made for the Diamond Queen and it serves a critical role in the story to save the game. // @author YouTubeDrawaria // @include https://drawaria.online/* // @include https://.drawaria.online/ // @grant GM_addStyle // @grant GM_xmlhttpRequest // @connect myinstants.com // @connect ibb.co // @run-at document-start // @icon https://i.ibb.co/zV5sXzkz/diamond2.gif // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; // 1. CONFIGURACIÓN DE URLS Y SONIDOS const STARTUP_SOUND_URL = 'https://www.myinstants.com/media/sounds/windows-vista-beta-2006-startup.mp3'; const CLICK_SOUND_URL = 'https://www.myinstants.com/media/sounds/pisseim-mund-online-audio-converter.mp3'; const GIF_ICON_URL = 'https://i.ibb.co/zV5sXzkz/diamond2.gif'; function playSound(url) { GM_xmlhttpRequest({ method: 'GET', url: url, responseType: 'arraybuffer', onload: function(response) { try { const context = new (window.AudioContext || window.webkitAudioContext)(); context.decodeAudioData(response.response, function(buffer) { const source = context.createBufferSource(); source.buffer = buffer; source.connect(context.destination); source.start(0); }); } catch (e) { console.error('Diamond Engine Error: Error al reproducir sonido:', e); } } }); } // 2. ESTILOS CSS GM_addStyle(` @import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&display=swap'); #diamond-gif-container { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 99999; cursor: pointer; transition: opacity 0.5s; } #diamond-gif { width: 100px; height: 100px; animation: spin 4s linear infinite, float 3s ease-in-out infinite alternate; } @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @keyframes float { 0% { transform: translateY(0px); } 100% { transform: translateY(-15px); } } #diamond-engine-container, #options-container, #game-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 99998; background-color: rgba(0, 0, 0, 0.95); display: none; overflow: auto; justify-content: center; align-items: center; } #diamond-engine-svg { display: block; margin: 50px auto; max-width: 900px; height: auto; } #options-svg { display: block; margin: 50px auto; max-width: 800px; height: auto; } #game-iframe { width: 100%; height: 100%; border: none; display: block; } .game-back-btn { position: absolute; top: 10px; right: 10px; padding: 10px 20px; background: #008B8B; color: #E0FFFF; border: 2px solid #00CED1; box-shadow: 0 0 5px #00CED1; cursor: pointer; font-family: 'Orbitron', sans-serif; font-size: 14px; z-index: 100001; transition: background 0.3s; } .game-back-btn:hover { background: #00CED1; } `); // 3. CONTENIDO SVG PRINCIPAL (MENU DE INICIO) const DIAMOND_ENGINE_SVG_CONTENT = ` Diamond Engine Options `; // 4. CONTENIDO SVG OPCIONES (HOLOGRÁFICO) const OPTIONS_SVG_CONTENT = ` DIMENSION GATE SELECT DESTINATION SIMULATION 01VELOCIDAD DE ESQUIRLA SIMULATION 02PRISMA LÓGICO SIMULATION 03FLUIDO DE NEÓN SIMULATION 04RED CUÁNTICA SIMULATION 05CAVERNAS ECO SIMULATION 06GRAVEDAD CERO BACK `; // 5. CODIGOS DE LOS JUEGOS (EXPANDIDOS PARA EVITAR DETECCIÓN DE MINIFICACIÓN) const GAME1_HTML = `
SCORE: 0
CLICK TO START
AVOID THE SHARDS
`; const GAME2_HTML = `

LOGIC PRISM

CLICK PRISMS TO ROTATE // CONNECT THE BEAM

SYSTEM SYNCED
GENERATING NEW PUZZLE...
`; const GAME3_HTML = `
System: Fluid Dynamics v3.0
Interaction: Hover / Click
`; const GAME4_HTML = `
CORE INTEGRITY: 100%
ENERGY: 100
WAVE: 1

SYSTEM BREACHED

`; const GAME5_HTML = `
ECHO CAVERNS
MOVE: WASD or ARROWS | SONAR PULSE: SPACE
`; const GAME6_HTML = `
ORBITAL THRUSTERS
SHARDS COLLECTED: 0

CRITICAL FAILURE

COLLISION DETECTED

`; // 6. ESTRUCTURA Y LÓGICA DEL ENGINE let gifContainer, engineContainer, optionsContainer, gameContainer; function initElements() { gifContainer = document.createElement('div'); gifContainer.id = 'diamond-gif-container'; gifContainer.innerHTML = `Diamond Engine`; document.body.appendChild(gifContainer); engineContainer = document.createElement('div'); engineContainer.id = 'diamond-engine-container'; engineContainer.innerHTML = `${DIAMOND_ENGINE_SVG_CONTENT}`; document.body.appendChild(engineContainer); optionsContainer = document.createElement('div'); optionsContainer.id = 'options-container'; optionsContainer.innerHTML = `${OPTIONS_SVG_CONTENT}`; document.body.appendChild(optionsContainer); gameContainer = document.createElement('div'); gameContainer.id = 'game-container'; gameContainer.innerHTML = ` `; document.body.appendChild(gameContainer); } function showView(view) { [engineContainer, optionsContainer, gameContainer, gifContainer].forEach(el => { if (el) el.style.display = 'none'; }); if (view === 'engine') { engineContainer.style.display = 'flex'; } else if (view === 'options') { optionsContainer.style.display = 'flex'; } else if (view === 'game') { gameContainer.style.display = 'block'; } else if (view === 'gif') { gifContainer.style.display = 'block'; } } function loadGame(gameContent) { const iframe = document.getElementById('game-iframe'); showView('game'); iframe.srcdoc = gameContent; } // 7. MANEJADORES DE EVENTOS function handleGifClick() { gifContainer.style.opacity = '0'; setTimeout(() => { showView('engine'); gifContainer.style.opacity = '1'; }, 500); playSound(STARTUP_SOUND_URL); setupEngineListeners(); } function setupEngineListeners() { const optionsButton = document.querySelector('#diamond-engine-svg g#options'); if (optionsButton) { const newOptionsButton = optionsButton.cloneNode(true); optionsButton.parentNode.replaceChild(newOptionsButton, optionsButton); newOptionsButton.addEventListener('click', handleOptionsClick); } } function handleOptionsClick() { playSound(CLICK_SOUND_URL); showView('options'); setupOptionsListeners(); } function setupOptionsListeners() { const optionsSvg = document.getElementById('options-svg'); if (!optionsSvg) return; // Mapeo de botones del SVG a las variables de los juegos const gameButtons = [ { selector: '#btn-group-left > g:nth-child(1)', content: GAME1_HTML }, // VELOCIDAD { selector: '#btn-group-left > g:nth-child(2)', content: GAME2_HTML }, // PRISMA { selector: '#btn-group-left > g:nth-child(3)', content: GAME3_HTML }, // FLUIDO { selector: '#btn-group-right > g:nth-child(1)', content: GAME4_HTML }, // RED { selector: '#btn-group-right > g:nth-child(2)', content: GAME5_HTML }, // CAVERNAS { selector: '#btn-group-right > g:nth-child(3)', content: GAME6_HTML }, // GRAVEDAD ]; gameButtons.forEach(btn => { const el = optionsSvg.querySelector(btn.selector); if (el) { const newEl = el.cloneNode(true); el.parentNode.replaceChild(newEl, el); newEl.addEventListener('click', () => { playSound(CLICK_SOUND_URL); loadGame(btn.content); }); } }); // Botón BACK // En el nuevo SVG el botón back es el último grupo con texto BACK const backBtnSpecific = optionsSvg.querySelector('g[transform="translate(200, 420)"]'); if (backBtnSpecific) { const newBack = backBtnSpecific.cloneNode(true); backBtnSpecific.parentNode.replaceChild(newBack, backBtnSpecific); newBack.addEventListener('click', () => { playSound(CLICK_SOUND_URL); showView('engine'); }); } } function handleGameBackClick() { playSound(CLICK_SOUND_URL); showView('options'); // Opcional: Recargar el iframe con vacío para detener el juego anterior const iframe = document.getElementById('game-iframe'); iframe.srcdoc = ''; } // 8. INICIALIZACIÓN document.addEventListener('DOMContentLoaded', function() { initElements(); gifContainer.addEventListener('click', handleGifClick, { once: true }); const gameBackBtn = gameContainer.querySelector('.game-back-btn'); gameBackBtn.addEventListener('click', handleGameBackClick); showView('gif'); }); })();