23 lines
675 B
C#
23 lines
675 B
C#
namespace PkmnLib.Plugin.Gen7.Scripts.Status;
|
|
|
|
[Script(ScriptCategory.Status, "paralyzed")]
|
|
public class Paralyzed : Script, IScriptChangeSpeed, IScriptPreventMove
|
|
{
|
|
/// <inheritdoc />
|
|
public void ChangeSpeed(ITurnChoice choice, ref uint speed)
|
|
{
|
|
speed = (uint)(speed * 0.5f);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public void PreventMove(IExecutingMove move, ref bool prevent)
|
|
{
|
|
if (move.Battle.Random.GetInt(0, 100) >= 25)
|
|
return;
|
|
prevent = true;
|
|
move.Battle.EventHook.Invoke(new DialogEvent("paralysis_prevent_move", new Dictionary<string, object>
|
|
{
|
|
{ "pokemon", move.User },
|
|
}));
|
|
}
|
|
} |