Adds more move scripts
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
public abstract class BaseChargeMove<TVolatile> : Script where TVolatile : Script
|
||||
public abstract class BaseChargeMove<TVolatile> : Script where TVolatile : RequireChargeEffect
|
||||
{
|
||||
public abstract TVolatile CreateVolatile(IPokemon user);
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@ public class ElectricTerrain : Script
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
battleData?.Battle.SetTerrain(ScriptUtils.ResolveName<ElectricTerrain>());
|
||||
battleData?.Battle.SetTerrain(ScriptUtils.ResolveName<Terrain.ElectricTerrain>());
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "freeze_shock")]
|
||||
public class FreezeShock : BaseChargeMove<FreezeShockEffect>
|
||||
public class FreezeShock : BaseChargeMove<RequireChargeEffect>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override FreezeShockEffect CreateVolatile(IPokemon user) => new(user);
|
||||
public override RequireChargeEffect CreateVolatile(IPokemon user) => new(user, "freeze_shock");
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
|
||||
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/GearUp.cs
Normal file
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/GearUp.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using PkmnLib.Static;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "gear_up")]
|
||||
public class GearUp : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
if (battleData == null)
|
||||
return;
|
||||
|
||||
var side = battleData.Battle.Sides[battleData.SideIndex];
|
||||
EventBatchId evtBatchId = new();
|
||||
foreach (var pokemon in side.Pokemon.WhereNotNull())
|
||||
{
|
||||
var ability = pokemon.ActiveAbility?.Name;
|
||||
if (ability != "plus" && ability != "minus")
|
||||
continue;
|
||||
pokemon.ChangeStatBoost(Statistic.Attack, 1, pokemon == move.User, evtBatchId);
|
||||
pokemon.ChangeStatBoost(Statistic.SpecialAttack, 1, pokemon == move.User, evtBatchId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Terrain;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "genesis_supernova")]
|
||||
public class GenesisSupernova : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
if (battleData == null)
|
||||
return;
|
||||
|
||||
battleData.Battle.SetTerrain(ScriptUtils.ResolveName<PsychicTerrain>());
|
||||
}
|
||||
}
|
||||
19
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Geomancy.cs
Normal file
19
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Geomancy.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
using PkmnLib.Static;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
public class Geomancy : BaseChargeMove<RequireChargeEffect>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override RequireChargeEffect CreateVolatile(IPokemon user) => new(user, "geomancy");
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
EventBatchId eventBatchId = new();
|
||||
move.User.ChangeStatBoost(Statistic.SpecialAttack, 2, true, eventBatchId);
|
||||
move.User.ChangeStatBoost(Statistic.SpecialDefense, 2, true, eventBatchId);
|
||||
move.User.ChangeStatBoost(Statistic.Speed, 2, true, eventBatchId);
|
||||
}
|
||||
}
|
||||
20
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/GrassKnot.cs
Normal file
20
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/GrassKnot.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "grass_knot")]
|
||||
public class GrassKnot : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref byte basePower)
|
||||
{
|
||||
var targetWeight = target.WeightInKg;
|
||||
basePower = targetWeight switch
|
||||
{
|
||||
< 10 => 20,
|
||||
< 25 => 40,
|
||||
< 50 => 60,
|
||||
< 100 => 80,
|
||||
< 200 => 100,
|
||||
_ => 120,
|
||||
};
|
||||
}
|
||||
}
|
||||
7
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/GrassPledge.cs
Normal file
7
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/GrassPledge.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "grass_pledge")]
|
||||
public class GrassPledge : Script
|
||||
{
|
||||
// TODO: pledge moves
|
||||
}
|
||||
14
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/GrassTerrain.cs
Normal file
14
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/GrassTerrain.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Terrain;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "grassy_terrain")]
|
||||
public class GrassyTerrain : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
battleData?.Battle.SetTerrain(ScriptUtils.ResolveName<Terrain.GrassyTerrain>());
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,14 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
public abstract class BaseChargeEffect : Script
|
||||
{
|
||||
private readonly IPokemon _owner;
|
||||
private readonly string _moveName;
|
||||
private readonly StringKey _moveName;
|
||||
|
||||
public BaseChargeEffect(IPokemon owner, string moveName)
|
||||
public BaseChargeEffect(IPokemon owner, StringKey moveName)
|
||||
{
|
||||
_owner = owner;
|
||||
_moveName = moveName;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
[Script(ScriptCategory.Pokemon, "freeze_shock")]
|
||||
public class FreezeShockEffect(IPokemon owner) : BaseChargeEffect(owner, "freeze_shock");
|
||||
public class RequireChargeEffect(IPokemon owner, StringKey moveName) : BaseChargeEffect(owner, moveName);
|
||||
@@ -3,5 +3,5 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Terrain;
|
||||
[Script(ScriptCategory.Terrain, "electric_terrain")]
|
||||
public class ElectricTerrain : Script
|
||||
{
|
||||
// TODO: Implement Electric Terrain
|
||||
// TODO: Implement Terrain
|
||||
}
|
||||
@@ -3,5 +3,5 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Terrain;
|
||||
[Script(ScriptCategory.Terrain, "grassy_terrain")]
|
||||
public class GrassyTerrain : Script
|
||||
{
|
||||
// TODO: Implement Electric Terrain
|
||||
// TODO: Implement Terrain
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Terrain;
|
||||
|
||||
[Script(ScriptCategory.Terrain, "psychic_terrain")]
|
||||
public class PsychicTerrain : Script
|
||||
{
|
||||
// TODO: Implement Terrain
|
||||
}
|
||||
Reference in New Issue
Block a user