More move effects
This commit is contained in:
20
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/FlyingPress.cs
Normal file
20
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/FlyingPress.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "flying_press")]
|
||||
public class FlyingPress : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeEffectiveness(IExecutingMove move, IPokemon target, byte hit, ref float effectiveness)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
if (battleData == null)
|
||||
return;
|
||||
|
||||
var typeLibrary = battleData.Battle.Library.StaticLibrary.Types;
|
||||
// If flying type is not found, return
|
||||
if (!typeLibrary.TryGetTypeIdentifier("flying", out var flyingType))
|
||||
return;
|
||||
var flyingEffectiveness = typeLibrary.GetEffectiveness(flyingType, target.Types);
|
||||
effectiveness *= flyingEffectiveness;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user