This commit is contained in:
26
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SandForce.cs
Normal file
26
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SandForce.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Sand Force is an ability that boosts the power of Rock, Ground, and Steel-type moves in a sandstorm.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Sand_Force_(Ability)">Bulbapedia - Sand Force</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "sand_force")]
|
||||
public class SandForce : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
|
||||
{
|
||||
if (move.Battle.WeatherName == ScriptUtils.ResolveName<Weather.Sandstorm>())
|
||||
{
|
||||
var type = move.GetHitData(target, hit).Type;
|
||||
if (type != null &&
|
||||
(type.Value.Name == "rock" || type.Value.Name == "ground" || type.Value.Name == "steel"))
|
||||
{
|
||||
basePower = basePower.MultiplyOrMax(1.3f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Prevent sandstorm damage.
|
||||
}
|
||||
Reference in New Issue
Block a user