This commit is contained in:
parent
8363b955af
commit
4385f0afaa
@ -397,15 +397,33 @@
|
|||||||
"no_guard": {
|
"no_guard": {
|
||||||
"effect": "no_guard"
|
"effect": "no_guard"
|
||||||
},
|
},
|
||||||
"normalize": {},
|
"normalize": {
|
||||||
"oblivious": {},
|
"effect": "normalize"
|
||||||
"overcoat": {},
|
},
|
||||||
"overgrow": {},
|
"oblivious": {
|
||||||
"own_tempo": {},
|
"effect": "oblivious"
|
||||||
"parental_bond": {},
|
},
|
||||||
"pickpocket": {},
|
"overcoat": {
|
||||||
"pickup": {},
|
"effect": "overcoat"
|
||||||
"pixilate": {},
|
},
|
||||||
|
"overgrow": {
|
||||||
|
"effect": "overgrow"
|
||||||
|
},
|
||||||
|
"own_tempo": {
|
||||||
|
"effect": "own_tempo"
|
||||||
|
},
|
||||||
|
"parental_bond": {
|
||||||
|
"effect": "parental_bond"
|
||||||
|
},
|
||||||
|
"pickpocket": {
|
||||||
|
"effect": "pickpocket"
|
||||||
|
},
|
||||||
|
"pickup": {
|
||||||
|
"effect": "pickup"
|
||||||
|
},
|
||||||
|
"pixilate": {
|
||||||
|
"effect": "pixilate"
|
||||||
|
},
|
||||||
"plus": {},
|
"plus": {},
|
||||||
"poison_heal": {},
|
"poison_heal": {},
|
||||||
"poison_point": {},
|
"poison_point": {},
|
||||||
|
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Normalize.cs
Normal file
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Normalize.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Normalize is an ability that changes all moves used by the Pokémon to Normal type.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Normalize_(Ability)">Bulbapedia - Normalize</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "normalize")]
|
||||||
|
public class Normalize : Script
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeMoveType(IExecutingMove move, IPokemon target, byte hit,
|
||||||
|
ref TypeIdentifier? typeIdentifier)
|
||||||
|
{
|
||||||
|
if (move.Battle.Library.StaticLibrary.Types.TryGetTypeIdentifier("normal", out var normalType))
|
||||||
|
typeIdentifier = normalType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
|
||||||
|
{
|
||||||
|
if (move.GetHitData(target, hit).Type?.Name == "normal")
|
||||||
|
basePower = (ushort)(basePower * 1.2f); // Boost Normal-type moves by 30%
|
||||||
|
}
|
||||||
|
}
|
22
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Oblivious.cs
Normal file
22
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Oblivious.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||||
|
|
||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Oblivious is an ability that prevents the Pokémon from being infatuated or taunted.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Oblivious_(Ability)">Bulbapedia - Oblivious</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "oblivious")]
|
||||||
|
public class Oblivious : Script
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void PreventVolatileAdd(Script script, ref bool preventVolatileAdd)
|
||||||
|
{
|
||||||
|
preventVolatileAdd = script switch
|
||||||
|
{
|
||||||
|
Infatuated or TauntEffect => true,
|
||||||
|
_ => preventVolatileAdd,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
29
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Overcoat.cs
Normal file
29
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Overcoat.cs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overcoat is an ability that protects the Pokémon from weather damage and powder moves.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Overcoat_(Ability)">Bulbapedia - Overcoat</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "overcoat")]
|
||||||
|
public class Overcoat : Script
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||||
|
{
|
||||||
|
if (eventName == CustomTriggers.IgnoreHail && args is CustomTriggers.IgnoreHailArgs hailArgs)
|
||||||
|
{
|
||||||
|
hailArgs.Ignore = true;
|
||||||
|
}
|
||||||
|
// TODO: Ignore sandstorm damage
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void IsInvulnerableToMove(IExecutingMove move, IPokemon target, ref bool invulnerable)
|
||||||
|
{
|
||||||
|
if (move.UseMove.HasFlag("powder"))
|
||||||
|
{
|
||||||
|
invulnerable = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
17
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Overgrow.cs
Normal file
17
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Overgrow.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overgrow is an ability that boosts the power of Grass-type moves when the Pokémon's HP is low.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Overgrow_(Ability)">Bulbapedia - Overgrow</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "overgrow")]
|
||||||
|
public class Overgrow : Script
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
|
||||||
|
{
|
||||||
|
if (move.GetHitData(target, hit).Type?.Name == "grass" && target.CurrentHealth <= target.BoostedStats.Hp / 3)
|
||||||
|
basePower = basePower.MultiplyOrMax(1.5f);
|
||||||
|
}
|
||||||
|
}
|
17
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/OwnTempo.cs
Normal file
17
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/OwnTempo.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Own Tempo is an ability that prevents the Pokémon from becoming confused.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Own_Tempo_(Ability)">Bulbapedia - Own Tempo</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "own_tempo")]
|
||||||
|
public class OwnTempo : Script
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void PreventVolatileAdd(Script script, ref bool preventVolatileAdd)
|
||||||
|
{
|
||||||
|
if (script is Pokemon.Confusion)
|
||||||
|
preventVolatileAdd = true;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Parental Bond is an ability that allows the Pokémon to hit twice with most moves.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Parental_Bond_(Ability)">Bulbapedia - Parental Bond</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "parental_bond")]
|
||||||
|
public class ParentalBond : Script
|
||||||
|
{
|
||||||
|
// TODO: Implement Parental Bond effect.
|
||||||
|
}
|
20
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Pickpocket.cs
Normal file
20
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Pickpocket.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Pickpocket is an ability that steals an item from a Pokémon that makes contact.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Pickpocket_(Ability)">Bulbapedia - Pickpocket</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "pickpocket")]
|
||||||
|
public class Pickpocket : Script
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void OnIncomingHit(IExecutingMove move, IPokemon target, byte hit)
|
||||||
|
{
|
||||||
|
if (move.GetHitData(target, hit).IsContact && target.HeldItem is null && move.User.HeldItem is not null)
|
||||||
|
{
|
||||||
|
move.Battle.EventHook.Invoke(new AbilityTriggerEvent(target));
|
||||||
|
_ = target.SetHeldItem(move.User.RemoveHeldItemForBattle());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Pickup.cs
Normal file
12
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Pickup.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Pickup is an ability that allows the Pokémon to pick up items after battle.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Pickup_(Ability)">Bulbapedia - Pickup</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "pickup")]
|
||||||
|
public class Pickup : Script
|
||||||
|
{
|
||||||
|
// TODO: Implement Pickup effect.
|
||||||
|
}
|
26
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Pixilate.cs
Normal file
26
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Pixilate.cs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Pixilate is an ability that turns Normal-type moves into Fairy-type moves and boosts their power.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Pixilate_(Ability)">Bulbapedia - Pixilate</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "pixilate")]
|
||||||
|
public class Pixilate : Script
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeMoveType(IExecutingMove move, IPokemon target, byte hit,
|
||||||
|
ref TypeIdentifier? typeIdentifier)
|
||||||
|
{
|
||||||
|
if (typeIdentifier?.Name == "normal" &&
|
||||||
|
move.Battle.Library.StaticLibrary.Types.TryGetTypeIdentifier("fairy", out var fairyType))
|
||||||
|
typeIdentifier = fairyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
|
||||||
|
{
|
||||||
|
if (move.GetHitData(target, hit).Type?.Name == "fairy")
|
||||||
|
basePower = (ushort)(basePower * 1.2f); // Boost Normal-type moves by 30%
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user