More work on refactor to interfaces
All checks were successful
Build / Build (push) Successful in 50s
All checks were successful
Build / Build (push) Successful in 50s
This commit is contained in:
@@ -7,10 +7,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Analytic_(Ability)">Bulbapedia - Analytic</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "analytic")]
|
||||
public class Analytic : Script
|
||||
public class Analytic : Script, IScriptChangeDamageModifier
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
public void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
{
|
||||
if (move.Battle.ChoiceQueue?.HasNext() == false)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Bad_Dreams_(Ability)">Bulbapedia - Bad Dreams</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "bad_dreams")]
|
||||
public class BadDreams : Script
|
||||
public class BadDreams : Script, IScriptOnEndTurn
|
||||
{
|
||||
private IPokemon? _owner;
|
||||
|
||||
@@ -20,7 +20,7 @@ public class BadDreams : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
if (_owner is null)
|
||||
return;
|
||||
|
||||
@@ -7,11 +7,11 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Competitive_(Ability)">Bulbapedia - Competitive</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "competitive")]
|
||||
public class Competitive : Script
|
||||
public class Competitive : Script, IScriptOnAfterStatBoostChange
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <inheritdoc />
|
||||
public override void OnAfterStatBoostChange(IPokemon pokemon, Statistic stat, bool selfInflicted, sbyte change)
|
||||
public void OnAfterStatBoostChange(IPokemon pokemon, Statistic stat, bool selfInflicted, sbyte change)
|
||||
{
|
||||
if (change >= 0)
|
||||
return;
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Contrary_(Ability)">Bulbapedia - Contrary</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "contrary")]
|
||||
public class Contrary : Script
|
||||
public class Contrary : Script, IScriptChangeStatBoostChange
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeStatBoostChange(IPokemon target, Statistic stat, bool selfInflicted, ref sbyte amount)
|
||||
public void ChangeStatBoostChange(IPokemon target, Statistic stat, bool selfInflicted, ref sbyte amount)
|
||||
{
|
||||
// Invert the stat change
|
||||
amount = (sbyte)-amount;
|
||||
|
||||
@@ -7,10 +7,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Dark_Aura_(Ability)">Bulbapedia - Dark Aura</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "dark_aura")]
|
||||
public class DarkAura : Script
|
||||
public class DarkAura : Script, IScriptChangeDamageModifier
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
public void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
{
|
||||
if (move.GetHitData(target, hit).Type?.Name == "dark")
|
||||
{
|
||||
|
||||
@@ -7,10 +7,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Defeatist_(Ability)">Bulbapedia - Defeatist</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "defeatist")]
|
||||
public class Defeatist : Script
|
||||
public class Defeatist : Script, IScriptChangeDamageModifier
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
public void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
{
|
||||
if (move.User.CurrentHealth < move.User.MaxHealth / 2)
|
||||
{
|
||||
|
||||
@@ -7,11 +7,11 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Defiant_(Ability)">Bulbapedia - Defiant</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "defiant")]
|
||||
public class Defiant : Script
|
||||
public class Defiant : Script, IScriptOnAfterStatBoostChange
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <inheritdoc />
|
||||
public override void OnAfterStatBoostChange(IPokemon pokemon, Statistic stat, bool selfInflicted, sbyte change)
|
||||
public void OnAfterStatBoostChange(IPokemon pokemon, Statistic stat, bool selfInflicted, sbyte change)
|
||||
{
|
||||
if (change >= 0)
|
||||
return;
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Dry_Skin_(Ability)">Bulbapedia - Dry Skin</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "dry_skin")]
|
||||
public class DrySkin : Script
|
||||
public class DrySkin : Script, IScriptChangeDamageModifier, IScriptOnEndTurn
|
||||
{
|
||||
private IPokemon? _owningPokemon;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class DrySkin : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
public void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
{
|
||||
var hitType = move.GetHitData(target, hit).Type;
|
||||
if (hitType?.Name == "fire")
|
||||
@@ -39,7 +39,7 @@ public class DrySkin : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
if (_owningPokemon == null)
|
||||
return;
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Fairy_Aura_(Ability)">Bulbapedia - Fairy Aura</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "fairy_aura")]
|
||||
public class FairyAura : Script
|
||||
public class FairyAura : Script, IScriptChangeDamageModifier
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
public void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
{
|
||||
if (move.GetHitData(target, hit).Type?.Name == "fairy")
|
||||
{
|
||||
|
||||
@@ -7,11 +7,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Filter_(Ability)">Bulbapedia - Filter</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "filter")]
|
||||
public class Filter : Script
|
||||
public class Filter : Script, IScriptChangeIncomingMoveDamageModifier
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingMoveDamageModifier(IExecutingMove move, IPokemon target, byte hit,
|
||||
ref float modifier)
|
||||
public void ChangeIncomingMoveDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
{
|
||||
if (move.GetHitData(target, hit).Effectiveness >= 2.0f)
|
||||
{
|
||||
|
||||
@@ -9,10 +9,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Flare_Boost_(Ability)">Bulbapedia - Flare Boost</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "flare_boost")]
|
||||
public class FlareBoost : Script
|
||||
public class FlareBoost : Script, IScriptChangeDamageModifier
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
public void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
{
|
||||
if (!move.User.HasStatus(ScriptUtils.ResolveName<Status.Burned>()))
|
||||
return;
|
||||
|
||||
@@ -7,10 +7,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Fluffy_(Ability)">Bulbapedia - Fluffy</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "fluffy")]
|
||||
public class Fluffy : Script
|
||||
public class Fluffy : Script, IScriptChangeDamageModifier
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
public void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
{
|
||||
if (move.GetHitData(target, hit).Type?.Name == "fire")
|
||||
{
|
||||
|
||||
@@ -7,10 +7,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Full_Metal_Body_(Ability)">Bulbapedia - Full Metal Body</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "full_metal_body")]
|
||||
public class FullMetalBody : Script
|
||||
public class FullMetalBody : Script, IScriptPreventStatBoostChange
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventStatBoostChange(IPokemon target, Statistic stat, sbyte amount, bool selfInflicted,
|
||||
public void PreventStatBoostChange(IPokemon target, Statistic stat, sbyte amount, bool selfInflicted,
|
||||
ref bool prevent)
|
||||
{
|
||||
if (selfInflicted)
|
||||
|
||||
@@ -9,10 +9,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Fur_Coat_(Ability)">Bulbapedia - Fur Coat</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "fur_coat")]
|
||||
public class FurCoat : Script
|
||||
public class FurCoat : Script, IScriptChangeIncomingMoveDamage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
public void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (move.UseMove.Category == MoveCategory.Physical)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Galvanize_(Ability)">Bulbapedia - Galvanize</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "galvanize")]
|
||||
public class Galvanize : Script, IScriptChangeMoveType
|
||||
public class Galvanize : Script, IScriptChangeMoveType, IScriptChangeDamageModifier
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void ChangeMoveType(IExecutingMove move, IPokemon target, byte hit, ref TypeIdentifier? typeIdentifier)
|
||||
@@ -20,7 +20,7 @@ public class Galvanize : Script, IScriptChangeMoveType
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
public void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
{
|
||||
if (move.GetHitData(target, hit).Type?.Name == "electric")
|
||||
modifier *= 1.2f;
|
||||
|
||||
@@ -7,11 +7,11 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Grass_Pelt_(Ability)">Bulbapedia - Grass Pelt</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "grass_pelt")]
|
||||
public class GrassPelt : Script
|
||||
public class GrassPelt : Script, IScriptChangeIncomingMoveDefensiveStatValue
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingMoveDefensiveStatValue(IExecutingMove move, IPokemon target, byte hit,
|
||||
uint offensiveStat, StatisticSet<uint> statisticSet, Statistic stat, ref uint value)
|
||||
public void ChangeIncomingMoveDefensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint offensiveStat,
|
||||
StatisticSet<uint> statisticSet, Statistic stat, ref uint value)
|
||||
{
|
||||
if (move.Battle.TerrainName == ScriptUtils.ResolveName<Terrain.GrassyTerrain>() && stat == Statistic.Defense)
|
||||
value = value.MultiplyOrMax(1.5f);
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Guts_(Ability)">Bulbapedia - Guts</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "guts")]
|
||||
public class Guts : Script
|
||||
public class Guts : Script, IScriptChangeOffensiveStatValue
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||
public void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||
ImmutableStatisticSet<uint> targetStats, Statistic stat, ref uint value)
|
||||
{
|
||||
if (target.StatusScript.IsEmpty)
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Harvest_(Ability)">Bulbapedia - Harvest</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "harvest")]
|
||||
public class Harvest : Script
|
||||
public class Harvest : Script, IScriptOnEndTurn
|
||||
{
|
||||
private IPokemon? _pokemon;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class Harvest : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
if (_pokemon?.BattleData is null)
|
||||
return;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Healer_(Ability)">Bulbapedia - Healer</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "healer")]
|
||||
public class Healer : Script
|
||||
public class Healer : Script, IScriptOnEndTurn
|
||||
{
|
||||
private IPokemon? _pokemon;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class Healer : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
if (_pokemon?.BattleData is null)
|
||||
return;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Huge_Power_(Ability)">Bulbapedia - Huge Power</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "huge_power")]
|
||||
public class HugePower : Script
|
||||
public class HugePower : Script, IScriptChangeOffensiveStatValue
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||
public void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||
ImmutableStatisticSet<uint> targetStats, Statistic stat, ref uint value)
|
||||
{
|
||||
if (stat == Statistic.Attack)
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Hustle_(Ability)">Bulbapedia - Hustle</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "hustle")]
|
||||
public class Hustle : Script
|
||||
public class Hustle : Script, IScriptChangeOffensiveStatValue
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||
public void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||
ImmutableStatisticSet<uint> targetStats, Statistic stat, ref uint value)
|
||||
{
|
||||
if (stat != Statistic.Attack)
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Hydration_(Ability)">Bulbapedia - Hydration</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "hydration")]
|
||||
public class Hydration : Script
|
||||
public class Hydration : Script, IScriptOnEndTurn
|
||||
{
|
||||
private IPokemon? _pokemon;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class Hydration : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
if (_pokemon is null)
|
||||
return;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Hyper_Cutter_(Ability)">Bulbapedia - Hyper Cutter</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "hyper_cutter")]
|
||||
public class HyperCutter : Script
|
||||
public class HyperCutter : Script, IScriptPreventStatBoostChange
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventStatBoostChange(IPokemon target, Statistic stat, sbyte amount, bool selfInflicted,
|
||||
public void PreventStatBoostChange(IPokemon target, Statistic stat, sbyte amount, bool selfInflicted,
|
||||
ref bool prevent)
|
||||
{
|
||||
if (stat != Statistic.Attack)
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Ice_Body_(Ability)">Bulbapedia - Ice Body</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "ice_body")]
|
||||
public class IceBody : Script
|
||||
public class IceBody : Script, IScriptOnEndTurn
|
||||
{
|
||||
private IPokemon? _pokemon;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class IceBody : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
if (_pokemon is null)
|
||||
return;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Keen_Eye_(Ability)">Bulbapedia - Keen Eye</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "keen_eye")]
|
||||
public class KeenEye : Script
|
||||
public class KeenEye : Script, IScriptPreventStatBoostChange
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventStatBoostChange(IPokemon target, Statistic stat, sbyte amount, bool selfInflicted,
|
||||
public void PreventStatBoostChange(IPokemon target, Statistic stat, sbyte amount, bool selfInflicted,
|
||||
ref bool prevent)
|
||||
{
|
||||
if (stat == Statistic.Accuracy && amount < 0)
|
||||
|
||||
@@ -6,11 +6,11 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Marvel_Scale_(Ability)">Bulbapedia - Marvel Scale</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "marvel_scale")]
|
||||
public class MarvelScale : Script
|
||||
public class MarvelScale : Script, IScriptChangeIncomingMoveDefensiveStatValue
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingMoveDefensiveStatValue(IExecutingMove move, IPokemon target, byte hit,
|
||||
uint offensiveStat, StatisticSet<uint> statisticSet, Statistic stat, ref uint value)
|
||||
public void ChangeIncomingMoveDefensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint offensiveStat,
|
||||
StatisticSet<uint> statisticSet, Statistic stat, ref uint value)
|
||||
{
|
||||
if (!target.StatusScript.IsEmpty && stat == Statistic.Defense)
|
||||
{
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Minus_(Ability)">Bulbapedia - Minus</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "minus")]
|
||||
public class Minus : Script
|
||||
public class Minus : Script, IScriptChangeOffensiveStatValue
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||
public void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||
ImmutableStatisticSet<uint> targetStats, Statistic stat, ref uint value)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Moody_(Ability)">Bulbapedia - Moody</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "moody")]
|
||||
public class Moody : Script
|
||||
public class Moody : Script, IScriptOnEndTurn
|
||||
{
|
||||
private IPokemon? _pokemon;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class Moody : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
if (_pokemon == null)
|
||||
return;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Multiscale_(Ability)">Bulbapedia - Multiscale</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "multiscale")]
|
||||
public class Multiscale : Script
|
||||
public class Multiscale : Script, IScriptChangeIncomingMoveDamage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
public void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (target.CurrentHealth == target.BoostedStats.Hp)
|
||||
{
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Plus_(Ability)">Bulbapedia - Plus</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "plus")]
|
||||
public class Plus : Script
|
||||
public class Plus : Script, IScriptChangeOffensiveStatValue
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||
public void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||
ImmutableStatisticSet<uint> targetStats, Statistic stat, ref uint value)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Power_Construct_(Ability)">Bulbapedia - Power Construct</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "power_construct")]
|
||||
public class PowerConstruct : Script
|
||||
public class PowerConstruct : Script, IScriptOnEndTurn
|
||||
{
|
||||
private IPokemon? _pokemon;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class PowerConstruct : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
if (_pokemon?.BattleData?.Battle == null)
|
||||
return;
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Swarm_(Ability)">Bulbapedia - Swarm</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "power_up_type_at_low_health")]
|
||||
public class PowerUpTypeAtLowHealth : Script, IScriptOnInitialize
|
||||
public class PowerUpTypeAtLowHealth : Script, IScriptOnInitialize, IScriptChangeDamageModifier
|
||||
{
|
||||
private StringKey _type;
|
||||
private float _threshold;
|
||||
@@ -35,7 +35,7 @@ public class PowerUpTypeAtLowHealth : Script, IScriptOnInitialize
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
public void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
{
|
||||
var currentHealthFraction = move.User.CurrentHealth / (float)move.User.MaxHealth;
|
||||
if (currentHealthFraction <= _threshold && move.GetHitData(target, hit).Type?.Name == _type)
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Full_Metal_Body_(Ability)">Bulbapedia - Full Metal Body</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "prevent_stat_lowering")]
|
||||
public class PreventStatLowering : Script, IScriptOnInitialize
|
||||
public class PreventStatLowering : Script, IScriptOnInitialize, IScriptPreventStatBoostChange
|
||||
{
|
||||
/// <summary>
|
||||
/// The statistic that this ability prevents from being lowered.
|
||||
@@ -32,7 +32,7 @@ public class PreventStatLowering : Script, IScriptOnInitialize
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PreventStatBoostChange(IPokemon target, Statistic stat, sbyte amount, bool selfInflicted,
|
||||
public void PreventStatBoostChange(IPokemon target, Statistic stat, sbyte amount, bool selfInflicted,
|
||||
ref bool prevent)
|
||||
{
|
||||
if (_statistic is not null && _statistic != stat)
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Prism_Armor_(Ability)">Bulbapedia - Prism Armor</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "prism_armor")]
|
||||
public class PrismArmor : Script
|
||||
public class PrismArmor : Script, IScriptChangeIncomingMoveDamage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
public void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (move.GetHitData(target, hit).Effectiveness >= 2)
|
||||
damage = (uint)(damage * 0.75);
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Pure_Power_(Ability)">Bulbapedia - Pure Power</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "pure_power")]
|
||||
public class PurePower : Script
|
||||
public class PurePower : Script, IScriptChangeOffensiveStatValue
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||
public void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||
ImmutableStatisticSet<uint> targetStats, Statistic stat, ref uint value)
|
||||
{
|
||||
if (stat == Statistic.Attack)
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Rain_Dish_(Ability)">Bulbapedia - Rain Dish</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "rain_dish")]
|
||||
public class RainDish : Script
|
||||
public class RainDish : Script, IScriptOnEndTurn
|
||||
{
|
||||
private IPokemon? _owner;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class RainDish : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
if (_owner is null)
|
||||
return;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Schooling_(Ability)">Bulbapedia - Schooling</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "schooling")]
|
||||
public class Schooling : Script
|
||||
public class Schooling : Script, IScriptOnEndTurn
|
||||
{
|
||||
private IPokemon? _owningPokemon;
|
||||
|
||||
@@ -22,7 +22,7 @@ public class Schooling : Script
|
||||
public override void OnSwitchIn(IPokemon pokemon, byte position) => ChangeFormIfNeeded(pokemon);
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle) => ChangeFormIfNeeded(_owningPokemon);
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle) => ChangeFormIfNeeded(_owningPokemon);
|
||||
|
||||
private static void ChangeFormIfNeeded(IPokemon? pokemon)
|
||||
{
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Serene_Grace_(Ability)">Bulbapedia - Serene Grace</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "serene_grace")]
|
||||
public class SereneGrace : Script
|
||||
public class SereneGrace : Script, IScriptChangeEffectChance
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeEffectChance(IExecutingMove move, IPokemon target, byte hit, ref float chance)
|
||||
public void ChangeEffectChance(IExecutingMove move, IPokemon target, byte hit, ref float chance)
|
||||
{
|
||||
chance *= 2;
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Shadow_Shield_(Ability)">Bulbapedia - Shadow Shield</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "shadow_shield")]
|
||||
public class ShadowShield : Script, IScriptOnBeforeAnyHookInvoked
|
||||
public class ShadowShield : Script, IScriptOnBeforeAnyHookInvoked, IScriptChangeIncomingMoveDamage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
public void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (target.CurrentHealth == target.BoostedStats.Hp)
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Shed_Skin_(Ability)">Bulbapedia - Shed Skin</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "shed_skin")]
|
||||
public class ShedSkin : Script
|
||||
public class ShedSkin : Script, IScriptOnEndTurn
|
||||
{
|
||||
private IPokemon? _owningPokemon;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class ShedSkin : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
if (_owningPokemon is null || _owningPokemon.StatusScript.IsEmpty)
|
||||
return;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Sheer_Force_(Ability)">Bulbapedia - Sheer Force</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "sheer_force")]
|
||||
public class SheerForce : Script, IScriptChangeBasePower
|
||||
public class SheerForce : Script, IScriptChangeBasePower, IScriptPreventSecondaryEffect
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
|
||||
@@ -15,7 +15,7 @@ public class SheerForce : Script, IScriptChangeBasePower
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PreventSecondaryEffect(IExecutingMove move, IPokemon target, byte hit, ref bool prevent)
|
||||
public void PreventSecondaryEffect(IExecutingMove move, IPokemon target, byte hit, ref bool prevent)
|
||||
{
|
||||
prevent = true;
|
||||
}
|
||||
|
||||
@@ -6,11 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Shield_Dust_(Ability)">Bulbapedia - Shield Dust</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "shield_dust")]
|
||||
public class ShieldDust : Script
|
||||
public class ShieldDust : Script, IScriptPreventIncomingSecondaryEffect
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventIncomingSecondaryEffect(IExecutingMove move, IPokemon target, byte hit,
|
||||
ref bool prevent)
|
||||
public void PreventIncomingSecondaryEffect(IExecutingMove move, IPokemon target, byte hit, ref bool prevent)
|
||||
{
|
||||
prevent = true;
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Shields_Down_(Ability)">Bulbapedia - Shields Down</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "shields_down")]
|
||||
public class ShieldsDown : Script
|
||||
public class ShieldsDown : Script, IScriptOnEndTurn
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSwitchIn(IPokemon pokemon, byte position) => ChangeFormIfNeeded(pokemon);
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle) => ChangeFormIfNeeded(owner as IPokemon);
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle) => ChangeFormIfNeeded(owner as IPokemon);
|
||||
|
||||
private static void ChangeFormIfNeeded(IPokemon? pokemon)
|
||||
{
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Simple_(Ability)">Bulbapedia - Simple</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "simple")]
|
||||
public class Simple : Script
|
||||
public class Simple : Script, IScriptChangeStatBoostChange
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeStatBoostChange(IPokemon target, Statistic stat, bool selfInflicted, ref sbyte amount)
|
||||
public void ChangeStatBoostChange(IPokemon target, Statistic stat, bool selfInflicted, ref sbyte amount)
|
||||
{
|
||||
amount = amount.MultiplyOrMax(2);
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Solar_Power_(Ability)">Bulbapedia - Solar Power</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "solar_power")]
|
||||
public class SolarPower : Script
|
||||
public class SolarPower : Script, IScriptChangeOffensiveStatValue, IScriptOnEndTurn
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||
public void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||
ImmutableStatisticSet<uint> targetStats, Statistic stat, ref uint value)
|
||||
{
|
||||
if ((stat == Statistic.SpecialAttack &&
|
||||
@@ -21,7 +21,7 @@ public class SolarPower : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
if (owner is not IPokemon pokemon)
|
||||
return;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Solid_Rock_(Ability)">Bulbapedia - Solid Rock</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "solid_rock")]
|
||||
public class SolidRock : Script
|
||||
public class SolidRock : Script, IScriptChangeIncomingMoveDamage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
public void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (move.GetHitData(target, hit).Effectiveness >= 2f)
|
||||
damage = (uint)(damage * 0.75f);
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Speed_Boost_(Ability)">Bulbapedia - Speed Boost</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "speed_boost")]
|
||||
public class SpeedBoost : Script
|
||||
public class SpeedBoost : Script, IScriptOnEndTurn
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
if (owner is not IPokemon pokemon)
|
||||
return;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Steelworker_(Ability)">Bulbapedia - Steelworker</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "steelworker")]
|
||||
public class Steelworker : Script
|
||||
public class Steelworker : Script, IScriptChangeOffensiveStatValue
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||
public void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||
ImmutableStatisticSet<uint> targetStats, Statistic stat, ref uint value)
|
||||
{
|
||||
if (move.GetHitData(target, hit).Type?.Name == "steel")
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Sturdy_(Ability)">Bulbapedia - Sturdy</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "sturdy")]
|
||||
public class Sturdy : Script
|
||||
public class Sturdy : Script, IScriptChangeIncomingMoveDamage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
public void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (damage >= target.MaxHealth && target.CurrentHealth == target.MaxHealth)
|
||||
{
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Thick_Fat_(Ability)">Bulbapedia - Thick Fat</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "thick_fat")]
|
||||
public class ThickFat : Script
|
||||
public class ThickFat : Script, IScriptChangeMoveDamage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
public void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
var type = move.GetHitData(target, hit).Type;
|
||||
if (type is not null && (type.Value.Name == "ice" || type.Value.Name == "fire"))
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Tinted_Lens_(Ability)">Bulbapedia - Tinted Lens</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "tinted_lens")]
|
||||
public class TintedLens : Script
|
||||
public class TintedLens : Script, IScriptChangeMoveDamage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
public void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (move.GetHitData(target, hit).Effectiveness < 1.0f)
|
||||
{
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Tough_Claws_(Ability)">Bulbapedia - Tough Claws</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "tough_claws")]
|
||||
public class ToughClaws : Script
|
||||
public class ToughClaws : Script, IScriptChangeMoveDamage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
public void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (move.GetHitData(target, hit).IsContact)
|
||||
{
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Toxic_Boost_(Ability)">Bulbapedia - Toxic Boost</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "toxic_boost")]
|
||||
public class ToxicBoost : Script
|
||||
public class ToxicBoost : Script, IScriptChangeMoveDamage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
public void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (move.User.HasStatus(ScriptUtils.ResolveName<Status.Poisoned>()) ||
|
||||
move.User.HasStatus(ScriptUtils.ResolveName<Status.BadlyPoisoned>()))
|
||||
|
||||
@@ -6,17 +6,17 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Unaware_(Ability)">Bulbapedia - Unaware</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "unaware")]
|
||||
public class Unaware : Script
|
||||
public class Unaware : Script, IScriptChangeIncomingMoveOffensiveStatValue, IScriptChangeDefensiveStatValue
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingMoveOffensiveStatValue(IExecutingMove executingMove, IPokemon target,
|
||||
byte hitNumber, uint defensiveStat, StatisticSet<uint> targetStats, Statistic offensive, ref uint offensiveStat)
|
||||
public void ChangeIncomingMoveOffensiveStatValue(IExecutingMove executingMove, IPokemon target, byte hitNumber,
|
||||
uint defensiveStat, StatisticSet<uint> targetStats, Statistic offensive, ref uint offensiveStat)
|
||||
{
|
||||
offensiveStat = executingMove.User.FlatStats.GetStatistic(offensive);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeDefensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint offensiveStat,
|
||||
public void ChangeDefensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint offensiveStat,
|
||||
ImmutableStatisticSet<uint> targetStats, Statistic stat, ref uint value)
|
||||
{
|
||||
value = target.FlatStats.GetStatistic(stat);
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Water_Bubble_(Ability)">Bulbapedia - Water Bubble</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "water_bubble")]
|
||||
public class WaterBubble : Script
|
||||
public class WaterBubble : Script, IScriptChangeIncomingMoveDamage, IScriptChangeMoveDamage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventStatusChange(IPokemon pokemon, StringKey status, bool selfInflicted,
|
||||
@@ -17,14 +17,14 @@ public class WaterBubble : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
public void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (move.GetHitData(target, hit).Type?.Name == "fire")
|
||||
damage /= 2;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
public void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (move.GetHitData(target, hit).Type?.Name == "water")
|
||||
damage *= 2;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/White_Smoke_(Ability)">Bulbapedia - White Smoke</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "white_smoke")]
|
||||
public class WhiteSmoke : Script
|
||||
public class WhiteSmoke : Script, IScriptPreventStatBoostChange
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventStatBoostChange(IPokemon target, Statistic stat, sbyte amount, bool selfInflicted,
|
||||
public void PreventStatBoostChange(IPokemon target, Statistic stat, sbyte amount, bool selfInflicted,
|
||||
ref bool prevent)
|
||||
{
|
||||
if (selfInflicted || amount >= 0)
|
||||
|
||||
@@ -6,13 +6,13 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Zen_Mode_(Ability)">Bulbapedia - Zen Mode</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "zen_mode")]
|
||||
public class ZenMode : Script
|
||||
public class ZenMode : Script, IScriptOnEndTurn
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSwitchIn(IPokemon pokemon, byte position) => ChangeFormIfNeeded(pokemon);
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle) => ChangeFormIfNeeded(owner as IPokemon);
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle) => ChangeFormIfNeeded(owner as IPokemon);
|
||||
|
||||
private static void ChangeFormIfNeeded(IPokemon? pokemon)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user