コード例 #1
0
        internal override void SetupAttributes()
        {
            myDef = CloneSkillDef(targetVariantDef);

            var nametoken = "CLASSICITEMS_SCEPLOADER_CHARGEZAPFISTNAME";

            newDescToken = "CLASSICITEMS_SCEPLOADER_CHARGEZAPFISTDESC";
            oldDescToken = targetVariantDef.skillDescriptionToken;
            var namestr = "Thundercrash";

            LanguageAPI.Add(nametoken, namestr);

            myDef.skillName             = namestr;
            myDef.skillNameToken        = nametoken;
            myDef.skillDescriptionToken = newDescToken;
            myDef.icon = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ScepterSkillIcons/loader_chargezapfisticon.png");

            ContentAddition.AddSkillDef(myDef);

            projReplacer = LegacyResourcesAPI.Load <GameObject>("prefabs/projectiles/LoaderZapCone").InstantiateClone("CIScepLoaderThundercrash", true);
            var proxb = projReplacer.GetComponent <ProjectileProximityBeamController>();

            proxb.attackFireCount *= 3;
            proxb.maxAngleFilter   = 180f;
            projReplacer.transform.Find("Effect").localScale *= 3f;

            ContentAddition.AddProjectile(projReplacer);
        }
コード例 #2
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()));
        }
コード例 #3
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;
        }
コード例 #4
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());
            };
        }
コード例 #5
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);
        }
コード例 #6
0
        internal override void SetupAttributes()
        {
            myDef = CloneSkillDef(targetVariantDef);

            var nametoken = "CLASSICITEMS_SCEPHUNTRESS_BALLISTANAME";

            newDescToken = "CLASSICITEMS_SCEPHUNTRESS_BALLISTADESC";
            oldDescToken = targetVariantDef.skillDescriptionToken;
            var namestr = "Rabauld";

            LanguageAPI.Add(nametoken, namestr);

            myDef.skillName             = namestr;
            myDef.skillNameToken        = nametoken;
            myDef.skillDescriptionToken = newDescToken;
            myDef.icon = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ScepterSkillIcons/huntress_ballistaicon.png");

            ContentAddition.AddSkillDef(myDef);

            var oldCtxDef = LegacyResourcesAPI.Load <SkillDef>("skilldefs/huntressbody/FireArrowSnipe");

            myCtxDef = CloneSkillDef(oldCtxDef);

            myCtxDef.skillName             = namestr;
            myCtxDef.skillNameToken        = nametoken;
            myCtxDef.skillDescriptionToken = newDescToken;
            myCtxDef.icon = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ScepterSkillIcons/huntress_ballistaicon.png");

            ContentAddition.AddSkillDef(myCtxDef);
        }
コード例 #7
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;
        }
コード例 #8
0
        internal override void SetupAttributes()
        {
            myDef = CloneSkillDef(targetVariantDef);

            var nametoken = "CLASSICITEMS_SCEPCOMMANDO_GRENADENAME";

            newDescToken = "CLASSICITEMS_SCEPCOMMANDO_GRENADEDESC";
            oldDescToken = targetVariantDef.skillDescriptionToken;
            var namestr = "Carpet Bomb";

            LanguageAPI.Add(nametoken, namestr);

            myDef.skillName             = namestr;
            myDef.skillNameToken        = nametoken;
            myDef.skillDescriptionToken = newDescToken;
            myDef.icon = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ScepterSkillIcons/commando_grenadeicon.png");

            ContentAddition.AddSkillDef(myDef);

            projReplacer = LegacyResourcesAPI.Load <GameObject>("prefabs/projectiles/CommandoGrenadeProjectile").InstantiateClone("CIScepCommandoGrenade", true);
            var pie = projReplacer.GetComponent <ProjectileImpactExplosion>();

            pie.blastDamageCoefficient *= 0.5f;
            pie.bonusBlastForce        *= 0.5f;

            ContentAddition.AddProjectile(projReplacer);
        }
コード例 #9
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            gupDebuff = ScriptableObject.CreateInstance <ItemDef>();
            gupDebuff.deprecatedTier   = ItemTier.NoTier;
            gupDebuff.canRemove        = false;
            gupDebuff.hidden           = true;
            gupDebuff.nameToken        = "TKSAT_INTERNAL_GUPRAY_COUNTER";
            gupDebuff.loreToken        = "";
            gupDebuff.descriptionToken = "";
            gupDebuff.pickupToken      = "";
            gupDebuff.name             = "TkSatInternalGupRayCounter";
            gupDebuff.tags             = new ItemTag[] { };
            ContentAddition.AddItemDef(gupDebuff);

            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 = ShrinkRay.instance.itemDef,
                                                   itemDef2 = itemDef
                                               } };
                orig(providers.Concat(new[] { isp }).ToArray());
            };
        }
コード例 #10
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>();
        }
コード例 #11
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);
 }
コード例 #12
0
        internal static void Init()
        {
            LanguageAPI.Add("GENETIC_ARTIFACT_NAME_TOKEN", "Artifact of Genetics");
            LanguageAPI.Add("GENETIC_ARTIFACT_DESCRIPTION_TOKEN", "Monsters will spawn with adjusted stats. Adjustments are determined by a genetic algorithm.");

            artifactDef                           = ScriptableObject.CreateInstance <ArtifactDef>();
            artifactDef.nameToken                 = "GENETIC_ARTIFACT_NAME_TOKEN";
            artifactDef.descriptionToken          = "GENETIC_ARTIFACT_DESCRIPTION_TOKEN";
            artifactDef.smallIconSelectedSprite   = GeneticsArtifactPlugin.geneticAssetBundle.LoadAsset <Sprite>("Assets/Genetics/Selected.png");
            artifactDef.smallIconDeselectedSprite = GeneticsArtifactPlugin.geneticAssetBundle.LoadAsset <Sprite>("Assets/Genetics/Unselected.png");
            artifactDef.pickupModelPrefab         = GeneticsArtifactPlugin.geneticAssetBundle.LoadAsset <GameObject>("Assets/Genetics/PickupGene.prefab");
            //ArtifactAPI.Add(artifactDef);
            ContentAddition.AddArtifactDef(artifactDef);

            geneArtifactCompoundDef             = ScriptableObject.CreateInstance <ArtifactCompoundDef>();
            geneArtifactCompoundDef.modelPrefab = GeneticsArtifactPlugin.geneticAssetBundle.LoadAsset <GameObject>("Assets/Genetics/CompoundGene.prefab");
            geneArtifactCompoundDef.value       = 15;
            ArtifactCodeAPI.AddCompound(geneArtifactCompoundDef);

            artifactCode = ScriptableObject.CreateInstance <ArtifactCode>();
            artifactCode.ArtifactCompounds = new List <int> {
                ArtifactCodeAPI.CompoundValues.Triangle, ArtifactCodeAPI.CompoundValues.Diamond, ArtifactCodeAPI.CompoundValues.Triangle,
                ArtifactCodeAPI.CompoundValues.Circle, geneArtifactCompoundDef.value, ArtifactCodeAPI.CompoundValues.Circle,
                ArtifactCodeAPI.CompoundValues.Triangle, ArtifactCodeAPI.CompoundValues.Diamond, ArtifactCodeAPI.CompoundValues.Triangle
            };

            ArtifactCodeAPI.AddCode(artifactDef, artifactCode);
        }
コード例 #13
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");
            }
        }
コード例 #14
0
        internal override void SetupAttributes()
        {
            myDef = CloneSkillDef(targetVariantDef);

            var nametoken = "CLASSICITEMS_SCEPCAPTAIN_AIRSTRIKENAME";

            newDescToken = "CLASSICITEMS_SCEPCAPTAIN_AIRSTRIKEDESC";
            oldDescToken = targetVariantDef.skillDescriptionToken;
            var namestr = "21-Probe Salute";

            LanguageAPI.Add(nametoken, namestr);

            myDef.skillName             = namestr;
            myDef.skillNameToken        = nametoken;
            myDef.skillDescriptionToken = newDescToken;
            myDef.icon = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ScepterSkillIcons/captain_airstrikeicon.png");

            ContentAddition.AddSkillDef(myDef);

            var oldCallDef = LegacyResourcesAPI.Load <SkillDef>("skilldefs/captainbody/CallAirstrike");

            myCallDef = CloneSkillDef(oldCallDef);
            myCallDef.baseMaxStock         = 21;
            myCallDef.mustKeyPress         = false;
            myCallDef.isCombatSkill        = true;
            myCallDef.baseRechargeInterval = 0.07f;
            myCallDef.icon = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ScepterSkillIcons/captain_airstrikeicon.png");

            ContentAddition.AddSkillDef(myCallDef);
        }
コード例 #15
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());
            };
        }
コード例 #16
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            projectilePrefab = TinkersSatchelPlugin.resources.LoadAsset <GameObject>("Assets/TinkersSatchel/Prefabs/Misc/UnstableBombShell.prefab");
            var expl = projectilePrefab.GetComponent <ProjectileExplosion>();

            expl.explosionEffect = Addressables.LoadAssetAsync <GameObject>("RoR2/Base/FusionCellDestructible/FusionCellExplosion.prefab")
                                   .WaitForCompletion();
            projectilePrefab.GetComponent <SphereCollider>().material = Addressables.LoadAssetAsync <PhysicMaterial>("RoR2/Base/Common/physmatBouncy.physicMaterial")
                                                                        .WaitForCompletion();

            var ghost     = TinkersSatchelPlugin.resources.LoadAsset <GameObject>("Assets/TinkersSatchel/Prefabs/Misc/UnstableBombShellGhost.prefab");
            var ghostPart = ghost.GetComponent <ParticleSystemRenderer>();

            ghostPart.material = Addressables.LoadAssetAsync <Material>("RoR2/Base/Common/VFX/matOpaqueDustLargeDirectional.mat")
                                 .WaitForCompletion();
            var indFixedRen = ghostPart.transform.Find("IndicatorFixed").GetComponent <MeshRenderer>();

            indFixedRen.material = Addressables.LoadAssetAsync <Material>("RoR2/Base/Captain/matCaptainAirstrikeAltAreaIndicatorOuter.mat")
                                   .WaitForCompletion();
            var indPulseRen = ghostPart.transform.Find("IndicatorPulse").GetComponent <MeshRenderer>();

            indPulseRen.material = Addressables.LoadAssetAsync <Material>("RoR2/Base/Captain/matCaptainAirstrikeAltAreaIndicatorInner.mat")
                                   .WaitForCompletion();

            ContentAddition.AddProjectile(projectilePrefab);
        }
コード例 #17
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            //load custom assets
            skillDef = TinkersSatchelPlugin.resources.LoadAsset <SkillDef>("Assets/TinkersSatchel/SkillDefs/CommandoPrimaryPulse.asset");

            //load vanilla assets
            targetSkillFamily = Addressables.LoadAssetAsync <SkillFamily>("RoR2/Base/Commando/CommandoBodyPrimaryFamily.asset")
                                .WaitForCompletion();

            //R2API catalog reg
            skillDef.activationState = ContentAddition.AddEntityState <Fire>(out bool entStateDidSucceed);

            if (!entStateDidSucceed)
            {
                TinkersSatchelPlugin._logger.LogError("EntityState setup failed on CommandoPrimaryPulse! Skill will not appear nor function.");
            }
            else if (!ContentAddition.AddSkillDef(skillDef))
            {
                TinkersSatchelPlugin._logger.LogError("SkillDef setup failed on CommandoPrimaryPulse! Skill will not appear nor function.");
            }
            else
            {
                setupSucceeded = true;
            }
        }
コード例 #18
0
        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);
        }
コード例 #19
0
        internal override void SetupAttributes()
        {
            myDef = CloneSkillDef(targetVariantDef);

            var nametoken = "CLASSICITEMS_SCEPCROCO_DISEASENAME";

            newDescToken = "CLASSICITEMS_SCEPCROCO_DISEASEDESC";
            oldDescToken = targetVariantDef.skillDescriptionToken;
            var namestr = "Plague";

            LanguageAPI.Add(nametoken, namestr);

            myDef.skillName             = namestr;
            myDef.skillNameToken        = nametoken;
            myDef.skillDescriptionToken = newDescToken;
            myDef.icon = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ScepterSkillIcons/croco_firediseaseicon.png");

            ContentAddition.AddSkillDef(myDef);

            var mshPrefab = LegacyResourcesAPI.Load <GameObject>("Prefabs/NetworkedObjects/MushroomWard");

            var dwPrefabPrefab = new GameObject("CIDiseaseAuraPrefabPrefab");

            dwPrefabPrefab.AddComponent <TeamFilter>();
            dwPrefabPrefab.AddComponent <MeshFilter>().mesh       = mshPrefab.GetComponentInChildren <MeshFilter>().mesh;
            dwPrefabPrefab.AddComponent <MeshRenderer>().material = UnityEngine.Object.Instantiate(mshPrefab.GetComponentInChildren <MeshRenderer>().material);
            dwPrefabPrefab.GetComponent <MeshRenderer>().material.SetVector("_TintColor", new Vector4(1.5f, 0.3f, 1f, 0.3f));
            dwPrefabPrefab.AddComponent <NetworkedBodyAttachment>().forceHostAuthority = true;
            var dw = dwPrefabPrefab.AddComponent <DiseaseWard>();

            dw.rangeIndicator = dwPrefabPrefab.GetComponent <MeshRenderer>().transform;
            dw.interval       = 1f;
            diseaseWardPrefab = dwPrefabPrefab.InstantiateClone("CIDiseaseWardAuraPrefab", true);
            UnityEngine.Object.Destroy(dwPrefabPrefab);
        }
コード例 #20
0
        private void RegisterExtraStates()
        {
            //Artificer extra states
            if (Configuration.GetConfigValue(Configuration.EnableMageSkills))
            {
                //Artificer Zappot Fire State
                ContentAddition.AddEntityState <ZapportFireEntity>(out _);
                EggsUtils.EggsUtils.LogToConsole("Zapport fire state loaded!");
            }

            //Engi extra states
            if (Configuration.GetConfigValue(Configuration.EnableEngiSkills))
            {
                //Tesla mine arming states
                ContentAddition.AddEntityState <TeslaArmingUnarmedState>(out _);
                ContentAddition.AddEntityState <TeslaArmingWeakState>(out _);
                ContentAddition.AddEntityState <TeslaArmingFullState>(out _);
                //Main states
                ContentAddition.AddEntityState <TeslaArmState>(out _);
                ContentAddition.AddEntityState <TeslaWaitForStick>(out _);
                ContentAddition.AddEntityState <TeslaWaitForTargetState>(out _);
                ContentAddition.AddEntityState <TeslaPreDetState>(out _);
                ContentAddition.AddEntityState <TeslaDetonateState>(out _);
                EggsUtils.EggsUtils.LogToConsole("Tesla mine states loaded!");
            }
        }
コード例 #21
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);
        }
コード例 #22
0
        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);
        }
コード例 #23
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);
        }
コード例 #24
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);
        }
コード例 #25
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);
        }
コード例 #26
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);
        }
コード例 #27
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);
        }
コード例 #28
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            var tempPfb = LegacyResourcesAPI.Load <GameObject>("Prefabs/Projectiles/GravSphere").InstantiateClone("temporary setup prefab", false);
            var proj    = tempPfb.GetComponent <RoR2.Projectile.ProjectileSimple>();

            proj.desiredForwardSpeed = 0;
            proj.lifetime            = PULL_VFX_DURATION;
            var projCtrl = tempPfb.GetComponent <RoR2.Projectile.ProjectileController>();

            projCtrl.procCoefficient = 0;
            var dmg = proj.GetComponent <RoR2.Projectile.ProjectileDamage>();

            dmg.damage  = 0f;
            dmg.enabled = false;
            var force = tempPfb.GetComponent <RadialForce>();

            force.enabled = false;

            var sph = tempPfb.transform.Find("Sphere");

            sph.gameObject.SetActive(false);

            var sps     = tempPfb.transform.Find("Sparks");
            var spsPart = sps.GetComponent <ParticleSystem>();
            var spsMain = spsPart.main;

            spsMain.startSpeed = new ParticleSystem.MinMaxCurve(10f, 30f);
            var spsShape = spsPart.shape;

            spsShape.radius = 4f;

            blackHolePrefab = tempPfb.InstantiateClone("KleinBottleProcPrefab", true);
            UnityEngine.Object.Destroy(tempPfb);

            ContentAddition.AddProjectile(blackHolePrefab);

            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/kleinBottleIcon.png");
            ContentAddition.AddUnlockableDef(unlockable);
            LanguageAPI.Add(achiNameToken, "Can't Touch This");
            LanguageAPI.Add(achiDescToken, "Block, or take 1 or less points of damage from, 3 attacks in a row.");
            itemDef.unlockableDef = unlockable;
        }
コード例 #29
0
        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/defibIcon.png");
            ContentAddition.AddUnlockableDef(unlockable);
            LanguageAPI.Add(achiNameToken, "Medic!");
            LanguageAPI.Add(achiDescToken, "Item Set: Shareable healing. Have 4 or more (of 7) at once.");
            itemDef.unlockableDef = unlockable;
        }
コード例 #30
0
        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/triBroochIcon.png");
            ContentAddition.AddUnlockableDef(unlockable);
            LanguageAPI.Add(achiNameToken, "Rasputin");
            LanguageAPI.Add(achiDescToken, "As a team: stun, then freeze, then ignite the same enemy within 3 seconds.");
            itemDef.unlockableDef = unlockable;
        }