Files
PkmnLib.NET/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/MeanLook.cs
Deukhoofd d2a82b5fe3
All checks were successful
Build / Build (push) Successful in 3m12s
Many more tests and fixes
2026-08-27 17:11:12 +02:00

24 lines
757 B
C#

using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "mean_look")]
public class MeanLook : Script, IScriptOnSecondaryEffect
{
private static StringKey GhostTypeName => new("ghost");
/// <inheritdoc />
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
{
if (target.Types.Any(x => x.Name == GhostTypeName))
return;
var targetEffect = target.Volatile.Add(new MeanLookEffectTarget());
if (targetEffect == null)
{
move.GetHitData(target, hit).Fail();
return;
}
var userEffect = new MeanLookEffectUser(targetEffect);
move.User.Volatile.Add(userEffect);
}
}