Adds a lot more move effects

This commit is contained in:
2025-01-26 11:55:13 +01:00
parent 802481c1f5
commit 549b92048a
75 changed files with 563 additions and 230 deletions

View File

@@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using PkmnLib.Dynamic.Models;
using PkmnLib.Dynamic.Models.Choices;
using PkmnLib.Dynamic.ScriptHandling;
using PkmnLib.Dynamic.ScriptHandling.Registry;
using PkmnLib.Plugin.Gen7.Scripts.Utils;
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
@@ -54,16 +51,7 @@ public class BideEffect : Script
choice = _choice;
return;
}
var bideMove = _owner.Moves.FirstOrDefault(x => x?.MoveData.Name == "bide");
if (bideMove == null)
{
if (!_owner.Library.StaticLibrary.Moves.TryGet("bide", out var moveData))
throw new Exception("Move 'bide' not found in move library.");
bideMove = new LearnedMoveImpl(moveData, MoveLearnMethod.Unknown);
}
choice = _choice = new MoveChoice(_owner, bideMove, sideIndex, position);
var opposingSideIndex = (byte)(_owner.BattleData?.SideIndex == 0 ? 1 : 0);
choice = TurnChoiceHelper.CreateMoveChoice(_owner, "bide", opposingSideIndex, position);
}
}