// ==UserScript== // @name [Pokechill] Dummy Target in VS (木桩对战) // @namespace https://play-pokechill.github.io/ // @version 1.2.1 // @description 在对战VS中添加一个无限血量的图图犬测试木桩。 // @author 人民当家做主 // @icon https://play-pokechill.github.io/img/icons/icon.png // @match https://play-pokechill.github.io/* // @match https://g1tyx.github.io/play-pokechill/* // @grant none // ==/UserScript== (function() { 'use strict'; const dummyAreaId = 'dummyTarget'; // 等待游戏核心加载 function waitForGame() { if (typeof areas === 'undefined' || typeof pkmn === 'undefined' || typeof move === 'undefined') { setTimeout(waitForGame, 200); return; } console.log('[DummyVS] 游戏核心已加载,开始注入(单卡片修复版)...'); injectDummyTarget(); } waitForGame(); function injectDummyTarget() { // ---------- 1. 注册木桩区域 ---------- if (!areas[dummyAreaId]) { areas[dummyAreaId] = { name: `🪵 Dummy Target`, background: 'gym', sprite: 'smeargle', trainer: true, type: 'vs', level: 100, team: { slot1: pkmn.smeargle, slot1Moves: [move.tackle.id, undefined, undefined, undefined] }, dummy: true, defeated: false, unlockRequirement: () => true, reward: [] }; } // ---------- 2. 备份原函数 ---------- const originalSetWildPkmn = setWildPkmn; const originalExploreCombatPlayer = exploreCombatPlayer; const originalExploreCombatWild = exploreCombatWild; // ---------- 3. 重写 setWildPkmn ---------- setWildPkmn = function() { if (saved.currentArea === dummyAreaId) { barProgressWild = 0; exploreCombatWildTurn = 1; // 隐藏无关指示器 ['team-indicator', 'spiraling-indicator', 'factory-indicator', 'training-indicator', 'raid-timer-indicator'] .forEach(id => document.getElementById(id) && (document.getElementById(id).style.display = 'none')); const dummyPkmnId = 'smeargle'; saved.currentPkmn = dummyPkmnId; wildLevel = 100; wildPkmnHp = 200000; // 正常血量,可自行修改 wildPkmnHpMax = 200000; // 更新UI document.getElementById('explore-wild-name').innerHTML = format(dummyPkmnId) + ' lvl 100'; const sprite = document.getElementById('explore-wild-sprite'); sprite.src = `img/pkmn/sprite/${dummyPkmnId}.png`; if (pkmn[dummyPkmnId]?.float) sprite.classList.add('floating-pkmn'); else sprite.classList.remove('floating-pkmn'); document.getElementById('explore-wild-sprite-data').dataset.pkmn = dummyPkmnId; // 设置招式(仅撞击) const moves = [move.tackle.id, undefined, undefined, undefined]; const container = document.getElementById('explore-header-moves-wild'); container.innerHTML = ''; for (let i = 0; i < 4; i++) { const moveId = moves[i]; if (!moveId) { const emptyDiv = document.createElement('div'); emptyDiv.className = 'pkmn-movebox'; emptyDiv.style.pointerEvents = 'none'; emptyDiv.style.opacity = '0.3'; container.appendChild(emptyDiv); continue; } const moveDiv = document.createElement('div'); moveDiv.className = 'pkmn-movebox'; moveDiv.style.borderColor = returnTypeColor(move[moveId].type); moveDiv.id = `pkmn-movebox-wild-${i+1}`; moveDiv.innerHTML = `
${format(moveId)}