Adds a lot more move effects
This commit is contained in:
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/BurnUp.cs
Normal file
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/BurnUp.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "burn_up")]
|
||||
public class BurnUp : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
if (battleData == null)
|
||||
return;
|
||||
var typeLibrary = battleData.Battle.Library.StaticLibrary.Types;
|
||||
if (!typeLibrary.TryGetTypeIdentifier("fire", out var fireType))
|
||||
return;
|
||||
if (!move.User.Types.Contains(fireType))
|
||||
{
|
||||
move.GetHitData(target, hit).Fail();
|
||||
return;
|
||||
}
|
||||
|
||||
if (move.User.HasStatus("frozen"))
|
||||
move.User.ClearStatus();
|
||||
move.User.RemoveType(fireType);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user