Fixes several moves

This commit is contained in:
2025-02-01 15:26:57 +01:00
parent 00fe08dcd4
commit 0669f15a98
10 changed files with 49 additions and 12 deletions

View File

@@ -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

View 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);
}
}
}
}