Added first script, bugfixes

This commit is contained in:
2024-07-28 12:18:12 +02:00
parent 5b495ac871
commit 7c0bd879b8
6 changed files with 89 additions and 7 deletions

View File

@@ -77,7 +77,7 @@ public class Gen7DamageCalculator(bool hasRandomness) : IDamageCalculator
{
if (executingMove.UseMove.Category == MoveCategory.Status)
return 0;
var basePower = hitData.BasePower;
var basePower = executingMove.UseMove.BasePower;
executingMove.RunScriptHook(script =>
script.ChangeBasePower(executingMove, target, hitNumber, ref basePower));
return basePower;

View File

@@ -0,0 +1,25 @@
using PkmnLib.Dynamic.Models;
using PkmnLib.Dynamic.ScriptHandling;
using PkmnLib.Static.Utils;
namespace PkmnLib.Plugin.Gen7.Moves;
/// <summary>
/// The user nimbly strikes the target. If the user is not holding an item, this attack inflicts massive damage.
/// </summary>
/// <remarks>
/// Does double base power if the user is not holding an item.
/// </remarks>
[Script(ScriptCategory.Move, "acrobatics")]
public class Acrobatics : Script
{
/// <inheritdoc />
public override string Name => "acrobatics";
/// <inheritdoc />
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref byte basePower)
{
if (move.User.HeldItem == null)
basePower = basePower.MultiplyOrMax(2);
}
}