Further work on refactor to interface based scripts
This commit is contained in:
@@ -6,18 +6,17 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Normalize_(Ability)">Bulbapedia - Normalize</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "normalize")]
|
||||
public class Normalize : Script
|
||||
public class Normalize : Script, IScriptChangeMoveType, IScriptChangeBasePower
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeMoveType(IExecutingMove move, IPokemon target, byte hit,
|
||||
ref TypeIdentifier? typeIdentifier)
|
||||
public 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)
|
||||
public 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%
|
||||
|
||||
Reference in New Issue
Block a user