This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using PkmnLib.Dynamic;
|
||||
using PkmnLib.Dynamic.Libraries;
|
||||
using PkmnLib.Static.Moves;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Libraries.Battling;
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Battle;
|
||||
|
||||
[Script(ScriptCategory.Battle, "gravity")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Battle;
|
||||
|
||||
[Script(ScriptCategory.Battle, "mud_sport")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Battle;
|
||||
|
||||
[Script(ScriptCategory.Battle, "uproar_effect")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Items;
|
||||
|
||||
[ItemScript("healing_item")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Items;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
|
||||
|
||||
[Script(ScriptCategory.MoveVolatile, "bypass_sleep")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
|
||||
|
||||
[Script(ScriptCategory.MoveVolatile, "me_first")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
|
||||
|
||||
[Script(ScriptCategory.MoveVolatile, "round")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
using PkmnLib.Static.Moves;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Weather;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "beat_up")]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "brine")]
|
||||
|
||||
@@ -1,7 +1,44 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "camouflage")]
|
||||
public class Camouflage : Script
|
||||
{
|
||||
// FIXME: Implement this. How to get the terrain in a sane manner? See also SecretPower.cs
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var type = GetTypeIdentifier(move.Battle);
|
||||
if (type == null)
|
||||
return;
|
||||
move.User.SetTypes([type.Value]);
|
||||
}
|
||||
|
||||
private static TypeIdentifier? GetTypeIdentifier(IBattle battle)
|
||||
{
|
||||
var typesLibrary = battle.Library.StaticLibrary.Types;
|
||||
var environmentCategory = battle.GetEnvironmentCategory();
|
||||
return environmentCategory switch
|
||||
{
|
||||
EnvironmentHelper.EnvironmentCategory.Electric when typesLibrary.TryGetTypeIdentifier("electric",
|
||||
out var electricType) => electricType,
|
||||
EnvironmentHelper.EnvironmentCategory.Fairy when typesLibrary.TryGetTypeIdentifier("fairy",
|
||||
out var fairyType) => fairyType,
|
||||
EnvironmentHelper.EnvironmentCategory.Grass when typesLibrary.TryGetTypeIdentifier("grass",
|
||||
out var grassType) => grassType,
|
||||
EnvironmentHelper.EnvironmentCategory.Psychic when typesLibrary.TryGetTypeIdentifier("psychic",
|
||||
out var psychicType) => psychicType,
|
||||
EnvironmentHelper.EnvironmentCategory.Rock when typesLibrary.TryGetTypeIdentifier("rock", out var rockType)
|
||||
=> rockType,
|
||||
EnvironmentHelper.EnvironmentCategory.Ground when typesLibrary.TryGetTypeIdentifier("ground",
|
||||
out var groundType) => groundType,
|
||||
EnvironmentHelper.EnvironmentCategory.Ice when typesLibrary.TryGetTypeIdentifier("ice", out var iceType) =>
|
||||
iceType,
|
||||
EnvironmentHelper.EnvironmentCategory.Water when typesLibrary.TryGetTypeIdentifier("water",
|
||||
out var waterType) => waterType,
|
||||
EnvironmentHelper.EnvironmentCategory.Normal when typesLibrary.TryGetTypeIdentifier("normal",
|
||||
out var normalType) => normalType,
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "change_all_target_stats")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "change_multiple_target_stat_boosts")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "change_multiple_user_stat_boosts")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
public abstract class ChangeTargetStats : Script
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
public abstract class ChangeUserStats : Script
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "conversion")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "conversion_2")]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "core_enforcer")]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "cure_party_status")]
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using JetBrains.Annotations;
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "facade")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "flame_burst")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "flame_wheel")]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "gear_up")]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "grudge")]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "heal_percent")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "hex")]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "last_resort")]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "magnetic_flux")]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Static.Moves;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Static.Moves;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Weather;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "natural_gift")]
|
||||
|
||||
@@ -1,7 +1,52 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
using PkmnLib.Static.Moves;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "nature_power")]
|
||||
public class NaturePower : Script
|
||||
{
|
||||
// FIXME: Implement this. How to get the terrain in a sane manner?
|
||||
/// <inheritdoc />
|
||||
public override void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||
{
|
||||
var battleData = choice.User.BattleData;
|
||||
if (battleData is null)
|
||||
return;
|
||||
var newMoveName = GetMoveName(battleData.Battle);
|
||||
if (newMoveName is null)
|
||||
{
|
||||
choice.Fail();
|
||||
return;
|
||||
}
|
||||
moveName = newMoveName.Value;
|
||||
}
|
||||
|
||||
private static StringKey? GetMoveName(IBattle battle)
|
||||
{
|
||||
var movesLibrary = battle.Library.StaticLibrary.Moves;
|
||||
var environmentCategory = battle.GetEnvironmentCategory();
|
||||
var moveName = environmentCategory switch
|
||||
{
|
||||
EnvironmentHelper.EnvironmentCategory.Electric when movesLibrary.TryGet("thunderbolt",
|
||||
out var thunderboltMove) => (StringKey?)thunderboltMove.Name,
|
||||
EnvironmentHelper.EnvironmentCategory.Fairy when movesLibrary.TryGet("moonblast", out var moonblastMove) =>
|
||||
moonblastMove.Name,
|
||||
EnvironmentHelper.EnvironmentCategory.Grass when movesLibrary.TryGet("energy_ball", out var energyballMove)
|
||||
=> energyballMove.Name,
|
||||
EnvironmentHelper.EnvironmentCategory.Psychic when movesLibrary.TryGet("psychic", out var psychicMove) =>
|
||||
psychicMove.Name,
|
||||
EnvironmentHelper.EnvironmentCategory.Rock when movesLibrary.TryGet("power_gem", out var rockMove) =>
|
||||
rockMove.Name,
|
||||
EnvironmentHelper.EnvironmentCategory.Ground when movesLibrary.TryGet("earth_power", out var groundMove) =>
|
||||
groundMove.Name,
|
||||
EnvironmentHelper.EnvironmentCategory.Ice when movesLibrary.TryGet("ice_beam", out var iceMove) => iceMove
|
||||
.Name,
|
||||
EnvironmentHelper.EnvironmentCategory.Water when movesLibrary.TryGet("hydro_pump", out var waterMove) =>
|
||||
waterMove.Name,
|
||||
EnvironmentHelper.EnvironmentCategory.Normal when movesLibrary.TryGet("tri_attack", out var normalMove) =>
|
||||
normalMove.Name,
|
||||
_ => null,
|
||||
};
|
||||
return moveName;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "one_hit_ko")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "power_trip")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "psywave")]
|
||||
|
||||
@@ -13,16 +13,15 @@ public class RapidSpin : Script
|
||||
move.User.Volatile.Remove<BindEffect>();
|
||||
move.User.Volatile.Remove<FireSpinEffect>();
|
||||
move.User.Volatile.Remove<MagmaStormEffect>();
|
||||
// TODO: Whirlpool effect removal
|
||||
// TODO: Wrap effect removal
|
||||
move.User.Volatile.Remove<WhirlpoolEffect>();
|
||||
|
||||
var battleData = move.User.BattleData;
|
||||
if (battleData != null)
|
||||
{
|
||||
battleData.BattleSide.VolatileScripts.Remove<SpikesEffect>();
|
||||
battleData.BattleSide.VolatileScripts.Remove<StickyWebEffect>();
|
||||
// TODO: Remove Toxic Spikes
|
||||
// TODO: Remove Stealth Rock
|
||||
battleData.BattleSide.VolatileScripts.Remove<ToxicSpikesEffect>();
|
||||
battleData.BattleSide.VolatileScripts.Remove<StealthRockEffect>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "reflect")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "retaliate")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "rototiller")]
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "set_status")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "set_weather")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "sketch")]
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "static_damage")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "stomping_tantrum")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "synchronoise")]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Battle;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "wake_up_slap")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "weather_ball")]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
[Script(ScriptCategory.Pokemon, "disable")]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Static.Libraries;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
public class RequireChargeEffect(IPokemon owner, StringKey moveName) : BaseChargeEffect(owner, moveName);
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
public class HelpingHandEffect : Script
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
[Script(ScriptCategory.Pokemon, "imprison")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
[Script(ScriptCategory.Pokemon, "ingrain")]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Dynamic.BattleFlow;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
[Script(ScriptCategory.Pokemon, "roost_effect")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
[Script(ScriptCategory.Pokemon, "smack_down")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
[Script(ScriptCategory.Move, "thousand_arrows")]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Status;
|
||||
|
||||
[Script(ScriptCategory.Status, "sleep")]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using PkmnLib.Static.Moves;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
|
||||
public static class EnvironmentHelper
|
||||
{
|
||||
public enum EnvironmentCategory
|
||||
{
|
||||
Electric,
|
||||
Fairy,
|
||||
Grass,
|
||||
Psychic,
|
||||
Rock,
|
||||
Ground,
|
||||
Ice,
|
||||
Water,
|
||||
Normal,
|
||||
}
|
||||
|
||||
public static EnvironmentCategory GetEnvironmentCategory(this IBattle battle)
|
||||
{
|
||||
var terrainName = battle.TerrainName;
|
||||
if (terrainName == ScriptUtils.ResolveName<Terrain.ElectricTerrain>())
|
||||
return EnvironmentCategory.Electric;
|
||||
if (terrainName == ScriptUtils.ResolveName<Terrain.MistyTerrain>())
|
||||
return EnvironmentCategory.Fairy;
|
||||
if (terrainName == ScriptUtils.ResolveName<Terrain.GrassyTerrain>())
|
||||
return EnvironmentCategory.Grass;
|
||||
if (terrainName == ScriptUtils.ResolveName<Terrain.PsychicTerrain>())
|
||||
return EnvironmentCategory.Psychic;
|
||||
|
||||
var environment = battle.EnvironmentName;
|
||||
if (environment.Contains("cave"))
|
||||
return EnvironmentCategory.Rock;
|
||||
if (environment.Contains("mountain") || environment.Contains("beach"))
|
||||
return EnvironmentCategory.Ground;
|
||||
if (environment.Contains("snow"))
|
||||
return EnvironmentCategory.Ice;
|
||||
if (environment.Contains("sea") || environment.Contains("lake") || environment.Contains("river"))
|
||||
return EnvironmentCategory.Water;
|
||||
if (environment.Contains("forest") || environment.Contains("field"))
|
||||
return EnvironmentCategory.Normal;
|
||||
return EnvironmentCategory.Normal; // Default case if no specific environment is matched
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user