using PkmnLib.Plugin.Gen7.Libraries.Battling; using PkmnLib.Static.Libraries; using PkmnLib.Static.Species; namespace PkmnLib.Plugin.Gen7; public class Gen7PluginConfiguration : IPluginConfiguration { /// /// Whether the damage calculator has randomness or not. If set to false, the damage calculator will always return /// the same value for the same inputs. If set to true, the damage calculator will randomize the damage output /// between 0.85 and 1.00 of the calculated damage. /// /// This should be set to true for most cases, as it simulates the actual damage calculation in the games. Only /// set to false for testing purposes. /// public bool DamageCalculatorHasRandomness { get; set; } = true; /// /// The number of times a species has been caught. This is used for critical capture calculations. /// public Func TimesSpeciesCaught { get; set; } = _ => 0; } public class Gen7Plugin : Plugin, IResourceProvider { public Gen7Plugin() : base(new Gen7PluginConfiguration()) { } /// public Gen7Plugin(Gen7PluginConfiguration configuration) : base(configuration) { } /// public override string Name => "Gen7"; /// public override uint LoadOrder => 0; /// public override void Register(ScriptRegistry registry) { registry.RegisterAssemblyScripts(typeof(Gen7Plugin).Assembly); registry.RegisterBattleStatCalculator(new Gen7BattleStatCalculator()); registry.RegisterDamageCalculator(new Gen7DamageCalculator(Configuration)); registry.RegisterMiscLibrary(new Gen7MiscLibrary()); registry.RegisterCaptureLibrary(new Gen7CaptureLibrary(Configuration)); } /// public LibrarySettings Settings => new() { MaxLevel = 100, ShinyRate = 4096, }; /// IResourceResult IResourceProvider.GetResource(ResourceFileType request) { return request switch { ResourceFileType.Types => new AssemblyResourceResult("PkmnLib.Plugin.Gen7.Data.Types.csv", typeof(Gen7Plugin).Assembly), ResourceFileType.Natures => new AssemblyResourceResult("PkmnLib.Plugin.Gen7.Data.Natures.csv", typeof(Gen7Plugin).Assembly), ResourceFileType.Moves => new AssemblyResourceResult("PkmnLib.Plugin.Gen7.Data.Moves.jsonc", typeof(Gen7Plugin).Assembly), ResourceFileType.Items => new AssemblyResourceResult("PkmnLib.Plugin.Gen7.Data.Items.json", typeof(Gen7Plugin).Assembly), ResourceFileType.Abilities => new AssemblyResourceResult("PkmnLib.Plugin.Gen7.Data.Abilities.jsonc", typeof(Gen7Plugin).Assembly), ResourceFileType.GrowthRates => new AssemblyResourceResult("PkmnLib.Plugin.Gen7.Data.GrowthRates.json", typeof(Gen7Plugin).Assembly), ResourceFileType.Species => new AssemblyResourceResult("PkmnLib.Plugin.Gen7.Data.Pokemon.json", typeof(Gen7Plugin).Assembly), _ => throw new ArgumentOutOfRangeException(nameof(request), request, null), }; } }