add-event-listener

Register and manage battle event listeners with callback functions and conditional logic.

13|5|Updated Apr 6, 2023
One-click install
npx skills add https://github.com/ewei068/pokestar --skill add-event-listener
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-event-listener
Source: https://github.com/ewei068/pokestar/tree/main/.cursor/skills/add-event-listener
Command: npx skills add https://github.com/ewei068/pokestar --skill add-event-listener

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a structured way to register and manage listeners for various battle events, enabling abilities, effects, and items to react dynamically to game occurrences.

Core Features & Use Cases

  • Event Subscription: Allows components to subscribe to specific battle events (e.g., BEFORE_DAMAGE, AFTER_FAINT).
  • Conditional Logic: Supports custom conditions for event triggers using callback functions.
  • Argument Modification: Enables modification of event arguments to alter battle outcomes.
  • Use Case: Implement an ability that heals a Pokémon by 10% of its max HP at the end of every turn, or an item that grants immunity to a specific move type.

Quick Start

Use the add-event-listener skill to register a listener that triggers when a Pokemon faints.

Frequently Asked Questions about add-event-listener

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I register a callback for battle events in a game engine?

Registering a callback for battle events involves subscribing to specific game states like damage or turn progression. Components can react dynamically to these game occurrences through conditional logic and argument modification.

How does conditional logic work when triggering battle event listeners?

Conditional logic for battle event listeners uses custom callback functions to evaluate game states before triggering. This allows abilities and items to react dynamically only when specific conditions are met during battle progression.

Can I modify battle outcomes by altering event arguments?

Modifying battle outcomes is possible by altering event arguments during listener execution. This enables dynamic adjustments to damage calculations and status effects, allowing abilities to change battle results dynamically.

What's the best way to implement a conditional healing ability in a battle system?

Implementing conditional healing requires subscribing to turn progression events with a callback function. The listener checks game states and modifies event arguments to heal a Pokémon by a percentage of max HP.

Do I need event emission capabilities to use battle event listeners?

Event emission capabilities are required to integrate battle event listeners effectively. The system must emit game state events like fainting or damage, allowing registered callbacks to respond and modify arguments dynamically.