This commit is contained in:
@@ -3,20 +3,20 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
[Script(ScriptCategory.Pokemon, "perish_song")]
|
||||
public class PerishSongEffect : Script, IScriptOnEndTurn
|
||||
{
|
||||
private int _turns;
|
||||
internal int Turns { get; private set; }
|
||||
private IPokemon _owner;
|
||||
|
||||
public PerishSongEffect(IPokemon owner, int turns = 3)
|
||||
{
|
||||
_owner = owner;
|
||||
_turns = turns;
|
||||
Turns = turns;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
_turns--;
|
||||
if (_turns <= 0)
|
||||
Turns--;
|
||||
if (Turns <= 0)
|
||||
{
|
||||
RemoveSelf();
|
||||
_owner.Faint(DamageSource.Misc);
|
||||
|
||||
Reference in New Issue
Block a user