More moves implemented
This commit is contained in:
23
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/ElectroBall.cs
Normal file
23
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/ElectroBall.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
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;
|
||||
|
||||
var ratio = (float) userSpeed / targetSpeed;
|
||||
basePower = ratio switch
|
||||
{
|
||||
> 4 => 150,
|
||||
> 3 => 120,
|
||||
> 2 => 80,
|
||||
> 1 => 60,
|
||||
_ => 40
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user