Implements more abilities
All checks were successful
Build / Build (push) Successful in 47s

This commit is contained in:
2025-06-09 12:10:25 +02:00
parent af0126e413
commit 00005aa4bf
50 changed files with 80425 additions and 20485 deletions

View File

@@ -7,6 +7,14 @@ public class ChargeMove : Script
{
public override void PreventMove(IExecutingMove move, ref bool prevent)
{
var bypassCharge = false;
var parameters = new Dictionary<StringKey, object?>
{
{ "move", move },
{ "bypassCharge", bypassCharge },
};
move.RunScriptHook(script => script.CustomTrigger(CustomTriggers.BypassChargeMove, parameters));
var chargeMoveEffect = move.User.Volatile.Get<ChargeMoveEffect>();
if (chargeMoveEffect != null && chargeMoveEffect.MoveName == move.UseMove.Name)
return;

View File

@@ -0,0 +1,18 @@
using PkmnLib.Plugin.Gen7.Scripts.Weather;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "growth")]
public class Growth : Script
{
/// <inheritdoc />
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
{
EventBatchId batchId = new();
sbyte amount = 1;
if (move.Battle.WeatherName == ScriptUtils.ResolveName<HarshSunlight>())
amount = 2;
move.User.ChangeStatBoost(Statistic.Attack, amount, true, batchId);
move.User.ChangeStatBoost(Statistic.SpecialAttack, amount, true, batchId);
}
}

View File

@@ -15,7 +15,7 @@ public class Moonlight : Script
var fraction = 0.5f;
var weather = battleData.Battle.WeatherName;
if (weather == ScriptUtils.ResolveName<Sunny>())
if (weather == ScriptUtils.ResolveName<HarshSunlight>())
fraction = 2f / 3f;
else if (weather == ScriptUtils.ResolveName<Rain>() || weather == ScriptUtils.ResolveName<Hail>() ||
weather == ScriptUtils.ResolveName<Sandstorm>())

View File

@@ -8,7 +8,7 @@ public class Synthesis : Script
{
var healModifier = 0.5f;
var weatherName = target.BattleData?.Battle.WeatherName;
if (weatherName == ScriptUtils.ResolveName<Weather.Sunny>())
if (weatherName == ScriptUtils.ResolveName<Weather.HarshSunlight>())
healModifier = 2 / 3f;
else if (weatherName == ScriptUtils.ResolveName<Weather.Rain>() ||
weatherName == ScriptUtils.ResolveName<Weather.Hail>() ||

View File

@@ -23,7 +23,7 @@ public class WeatherBall : Script
if (weather is null)
return;
if (weather == ScriptUtils.ResolveName<Weather.Sunny>() &&
if (weather == ScriptUtils.ResolveName<Weather.HarshSunlight>() &&
typeLibrary.TryGetTypeIdentifier("fire", out var fireType))
typeIdentifier = fireType;
else if (weather == ScriptUtils.ResolveName<Weather.Rain>() &&