Fixes for masterball

This commit is contained in:
Deukhoofd committed 2026-11-03 15:45:54 +01:00
1 parent e38bb05007
commit 4c51e67985
5 files changed
+381 -4

No files matched your search

+1 -4
View File
@@ -3514,10 +3514,7 @@
"flingPower": 0
},
"battleEffect": {
"name": "pokeball_flat_modifier",
"parameters": {
"catchRate": 255
}
"name": "master_ball"
}
},
{
@@ -24,6 +24,9 @@ public class Gen7CaptureLibrary : ICaptureLibrary
if (target.Library.ScriptResolver.TryResolveBattleItemScript(captureItem, out var script) &&
script is PokeballScript pokeballScript)
{
if (pokeballScript.IsAlwaysSuccessful(target))
return new CaptureResult(true, 4, false);
pokeballScript.ChangeCatchRate(target, ref catchRate);
}
@@ -0,0 +1,11 @@
namespace PkmnLib.Plugin.Gen7.Scripts.Items.Pokeballs;
[ItemScript("master_ball")]
public class MasterBall(IItem item) : PokeballScript(item)
{
public override bool IsAlwaysSuccessful(IBattlePokemon target) => true;
public override void ChangeCatchRate(IBattlePokemon target, ref byte catchRate)
{
}
}