This commit is contained in:
@@ -3,14 +3,14 @@
|
|||||||
"isRoot": true,
|
"isRoot": true,
|
||||||
"tools": {
|
"tools": {
|
||||||
"husky": {
|
"husky": {
|
||||||
"version": "0.7.2",
|
"version": "0.9.1",
|
||||||
"commands": [
|
"commands": [
|
||||||
"husky"
|
"husky"
|
||||||
],
|
],
|
||||||
"rollForward": false
|
"rollForward": false
|
||||||
},
|
},
|
||||||
"jetbrains.resharper.globaltools": {
|
"jetbrains.resharper.globaltools": {
|
||||||
"version": "2025.1.1",
|
"version": "2026.1.4",
|
||||||
"commands": [
|
"commands": [
|
||||||
"jb"
|
"jb"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: dotnet build PkmnLib.NET.slnx -c Release --nologo --verbosity quiet -p:NoWarn=CS1591
|
run: dotnet build PkmnLib.NET.slnx -c Release --nologo --verbosity quiet -p:NoWarn=CS1591
|
||||||
- name: Test
|
- name: Test
|
||||||
run: dotnet test PkmnLib.NET.slnx -c Release --nologo --no-restore --no-build -- --disable-logo
|
run: dotnet test --solution PkmnLib.NET.slnx -c Release --nologo --no-restore --no-build -- --disable-logo
|
||||||
@@ -7,7 +7,6 @@
|
|||||||
"command": "dotnet",
|
"command": "dotnet",
|
||||||
"args": [
|
"args": [
|
||||||
"test",
|
"test",
|
||||||
"PkmnLib.NET.sln",
|
|
||||||
"--verbosity",
|
"--verbosity",
|
||||||
"minimal"
|
"minimal"
|
||||||
]
|
]
|
||||||
@@ -21,7 +20,7 @@
|
|||||||
"args": [
|
"args": [
|
||||||
"jb",
|
"jb",
|
||||||
"cleanupcode",
|
"cleanupcode",
|
||||||
"PkmnLib.NET.sln",
|
"PkmnLib.NET.slnx",
|
||||||
"--profile=Built-in: Reformat & Apply Syntax Style",
|
"--profile=Built-in: Reformat & Apply Syntax Style",
|
||||||
"--include=${args}"
|
"--include=${args}"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System.CommandLine;
|
using System.CommandLine;
|
||||||
using System.CommandLine.Parsing;
|
using System.CommandLine.Parsing;
|
||||||
using System.Reflection;
|
|
||||||
using PkmnLib.Dynamic.AI;
|
using PkmnLib.Dynamic.AI;
|
||||||
using PkmnLib.Dynamic.Libraries;
|
using PkmnLib.Dynamic.Libraries;
|
||||||
using PkmnLib.Plugin.Gen7;
|
using PkmnLib.Plugin.Gen7;
|
||||||
@@ -14,7 +13,7 @@ internal static class Program
|
|||||||
{
|
{
|
||||||
private static List<PokemonAI>? _availableAIs;
|
private static List<PokemonAI>? _availableAIs;
|
||||||
|
|
||||||
internal static LoggingLevelSwitch LogLevelSwitch { get; } = new(LogEventLevel.Information);
|
internal static LoggingLevelSwitch LogLevelSwitch { get; } = new();
|
||||||
|
|
||||||
private static Task<int> Main(string[] args)
|
private static Task<int> Main(string[] args)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ using System.Collections.Concurrent;
|
|||||||
using PkmnLib.Dynamic.AI;
|
using PkmnLib.Dynamic.AI;
|
||||||
using PkmnLib.Dynamic.Libraries;
|
using PkmnLib.Dynamic.Libraries;
|
||||||
using PkmnLib.Dynamic.Models;
|
using PkmnLib.Dynamic.Models;
|
||||||
using PkmnLib.Plugin.Gen7;
|
|
||||||
using PkmnLib.Static.Species;
|
using PkmnLib.Static.Species;
|
||||||
using PkmnLib.Static.Utils;
|
using PkmnLib.Static.Utils;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
@@ -184,10 +183,10 @@ public static class TestCommandRunner
|
|||||||
throw new InvalidOperationException("Both Pokémon must be non-null to proceed with the battle.");
|
throw new InvalidOperationException("Both Pokémon must be non-null to proceed with the battle.");
|
||||||
}
|
}
|
||||||
|
|
||||||
var taskAiOne = !battle.HasForcedTurn(pokemon1!, out var choice1)
|
var taskAiOne = !battle.HasForcedTurn(pokemon1, out var choice1)
|
||||||
? Task.Run(() => ai1.GetChoice(battle, pokemon1))
|
? Task.Run(() => ai1.GetChoice(battle, pokemon1))
|
||||||
: Task.FromResult(choice1);
|
: Task.FromResult(choice1);
|
||||||
var taskAiTwo = !battle.HasForcedTurn(pokemon2!, out var choice2)
|
var taskAiTwo = !battle.HasForcedTurn(pokemon2, out var choice2)
|
||||||
? Task.Run(() => ai2.GetChoice(battle, pokemon2))
|
? Task.Run(() => ai2.GetChoice(battle, pokemon2))
|
||||||
: Task.FromResult(choice2);
|
: Task.FromResult(choice2);
|
||||||
await Task.WhenAll(taskAiOne, taskAiTwo);
|
await Task.WhenAll(taskAiOne, taskAiTwo);
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
<WarningsAsErrors>nullable</WarningsAsErrors>
|
<WarningsAsErrors>nullable</WarningsAsErrors>
|
||||||
<UseArtifactsOutput>true</UseArtifactsOutput>
|
<UseArtifactsOutput>true</UseArtifactsOutput>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
<PackageVersion Include="NSubstitute" Version="5.3.0" />
|
<PackageVersion Include="NSubstitute" Version="5.3.0" />
|
||||||
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" />
|
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" />
|
||||||
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
|
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
|
||||||
<PackageVersion Include="TUnit" Version="0.25.21"/>
|
<PackageVersion Include="TUnit" Version="1.58.0" />
|
||||||
<PackageVersion Include="PolySharp" Version="1.15" />
|
<PackageVersion Include="PolySharp" Version="1.15" />
|
||||||
<PackageVersion Include="JetBrains.Annotations" Version="2024.3.0"/>
|
<PackageVersion Include="JetBrains.Annotations" Version="2026.2.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -2,7 +2,7 @@ namespace PkmnLib.Dynamic.AI;
|
|||||||
|
|
||||||
public static class AILogging
|
public static class AILogging
|
||||||
{
|
{
|
||||||
public static Action<string> LogHandler { get; set; } = message => { };
|
public static Action<string> LogHandler { get; set; } = _ => { };
|
||||||
|
|
||||||
public static void LogInformation(string message) => LogHandler(message);
|
public static void LogInformation(string message) => LogHandler(message);
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using PkmnLib.Dynamic.Models;
|
using PkmnLib.Dynamic.Models;
|
||||||
using PkmnLib.Dynamic.Models.Choices;
|
using PkmnLib.Dynamic.Models.Choices;
|
||||||
using PkmnLib.Static;
|
|
||||||
using PkmnLib.Static.Utils;
|
using PkmnLib.Static.Utils;
|
||||||
|
|
||||||
namespace PkmnLib.Dynamic.AI;
|
namespace PkmnLib.Dynamic.AI;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using PkmnLib.Dynamic.Events;
|
using PkmnLib.Dynamic.Models;
|
||||||
using PkmnLib.Static.Species;
|
using PkmnLib.Static.Species;
|
||||||
|
|
||||||
namespace PkmnLib.Dynamic.Models;
|
namespace PkmnLib.Dynamic.Events;
|
||||||
|
|
||||||
public class DisplaySpeciesChangeEvent : IEventData
|
public class DisplaySpeciesChangeEvent : IEventData
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -226,20 +226,20 @@ public class SerializedMoves
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The moves the Pokémon can learn by leveling up.
|
/// The moves the Pokémon can learn by leveling up.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public SerializedLevelMove[]? LevelMoves { get; set; } = null!;
|
public SerializedLevelMove[]? LevelMoves { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The moves the Pokémon can learn by breeding.
|
/// The moves the Pokémon can learn by breeding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string[]? EggMoves { get; set; } = null!;
|
public string[]? EggMoves { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The moves the Pokémon can learn by tutoring.
|
/// The moves the Pokémon can learn by tutoring.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string[]? TutorMoves { get; set; } = null!;
|
public string[]? TutorMoves { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The moves the Pokémon can learn by TM.
|
/// The moves the Pokémon can learn by TM.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string[]? Machine { get; set; } = null!;
|
public string[]? Machine { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
using PkmnLib.Dynamic.AI.Explicit;
|
using PkmnLib.Dynamic.AI.Explicit;
|
||||||
using PkmnLib.Dynamic.Plugins;
|
using PkmnLib.Dynamic.Plugins;
|
||||||
using PkmnLib.Dynamic.ScriptHandling;
|
using PkmnLib.Dynamic.ScriptHandling;
|
||||||
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
|
||||||
using PkmnLib.Static.Libraries;
|
using PkmnLib.Static.Libraries;
|
||||||
|
|
||||||
namespace PkmnLib.Dynamic.Libraries;
|
namespace PkmnLib.Dynamic.Libraries;
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ public interface IBattle : IScriptSource, IDeepCloneable, IDisposable
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the current weather for the battle. If null is passed, this clears the weather.
|
/// Sets the current weather for the battle. If null is passed, this clears the weather.
|
||||||
/// A duration can be passed to set the duration of the weather in turns. This duration can be modified by
|
/// A duration can be passed to set the duration of the weather in turns. This duration can be modified by
|
||||||
/// other scripts before the weather is set through the <see cref="Script.ChangeWeatherDuration"/> script hook.
|
/// other scripts before the weather is set through the <see cref="IScriptChangeWeatherDuration"/> script hook.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool SetWeather(StringKey? weatherName, int duration, EventBatchId batchId = default);
|
bool SetWeather(StringKey? weatherName, int duration, EventBatchId batchId = default);
|
||||||
|
|
||||||
@@ -369,18 +369,18 @@ public class BattleImpl : ScriptSource, IBattle
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
bool IsValidForForcedTurn(ITurnChoice forcedChoice, ITurnChoice choiceToCheck)
|
bool IsValidForForcedTurn(ITurnChoice forcedChoiceInner, ITurnChoice choiceToCheck)
|
||||||
{
|
{
|
||||||
// If the forced choice is a move choice, we can only use it if the move is the same
|
// If the forced choice is a move choice, we can only use it if the move is the same
|
||||||
if (forcedChoice is IMoveChoice forcedMove && choiceToCheck is IMoveChoice moveChoice)
|
if (forcedChoiceInner is IMoveChoice forcedMove && choiceToCheck is IMoveChoice moveChoiceInner)
|
||||||
{
|
{
|
||||||
return forcedMove.ChosenMove.MoveData.Name == moveChoice.ChosenMove.MoveData.Name;
|
return forcedMove.ChosenMove.MoveData.Name == moveChoiceInner.ChosenMove.MoveData.Name;
|
||||||
}
|
}
|
||||||
if (forcedChoice is IPassChoice && choiceToCheck is IPassChoice)
|
if (forcedChoiceInner is IPassChoice && choiceToCheck is IPassChoice)
|
||||||
{
|
{
|
||||||
return true; // Both are pass choices, so they are valid
|
return true; // Both are pass choices, so they are valid
|
||||||
}
|
}
|
||||||
return forcedChoice.Equals(choiceToCheck);
|
return forcedChoiceInner.Equals(choiceToCheck);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class BattleChoiceQueue : IDeepCloneable
|
|||||||
/// <inheritdoc cref="BattleChoiceQueue"/>
|
/// <inheritdoc cref="BattleChoiceQueue"/>
|
||||||
public BattleChoiceQueue(ITurnChoice[] choices)
|
public BattleChoiceQueue(ITurnChoice[] choices)
|
||||||
{
|
{
|
||||||
Array.Sort(choices, TurnChoiceComparer.Instance!);
|
Array.Sort(choices, TurnChoiceComparer.Instance);
|
||||||
_choices = choices;
|
_choices = choices;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ public class BattleChoiceQueue : IDeepCloneable
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void Remove(ITurnChoice choice)
|
public void Remove(ITurnChoice choice)
|
||||||
{
|
{
|
||||||
var index = Array.FindIndex(_choices, _currentIndex, x => x == choice);
|
var index = Array.FindIndex(_choices, _currentIndex, x => Equals(x, choice));
|
||||||
if (index == -1)
|
if (index == -1)
|
||||||
return;
|
return;
|
||||||
_choices[index] = null;
|
_choices[index] = null;
|
||||||
|
|||||||
@@ -47,5 +47,6 @@ public class FleeTurnChoice : TurnChoice, IFleeChoice
|
|||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override int GetHashCode() =>
|
public override int GetHashCode() =>
|
||||||
|
// ReSharper disable once ConditionalAccessQualifierIsNonNullableAccordingToAPIContract
|
||||||
User?.GetHashCode() ?? 0;
|
User?.GetHashCode() ?? 0;
|
||||||
}
|
}
|
||||||
@@ -51,5 +51,6 @@ public class PassChoice : TurnChoice, IPassChoice
|
|||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override int GetHashCode() =>
|
public override int GetHashCode() =>
|
||||||
|
// ReSharper disable once ConditionalAccessQualifierIsNonNullableAccordingToAPIContract
|
||||||
User?.GetHashCode() ?? 0;
|
User?.GetHashCode() ?? 0;
|
||||||
}
|
}
|
||||||
@@ -60,5 +60,6 @@ public class SwitchChoice : TurnChoice, ISwitchChoice
|
|||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override int GetHashCode() =>
|
public override int GetHashCode() =>
|
||||||
|
// ReSharper disable twice ConditionalAccessQualifierIsNonNullableAccordingToAPIContract
|
||||||
User?.GetHashCode() ?? 0 ^ SwitchTo?.GetHashCode() ?? 0;
|
User?.GetHashCode() ?? 0 ^ SwitchTo?.GetHashCode() ?? 0;
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,5 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using PkmnLib.Dynamic.Models;
|
|
||||||
using PkmnLib.Dynamic.Models.Choices;
|
|
||||||
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
||||||
using PkmnLib.Static;
|
|
||||||
using PkmnLib.Static.Moves;
|
|
||||||
using PkmnLib.Static.Utils;
|
using PkmnLib.Static.Utils;
|
||||||
|
|
||||||
namespace PkmnLib.Dynamic.ScriptHandling;
|
namespace PkmnLib.Dynamic.ScriptHandling;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace PkmnLib.Dynamic.ScriptHandling;
|
|||||||
public class ScriptIterator : IEnumerable<ScriptContainer>
|
public class ScriptIterator : IEnumerable<ScriptContainer>
|
||||||
{
|
{
|
||||||
private readonly IReadOnlyList<IEnumerable<ScriptContainer>> _scripts;
|
private readonly IReadOnlyList<IEnumerable<ScriptContainer>> _scripts;
|
||||||
private int _currentIndex = 0;
|
private int _currentIndex;
|
||||||
|
|
||||||
/// <inheritdoc cref="ScriptIterator"/>
|
/// <inheritdoc cref="ScriptIterator"/>
|
||||||
public ScriptIterator(IReadOnlyList<IEnumerable<ScriptContainer>> scripts)
|
public ScriptIterator(IReadOnlyList<IEnumerable<ScriptContainer>> scripts)
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PkmnLib.Static", "PkmnLib.Static\PkmnLib.Static.csproj", "{312782DA-1066-4490-BD0E-DF4DF8713B4A}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PkmnLib.Tests", "PkmnLib.Tests\PkmnLib.Tests.csproj", "{42DE3095-0468-4827-AF5C-691C94BA7F92}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PkmnLib.Dynamic", "PkmnLib.Dynamic\PkmnLib.Dynamic.csproj", "{D0CBA9A9-7288-41B4-B76B-CB4F20036AB2}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PkmnLib.Plugin.Gen7", "Plugins\PkmnLib.Plugin.Gen7\PkmnLib.Plugin.Gen7.csproj", "{FA5380F0-28CC-4AEC-8963-814B347A89BA}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{63C1B450-DC26-444A-AEBD-15979F3EEE53}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PkmnLib.Plugin.Gen7.Tests", "Plugins\PkmnLib.Plugin.Gen7.Tests\PkmnLib.Plugin.Gen7.Tests.csproj", "{FBB53861-081F-4DAC-B006-79EE238D0DFC}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFiles", "SolutionFiles", "{2B99ADF8-10E2-4A3D-906F-27DC8E312A79}"
|
|
||||||
ProjectSection(SolutionItems) = preProject
|
|
||||||
.editorconfig = .editorconfig
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{312782DA-1066-4490-BD0E-DF4DF8713B4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{312782DA-1066-4490-BD0E-DF4DF8713B4A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{312782DA-1066-4490-BD0E-DF4DF8713B4A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{312782DA-1066-4490-BD0E-DF4DF8713B4A}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{42DE3095-0468-4827-AF5C-691C94BA7F92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{42DE3095-0468-4827-AF5C-691C94BA7F92}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{42DE3095-0468-4827-AF5C-691C94BA7F92}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{42DE3095-0468-4827-AF5C-691C94BA7F92}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{D0CBA9A9-7288-41B4-B76B-CB4F20036AB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{D0CBA9A9-7288-41B4-B76B-CB4F20036AB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{D0CBA9A9-7288-41B4-B76B-CB4F20036AB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{D0CBA9A9-7288-41B4-B76B-CB4F20036AB2}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{FA5380F0-28CC-4AEC-8963-814B347A89BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{FA5380F0-28CC-4AEC-8963-814B347A89BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{FA5380F0-28CC-4AEC-8963-814B347A89BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{FA5380F0-28CC-4AEC-8963-814B347A89BA}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{FBB53861-081F-4DAC-B006-79EE238D0DFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{FBB53861-081F-4DAC-B006-79EE238D0DFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{FBB53861-081F-4DAC-B006-79EE238D0DFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{FBB53861-081F-4DAC-B006-79EE238D0DFC}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(NestedProjects) = preSolution
|
|
||||||
{FA5380F0-28CC-4AEC-8963-814B347A89BA} = {63C1B450-DC26-444A-AEBD-15979F3EEE53}
|
|
||||||
{FBB53861-081F-4DAC-B006-79EE238D0DFC} = {63C1B450-DC26-444A-AEBD-15979F3EEE53}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using PkmnLib.Dynamic.Libraries.DataLoaders;
|
using PkmnLib.Dynamic.Libraries.DataLoaders;
|
||||||
using PkmnLib.Dynamic.Plugins;
|
using PkmnLib.Dynamic.Plugins;
|
||||||
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
|
||||||
|
|
||||||
namespace PkmnLib.Tests.Dataloader;
|
namespace PkmnLib.Tests.Dataloader;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using PkmnLib.Dynamic.Libraries.DataLoaders;
|
using PkmnLib.Dynamic.Libraries.DataLoaders;
|
||||||
using PkmnLib.Dynamic.Plugins;
|
using PkmnLib.Dynamic.Plugins;
|
||||||
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
|
||||||
|
|
||||||
namespace PkmnLib.Tests.Dataloader;
|
namespace PkmnLib.Tests.Dataloader;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using PkmnLib.Dynamic.Libraries.DataLoaders;
|
using PkmnLib.Dynamic.Libraries.DataLoaders;
|
||||||
using PkmnLib.Dynamic.Plugins;
|
using PkmnLib.Dynamic.Plugins;
|
||||||
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
|
||||||
|
|
||||||
namespace PkmnLib.Tests.Dataloader;
|
namespace PkmnLib.Tests.Dataloader;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using PkmnLib.Dynamic.Libraries.DataLoaders;
|
using PkmnLib.Dynamic.Libraries.DataLoaders;
|
||||||
using PkmnLib.Dynamic.Plugins;
|
using PkmnLib.Dynamic.Plugins;
|
||||||
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
|
||||||
using PkmnLib.Static.Libraries;
|
using PkmnLib.Static.Libraries;
|
||||||
|
|
||||||
namespace PkmnLib.Tests.Dataloader;
|
namespace PkmnLib.Tests.Dataloader;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using PkmnLib.Dynamic.Libraries.DataLoaders;
|
using PkmnLib.Dynamic.Libraries.DataLoaders;
|
||||||
using PkmnLib.Dynamic.Plugins;
|
using PkmnLib.Dynamic.Plugins;
|
||||||
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
|
||||||
|
|
||||||
namespace PkmnLib.Tests.Dataloader;
|
namespace PkmnLib.Tests.Dataloader;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using PkmnLib.Dynamic.Libraries.DataLoaders;
|
using PkmnLib.Dynamic.Libraries.DataLoaders;
|
||||||
using PkmnLib.Dynamic.Plugins;
|
using PkmnLib.Dynamic.Plugins;
|
||||||
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
|
||||||
using PkmnLib.Static.Libraries;
|
using PkmnLib.Static.Libraries;
|
||||||
|
|
||||||
namespace PkmnLib.Tests.Dataloader;
|
namespace PkmnLib.Tests.Dataloader;
|
||||||
@@ -70,9 +69,9 @@ public class SpeciesDataloaderTests
|
|||||||
await Assert.That(species).IsNotNull();
|
await Assert.That(species).IsNotNull();
|
||||||
await Assert.That(species!.TryGetForm("arceus_fighting", out var form)).IsTrue();
|
await Assert.That(species!.TryGetForm("arceus_fighting", out var form)).IsTrue();
|
||||||
await Assert.That(form).IsNotNull();
|
await Assert.That(form).IsNotNull();
|
||||||
await Assert.That(form!.Types).HasCount().EqualTo(1);
|
await Assert.That(form!.Types).Count().IsEqualTo(1);
|
||||||
await Assert.That(form.Types[0].Name).IsEqualTo("fighting");
|
await Assert.That(form.Types[0].Name.ToString()).IsEqualTo("fighting");
|
||||||
await Assert.That(form.Flags).IsEqualTo(species.GetDefaultForm().Flags);
|
await Assert.That(form.Flags).IsEquivalentTo(species.GetDefaultForm().Flags);
|
||||||
await Assert.That(form.BaseStats).IsEqualTo(species.GetDefaultForm().BaseStats);
|
await Assert.That(form.BaseStats).IsEqualTo(species.GetDefaultForm().BaseStats);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using PkmnLib.Dynamic.Libraries.DataLoaders;
|
using PkmnLib.Dynamic.Libraries.DataLoaders;
|
||||||
using PkmnLib.Dynamic.Plugins;
|
using PkmnLib.Dynamic.Plugins;
|
||||||
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
|
||||||
|
|
||||||
namespace PkmnLib.Tests.Dataloader;
|
namespace PkmnLib.Tests.Dataloader;
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ public class ChoiceQueueTests
|
|||||||
choice2.Speed.Returns((uint)50);
|
choice2.Speed.Returns((uint)50);
|
||||||
|
|
||||||
var queue = new BattleChoiceQueue([choice1, choice2]);
|
var queue = new BattleChoiceQueue([choice1, choice2]);
|
||||||
await Assert.That(queue.Dequeue()).IsEqualTo(choice1);
|
await Assert.That((IMoveChoice)queue.Dequeue()!).IsEqualTo(choice1);
|
||||||
await Assert.That(queue.Dequeue()).IsEqualTo(choice2);
|
await Assert.That((IMoveChoice)queue.Dequeue()!).IsEqualTo(choice2);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -41,8 +41,8 @@ public class ChoiceQueueTests
|
|||||||
choice2.Speed.Returns((uint)50);
|
choice2.Speed.Returns((uint)50);
|
||||||
|
|
||||||
var queue = new BattleChoiceQueue([choice1, choice2]);
|
var queue = new BattleChoiceQueue([choice1, choice2]);
|
||||||
await Assert.That(queue.Dequeue()).IsEqualTo(choice2);
|
await Assert.That((IMoveChoice)queue.Dequeue()!).IsEqualTo(choice2);
|
||||||
await Assert.That(queue.Dequeue()).IsEqualTo(choice1);
|
await Assert.That((IMoveChoice)queue.Dequeue()!).IsEqualTo(choice1);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -69,7 +69,7 @@ public class ChoiceQueueTests
|
|||||||
var queue = new BattleChoiceQueue([choice1, choice2, choice3, choice4]);
|
var queue = new BattleChoiceQueue([choice1, choice2, choice3, choice4]);
|
||||||
var result = queue.MovePokemonChoiceNext(pokemon3);
|
var result = queue.MovePokemonChoiceNext(pokemon3);
|
||||||
await Assert.That(result).IsTrue();
|
await Assert.That(result).IsTrue();
|
||||||
await Assert.That(queue.Dequeue()).IsEqualTo(choice3);
|
await Assert.That((IMoveChoice)queue.Dequeue()!).IsEqualTo(choice3);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -97,7 +97,7 @@ public class ChoiceQueueTests
|
|||||||
queue.Dequeue();
|
queue.Dequeue();
|
||||||
var result = queue.MovePokemonChoiceNext(pokemon1);
|
var result = queue.MovePokemonChoiceNext(pokemon1);
|
||||||
await Assert.That(result).IsFalse();
|
await Assert.That(result).IsFalse();
|
||||||
await Assert.That(queue.Dequeue()).IsEqualTo(choice2);
|
await Assert.That((IMoveChoice)queue.Dequeue()!).IsEqualTo(choice2);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -124,10 +124,10 @@ public class ChoiceQueueTests
|
|||||||
var queue = new BattleChoiceQueue([choice1, choice2, choice3, choice4]);
|
var queue = new BattleChoiceQueue([choice1, choice2, choice3, choice4]);
|
||||||
var result = queue.MovePokemonChoiceLast(pokemon2);
|
var result = queue.MovePokemonChoiceLast(pokemon2);
|
||||||
await Assert.That(result).IsTrue();
|
await Assert.That(result).IsTrue();
|
||||||
await Assert.That(queue.Dequeue()).IsEqualTo(choice1);
|
await Assert.That((IMoveChoice)queue.Dequeue()!).IsEqualTo(choice1);
|
||||||
await Assert.That(queue.Dequeue()).IsEqualTo(choice3);
|
await Assert.That((IMoveChoice)queue.Dequeue()!).IsEqualTo(choice3);
|
||||||
await Assert.That(queue.Dequeue()).IsEqualTo(choice4);
|
await Assert.That((IMoveChoice)queue.Dequeue()!).IsEqualTo(choice4);
|
||||||
await Assert.That(queue.Dequeue()).IsEqualTo(choice2);
|
await Assert.That((IMoveChoice)queue.Dequeue()!).IsEqualTo(choice2);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -155,8 +155,8 @@ public class ChoiceQueueTests
|
|||||||
queue.Dequeue();
|
queue.Dequeue();
|
||||||
var result = queue.MovePokemonChoiceLast(pokemon1);
|
var result = queue.MovePokemonChoiceLast(pokemon1);
|
||||||
await Assert.That(result).IsFalse();
|
await Assert.That(result).IsFalse();
|
||||||
await Assert.That(queue.Dequeue()).IsEqualTo(choice2);
|
await Assert.That((IMoveChoice)queue.Dequeue()!).IsEqualTo(choice2);
|
||||||
await Assert.That(queue.Dequeue()).IsEqualTo(choice3);
|
await Assert.That((IMoveChoice)queue.Dequeue()!).IsEqualTo(choice3);
|
||||||
await Assert.That(queue.Dequeue()).IsEqualTo(choice4);
|
await Assert.That((IMoveChoice)queue.Dequeue()!).IsEqualTo(choice4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
using PkmnLib.Dynamic.Libraries;
|
|
||||||
using PkmnLib.Dynamic.Models;
|
using PkmnLib.Dynamic.Models;
|
||||||
using PkmnLib.Static;
|
using PkmnLib.Static;
|
||||||
using PkmnLib.Static.Species;
|
using PkmnLib.Static.Species;
|
||||||
@@ -13,7 +12,7 @@ public class PokemonStatBoostTests
|
|||||||
var library = LibraryHelpers.LoadLibrary();
|
var library = LibraryHelpers.LoadLibrary();
|
||||||
if (!library.StaticLibrary.Species.TryGet("bulbasaur", out var species))
|
if (!library.StaticLibrary.Species.TryGet("bulbasaur", out var species))
|
||||||
throw new InvalidOperationException("Failed to load bulbasaur species.");
|
throw new InvalidOperationException("Failed to load bulbasaur species.");
|
||||||
return new PokemonImpl(library, species!, species!.GetDefaultForm(), new AbilityIndex
|
return new PokemonImpl(library, species, species.GetDefaultForm(), new AbilityIndex
|
||||||
{
|
{
|
||||||
Index = 0,
|
Index = 0,
|
||||||
IsHidden = false,
|
IsHidden = false,
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ public class SerializationTests
|
|||||||
await Assert.That(data.Gender).IsEqualTo(Gender.Male);
|
await Assert.That(data.Gender).IsEqualTo(Gender.Male);
|
||||||
await Assert.That(data.Coloring).IsEqualTo((byte)0);
|
await Assert.That(data.Coloring).IsEqualTo((byte)0);
|
||||||
await Assert.That(data.HeldItem).IsNull();
|
await Assert.That(data.HeldItem).IsNull();
|
||||||
await Assert.That(data.CurrentHealth).IsEqualTo((ushort)29);
|
await Assert.That(data.CurrentHealth).IsEqualTo((uint)29);
|
||||||
await Assert.That(data.Happiness).IsEqualTo((byte)70);
|
await Assert.That(data.Happiness).IsEqualTo((byte)70);
|
||||||
|
|
||||||
await Assert.That(data.Moves).HasCount().EqualTo(4);
|
await Assert.That(data.Moves).Count().IsEqualTo(4);
|
||||||
await Assert.That(data.Moves[0]).IsNotNull();
|
await Assert.That(data.Moves[0]).IsNotNull();
|
||||||
await Assert.That(data.Moves[0]!.MoveName).IsEqualTo("tackle");
|
await Assert.That(data.Moves[0]!.MoveName).IsEqualTo("tackle");
|
||||||
await Assert.That(data.Moves[0]!.LearnMethod).IsEqualTo(MoveLearnMethod.LevelUp);
|
await Assert.That(data.Moves[0]!.LearnMethod).IsEqualTo(MoveLearnMethod.LevelUp);
|
||||||
@@ -93,7 +93,7 @@ public class SerializationTests
|
|||||||
await Assert.That(pokemon.EffortValues).IsEqualTo(new EffortValueStatisticSet(0, 0, 0, 0, 0, 0));
|
await Assert.That(pokemon.EffortValues).IsEqualTo(new EffortValueStatisticSet(0, 0, 0, 0, 0, 0));
|
||||||
await Assert.That(pokemon.Nature.Name.ToString()).IsEqualTo("hardy");
|
await Assert.That(pokemon.Nature.Name.ToString()).IsEqualTo("hardy");
|
||||||
await Assert.That(pokemon.Nickname).IsEqualTo("foo");
|
await Assert.That(pokemon.Nickname).IsEqualTo("foo");
|
||||||
await Assert.That(pokemon.Moves).HasCount().EqualTo(4);
|
await Assert.That(pokemon.Moves).Count().IsEqualTo(4);
|
||||||
await Assert.That(pokemon.Moves[0]).IsNotNull();
|
await Assert.That(pokemon.Moves[0]).IsNotNull();
|
||||||
await Assert.That(pokemon.Moves[0]!.MoveData.Name.ToString()).IsEqualTo("tackle");
|
await Assert.That(pokemon.Moves[0]!.MoveData.Name.ToString()).IsEqualTo("tackle");
|
||||||
await Assert.That(pokemon.Moves[0]!.LearnMethod).IsEqualTo(MoveLearnMethod.LevelUp);
|
await Assert.That(pokemon.Moves[0]!.LearnMethod).IsEqualTo(MoveLearnMethod.LevelUp);
|
||||||
@@ -153,7 +153,7 @@ public class SerializationTests
|
|||||||
await Assert.That(deserialized.Nature).IsEqualTo("hardy");
|
await Assert.That(deserialized.Nature).IsEqualTo("hardy");
|
||||||
await Assert.That(deserialized.Nickname).IsEqualTo("foo");
|
await Assert.That(deserialized.Nickname).IsEqualTo("foo");
|
||||||
|
|
||||||
await Assert.That(deserialized.Moves).HasCount().EqualTo(4);
|
await Assert.That(deserialized.Moves).Count().IsEqualTo(4);
|
||||||
await Assert.That(deserialized.Moves[0]).IsNotNull();
|
await Assert.That(deserialized.Moves[0]).IsNotNull();
|
||||||
await Assert.That(deserialized.Moves[0]!.MoveName).IsEqualTo("tackle");
|
await Assert.That(deserialized.Moves[0]!.MoveName).IsEqualTo("tackle");
|
||||||
await Assert.That(deserialized.Moves[0]!.LearnMethod).IsEqualTo(MoveLearnMethod.LevelUp);
|
await Assert.That(deserialized.Moves[0]!.LearnMethod).IsEqualTo(MoveLearnMethod.LevelUp);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public class IntegrationTestRunner
|
|||||||
}
|
}
|
||||||
|
|
||||||
await TestContext.Current!.OutputWriter.WriteLineAsync("File: " + $"file://{test.FileName}");
|
await TestContext.Current!.OutputWriter.WriteLineAsync("File: " + $"file://{test.FileName}");
|
||||||
TestContext.Current.AddArtifact(new Artifact
|
TestContext.Current.Output.AttachArtifact(new Artifact
|
||||||
{
|
{
|
||||||
File = new FileInfo(test.FileName),
|
File = new FileInfo(test.FileName),
|
||||||
DisplayName = test.Name,
|
DisplayName = test.Name,
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ using System.Diagnostics.CodeAnalysis;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Pcg;
|
using Pcg;
|
||||||
using PkmnLib.Dynamic.Models;
|
using PkmnLib.Dynamic.Models;
|
||||||
using PkmnLib.Plugin.Gen7.Scripts.Moves;
|
|
||||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||||
using PkmnLib.Static;
|
using PkmnLib.Static;
|
||||||
using PkmnLib.Static.Species;
|
using PkmnLib.Static.Species;
|
||||||
@@ -60,7 +59,7 @@ public class DeepCloneTests
|
|||||||
var clonePrivateValue =
|
var clonePrivateValue =
|
||||||
clone.GetType().GetProperty("PrivateValue", BindingFlags.NonPublic | BindingFlags.Instance)!
|
clone.GetType().GetProperty("PrivateValue", BindingFlags.NonPublic | BindingFlags.Instance)!
|
||||||
.GetValue(clone);
|
.GetValue(clone);
|
||||||
await Assert.That(clonePrivateValue).IsEqualTo(1);
|
await Assert.That((int)clonePrivateValue!).IsEqualTo(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -72,7 +71,7 @@ public class DeepCloneTests
|
|||||||
await Assert.That(clone).IsNotEqualTo(obj);
|
await Assert.That(clone).IsNotEqualTo(obj);
|
||||||
var clonePrivateField =
|
var clonePrivateField =
|
||||||
clone.GetType().GetField("_privateField", BindingFlags.NonPublic | BindingFlags.Instance)!.GetValue(clone);
|
clone.GetType().GetField("_privateField", BindingFlags.NonPublic | BindingFlags.Instance)!.GetValue(clone);
|
||||||
await Assert.That(clonePrivateField).IsEqualTo(1);
|
await Assert.That((int)clonePrivateField!).IsEqualTo(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -119,8 +118,8 @@ public class DeepCloneTests
|
|||||||
|
|
||||||
var clone = battle.DeepClone();
|
var clone = battle.DeepClone();
|
||||||
await Assert.That(clone).IsNotEqualTo(battle);
|
await Assert.That(clone).IsNotEqualTo(battle);
|
||||||
await Assert.That(clone.Sides[0].Pokemon[0]).IsNotEqualTo(battle.Sides[0].Pokemon[0]);
|
await Assert.That(clone.Sides[0].Pokemon[0]).IsNotEqualTo(battle.Sides[0].Pokemon[0]!);
|
||||||
await Assert.That(clone.Sides[1].Pokemon[0]).IsNotEqualTo(battle.Sides[1].Pokemon[0]);
|
await Assert.That(clone.Sides[1].Pokemon[0]).IsNotEqualTo(battle.Sides[1].Pokemon[0]!);
|
||||||
|
|
||||||
await Assert.That(clone.Sides[0].Pokemon[0]!.Species).IsEqualTo(battle.Sides[0].Pokemon[0]!.Species);
|
await Assert.That(clone.Sides[0].Pokemon[0]!.Species).IsEqualTo(battle.Sides[0].Pokemon[0]!.Species);
|
||||||
await Assert.That(clone.Sides[1].Pokemon[0]!.Species).IsEqualTo(battle.Sides[1].Pokemon[0]!.Species);
|
await Assert.That(clone.Sides[1].Pokemon[0]!.Species).IsEqualTo(battle.Sides[1].Pokemon[0]!.Species);
|
||||||
@@ -129,21 +128,21 @@ public class DeepCloneTests
|
|||||||
|
|
||||||
var pokemon = clone.Sides[0].Pokemon[0]!;
|
var pokemon = clone.Sides[0].Pokemon[0]!;
|
||||||
await Assert.That(pokemon).IsNotNull();
|
await Assert.That(pokemon).IsNotNull();
|
||||||
await Assert.That(pokemon).IsNotEqualTo(battle.Sides[0].Pokemon[0]);
|
await Assert.That(pokemon).IsNotEqualTo(battle.Sides[0].Pokemon[0]!);
|
||||||
await Assert.That(pokemon.BattleData).IsNotNull();
|
await Assert.That(pokemon.BattleData).IsNotNull();
|
||||||
await Assert.That(pokemon.BattleData).IsNotEqualTo(battle.Sides[0].Pokemon[0]!.BattleData);
|
await Assert.That(pokemon.BattleData).IsNotEqualTo(battle.Sides[0].Pokemon[0]!.BattleData!);
|
||||||
await Assert.That(pokemon.BattleData!.Battle).IsEqualTo(clone);
|
await Assert.That(pokemon.BattleData!.Battle).IsEqualTo((IBattle)clone);
|
||||||
await Assert.That(pokemon.BattleData!.SeenOpponents).Contains(clone.Sides[1].Pokemon[0]!);
|
await Assert.That(pokemon.BattleData!.SeenOpponents).Contains(clone.Sides[1].Pokemon[0]!);
|
||||||
await Assert.That(pokemon.BattleData!.SeenOpponents).DoesNotContain(battle.Sides[1].Pokemon[0]!);
|
await Assert.That(pokemon.BattleData!.SeenOpponents).DoesNotContain(battle.Sides[1].Pokemon[0]!);
|
||||||
await Assert.That(pokemon.StatBoost.Defense).IsEqualTo((sbyte)2);
|
await Assert.That(pokemon.StatBoost.Defense).IsEqualTo((sbyte)2);
|
||||||
await Assert.That(pokemon.Volatile.Get<ChargeBounceEffect>()).IsNotNull();
|
await Assert.That(pokemon.Volatile.Get<ChargeBounceEffect>()).IsNotNull();
|
||||||
await Assert.That(pokemon.Volatile.Get<ChargeBounceEffect>()).IsNotEqualTo(
|
await Assert.That(pokemon.Volatile.Get<ChargeBounceEffect>()).IsNotEqualTo(
|
||||||
battle.Sides[0].Pokemon[0]!.Volatile.Get<ChargeBounceEffect>());
|
battle.Sides[0].Pokemon[0]!.Volatile.Get<ChargeBounceEffect>()!);
|
||||||
|
|
||||||
var ownerGetter =
|
var ownerGetter =
|
||||||
typeof(ChargeBounceEffect).GetField("_owner", BindingFlags.NonPublic | BindingFlags.Instance)!;
|
typeof(ChargeBounceEffect).GetField("_owner", BindingFlags.NonPublic | BindingFlags.Instance)!;
|
||||||
var owner = ownerGetter.GetValue(pokemon.Volatile.Get<ChargeBounceEffect>()!);
|
var owner = ownerGetter.GetValue(pokemon.Volatile.Get<ChargeBounceEffect>()!);
|
||||||
await Assert.That(owner).IsEqualTo(pokemon);
|
await Assert.That((IPokemon)owner!).IsEqualTo(pokemon);
|
||||||
pokemon.Volatile.Remove<ChargeBounceEffect>();
|
pokemon.Volatile.Remove<ChargeBounceEffect>();
|
||||||
|
|
||||||
await Assert.That(pokemon.Volatile.Get<ChargeBounceEffect>()).IsNull();
|
await Assert.That(pokemon.Volatile.Get<ChargeBounceEffect>()).IsNull();
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using PkmnLib.Static;
|
using PkmnLib.Static;
|
||||||
using TUnit.Assertions.AssertConditions.Throws;
|
|
||||||
|
|
||||||
namespace PkmnLib.Tests.Static;
|
namespace PkmnLib.Tests.Static;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using System.Text.Json;
|
|||||||
using PkmnLib.Dynamic.Libraries;
|
using PkmnLib.Dynamic.Libraries;
|
||||||
using PkmnLib.Dynamic.Plugins;
|
using PkmnLib.Dynamic.Plugins;
|
||||||
using PkmnLib.Dynamic.ScriptHandling;
|
using PkmnLib.Dynamic.ScriptHandling;
|
||||||
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
|
||||||
using PkmnLib.Plugin.Gen7.Common;
|
using PkmnLib.Plugin.Gen7.Common;
|
||||||
using PkmnLib.Static.Moves;
|
using PkmnLib.Static.Moves;
|
||||||
using PkmnLib.Static.Utils;
|
using PkmnLib.Static.Utils;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using PkmnLib.Dynamic.Events;
|
using PkmnLib.Dynamic.Events;
|
||||||
using PkmnLib.Dynamic.Models;
|
using PkmnLib.Dynamic.Models;
|
||||||
using PkmnLib.Dynamic.ScriptHandling;
|
|
||||||
using PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
using PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
using PkmnLib.Static.Species;
|
using PkmnLib.Static.Species;
|
||||||
using PkmnLib.Static.Utils;
|
using PkmnLib.Static.Utils;
|
||||||
@@ -333,7 +332,7 @@ public class AftermathTests
|
|||||||
aftermath.OnFaint(target, DamageSource.MoveDamage);
|
aftermath.OnFaint(target, DamageSource.MoveDamage);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await Assert.That(GetDamageSource(user)).IsEqualTo(DamageSource.Misc);
|
await Assert.That(GetDamageSource(user)!.Value).IsEqualTo(DamageSource.Misc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using PkmnLib.Dynamic.ScriptHandling;
|
using PkmnLib.Dynamic.ScriptHandling;
|
||||||
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
||||||
using Assembly = System.Reflection.Assembly;
|
|
||||||
|
|
||||||
namespace PkmnLib.Plugin.Gen7.Tests.Scripts;
|
namespace PkmnLib.Plugin.Gen7.Tests.Scripts;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class AcrobaticsTests
|
|||||||
acrobatics.ChangeBasePower(move, target, 0, ref basePower);
|
acrobatics.ChangeBasePower(move, target, 0, ref basePower);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await Assert.That(basePower).IsEqualTo((byte)20);
|
await Assert.That(basePower).IsEqualTo((ushort)20);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -41,7 +41,7 @@ public class AcrobaticsTests
|
|||||||
acrobatics.ChangeBasePower(move, target, 0, ref basePower);
|
acrobatics.ChangeBasePower(move, target, 0, ref basePower);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await Assert.That(basePower).IsEqualTo((byte)10);
|
await Assert.That(basePower).IsEqualTo((ushort)10);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class BatonPassTests
|
|||||||
script.OnSecondaryEffect(move, user, 0);
|
script.OnSecondaryEffect(move, user, 0);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
side.Received(1).SwapPokemon((byte)1, toSwitch);
|
side.Received(1).SwapPokemon(1, toSwitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public class BeakBlastTests
|
|||||||
// Assert
|
// Assert
|
||||||
await Assert.That(capturedEvent).IsNotNull();
|
await Assert.That(capturedEvent).IsNotNull();
|
||||||
await Assert.That(capturedEvent!.Message).IsEqualTo("beak_blast_charge");
|
await Assert.That(capturedEvent!.Message).IsEqualTo("beak_blast_charge");
|
||||||
await Assert.That(capturedEvent.Parameters!["user"]).IsEqualTo(user);
|
await Assert.That((IPokemon)capturedEvent.Parameters!["user"]).IsEqualTo(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class BellyDrumTests
|
|||||||
script.OnSecondaryEffect(move, user, 0);
|
script.OnSecondaryEffect(move, user, 0);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await Assert.That(GetDamageCall(user)).IsEqualTo((expectedDeduction, DamageSource.Misc, true));
|
await Assert.That(GetDamageCall(user)!.Value).IsEqualTo((expectedDeduction, DamageSource.Misc, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class BestowTests
|
|||||||
script.OnSecondaryEffect(move, target, 0);
|
script.OnSecondaryEffect(move, target, 0);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
target.Received(1).ForceSetHeldItem(userItem);
|
_ = target.Received(1).ForceSetHeldItem(userItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -115,7 +115,7 @@ public class BestowTests
|
|||||||
script.OnSecondaryEffect(move, target, 0);
|
script.OnSecondaryEffect(move, target, 0);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
target.DidNotReceive().ForceSetHeldItem(Arg.Any<IItem>());
|
_ = target.DidNotReceive().ForceSetHeldItem(Arg.Any<IItem>());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ public class BideTests
|
|||||||
script.OnSecondaryEffect(move, target, 0);
|
script.OnSecondaryEffect(move, target, 0);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await Assert.That(GetDamageAmount(attacker)).IsEqualTo(expectedDamage);
|
await Assert.That(GetDamageAmount(attacker)!.Value).IsEqualTo(expectedDamage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -154,7 +154,7 @@ public class BideTests
|
|||||||
script.OnSecondaryEffect(move, target, 0);
|
script.OnSecondaryEffect(move, target, 0);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await Assert.That(GetDamageSource(attacker)).IsEqualTo(DamageSource.MoveDamage);
|
await Assert.That(GetDamageSource(attacker)!.Value).IsEqualTo(DamageSource.MoveDamage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ public class BindTests
|
|||||||
effect!.OnEndTurn(target, Substitute.For<IBattle>());
|
effect!.OnEndTurn(target, Substitute.For<IBattle>());
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await Assert.That(GetDamageAmount(target)).IsEqualTo(expectedDamage);
|
await Assert.That(GetDamageAmount(target)!.Value).IsEqualTo(expectedDamage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -193,7 +193,7 @@ public class BindTests
|
|||||||
effect!.OnEndTurn(target, Substitute.For<IBattle>());
|
effect!.OnEndTurn(target, Substitute.For<IBattle>());
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await Assert.That(GetDamageAmount(target)).IsEqualTo(expectedDamage);
|
await Assert.That(GetDamageAmount(target)!.Value).IsEqualTo(expectedDamage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using PkmnLib.Dynamic.ScriptHandling;
|
|||||||
using PkmnLib.Plugin.Gen7.Scripts.Moves;
|
using PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||||
using PkmnLib.Plugin.Gen7.Scripts.Side;
|
using PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||||
using PkmnLib.Static.Utils;
|
using PkmnLib.Static.Utils;
|
||||||
using TUnit.Assertions.AssertConditions.Throws;
|
|
||||||
|
|
||||||
namespace PkmnLib.Plugin.Gen7.Tests.Scripts.Moves;
|
namespace PkmnLib.Plugin.Gen7.Tests.Scripts.Moves;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ using PkmnLib.Dynamic.Models;
|
|||||||
using PkmnLib.Plugin.Gen7.Scripts.Moves;
|
using PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||||
using PkmnLib.Static;
|
using PkmnLib.Static;
|
||||||
using PkmnLib.Static.Utils;
|
using PkmnLib.Static.Utils;
|
||||||
using TUnit.Assertions.AssertConditions.Throws;
|
|
||||||
|
|
||||||
namespace PkmnLib.Plugin.Gen7.Tests.Scripts.Moves;
|
namespace PkmnLib.Plugin.Gen7.Tests.Scripts.Moves;
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public class DrainTests
|
|||||||
drain.OnSecondaryEffect(move, target, 0);
|
drain.OnSecondaryEffect(move, target, 0);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await Assert.That(GetHealAmount(user)).IsEqualTo(50u);
|
await Assert.That(GetHealAmount(user)!.Value).IsEqualTo(50u);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -97,7 +97,7 @@ public class DrainTests
|
|||||||
drain.OnSecondaryEffect(move, target, 0);
|
drain.OnSecondaryEffect(move, target, 0);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await Assert.That(GetHealAmount(user)).IsEqualTo(expectedHeal);
|
await Assert.That(GetHealAmount(user)!.Value).IsEqualTo(expectedHeal);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -115,7 +115,7 @@ public class DrainTests
|
|||||||
drain.OnSecondaryEffect(move, target, 0);
|
drain.OnSecondaryEffect(move, target, 0);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await Assert.That(GetHealAmount(user)).IsEqualTo(1u);
|
await Assert.That(GetHealAmount(user)!.Value).IsEqualTo(1u);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -132,7 +132,7 @@ public class DrainTests
|
|||||||
drain.OnSecondaryEffect(move, target, 0);
|
drain.OnSecondaryEffect(move, target, 0);
|
||||||
|
|
||||||
// Assert - 65% of 100 damage
|
// Assert - 65% of 100 damage
|
||||||
await Assert.That(GetHealAmount(user)).IsEqualTo(65u);
|
await Assert.That(GetHealAmount(user)!.Value).IsEqualTo(65u);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -149,7 +149,7 @@ public class DrainTests
|
|||||||
drain.OnSecondaryEffect(move, target, 0);
|
drain.OnSecondaryEffect(move, target, 0);
|
||||||
|
|
||||||
// Assert - user takes the 50 HP it would have gained, and is not healed
|
// Assert - user takes the 50 HP it would have gained, and is not healed
|
||||||
await Assert.That(GetDamageAmount(user)).IsEqualTo(50u);
|
await Assert.That(GetDamageAmount(user)!.Value).IsEqualTo(50u);
|
||||||
await Assert.That(user.ReceivedCalls().Any(c => c.GetMethodInfo().Name == "Heal")).IsFalse();
|
await Assert.That(user.ReceivedCalls().Any(c => c.GetMethodInfo().Name == "Heal")).IsFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ public class DrainTests
|
|||||||
drain.OnSecondaryEffect(move, target, 0);
|
drain.OnSecondaryEffect(move, target, 0);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await Assert.That(GetDamageSource(user)).IsEqualTo(DamageSource.Misc);
|
await Assert.That(GetDamageSource(user)!.Value).IsEqualTo(DamageSource.Misc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -184,7 +184,7 @@ public class DrainTests
|
|||||||
drain.OnSecondaryEffect(move, target, 0);
|
drain.OnSecondaryEffect(move, target, 0);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await Assert.That(GetDamageAmount(user)).IsEqualTo(65u);
|
await Assert.That(GetDamageAmount(user)!.Value).IsEqualTo(65u);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -238,6 +238,6 @@ public class DrainTests
|
|||||||
drain.OnSecondaryEffect(move, target, 0);
|
drain.OnSecondaryEffect(move, target, 0);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await Assert.That(GetHealAmount(user)).IsEqualTo(50u);
|
await Assert.That(GetHealAmount(user)!.Value).IsEqualTo(50u);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,7 @@ namespace PkmnLib.Plugin.Gen7.Tests.Scripts.Moves;
|
|||||||
|
|
||||||
public class HiddenPowerTests
|
public class HiddenPowerTests
|
||||||
{
|
{
|
||||||
public record TestCaseData(IndividualValueStatisticSet Ivs, StringKey ExpectedType, byte ExpectedPower)
|
public record TestCaseData(IndividualValueStatisticSet Ivs, StringKey ExpectedType, ushort ExpectedPower)
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string ToString() =>
|
public override string ToString() =>
|
||||||
|
|||||||
@@ -86,6 +86,6 @@ public class MultiAttackTests
|
|||||||
multiAttack.ChangeMoveType(move, target, 0, ref typeIdentifier);
|
multiAttack.ChangeMoveType(move, target, 0, ref typeIdentifier);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await Assert.That(typeIdentifier!.Value.Name).IsEqualTo(test.ExpectedTypeName);
|
await Assert.That(typeIdentifier!.Value.Name.ToString()).IsEqualTo(test.ExpectedTypeName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using PkmnLib.Dynamic.AI.Explicit;
|
using PkmnLib.Dynamic.AI.Explicit;
|
||||||
using PkmnLib.Plugin.Gen7.Scripts.Moves;
|
|
||||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||||
using PkmnLib.Plugin.Gen7.Scripts.Side;
|
using PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||||
using PkmnLib.Plugin.Gen7.Scripts.Status;
|
using PkmnLib.Plugin.Gen7.Scripts.Status;
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
using PkmnLib.Plugin.Gen7.Common;
|
|
||||||
|
|
||||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
|||||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/RKS_System_(Ability)">Bulbapedia - RKS System</see>
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/RKS_System_(Ability)">Bulbapedia - RKS System</see>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Script(ScriptCategory.Ability, "rks_system")]
|
[Script(ScriptCategory.Ability, "rks_system")]
|
||||||
public class RKSSystem : Script, IScriptOnAfterHeldItemChange
|
public class RksSystem : Script, IScriptOnAfterHeldItemChange
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void OnAfterHeldItemChange(IPokemon pokemon, IItem? previous, IItem? item)
|
public void OnAfterHeldItemChange(IPokemon pokemon, IItem? previous, IItem? item)
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
using PkmnLib.Plugin.Gen7.Common;
|
|
||||||
|
|
||||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ public class KnockOff : Script, IScriptOnSecondaryEffect
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||||
{
|
{
|
||||||
if (!target.TryStealHeldItem(out var item))
|
if (!target.TryStealHeldItem(out _))
|
||||||
{
|
{
|
||||||
move.GetHitData(target, hit).Fail();
|
move.GetHitData(target, hit).Fail();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
|||||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||||
|
|
||||||
[Script(ScriptCategory.Move, "magma_storm")]
|
[Script(ScriptCategory.Move, "magma_storm")]
|
||||||
public class MagmaStorm : MultiHitMove
|
public class MagmaStorm : MultiHitMove, IScriptOnSecondaryEffect
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||||
using PkmnLib.Static.Moves;
|
|
||||||
|
|
||||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
using PkmnLib.Plugin.Gen7.Common;
|
|
||||||
|
|
||||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||||
|
|
||||||
[Script(ScriptCategory.Pokemon, "protect")]
|
[Script(ScriptCategory.Pokemon, "protect")]
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class PursuitEffect : Script, IScriptOnSwitchOut
|
|||||||
|
|
||||||
var choiceQueue = battleData.Battle.ChoiceQueue;
|
var choiceQueue = battleData.Battle.ChoiceQueue;
|
||||||
|
|
||||||
var choice = choiceQueue?.FirstOrDefault(x => x == _choice);
|
var choice = choiceQueue?.FirstOrDefault(x => Equals(x, _choice));
|
||||||
if (choice == null)
|
if (choice == null)
|
||||||
return;
|
return;
|
||||||
choiceQueue!.Remove(choice);
|
choiceQueue!.Remove(choice);
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
using PkmnLib.Plugin.Gen7.Common;
|
|
||||||
|
|
||||||
namespace PkmnLib.Plugin.Gen7.Scripts.Status;
|
namespace PkmnLib.Plugin.Gen7.Scripts.Status;
|
||||||
|
|
||||||
[Script(ScriptCategory.Status, "frozen")]
|
[Script(ScriptCategory.Status, "frozen")]
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
namespace PkmnLib.Plugin.Gen7.Scripts.Weather;
|
namespace PkmnLib.Plugin.Gen7.Scripts.Weather;
|
||||||
|
|
||||||
[Script(ScriptCategory.Weather, "desolate_lands")]
|
[Script(ScriptCategory.Weather, "desolate_lands")]
|
||||||
public class DesolateLands : HarshSunlight, IScriptFailMove, IScriptOnEndTurn, IScriptOnSwitchOut,
|
public class DesolateLands : HarshSunlight, IScriptFailMove, IScriptOnSwitchOut, IScriptPreventWeatherChange
|
||||||
IScriptPreventWeatherChange
|
|
||||||
{
|
{
|
||||||
private readonly HashSet<IPokemon> _placers = [];
|
private readonly HashSet<IPokemon> _placers = [];
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace PkmnLib.Plugin.Gen7.Scripts.Weather;
|
namespace PkmnLib.Plugin.Gen7.Scripts.Weather;
|
||||||
|
|
||||||
[Script(ScriptCategory.Weather, "primordial_sea")]
|
[Script(ScriptCategory.Weather, "primordial_sea")]
|
||||||
public class PrimordialSea : Rain, IScriptFailMove, IScriptOnEndTurn, IScriptOnSwitchOut, IScriptPreventWeatherChange
|
public class PrimordialSea : Rain, IScriptFailMove, IScriptOnSwitchOut, IScriptPreventWeatherChange
|
||||||
{
|
{
|
||||||
private HashSet<IPokemon> _placers = new();
|
private HashSet<IPokemon> _placers = new();
|
||||||
|
|
||||||
|
|||||||
5
global.json
Normal file
5
global.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"test": {
|
||||||
|
"runner": "Microsoft.Testing.Platform"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user