Implements more abilities
All checks were successful
Build / Build (push) Successful in 47s

This commit is contained in:
2025-06-09 12:10:25 +02:00
parent af0126e413
commit 00005aa4bf
50 changed files with 80425 additions and 20485 deletions

View File

@@ -8,16 +8,10 @@ namespace PkmnLib.Dynamic.Events;
/// For example, when a Pokemon gets hurt by poison, we want to show the purple poison animation and the damage at the
/// same time. This is done by batching the events together.
/// </remarks>
public readonly record struct EventBatchId
public readonly record struct EventBatchId()
{
/// <inheritdoc cref="EventBatchId"/>
public EventBatchId()
{
Id = Guid.NewGuid();
}
/// <summary>
/// The unique identifier for this batch of events.
/// </summary>
public Guid Id { get; init; }
public Guid Id { get; init; } = Guid.NewGuid();
}

View File

@@ -0,0 +1,36 @@
using PkmnLib.Dynamic.Models;
using PkmnLib.Static.Utils;
namespace PkmnLib.Dynamic.Events;
/// <summary>
/// Represents an event that occurs when a Pokémon's status changes.
/// </summary>
public record StatusChangeEvent : IEventData
{
/// <inheritdoc cref="StatusChangeEvent"/>
public StatusChangeEvent(IPokemon pokemon, StringKey? previousStatus, StringKey? newStatus)
{
Pokemon = pokemon;
PreviousStatus = previousStatus;
NewStatus = newStatus;
}
/// <summary>
/// The Pokémon whose status has changed.
/// </summary>
public IPokemon Pokemon { get; }
/// <summary>
/// The new status of the Pokémon after the change.
/// </summary>
public StringKey? NewStatus { get; }
/// <summary>
/// The previous status of the Pokémon before the change.
/// </summary>
public StringKey? PreviousStatus { get; }
/// <inheritdoc />
public EventBatchId BatchId { get; init; }
}

View File

@@ -0,0 +1,18 @@
using PkmnLib.Static.Utils;
namespace PkmnLib.Dynamic.Events;
public class TerrainChangeEvent : IEventData
{
public StringKey? OldTerrain { get; }
public StringKey? NewTerrain { get; }
public TerrainChangeEvent(StringKey? oldTerrain, StringKey? newTerrain)
{
OldTerrain = oldTerrain;
NewTerrain = newTerrain;
}
/// <inheritdoc />
public EventBatchId BatchId { get; init; }
}

View File

@@ -0,0 +1,18 @@
using PkmnLib.Static.Utils;
namespace PkmnLib.Dynamic.Events;
public class WeatherChangeEvent : IEventData
{
public StringKey? OldWeather { get; }
public StringKey? NewWeather { get; }
public WeatherChangeEvent(StringKey? oldWeather, StringKey? newWeather)
{
OldWeather = oldWeather;
NewWeather = newWeather;
}
/// <inheritdoc />
public EventBatchId BatchId { get; init; }
}