mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-10 14:44:24 +00:00
More transfer implications
Totems are downsized to regular araquanid, togedemaru, and ribombee totems can't transfer (at the moment)
This commit is contained in:
parent
435953f4e1
commit
ebf20d927b
9 changed files with 27 additions and 17 deletions
|
@ -75,7 +75,7 @@ namespace PKHeX.Core
|
|||
yield return GetPressureSlot(slotMax, pkm);
|
||||
}
|
||||
|
||||
bool ShouldMatchSlotForm() => Legal.WildForms.Contains(species) || Legal.AlolanOriginForms.Contains(species) || FormConverter.IsTotemForm(species, form);
|
||||
bool ShouldMatchSlotForm() => Legal.WildForms.Contains(species) || Legal.AlolanOriginForms.Contains(species) || FormConverter.IsTotemForm(species, form, 7);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -297,6 +297,11 @@ namespace PKHeX.Core
|
|||
{
|
||||
if (SkipFormCheck)
|
||||
return true;
|
||||
if (FormConverter.IsTotemForm(Species, Form, Generation))
|
||||
{
|
||||
var expectForm = pkm.Format == 7 ? Form : FormConverter.GetTotemBaseForm(Species, Form);
|
||||
return expectForm == pkm.AltForm;
|
||||
}
|
||||
if (Form != pkm.AltForm && !Legal.IsFormChangeable(pkm, Species))
|
||||
return false;
|
||||
return true;
|
||||
|
|
|
@ -470,16 +470,11 @@ namespace PKHeX.Core
|
|||
778, // Mimikyu (Normal, Busted, Totem, Totem_Busted)
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Totem_SM = new HashSet<int>
|
||||
internal static readonly HashSet<int> Totem_NoTransfer = new HashSet<int>
|
||||
{
|
||||
020, // Raticate
|
||||
735, // Gumshoos
|
||||
//746, // Wishiwashi
|
||||
758, // Salazzle
|
||||
754, // Lurantis
|
||||
738, // Vikavolt
|
||||
778, // Mimikyu
|
||||
784, // Kommo-o
|
||||
752, // Araquanid
|
||||
777, // Togedemaru
|
||||
743, // Ribombee
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Totem_USUM = new HashSet<int>
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace PKHeX.Core
|
|||
}
|
||||
else if (EncounterMatch is EncounterEgg)
|
||||
{
|
||||
if (FormConverter.IsTotemForm(species, form))
|
||||
if (FormConverter.IsTotemForm(species, form, data.Info.Generation))
|
||||
return GetInvalid(LFormInvalidGame);
|
||||
}
|
||||
|
||||
|
|
|
@ -117,6 +117,15 @@ namespace PKHeX.Core
|
|||
data.AddLine(GetInvalid(LTransferBad));
|
||||
if (pk.WeightScalar != 0)
|
||||
data.AddLine(GetInvalid(LTransferBad));
|
||||
|
||||
var enc = data.EncounterMatch;
|
||||
if (data.Info.Generation == 7 && FormConverter.IsTotemForm(enc.Species, enc.Form, 7))
|
||||
{
|
||||
if (Legal.Totem_NoTransfer.Contains(data.EncounterMatch.Species))
|
||||
data.AddLine(GetInvalid(LTransferBad));
|
||||
if (pkm.AltForm != FormConverter.GetTotemBaseForm(enc.Species, enc.Form))
|
||||
data.AddLine(GetInvalid(LTransferBad));
|
||||
}
|
||||
}
|
||||
if (pk.Tracker == 0) // Tracker value?
|
||||
data.AddLine(GetInvalid(LTransferBad));
|
||||
|
|
|
@ -641,6 +641,10 @@ namespace PKHeX.Core
|
|||
// WeightScalar = 0,
|
||||
};
|
||||
|
||||
// Wipe Totem Forms
|
||||
if (FormConverter.IsTotemForm(Species, AltForm, 7))
|
||||
pk8.AltForm = FormConverter.GetTotemBaseForm(Species, AltForm);
|
||||
|
||||
// Fix PP
|
||||
pk8.HealPP();
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace PKHeX.Core
|
|||
// this is a hack; depends on currently loaded SaveFile's Game ID
|
||||
private static bool IsGG() => GameVersion.GG.Contains(PKMConverter.Game);
|
||||
|
||||
public static bool IsTotemForm(int species, int form, int generation = 7)
|
||||
public static bool IsTotemForm(int species, int form, int generation)
|
||||
{
|
||||
if (generation != 7)
|
||||
return false;
|
||||
|
|
|
@ -82,7 +82,7 @@ namespace PKHeX.Drawing
|
|||
|
||||
private Image GetBaseImage(int species, int form, int gender, bool shiny, int generation)
|
||||
{
|
||||
var img = FormConverter.IsTotemForm(species, form)
|
||||
var img = FormConverter.IsTotemForm(species, form, generation)
|
||||
? GetBaseImageTotem(species, form, gender, shiny, generation)
|
||||
: GetBaseImageDefault(species, form, gender, shiny, generation);
|
||||
return img ?? GetBaseImageFallback(species, form, gender, shiny, generation);
|
||||
|
|
|
@ -23,10 +23,7 @@ namespace PKHeX.WinForms
|
|||
public partial class Main : Form
|
||||
{
|
||||
private static readonly Version CurrentProgramVersion = Assembly.GetExecutingAssembly().GetName().Version;
|
||||
static async Task<LegalityAnalysis> GetLegal(PKM pkm)
|
||||
{
|
||||
return await Task.Run(() => new LegalityAnalysis(pkm));
|
||||
}
|
||||
|
||||
public Main()
|
||||
{
|
||||
Form splash = null; // popup a splash screen in another thread
|
||||
|
|
Loading…
Reference in a new issue