Bunch more moves, changes in how additional information for items works.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using PkmnLib.Static;
|
||||
using PkmnLib.Static.Libraries;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
@@ -29,12 +31,12 @@ public class ForesightEffect : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeEffectiveness(IExecutingMove move, IPokemon target, byte hit, ref float effectiveness)
|
||||
public override void ChangeTypesForIncomingMove(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
IList<TypeIdentifier> types)
|
||||
{
|
||||
var hitData = move.GetHitData(target, hit);
|
||||
if (hitData.Type == _normalType && target.Types.Contains(_fightingType))
|
||||
effectiveness = _typeLibrary.GetEffectiveness(_normalType, target.Types.Where(x => x != _ghostType));
|
||||
else if (hitData.Type == _fightingType && target.Types.Contains(_ghostType))
|
||||
effectiveness = _typeLibrary.GetEffectiveness(_fightingType, target.Types.Where(x => x != _ghostType));
|
||||
if (executingMove.UseMove.MoveType == _normalType || executingMove.UseMove.MoveType == _fightingType)
|
||||
{
|
||||
types.RemoveAll(x => x == _ghostType);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user