protected virtual void OnFinishedPatch() { //Main.AddSubstitution(this.TechType, TechType.Stillsuit); foreach (TechType tt in substitutions) { Main.AddSubstitution(this.TechType, tt); } Main.AddModTechType(this.TechType); PlayerPatch.AddSurvivalSuit(this.TechType); if (CompoundDependencies.Count > 0) { KnownTech.CompoundTech compound = new KnownTech.CompoundTech(); compound.techType = this.TechType; compound.dependencies = CompoundDependencies; Reflection.AddCompoundTech(compound); } //SurvivalPatches.AddNeedsCapOverride(this.TechType, SurvivalCapOverride); }
public Vibroblade(string classId = "Vibroblade", string friendlyName = "Vibroblade", string description = "Hardened survival blade with high-frequency oscillator inflicts horrific damage with even glancing blows") : base(classId, friendlyName, description) { OnFinishedPatching += () => { #if SUBNAUTICA_STABLE var diamondBlade = new TechData() { craftAmount = 1, Ingredients = new List <Ingredient>() { new Ingredient(TechType.Knife, 1), new Ingredient(TechType.Diamond, 1) } }; CraftDataHandler.SetTechData(TechType.DiamondBlade, diamondBlade); CraftTreeHandler.AddCraftingNode(CraftTree.Type.Workbench, TechType.DiamondBlade, new string[] { DWConstants.KnifeMenuPath }); #endif Main.AddModTechType(this.TechType); PlayerPatch.AddSubstitution(this.TechType, TechType.Knife); }; }
internal static void AddSubstitution(TechType custom, TechType vanilla) { EquipmentPatch.AddSubstitution(custom, vanilla); PlayerPatch.AddSubstitution(custom, vanilla); }
private void OnDestroy() { PlayerPatch.Disable(); }