Implement most pokeballs
All checks were successful
Build / Build (push) Successful in 1m2s

This commit is contained in:
2025-07-20 11:15:45 +02:00
parent db3f7f2403
commit 77d7b86a3c
19 changed files with 452 additions and 38 deletions

View File

@@ -0,0 +1,32 @@
using PkmnLib.Static.Species;
namespace PkmnLib.Plugin.Gen7.Scripts.Items.Pokeballs;
[ItemScript("moon_ball")]
public class MoonBall : PokeballScript
{
/// <inheritdoc />
public MoonBall(IItem item) : base(item)
{
}
/// <inheritdoc />
public override void ChangeCatchRate(IPokemon target, ref byte catchRate)
{
if (target.Species.EvolutionData.Any(x =>
{
switch (x)
{
case ItemUseEvolution itemUseEvolution when itemUseEvolution.Item == "moon_ball":
case ItemGenderEvolution itemGenderEvolution when itemGenderEvolution.Item == "moon_ball":
return true;
default:
return false;
}
}))
{
// If the target can evolve with a Moon Ball, it has a 4x catch rate.
catchRate = catchRate.MultiplyOrMax(4f);
}
}
}