예제 #1
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();
            rewindStateType = ContentAddition.AddEntityState <RewindState>(out _);
            R2API.Networking.NetworkingAPI.RegisterMessageType <MsgRewind>();

            blacklistedSkills = new[] {
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/CaptainBody/CallSupplyDropHealing"),
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/CaptainBody/CallSupplyDropHacking"),
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/CaptainBody/CallSupplyDropShocking"),
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/CaptainBody/CallSupplyDropEquipmentRestock"),
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/CaptainBody/CaptainSkillUsedUp"),
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/CaptainBody/CaptainCancelDummy")
            };

            rewindBuff            = ScriptableObject.CreateInstance <BuffDef>();
            rewindBuff.buffColor  = Color.white;
            rewindBuff.canStack   = true;
            rewindBuff.isDebuff   = false;
            rewindBuff.isCooldown = true;
            rewindBuff.name       = "TKSATRewind";
            rewindBuff.iconSprite = TinkersSatchelPlugin.resources.LoadAsset <Sprite>("Assets/TinkersSatchel/Textures/MiscIcons/rewindBuffIcon.png");
            ContentAddition.AddBuffDef(rewindBuff);

            if (Compat_ClassicItems.enabled)
            {
                LanguageAPI.Add("TKSAT_REWIND_CI_EMBRYO_APPEND", "\n<style=cStack>Beating Embryo: 50% chance to not consume stock.</style>");
                Compat_ClassicItems.RegisterEmbryoHook(equipmentDef, "TKSAT_REWIND_CI_EMBRYO_APPEND", () => "TKSAT.CausalCamera");
            }
        }
예제 #2
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            statusBuff            = ScriptableObject.CreateInstance <BuffDef>();
            statusBuff.buffColor  = new Color(0.35f, 0.15f, 0.65f);
            statusBuff.canStack   = true;
            statusBuff.isDebuff   = false;
            statusBuff.name       = "TKSATOrderedArmor";
            statusBuff.iconSprite = Addressables.LoadAssetAsync <Sprite>("RoR2/Base/Common/texBuffGenericShield.tif")
                                    .WaitForCompletion();
            ContentAddition.AddBuffDef(statusBuff);

            itemDef.requiredExpansion = Addressables.LoadAssetAsync <ExpansionDef>("RoR2/DLC1/Common/DLC1.asset")
                                        .WaitForCompletion();

            On.RoR2.ItemCatalog.SetItemRelationships += (orig, providers) => {
                var isp = ScriptableObject.CreateInstance <ItemRelationshipProvider>();
                isp.relationshipType = DLC1Content.ItemRelationshipTypes.ContagiousItem;
                isp.relationships    = new[] { new ItemDef.Pair {
                                                   itemDef1 = GoldenGear.instance.itemDef,
                                                   itemDef2 = itemDef
                                               } };
                orig(providers.Concat(new[] { isp }).ToArray());
            };
        }
예제 #3
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            loomBuff            = ScriptableObject.CreateInstance <BuffDef>();
            loomBuff.buffColor  = Color.white;
            loomBuff.canStack   = true;
            loomBuff.isDebuff   = false;
            loomBuff.name       = "TKSATLoomBuff";
            loomBuff.iconSprite = TinkersSatchelPlugin.resources.LoadAsset <Sprite>("Assets/TinkersSatchel/Textures/MiscIcons/loomBuffIcon.png");
            ContentAddition.AddBuffDef(loomBuff);

            itemDef.requiredExpansion = Addressables.LoadAssetAsync <ExpansionDef>("RoR2/DLC1/Common/DLC1.asset")
                                        .WaitForCompletion();

            On.RoR2.ItemCatalog.SetItemRelationships += (orig, providers) => {
                var isp = ScriptableObject.CreateInstance <ItemRelationshipProvider>();
                isp.relationshipType = DLC1Content.ItemRelationshipTypes.ContagiousItem;
                isp.relationships    = new[] { new ItemDef.Pair {
                                                   itemDef1 = Skein.instance.itemDef,
                                                   itemDef2 = itemDef
                                               } };
                orig(providers.Concat(new[] { isp }).ToArray());
            };
        }
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            var achiNameToken = $"ACHIEVEMENT_TKSAT_{name.ToUpper(System.Globalization.CultureInfo.InvariantCulture)}_NAME";
            var achiDescToken = $"ACHIEVEMENT_TKSAT_{name.ToUpper(System.Globalization.CultureInfo.InvariantCulture)}_DESCRIPTION";

            unlockable                 = ScriptableObject.CreateInstance <UnlockableDef>();
            unlockable.cachedName      = $"TkSat_{name}Unlockable";
            unlockable.sortScore       = 200;
            unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset <Sprite>("Assets/TinkersSatchel/Textures/UnlockIcons/deadManSwitchIcon.png");
            ContentAddition.AddUnlockableDef(unlockable);
            LanguageAPI.Add(achiNameToken, "Nine Lives");
            LanguageAPI.Add(achiDescToken, "Survive falling to low health 9 times in the same run (must return to above 50% health each time).");
            itemDef.unlockableDef = unlockable;

            deadManSwitchBuff            = ScriptableObject.CreateInstance <BuffDef>();
            deadManSwitchBuff.buffColor  = Color.red;
            deadManSwitchBuff.canStack   = false;
            deadManSwitchBuff.isDebuff   = false;
            deadManSwitchBuff.isCooldown = true;
            deadManSwitchBuff.name       = "TKSATDeadManSwitch";
            deadManSwitchBuff.iconSprite = TinkersSatchelPlugin.resources.LoadAsset <Sprite>("Assets/TinkersSatchel/Textures/MiscIcons/deadManSwitchBuff.png");
            ContentAddition.AddBuffDef(deadManSwitchBuff);
        }
예제 #5
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            headsetBuff            = ScriptableObject.CreateInstance <BuffDef>();
            headsetBuff.buffColor  = new Color(0.5f, 0.575f, 0.95f);
            headsetBuff.canStack   = true;
            headsetBuff.isDebuff   = false;
            headsetBuff.name       = "TKSATHeadset";
            headsetBuff.iconSprite = Addressables.LoadAssetAsync <Sprite>("RoR2/Base/ShockNearby/texBuffTeslaIcon.tif")
                                     .WaitForCompletion();
            ContentAddition.AddBuffDef(headsetBuff);

            var achiNameToken = $"ACHIEVEMENT_TKSAT_{name.ToUpper(System.Globalization.CultureInfo.InvariantCulture)}_NAME";
            var achiDescToken = $"ACHIEVEMENT_TKSAT_{name.ToUpper(System.Globalization.CultureInfo.InvariantCulture)}_DESCRIPTION";

            unlockable                 = ScriptableObject.CreateInstance <UnlockableDef>();
            unlockable.cachedName      = $"TkSat_{name}Unlockable";
            unlockable.sortScore       = 200;
            unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset <Sprite>("Assets/TinkersSatchel/Textures/UnlockIcons/headsetIcon.png");
            ContentAddition.AddUnlockableDef(unlockable);
            LanguageAPI.Add(achiNameToken, "You Broke It");
            LanguageAPI.Add(achiDescToken, "Kill a boss with a maximum damage H3AD-5T v2 explosion.");
            itemDef.unlockableDef = unlockable;
        }
예제 #6
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            var captainSD = LegacyResourcesAPI.Load <SkillDef>("SkillDefs/CaptainBody/CaptainSkillUsedUp");

            disabledSkillDef = SkillUtil.CloneSkillDef(captainSD);
            disabledSkillDef.skillNameToken               = "TKSAT_DISABLED_SKILL_NAME";
            disabledSkillDef.skillDescriptionToken        = "TKSAT_DISABLED_SKILL_DESCRIPTION";
            disabledSkillDef.dontAllowPastMaxStocks       = false;
            disabledSkillDef.beginSkillCooldownOnSkillEnd = true;

            ContentAddition.AddSkillDef(disabledSkillDef);

            tauntDebuff            = ScriptableObject.CreateInstance <BuffDef>();
            tauntDebuff.buffColor  = Color.white;
            tauntDebuff.canStack   = false;
            tauntDebuff.isDebuff   = true;
            tauntDebuff.name       = "TKSATTaunt";
            tauntDebuff.iconSprite = Addressables.LoadAssetAsync <Sprite>("RoR2/Base/Common/MiscIcons/texAttackIcon.png")
                                     .WaitForCompletion();
            ContentAddition.AddBuffDef(tauntDebuff);

            R2API.Networking.NetworkingAPI.RegisterMessageType <ServerTimedSkillDisable.MsgApply>();
            R2API.Networking.NetworkingAPI.RegisterMessageType <ServerTimedSkillDisable.MsgRemove>();
        }
예제 #7
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            markDebuff            = ScriptableObject.CreateInstance <BuffDef>();
            markDebuff.buffColor  = Color.yellow;
            markDebuff.canStack   = false;
            markDebuff.isDebuff   = true;
            markDebuff.name       = modInfo.shortIdentifier + "HitListDebuff";
            markDebuff.iconSprite = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ClassicIcons/hitlist_debuff_icon.png");
            ContentAddition.AddBuffDef(markDebuff);

            tallyBuff            = ScriptableObject.CreateInstance <BuffDef>();
            tallyBuff.buffColor  = Color.yellow;
            tallyBuff.canStack   = true;
            tallyBuff.isDebuff   = false;
            tallyBuff.name       = modInfo.shortIdentifier + "HitListBuff";
            tallyBuff.iconSprite = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ClassicIcons/hitlist_buff_icon.png");
            ContentAddition.AddBuffDef(tallyBuff);

            hitListTally                  = ScriptableObject.CreateInstance <ItemDef>();
            hitListTally.hidden           = true;
            hitListTally.name             = modInfo.shortIdentifier + "INTERNALTally";
            hitListTally.deprecatedTier   = ItemTier.NoTier;
            hitListTally.canRemove        = false;
            hitListTally.nameToken        = "";
            hitListTally.pickupToken      = "";
            hitListTally.loreToken        = "";
            hitListTally.descriptionToken = "";
            ItemAPI.Add(new CustomItem(hitListTally, new ItemDisplayRuleDict()));
        }
예제 #8
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            speedBuff            = ScriptableObject.CreateInstance <BuffDef>();
            speedBuff.buffColor  = Color.white;
            speedBuff.canStack   = true;
            speedBuff.isDebuff   = false;
            speedBuff.name       = "TKSATSkeinSpeed";
            speedBuff.iconSprite = TinkersSatchelPlugin.resources.LoadAsset <Sprite>("Assets/TinkersSatchel/Textures/MiscIcons/skeinSpeedBuffIcon.png");
            ContentAddition.AddBuffDef(speedBuff);

            resistBuff            = ScriptableObject.CreateInstance <BuffDef>();
            resistBuff.buffColor  = Color.white;
            resistBuff.canStack   = true;
            resistBuff.isDebuff   = false;
            resistBuff.name       = "TKSATSkeinResist";
            resistBuff.iconSprite = TinkersSatchelPlugin.resources.LoadAsset <Sprite>("Assets/TinkersSatchel/Textures/MiscIcons/skeinResistBuffIcon.png");
            ContentAddition.AddBuffDef(resistBuff);

            var achiNameToken = $"ACHIEVEMENT_TKSAT_{name.ToUpper(System.Globalization.CultureInfo.InvariantCulture)}_NAME";
            var achiDescToken = $"ACHIEVEMENT_TKSAT_{name.ToUpper(System.Globalization.CultureInfo.InvariantCulture)}_DESCRIPTION";

            unlockable                 = ScriptableObject.CreateInstance <UnlockableDef>();
            unlockable.cachedName      = $"TkSat_{name}Unlockable";
            unlockable.sortScore       = 200;
            unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset <Sprite>("Assets/TinkersSatchel/Textures/UnlockIcons/skeinIcon.png");
            ContentAddition.AddUnlockableDef(unlockable);
            LanguageAPI.Add(achiNameToken, "Phenomenal Cosmic Power");
            LanguageAPI.Add(achiDescToken, "Complete all 4 Item Set achievements from Tinker's Satchel.");
            itemDef.unlockableDef = unlockable;
        }
예제 #9
0
 public override void SetupAttributes()
 {
     base.SetupAttributes();
     attackBuff            = ScriptableObject.CreateInstance <BuffDef>();
     attackBuff.buffColor  = Color.red;
     attackBuff.canStack   = false;
     attackBuff.isDebuff   = false;
     attackBuff.name       = modInfo.shortIdentifier + "ImprintAttack";
     attackBuff.iconSprite = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ClassicIcons/Imprint_icon.png");
     ContentAddition.AddBuffDef(attackBuff);
     speedBuff            = ScriptableObject.CreateInstance <BuffDef>();
     speedBuff.buffColor  = Color.cyan;
     speedBuff.canStack   = false;
     speedBuff.isDebuff   = false;
     speedBuff.name       = modInfo.shortIdentifier + "ImprintSpeed";
     speedBuff.iconSprite = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ClassicIcons/Imprint_icon.png");
     ContentAddition.AddBuffDef(speedBuff);
     healBuff            = ScriptableObject.CreateInstance <BuffDef>();
     healBuff.buffColor  = Color.green;
     healBuff.canStack   = false;
     healBuff.isDebuff   = false;
     healBuff.name       = modInfo.shortIdentifier + "ImprintHeal";
     healBuff.iconSprite = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ClassicIcons/Imprint_icon.png");
     ContentAddition.AddBuffDef(healBuff);
 }
예제 #10
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();
            tacticsBuff            = ScriptableObject.CreateInstance <BuffDef>();
            tacticsBuff.buffColor  = Color.white;
            tacticsBuff.canStack   = true;
            tacticsBuff.isDebuff   = false;
            tacticsBuff.name       = modInfo.shortIdentifier + "TacticsBuff";
            tacticsBuff.iconSprite = iconResource;
            ContentAddition.AddBuffDef(tacticsBuff);

            var tacticsPrefabPrefab = new GameObject("TacticsAuraPrefabPrefab");

            tacticsPrefabPrefab.AddComponent <NetworkIdentity>();
            tacticsPrefabPrefab.AddComponent <TeamFilter>();
            tacticsPrefabPrefab.AddComponent <NetworkedBodyAttachment>().forceHostAuthority = true;
            tacticsPrefabPrefab.AddComponent <TacticsWard>();
            var bw = tacticsPrefabPrefab.AddComponent <BuffWard>();

            bw.invertTeamFilter = false;
            bw.expires          = false;
            bw.animateRadius    = false;
            bw.radius           = baseRadius;
            bw.rangeIndicator   = null;
            bw.Networkradius    = baseRadius;
            bw.buffDuration     = 1f;
            bw.interval         = 1f;
            bw.buffDef          = tacticsBuff;
            tacticsWardPrefab   = tacticsPrefabPrefab.InstantiateClone("TacticsAuraPrefab", true);
            UnityEngine.Object.Destroy(tacticsPrefabPrefab);
        }
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            damageBonusDisplayBuff            = ScriptableObject.CreateInstance <BuffDef>();
            damageBonusDisplayBuff.buffColor  = Color.red;
            damageBonusDisplayBuff.canStack   = true;
            damageBonusDisplayBuff.isDebuff   = false;
            damageBonusDisplayBuff.name       = modInfo.shortIdentifier + "HealsToDamage";
            damageBonusDisplayBuff.iconSprite = iconResource;
            ContentAddition.AddBuffDef(damageBonusDisplayBuff);
        }
예제 #12
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            bismuthFlaskBuff            = ScriptableObject.CreateInstance <BuffDef>();
            bismuthFlaskBuff.buffColor  = Color.white;
            bismuthFlaskBuff.canStack   = false;
            bismuthFlaskBuff.isDebuff   = false;
            bismuthFlaskBuff.name       = "TKSATBismuthFlask";
            bismuthFlaskBuff.iconSprite = iconResource;
            ContentAddition.AddBuffDef(bismuthFlaskBuff);
        }
예제 #13
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            snakeEyesBuff            = ScriptableObject.CreateInstance <BuffDef>();
            snakeEyesBuff.buffColor  = Color.red;
            snakeEyesBuff.canStack   = true;
            snakeEyesBuff.isDebuff   = false;
            snakeEyesBuff.name       = $"{modInfo.shortIdentifier}SnakeEyes";
            snakeEyesBuff.iconSprite = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ClassicIcons/SnakeEyes_icon.png");
            ContentAddition.AddBuffDef(snakeEyesBuff);
        }
예제 #14
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            pillageBuff            = ScriptableObject.CreateInstance <BuffDef>();
            pillageBuff.buffColor  = new Color(0.85f, 0.8f, 0.3f);
            pillageBuff.canStack   = true;
            pillageBuff.isDebuff   = false;
            pillageBuff.name       = modInfo.shortIdentifier + "PillagedGold";
            pillageBuff.iconSprite = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ClassicIcons/pillage_icon.png");
            ContentAddition.AddBuffDef(pillageBuff);
        }
예제 #15
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            photonFuelBuff            = ScriptableObject.CreateInstance <BuffDef>();
            photonFuelBuff.buffColor  = Color.cyan;
            photonFuelBuff.canStack   = true;
            photonFuelBuff.isDebuff   = false;
            photonFuelBuff.name       = modInfo.shortIdentifier + "PhotonFuel";
            photonFuelBuff.iconSprite = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ClassicIcons/PhotonJetpack_icon.png");

            ContentAddition.AddBuffDef(photonFuelBuff);
        }
예제 #16
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            goldenGearBuff            = ScriptableObject.CreateInstance <BuffDef>();
            goldenGearBuff.buffColor  = new Color(0.85f, 0.8f, 0.3f);
            goldenGearBuff.canStack   = true;
            goldenGearBuff.isDebuff   = false;
            goldenGearBuff.name       = "TKSATGoldenGear";
            goldenGearBuff.iconSprite = Addressables.LoadAssetAsync <Sprite>("RoR2/Base/Common/texBuffGenericShield.tif")
                                        .WaitForCompletion();
            ContentAddition.AddBuffDef(goldenGearBuff);
        }
예제 #17
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            shrinkDebuff            = ScriptableObject.CreateInstance <BuffDef>();
            shrinkDebuff.buffColor  = Color.white;
            shrinkDebuff.canStack   = true;
            shrinkDebuff.isDebuff   = true;
            shrinkDebuff.name       = "TKSATShrink";
            shrinkDebuff.iconSprite = Addressables.LoadAssetAsync <Sprite>("RoR2/Base/Common/texDifficultyEasyIcon.png")
                                      .WaitForCompletion();
            ContentAddition.AddBuffDef(shrinkDebuff);
        }
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            activeBuff            = ScriptableObject.CreateInstance <BuffDef>();
            activeBuff.buffColor  = new Color(0.85f, 0.2f, 0.2f);
            activeBuff.canStack   = false;
            activeBuff.isDebuff   = false;
            activeBuff.name       = "TKSATEnterCombatDamageActive";
            activeBuff.iconSprite = buffIconResource;
            ContentAddition.AddBuffDef(activeBuff);

            readyBuff            = ScriptableObject.CreateInstance <BuffDef>();
            readyBuff.buffColor  = new Color(0.85f, 0.85f, 0.2f);
            readyBuff.canStack   = false;
            readyBuff.isDebuff   = false;
            readyBuff.name       = "TKSATEnterCombatDamageReady";
            readyBuff.iconSprite = buffIconResource;
            ContentAddition.AddBuffDef(readyBuff);

            chargingBuff            = ScriptableObject.CreateInstance <BuffDef>();
            chargingBuff.buffColor  = new Color(0.4f, 0.4f, 0.4f);
            chargingBuff.canStack   = false;
            chargingBuff.isDebuff   = false;
            chargingBuff.name       = "TKSATEnterCombatDamageCharging";
            chargingBuff.iconSprite = buffIconResource;
            ContentAddition.AddBuffDef(chargingBuff);

            itemDef.requiredExpansion = Addressables.LoadAssetAsync <ExpansionDef>("RoR2/DLC1/Common/DLC1.asset")
                                        .WaitForCompletion();

            On.RoR2.ItemCatalog.SetItemRelationships += (orig, providers) => {
                var isp = ScriptableObject.CreateInstance <ItemRelationshipProvider>();
                isp.relationshipType = DLC1Content.ItemRelationshipTypes.ContagiousItem;
                isp.relationships    = new[] { new ItemDef.Pair {
                                                   itemDef1 = Moustache.instance.itemDef,
                                                   itemDef2 = itemDef
                                               } };
                orig(providers.Concat(new[] { isp }).ToArray());
            };
        }
예제 #19
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            moustacheBuff            = ScriptableObject.CreateInstance <BuffDef>();
            moustacheBuff.buffColor  = new Color(0.85f, 0.2f, 0.2f);
            moustacheBuff.canStack   = true;
            moustacheBuff.isDebuff   = false;
            moustacheBuff.name       = "TKSATMoustache";
            moustacheBuff.iconSprite = iconResource;
            ContentAddition.AddBuffDef(moustacheBuff);

            var achiNameToken = $"ACHIEVEMENT_TKSAT_{name.ToUpper(System.Globalization.CultureInfo.InvariantCulture)}_NAME";
            var achiDescToken = $"ACHIEVEMENT_TKSAT_{name.ToUpper(System.Globalization.CultureInfo.InvariantCulture)}_DESCRIPTION";

            unlockable                 = ScriptableObject.CreateInstance <UnlockableDef>();
            unlockable.cachedName      = $"TkSat_{name}Unlockable";
            unlockable.sortScore       = 200;
            unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset <Sprite>("Assets/TinkersSatchel/Textures/UnlockIcons/moustacheIcon.png");
            ContentAddition.AddUnlockableDef(unlockable);
            LanguageAPI.Add(achiNameToken, "Big Brawl");
            LanguageAPI.Add(achiDescToken, "Participate in a very busy fight.");
            itemDef.unlockableDef = unlockable;
        }
예제 #20
0
        private void Awake()
        {
            _logger = Logger;

            Logger.LogDebug("Performing plugin setup:");

            Logger.LogDebug("Loading assets...");
            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("ClassicItems.classicitems_assets")) {
                resources = AssetBundle.LoadFromStream(stream);
            }

            cfgFile = new ConfigFile(Path.Combine(Paths.ConfigPath, ModGuid + ".cfg"), true);

            Logger.LogDebug("Loading global configs...");

            globalConfig.BindAll(cfgFile, "ClassicItems", "Global");

            Logger.LogDebug("Instantiating item classes...");
            masterItemList = T2Module.InitAll <CatalogBoilerplate>(new T2Module.ModInfo {
                displayName     = "Classic Items",
                longIdentifier  = "ClassicItems",
                shortIdentifier = "CI",
                mainConfigFile  = cfgFile
            });

            Logger.LogDebug("Loading item configs...");
            foreach (CatalogBoilerplate x in masterItemList)
            {
                x.SetupConfig();
            }

            Logger.LogDebug("Registering item attributes...");
            foreach (CatalogBoilerplate x in masterItemList)
            {
                x.SetupAttributes();
            }

            Logger.LogDebug("Registering shared buffs...");
            //used only for purposes of Death Mark; applied by Permafrost and Snowglobe
            freezeBuff            = ScriptableObject.CreateInstance <BuffDef>();
            freezeBuff.buffColor  = Color.cyan;
            freezeBuff.canStack   = false;
            freezeBuff.isDebuff   = true;
            freezeBuff.name       = "CIFreeze";
            freezeBuff.iconSprite = resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ClassicIcons/permafrost_icon.png");
            ContentAddition.AddBuffDef(freezeBuff);

            fearBuff            = ScriptableObject.CreateInstance <BuffDef>();
            fearBuff.buffColor  = Color.red;
            fearBuff.canStack   = false;
            fearBuff.isDebuff   = true;
            fearBuff.name       = "CIFear";
            fearBuff.iconSprite = LegacyResourcesAPI.Load <Sprite>("textures/miscicons/texSprintIcon");

            ContentAddition.AddBuffDef(fearBuff);
            IL.EntityStates.AI.Walker.Combat.UpdateAI += IL_ESAIWalkerCombatUpdateAI;

            Logger.LogDebug("Registering item behaviors...");

            foreach (CatalogBoilerplate x in masterItemList)
            {
                x.SetupBehavior();
            }

            Logger.LogDebug("Initial setup done!");
        }
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            //load custom assets
            skillDef = TinkersSatchelPlugin.resources.LoadAsset <SkillDef>("Assets/TinkersSatchel/SkillDefs/EngiUtilitySpeedispenser.asset");
            var tmpDeployableBody = TinkersSatchelPlugin.resources.LoadAsset <GameObject>("Assets/TinkersSatchel/Prefabs/Characters/EngiSpeedispenser/EngiSpeedispenserBody.prefab")
                                    .InstantiateClone("TkSatTempSetupPrefab", false);

            deployableMaster    = TinkersSatchelPlugin.resources.LoadAsset <GameObject>("Assets/TinkersSatchel/Prefabs/Characters/EngiSpeedispenser/EngiSpeedispenserMaster.prefab");
            deployableBlueprint = TinkersSatchelPlugin.resources.LoadAsset <GameObject>("Assets/TinkersSatchel/Prefabs/Characters/EngiSpeedispenser/EngiSpeedispenserBlueprints.prefab");

            //load vanilla assets
            targetSkillFamily = Addressables.LoadAssetAsync <SkillFamily>("RoR2/Base/Engi/EngiBodyUtilityFamily.asset")
                                .WaitForCompletion();
            var captainSupply = Addressables.LoadAssetAsync <GameObject>("RoR2/Base/Captain/CaptainSupplyDrop, EquipmentRestock.prefab")
                                .WaitForCompletion()
                                .InstantiateClone("TkSatTempSetupPrefab2", false);
            var buffIcon = Addressables.LoadAssetAsync <Sprite>("RoR2/DLC1/AttackSpeedAndMoveSpeed/texCoffeeIcon.png")
                           .WaitForCompletion();
            var mainMtl = Addressables.LoadAssetAsync <Material>("RoR2/Base/Engi/matEngiTurret.mat")
                          .WaitForCompletion();
            var bpOkMtl = Addressables.LoadAssetAsync <Material>("RoR2/Base/Engi/matBlueprintsOk.mat")
                          .WaitForCompletion();
            var bpNokMtl = Addressables.LoadAssetAsync <Material>("RoR2/Base/Engi/matBlueprintsInvalid.mat")
                           .WaitForCompletion();
            var ctp = Addressables.LoadAssetAsync <CharacterCameraParams>("RoR2/Base/Common/ccpStandard.asset")
                      .WaitForCompletion();
            var turretBp = Addressables.LoadAssetAsync <GameObject>("RoR2/Base/Engi/EngiTurretBlueprints.prefab")
                           .WaitForCompletion();
            var turretObj = Addressables.LoadAssetAsync <GameObject>("RoR2/Base/Engi/EngiTurretBody.prefab")
                            .WaitForCompletion();
            var bpProjMtl = turretBp.transform.Find("BlobLightProjector").GetComponent <Projector>().material;

            //modify
            speedBuff            = ScriptableObject.CreateInstance <BuffDef>();
            speedBuff.buffColor  = Color.white;
            speedBuff.canStack   = false;
            speedBuff.isDebuff   = false;
            speedBuff.name       = "TKSATEngiSpeedispenserBuff";
            speedBuff.iconSprite = buffIcon;

            tmpDeployableBody.GetComponent <CameraTargetParams>().cameraParams = ctp;
            tmpDeployableBody.GetComponent <ModelLocator>().modelTransform.GetComponent <MeshRenderer>().material = mainMtl;
            var eic = captainSupply.transform.Find("ModelBase/captain supply drop/EnergyIndicatorContainer");

            eic.SetParent(tmpDeployableBody.transform);
            eic.localScale *= 0.5f;
            eic.position   -= new Vector3(0f, 1.5f, 0f);
            var cl = tmpDeployableBody.GetComponent <ModelLocator>().modelTransform.GetComponent <ChildLocator>();

            cl.transformPairs[0].transform = eic;
            cl.transformPairs[1].transform = eic.Find("Canvas/EnergyIndicatorBackgroundPanel/EnergyIndicator");

            GameObject.Destroy(captainSupply);
            deployableBody = tmpDeployableBody.InstantiateClone("EngiSpeedispenserBody", true);
            GameObject.Destroy(tmpDeployableBody);
            deployableMaster.GetComponent <CharacterMaster>().bodyPrefab = deployableBody;

            deployableBlueprint.transform.Find("BlobLight").GetComponent <Projector>().material = bpProjMtl;
            deployableBlueprint.transform.Find("Model Base/SpeedispenserModel").GetComponent <MeshRenderer>().material = bpOkMtl;
            var bp = deployableBlueprint.GetComponent <BlueprintController>();

            bp.okMaterial      = bpOkMtl;
            bp.invalidMaterial = bpNokMtl;

            foreach (var akEvent in turretBp.GetComponents <AkEvent>())
            {
                var newEvent = deployableBlueprint.AddComponent <AkEvent>();
                newEvent.triggerList         = akEvent.triggerList.ToArray().ToList();
                newEvent.useOtherObject      = akEvent.useOtherObject;
                newEvent.actionOnEventType   = akEvent.actionOnEventType;
                newEvent.curveInterpolation  = akEvent.curveInterpolation;
                newEvent.enableActionOnEvent = akEvent.enableActionOnEvent;
                newEvent.data               = akEvent.data;
                newEvent.useCallbacks       = akEvent.useCallbacks;
                newEvent.Callbacks          = akEvent.Callbacks.ToArray().ToList();
                newEvent.playingId          = akEvent.playingId;
                newEvent.soundEmitterObject = deployableBlueprint;
                newEvent.transitionDuration = akEvent.transitionDuration;
            }

            foreach (var akEvent in turretObj.GetComponents <AkEvent>())
            {
                var newEvent = deployableBody.AddComponent <AkEvent>();
                newEvent.triggerList         = akEvent.triggerList.ToArray().ToList();
                newEvent.useOtherObject      = akEvent.useOtherObject;
                newEvent.actionOnEventType   = akEvent.actionOnEventType;
                newEvent.curveInterpolation  = akEvent.curveInterpolation;
                newEvent.enableActionOnEvent = akEvent.enableActionOnEvent;
                newEvent.data               = akEvent.data;
                newEvent.useCallbacks       = akEvent.useCallbacks;
                newEvent.Callbacks          = akEvent.Callbacks.ToArray().ToList();
                newEvent.playingId          = akEvent.playingId;
                newEvent.soundEmitterObject = deployableBody;
                newEvent.transitionDuration = akEvent.transitionDuration;
            }

            //R2API catalog reg

            var dmsSerializable = ContentAddition.AddEntityState <DispenserMainState>(out bool entStateDidSucceed);

            if (!entStateDidSucceed)
            {
                TinkersSatchelPlugin._logger.LogError("EntityState setup failed on EngiUtilitySpeedispenser (DispenserMainState)! Deployable will be unusable.");
            }
            else
            {
                var esm = deployableBody.GetComponent <EntityStateMachine>();
                esm.initialStateType = dmsSerializable;
                esm.mainStateType    = dmsSerializable;
            }

            R2API.Networking.NetworkingAPI.RegisterMessageType <PlaceDispenser.MsgConstructDispenser>();
            ContentAddition.AddBuffDef(speedBuff);
            ContentAddition.AddBody(deployableBody);
            ContentAddition.AddMaster(deployableMaster);
            deployableSlot = DeployableAPI.RegisterDeployableSlot((master, countMult) => {
                return(1);
            });

            skillDef.activationState = ContentAddition.AddEntityState <PlaceDispenser>(out entStateDidSucceed);

            if (!entStateDidSucceed)
            {
                TinkersSatchelPlugin._logger.LogError("EntityState setup failed on EngiUtilitySpeedispenser! Skill will not appear nor function.");
            }
            else if (!ContentAddition.AddSkillDef(skillDef))
            {
                TinkersSatchelPlugin._logger.LogError("SkillDef setup failed on EngiUtilitySpeedispenser! Skill will not appear nor function.");
            }
            else
            {
                setupSucceeded = true;
            }
        }
예제 #22
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            blacklistedSkills = new[] {
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/EngiBody/EngiCancelTargetingDummy"),
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/EngiBody/EngiConfirmTargetDummy"),
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/EngiBody/EngiBodyPlaceTurret"),
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/EngiBody/EngiBodyPlaceWalkerTurret"),
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/EngiBody/EngiHarpoons"),
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/CaptainBody/CaptainCancelDummy"),
                LegacyResourcesAPI.Load <RoR2.Skills.SkillDef>("SkillDefs/CaptainBody/PrepSupplyDrop"),
            };

            var colors         = new[] { new Color(0.15f, 0.25f, 1f), new Color(1f, 1f, 0.4f), new Color(1f, 0.25f, 0.1f), new Color(0.5f, 0.35f, 0.2f) };
            var sharedBuffIcon = Addressables.LoadAssetAsync <Sprite>("RoR2/Base/Common/MiscIcons/texBarrelIcon.png")
                                 .WaitForCompletion();
            var rampTex = Addressables.LoadAssetAsync <Texture2D>("RoR2/Base/Common/ColorRamps/texRampDefault.png")
                          .WaitForCompletion();

            moveBuff            = ScriptableObject.CreateInstance <BuffDef>();
            moveBuff.buffColor  = colors[0];
            moveBuff.canStack   = true;
            moveBuff.isDebuff   = false;
            moveBuff.name       = modInfo.shortIdentifier + "PixieMoveSpeed";
            moveBuff.iconSprite = sharedBuffIcon;
            ContentAddition.AddBuffDef(moveBuff);

            attackBuff            = ScriptableObject.CreateInstance <BuffDef>();
            attackBuff.buffColor  = colors[1];
            attackBuff.canStack   = true;
            attackBuff.isDebuff   = false;
            attackBuff.name       = modInfo.shortIdentifier + "PixieAttackSpeed";
            attackBuff.iconSprite = sharedBuffIcon;
            ContentAddition.AddBuffDef(attackBuff);

            damageBuff            = ScriptableObject.CreateInstance <BuffDef>();
            damageBuff.buffColor  = colors[2];
            damageBuff.canStack   = true;
            damageBuff.isDebuff   = false;
            damageBuff.name       = modInfo.shortIdentifier + "PixieDamage";
            damageBuff.iconSprite = sharedBuffIcon;
            ContentAddition.AddBuffDef(damageBuff);

            armorBuff            = ScriptableObject.CreateInstance <BuffDef>();
            armorBuff.buffColor  = colors[3];
            armorBuff.canStack   = true;
            armorBuff.isDebuff   = false;
            armorBuff.name       = modInfo.shortIdentifier + "PixieArmor";
            armorBuff.iconSprite = sharedBuffIcon;
            ContentAddition.AddBuffDef(armorBuff);

            var origPrefab = LegacyResourcesAPI.Load <GameObject>("Prefabs/NetworkedObjects/HealPack");

            prefabs = new[] {
                origPrefab.InstantiateClone("TkSatTempSetupPrefab1", false),
                origPrefab.InstantiateClone("TkSatTempSetupPrefab2", false),
                origPrefab.InstantiateClone("TkSatTempSetupPrefab3", false),
                origPrefab.InstantiateClone("TkSatTempSetupPrefab4", false)
            };
            var bufftypes  = new[] { moveBuff, attackBuff, damageBuff, armorBuff };
            var finalNames = new[] { "TkSatPixieMovePack", "TkSatPixieAttackPack", "TkSatPixieDamagePack", "TkSatPixieArmorPack" };

            for (var i = 0; i < prefabs.Length; i++)
            {
                var prefab = prefabs[i];

                var vros = prefab.GetComponent <VelocityRandomOnStart>();
                vros.enabled = false;

                var dstroy = prefab.GetComponent <DestroyOnTimer>();
                dstroy.duration += PICKUP_ARMING_DELAY;

                var blinker = prefab.GetComponent <BeginRapidlyActivatingAndDeactivating>();
                blinker.delayBeforeBeginningBlinking = dstroy.duration - 1f;

                var trail = prefab.transform.Find("HealthOrbEffect/TrailParent/Trail").gameObject;
                var tren  = trail.GetComponent <TrailRenderer>();
                tren.material.SetTexture("_RemapTex", rampTex);
                tren.material.SetColor("_TintColor", colors[i]);

                var core = prefab.transform.Find("HealthOrbEffect/VFX/Core").gameObject;
                var cren = core.GetComponent <ParticleSystem>();
                var ccol = cren.colorOverLifetime;
                ccol.color = new ParticleSystem.MinMaxGradient(colors[i], colors[i].AlphaMultiplied(0f));
                core.transform.localScale *= 0.5f;

                var pulse = prefab.transform.Find("HealthOrbEffect/VFX/PulseGlow").gameObject;
                var pren  = pulse.GetComponent <ParticleSystem>();
                var pcol  = pren.colorOverLifetime;
                pcol.color = new ParticleSystem.MinMaxGradient(colors[i], colors[i].AlphaMultiplied(0f));
                pulse.transform.localScale *= 0.5f;

                var pickup = prefab.transform.Find("PickupTrigger").gameObject;
                pickup.GetComponent <HealthPickup>().enabled = false;
                var bpkp = pickup.AddComponent <EffectlessBuffPickup>();
                bpkp.buffDef      = bufftypes[i];
                bpkp.teamFilter   = prefab.GetComponent <TeamFilter>();
                bpkp.buffDuration = buffDuration;
                bpkp.baseObject   = prefabs[i];

                var grav  = prefab.transform.Find("GravitationController").gameObject;
                var delay = prefab.AddComponent <ActivateAfterDelay>();
                pickup.SetActive(false);
                core.SetActive(false);
                delay.targets.Add(pickup);
                delay.targets.Add(core);
                delay.delay = PICKUP_ARMING_DELAY;

                grav.GetComponent <GravitatePickup>().enabled = false;

                var gravramp = grav.AddComponent <WispAnimAndGravitate>();
                gravramp.armingDelay        = PICKUP_ARMING_DELAY;
                gravramp.duration           = dstroy.duration - PICKUP_ARMING_DELAY;
                gravramp.parentRigidbody    = prefab.GetComponent <Rigidbody>();
                gravramp.teamFilter         = prefab.GetComponent <TeamFilter>();
                gravramp.playerOnlyDuration = gravramp.duration - 2f;

                prefabs[i] = prefabs[i].InstantiateClone(finalNames[i], true);
            }
        }
예제 #23
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            genericSpeedBoostBuff            = ScriptableObject.CreateInstance <BuffDef>();
            genericSpeedBoostBuff.buffColor  = Color.red;
            genericSpeedBoostBuff.canStack   = true;
            genericSpeedBoostBuff.isDebuff   = false;
            genericSpeedBoostBuff.name       = modInfo.shortIdentifier + "GoFasterUnhandled";
            genericSpeedBoostBuff.iconSprite = Addressables.LoadAssetAsync <Sprite>("RoR2/Base/Common/texMovespeedBuffIcon.tif")
                                               .WaitForCompletion();
            ContentAddition.AddBuffDef(genericSpeedBoostBuff);

            engiSpeedBoostBuff            = ScriptableObject.CreateInstance <BuffDef>();
            engiSpeedBoostBuff.buffColor  = Color.red;
            engiSpeedBoostBuff.canStack   = true;
            engiSpeedBoostBuff.isDebuff   = false;
            engiSpeedBoostBuff.name       = modInfo.shortIdentifier + "GoFasterEngi";
            engiSpeedBoostBuff.iconSprite = Addressables.LoadAssetAsync <Sprite>("RoR2/Base/Common/texMovespeedBuffIcon.tif")
                                            .WaitForCompletion();
            ContentAddition.AddBuffDef(engiSpeedBoostBuff);

            var tmpPrefab = Addressables.LoadAssetAsync <GameObject>("RoR2/Base/Captain/CaptainAirstrikeAltProjectile.prefab")
                            .WaitForCompletion()
                            .InstantiateClone("TkSatTempSetupPrefab", false);

            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/CommandoBody/CommandoBodyRoll"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/CommandoBody/CommandoSlide"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/HuntressBody/HuntressBlink"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/HuntressBody/HuntressMiniBlink"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/Bandit2Body/ThrowSmokeBomb"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/ToolbotBody/ToolbotBodyToolbotDash"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/EngiBody/EngiBodyPlaceBubbleShield"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/EngiBody/EngiHarpoons"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/MageBody/MageBodyWall"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/MercBody/MercBodyFocusedAssault"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/MercBody/MercBodyAssaulter"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/TreebotBody/TreebotBodySonicBoom"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/TreebotBody/TreebotBodyPlantSonicBoom"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/LoaderBody/ChargeFist"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/LoaderBody/ChargeZapFist"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/CrocoBody/CrocoLeap"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/CrocoBody/CrocoChainableLeap"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/CaptainBody/PrepAirstrike"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/CaptainBody/PrepAirstrikeAlt"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/CaptainBody/CallAirstrike"));
            handledSkillDefs.Add(LegacyResourcesAPI.Load <SkillDef>("SkillDefs/CaptainBody/CallAirstrikeAlt"));

            skillIconOverlay = TinkersSatchelPlugin.resources.LoadAsset <Sprite>("Assets/TinkersSatchel/Textures/SkillIcons/GoFasterStripesOverlay.png");

            /*var ghost = tmpPrefab.GetComponent<ProjectileController>().ghostPrefab.InstantiateClone("TkSatTempSetupPrefab2", false);
             *
             * ghost.AddComponent<SwooceTrajectoryPredictor>();
             *
             * tmpPrefab.GetComponent<ProjectileController>().ghostPrefab = ghost.InstantiateClone("TkSatCaptainStrikeJumperAltGhost", false);
             * GameObject.Destroy(ghost);*/

            tmpPrefab.AddComponent <SwooceTrajectoryPredictor>();

            captainStrikeJumperAltProjectile = tmpPrefab.InstantiateClone("TkSatCaptainStrikeJumperAltProjectile", true);

            GameObject.Destroy(tmpPrefab);

            var achiNameToken = $"ACHIEVEMENT_TKSAT_{name.ToUpper(System.Globalization.CultureInfo.InvariantCulture)}_NAME";
            var achiDescToken = $"ACHIEVEMENT_TKSAT_{name.ToUpper(System.Globalization.CultureInfo.InvariantCulture)}_DESCRIPTION";

            unlockable                 = ScriptableObject.CreateInstance <UnlockableDef>();
            unlockable.cachedName      = $"TkSat_{name}Unlockable";
            unlockable.sortScore       = 200;
            unlockable.achievementIcon = TinkersSatchelPlugin.resources.LoadAsset <Sprite>("Assets/TinkersSatchel/Textures/UnlockIcons/goFasterIcon.png");
            ContentAddition.AddUnlockableDef(unlockable);
            LanguageAPI.Add(achiNameToken, "Faster Than Recommended");
            LanguageAPI.Add(achiDescToken, "Trimp.");
            itemDef.unlockableDef = unlockable;
        }