2024-07-20 11:51:52 +00:00
|
|
|
using PkmnLib.Static.Utils;
|
|
|
|
|
|
|
|
namespace PkmnLib.Static.Moves;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// A secondary effect is an effect on a move that happens after it hits.
|
|
|
|
/// </summary>
|
|
|
|
public interface ISecondaryEffect
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// The chance in percentages that the effect triggers. When less than 0, the effect is always active.
|
|
|
|
/// </summary>
|
|
|
|
public float Chance { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The name of the effect.
|
|
|
|
/// </summary>
|
|
|
|
public StringKey Name { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Parameters for the effect.
|
|
|
|
/// </summary>
|
2024-08-18 12:22:50 +00:00
|
|
|
public IReadOnlyDictionary<StringKey, object?> Parameters { get; }
|
2024-07-20 11:51:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public class SecondaryEffectImpl : ISecondaryEffect
|
|
|
|
{
|
|
|
|
/// <inheritdoc cref="SecondaryEffectImpl" />
|
2024-08-18 12:22:50 +00:00
|
|
|
public SecondaryEffectImpl(float chance, StringKey name, IReadOnlyDictionary<StringKey, object?> parameters)
|
2024-07-20 11:51:52 +00:00
|
|
|
{
|
|
|
|
Chance = chance;
|
|
|
|
Name = name;
|
|
|
|
Parameters = parameters;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public float Chance { get; }
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public StringKey Name { get; }
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2024-08-18 12:22:50 +00:00
|
|
|
public IReadOnlyDictionary<StringKey, object?> Parameters { get; }
|
2024-07-20 11:51:52 +00:00
|
|
|
}
|