Changed es1e to allow multi-OT (#3016)

* es1e allows multi-OT, merged Stadium Psyduck OTs, added Yoshira Mew

* fixed spacing on Gen 1 event OTs
This commit is contained in:
ShadowMario3 2020-10-08 10:10:10 -04:00 committed by GitHub
parent 7aac80769b
commit 9516458491
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 9 deletions

View file

@ -1,4 +1,5 @@
using static PKHeX.Core.GameVersion;
using static PKHeX.Core.EncounterGBLanguage;
namespace PKHeX.Core
{
@ -152,6 +153,7 @@ namespace PKHeX.Core
});
private static readonly int[] Flawless15 = { 15, 15, 15, 15, 15, 15 };
private static readonly int[] Yoshira = { 5, 10, 1, 12, 5, 5 };
internal static readonly EncounterStatic1E[] StaticEventsVC =
{
@ -164,10 +166,9 @@ namespace PKHeX.Core
{
// Stadium 1: Psyduck
new EncounterStatic1E(054, 15, Stadium) {Moves = new[] {133, 10}, TID = 1999, OT_Name = "スタジアム" }, // Stadium Psyduck (Amnesia)
new EncounterStatic1E(054, 15, Stadium) {Moves = new[] {133, 10}, TID = 2000, OT_Name = "STADIUM", Language = EncounterGBLanguage.International }, // Stadium Psyduck (Amnesia)
new EncounterStatic1E(054, 15, Stadium) {Moves = new[] {133, 10}, TID = 2000, OT_Name = "STADE", Language = EncounterGBLanguage.International }, // Stadium Psyduck (Amnesia)
new EncounterStatic1E(054, 15, Stadium) {Moves = new[] {133, 10}, TID = 2000, OT_Name = "STADIO", Language = EncounterGBLanguage.International }, // Stadium Psyduck (Amnesia)
new EncounterStatic1E(054, 15, Stadium) {Moves = new[] {133, 10}, TID = 2000, OT_Name = "ESTADIO", Language = EncounterGBLanguage.International }, // Stadium Psyduck (Amnesia)
new EncounterStatic1E(054, 15, Stadium) {Moves = new[] {133, 10}, TID = 2000, OT_Names = new[]{"STADIUM", "Stade", "Stadio", "Estadio"}, Language = International }, // Stadium Psyduck (Amnesia)
new EncounterStatic1E(151, 5, RB) {IVs = Yoshira, OT_Names = new[]{"YOSHIRA", "YOSHIRAB"}, Language = International }, // Yoshira US Mew
};
}
}

View file

@ -1,4 +1,9 @@
namespace PKHeX.Core
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
namespace PKHeX.Core
{
/// <summary>
/// Event data for Generation 1
@ -10,6 +15,8 @@
/// <summary> Trainer name for the event. </summary>
public string OT_Name { get; set; } = string.Empty;
public IReadOnlyList<string> OT_Names { get; set; } = Array.Empty<string>();
/// <summary> Trainer ID for the event. </summary>
public int TID { get; set; } = -1;
@ -25,12 +32,20 @@
if (Language != EncounterGBLanguage.Any && pkm.Japanese != (Language == EncounterGBLanguage.Japanese))
return false;
if (OT_Name.Length != 0 && pkm.OT_Name != OT_Name)
return false;
if (TID != -1 && pkm.TID != TID)
return false;
if (OT_Name.Length != 0)
{
if (pkm.OT_Name != OT_Name)
return false;
}
else if (OT_Names.Count != 0)
{
if (!OT_Names.Contains(pkm.OT_Name))
return false;
}
return true;
}
@ -50,6 +65,8 @@
if (OT_Name.Length != 0)
pk.OT_Name = OT_Name;
else if (OT_Names.Count != 0)
pk.OT_Name = OT_Names[Util.Rand.Next(OT_Names.Count)];
}
}