Пример #1
0
 private static void AddLang()
 {
     LanguageAPI.Add("INTERACTABLE_SHIELD_NAME", "Shield");
     LanguageAPI.Add("INTERACTABLE_SHIELD_CONTEXT", "Protect and Serve");
     LanguageAPI.Add("INTERACTABLE_SWAG_NAME", "Swag");
     LanguageAPI.Add("INTERACTABLE_SWAG_CONTEXT", "Protect and Swerve");
 }
Пример #2
0
 protected void CreateLang()
 {
     LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_NAME", ItemName);
     LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_PICKUP", ItemPickupDesc);
     LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_DESCRIPTION", ItemFullDescription);
     LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_LORE", ItemLore);
 }
        internal override void SetupAttributes()
        {
            var oldDef = Resources.Load <SkillDef>("skilldefs/captainbody/PrepAirstrike");

            myDef = CloneSkillDef(oldDef);

            var nametoken = "CLASSICITEMS_SCEPCAPTAIN_AIRSTRIKENAME";

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

            LanguageAPI.Add(nametoken, namestr);

            myDef.skillName             = namestr;
            myDef.skillNameToken        = nametoken;
            myDef.skillDescriptionToken = newDescToken;
            myDef.icon = Resources.Load <Sprite>("@ClassicItems:Assets/ClassicItems/icons/scepter/captain_airstrikeicon.png");

            LoadoutAPI.AddSkillDef(myDef);

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

            myCallDef = CloneSkillDef(oldCallDef);
            myCallDef.baseMaxStock         = 21;
            myCallDef.mustKeyPress         = false;
            myCallDef.isBullets            = true;
            myCallDef.shootDelay           = 0.07f;
            myCallDef.baseRechargeInterval = 0.07f;
            myCallDef.icon = Resources.Load <Sprite>("@ClassicItems:Assets/ClassicItems/icons/scepter/captain_airstrikeicon.png");

            LoadoutAPI.AddSkillDef(myCallDef);
        }
Пример #4
0
        void PrimarySetup()
        {
            SkillLocator component = characterPrefab.GetComponent <SkillLocator>();

            LanguageAPI.Add("EXAMPLESURVIVOR_PRIMARY_CROSSBOW_NAME", "Crossbow");
            LanguageAPI.Add("EXAMPLESURVIVOR_PRIMARY_CROSSBOW_DESCRIPTION", "Fire an arrow, dealing <style=cIsDamage>200% damage</style>.");

            // set up your primary skill def here!

            SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();

            mySkillDef.activationState            = new SerializableEntityStateType(typeof(ExampleSurvivorFireArrow));
            mySkillDef.activationStateMachineName = "Weapon";
            mySkillDef.baseMaxStock                 = 1;
            mySkillDef.baseRechargeInterval         = 0f;
            mySkillDef.beginSkillCooldownOnSkillEnd = false;
            mySkillDef.canceledFromSprinting        = false;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.Any;
            mySkillDef.isBullets             = false;
            mySkillDef.isCombatSkill         = true;
            mySkillDef.mustKeyPress          = false;
            mySkillDef.noSprint              = true;
            mySkillDef.rechargeStock         = 1;
            mySkillDef.requiredStock         = 1;
            mySkillDef.shootDelay            = 0f;
            mySkillDef.stockToConsume        = 1;
            mySkillDef.icon                  = Assets.icon1;
            mySkillDef.skillDescriptionToken = "EXAMPLESURVIVOR_PRIMARY_CROSSBOW_DESCRIPTION";
            mySkillDef.skillName             = "EXAMPLESURVIVOR_PRIMARY_CROSSBOW_NAME";
            mySkillDef.skillNameToken        = "EXAMPLESURVIVOR_PRIMARY_CROSSBOW_NAME";

            LoadoutAPI.AddSkillDef(mySkillDef);

            component.primary = characterPrefab.AddComponent <GenericSkill>();
            SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>();

            newFamily.variants = new SkillFamily.Variant[1];
            LoadoutAPI.AddSkillFamily(newFamily);
            component.primary.SetFieldValue("_skillFamily", newFamily);
            SkillFamily skillFamily = component.primary.skillFamily;

            skillFamily.variants[0] = new SkillFamily.Variant
            {
                skillDef       = mySkillDef,
                unlockableName = "",
                viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
            };


            // add this code after defining a new skilldef if you're adding an alternate skill

            /*Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
             * skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
             * {
             *  skillDef = newSkillDef,
             *  unlockableName = "",
             *  viewableNode = new ViewablesCatalog.Node(newSkillDef.skillNameToken, false, null)
             * };*/
        }
Пример #5
0
        public void CreateElite()
        {
            var eliteDef = new RoR2.EliteDef
            {
                name                = "Hypercharged",
                modifierToken       = "ARES_HYPERCHARGED",
                color               = Color.white,
                eliteEquipmentIndex = AffixEquipmentIndex
            };

            EliteIndex = EliteAPI.Add(new CustomElite(eliteDef, 2));
            LanguageAPI.Add(eliteDef.modifierToken, eliteDef.name + " {0}");

            EliteBuffDef.eliteIndex       = EliteIndex;
            EliteBuffIndex                = BuffAPI.Add(new CustomBuff(EliteBuffDef));
            AffixEquipmentDef.passiveBuff = EliteBuffIndex;

            EliteAffixCard = new EliteAffixCard
            {
                spawnWeight      = 0.5f,
                costMultiplier   = 30.0f,
                damageBoostCoeff = 2.0f,
                healthBoostCoeff = 4.5f,
                eliteOnlyScaling = 0.5f,
                eliteType        = EliteIndex
            };
            EsoLib.Cards.Add(EliteAffixCard);
        }
Пример #6
0
 protected void SetupLangTokens()
 {
     LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_NAME", EquipmentName);
     LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_PICKUP", EquipmentPickupDesc);
     LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_DESCRIPTION", EquipmentFullDescription);
     LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_LORE", EquipmentLore);
 }
Пример #7
0
        internal override void SetupAttributes()
        {
            var oldDef = Resources.Load <SkillDef>("skilldefs/commandobody/ThrowGrenade");

            myDef = CloneSkillDef(oldDef);

            var nametoken = "ANCIENTSCEPTER_SCEPCOMMANDO_GRENADENAME";

            newDescToken = "ANCIENTSCEPTER_SCEPCOMMANDO_GRENADEDESC";
            oldDescToken = oldDef.skillDescriptionToken;
            var namestr = "Carpet Bomb";

            LanguageAPI.Add(nametoken, namestr);

            myDef.skillName             = namestr;
            myDef.skillNameToken        = nametoken;
            myDef.skillDescriptionToken = newDescToken;
            myDef.icon = Assets.mainAssetBundle.LoadAsset <Sprite>("texCommandoR2");

            LoadoutAPI.AddSkillDef(myDef);

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

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

            ProjectileAPI.Add(projReplacer);
        }
Пример #8
0
            private static void ThalliumAsItem()
            {
                LanguageAPI.Add("THALLIUM_NAME_TOKEN", "Thallium");
                LanguageAPI.Add("THALLIUM_PICKUP_TOKEN", "Chance to slow and damage enemies over time.");
                LanguageAPI.Add("THALLIUM_DESCRIPTION_TOKEN", "<style=cIsDamage>10%</style> chance on hit to slow an enemy with a <style=cIsDamage>metal poisoning</style>, <style=cIsUtility>slowing</style> them by <style=cIsUtility>100%</style> and dealing <style=cIsDamage>600%</style> <style=cStack>(+600% per stack)</style> TOTAL damage.");
                LanguageAPI.Add("THALLIUM_LORE_TOKEN", "Shipping Method: High Priority / Fragile\r\nOrder Details: She shouldn't notice.");
                LanguageAPI.Add("THALLIUM_NAME_TOKEN", "铊", "zh-CN");
                LanguageAPI.Add("THALLIUM_PICKUP_TOKEN", "几率减速敌人,并且使敌人中毒。", "zh-CN");
                LanguageAPI.Add("THALLIUM_DESCRIPTION_TOKEN", "有<style=cIsDamage>10%</style> 几率使得敌人<style=cIsDamage>金属中毒</style>,并<style=cIsUtility>减速</style>其<style=cIsUtility>100%</style>,造成<style=cIsDamage>600%</style> <style=cStack>(每层增加600%)</style> 总伤害。", "zh-CN");
                LanguageAPI.Add("THALLIUM_LORE_TOKEN", "运输方式:高优先级 / 脆弱\r\n商品细节:她不会注意到的。", "zh-CN");

                ItemDef ThalliumDef = new ItemDef
                {
                    name             = "THALLIUM_NAME_TOKEN",
                    pickupIconPath   = IconPath,
                    pickupModelPath  = PrefabPath,
                    nameToken        = "THALLIUM_NAME_TOKEN",
                    pickupToken      = "THALLIUM_PICKUP_TOKEN",
                    descriptionToken = "THALLIUM_DESCRIPTION_TOKEN",
                    loreToken        = "THALLIUM_LORE_TOKEN",
                    tier             = ItemTier.Tier3,
                    tags             = new ItemTag[]
                    {
                        ItemTag.Damage
                    }
                };

                ItemDisplayRule[] DisplayRules = null;
                CustomItem        ThalliumItem = new CustomItem(ThalliumDef, DisplayRules);

                ThalliumItemIndex = ItemAPI.Add(ThalliumItem);
            }
Пример #9
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);
        }
Пример #10
0
 public override void InstallLanguage()
 {
     base.InstallLanguage();
     LanguageAPI.Add(modInfo.shortIdentifier + "_MASTERROUND_START", "<color=#c9ab14>[MR] Each player can take a max of {0} hits!</color>", "en");
     LanguageAPI.Add(modInfo.shortIdentifier + "_MASTERROUND_HIT", "<color=#ba3f0f>[MR] {0} has been hit {1} out of {2} times by {3}!</color>", "en");
     LanguageAPI.Add(modInfo.shortIdentifier + "_MASTERROUND_FAIL", "<color=#ba3f0f>[MR] {0} failed by getting hit {1} out of {2} times by {3}!</color>", "en");
 }
Пример #11
0
        public static void RegisterSurvivors()
        {
            SurvivorDef survivorDef = ScriptableObject.CreateInstance <SurvivorDef>();

            survivorDef.displayNameToken    = "ROCKETEER_NAME";
            survivorDef.unlockableDef       = null;
            survivorDef.descriptionToken    = "ROCKETEER_DESCRIPTION";
            survivorDef.primaryColor        = characterColor;
            survivorDef.bodyPrefab          = characterPrefab;
            survivorDef.displayPrefab       = characterDisplay;
            survivorDef.outroFlavorToken    = "MINER_OUTRO_FLAVOR";
            survivorDef.hidden              = false;
            survivorDef.desiredSortPosition = 17f;

            bodyPrefabs.Add(characterPrefab);
            survivorDefs.Add(survivorDef);

            // now that the body prefab's set up, clone it here to make the display prefab
            characterDisplay = PrefabAPI.InstantiateClone(characterPrefab.GetComponent <ModelLocator>().modelBaseTransform.gameObject, "RocketeerDisplay", true, "C:\\Users\\Tinde\\Desktop\\Lurgypai\\ROR2\\mods\\Projects\\files\\ExampleSurvivor\\ExampleSurvivor\\ExampleSurvivor\\ExampleSurvivor\\Rocketeer.cs", "RegisterCharacter", 153);
            characterDisplay.AddComponent <NetworkIdentity>();

            // write a clean survivor description here!
            string desc = "Rocketeer.<color=#CCD3E0>" + Environment.NewLine + Environment.NewLine;

            desc = desc + "< ! > After jetting, the Rocketeer can activate a final secondary jet to negate fall damage." + Environment.NewLine + Environment.NewLine;
            desc = desc + "< ! > Remember that the Rocketeer's Big Booma Cannon does additional damage for each stored rocket." + Environment.NewLine + Environment.NewLine;
            desc = desc + "< ! > The Rocketeer spawns with a Shiny Jetpack." + Environment.NewLine + Environment.NewLine;

            // add the language tokens
            LanguageAPI.Add("ROCKETEER_NAME", "Rocketeer");
            LanguageAPI.Add("ROCKETEER_DESCRIPTION", desc);
            LanguageAPI.Add("ROCKETEER_SUBTITLE", "Flight of the boomble-bee.");
        }
Пример #12
0
        internal override void SetupAttributes()
        {
            var oldDef = Resources.Load <SkillDef>("skilldefs/huntressbody/AimArrowSnipe");

            myDef = CloneSkillDef(oldDef);

            var nametoken = "CLASSICITEMS_SCEPHUNTRESS_BALLISTANAME";

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

            LanguageAPI.Add(nametoken, namestr);

            myDef.skillName             = namestr;
            myDef.skillNameToken        = nametoken;
            myDef.skillDescriptionToken = newDescToken;
            myDef.icon = Resources.Load <Sprite>("@ClassicItems:Assets/ClassicItems/icons/scepter/huntress_ballistaicon.png");

            LoadoutAPI.AddSkillDef(myDef);

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

            myCtxDef = CloneSkillDef(oldCtxDef);

            myCtxDef.skillName             = namestr;
            myCtxDef.skillNameToken        = nametoken;
            myCtxDef.skillDescriptionToken = newDescToken;
            myCtxDef.icon = Resources.Load <Sprite>("@ClassicItems:Assets/ClassicItems/icons/scepter/huntress_ballistaicon.png");

            LoadoutAPI.AddSkillDef(myCtxDef);
        }
Пример #13
0
        internal override void SetupAttributes()
        {
            var oldDef = Resources.Load <SkillDef>("skilldefs/huntressbody/AimArrowSnipe");

            myDef = CloneSkillDef(oldDef);

            var nametoken = "ANCIENTSCEPTER_SCEPHUNTRESS_BALLISTANAME";

            newDescToken = "ANCIENTSCEPTER_SCEPHUNTRESS_BALLISTADESC";
            oldDescToken = oldDef.skillDescriptionToken;
            var namestr = "Rabauld";

            LanguageAPI.Add(nametoken, namestr);

            myDef.skillName             = namestr;
            myDef.skillNameToken        = nametoken;
            myDef.skillDescriptionToken = newDescToken;
            myDef.icon = Assets.mainAssetBundle.LoadAsset <Sprite>("texHuntressR2");

            LoadoutAPI.AddSkillDef(myDef);

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

            myCtxDef = CloneSkillDef(oldCtxDef);

            myCtxDef.skillName             = namestr;
            myCtxDef.skillNameToken        = nametoken;
            myCtxDef.skillDescriptionToken = newDescToken;
            myCtxDef.icon = Assets.mainAssetBundle.LoadAsset <Sprite>("texHuntressR2");

            LoadoutAPI.AddSkillDef(myCtxDef);
        }
        internal override void SetupAttributes()
        {
            var oldDef = Resources.Load <SkillDef>("skilldefs/loaderbody/ChargeZapFist");

            myDef = CloneSkillDef(oldDef);

            var nametoken = "ANCIENTSCEPTER_SCEPLOADER_CHARGEZAPFISTNAME";

            newDescToken = "ANCIENTSCEPTER_SCEPLOADER_CHARGEZAPFISTDESC";
            oldDescToken = oldDef.skillDescriptionToken;
            var namestr = "Thundercrash";

            LanguageAPI.Add(nametoken, namestr);

            myDef.skillName             = namestr;
            myDef.skillNameToken        = nametoken;
            myDef.skillDescriptionToken = newDescToken;
            myDef.icon = Assets.mainAssetBundle.LoadAsset <Sprite>("texLoaderU2");

            LoadoutAPI.AddSkillDef(myDef);

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

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

            ProjectileAPI.Add(projReplacer);
        }
Пример #15
0
            private static void VialAsItem()
            {
                LanguageAPI.Add("VIAL_NAME_TOKEN", "Mysterious Vial");
                LanguageAPI.Add("VIAL_PICKUP_TOKEN", "Increased health regeneration.");
                LanguageAPI.Add("VIAL_DESCRIPTION_TOKEN", "Gain <style=cIsHealing>1.2</style> <style=cStack>(+1.2 per stack)</style>HP regen/s.");
                LanguageAPI.Add("VIAL_LORE_TOKEN", "Apply to skin for a rapidly acting gel that contains both antiseptics and an agent to encourage protein synthesis!");
                LanguageAPI.Add("VIAL_NAME_TOKEN", "神秘药剂", "zh-CN");
                LanguageAPI.Add("VIAL_PICKUP_TOKEN", "增加生命值再生速度", "zh-CN");
                LanguageAPI.Add("VIAL_DESCRIPTION_TOKEN", "使<style=cIsHealing>基础生命值再生速度</style>提高<style=cIsHealing>1.2hp/s</style><style=cStack>(每层增加1.2hp/s)</style>。", "zh-CN");
                LanguageAPI.Add("VIAL_LORE_TOKEN", "涂在皮肤上,可快速作用,同时含有防腐剂和促进蛋白质合成的物质!", "zh-CN");

                ItemDef VialDef = new ItemDef
                {
                    name             = "VIAL_NAME_TOKEN",
                    pickupIconPath   = IconPath,
                    pickupModelPath  = PrefabPath,
                    nameToken        = "VIAL_NAME_TOKEN",
                    pickupToken      = "VIAL_PICKUP_TOKEN",
                    descriptionToken = "VIAL_DESCRIPTION_TOKEN",
                    loreToken        = "VIAL_LORE_TOKEN",
                    tier             = ItemTier.Tier1,
                    tags             = new ItemTag[]
                    {
                        ItemTag.Healing
                    }
                };

                ItemDisplayRule[] DisplayRules = null;
                CustomItem        VialItem     = new CustomItem(VialDef, DisplayRules);

                VialItemIndex = ItemAPI.Add(VialItem);
            }
Пример #16
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);
        }
        internal static void SetupAttributes()
        {
            var oldDef = Resources.Load <SkillDef>("skilldefs/huntressbody/AimArrowSnipe");

            myDef = CloneSkillDef(oldDef);

            var nametoken = "CLASSICITEMS_SCEPHUNTRESS_BALLISTANAME";
            var desctoken = "CLASSICITEMS_SCEPHUNTRESS_BALLISTADESC";
            var namestr   = "Rabauld";

            LanguageAPI.Add(nametoken, namestr);
            LanguageAPI.Add(desctoken, Language.GetString(oldDef.skillDescriptionToken) + "\n<color=#d299ff>SCEPTER: Fires quick bursts of five extra projectiles for 2.5x TOTAL damage.</color>");

            myDef.skillName             = namestr;
            myDef.skillNameToken        = nametoken;
            myDef.skillDescriptionToken = desctoken;
            myDef.icon = Resources.Load <Sprite>("@ClassicItems:Assets/ClassicItems/icons/scepter/huntress_ballistaicon.png");

            LoadoutAPI.AddSkillDef(myDef);

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

            myCtxDef = CloneSkillDef(oldCtxDef);

            myCtxDef.skillName             = namestr;
            myCtxDef.skillNameToken        = nametoken;
            myCtxDef.skillDescriptionToken = desctoken;
            myCtxDef.icon = Resources.Load <Sprite>("@ClassicItems:Assets/ClassicItems/icons/scepter/huntress_ballistaicon.png");

            LoadoutAPI.AddSkillDef(myCtxDef);
        }
Пример #18
0
        private static void SpecialSetup()
        {
            SkillLocator component = WispSurvivor.characterPrefab.GetComponent <SkillLocator>();

            LanguageAPI.Add("EXAMPLESURVIVOR_SPECIAL_BURST_NAME", "Burst");
            LanguageAPI.Add("EXAMPLESURVIVOR_SPECIAL_BURST_DESCRIPTION", "Shatter your barrier for <style=cIsDamage>700-800%</style> damage. " +
                            "If tethered, duplicate explosion on target.");

            // set up your primary skill def here!

            SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();

            mySkillDef.activationState            = new SerializableEntityStateType(typeof(EntityStates.WispSurvivorStates.WispBurst));
            mySkillDef.activationStateMachineName = "Weapon";
            mySkillDef.baseMaxStock                 = 1;
            mySkillDef.baseRechargeInterval         = 7f;
            mySkillDef.beginSkillCooldownOnSkillEnd = true;
            mySkillDef.canceledFromSprinting        = false;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.Skill;
            mySkillDef.isBullets             = false;
            mySkillDef.isCombatSkill         = true;
            mySkillDef.mustKeyPress          = true;
            mySkillDef.noSprint              = false;
            mySkillDef.rechargeStock         = 1;
            mySkillDef.requiredStock         = 1;
            mySkillDef.shootDelay            = 1f;
            mySkillDef.stockToConsume        = 1;
            mySkillDef.icon                  = Assets.icon4;
            mySkillDef.skillDescriptionToken = "EXAMPLESURVIVOR_SPECIAL_BURST_DESCRIPTION";
            mySkillDef.skillName             = "EXAMPLESURVIVOR_SPECIAL_BURST_NAME";
            mySkillDef.skillNameToken        = "EXAMPLESURVIVOR_SPECIAL_BURST_NAME";

            LoadoutAPI.AddSkillDef(mySkillDef);
            component.special = WispSurvivor.characterPrefab.AddComponent <GenericSkill>();
            SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>();

            newFamily.variants = new SkillFamily.Variant[1];
            LoadoutAPI.AddSkillFamily(newFamily);
            component.special.SetFieldValue("_skillFamily", newFamily);
            SkillFamily skillFamily = component.special.skillFamily;

            skillFamily.variants[0] = new SkillFamily.Variant
            {
                skillDef       = mySkillDef,
                unlockableName = "",
                viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
            };


            // add this code after defining a new skilldef if you're adding an alternate skill

            /*Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
             * skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
             * {
             *  skillDef = newSkillDef,
             *  unlockableName = "",
             *  viewableNode = new ViewablesCatalog.Node(newSkillDef.skillNameToken, false, null)
             * };*/
        }
Пример #19
0
        internal static void SetupAttributes()
        {
            var oldDef = Resources.Load <SkillDef>("skilldefs/commandobody/ThrowGrenade");

            myDef = CloneSkillDef(oldDef);

            var nametoken = "CLASSICITEMS_SCEPCOMMANDO_GRENADENAME";
            var desctoken = "CLASSICITEMS_SCEPCOMMANDO_GRENADEDESC";
            var namestr   = "Carpet Bomb";

            LanguageAPI.Add(nametoken, namestr);
            LanguageAPI.Add(desctoken, Language.GetString(oldDef.skillDescriptionToken) + "\n<color=#d299ff>SCEPTER: Half damage and knockback; throw eight at once.</color>");

            myDef.skillName             = namestr;
            myDef.skillNameToken        = nametoken;
            myDef.skillDescriptionToken = desctoken;
            myDef.icon = Resources.Load <Sprite>("@ClassicItems:Assets/ClassicItems/icons/scepter/commando_grenadeicon.png");

            LoadoutAPI.AddSkillDef(myDef);

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

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

            ProjectileCatalog.getAdditionalEntries += (list) => list.Add(projReplacer);
        }
Пример #20
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");
            }
        }
Пример #21
0
 public void AddLanguage(TokenValue tv)
 {
     if (tv.Token != null && tv.Token != "")
     {
         LanguageAPI.Add(tv.Token, tv.Value);
     }
 }
Пример #22
0
        public static void YellowAspectDef(EquipmentDef OriginalAspect, string[] NewLanguageTokens)
        {
            LanguageAPI.Add(OriginalAspect.ToString().ToUpper() + "_NAME", NewLanguageTokens[0]);
            LanguageAPI.Add(OriginalAspect.ToString().ToUpper() + "_PICKUP", NewLanguageTokens[1]);
            LanguageAPI.Add(OriginalAspect.ToString().ToUpper() + "_DESC", NewLanguageTokens[2]);
            LanguageAPI.Add(OriginalAspect.ToString().ToUpper() + "_LORE", NewLanguageTokens[3]);

            if (OriginalAspect != null)
            {
                ItemDef itemDef = ScriptableObject.CreateInstance <ItemDef>();
                itemDef.name = OriginalAspect.name;
                itemDef.tier = AspectsTier.Value;
                itemDef.pickupModelPrefab = OriginalAspect.pickupModelPrefab;
                itemDef.pickupIconSprite  = OriginalAspect.pickupIconSprite;
                itemDef.nameToken         = OriginalAspect.ToString().ToUpper() + "_NAME";
                itemDef.pickupToken       = OriginalAspect.ToString().ToUpper() + "_PICKUP";
                itemDef.descriptionToken  = OriginalAspect.ToString().ToUpper() + "_DESC";
                itemDef.loreToken         = OriginalAspect.ToString().ToUpper() + "_LORE";
                itemDef.tags = new ItemTag[]
                {
                    ItemTag.Utility,
                    WorldUniqueConfig.Value ? ItemTag.Any : ItemTag.WorldUnique
                };
                NewDefsList.Add(itemDef);
                OldDefsList.Add(OriginalAspect);
            }
        }
Пример #23
0
        public override void SetupConfig()
        {
            base.SetupConfig();
            var netOrchPrefabPrefab = new GameObject("TILER2NetConfigOrchestratorPrefabPrefab");

            netOrchPrefabPrefab.AddComponent <NetworkIdentity>();
            NetConfig.netOrchPrefab = netOrchPrefabPrefab.InstantiateClone("TILER2NetConfigOrchestratorPrefab", true);
            NetConfig.netOrchPrefab.AddComponent <NetConfigOrchestrator>();

            On.RoR2.Networking.GameNetworkManager.OnServerAddPlayerInternal += (orig, self, conn, pcid, extraMsg) => {
                orig(self, conn, pcid, extraMsg);
                if (!enableCheck || Util.ConnectionIsLocal(conn) || NetConfigOrchestrator.checkedConnections.Contains(conn))
                {
                    return;
                }
                NetConfigOrchestrator.checkedConnections.Add(conn);
                NetConfig.EnsureOrchestrator();
                NetConfigOrchestrator.AICSyncAllToOne(conn);
            };

            /*On.RoR2.Run.EndStage += (orig, self) => {
             *  orig(self);
             *  AutoItemConfig.CleanupDirty(false);
             * };*/

            LanguageAPI.Add("TILER2_KICKREASON_NCCRITMISMATCH", "TILER2 NetConfig: unable to resolve some config mismatches.\nSome settings must be synced, but cannot be changed while the game is running. Please check your console window for details.");
            LanguageAPI.Add("TILER2_KICKREASON_NCTIMEOUT", "TILER2 NetConfig: mismatch check timed out.\nThis may be caused by a mod version mismatch, a network outage, or an error while applying changes.\nIf seeking support for this issue, please make sure to have FULL CONSOLE LOGS from BOTH CLIENT AND SERVER ready to post.");
            LanguageAPI.Add("TILER2_KICKREASON_NCMISSINGENTRY", "TILER2 NetConfig: mismatch check found missing config entries.\nYou are likely using a different version of a mod than the server.");
            LanguageAPI.Add("TILER2_DISABLED_ARTIFACT", "This artifact is <color=#ff7777>force-disabled</color>; it will have no effect ingame.");
        }
Пример #24
0
        private static void LeechAsEquip()
        {
            LanguageAPI.Add("MASSIVELEECH_NAME_TOKEN", "Massive Leech");
            LanguageAPI.Add("MASSIVELEECH_PICKUP_TOKEN", "Grant massive life on hit for 10 seconds.Heal will increase with your level up.");
            LanguageAPI.Add("MASSIVELEECH_DESCRIPTION_TOKEN", "For 10 seconds, every hit <style=cIsHealing>heals</style> you for <style=cIsHealing>10 health</style>. Each level will gain <style=cIsHealing>1 extra health</style>.");
            LanguageAPI.Add("MASSIVELEECH_LORE_TOKEN", @"- Shipping Method:  Volatile
- Order Details:  Giant leeches found in the pools of HYPERION-5. Very similar to its counterpart on Earth, but it seems to have developed teeth as well, allowing it to eat meat as well as siphon blood. A few have been spotted to ballon to enormous proportions,up to the size of a small dog. Like the common leech, this has obvious medical implications. You will just have to be extra careful, or you may come back to no patient and a giant bloody leech.
");
            LanguageAPI.Add("MASSIVELEECH_NAME_TOKEN", "庞大水蛭", "zh-CN");
            LanguageAPI.Add("MASSIVELEECH_PICKUP_TOKEN", "在10秒内,攻击汲取巨额生命。吸血值随等级上涨。", "zh-CN");
            LanguageAPI.Add("MASSIVELEECH_DESCRIPTION_TOKEN", "10秒内,每次攻击<style=cIsHealing>回复10点生命值</style>。人物每提升一级,就额外获得<style=cIsHealing>1点生命值</style>。", "zh-CN");
            LanguageAPI.Add("MASSIVELEECH_LORE_TOKEN", @"- 邮寄方式:易挥发
- 订单详细信息:在HYPERION-5的水池中发现了巨型水蛭。 它与地球上的对应物非常相似,但它似乎也有牙齿,可以吃肉和虹吸血。已经发现他们可以按比例放大,甚至可以达到狗的大小。 像普通的水蛭一样,这也具有明显的医学含义。 您只需要格外小心。
", "zh-CN");

            EquipmentDef LeechEquipmentDef = new EquipmentDef
            {
                name             = "MASSIVELEECH_NAME_TOKEN",
                cooldown         = 45f,
                pickupModelPath  = PrefabPath,
                pickupIconPath   = IconPath,
                nameToken        = "MASSIVELEECH_NAME_TOKEN",
                pickupToken      = "MASSIVELEECH_PICKUP_TOKEN",
                descriptionToken = "MASSIVELEECH_DESCRIPTION_TOKEN",
                loreToken        = "MASSIVELEECH_LORE_TOKEN",
                canDrop          = true,
                enigmaCompatible = true
            };

            ItemDisplayRule[] LeechDisplayRules = null;
            CustomEquipment   LeechEquipment    = new CustomEquipment(LeechEquipmentDef, LeechDisplayRules);

            MassiveLeechIndex = ItemAPI.Add(LeechEquipment);
        }
Пример #25
0
        private static void SetupLanguage()
        {
            Main._logger.LogMessage($"Setting up language with {langTokenValues.Count} tokens.");
            foreach (var langTokenValue in langTokenValues)
            {
                var newString = FormatToken(langTokenValue.token, langTokenValue.lang, langTokenValue.strings);
                LanguageAPI.Add(langTokenValue.token, newString, langTokenValue.lang);

/*
 *              try
 *              {
 *
 *              }catch
 *              {
 *                  Main._logger.LogError($"Failed setting up token \"{langTokenValue.token}\" for language {langTokenValue.lang}." +
 *                      $"\nFollowing parameters where given:");
 *                  foreach (var str in langTokenValue.strings)
 *                  {
 *                      Main._logger.LogMessage(str);
 *                  }
 *              }*/
                /*if (langTokenValue.lang == "en")
                 * {
                 *  Main._logger.LogMessage($"{langTokenValue.token} {newString}");
                 * }*/
            }
        }
Пример #26
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);
        }
        internal override void SetupAttributes()
        {
            var oldDef = Resources.Load <SkillDef>("skilldefs/loaderbody/ChargeZapFist");

            myDef = CloneSkillDef(oldDef);

            var nametoken = "CLASSICITEMS_SCEPLOADER_CHARGEZAPFISTNAME";

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

            LanguageAPI.Add(nametoken, namestr);

            myDef.skillName             = namestr;
            myDef.skillNameToken        = nametoken;
            myDef.skillDescriptionToken = newDescToken;
            myDef.icon = Resources.Load <Sprite>("@ClassicItems:Assets/ClassicItems/icons/scepter/loader_chargezapfisticon.png");

            LoadoutAPI.AddSkillDef(myDef);

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

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

            ProjectileCatalog.getAdditionalEntries += (list) => list.Add(projReplacer);
        }
        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);
        }
Пример #29
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);
        }
Пример #30
0
        private static void ToughTimesAsItem()
        {
            LanguageAPI.Add("TOUGHTIMES_NAME_TOKEN", "Tough Times");
            LanguageAPI.Add("TOUGHTIMES_PICKUP_TOKEN", "Add Armor to reduce incoming damage.");
            LanguageAPI.Add("TOUGHTIMES_DESCRIPTION_TOKEN", "<style=cIsHealing>Increase armor</style> by <style=cIsHealing>14</style> <style=cStack>(+14 per stack)</style>.");
            LanguageAPI.Add("TOUGHTIMES_LORE_TOKEN", "- Order Details:\"Bears are just about the only toy that can lose just about everything and still maintain their dignity and worth.\" \r\n- Samantha Armstrong.Don't forget, hon. I'm coming home soon.Stay strong.");
            LanguageAPI.Add("TOUGHTIMES_NAME_TOKEN", "艰难时光", "zh-CN");
            LanguageAPI.Add("TOUGHTIMES_PICKUP_TOKEN", "提高自身护甲", "zh-CN");
            LanguageAPI.Add("TOUGHTIMES_DESCRIPTION_TOKEN", "<style=cIsHealing>提高护甲14点</style><style=cStack>(每层增加14点)</style>。", "zh-CN");
            LanguageAPI.Add("TOUGHTIMES_LORE_TOKEN", "-商品细节:“熊是唯一可以失去几乎所有东西并仍然保持其尊严和价值的玩具”。\r\n-萨曼莎·阿姆斯特朗:别忘了,亲爱的。我很快就要回家了。", "zh-CN");

            ItemDef ToughTimesDef = new ItemDef
            {
                name             = "TOUGHTIMES_NAME_TOKEN",
                pickupIconPath   = IconPath,
                pickupModelPath  = PrefabPath,
                nameToken        = "TOUGHTIMES_NAME_TOKEN",
                pickupToken      = "TOUGHTIMES_PICKUP_TOKEN",
                descriptionToken = "TOUGHTIMES_DESCRIPTION_TOKEN",
                loreToken        = "TOUGHTIMES_LORE_TOKEN",
                tier             = ItemTier.Tier2,
                tags             = new ItemTag[]
                {
                    ItemTag.Utility
                }
            };

            ItemDisplayRule[] DisplayRules   = null;
            CustomItem        ToughTimesItem = new CustomItem(ToughTimesDef, DisplayRules);

            ToughTimesItemIndex = ItemAPI.Add(ToughTimesItem);
        }