This commit is contained in:
@@ -6,8 +6,7 @@ public class Spite : Script, IScriptOnSecondaryEffect
|
||||
/// <inheritdoc />
|
||||
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var lastMoveChoiceByTarget = move.Battle.PreviousTurnChoices.SelectMany(x => x).Reverse()
|
||||
.SkipWhile(x => x != move.MoveChoice).OfType<MoveChoice>().FirstOrDefault(x => x.User == target);
|
||||
var lastMoveChoiceByTarget = target.BattleData?.LastMoveChoice;
|
||||
if (lastMoveChoiceByTarget == null || lastMoveChoiceByTarget.HasFailed)
|
||||
{
|
||||
move.GetHitData(target, hit).Fail();
|
||||
|
||||
Reference in New Issue
Block a user