From 58b3345f6abea95c6bceec9c9e54364400d09176 Mon Sep 17 00:00:00 2001 From: dazedanon Date: Sun, 21 Dec 2025 13:01:22 -0600 Subject: [PATCH] Show enemies on minimap --- js/plugins/MinimapZoom.js | 67 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 4 deletions(-) diff --git a/js/plugins/MinimapZoom.js b/js/plugins/MinimapZoom.js index 73e0773..c1bed41 100644 --- a/js/plugins/MinimapZoom.js +++ b/js/plugins/MinimapZoom.js @@ -954,7 +954,7 @@ const lineHeight = 24; const padding = 15; const panelWidth = 120; - const panelHeight = 35 + 4 * lineHeight + padding; + const panelHeight = 35 + 5 * lineHeight + padding; // Create legend sprite this._legendPanel = new Sprite(); @@ -1029,15 +1029,25 @@ ctx.stroke(); bitmap.drawText('Locked', legendX + dotSize + 8, startY + lineHeight * 2 + 2, 80, 18, 'left'); - // Exit/Transfer marker (eerie green) - ctx.fillStyle = '#7cfc00'; + // Enemy marker (blood red) + ctx.fillStyle = '#dc143c'; ctx.beginPath(); ctx.arc(legendX + dotSize/2, startY + lineHeight * 3 + dotSize/2 + 5, dotSize/2, 0, Math.PI * 2); ctx.fill(); ctx.strokeStyle = '#2a1a00'; ctx.lineWidth = 1; ctx.stroke(); - bitmap.drawText('Passage', legendX + dotSize + 8, startY + lineHeight * 3 + 2, 80, 18, 'left'); + bitmap.drawText('Enemy', legendX + dotSize + 8, startY + lineHeight * 3 + 2, 80, 18, 'left'); + + // Exit/Transfer marker (eerie green) + ctx.fillStyle = '#7cfc00'; + ctx.beginPath(); + ctx.arc(legendX + dotSize/2, startY + lineHeight * 4 + dotSize/2 + 5, dotSize/2, 0, Math.PI * 2); + ctx.fill(); + ctx.strokeStyle = '#2a1a00'; + ctx.lineWidth = 1; + ctx.stroke(); + bitmap.drawText('Passage', legendX + dotSize + 8, startY + lineHeight * 4 + 2, 80, 18, 'left'); // Position panel to the left of the map this._legendPanelOffset = 20; // Gap between map and panel @@ -1378,6 +1388,18 @@ ctx.stroke(); } else if (this.isMapTransfer(event)) { // Skip - transfers are drawn as numbered markers by createExitMarkers() + } else if (this.isEnemyEvent(event)) { + // Draw enemy marker (blood red) + ctx.fillStyle = '#dc143c'; + ctx.shadowColor = '#dc143c'; + ctx.shadowBlur = 4; + ctx.beginPath(); + ctx.arc(ex, ey, markerSize, 0, Math.PI * 2); + ctx.fill(); + ctx.shadowBlur = 0; + ctx.strokeStyle = '#4a0a0a'; + ctx.lineWidth = 2; + ctx.stroke(); } else if (this.isImportantEvent(event)) { // Draw NPC marker (warm gold) ctx.fillStyle = '#daa520'; @@ -1497,6 +1519,43 @@ return this.isLockedDoorOrChest(event); }; + // Check if an event is an enemy (triggers battle) + Scene_Map.prototype.isEnemyEvent = function(event) { + if (!event) return false; + + // Get the current active page - if no page is active, event is not visible + const page = event.page(); + if (!page) return false; + + // Must have a character graphic on the current page (enemy is visible) + if (!page.image || !page.image.characterName) return false; + + // Get the event data + const eventData = event.event(); + if (!eventData) return false; + + // Check for tag in the event note (this game's primary enemy marker) + const note = eventData.note || ''; + if (note.includes('')) return true; + + // Check event name for specific enemy patterns used in this game + const name = eventData.name; + if (name.includes('エネミーシンボル')) return true; // "Enemy Symbol" + if (name.includes('ボス') && !name.includes('移動')) return true; // "Boss" but not transfer events + + // Check the current page for Battle Processing command (code 301) + const list = page.list; + if (!list) return false; + + for (const cmd of list) { + if (cmd.code === 301) { // Battle Processing command + return true; + } + } + + return false; + }; + // Determine if an event is "important" (NPC, not decoration/ambient) Scene_Map.prototype.isImportantEvent = function(event) { if (!event) return false;