Fixes several moves
This commit is contained in:
@@ -307,7 +307,7 @@
|
||||
"category": "status",
|
||||
"flags": [],
|
||||
"effect": {
|
||||
"name": "SwapWithTarget"
|
||||
"name": "ally_switch"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -644,7 +644,7 @@
|
||||
"mirror"
|
||||
],
|
||||
"effect": {
|
||||
"name": "double_power_user_damaged_by_target_in_turn"
|
||||
"name": "double_power_if_target_damaged_in_turn"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -2371,7 +2371,7 @@
|
||||
"mirror"
|
||||
],
|
||||
"effect": {
|
||||
"name": "raise_user_defense",
|
||||
"name": "change_user_defense",
|
||||
"chance": 50,
|
||||
"parameters": {
|
||||
"amount": 2
|
||||
|
||||
30
PkmnLib.Tests/DataTests/MoveDataTests.cs
Normal file
30
PkmnLib.Tests/DataTests/MoveDataTests.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using PkmnLib.Dynamic.ScriptHandling;
|
||||
using PkmnLib.Tests.Integration;
|
||||
|
||||
namespace PkmnLib.Tests.DataTests;
|
||||
|
||||
public class MoveDataTests
|
||||
{
|
||||
[Test]
|
||||
public async Task AllMoveEffectsHaveValidScripts()
|
||||
{
|
||||
var library = LibraryHelpers.LoadLibrary();
|
||||
var moveLibrary = library.StaticLibrary.Moves;
|
||||
foreach (var move in moveLibrary)
|
||||
{
|
||||
if (move.SecondaryEffect == null)
|
||||
continue;
|
||||
var scriptName = move.SecondaryEffect.Name;
|
||||
|
||||
try
|
||||
{
|
||||
await Assert.That(library.ScriptResolver.TryResolve(ScriptCategory.Move, scriptName,
|
||||
move.SecondaryEffect.Parameters, out var script)).IsTrue();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new AggregateException($"Failed to resolve script for move {move.Name} with effect {scriptName}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user