Slight cleanup, do some TODOs
All checks were successful
Build / Build (push) Successful in 51s

This commit is contained in:
2025-06-22 10:42:25 +02:00
parent e305cfaef6
commit 2533512eda
114 changed files with 218 additions and 168 deletions

View File

@@ -1,7 +1,46 @@
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
using PkmnLib.Plugin.Gen7.Scripts.Utils;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "secret_power")]
public class SecretPower : Script
{
// FIXME: Implement this. How to get the terrain in a sane manner? See also Camouflage.cs
/// <inheritdoc />
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
{
var environmentCategory = move.Battle.GetEnvironmentCategory();
switch (environmentCategory)
{
case EnvironmentHelper.EnvironmentCategory.Electric:
case EnvironmentHelper.EnvironmentCategory.Normal:
target.SetStatus(ScriptUtils.ResolveName<Status.Paralyzed>(), move.User);
break;
case EnvironmentHelper.EnvironmentCategory.Rock:
target.Volatile.Add(new FlinchEffect());
break;
case EnvironmentHelper.EnvironmentCategory.Ground:
target.ChangeStatBoost(Statistic.Accuracy, -1, false, false);
break;
case EnvironmentHelper.EnvironmentCategory.Water:
target.ChangeStatBoost(Statistic.Attack, -1, false, false);
break;
case EnvironmentHelper.EnvironmentCategory.Ice:
target.SetStatus(ScriptUtils.ResolveName<Status.Frozen>(), move.User);
break;
case EnvironmentHelper.EnvironmentCategory.Grass:
target.SetStatus(ScriptUtils.ResolveName<Status.Sleep>(), move.User);
break;
case EnvironmentHelper.EnvironmentCategory.Fairy:
target.ChangeStatBoost(Statistic.SpecialAttack, -1, false, false);
break;
case EnvironmentHelper.EnvironmentCategory.Psychic:
target.ChangeStatBoost(Statistic.Speed, -1, false, false);
break;
// ReSharper disable once RedundantEmptySwitchSection
default:
// No effect for unrecognized environments
break;
}
}
}