Implements several more moves
This commit is contained in:
20
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Conversion.cs
Normal file
20
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Conversion.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Linq;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "conversion")]
|
||||
public class Conversion : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var moveType = move.User.Moves.WhereNotNull().FirstOrDefault()?.MoveData.MoveType;
|
||||
if (moveType == null)
|
||||
{
|
||||
move.GetHitData(target, hit).Fail();
|
||||
return;
|
||||
}
|
||||
move.User.SetTypes([moveType.Value]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user