More moves
This commit is contained in:
28
Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/PowderEffect.cs
Normal file
28
Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/PowderEffect.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
[Script(ScriptCategory.Pokemon, "powder")]
|
||||
public class PowderEffect : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <inheritdoc />
|
||||
public override void BlockOutgoingHit(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool block)
|
||||
{
|
||||
var hit = executingMove.GetHitData(target, hitIndex);
|
||||
if (hit.Type.Name == "fire")
|
||||
{
|
||||
executingMove.User.BattleData?.Battle.EventHook.Invoke(new DialogEvent("powder_explodes",
|
||||
new Dictionary<string, object>
|
||||
{
|
||||
{ "user", executingMove.User },
|
||||
{ "target", target },
|
||||
}));
|
||||
|
||||
var health = executingMove.User.MaxHealth / 4;
|
||||
executingMove.User.Damage(health, DamageSource.Misc);
|
||||
|
||||
block = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user