/** * Base Skill class */ export class Skill { constructor(id, name, cooldown = 2.0) { this.id = id; this.name = name; this.cooldown = cooldown; this.description = ''; } /** * Activate the skill * @param {Entity} caster - Entity using the skill * @param {Engine} engine - Game engine * @returns {boolean} - Whether skill was successfully activated */ activate(_caster, _engine) { // Override in subclasses return false; } /** * Check if skill can be used */ canUse(caster, _engine) { const skills = caster.getComponent('Skills'); if (!skills) return false; return !skills.isOnCooldown(this.id); } }