This commit is contained in:
@@ -3,5 +3,26 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Terrain;
|
||||
[Script(ScriptCategory.Terrain, "misty_terrain")]
|
||||
public class MistyTerrain : Script
|
||||
{
|
||||
// TODO: Implement Terrain
|
||||
private static bool IsAffectedByTerrain(IPokemon pokemon) =>
|
||||
!pokemon.IsFloating;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
|
||||
{
|
||||
if (!IsAffectedByTerrain(target))
|
||||
return;
|
||||
if (move.GetHitData(target, hit).Type?.Name == "dragon")
|
||||
{
|
||||
basePower /= 2;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PreventStatusChange(IPokemon pokemon, StringKey status, bool selfInflicted,
|
||||
ref bool preventStatus)
|
||||
{
|
||||
if (!IsAffectedByTerrain(pokemon))
|
||||
return;
|
||||
preventStatus = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user