mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-18 16:33:24 +00:00
7fc8001806
EncounterTrade: don't init Location to -1; keep as default 0 and use that as the pivot for default met location. Move Fateful property to the sub-type that uses it (EncounterTrade4, for Ranch). Move some EncounterStatic->PKM logic that is per-type to the associated type overloaded methods. Rearrange order of properties to be more consistent with interfaces Gen3: Initialize some classes without using post-constructor setters. The `init` setter functionality coming in c#9 won't be usable as the net46 runtime/netstandard2 doesn't support it on current previews. Do it this way so we can explicity initialize some required properties rather than apply version on a second iteration.
38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
public sealed class EncounterStatic6 : EncounterStatic, IContestStats
|
|
{
|
|
public override int Generation => 6;
|
|
|
|
internal IReadOnlyList<int> Contest { set => this.SetContestStats(value); }
|
|
public int CNT_Cool { get; set; }
|
|
public int CNT_Beauty { get; set; }
|
|
public int CNT_Cute { get; set; }
|
|
public int CNT_Smart { get; set; }
|
|
public int CNT_Tough { get; set; }
|
|
public int CNT_Sheen { get; set; }
|
|
|
|
protected override bool IsMatchLocation(PKM pkm)
|
|
{
|
|
if (base.IsMatchLocation(pkm))
|
|
return true;
|
|
|
|
if (Species != (int) Core.Species.Pikachu)
|
|
return false;
|
|
|
|
// Cosplay Pikachu is given from multiple locations
|
|
var loc = pkm.Met_Location;
|
|
return loc == 180 || loc == 186 || loc == 194;
|
|
}
|
|
|
|
protected override void ApplyDetails(ITrainerInfo sav, EncounterCriteria criteria, PKM pk)
|
|
{
|
|
base.ApplyDetails(sav, criteria, pk);
|
|
var pk6 = (PK6)pk;
|
|
this.CopyContestStatsTo(pk6);
|
|
pk6.SetRandomMemory6();
|
|
}
|
|
}
|
|
}
|