PkmnLib.NET/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/ElectroBall.cs

23 lines
627 B
C#
Raw Normal View History

2025-02-01 14:00:22 +00:00
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 byte basePower)
{
var user = move.User;
var targetSpeed = target.BoostedStats.Speed;
var userSpeed = user.BoostedStats.Speed;
2025-03-02 16:19:57 +00:00
var ratio = (float)userSpeed / targetSpeed;
2025-02-01 14:00:22 +00:00
basePower = ratio switch
{
> 4 => 150,
> 3 => 120,
> 2 => 80,
> 1 => 60,
2025-03-02 16:19:57 +00:00
_ => 40,
2025-02-01 14:00:22 +00:00
};
}
}