Bunch more moves, changes in how additional information for items works.
This commit is contained in:
@@ -1,20 +1,18 @@
|
||||
using System.Collections.Generic;
|
||||
using PkmnLib.Static;
|
||||
|
||||
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)
|
||||
public override void ChangeTypesForMove(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
IList<TypeIdentifier> types)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
if (battleData == null)
|
||||
return;
|
||||
|
||||
var typeLibrary = battleData.Battle.Library.StaticLibrary.Types;
|
||||
// If flying type is not found, return
|
||||
var typeLibrary = executingMove.User.Library.StaticLibrary.Types;
|
||||
if (!typeLibrary.TryGetTypeIdentifier("flying", out var flyingType))
|
||||
return;
|
||||
var flyingEffectiveness = typeLibrary.GetEffectiveness(flyingType, target.Types);
|
||||
effectiveness *= flyingEffectiveness;
|
||||
types.Add(flyingType);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user