This commit is contained in:
20
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Synthesis.cs
Normal file
20
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Synthesis.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "synthesis")]
|
||||
public class Synthesis : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var healModifier = 0.5f;
|
||||
var weatherName = target.BattleData?.Battle?.WeatherName;
|
||||
if (weatherName == ScriptUtils.ResolveName<Weather.Sunny>())
|
||||
healModifier = 2 / 3f;
|
||||
else if (weatherName == ScriptUtils.ResolveName<Weather.Rain>() ||
|
||||
weatherName == ScriptUtils.ResolveName<Weather.Hail>() ||
|
||||
weatherName == ScriptUtils.ResolveName<Weather.Sandstorm>())
|
||||
healModifier = 1 / 4f;
|
||||
|
||||
move.User.Heal((uint)(move.User.MaxHealth * healModifier));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user