More move effects
This commit is contained in:
31
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Fling.cs
Normal file
31
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Fling.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using PkmnLib.Static;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "fling")]
|
||||
public class Fling : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref byte basePower)
|
||||
{
|
||||
var item = move.User.HeldItem;
|
||||
if (item == null)
|
||||
{
|
||||
move.GetHitData(target, hit).Fail();
|
||||
return;
|
||||
}
|
||||
|
||||
if (item.Category is ItemCategory.FormChanger or ItemCategory.Pokeball or ItemCategory.Mail
|
||||
or ItemCategory.KeyItem or ItemCategory.TmHm)
|
||||
{
|
||||
move.GetHitData(target, hit).Fail();
|
||||
return;
|
||||
}
|
||||
|
||||
basePower = item.FlingPower;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit) =>
|
||||
move.User.RemoveHeldItemForBattle();
|
||||
}
|
||||
Reference in New Issue
Block a user