This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "hidden_power")]
|
||||
public class HiddenPower : Script, IScriptChangeMoveType, IScriptChangeBasePower
|
||||
public class HiddenPower : Script, IScriptChangeMoveType
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void ChangeMoveType(IExecutingMove move, IPokemon target, byte hit, ref TypeIdentifier? moveType)
|
||||
@@ -14,16 +14,6 @@ public class HiddenPower : Script, IScriptChangeMoveType, IScriptChangeBasePower
|
||||
moveType = t;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
|
||||
{
|
||||
var ivs = move.User.IndividualValues;
|
||||
|
||||
var power = GetHiddenPowerValue(ivs, 0x00000002) * 40 / 63 + 30;
|
||||
// cast to byte with overflow check
|
||||
basePower = (byte)Math.Min(power, byte.MaxValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to calculate the hidden power value from the IVs.
|
||||
/// This is used to determine the type and power of the move.
|
||||
|
||||
Reference in New Issue
Block a user