Bunch more moves, changes in how additional information for items works.
This commit is contained in:
28
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Moonlight.cs
Normal file
28
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Moonlight.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Weather;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "moonlight")]
|
||||
public class Moonlight : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
if (battleData == null)
|
||||
return;
|
||||
|
||||
var fraction = 0.5f;
|
||||
var weather = battleData.Battle.WeatherName;
|
||||
if (weather == ScriptUtils.ResolveName<Sunny>())
|
||||
fraction = 2f / 3f;
|
||||
else if (weather == ScriptUtils.ResolveName<Rain>() || weather == ScriptUtils.ResolveName<Hail>() ||
|
||||
weather == ScriptUtils.ResolveName<Sandstorm>())
|
||||
fraction = 0.25f;
|
||||
|
||||
var maxHp = target.BoostedStats.Hp;
|
||||
var healAmount = maxHp.MultiplyOrMax(fraction);
|
||||
move.User.Heal(healAmount);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user