This commit is contained in:
@@ -6,8 +6,29 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Weather;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Harsh_sunlight">Bulbapedia - Harsh Sunlight</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Weather, "harsh_sunlight")]
|
||||
public class HarshSunlight : Script
|
||||
public class HarshSunlight : Script, ILimitedTurnsScript
|
||||
{
|
||||
private int? _duration;
|
||||
|
||||
/// <inheritdoc />
|
||||
public int TurnsRemaining => _duration ?? 0;
|
||||
|
||||
/// <inheritdoc />
|
||||
public void SetTurns(int turns)
|
||||
{
|
||||
_duration = turns;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IBattle battle)
|
||||
{
|
||||
_duration--;
|
||||
if (_duration <= 0)
|
||||
{
|
||||
battle.SetWeather(null, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user