Files
PkmnLib.NET/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/ElectroBall.cs
2026-07-05 19:45:40 +02:00

28 lines
746 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "electro_ball")]
public class ElectroBall : Script, IScriptChangeBasePower
{
/// <inheritdoc />
public void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
{
var user = move.User;
var targetSpeed = target.BoostedStats.Speed;
var userSpeed = user.BoostedStats.Speed;
if (targetSpeed == 0)
{
basePower = 40;
return;
}
var ratio = (float)userSpeed / targetSpeed;
basePower = ratio switch
{
>= 4 => 150,
>= 3 => 120,
>= 2 => 80,
>= 1 => 60,
_ => 40,
};
}
}