First couple abilities implemented
Build / Build (push) Successful in 48s

This commit is contained in:
Deukhoofd committed 2025-05-31 12:29:03 +02:00
1 parent c1a7b806b1
commit b090aa65f9
34 files changed
+733 -50

No files matched your search

+5 -2
View File
@@ -401,7 +401,7 @@ public interface IPokemon : IScriptSource, IDeepCloneable
/// <summary>
/// Changes the ability of the Pokémon.
/// </summary>
void ChangeAbility(IAbility ability);
bool ChangeAbility(IAbility ability);
/// <summary>
/// Whether the Pokémon is levitating. This is used for moves like Magnet Rise, and abilities such as
@@ -1197,8 +1197,10 @@ public class PokemonImpl : ScriptSource, IPokemon
}
/// <inheritdoc />
public void ChangeAbility(IAbility ability)
public bool ChangeAbility(IAbility ability)
{
if (!ability.CanBeChanged)
return false;
OverrideAbility = ability;
if (Library.ScriptResolver.TryResolve(ScriptCategory.Ability, ability.Name, ability.Parameters,
out var abilityScript))
@@ -1210,6 +1212,7 @@ public class PokemonImpl : ScriptSource, IPokemon
{
AbilityScript.Clear();
}
return true;
}
/// <inheritdoc />