Deukhoofd 7727f92f4e
All checks were successful
continuous-integration/drone/push Build is passing
Even more moves
2025-05-05 16:58:03 +02:00

23 lines
629 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "electro_ball")]
public class ElectroBall : Script
{
/// <inheritdoc />
public override 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;
var ratio = (float)userSpeed / targetSpeed;
basePower = ratio switch
{
> 4 => 150,
> 3 => 120,
> 2 => 80,
> 1 => 60,
_ => 40,
};
}
}