More moves, allow for typeless moves
This commit is contained in:
@@ -7,13 +7,14 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
public class HiddenPower : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeMoveType(IExecutingMove move, IPokemon target, byte hit, ref TypeIdentifier moveType)
|
||||
public override void ChangeMoveType(IExecutingMove move, IPokemon target, byte hit, ref TypeIdentifier? moveType)
|
||||
{
|
||||
var ivs = move.User.IndividualValues;
|
||||
|
||||
var type = GetHiddenPowerValue(ivs, 0x00000001) * 15 / 63;
|
||||
|
||||
move.User.Library.StaticLibrary.Types.TryGetTypeIdentifierFromIndex((byte)(type + 2), out moveType);
|
||||
if (move.User.Library.StaticLibrary.Types.TryGetTypeIdentifierFromIndex((byte)(type + 2), out var t))
|
||||
moveType = t;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user