'use strict'; const WEAPONS = [ { id: 'sword', name: 'Sword', damage: 3, type: 'melee', range: 1, cooldown: 400, ammo: null, ammoCost: 1, color: '#C0C0C0', effect: null, drawFunction: 'drawSword', description: 'A basic sword. Reliable and versatile.' }, { id: 'bow', name: 'Bow', damage: 2, type: 'ranged', range: 8, cooldown: 800, ammo: 'arrow', ammoCost: 1, color: '#8B4513', effect: null, drawFunction: 'drawBow', description: 'Shoots arrows at distant foes.' }, { id: 'boomerang', name: 'Boomerang', damage: 2, type: 'ranged', range: 5, cooldown: 1200, ammo: null, ammoCost: 1, color: '#FF8C00', effect: 'stun', drawFunction: 'drawBoomerang', description: 'Returns to hand. Stuns enemies on hit.' }, { id: 'hammer', name: 'Hammer', damage: 5, type: 'melee', range: 2, cooldown: 1000, ammo: null, ammoCost: 1, color: '#8B4513', effect: null, drawFunction: 'drawHammer', description: 'Heavy weapon. Breaks walls and cracks blocks.' }, { id: 'bomb', name: 'Bomb', damage: 4, type: 'consumable', range: 2, cooldown: 600, ammo: 'bomb', ammoCost: 1, color: '#8B4513', effect: 'explode', drawFunction: 'drawBomb', description: 'Creates an explosion. Destroys breakable blocks.' }, { id: 'fire_rod', name: 'Fire Rod', damage: 3, type: 'ranged', range: 6, cooldown: 1000, ammo: 'magic', ammoCost: 1, color: '#FF4500', effect: 'fire', drawFunction: 'drawFireRod', description: 'Shoots fireballs. Burns enemies over time.' }, { id: 'ice_rod', name: 'Ice Rod', damage: 2, type: 'ranged', range: 5, cooldown: 1200, ammo: 'magic', ammoCost: 1, color: '#87CEEB', effect: 'ice', drawFunction: 'drawIceRod', description: 'Freezes enemies in place.' }, { id: 'hookshot', name: 'Hookshot', damage: 1, type: 'ranged', range: 8, cooldown: 1500, ammo: null, ammoCost: 1, color: '#C0C0C0', effect: null, drawFunction: 'drawHookshot', description: 'Grapples to targets across gaps.' }, { id: 'master_sword', name: 'Master Sword', damage: 5, type: 'melee', range: 1, cooldown: 350, ammo: null, ammoCost: 1, color: '#FFD700', effect: null, drawFunction: 'drawMasterSword', description: 'The legendary blade of the hero.' }, { id: 'magic_sword', name: 'Magic Sword', damage: 6, type: 'melee', range: 2, cooldown: 500, ammo: 'magic', ammoCost: 1, color: '#9400D3', effect: 'stun', drawFunction: 'drawMagicSword', description: 'Deals magic damage and stuns foes.' }, { id: 'slingshot', name: 'Slingshot', damage: 1, type: 'ranged', range: 5, cooldown: 600, ammo: null, ammoCost: 1, color: '#8B4513', effect: null, drawFunction: 'drawSlingshot', description: 'Simple but effective. No ammo needed.' }, { id: 'bug_net', name: 'Bug Net', damage: 1, type: 'melee', range: 1, cooldown: 500, ammo: null, ammoCost: 1, color: '#87CEEB', effect: null, drawFunction: 'drawBugNet', description: 'Captures small creatures.' } ]; function getWeapon(id) { return WEAPONS.find(w => w.id === id); } if (typeof module !== 'undefined' && module.exports) { module.exports = { WEAPONS, getWeapon }; }