using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using InscryptionAPI.Ascension; using InscryptionAPI.Card; using InscryptionAPI.Guid; using InscryptionAPI.Localizing; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: AssemblyCompany("NeedMoreWater.Compat")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.11.0")] [assembly: AssemblyInformationalVersion("1.0.11")] [assembly: AssemblyProduct("NeedMoreWater.Compat")] [assembly: AssemblyTitle("NeedMoreWater.Compat")] [assembly: AssemblyVersion("1.0.11.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace NeedMoreWater.Compat { [BepInPlugin("Rivera.NeedMoreWater.Compat", "NeedMoreWater Compat", "1.0.11")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public sealed class Plugin : BaseUnityPlugin { public const string PluginGuid = "Rivera.NeedMoreWater.Compat"; public const string PluginName = "NeedMoreWater Compat"; public const string PluginVersion = "1.0.11"; public const string ApiGuid = "cyantist.inscryption.api"; public const string BundleOfTotemsGuid = "Lily.BOT"; private static readonly Tribe Aquatic = GuidManager.GetEnumValue("Lily.BOT", "aquatic"); private void Awake() { AbilityManager.ModifyAbilityList += ModifyAbilities; CardManager.ModifyCardList += ModifyCards; RegisterSpanishTranslations(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"NeedMoreWater compatibility/localisation layer loaded."); } private void Start() { CardManager.SyncCardList(); ReplaceWaterborneBaseDeck(); StarterDeckManager.SyncDeckList(); FullStarterDeck val = ((IEnumerable)StarterDeckManager.AllDecks).FirstOrDefault((Func)((FullStarterDeck d) => d.CardNames != null && d.CardNames.Contains("NMW_Catfish") && d.CardNames.Contains("NMW_Betafish"))); if (val != null) { ((BaseUnityPlugin)this).Logger.LogInfo((object)("Waterborne starter replacement active: " + string.Join(", ", val.CardNames))); } else { ((BaseUnityPlugin)this).Logger.LogWarning((object)"Waterborne starter replacement was not found in StarterDeckManager.AllDecks."); } } private void ReplaceWaterborneBaseDeck() { FullStarterDeck val = ((IEnumerable)StarterDeckManager.BaseGameDecks).FirstOrDefault((Func)((FullStarterDeck d) => d.CardNames != null && d.CardNames.Count((string n) => n == "Kingfisher") == 2)); if (val == null) { ((BaseUnityPlugin)this).Logger.LogWarning((object)"Could not locate the vanilla Waterborne starter deck (two Kingfishers)."); return; } ((BaseUnityPlugin)this).Logger.LogInfo((object)("Found vanilla Waterborne starter: " + string.Join(", ", val.CardNames))); string text = val.CardNames.FirstOrDefault((string n) => n != "Kingfisher"); if (string.IsNullOrEmpty(text)) { ((BaseUnityPlugin)this).Logger.LogWarning((object)"Waterborne starter had no non-Kingfisher third card; replacement aborted."); return; } val.CardNames = new List { "NMW_Catfish", "NMW_Betafish", text }; ((BaseUnityPlugin)this).Logger.LogInfo((object)("Waterborne base deck changed to: " + string.Join(", ", val.CardNames))); } private static List ModifyAbilities(List abilities) { FullAbility val = ((IEnumerable)abilities).FirstOrDefault((Func)((FullAbility a) => (int)a.Info.ability == 53)); if (val != null && !val.Info.metaCategories.Contains((AbilityMetaCategory)0)) { AbilityExtensions.AddMetaCategories(val.Info, (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); } return abilities; } private static List ModifyCards(List cards) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) string[] array = new string[4] { "GreatKraken", "SquidBell", "SquidCards", "SquidMirror" }; foreach (string cardName in array) { CardInfo val = ((IEnumerable)cards).FirstOrDefault((Func)((CardInfo c) => ((Object)c).name == cardName)); if (!((Object)(object)val == (Object)null)) { if (val.tribes == null) { val.tribes = new List(); } if (!val.tribes.Contains(Aquatic)) { val.tribes.Add(Aquatic); } } } return cards; } private static void RegisterSpanishTranslations() { T("ats_fishhook_name", "Fish Hook", "Anzuelo"); T("ats_fishhook_desc", "When [creature], a targeted card is moved to the owner's side of the board.", "Cuando se juega [creature], una carta seleccionada se mueve al lado del tablero de quien controla [creature]."); T("ats_instant_name", "Instant", "Instantáneo"); T("ats_instant_desc", "[creature] will perish immediately after its played.", "[creature] perece inmediatamente después de ser jugada."); T("ats_entomophage_name", "Entomophage", "Entomófago"); T("ats_entomophage_desc", "[creature] will deal 2 additional damage to cards of the insect tribe.", "[creature] inflige 2 puntos de daño adicionales a las cartas de la tribu Insecto."); T("ats_tribehealth_name", "Tribe Health", "Salud tribal"); T("ats_tribehealth_desc", "While [creature] is on the board, all other cards on your side of the board of the same tribe will gain +1 health.", "Mientras [creature] esté en el tablero, las demás cartas de su mismo lado y tribu obtienen +1 de vida."); T("ats_tribaltutor_name", "Tribal Tutor", "Tutor tribal"); T("ats_tribaltutor_desc", "When [creature] is played, you may search your deck for a card of the same tribe and take it into your hand. No tribe counts as a tribe of tribeless.", "Cuando se juega [creature], puedes buscar en tu mazo una carta de la misma tribu y añadirla a tu mano. Las cartas sin tribu cuentan como pertenecientes a una misma tribu."); T("ats_lure_name", "Lure", "Señuelo"); T("ats_lure_desc", "[creature] will cause facedown cards to become face up when attacking.", "Cuando [creature] ataca, hace que las cartas boca abajo se pongan boca arriba."); T("ats_submergedambush_name", "Submerged Ambush", "Emboscada sumergida"); T("ats_submergedambush_desc", "[creature] will deal 1 damage to cards that attacked over it while it was face-down. Does not affect cards that are Airborne.", "[creature] inflige 1 de daño a las cartas que ataquen por encima de ella mientras está boca abajo. No afecta a las cartas que vuelan."); T("ats_toxinvigor_name", "Toxin (Vigor)", "Toxina (Vigor)"); T("ats_toxinvigor_desc", "When [creature] damages another creature, that creature looses 1 health.", "Cuando [creature] daña a otra criatura, esa criatura pierde 1 de vida."); T("ats_toxin_name", "Toxin", "Toxina"); T("ats_toxin_desc", "When [creature] damages another creature, that creature looses 1 power and 1 health.", "Cuando [creature] daña a otra criatura, esa criatura pierde 1 de ataque y 1 de vida."); T("ats_schooling_name", "Schooling", "Nado en banco"); T("ats_schooling_desc", "[creature] will grant creatures with the waterborn 1 power.", "[creature] otorga +1 de ataque a las criaturas con Sumergirse."); T("ats_hourglass_name", "Hourglass", "Reloj de arena"); T("ats_hourglass_desc", "[creature] will cause the opponant to skip their turn when played.", "Cuando se juega [creature], el oponente pierde su turno."); T("ats_deadlywaters_name", "Deadly Waters", "Aguas mortales"); T("ats_deadlywaters_desc", "[creature] will kill cards that attacked over it while it was face-down. Does not affect cards that have Airborne or Made of Stone.", "[creature] mata a las cartas que ataquen por encima de ella mientras está boca abajo. No afecta a las cartas que vuelan ni a las hechas de piedra."); T("ats_electric_name", "Electric", "Eléctrico"); T("ats_electric_desc", "When [creature] decalres an attack, they will deal half the damage to cards adjacent to the target.", "Cuando [creature] declara un ataque, inflige la mitad del daño a las cartas adyacentes al objetivo."); T("ats_shielded_name", "Shielded", "Blindado"); T("ats_shielded_desc", "When [creature] is dealt damage, the damage dealt is halved, rounded down.", "Cuando [creature] recibe daño, el daño recibido se reduce a la mitad, redondeando hacia abajo."); } private static void T(string id, string original, string translation) { LocalizationManager.Translate("Rivera.NeedMoreWater.Compat", "NMW_" + id, original, translation, (Language)4); } } }