27 lines
1017 B
C#
27 lines
1017 B
C#
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
|
|
|
/// <summary>
|
|
/// Battery is an ability that increases the power of allies' Special moves by 30%.
|
|
/// This effect only applies to allies on the same side of the field.
|
|
///
|
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Battery_(Ability)">Bulbapedia - Battery</see>
|
|
/// </summary>
|
|
[Script(ScriptCategory.Ability, "battery")]
|
|
public class Battery : Script
|
|
{
|
|
/// <inheritdoc />
|
|
public override void OnSwitchIn(IPokemon pokemon, byte position)
|
|
{
|
|
var side = pokemon.BattleData?.BattleSide;
|
|
var effect = side?.VolatileScripts.Add(new Side.BatteryAbilityEffect())?.Script as Side.BatteryAbilityEffect;
|
|
effect?.PlacerActivated(pokemon);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override void OnSwitchOut(IPokemon oldPokemon, byte position)
|
|
{
|
|
var side = oldPokemon.BattleData?.BattleSide;
|
|
var effect = side?.VolatileScripts.Get<Side.BatteryAbilityEffect>();
|
|
effect?.PlacerDeactivated(oldPokemon);
|
|
}
|
|
} |