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);
        }
        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>();
        }
Exemple #3
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;
            }
        }
Exemple #4
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);
        }
Exemple #5
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);
        }
Exemple #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);
        }
Exemple #7
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);
        }
Exemple #8
0
        internal override void SetupAttributes()
        {
            myDef = CloneSkillDef(targetVariantDef);

            var nametoken = "CLASSICITEMS_SCEPHUNTRESS_RAINNAME";

            newDescToken = "CLASSICITEMS_SCEPHUNTRESS_RAINDESC";
            oldDescToken = targetVariantDef.skillDescriptionToken;
            var namestr = "Burning Rain";

            LanguageAPI.Add(nametoken, namestr);

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

            ContentAddition.AddSkillDef(myDef);

            projReplacer = LegacyResourcesAPI.Load <GameObject>("prefabs/projectiles/HuntressArrowRain").InstantiateClone("CIScepHuntressRain", true);
            projReplacer.GetComponent <ProjectileDamage>().damageType |= DamageType.IgniteOnHit;
            projReplacer.GetComponent <ProjectileDotZone>().lifetime  *= 1.5f;
            projReplacer.transform.localScale = new Vector3(22.5f, 15f, 22.5f);
            var fx    = projReplacer.transform.Find("FX");
            var afall = fx.Find("ArrowsFalling");

            afall.GetComponent <ParticleSystemRenderer>().material.SetVector("_TintColor", new Vector4(3f, 0.1f, 0.04f, 1.5f));
            var aimp = fx.Find("ImpaledArrow");

            aimp.GetComponent <ParticleSystemRenderer>().material.SetVector("_TintColor", new Vector4(3f, 0.1f, 0.04f, 1.5f));
            var radInd = fx.Find("RadiusIndicator");

            radInd.GetComponent <MeshRenderer>().material.SetVector("_TintColor", new Vector4(3f, 0.1f, 0.04f, 1.25f));
            var flash = fx.Find("ImpactFlashes");
            var psm   = flash.GetComponent <ParticleSystem>().main;

            psm.startColor = new Color(1f, 0.7f, 0.4f);
            flash.GetComponent <ParticleSystemRenderer>().material.SetVector("_TintColor", new Vector4(3f, 0.1f, 0.04f, 1.5f));
            var flashlight = flash.Find("Point Light");

            flashlight.GetComponent <Light>().color = new Color(1f, 0.5f, 0.3f);
            flashlight.GetComponent <Light>().range = 15f;
            flashlight.gameObject.SetActive(true);

            ContentAddition.AddProjectile(projReplacer);
        }
        internal override void SetupAttributes()
        {
            myDef = CloneSkillDef(targetVariantDef);

            var nametoken = "CLASSICITEMS_SCEPMAGE_FLYUPNAME";

            newDescToken = "CLASSICITEMS_SCEPMAGE_FLYUPDESC";
            oldDescToken = targetVariantDef.skillDescriptionToken;
            var namestr = "Antimatter Surge";

            LanguageAPI.Add(nametoken, namestr);

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

            ContentAddition.AddSkillDef(myDef);
        }
        internal override void SetupAttributes()
        {
            myDef = CloneSkillDef(targetVariantDef);

            var nametoken = "CLASSICITEMS_SCEPTREEBOT_FLOWER2NAME";

            newDescToken = "CLASSICITEMS_SCEPTREEBOT_FLOWER2DESC";
            oldDescToken = targetVariantDef.skillDescriptionToken;
            var namestr = "Chaotic Growth";

            LanguageAPI.Add(nametoken, namestr);

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

            ContentAddition.AddSkillDef(myDef);
        }
        internal override void SetupAttributes()
        {
            myDef = CloneSkillDef(targetVariantDef);

            var nametoken = "CLASSICITEMS_SCEPLOADER_CHARGEFISTNAME";

            newDescToken = "CLASSICITEMS_SCEPLOADER_CHARGEFISTDESC";
            oldDescToken = targetVariantDef.skillDescriptionToken;
            var namestr = "Megaton Punch";

            LanguageAPI.Add(nametoken, namestr);

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

            ContentAddition.AddSkillDef(myDef);
        }
Exemple #12
0
        internal override void SetupAttributes()
        {
            myDef = CloneSkillDef(targetVariantDef);

            var nametoken = "CLASSICITEMS_SCEPTOOLBOT_DASHNAME";

            newDescToken = "CLASSICITEMS_SCEPTOOLBOT_DASHDESC";
            oldDescToken = targetVariantDef.skillDescriptionToken;
            var namestr = "Breach Mode";

            LanguageAPI.Add(nametoken, namestr);

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

            ContentAddition.AddSkillDef(myDef);
        }
        internal override void SetupAttributes()
        {
            myDef = CloneSkillDef(targetVariantDef);

            var nametoken = "CLASSICITEMS_SCEPCAPTAIN_AIRSTRIKEALTNAME";

            newDescToken = "CLASSICITEMS_SCEPCAPTAIN_AIRSTRIKEALTDESC";
            oldDescToken = targetVariantDef.skillDescriptionToken;
            var namestr = "Colony Drop";

            LanguageAPI.Add(nametoken, namestr);

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

            ContentAddition.AddSkillDef(myDef);

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

            myCallDef      = CloneSkillDef(oldCallDef);
            myCallDef.icon = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ScepterSkillIcons/captain_airstrikealticon.png");

            ContentAddition.AddSkillDef(myCallDef);

            projReplacer = LegacyResourcesAPI.Load <GameObject>("Prefabs/Projectiles/CaptainAirstrikeAltProjectile").InstantiateClone("CIScepCaptainAirstrikeAltTemp", false);
            projReplacer.GetComponent <ProjectileImpactExplosion>().blastRadius *= 8f;
            var pc = projReplacer.GetComponent <ProjectileController>();

            ghostReplacer = LegacyResourcesAPI.Load <GameObject>("Prefabs/ProjectileGhosts/CaptainAirstrikeAltGhost").InstantiateClone("CIScepCaptainAirstrikeAltGhostTemp", false);
            ghostReplacer.transform.Find("Indicator").lossyScale.Scale(new Vector3(8f, 8f, 2f));
            ghostReplacer.transform.Find("AreaIndicatorCenter").lossyScale.Scale(new Vector3(8f, 8f, 2f));
            ghostReplacer.transform.Find("AirstrikeOrientation").Find("FallingProjectile").lossyScale.Scale(new Vector3(4f, 4f, 4f));
            ghostReplacer = ghostReplacer.InstantiateClone("CIScepCaptainAirstrikeAltGhost", false);

            pc.ghostPrefab = ghostReplacer;

            projReplacer = projReplacer.InstantiateClone("CIScepCaptainAirstrikeAlt", true);

            ContentAddition.AddProjectile(projReplacer);
        }
Exemple #14
0
        internal override void SetupAttributes()
        {
            myDef = CloneSkillDef(targetVariantDef);

            var nametoken = "CLASSICITEMS_SCEPCOMMANDO_BARRAGENAME";

            newDescToken = "CLASSICITEMS_SCEPCOMMANDO_BARRAGEDESC";
            oldDescToken = targetVariantDef.skillDescriptionToken;
            var namestr = "Death Blossom";

            LanguageAPI.Add(nametoken, namestr);
            //TODO: fire auto-aim bullets at every enemy in range

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

            ContentAddition.AddSkillDef(myDef);
        }
Exemple #15
0
        internal override void SetupAttributes()
        {
            myDef = CloneSkillDef(targetVariantDef);

            var nametoken = "CLASSICITEMS_SCEPENGI_TURRETNAME";

            newDescToken = "CLASSICITEMS_SCEPENGI_TURRETDESC";
            oldDescToken = targetVariantDef.skillDescriptionToken;
            var namestr = "TR12-C Gauss Compact";

            LanguageAPI.Add(nametoken, namestr);

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

            ContentAddition.AddSkillDef(myDef);
        }
Exemple #16
0
        internal override void SetupAttributes()
        {
            myDef = CloneSkillDef(targetVariantDef);

            var nametoken = "CLASSICITEMS_SCEPENGI_WALKERNAME";

            newDescToken = "CLASSICITEMS_SCEPENGI_WALKERDESC";
            oldDescToken = targetVariantDef.skillDescriptionToken;
            var namestr = "TR58-C Carbonizer Mini";

            LanguageAPI.Add(nametoken, namestr);

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

            ContentAddition.AddSkillDef(myDef);
        }
Exemple #17
0
        internal override void SetupAttributes()
        {
            myDef = CloneSkillDef(targetVariantDef);

            var nametoken = "CLASSICITEMS_SCEPMERC_EVISPROJNAME";

            newDescToken = "CLASSICITEMS_SCEPMERC_EVISPROJDESC";
            oldDescToken = targetVariantDef.skillDescriptionToken;
            var namestr = "Gale-Force";

            LanguageAPI.Add(nametoken, namestr);

            myDef.skillName             = namestr;
            myDef.skillNameToken        = nametoken;
            myDef.skillDescriptionToken = newDescToken;
            myDef.icon                  = ClassicItemsPlugin.resources.LoadAsset <Sprite>("Assets/ClassicItems/Textures/ScepterSkillIcons/merc_evisprojectileicon.png");
            myDef.baseMaxStock         *= 4;
            myDef.baseRechargeInterval /= 4f;

            ContentAddition.AddSkillDef(myDef);
        }
Exemple #18
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            //load custom assets
            var muzzleEffectPrefab = TinkersSatchelPlugin.resources.LoadAsset <GameObject>("Assets/TinkersSatchel/Prefabs/Misc/EngiChaffFlareEffect.prefab");

            skillDef = TinkersSatchelPlugin.resources.LoadAsset <SkillDef>("Assets/TinkersSatchel/SkillDefs/EngiSecondaryChaff.asset");

            //load vanilla assets
            targetSkillFamily = Addressables.LoadAssetAsync <SkillFamily>("RoR2/Base/Engi/EngiBodySecondaryFamily.asset")
                                .WaitForCompletion();
            var tracerMtl = Addressables.LoadAssetAsync <Material>("RoR2/Base/Firework/matFireworkSparkle.mat")
                            .WaitForCompletion();

            //modify
            muzzleEffectPrefab.GetComponent <ParticleSystemRenderer>().material = tracerMtl;
            Fire.effectPrefab = muzzleEffectPrefab;

            //R2API catalog reg
            ContentAddition.AddEffect(muzzleEffectPrefab);

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

            if (!entStateDidSucceed)
            {
                TinkersSatchelPlugin._logger.LogError("EntityState setup failed on EngiSecondaryChaff! Skill will not appear nor function.");
            }
            else if (!ContentAddition.AddSkillDef(skillDef))
            {
                TinkersSatchelPlugin._logger.LogError("SkillDef setup failed on EngiSecondaryChaff! Skill will not appear nor function.");
            }
            else
            {
                setupSucceeded = true;
            }
        }
Exemple #19
0
        internal override void SetupAttributes()
        {
            myDef = CloneSkillDef(targetVariantDef);

            var nametoken = "CLASSICITEMS_SCEPMAGE_FLAMETHROWERNAME";

            newDescToken = "CLASSICITEMS_SCEPMAGE_FLAMETHROWERDESC";
            oldDescToken = targetVariantDef.skillDescriptionToken;
            var namestr = "Dragon's Breath";

            LanguageAPI.Add(nametoken, namestr);

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

            ContentAddition.AddSkillDef(myDef);

            projCloud = LegacyResourcesAPI.Load <GameObject>("prefabs/projectiles/BeetleQueenAcid").InstantiateClone("CIScepMageFlamethrowerCloud", true);
            var pdz = projCloud.GetComponent <ProjectileDotZone>();

            pdz.lifetime      = 10f;
            pdz.impactEffect  = null;
            pdz.fireFrequency = 2f;
            var fxObj = projCloud.transform.Find("FX");

            fxObj.Find("Spittle").gameObject.SetActive(false);
            fxObj.Find("Decal").gameObject.SetActive(false);
            fxObj.Find("Gas").gameObject.SetActive(false);
            foreach (var x in fxObj.GetComponents <AnimateShaderAlpha>())
            {
                x.enabled = false;
            }
            var fxcloud = UnityEngine.Object.Instantiate(LegacyResourcesAPI.Load <GameObject>("prefabs/FireTrail").GetComponent <DamageTrail>().segmentPrefab, fxObj.transform);
            var psmain  = fxcloud.GetComponent <ParticleSystem>().main;

            psmain.duration        = 10f;
            psmain.gravityModifier = -0.05f;
            var pstartx = psmain.startSizeX;

            pstartx.constantMin *= 0.75f;
            pstartx.constantMax *= 0.75f;
            var pstarty = psmain.startSizeY;

            pstarty.constantMin *= 0.75f;
            pstarty.constantMax *= 0.75f;
            var pstartz = psmain.startSizeZ;

            pstartz.constantMin *= 0.75f;
            pstartz.constantMax *= 0.75f;
            var pslife = psmain.startLifetime;

            pslife.constantMin = 0.75f;
            pslife.constantMax = 1.5f;
            fxcloud.GetComponent <DestroyOnTimer>().enabled = false;
            fxcloud.transform.localPosition = Vector3.zero;
            fxcloud.transform.localScale    = Vector3.one;
            var psshape = fxcloud.GetComponent <ParticleSystem>().shape;

            psshape.shapeType = ParticleSystemShapeType.Sphere;
            psshape.scale     = Vector3.one * 1.5f;
            var psemit = fxcloud.GetComponent <ParticleSystem>().emission;

            psemit.rateOverTime = Scepter.instance.artiFlamePerformanceMode ? 4f : 20f;
            var lightObj = fxObj.Find("Point Light").gameObject;

            if (Scepter.instance.artiFlamePerformanceMode)
            {
                UnityEngine.Object.Destroy(lightObj);
            }
            else
            {
                var lightCpt = lightObj.GetComponent <Light>();
                lightCpt.color     = new Color(1f, 0.5f, 0.2f);
                lightCpt.intensity = 3.5f;
                lightCpt.range     = 5f;
            }

            ContentAddition.AddProjectile(projCloud);
        }
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            //load custom assets
            projectilePrefab    = TinkersSatchelPlugin.resources.LoadAsset <GameObject>("Assets/TinkersSatchel/Prefabs/Misc/EngiFlakProjectile.prefab");
            projectileGhost     = TinkersSatchelPlugin.resources.LoadAsset <GameObject>("Assets/TinkersSatchel/Prefabs/Misc/EngiFlakGhost.prefab");
            subProjectilePrefab = TinkersSatchelPlugin.resources.LoadAsset <GameObject>("Assets/TinkersSatchel/Prefabs/Misc/EngiFlakSubProjectile.prefab");
            subProjectileGhost  = TinkersSatchelPlugin.resources.LoadAsset <GameObject>("Assets/TinkersSatchel/Prefabs/Misc/EngiFlakSubGhost.prefab");
            skillDef            = ScriptableObject.CreateInstance <SteppedSkillDef>();
            skillDef.activationStateMachineName = "Weapon";
            skillDef.skillNameToken             = "TKSAT_ENGI_PRIMARY_FLAK_NAME";
            skillDef.skillDescriptionToken      = "TKSAT_ENGI_PRIMARY_FLAK_DESCRIPTION";
            skillDef.interruptPriority          = InterruptPriority.Any;
            skillDef.icon = TinkersSatchelPlugin.resources.LoadAsset <Sprite>("Assets/TinkersSatchel/Textures/SkillIcons/EngiPrimaryFlak.png");
            skillDef.baseRechargeInterval         = 0;
            skillDef.baseMaxStock                 = 1;
            skillDef.rechargeStock                = 1;
            skillDef.requiredStock                = 1;
            skillDef.stockToConsume               = 1;
            skillDef.resetCooldownTimerOnUse      = true;
            skillDef.fullRestockOnAssign          = true;
            skillDef.dontAllowPastMaxStocks       = false;
            skillDef.beginSkillCooldownOnSkillEnd = true;
            skillDef.cancelSprintingOnActivation  = true;
            skillDef.forceSprintDuringState       = false;
            skillDef.canceledFromSprinting        = false;
            skillDef.isCombatSkill                = true;
            skillDef.mustKeyPress                 = false;
            skillDef.stepCount         = 2;
            skillDef.stepGraceDuration = 0.1f;

            //load vanilla assets
            var mainMtl = Addressables.LoadAssetAsync <Material>("RoR2/Base/Engi/matEngiTurret.mat")
                          .WaitForCompletion();
            var tracerMtl = Addressables.LoadAssetAsync <Material>("RoR2/Base/Common/VFX/matTracerBrightTransparent.mat")
                            .WaitForCompletion();
            var muzzleEffectPrefab = Addressables.LoadAssetAsync <GameObject>("RoR2/Base/Common/VFX/MuzzleflashSmokeRing.prefab")
                                     .WaitForCompletion();
            var explosionEffectPrefab = Addressables.LoadAssetAsync <GameObject>("RoR2/Base/Engi/EngiGrenadeExplosion.prefab")
                                        .WaitForCompletion();
            var shrapnelHitEffectPrefab = Addressables.LoadAssetAsync <GameObject>("RoR2/Base/Commando/HitsparkCommando.prefab")
                                          .WaitForCompletion();

            targetSkillFamily = Addressables.LoadAssetAsync <SkillFamily>("RoR2/Base/Engi/EngiBodyPrimaryFamily.asset")
                                .WaitForCompletion();

            //modify
            projectilePrefab.GetComponent <ProjectileSimple>().lifetimeExpiredEffect  = explosionEffectPrefab;
            projectilePrefab.GetComponent <ProjectileOverlapAttack>().impactEffect    = shrapnelHitEffectPrefab;
            subProjectilePrefab.GetComponent <ProjectileOverlapAttack>().impactEffect = shrapnelHitEffectPrefab;

            projectileGhost.GetComponent <MeshRenderer>().material = mainMtl;
            subProjectileGhost.transform.Find("SpikeModel").GetComponent <MeshRenderer>().material = mainMtl;
            subProjectileGhost.transform.Find("Trail").GetComponent <TrailRenderer>().material     = tracerMtl;

            FireContinuous.projectilePrefab = projectilePrefab;
            FireContinuous.effectPrefab     = muzzleEffectPrefab;

            //R2API catalog reg
            skillDef.activationState = ContentAddition.AddEntityState <FireContinuous>(out bool entStateDidSucceed);
            ContentAddition.AddProjectile(projectilePrefab);
            ContentAddition.AddProjectile(subProjectilePrefab);

            if (!entStateDidSucceed)
            {
                TinkersSatchelPlugin._logger.LogError("EntityState setup failed on EngiPrimaryFlak! Skill will not appear nor function.");
            }
            else if (!ContentAddition.AddSkillDef(skillDef))
            {
                TinkersSatchelPlugin._logger.LogError("SkillDef setup failed on EngiPrimaryFlak! Skill will not appear nor function.");
            }
            else
            {
                setupSucceeded = true;
            }
        }
        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;
            }
        }
Exemple #22
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();

            //load custom assets
            skillDef         = TinkersSatchelPlugin.resources.LoadAsset <SkillDef>("Assets/TinkersSatchel/SkillDefs/CommandoSpecialPlasmaGrenade.asset");
            scepterSkillDef  = TinkersSatchelPlugin.resources.LoadAsset <SkillDef>("Assets/TinkersSatchel/SkillDefs/CIScepter/CommandoSpecialPlasmaGrenadeScep.asset");
            projectilePrefab = TinkersSatchelPlugin.resources.LoadAsset <GameObject>("Assets/TinkersSatchel/Prefabs/Misc/CommandoPlasmaGrenadeProjectile.prefab");
            var ghostPrefab = TinkersSatchelPlugin.resources.LoadAsset <GameObject>("Assets/TinkersSatchel/Prefabs/Misc/CommandoPlasmaGrenadeGhost.prefab");

            scepterProjectilePrefab = TinkersSatchelPlugin.resources.LoadAsset <GameObject>("Assets/TinkersSatchel/Prefabs/Misc/CommandoPlasmaGrenadeProjectileScep.prefab");
            var scepterGhostPrefab = TinkersSatchelPlugin.resources.LoadAsset <GameObject>("Assets/TinkersSatchel/Prefabs/Misc/CommandoPlasmaGrenadeGhostScep.prefab");

            //load vanilla assets
            targetSkillFamily = Addressables.LoadAssetAsync <SkillFamily>("RoR2/Base/Commando/CommandoBodySpecialFamily.asset")
                                .WaitForCompletion();
            var detParticleMaterial = Addressables.LoadAssetAsync <Material>("RoR2/Base/Wisp/matWispFire.mat")
                                      .WaitForCompletion();
            var fuseParticleMaterial = Addressables.LoadAssetAsync <Material>("RoR2/Base/ClayBoss/matClayBossLightshaft.mat")
                                       .WaitForCompletion();
            var explosionPrefab = Addressables.LoadAssetAsync <GameObject>("RoR2/Base/LemurianBruiser/OmniExplosionVFXLemurianBruiserFireballImpact.prefab")
                                  .WaitForCompletion();

            //modify
            var pRen = ghostPrefab.transform.Find("RadialGlow").gameObject.GetComponent <ParticleSystemRenderer>();

            pRen.material = detParticleMaterial;
            var expl = projectilePrefab.GetComponent <ProjectileExplosion>();

            expl.explosionEffect = explosionPrefab;
            var pRen2 = projectilePrefab.transform.Find("FuseVFX").gameObject.GetComponent <ParticleSystemRenderer>();

            pRen2.material = fuseParticleMaterial;

            var scepterExplosionPrefabTmp = explosionPrefab.InstantiateClone("TkSatTempSetupPrefab", false);

            scepterExplosionPrefabTmp.transform.localScale *= 2f;

            var scepterExplosionPrefab = scepterExplosionPrefabTmp.InstantiateClone("TkSatPlasmaGrenadeScepterExplosion", false);

            pRen                 = scepterGhostPrefab.transform.Find("RadialGlow").gameObject.GetComponent <ParticleSystemRenderer>();
            pRen.material        = detParticleMaterial;
            expl                 = scepterProjectilePrefab.GetComponent <ProjectileExplosion>();
            expl.explosionEffect = scepterExplosionPrefab;
            pRen2                = scepterProjectilePrefab.transform.Find("FuseVFX").gameObject.GetComponent <ParticleSystemRenderer>();
            pRen2.material       = fuseParticleMaterial;

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

            skillDef.activationState        = astate;
            scepterSkillDef.activationState = astate;

            if (!entStateDidSucceed)
            {
                TinkersSatchelPlugin._logger.LogError("EntityState setup failed on CommandoSpecialPlasmaGrenade! Skill will not appear nor function.");
            }
            else if (!ContentAddition.AddSkillDef(skillDef))
            {
                TinkersSatchelPlugin._logger.LogError("SkillDef setup failed on CommandoSpecialPlasmaGrenade! Skill will not appear nor function.");
            }
            else
            {
                setupSucceeded = true;
            }

            ContentAddition.AddEffect(scepterExplosionPrefab);
            ContentAddition.AddProjectile(projectilePrefab);
            ContentAddition.AddProjectile(scepterProjectilePrefab);

            if (Compat_ClassicItems.enabled)
            {
                if (!ContentAddition.AddSkillDef(scepterSkillDef))
                {
                    scepSetupSucceeded = false;
                }
                else
                {
                    scepSetupSucceeded = Compat_ClassicItems.RegisterScepterSkill(scepterSkillDef, "CommandoBody", SkillSlot.Special, skillDef);
                }
                if (!scepSetupSucceeded)
                {
                    TinkersSatchelPlugin._logger.LogError("ClassicItems Scepter support failed for CommandoSpecialPlasmaGrenade! Ancient Scepter will not work on this skill.");
                }
            }
        }
Exemple #23
0
        //Main method for setting up all our skills
        private void RegisterSkills()
        {
            //For each character, if the configvalue says they are allowed to load up their skills load them, otherwise don't.  Simple.
            //Artificer
            if (Configuration.GetConfigValue(Configuration.EnableMageSkills))
            {
                RegisterArtificerSkills();
            }
            //Mercenary
            if (Configuration.GetConfigValue(Configuration.EnableMercSkills))
            {
                RegisterMercenarySkills();
            }
            //Commando
            if (Configuration.GetConfigValue(Configuration.EnableCommandoSkills))
            {
                RegisterCommandoSkills();
            }
            //Engineer
            if (Configuration.GetConfigValue(Configuration.EnableEngiSkills))
            {
                RegisterEngiSkills();
            }
            //Acrid (Yes he is called croco in the official code and it is beautiful)
            if (Configuration.GetConfigValue(Configuration.EnableCrocoSkills))
            {
                RegisterAcridSkills();
            }
            //Loader
            if (Configuration.GetConfigValue(Configuration.EnableLoaderSkills))
            {
                RegisterLoaderSkills();
            }
            //Captain
            if (Configuration.GetConfigValue(Configuration.EnableCaptainSkills))
            {
                RegisterCaptainSkills();
            }
            //REX
            if (Configuration.GetConfigValue(Configuration.EnableTreebotSkills))
            {
                RegisterRexSkills();
            }
            //Bandit
            if (Configuration.GetConfigValue(Configuration.EnableBanditSkills))
            {
                RegisterBanditSkills();
            }
            //Huntress
            if (Configuration.GetConfigValue(Configuration.EnableHuntressSkills))
            {
                RegisterHuntressSkills();
            }
            //MUL-T
            if (Configuration.GetConfigValue(Configuration.EnableToolbotSkills))
            {
                RegisterMultSkills();
            }

            //Register any states that aren't directly tied to skill activation (Basically, don't need skilldefs)
            RegisterExtraStates();

            //As long as there are any skilldefs waiting to be added...
            if (defList.Count > 0)
            {
                //For every skilldef queue'd up to be added...
                foreach (SkillDef def in defList)
                {
                    //Add skilldef via R2API
                    ContentAddition.AddSkillDef(def);
                    //Tell us each time a skill is registered, helps with sanity checks
                    EggsUtils.EggsUtils.LogToConsole("Skill: " + def.skillName + " Registered");
                }
            }
            //Sadness check
            else
            {
                EggsUtils.EggsUtils.LogToConsole("Did you really install my mod just to disable all the skills :(");
            }
        }