Esempio n. 1
0
        private static void BuffsSetup()
        {
            SkillLocator component = WispSurvivor.characterPrefab.GetComponent <SkillLocator>();

            #region hasteslow
            LanguageAPI.Add("WISP_HASTE_NAME", "Haste");
            LanguageAPI.Add("WISP_HASTE_DESCRIPTION", "Increase attack and movespeed by <style=cIsUtility>150%</style>. Duplicate effect on <style=cIsHealing>partner</style>. Reduce " +
                            "attack and movespeed of <style=cIsHealing>tethered</style> enemies.");

            // set up your primary skill def here!

            SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
            mySkillDef.activationState            = new SerializableEntityStateType(typeof(EntityStates.WispSurvivorStates.WispHasteSkillState));
            mySkillDef.activationStateMachineName = "Weapon";
            mySkillDef.baseMaxStock                 = 1;
            mySkillDef.baseRechargeInterval         = 9f;
            mySkillDef.beginSkillCooldownOnSkillEnd = true;
            mySkillDef.canceledFromSprinting        = false;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.Skill;
            mySkillDef.isBullets             = false;
            mySkillDef.isCombatSkill         = false;
            mySkillDef.mustKeyPress          = false;
            mySkillDef.noSprint              = false;
            mySkillDef.rechargeStock         = 1;
            mySkillDef.requiredStock         = 1;
            mySkillDef.shootDelay            = 0f;
            mySkillDef.stockToConsume        = 1;
            mySkillDef.icon                  = Assets.icon2;
            mySkillDef.skillDescriptionToken = "WISP_HASTE_DESCRIPTION";
            mySkillDef.skillName             = "WISP_HASTE_NAME";
            mySkillDef.skillNameToken        = "WISP_HASTE_NAME";

            LoadoutAPI.AddSkillDef(mySkillDef);
            hasteSkillDef       = mySkillDef;
            component.secondary = WispSurvivor.characterPrefab.AddComponent <GenericSkill>();

            SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>();
            newFamily.variants = new SkillFamily.Variant[1];
            LoadoutAPI.AddSkillFamily(newFamily);
            component.secondary.SetFieldValue("_skillFamily", newFamily);
            SkillFamily skillFamily = component.secondary.skillFamily;


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

            /*
             * // 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 = mySkillDef,
             *  unlockableName = "",
             *  viewableNode = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
             * };
             */

            #region invigorate
            LanguageAPI.Add("WISP_REGEN_NAME", "Invigorate");
            LanguageAPI.Add("WISP_REGEN_DESCRIPTION", "Increase healing rate and base damage. Duplicate effect on <style=cIsHealing>partner</style>. " +
                            "Deal <style=cIsDamage>100%</style> damage per second to <style=cIsHealing>tethered</style> enemies.");

            // set up your primary skill def here!

            SkillDef secondarySkillDef = ScriptableObject.CreateInstance <SkillDef>();
            secondarySkillDef.activationState            = new SerializableEntityStateType(typeof(EntityStates.WispSurvivorStates.WispInvigorateSkillState));
            secondarySkillDef.activationStateMachineName = "Weapon";
            secondarySkillDef.baseMaxStock                 = 1;
            secondarySkillDef.baseRechargeInterval         = 9f;
            secondarySkillDef.beginSkillCooldownOnSkillEnd = true;
            secondarySkillDef.canceledFromSprinting        = false;
            secondarySkillDef.fullRestockOnAssign          = true;
            secondarySkillDef.interruptPriority            = InterruptPriority.Skill;
            secondarySkillDef.isBullets             = false;
            secondarySkillDef.isCombatSkill         = false;
            secondarySkillDef.mustKeyPress          = false;
            secondarySkillDef.noSprint              = false;
            secondarySkillDef.rechargeStock         = 1;
            secondarySkillDef.requiredStock         = 1;
            secondarySkillDef.shootDelay            = 0f;
            secondarySkillDef.stockToConsume        = 1;
            secondarySkillDef.icon                  = Assets.icon2_invigorate;
            secondarySkillDef.skillDescriptionToken = "WISP_REGEN_DESCRIPTION";
            secondarySkillDef.skillName             = "WISP_REGEN_NAME";
            secondarySkillDef.skillNameToken        = "WISP_REGEN_NAME";

            invigorateSkillDef = secondarySkillDef;
            LoadoutAPI.AddSkillDef(secondarySkillDef);

            Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
            skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef       = secondarySkillDef,
                unlockableName = "",
                viewableNode   = new ViewablesCatalog.Node(secondarySkillDef.skillNameToken, false, null)
            };
            #endregion
        }
Esempio n. 2
0
        private void AssignSpecial(SkillLocator sk)
        {
            SkillFamily specialSkillFamily = ScriptableObject.CreateInstance <SkillFamily>();

            specialSkillFamily.defaultVariantIndex = 0u;
            specialSkillFamily.variants            = new SkillFamily.Variant[1];
            Reflection.SetFieldValue <SkillFamily>(sk.special, "_skillFamily", specialSkillFamily);

            SkillDef specialFlareDef = SkillDef.CreateInstance <SkillDef>();

            specialFlareDef.activationState            = new SerializableEntityStateType(typeof(Flaregun));
            specialFlareDef.activationStateMachineName = "Weapon";
            specialFlareDef.baseMaxStock                 = 1;
            specialFlareDef.baseRechargeInterval         = 10f;
            specialFlareDef.beginSkillCooldownOnSkillEnd = true;
            specialFlareDef.canceledFromSprinting        = false;
            specialFlareDef.dontAllowPastMaxStocks       = true;
            specialFlareDef.forceSprintDuringState       = false;
            specialFlareDef.fullRestockOnAssign          = true;
            specialFlareDef.icon = Resources.Load <Sprite>(assetPrefix + ":skill4.png");
            specialFlareDef.interruptPriority     = InterruptPriority.PrioritySkill;
            specialFlareDef.isBullets             = false;
            specialFlareDef.isCombatSkill         = true;
            specialFlareDef.keywordTokens         = new string[] { "KEYWORD_PYRO_HEAT" };
            specialFlareDef.mustKeyPress          = false;
            specialFlareDef.noSprint              = true;
            specialFlareDef.rechargeStock         = 1;
            specialFlareDef.requiredStock         = 1;
            specialFlareDef.shootDelay            = 0f;
            specialFlareDef.skillName             = "Flaregun";
            specialFlareDef.skillNameToken        = "PYRO_SPECIAL_NAME";
            specialFlareDef.skillDescriptionToken = "PYRO_SPECIAL_DESC";
            specialFlareDef.stockToConsume        = 1;
            LoadoutAPI.AddSkill(typeof(Flaregun));
            LoadoutAPI.AddSkillDef(specialFlareDef);
            specialSkillFamily.variants[0] = new SkillFamily.Variant
            {
                skillDef       = specialFlareDef,
                unlockableName = "",
                viewableNode   = new ViewablesCatalog.Node(specialFlareDef.skillNameToken, false)
            };

            SkillDef specialBlazeborneDef = SkillDef.CreateInstance <SkillDef>();

            specialBlazeborneDef.activationState            = new SerializableEntityStateType(typeof(Blazeborne));
            specialBlazeborneDef.activationStateMachineName = "Weapon";
            specialBlazeborneDef.baseMaxStock                 = 1;
            specialBlazeborneDef.baseRechargeInterval         = 10f;
            specialBlazeborneDef.beginSkillCooldownOnSkillEnd = true;
            specialBlazeborneDef.canceledFromSprinting        = false;
            specialBlazeborneDef.dontAllowPastMaxStocks       = true;
            specialBlazeborneDef.forceSprintDuringState       = false;
            specialBlazeborneDef.fullRestockOnAssign          = true;
            specialBlazeborneDef.icon = Resources.Load <Sprite>(assetPrefix + ":skill4.png");
            specialBlazeborneDef.interruptPriority     = InterruptPriority.PrioritySkill;
            specialBlazeborneDef.isBullets             = false;
            specialBlazeborneDef.isCombatSkill         = true;
            specialBlazeborneDef.keywordTokens         = new string[] { "KEYWORD_PYRO_HEAT" };
            specialBlazeborneDef.mustKeyPress          = false;
            specialBlazeborneDef.noSprint              = true;
            specialBlazeborneDef.rechargeStock         = 1;
            specialBlazeborneDef.requiredStock         = 1;
            specialBlazeborneDef.shootDelay            = 0f;
            specialBlazeborneDef.skillName             = "Blazeborne";
            specialBlazeborneDef.skillNameToken        = "PYRO_SPECIAL_ALT_NAME";
            specialBlazeborneDef.skillDescriptionToken = "PYRO_SPECIAL_ALT_DESC";
            specialBlazeborneDef.stockToConsume        = 1;
            LoadoutAPI.AddSkill(typeof(Blazeborne));
            LoadoutAPI.AddSkillDef(specialBlazeborneDef);
            Array.Resize(ref specialSkillFamily.variants, specialSkillFamily.variants.Length + 1);
            specialSkillFamily.variants[specialSkillFamily.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef       = specialBlazeborneDef,
                unlockableName = "",
                viewableNode   = new ViewablesCatalog.Node(specialBlazeborneDef.skillNameToken, false)
            };

            //Unused
            LoadoutAPI.AddSkill(typeof(PrepFlare));
            LoadoutAPI.AddSkill(typeof(FireFlareBurst));
        }
Esempio n. 3
0
        internal static void SpecialSetup()
        {
            SkillLocator component = Templar.myCharacter.GetComponent <SkillLocator>();
            SkillDef     skillDef  = SkillDef.CreateInstance <SkillDef>();

            skillDef.activationState            = new SerializableEntityStateType(typeof(TemplarChargeRocket));
            skillDef.activationStateMachineName = "Weapon";
            skillDef.baseMaxStock                 = Templar.bazookaStock.Value;
            skillDef.baseRechargeInterval         = Templar.bazookaCooldown.Value;
            skillDef.beginSkillCooldownOnSkillEnd = true;
            skillDef.canceledFromSprinting        = false;
            skillDef.cancelSprintingOnActivation  = true;
            skillDef.fullRestockOnAssign          = true;
            skillDef.interruptPriority            = InterruptPriority.PrioritySkill;
            skillDef.isCombatSkill                = true;
            skillDef.mustKeyPress                 = true;
            skillDef.rechargeStock                = 1;
            skillDef.requiredStock                = 1;
            skillDef.stockToConsume               = 1;
            skillDef.icon = Assets.icon4;
            skillDef.skillDescriptionToken = "TEMPLAR_SPECIAL_FIRE_DESCRIPTION";
            skillDef.skillName             = "TEMPLAR_SPECIAL_FIRE_NAME";
            skillDef.skillNameToken        = "TEMPLAR_SPECIAL_FIRE_NAME";
            skillDef.keywordTokens         = new string[]
            {
                "KEYWORD_EXPLOSIVE"
            };


            component.special = Templar.myCharacter.AddComponent <GenericSkill>();
            SkillFamily skillFamily = ScriptableObject.CreateInstance <SkillFamily>();

            skillFamily.variants = new SkillFamily.Variant[1];

            component.special.SetFieldValue("_skillFamily", skillFamily);
            SkillFamily skillFamily2 = component.special.skillFamily;

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

            SkillDef skillDef2 = SkillDef.CreateInstance <SkillDef>();

            skillDef2.activationState            = new SerializableEntityStateType(typeof(TemplarSwapWeapon));
            skillDef2.activationStateMachineName = "Weapon";
            skillDef2.baseMaxStock                 = 1;
            skillDef2.baseRechargeInterval         = 0.1f;
            skillDef2.beginSkillCooldownOnSkillEnd = true;
            skillDef2.canceledFromSprinting        = false;
            skillDef2.cancelSprintingOnActivation  = true;
            skillDef2.fullRestockOnAssign          = true;
            skillDef2.interruptPriority            = InterruptPriority.PrioritySkill;
            skillDef2.isCombatSkill                = false;
            skillDef2.mustKeyPress                 = false;
            skillDef2.rechargeStock                = 1;
            skillDef2.requiredStock                = 1;
            skillDef2.stockToConsume               = 1;
            skillDef2.icon = Assets.icon4b;
            skillDef2.skillDescriptionToken = "TEMPLAR_SPECIAL_SWAP_DESCRIPTION";
            skillDef2.skillName             = "TEMPLAR_SPECIAL_SWAP_NAME";
            skillDef2.skillNameToken        = "TEMPLAR_SPECIAL_SWAP_NAME";

            Array.Resize <SkillFamily.Variant>(ref skillFamily2.variants, skillFamily2.variants.Length + 1);
            skillFamily2.variants[skillFamily2.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef     = skillDef2,
                viewableNode = new ViewablesCatalog.Node(skillDef2.skillNameToken, false, null)
            };

            Loader.entityStates.Add(typeof(TemplarChargeRocket));
            Loader.entityStates.Add(typeof(TemplarSwapWeapon));

            Loader.skillDefs.Add(skillDef);
            Loader.skillDefs.Add(skillDef2);
        }
Esempio n. 4
0
        internal static void UtilitySetup()
        {
            UtilityStateMachineSetup();

            SkillLocator component = characterPrefab.GetComponent <SkillLocator>();

            LanguageAPI.Add("ROCKETEER_UTILITY_JET_NAME", "Jet");
            LanguageAPI.Add("ROCKETEER_UTILITY_JET_DESCRIPTION", "They fly now. Activate again for a small secondary burst.");

            // set up your primary skill def here!

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

            mySkillDef.activationState            = new SerializableEntityStateType(typeof(RocketeerJet));
            mySkillDef.activationStateMachineName = "ROCKETEER_Utility";
            mySkillDef.baseMaxStock                 = 1;
            mySkillDef.baseRechargeInterval         = 6.0f;
            mySkillDef.beginSkillCooldownOnSkillEnd = false;
            mySkillDef.canceledFromSprinting        = false;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.PrioritySkill;
            mySkillDef.isCombatSkill                = true;
            mySkillDef.mustKeyPress                 = false;
            mySkillDef.rechargeStock                = 1;
            mySkillDef.requiredStock                = 1;
            mySkillDef.stockToConsume               = 1;
            mySkillDef.icon = Resources.Load <Sprite>("Textures/MiscIcons/texMysteryIcon");
            mySkillDef.skillDescriptionToken = "ROCKETEER_UTILITY_JET_DESCRIPTION";
            mySkillDef.skillName             = "ROCKETEER_UTILITY_JET_NAME";
            mySkillDef.skillNameToken        = "ROCKETEER_UTILITY_JET_NAME";

            LoadoutAPI.AddSkillDef(mySkillDef);

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

            newFamily.variants = new SkillFamily.Variant[1];
            LoadoutAPI.AddSkillFamily(newFamily);
            component.utility.SetFieldValue("_skillFamily", newFamily);
            SkillFamily skillFamily = component.utility.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)
             * };*/


            ContentPacks.skillDefs.Add(mySkillDef);
            ContentPacks.skillFamilies.Add(newFamily);

            LoadoutAPI.AddSkill(typeof(RocketeerJet));
        }
Esempio n. 5
0
        private static void SecondarySetup(GameObject bodyPrefab)
        {
            SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();

            mySkillDef.activationState            = new SerializableEntityStateType(typeof(PaladinMod.States.SpinSlashEntry));
            mySkillDef.activationStateMachineName = "Weapon";
            mySkillDef.baseMaxStock                 = 1;
            mySkillDef.baseRechargeInterval         = 6f;
            mySkillDef.beginSkillCooldownOnSkillEnd = true;
            mySkillDef.canceledFromSprinting        = false;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.Skill;
            mySkillDef.isBullets             = false;
            mySkillDef.isCombatSkill         = true;
            mySkillDef.mustKeyPress          = false;
            mySkillDef.noSprint              = true;
            mySkillDef.rechargeStock         = 1;
            mySkillDef.requiredStock         = 1;
            mySkillDef.shootDelay            = 0.5f;
            mySkillDef.stockToConsume        = 1;
            mySkillDef.icon                  = Assets.icon2;
            mySkillDef.skillDescriptionToken = "PALADIN_SECONDARY_SPINSLASH_DESCRIPTION";
            mySkillDef.skillName             = "PALADIN_SECONDARY_SPINSLASH_NAME";
            mySkillDef.skillNameToken        = "PALADIN_SECONDARY_SPINSLASH_NAME";
            mySkillDef.keywordTokens         = new string[] {
                "KEYWORD_STUNNING",
            };

            LoadoutAPI.AddSkillDef(mySkillDef);

            skillLocator.secondary = bodyPrefab.AddComponent <GenericSkill>();
            SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>();

            newFamily.variants = new SkillFamily.Variant[1];
            LoadoutAPI.AddSkillFamily(newFamily);
            skillLocator.secondary._skillFamily = newFamily;
            SkillFamily skillFamily = skillLocator.secondary.skillFamily;

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

            mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
            mySkillDef.activationState            = new SerializableEntityStateType(typeof(PaladinMod.States.ChargeLightningSpear));
            mySkillDef.activationStateMachineName = "Weapon";
            mySkillDef.baseMaxStock                 = 1;
            mySkillDef.baseRechargeInterval         = 6f;
            mySkillDef.beginSkillCooldownOnSkillEnd = true;
            mySkillDef.canceledFromSprinting        = false;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.Skill;
            mySkillDef.isBullets             = false;
            mySkillDef.isCombatSkill         = true;
            mySkillDef.mustKeyPress          = false;
            mySkillDef.noSprint              = false;
            mySkillDef.rechargeStock         = 1;
            mySkillDef.requiredStock         = 1;
            mySkillDef.shootDelay            = 0.5f;
            mySkillDef.stockToConsume        = 1;
            mySkillDef.icon                  = Assets.icon2b;
            mySkillDef.skillDescriptionToken = "PALADIN_SECONDARY_LIGHTNING_DESCRIPTION";
            mySkillDef.skillName             = "PALADIN_SECONDARY_LIGHTNING_NAME";
            mySkillDef.skillNameToken        = "PALADIN_SECONDARY_LIGHTNING_NAME";
            mySkillDef.keywordTokens         = new string[] {
                "KEYWORD_SHOCKING",
                "KEYWORD_AGILE"
            };

            LoadoutAPI.AddSkillDef(mySkillDef);

            Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
            skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef       = mySkillDef,
                unlockableName = "",//PALADIN_LIGHTNINGSPEARUNLOCKABLE_REWARD_ID
                viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
            };

            mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
            mySkillDef.activationState            = new SerializableEntityStateType(typeof(PaladinMod.States.LunarShards));
            mySkillDef.activationStateMachineName = "Weapon";
            mySkillDef.baseMaxStock                 = StaticValues.lunarShardMaxStock;
            mySkillDef.baseRechargeInterval         = 0.75f;
            mySkillDef.beginSkillCooldownOnSkillEnd = true;
            mySkillDef.canceledFromSprinting        = false;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.Any;
            mySkillDef.isBullets             = false;
            mySkillDef.isCombatSkill         = true;
            mySkillDef.mustKeyPress          = false;
            mySkillDef.noSprint              = false;
            mySkillDef.rechargeStock         = 1;
            mySkillDef.requiredStock         = 1;
            mySkillDef.shootDelay            = 0.5f;
            mySkillDef.stockToConsume        = 1;
            mySkillDef.icon                  = Assets.icon2c;
            mySkillDef.skillDescriptionToken = "PALADIN_SECONDARY_LUNARSHARD_DESCRIPTION";
            mySkillDef.skillName             = "PALADIN_SECONDARY_LUNARSHARD_NAME";
            mySkillDef.skillNameToken        = "PALADIN_SECONDARY_LUNARSHARD_NAME";
            mySkillDef.keywordTokens         = new string[] {
                "KEYWORD_AGILE"
            };

            LoadoutAPI.AddSkillDef(mySkillDef);

            Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
            skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef       = mySkillDef,
                unlockableName = "PALADIN_LUNARSHARDUNLOCKABLE_REWARD_ID",
                viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
            };
        }
Esempio n. 6
0
        internal static void SecondarySetup()
        {
            SkillLocator component = Templar.myCharacter.GetComponent <SkillLocator>();
            SkillDef     skillDef  = SkillDef.CreateInstance <SkillDef>();

            skillDef.activationState            = new SerializableEntityStateType(typeof(TemplarThrowClaybomb));
            skillDef.activationStateMachineName = "Weapon";
            skillDef.baseMaxStock                 = Templar.clayGrenadeStock.Value;
            skillDef.baseRechargeInterval         = Templar.clayGrenadeCooldown.Value;
            skillDef.beginSkillCooldownOnSkillEnd = false;
            skillDef.canceledFromSprinting        = false;
            skillDef.cancelSprintingOnActivation  = true;
            skillDef.fullRestockOnAssign          = true;
            skillDef.interruptPriority            = InterruptPriority.Skill;
            skillDef.isCombatSkill                = true;
            skillDef.mustKeyPress                 = true;
            skillDef.rechargeStock                = 1;
            skillDef.requiredStock                = 1;
            skillDef.stockToConsume               = 1;
            skillDef.icon = Assets.icon2;
            skillDef.skillDescriptionToken = "TEMPLAR_SECONDARY_GRENADE_DESCRIPTION";
            skillDef.skillName             = "TEMPLAR_SECONDARY_GRENADE_NAME";
            skillDef.skillNameToken        = "TEMPLAR_SECONDARY_GRENADE_NAME";

            component.secondary = Templar.myCharacter.AddComponent <GenericSkill>();
            SkillFamily skillFamily = ScriptableObject.CreateInstance <SkillFamily>();

            skillFamily.variants = new SkillFamily.Variant[1];

            component.secondary.SetFieldValue("_skillFamily", skillFamily);
            SkillFamily skillFamily2 = component.secondary.skillFamily;

            skillFamily2.variants[0] = new SkillFamily.Variant
            {
                skillDef     = skillDef,
                viewableNode = new ViewablesCatalog.Node(skillDef.skillNameToken, false, null)
            };
            SkillDef skillDef2 = SkillDef.CreateInstance <SkillDef>();

            skillDef2.activationState            = new SerializableEntityStateType(typeof(TemplarShotgun));
            skillDef2.activationStateMachineName = "Weapon";
            skillDef2.baseMaxStock                 = Templar.blunderbussStock.Value;
            skillDef2.baseRechargeInterval         = Templar.blunderbussCooldown.Value;
            skillDef2.beginSkillCooldownOnSkillEnd = false;
            skillDef2.canceledFromSprinting        = false;
            skillDef2.cancelSprintingOnActivation  = true;
            skillDef2.fullRestockOnAssign          = true;
            skillDef2.interruptPriority            = InterruptPriority.Skill;
            skillDef2.isCombatSkill                = true;
            skillDef2.mustKeyPress                 = true;
            skillDef2.rechargeStock                = 1;
            skillDef2.requiredStock                = 1;
            skillDef2.stockToConsume               = 1;
            skillDef2.icon = Assets.icon2b;
            skillDef2.skillDescriptionToken = "TEMPLAR_SECONDARY_SHOTGUN_DESCRIPTION";
            skillDef2.skillName             = "TEMPLAR_SECONDARY_SHOTGUN_NAME";
            skillDef2.skillNameToken        = "TEMPLAR_SECONDARY_SHOTGUN_NAME";

            Array.Resize <SkillFamily.Variant>(ref skillFamily2.variants, skillFamily2.variants.Length + 1);
            skillFamily2.variants[skillFamily2.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef     = skillDef2,
                viewableNode = new ViewablesCatalog.Node(skillDef2.skillNameToken, false, null)
            };

            Loader.entityStates.Add(typeof(TemplarThrowClaybomb));
            Loader.entityStates.Add(typeof(TemplarShotgun));

            Loader.skillDefs.Add(skillDef);
            Loader.skillDefs.Add(skillDef2);
        }
Esempio n. 7
0
 public virtual void CreateSpecial(SkillLocator skillLocator, SkillFamily skillFamily)
 {
 }
Esempio n. 8
0
        private static void UtilitySetup(GameObject bodyPrefab)
        {
            SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();

            mySkillDef.activationState            = new SerializableEntityStateType(typeof(PaladinMod.States.Quickstep.QuickstepSimple));
            mySkillDef.activationStateMachineName = "Weapon";
            mySkillDef.baseMaxStock                 = 2;
            mySkillDef.baseRechargeInterval         = 10f;
            mySkillDef.beginSkillCooldownOnSkillEnd = true;
            mySkillDef.canceledFromSprinting        = false;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.PrioritySkill;
            mySkillDef.isBullets              = false;
            mySkillDef.isCombatSkill          = false;
            mySkillDef.mustKeyPress           = false;
            mySkillDef.noSprint               = false;
            mySkillDef.forceSprintDuringState = true;
            mySkillDef.rechargeStock          = 1;
            mySkillDef.requiredStock          = 1;
            mySkillDef.shootDelay             = 0.5f;
            mySkillDef.stockToConsume         = 1;
            mySkillDef.icon = Assets.icon3;
            mySkillDef.skillDescriptionToken = "PALADIN_UTILITY_DASH_DESCRIPTION";
            mySkillDef.skillName             = "PALADIN_UTILITY_DASH_NAME";
            mySkillDef.skillNameToken        = "PALADIN_UTILITY_DASH_NAME";

            LoadoutAPI.AddSkillDef(mySkillDef);

            skillLocator.utility = bodyPrefab.AddComponent <GenericSkill>();
            SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>();

            newFamily.variants = new SkillFamily.Variant[1];
            LoadoutAPI.AddSkillFamily(newFamily);
            skillLocator.utility._skillFamily = newFamily;
            SkillFamily skillFamily = skillLocator.utility.skillFamily;

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

            mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
            mySkillDef.activationState            = new SerializableEntityStateType(typeof(PaladinMod.States.AimHeal));
            mySkillDef.activationStateMachineName = "Weapon";
            mySkillDef.baseMaxStock                 = 1;
            mySkillDef.baseRechargeInterval         = 8;
            mySkillDef.beginSkillCooldownOnSkillEnd = true;
            mySkillDef.canceledFromSprinting        = false;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.Skill;
            mySkillDef.isBullets             = false;
            mySkillDef.isCombatSkill         = true;
            mySkillDef.mustKeyPress          = false;
            mySkillDef.noSprint              = true;
            mySkillDef.rechargeStock         = 1;
            mySkillDef.requiredStock         = 1;
            mySkillDef.shootDelay            = 0.5f;
            mySkillDef.stockToConsume        = 1;
            mySkillDef.icon                  = Assets.icon3b;
            mySkillDef.skillDescriptionToken = "PALADIN_UTILITY_HEAL_DESCRIPTION";
            mySkillDef.skillName             = "PALADIN_UTILITY_HEAL_NAME";
            mySkillDef.skillNameToken        = "PALADIN_UTILITY_HEAL_NAME";

            LoadoutAPI.AddSkillDef(mySkillDef);

            Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
            skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef       = mySkillDef,
                unlockableName = "PALADIN_HEALUNLOCKABLE_REWARD_ID",
                viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
            };
        }
Esempio n. 9
0
 public virtual void CreateSecondary(SkillLocator skillLocator, SkillFamily skillFamily)
 {
 }
Esempio n. 10
0
 public virtual void CreateUtility(SkillLocator skillLocator, SkillFamily skillFamily)
 {
 }
Esempio n. 11
0
 public virtual void CreatePrimary(SkillLocator skillLocator, SkillFamily skillFamily)
 {
 }
Esempio n. 12
0
        public static void Setup()
        {
            On.RoR2.Orbs.LightningOrb.Begin += LightningOrb_Begin;
            #region huntress
            LoadoutAPI.AddSkill(typeof(VTStates.States.Huntress.JumpingArrow));
            {
                SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
                mySkillDef.activationState            = new SerializableEntityStateType(typeof(VTStates.States.Huntress.JumpingArrow));
                mySkillDef.activationStateMachineName = "Weapon";
                mySkillDef.baseMaxStock                 = 1;
                mySkillDef.baseRechargeInterval         = 0.5f;
                mySkillDef.beginSkillCooldownOnSkillEnd = false;
                mySkillDef.canceledFromSprinting        = false;
                mySkillDef.fullRestockOnAssign          = true;
                mySkillDef.interruptPriority            = InterruptPriority.Any;
                mySkillDef.isBullets      = true;
                mySkillDef.isCombatSkill  = true;
                mySkillDef.mustKeyPress   = false;
                mySkillDef.noSprint       = false;
                mySkillDef.rechargeStock  = 1;
                mySkillDef.requiredStock  = 1;
                mySkillDef.shootDelay     = 0f;
                mySkillDef.stockToConsume = 0;
                //mySkillDef.icon = Resources.Load<Sprite>()
                mySkillDef.skillDescriptionToken = "<style=cIsUtility>Agile</style>. Quickly fire a seeking arrow for <style=cIsDamage>100% damage</style>. It <style=cIsUtility>Bounces</style> twice";
                mySkillDef.skillName             = "EXPANDEDSKILLS_JUMPINGARROW_PRIMARY";
                mySkillDef.skillNameToken        = "Jumping Arrow";

                LoadoutAPI.AddSkillDef(mySkillDef);

                GameObject   gameObject  = Resources.Load <GameObject>("prefabs/characterbodies/huntressbody");
                SkillLocator component   = gameObject.GetComponent <SkillLocator>();
                SkillFamily  skillFamily = component.primary.skillFamily;

                Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);

                skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
                {
                    skillDef       = mySkillDef,
                    unlockableName = "",
                    viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
                };
            }
            LoadoutAPI.AddSkill(typeof(VTStates.States.Huntress.MultiArrow));
            {
                SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
                mySkillDef.activationState            = new SerializableEntityStateType(typeof(VTStates.States.Huntress.MultiArrow));
                mySkillDef.activationStateMachineName = "Weapon";
                mySkillDef.baseMaxStock                 = 3;
                mySkillDef.baseRechargeInterval         = 2f;
                mySkillDef.beginSkillCooldownOnSkillEnd = false;
                mySkillDef.canceledFromSprinting        = false;
                mySkillDef.fullRestockOnAssign          = true;
                mySkillDef.interruptPriority            = InterruptPriority.Any;
                mySkillDef.isBullets      = false;
                mySkillDef.isCombatSkill  = true;
                mySkillDef.mustKeyPress   = false;
                mySkillDef.noSprint       = false;
                mySkillDef.rechargeStock  = 1;
                mySkillDef.requiredStock  = 1;
                mySkillDef.shootDelay     = 0f;
                mySkillDef.stockToConsume = 0;
                //mySkillDef.icon = Resources.Load<Sprite>()
                mySkillDef.skillDescriptionToken = "Launch an arrow that deals <style=cIsDamage>75% damage</style> and bounces between up to <style=cIsDamage>2</style> times, <style=cIsUtility>Doubling Damage and splitting into two each time</style>";
                mySkillDef.skillName             = "EXPANDEDSKILLS_MULTIARROW_SECONDARY";
                mySkillDef.skillNameToken        = "Splinter Shot";

                LoadoutAPI.AddSkillDef(mySkillDef);

                GameObject   gameObject  = Resources.Load <GameObject>("prefabs/characterbodies/huntressbody");
                SkillLocator component   = gameObject.GetComponent <SkillLocator>();
                SkillFamily  skillFamily = component.secondary.skillFamily;

                Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);

                skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
                {
                    skillDef       = mySkillDef,
                    unlockableName = "",
                    viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
                };
            }
            LoadoutAPI.AddSkill(typeof(VTStates.States.Huntress.ChargedArrow));
            {
                SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
                mySkillDef.activationState            = new SerializableEntityStateType(typeof(VTStates.States.Huntress.ChargedArrow));
                mySkillDef.activationStateMachineName = "Weapon";
                mySkillDef.baseMaxStock                 = 4;
                mySkillDef.baseRechargeInterval         = 4f;
                mySkillDef.beginSkillCooldownOnSkillEnd = false;
                mySkillDef.canceledFromSprinting        = false;
                mySkillDef.fullRestockOnAssign          = true;
                mySkillDef.interruptPriority            = InterruptPriority.Any;
                mySkillDef.isBullets      = false;
                mySkillDef.isCombatSkill  = true;
                mySkillDef.mustKeyPress   = false;
                mySkillDef.noSprint       = false;
                mySkillDef.rechargeStock  = 1;
                mySkillDef.requiredStock  = 1;
                mySkillDef.shootDelay     = 0f;
                mySkillDef.stockToConsume = 0;
                //mySkillDef.icon = Resources.Load<Sprite>()
                mySkillDef.skillDescriptionToken = "Charge an arrow for up to <style=cIsDamage>600% damage</style> per stock.";
                mySkillDef.skillName             = "EXPANDEDSKILLS_CHARGED_SECONDARY";
                mySkillDef.skillNameToken        = "Charged Shot";

                LoadoutAPI.AddSkillDef(mySkillDef);

                GameObject   gameObject  = Resources.Load <GameObject>("prefabs/characterbodies/huntressbody");
                SkillLocator component   = gameObject.GetComponent <SkillLocator>();
                SkillFamily  skillFamily = component.secondary.skillFamily;

                Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);

                skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
                {
                    skillDef       = mySkillDef,
                    unlockableName = "",
                    viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
                };
            }
            #endregion huntress
        }
Esempio n. 13
0
        public static void Setup()
        {
            LoadoutAPI.AddSkill(typeof(VTStates.States.Mercenary.SummonManyAtPoint));
            {
                SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
                mySkillDef.activationState            = new SerializableEntityStateType(typeof(VTStates.States.Mercenary.SummonManyAtPoint));
                mySkillDef.activationStateMachineName = "Weapon";
                mySkillDef.baseMaxStock                 = 4;
                mySkillDef.baseRechargeInterval         = 25f;
                mySkillDef.beginSkillCooldownOnSkillEnd = false;
                mySkillDef.canceledFromSprinting        = false;
                mySkillDef.fullRestockOnAssign          = true;
                mySkillDef.interruptPriority            = InterruptPriority.Any;
                mySkillDef.isBullets      = false;
                mySkillDef.isCombatSkill  = true;
                mySkillDef.mustKeyPress   = true;
                mySkillDef.noSprint       = false;
                mySkillDef.rechargeStock  = 1;
                mySkillDef.requiredStock  = 1;
                mySkillDef.shootDelay     = 0f;
                mySkillDef.stockToConsume = 0;
                //mySkillDef.icon = Resources.Load<Sprite>()
                mySkillDef.skillDescriptionToken = "Summon a clone that <style=cIsUtility>inherits your items</style>.";
                mySkillDef.skillName             = "EXPANDEDSKILLS_SUMMONMANYCLONE_SPECIAL";
                mySkillDef.skillNameToken        = "Swarming Clones";

                LoadoutAPI.AddSkillDef(mySkillDef);

                GameObject   gameObject  = Resources.Load <GameObject>("prefabs/characterbodies/mercbody");
                SkillLocator component   = gameObject.GetComponent <SkillLocator>();
                SkillFamily  skillFamily = component.special.skillFamily;

                Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);

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

            LoadoutAPI.AddSkill(typeof(VTStates.States.Mercenary.SummonDistraction));
            {
                SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
                mySkillDef.activationState            = new SerializableEntityStateType(typeof(VTStates.States.Mercenary.SummonDistraction));
                mySkillDef.activationStateMachineName = "Weapon";
                mySkillDef.baseMaxStock                 = 1;
                mySkillDef.baseRechargeInterval         = 12f;
                mySkillDef.beginSkillCooldownOnSkillEnd = false;
                mySkillDef.canceledFromSprinting        = false;
                mySkillDef.fullRestockOnAssign          = true;
                mySkillDef.interruptPriority            = InterruptPriority.Any;
                mySkillDef.isBullets      = false;
                mySkillDef.isCombatSkill  = true;
                mySkillDef.mustKeyPress   = true;
                mySkillDef.noSprint       = false;
                mySkillDef.rechargeStock  = 1;
                mySkillDef.requiredStock  = 1;
                mySkillDef.shootDelay     = 0f;
                mySkillDef.stockToConsume = 0;
                //mySkillDef.icon = Resources.Load<Sprite>()
                mySkillDef.skillDescriptionToken = "Summon a <style=cIsUtility>Celestine</style> Mercenary and teleport away.";
                mySkillDef.skillName             = "EXPANDEDSKILLS_SUMMONDISTRACTION_UTILITY";
                mySkillDef.skillNameToken        = "Meatshield";

                LoadoutAPI.AddSkillDef(mySkillDef);

                GameObject   gameObject  = Resources.Load <GameObject>("prefabs/characterbodies/mercbody");
                SkillLocator component   = gameObject.GetComponent <SkillLocator>();
                SkillFamily  skillFamily = component.utility.skillFamily;

                Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);

                skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
                {
                    skillDef       = mySkillDef,
                    unlockableName = "",
                    viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
                };
            }
        }
Esempio n. 14
0
        void SpecialSkills()
        {
            {
                SkillLocator skillLocator = myCharacter.GetComponent <SkillLocator>();

                skillLocator.special = myCharacter.AddComponent <GenericSkill>();
                SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>();
                newFamily.variants = new SkillFamily.Variant[1];

                LoadoutAPI.AddSkillFamily(newFamily);
                skillLocator.special.SetFieldValue("_skillFamily", newFamily);
            }

            LoadoutAPI.AddSkill(typeof(DroneSummonBasic));
            {
                SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
                mySkillDef.activationState            = new SerializableEntityStateType(typeof(DroneSummonBasic));
                mySkillDef.activationStateMachineName = "WeaponGun";
                mySkillDef.baseMaxStock                 = 1;
                mySkillDef.baseRechargeInterval         = 16f;
                mySkillDef.beginSkillCooldownOnSkillEnd = false;
                mySkillDef.canceledFromSprinting        = false;
                mySkillDef.fullRestockOnAssign          = false;
                mySkillDef.interruptPriority            = InterruptPriority.PrioritySkill;
                mySkillDef.isBullets             = true;
                mySkillDef.isCombatSkill         = false;
                mySkillDef.mustKeyPress          = false;
                mySkillDef.noSprint              = true;
                mySkillDef.rechargeStock         = 1;
                mySkillDef.requiredStock         = 1;
                mySkillDef.shootDelay            = 0f;
                mySkillDef.stockToConsume        = 1;
                mySkillDef.icon                  = Resources.Load <GameObject>("Prefabs/CharacterBodies/drone1body").GetComponent <SkillLocator>().primary.skillFamily.variants[0].skillDef.icon;
                mySkillDef.skillDescriptionToken = "Summon two basic gunner drones that inherit all your items";
                mySkillDef.skillName             = "PP_PLAYABLETC_SPECIAL_BASIC";
                mySkillDef.skillNameToken        = "Calling Backup";

                LoadoutAPI.AddSkillDef(mySkillDef);

                GameObject   gameObject  = myCharacter;
                SkillLocator component   = gameObject.GetComponent <SkillLocator>();
                SkillFamily  skillFamily = component.special.skillFamily;

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

            //LoadoutAPI.AddSkill(typeof(DroneSummonHealing));
            //{
            //    SkillDef mySkillDef = ScriptableObject.CreateInstance<SkillDef>();
            //    mySkillDef.activationState = new SerializableEntityStateType(typeof(DroneSummonHealing));
            //    mySkillDef.activationStateMachineName = "WeaponGun";
            //    mySkillDef.baseMaxStock = 1;
            //    mySkillDef.baseRechargeInterval = 16f;
            //    mySkillDef.beginSkillCooldownOnSkillEnd = false;
            //    mySkillDef.canceledFromSprinting = false;
            //    mySkillDef.fullRestockOnAssign = false;
            //    mySkillDef.interruptPriority = InterruptPriority.PrioritySkill;
            //    mySkillDef.isBullets = true;
            //    mySkillDef.isCombatSkill = false;
            //    mySkillDef.mustKeyPress = false;
            //    mySkillDef.noSprint = true;
            //    mySkillDef.rechargeStock = 1;
            //    mySkillDef.requiredStock = 1;
            //    mySkillDef.shootDelay = 3f;
            //    mySkillDef.stockToConsume = 1;
            //    mySkillDef.icon = Resources.Load<GameObject>("Prefabs/CharacterBodies/drone2body").GetComponent<SkillLocator>().primary.skillFamily.variants[0].skillDef.icon;
            //    mySkillDef.skillDescriptionToken = "Summon two healing drones that inherit all your items";
            //    mySkillDef.skillName = "PP_PLAYABLETC_SPECIAL_HEALING";
            //    mySkillDef.skillNameToken = "Emergency Services";

            //    LoadoutAPI.AddSkillDef(mySkillDef);

            //    GameObject gameObject = myCharacter;
            //    SkillLocator component = gameObject.GetComponent<SkillLocator>();
            //    SkillFamily skillFamily = component.special.skillFamily;

            //    skillFamily.variants[1] =
            //        new SkillFamily.Variant
            //        {
            //            skillDef = mySkillDef,
            //            unlockableName = "",
            //            viewableNode = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
            //        };
            //}
        }
        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;
            }
        }
Esempio n. 16
0
        private static void SpecialSetup(GameObject bodyPrefab)
        {
            SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();

            mySkillDef.activationState            = new SerializableEntityStateType(typeof(PaladinMod.States.Spell.ChannelHealZone));
            mySkillDef.activationStateMachineName = "Weapon";
            mySkillDef.baseMaxStock                 = 1;
            mySkillDef.baseRechargeInterval         = 18f;
            mySkillDef.beginSkillCooldownOnSkillEnd = true;
            mySkillDef.canceledFromSprinting        = false;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.Skill;
            mySkillDef.resetCooldownTimerOnUse      = false;
            mySkillDef.isCombatSkill                = true;
            mySkillDef.mustKeyPress                 = false;
            mySkillDef.cancelSprintingOnActivation  = true;
            mySkillDef.rechargeStock                = 1;
            mySkillDef.requiredStock                = 1;
            mySkillDef.stockToConsume               = 1;
            mySkillDef.icon = Assets.icon4;
            mySkillDef.skillDescriptionToken = "PALADIN_SPECIAL_HEALZONE_DESCRIPTION";
            mySkillDef.skillName             = "PALADIN_SPECIAL_HEALZONE_NAME";
            mySkillDef.skillNameToken        = "PALADIN_SPECIAL_HEALZONE_NAME";

            skillDefs.Add(mySkillDef);

            skillLocator.special = bodyPrefab.AddComponent <GenericSkill>();
            SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>();

            newFamily.variants = new SkillFamily.Variant[1];
            skillFamilies.Add(newFamily);
            skillLocator.special._skillFamily = newFamily;
            SkillFamily skillFamily = skillLocator.special.skillFamily;

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

            mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
            mySkillDef.activationState            = new SerializableEntityStateType(typeof(PaladinMod.States.Spell.ChannelTorpor));
            mySkillDef.activationStateMachineName = "Weapon";
            mySkillDef.baseMaxStock                 = 1;
            mySkillDef.baseRechargeInterval         = 18f;
            mySkillDef.beginSkillCooldownOnSkillEnd = true;
            mySkillDef.canceledFromSprinting        = false;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.Skill;
            mySkillDef.resetCooldownTimerOnUse      = false;
            mySkillDef.isCombatSkill                = true;
            mySkillDef.mustKeyPress                 = false;
            mySkillDef.cancelSprintingOnActivation  = true;
            mySkillDef.rechargeStock                = 1;
            mySkillDef.requiredStock                = 1;
            mySkillDef.stockToConsume               = 1;
            mySkillDef.icon = Assets.icon4b;
            mySkillDef.skillDescriptionToken = "PALADIN_SPECIAL_TORPOR_DESCRIPTION";
            mySkillDef.skillName             = "PALADIN_SPECIAL_TORPOR_NAME";
            mySkillDef.skillNameToken        = "PALADIN_SPECIAL_TORPOR_NAME";
            mySkillDef.keywordTokens         = new string[] {
                "KEYWORD_TORPOR"
            };

            skillDefs.Add(mySkillDef);

            Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
            skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef      = mySkillDef,
                unlockableDef = Modules.Unlockables.paladinTorporSkillDefDef,
                viewableNode  = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
            };

            mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
            mySkillDef.activationState            = new SerializableEntityStateType(typeof(PaladinMod.States.Spell.ChannelWarcry));
            mySkillDef.activationStateMachineName = "Weapon";
            mySkillDef.baseMaxStock                 = 1;
            mySkillDef.baseRechargeInterval         = 18f;
            mySkillDef.beginSkillCooldownOnSkillEnd = true;
            mySkillDef.canceledFromSprinting        = false;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.Skill;
            mySkillDef.resetCooldownTimerOnUse      = false;
            mySkillDef.isCombatSkill                = true;
            mySkillDef.mustKeyPress                 = false;
            mySkillDef.cancelSprintingOnActivation  = true;
            mySkillDef.rechargeStock                = 1;
            mySkillDef.requiredStock                = 1;
            mySkillDef.stockToConsume               = 1;
            mySkillDef.icon = Assets.icon4c;
            mySkillDef.skillDescriptionToken = "PALADIN_SPECIAL_WARCRY_DESCRIPTION";
            mySkillDef.skillName             = "PALADIN_SPECIAL_WARCRY_NAME";
            mySkillDef.skillNameToken        = "PALADIN_SPECIAL_WARCRY_NAME";

            skillDefs.Add(mySkillDef);

            Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
            skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef     = mySkillDef,
                viewableNode = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
            };

            mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
            mySkillDef.activationState            = new SerializableEntityStateType(typeof(PaladinMod.States.Spell.ChannelCruelSun));
            mySkillDef.activationStateMachineName = "Weapon";
            mySkillDef.baseMaxStock                 = 1;
            mySkillDef.baseRechargeInterval         = 40f;
            mySkillDef.beginSkillCooldownOnSkillEnd = true;
            mySkillDef.canceledFromSprinting        = false;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.Skill;
            mySkillDef.resetCooldownTimerOnUse      = false;
            mySkillDef.isCombatSkill                = true;
            mySkillDef.mustKeyPress                 = false;
            mySkillDef.cancelSprintingOnActivation  = true;
            mySkillDef.rechargeStock                = 1;
            mySkillDef.requiredStock                = 1;
            mySkillDef.stockToConsume               = 1;
            mySkillDef.icon = Assets.icon4d;
            mySkillDef.skillDescriptionToken = "PALADIN_SPECIAL_SUN_DESCRIPTION";
            mySkillDef.skillName             = "PALADIN_SPECIAL_SUN_NAME";
            mySkillDef.skillNameToken        = "PALADIN_SPECIAL_SUN_NAME";

            skillDefs.Add(mySkillDef);

            Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
            skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef      = mySkillDef,
                unlockableDef = Modules.Unlockables.paladinCruelSunSkillDefDef,
                viewableNode  = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
            };

            SkillDef berserkSkillDef = CreateRageSkillDef(new SkillDefInfo
            {
                skillName                    = "PALADIN_SPECIAL_BERSERK_NAME",
                skillNameToken               = "PALADIN_SPECIAL_BERSERK_NAME",
                skillDescriptionToken        = "PALADIN_SPECIAL_BERSERK_DESCRIPTION",
                skillIcon                    = Modules.Assets.mainAssetBundle.LoadAsset <Sprite>("BerserkIcon"),
                activationState              = new SerializableEntityStateType(typeof(PaladinMod.States.Rage.RageEnter)),
                activationStateMachineName   = "Body",
                baseMaxStock                 = 1,
                baseRechargeInterval         = 0f,
                beginSkillCooldownOnSkillEnd = false,
                canceledFromSprinting        = false,
                forceSprintDuringState       = false,
                fullRestockOnAssign          = true,
                interruptPriority            = InterruptPriority.PrioritySkill,
                resetCooldownTimerOnUse      = false,
                isCombatSkill                = true,
                mustKeyPress                 = true,
                cancelSprintingOnActivation  = true,
                rechargeStock                = 100,
                requiredStock                = 0,
                stockToConsume               = 0
            });

            berserkOutSkillDef = CreateSkillDef(new SkillDefInfo
            {
                skillName                    = "PALADIN_SPECIAL_BERSERK_NAME",
                skillNameToken               = "PALADIN_SPECIAL_BERSERK_NAME",
                skillDescriptionToken        = "PALADIN_SPECIAL_BERSERK_DESCRIPTION",
                skillIcon                    = Modules.Assets.mainAssetBundle.LoadAsset <Sprite>("BerserkIcon"),
                activationState              = new SerializableEntityStateType(typeof(PaladinMod.States.Rage.RageExit)),
                activationStateMachineName   = "Slide",
                baseMaxStock                 = 1,
                baseRechargeInterval         = 5f,
                beginSkillCooldownOnSkillEnd = false,
                canceledFromSprinting        = false,
                forceSprintDuringState       = false,
                fullRestockOnAssign          = true,
                interruptPriority            = InterruptPriority.PrioritySkill,
                resetCooldownTimerOnUse      = false,
                isCombatSkill                = false,
                mustKeyPress                 = true,
                cancelSprintingOnActivation  = false,
                rechargeStock                = 1,
                requiredStock                = 1,
                stockToConsume               = 1
            });

            berserkDashSkillDef = CreateSkillDef(new SkillDefInfo
            {
                skillName                    = "PALADIN_UTILITY_BLINK_NAME",
                skillNameToken               = "PALADIN_UTILITY_BLINK_NAME",
                skillDescriptionToken        = "PALADIN_UTILITY_BLINK_DESCRIPTION",
                skillIcon                    = Assets.icon3,
                activationState              = new SerializableEntityStateType(typeof(PaladinMod.States.Quickstep.FlashStep)),
                activationStateMachineName   = "Weapon",
                baseMaxStock                 = 3,
                baseRechargeInterval         = 4f,
                beginSkillCooldownOnSkillEnd = false,
                canceledFromSprinting        = false,
                forceSprintDuringState       = false,
                fullRestockOnAssign          = true,
                interruptPriority            = InterruptPriority.PrioritySkill,
                resetCooldownTimerOnUse      = false,
                isCombatSkill                = false,
                mustKeyPress                 = true,
                cancelSprintingOnActivation  = true,
                rechargeStock                = 1,
                requiredStock                = 1,
                stockToConsume               = 1
            });

            //if (Modules.Config.cursed.Value) AddSpecialSkill(bodyPrefab, berserkSkillDef);
        }
Esempio n. 17
0
        private static void UtilitySetup(GameObject bodyPrefab)
        {
            crouchSkillDef = ScriptableObject.CreateInstance <SkillDef>();
            crouchSkillDef.activationState            = new SerializableEntityStateType(typeof(ROR2_SaxtonHale.States.Crouch));
            crouchSkillDef.activationStateMachineName = "Weapon";
            crouchSkillDef.baseMaxStock                 = 1;
            crouchSkillDef.baseRechargeInterval         = 0f;
            crouchSkillDef.beginSkillCooldownOnSkillEnd = true;
            crouchSkillDef.canceledFromSprinting        = false;
            crouchSkillDef.fullRestockOnAssign          = true;
            crouchSkillDef.interruptPriority            = InterruptPriority.Death;
            crouchSkillDef.isBullets             = false;
            crouchSkillDef.isCombatSkill         = false;
            crouchSkillDef.mustKeyPress          = true;
            crouchSkillDef.noSprint              = true;
            crouchSkillDef.rechargeStock         = 1;
            crouchSkillDef.requiredStock         = 1;
            crouchSkillDef.shootDelay            = 0.5f;
            crouchSkillDef.stockToConsume        = 1;
            crouchSkillDef.icon                  = Resources.Load <Sprite>("textures/bufficons/texBuffSlow80Icon");
            crouchSkillDef.skillDescriptionToken = "SAXTONHALE_UTILITY_CROUCH_DESCRIPTION";
            crouchSkillDef.skillName             = "SAXTONHALE_UTILITY_CROUCH_NAME";
            crouchSkillDef.skillNameToken        = "SAXTONHALE_UTILITY_CROUCH_NAME";

            weighdownSkillDef = ScriptableObject.CreateInstance <SkillDef>();
            weighdownSkillDef.activationState            = new SerializableEntityStateType(typeof(ROR2_SaxtonHale.States.Weighdown));
            weighdownSkillDef.activationStateMachineName = "Weapon";
            weighdownSkillDef.baseMaxStock                 = 1;
            weighdownSkillDef.baseRechargeInterval         = 0f;
            weighdownSkillDef.beginSkillCooldownOnSkillEnd = true;
            weighdownSkillDef.canceledFromSprinting        = false;
            weighdownSkillDef.fullRestockOnAssign          = true;
            weighdownSkillDef.interruptPriority            = InterruptPriority.Death;
            weighdownSkillDef.isBullets             = false;
            weighdownSkillDef.isCombatSkill         = false;
            weighdownSkillDef.mustKeyPress          = true;
            weighdownSkillDef.noSprint              = true;
            weighdownSkillDef.rechargeStock         = 0;
            weighdownSkillDef.requiredStock         = 1;
            weighdownSkillDef.shootDelay            = 0.5f;
            weighdownSkillDef.stockToConsume        = 1;
            weighdownSkillDef.icon                  = Resources.Load <Sprite>("textures/bufficons/texBuffSlow50Icon");
            weighdownSkillDef.skillDescriptionToken = "SAXTONHALE_UTILITY_WEIGHDOWN_DESCRIPTION";
            weighdownSkillDef.skillName             = "SAXTONHALE_UTILITY_WEIGHDOWN_NAME";
            weighdownSkillDef.skillNameToken        = "SAXTONHALE_UTILITY_WEIGHDOWN_NAME";


            LoadoutAPI.AddSkillDef(crouchSkillDef);
            LoadoutAPI.AddSkillDef(weighdownSkillDef);

            skillLocator.utility = bodyPrefab.AddComponent <GenericSkill>();
            SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>();

            newFamily.variants = new SkillFamily.Variant[1];
            LoadoutAPI.AddSkillFamily(newFamily);
            skillLocator.utility._skillFamily = newFamily;
            SkillFamily skillFamily = skillLocator.utility.skillFamily;

            skillFamily.variants[0] = new SkillFamily.Variant
            {
                skillDef       = crouchSkillDef,
                unlockableName = "",
                viewableNode   = new ViewablesCatalog.Node(crouchSkillDef.skillNameToken, false, null)
            };
        }
Esempio n. 18
0
        private static void SpecialSetup(GameObject bodyPrefab)
        {
            SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();

            mySkillDef.activationState            = new SerializableEntityStateType(typeof(PaladinMod.States.Spell.ChannelHealZone));
            mySkillDef.activationStateMachineName = "Weapon";
            mySkillDef.baseMaxStock                 = 1;
            mySkillDef.baseRechargeInterval         = 18f;
            mySkillDef.beginSkillCooldownOnSkillEnd = true;
            mySkillDef.canceledFromSprinting        = true;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.Skill;
            mySkillDef.isBullets             = false;
            mySkillDef.isCombatSkill         = true;
            mySkillDef.mustKeyPress          = false;
            mySkillDef.noSprint              = true;
            mySkillDef.rechargeStock         = 1;
            mySkillDef.requiredStock         = 1;
            mySkillDef.shootDelay            = 0.5f;
            mySkillDef.stockToConsume        = 1;
            mySkillDef.icon                  = Assets.icon4;
            mySkillDef.skillDescriptionToken = "PALADIN_SPECIAL_HEALZONE_DESCRIPTION";
            mySkillDef.skillName             = "PALADIN_SPECIAL_HEALZONE_NAME";
            mySkillDef.skillNameToken        = "PALADIN_SPECIAL_HEALZONE_NAME";

            LoadoutAPI.AddSkillDef(mySkillDef);

            skillLocator.special = bodyPrefab.AddComponent <GenericSkill>();
            SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>();

            newFamily.variants = new SkillFamily.Variant[1];
            LoadoutAPI.AddSkillFamily(newFamily);
            skillLocator.special._skillFamily = newFamily;
            SkillFamily skillFamily = skillLocator.special.skillFamily;

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

            mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
            mySkillDef.activationState            = new SerializableEntityStateType(typeof(PaladinMod.States.Spell.ChannelTorpor));
            mySkillDef.activationStateMachineName = "Weapon";
            mySkillDef.baseMaxStock                 = 1;
            mySkillDef.baseRechargeInterval         = 18f;
            mySkillDef.beginSkillCooldownOnSkillEnd = true;
            mySkillDef.canceledFromSprinting        = true;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.Skill;
            mySkillDef.isBullets             = false;
            mySkillDef.isCombatSkill         = true;
            mySkillDef.mustKeyPress          = false;
            mySkillDef.noSprint              = true;
            mySkillDef.rechargeStock         = 1;
            mySkillDef.requiredStock         = 1;
            mySkillDef.shootDelay            = 0.5f;
            mySkillDef.stockToConsume        = 1;
            mySkillDef.icon                  = Assets.icon4b;
            mySkillDef.skillDescriptionToken = "PALADIN_SPECIAL_TORPOR_DESCRIPTION";
            mySkillDef.skillName             = "PALADIN_SPECIAL_TORPOR_NAME";
            mySkillDef.skillNameToken        = "PALADIN_SPECIAL_TORPOR_NAME";
            mySkillDef.keywordTokens         = new string[] {
                "KEYWORD_TORPOR"
            };

            LoadoutAPI.AddSkillDef(mySkillDef);

            Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
            skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef       = mySkillDef,
                unlockableName = "PALADIN_TORPORUNLOCKABLE_REWARD_ID",
                viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
            };

            mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
            mySkillDef.activationState            = new SerializableEntityStateType(typeof(PaladinMod.States.Spell.ChannelWarcry));
            mySkillDef.activationStateMachineName = "Weapon";
            mySkillDef.baseMaxStock                 = 1;
            mySkillDef.baseRechargeInterval         = 18f;
            mySkillDef.beginSkillCooldownOnSkillEnd = true;
            mySkillDef.canceledFromSprinting        = true;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.Skill;
            mySkillDef.isBullets             = false;
            mySkillDef.isCombatSkill         = true;
            mySkillDef.mustKeyPress          = false;
            mySkillDef.noSprint              = true;
            mySkillDef.rechargeStock         = 1;
            mySkillDef.requiredStock         = 1;
            mySkillDef.shootDelay            = 0.5f;
            mySkillDef.stockToConsume        = 1;
            mySkillDef.icon                  = Assets.icon4c;
            mySkillDef.skillDescriptionToken = "PALADIN_SPECIAL_WARCRY_DESCRIPTION";
            mySkillDef.skillName             = "PALADIN_SPECIAL_WARCRY_NAME";
            mySkillDef.skillNameToken        = "PALADIN_SPECIAL_WARCRY_NAME";

            LoadoutAPI.AddSkillDef(mySkillDef);

            Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
            skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef       = mySkillDef,
                unlockableName = "",
                viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
            };
        }
Esempio n. 19
0
        public static void Initialize()
        {
            SkillDef sharpClawsSkillDef = ScriptableObject.CreateInstance <SkillDef>();

            sharpClawsSkillDef.activationState            = new SerializableEntityStateType(typeof(States.SharpClaws));
            sharpClawsSkillDef.activationStateMachineName = "Weapon";
            sharpClawsSkillDef.baseMaxStock                 = 1;
            sharpClawsSkillDef.baseRechargeInterval         = 0f;
            sharpClawsSkillDef.beginSkillCooldownOnSkillEnd = false;
            sharpClawsSkillDef.canceledFromSprinting        = false;
            sharpClawsSkillDef.fullRestockOnAssign          = true;
            sharpClawsSkillDef.interruptPriority            = InterruptPriority.Any;
            sharpClawsSkillDef.isCombatSkill                = true;
            sharpClawsSkillDef.mustKeyPress                 = false;
            sharpClawsSkillDef.cancelSprintingOnActivation  = true;
            sharpClawsSkillDef.rechargeStock                = 1;
            sharpClawsSkillDef.requiredStock                = 1;
            sharpClawsSkillDef.stockToConsume               = 1;
            sharpClawsSkillDef.icon = Core.Assets.icon1;
            sharpClawsSkillDef.skillDescriptionToken = "URSA_PRIMARY_DESCRIPTION";
            sharpClawsSkillDef.skillName             = "URSA_PRIMARY_NAME";
            sharpClawsSkillDef.skillNameToken        = "URSA_PRIMARY_NAME";

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

            overpowerSkillDef.activationState            = new SerializableEntityStateType(typeof(States.Overpower));
            overpowerSkillDef.activationStateMachineName = "Body";
            overpowerSkillDef.baseMaxStock                 = Core.Config.secondaryBaseCharges.Value;
            overpowerSkillDef.baseRechargeInterval         = Core.Config.secondaryBaseCooldown.Value;
            overpowerSkillDef.beginSkillCooldownOnSkillEnd = false;
            overpowerSkillDef.canceledFromSprinting        = false;
            overpowerSkillDef.fullRestockOnAssign          = true;
            overpowerSkillDef.interruptPriority            = InterruptPriority.Skill;
            overpowerSkillDef.isCombatSkill                = true;
            overpowerSkillDef.mustKeyPress                 = true;
            overpowerSkillDef.cancelSprintingOnActivation  = false;
            overpowerSkillDef.rechargeStock                = 1;
            overpowerSkillDef.requiredStock                = 1;
            overpowerSkillDef.stockToConsume               = 1;
            overpowerSkillDef.icon = Core.Assets.icon2;
            overpowerSkillDef.skillDescriptionToken = "URSA_SECONDARY_DESCRIPTION";
            overpowerSkillDef.skillName             = "URSA_SECONDARY_NAME";
            overpowerSkillDef.skillNameToken        = "URSA_SECONDARY_NAME";

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

            earthshockSkillDef.activationState            = new SerializableEntityStateType(typeof(States.Earthshock));
            earthshockSkillDef.activationStateMachineName = "Weapon";
            earthshockSkillDef.baseMaxStock                 = 1;
            earthshockSkillDef.baseRechargeInterval         = Core.Config.utilityBaseCooldown.Value;
            earthshockSkillDef.beginSkillCooldownOnSkillEnd = true;
            earthshockSkillDef.canceledFromSprinting        = false;
            earthshockSkillDef.fullRestockOnAssign          = true;
            earthshockSkillDef.interruptPriority            = InterruptPriority.Skill;
            earthshockSkillDef.isCombatSkill                = false;
            earthshockSkillDef.mustKeyPress                 = true;
            earthshockSkillDef.cancelSprintingOnActivation  = false;
            earthshockSkillDef.rechargeStock                = 1;
            earthshockSkillDef.requiredStock                = 1;
            earthshockSkillDef.stockToConsume               = 1;
            earthshockSkillDef.icon = Core.Assets.icon3;
            earthshockSkillDef.skillDescriptionToken = "URSA_UTILITY_DESCRIPTION";
            earthshockSkillDef.skillName             = "URSA_UTILITY_NAME";
            earthshockSkillDef.skillNameToken        = "URSA_UTILITY_NAME";

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

            enrageSkillDef.activationState            = new SerializableEntityStateType(typeof(States.Enrage));
            enrageSkillDef.activationStateMachineName = "Body";
            enrageSkillDef.baseMaxStock                 = 1;
            enrageSkillDef.baseRechargeInterval         = Core.Config.specialBaseCooldown.Value;
            enrageSkillDef.beginSkillCooldownOnSkillEnd = true;
            enrageSkillDef.canceledFromSprinting        = false;
            enrageSkillDef.fullRestockOnAssign          = true;
            enrageSkillDef.interruptPriority            = InterruptPriority.Frozen;
            enrageSkillDef.isCombatSkill                = true;
            enrageSkillDef.mustKeyPress                 = true;
            enrageSkillDef.cancelSprintingOnActivation  = true;
            enrageSkillDef.rechargeStock                = 1;
            enrageSkillDef.requiredStock                = 1;
            enrageSkillDef.stockToConsume               = 1;
            enrageSkillDef.icon = Core.Assets.icon4;
            enrageSkillDef.skillDescriptionToken = "URSA_SPECIAL_DESCRIPTION";
            enrageSkillDef.skillName             = "URSA_SPECIAL_NAME";
            enrageSkillDef.skillNameToken        = "URSA_SPECIAL_NAME";

            LoadoutAPI.AddSkillDef(sharpClawsSkillDef);
            LoadoutAPI.AddSkillDef(overpowerSkillDef);
            LoadoutAPI.AddSkillDef(earthshockSkillDef);
            LoadoutAPI.AddSkillDef(enrageSkillDef);

            foreach (GenericSkill i in Survivor.Character.body.GetComponentsInChildren <GenericSkill>())
            {
                UnityEngine.Object.DestroyImmediate(i);
            }

            SkillLocator skillLocator = Survivor.Character.body.GetComponent <SkillLocator>();

            //Passive
            skillLocator.passiveSkill.enabled               = true;
            skillLocator.passiveSkill.skillNameToken        = "URSA_PASSIVE_NAME";
            skillLocator.passiveSkill.skillDescriptionToken = "URSA_PASSIVE_DESCRIPTION";
            skillLocator.passiveSkill.icon = Core.Assets.icon5;

            //Primary
            skillLocator.primary = Survivor.Character.body.AddComponent <GenericSkill>();
            SkillFamily newFamilyPrimary = ScriptableObject.CreateInstance <SkillFamily>();

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

            skillFamilyPrimary.variants[0] = new SkillFamily.Variant
            {
                skillDef     = sharpClawsSkillDef,
                viewableNode = new ViewablesCatalog.Node(sharpClawsSkillDef.skillNameToken, false, null)
            };

            //Secondary
            skillLocator.secondary = Survivor.Character.body.AddComponent <GenericSkill>();
            SkillFamily newFamilySecondary = ScriptableObject.CreateInstance <SkillFamily>();

            newFamilySecondary.variants = new SkillFamily.Variant[1];
            LoadoutAPI.AddSkillFamily(newFamilySecondary);
            skillLocator.secondary.SetFieldValue("_skillFamily", newFamilySecondary);
            SkillFamily skillFamilySecondary = skillLocator.secondary.skillFamily;

            skillFamilySecondary.variants[0] = new SkillFamily.Variant
            {
                skillDef     = overpowerSkillDef,
                viewableNode = new ViewablesCatalog.Node(overpowerSkillDef.skillNameToken, false, null)
            };

            //Utility
            skillLocator.utility = Survivor.Character.body.AddComponent <GenericSkill>();
            SkillFamily newFamilyUtility = ScriptableObject.CreateInstance <SkillFamily>();

            newFamilyUtility.variants = new SkillFamily.Variant[1];
            LoadoutAPI.AddSkillFamily(newFamilyUtility);
            skillLocator.utility.SetFieldValue("_skillFamily", newFamilyUtility);
            SkillFamily skillFamilyUtility = skillLocator.utility.skillFamily;

            skillFamilyUtility.variants[0] = new SkillFamily.Variant
            {
                skillDef     = earthshockSkillDef,
                viewableNode = new ViewablesCatalog.Node(earthshockSkillDef.skillNameToken, false, null)
            };

            //Special
            skillLocator.special = Survivor.Character.body.AddComponent <GenericSkill>();
            SkillFamily newFamilySpecial = ScriptableObject.CreateInstance <SkillFamily>();

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

            skillFamilySpecial.variants[0] = new SkillFamily.Variant
            {
                skillDef     = enrageSkillDef,
                viewableNode = new ViewablesCatalog.Node(enrageSkillDef.skillNameToken, false, null)
            };
        }
Esempio n. 20
0
        internal static void PrimarySetup()
        {
            SkillLocator component = Templar.myCharacter.GetComponent <SkillLocator>();
            SkillDef     skillDef  = SkillDef.CreateInstance <SkillDef>();

            skillDef.activationState            = new SerializableEntityStateType(typeof(TemplarMinigunSpinUp));
            skillDef.activationStateMachineName = "Weapon";
            skillDef.baseMaxStock                 = 1;
            skillDef.baseRechargeInterval         = 0f;
            skillDef.beginSkillCooldownOnSkillEnd = true;
            skillDef.canceledFromSprinting        = false;
            skillDef.cancelSprintingOnActivation  = true;
            skillDef.fullRestockOnAssign          = true;
            skillDef.interruptPriority            = InterruptPriority.Any;
            skillDef.isCombatSkill                = true;
            skillDef.mustKeyPress                 = false;
            skillDef.rechargeStock                = 1;
            skillDef.requiredStock                = 1;
            skillDef.stockToConsume               = 1;
            skillDef.icon = Assets.icon1;
            skillDef.skillDescriptionToken = "TEMPLAR_PRIMARY_MINIGUN_DESCRIPTION";
            skillDef.skillName             = "TEMPLAR_PRIMARY_MINIGUN_NAME";
            skillDef.skillNameToken        = "TEMPLAR_PRIMARY_MINIGUN_NAME";
            skillDef.keywordTokens         = new string[]
            {
                "KEYWORD_RAPIDFIRE"
            };


            component.primary = Templar.myCharacter.AddComponent <GenericSkill>();
            SkillFamily skillFamily = ScriptableObject.CreateInstance <SkillFamily>();

            skillFamily.variants = new SkillFamily.Variant[1];

            component.primary.SetFieldValue("_skillFamily", skillFamily);
            SkillFamily skillFamily2 = component.primary.skillFamily;

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

            SkillDef skillDef2 = SkillDef.CreateInstance <SkillDef>();

            skillDef2.activationState            = new SerializableEntityStateType(typeof(TemplarRifleFire));
            skillDef2.activationStateMachineName = "Weapon";
            skillDef2.baseMaxStock                 = 1;
            skillDef2.baseRechargeInterval         = 0f;
            skillDef2.beginSkillCooldownOnSkillEnd = true;
            skillDef2.canceledFromSprinting        = true;
            skillDef2.cancelSprintingOnActivation  = true;
            skillDef2.fullRestockOnAssign          = true;
            skillDef2.interruptPriority            = InterruptPriority.Any;
            skillDef2.isCombatSkill                = true;
            skillDef2.mustKeyPress                 = false;
            skillDef2.rechargeStock                = 1;
            skillDef2.requiredStock                = 1;
            skillDef2.stockToConsume               = 1;
            skillDef2.icon = Assets.icon1b;
            skillDef2.skillDescriptionToken = "TEMPLAR_PRIMARY_PRECISEMINIGUN_DESCRIPTION";
            skillDef2.skillName             = "TEMPLAR_PRIMARY_PRECISEMINIGUN_NAME";
            skillDef2.skillNameToken        = "TEMPLAR_PRIMARY_PRECISEMINIGUN_NAME";
            Array.Resize <SkillFamily.Variant>(ref skillFamily2.variants, skillFamily2.variants.Length + 1);
            skillFamily2.variants[skillFamily2.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef     = skillDef2,
                viewableNode = new ViewablesCatalog.Node(skillDef2.skillNameToken, false, null)
            };


            SkillDef skillDef3 = SkillDef.CreateInstance <SkillDef>();

            skillDef3.activationState            = new SerializableEntityStateType(typeof(TemplarChargeBeam));
            skillDef3.activationStateMachineName = "Weapon";
            skillDef3.baseMaxStock                 = 1;
            skillDef3.baseRechargeInterval         = 0f;
            skillDef3.beginSkillCooldownOnSkillEnd = true;
            skillDef3.canceledFromSprinting        = false;
            skillDef3.cancelSprintingOnActivation  = true;
            skillDef3.fullRestockOnAssign          = true;
            skillDef3.interruptPriority            = InterruptPriority.Any;
            skillDef3.isCombatSkill                = true;
            skillDef3.mustKeyPress                 = false;
            skillDef3.rechargeStock                = 1;
            skillDef3.requiredStock                = 1;
            skillDef3.stockToConsume               = 1;
            skillDef3.icon = Assets.icon1c;
            skillDef3.skillDescriptionToken = "TEMPLAR_PRIMARY_RAILGUN_DESCRIPTION";
            skillDef3.skillName             = "TEMPLAR_PRIMARY_RAILGUN_NAME";
            skillDef3.skillNameToken        = "TEMPLAR_PRIMARY_RAILGUN_NAME";
            skillDef3.keywordTokens         = new string[]
            {
                "KEYWORD_EXPLOSIVE"
            };
            Array.Resize <SkillFamily.Variant>(ref skillFamily2.variants, skillFamily2.variants.Length + 1);
            skillFamily2.variants[skillFamily2.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef     = skillDef3,
                viewableNode = new ViewablesCatalog.Node(skillDef3.skillNameToken, false, null)
            };


            SkillDef skillDef4 = SkillDef.CreateInstance <SkillDef>();

            skillDef4.activationState            = new SerializableEntityStateType(typeof(TemplarFlamethrower));
            skillDef4.activationStateMachineName = "Weapon";
            skillDef4.baseMaxStock                 = 1;
            skillDef4.baseRechargeInterval         = 0f;
            skillDef4.beginSkillCooldownOnSkillEnd = true;
            skillDef4.canceledFromSprinting        = false;
            skillDef4.cancelSprintingOnActivation  = true;
            skillDef4.fullRestockOnAssign          = true;
            skillDef4.interruptPriority            = InterruptPriority.Any;
            skillDef4.isCombatSkill                = true;
            skillDef4.mustKeyPress                 = false;
            skillDef4.rechargeStock                = 1;
            skillDef4.requiredStock                = 1;
            skillDef4.stockToConsume               = 1;
            skillDef4.icon = Assets.icon1d;
            skillDef4.skillDescriptionToken = "TEMPLAR_PRIMARY_FLAMETHROWER_DESCRIPTION";
            skillDef4.skillName             = "TEMPLAR_PRIMARY_FLAMETHROWER_NAME";
            skillDef4.skillNameToken        = "TEMPLAR_PRIMARY_FLAMETHROWER_NAME";
            skillDef4.keywordTokens         = new string[]
            {
                "KEYWORD_EXPLOSIVE"
            };

            Array.Resize <SkillFamily.Variant>(ref skillFamily2.variants, skillFamily2.variants.Length + 1);
            skillFamily2.variants[skillFamily2.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef     = skillDef4,
                viewableNode = new ViewablesCatalog.Node(skillDef4.skillNameToken, false, null)
            };

            bool value = Templar.bazookaGoBoom.Value;
            bool flag  = value;

            if (flag)
            {
                LanguageAPI.Add("TEMPLAR_PRIMARY_BAZOOKA_NAME", "Bazooka Mk. 2");
                LanguageAPI.Add("TEMPLAR_PRIMARY_BAZOOKA_DESCRIPTION", "<style=cIsDamage>Explosive</style>. Fire a <style=cIsUtility>rocket</style>, dealing <style=cIsDamage>" + (Templar.miniBazookaDamageCoefficient.Value * 100f).ToString() + "% damage</style>.");
                SkillDef skillDef5 = SkillDef.CreateInstance <SkillDef>();
                skillDef5.activationState            = new SerializableEntityStateType(typeof(TemplarChargeMiniRocket));
                skillDef5.activationStateMachineName = "Weapon";
                skillDef5.baseMaxStock                 = 1;
                skillDef5.baseRechargeInterval         = 0.1f;
                skillDef5.beginSkillCooldownOnSkillEnd = true;
                skillDef5.canceledFromSprinting        = false;
                skillDef5.fullRestockOnAssign          = true;
                skillDef5.interruptPriority            = InterruptPriority.Any;
                skillDef5.isCombatSkill                = true;
                skillDef5.mustKeyPress                 = false;
                skillDef5.rechargeStock                = 1;
                skillDef5.requiredStock                = 1;
                skillDef5.stockToConsume               = 1;
                skillDef5.icon = Assets.icon4;
                skillDef5.skillDescriptionToken = "TEMPLAR_PRIMARY_BAZOOKA_DESCRIPTION";
                skillDef5.skillName             = "TEMPLAR_PRIMARY_BAZOOKA_NAME";
                skillDef5.skillNameToken        = "TEMPLAR_PRIMARY_BAZOOKA_NAME";
                skillDef5.keywordTokens         = new string[]
                {
                    "KEYWORD_EXPLOSIVE"
                };
                skillDef5.cancelSprintingOnActivation = true;

                Array.Resize <SkillFamily.Variant>(ref skillFamily2.variants, skillFamily2.variants.Length + 1);
                skillFamily2.variants[skillFamily2.variants.Length - 1] = new SkillFamily.Variant
                {
                    skillDef     = skillDef5,
                    viewableNode = new ViewablesCatalog.Node(skillDef5.skillNameToken, false, null)
                };
                Loader.entityStates.Add(typeof(TemplarChargeMiniRocket));
                Loader.skillDefs.Add(skillDef5);
            }


            Loader.entityStates.Add(typeof(TemplarMinigunSpinUp));
            Loader.entityStates.Add(typeof(TemplarRifleFire));
            Loader.entityStates.Add(typeof(TemplarChargeBeam));
            Loader.entityStates.Add(typeof(TemplarFlamethrower));

            Loader.skillDefs.Add(skillDef);
            Loader.skillDefs.Add(skillDef2);
            Loader.skillDefs.Add(skillDef3);
            Loader.skillDefs.Add(skillDef4);
        }
        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;
            }
        }
Esempio n. 22
0
        internal static void UtilitySetup()
        {
            SkillLocator component = Templar.myCharacter.GetComponent <SkillLocator>();
            SkillDef     skillDef  = SkillDef.CreateInstance <SkillDef>();

            skillDef.activationState            = new SerializableEntityStateType(typeof(TemplarOverdrive));
            skillDef.activationStateMachineName = "Body";
            skillDef.baseMaxStock                 = Templar.overdriveStock.Value;
            skillDef.baseRechargeInterval         = Templar.overdriveCooldown.Value;
            skillDef.beginSkillCooldownOnSkillEnd = false;
            skillDef.canceledFromSprinting        = false;
            skillDef.cancelSprintingOnActivation  = false;
            skillDef.fullRestockOnAssign          = true;
            skillDef.interruptPriority            = InterruptPriority.PrioritySkill;
            skillDef.isCombatSkill                = true;
            skillDef.mustKeyPress                 = true;
            skillDef.rechargeStock                = 1;
            skillDef.requiredStock                = 1;
            skillDef.stockToConsume               = 1;
            skillDef.icon = Assets.icon3;
            skillDef.skillDescriptionToken = "TEMPLAR_UTILITY_OVERDRIVE_DESCRIPTION";
            skillDef.skillName             = "TEMPLAR_UTILITY_OVERDRIVE_NAME";
            skillDef.skillNameToken        = "TEMPLAR_UTILITY_OVERDRIVE_NAME";

            component.utility = Templar.myCharacter.AddComponent <GenericSkill>();
            SkillFamily skillFamily = ScriptableObject.CreateInstance <SkillFamily>();

            skillFamily.variants = new SkillFamily.Variant[1];
            component.utility.SetFieldValue("_skillFamily", skillFamily);
            SkillFamily skillFamily2 = component.utility.skillFamily;

            skillFamily2.variants[0] = new SkillFamily.Variant
            {
                skillDef     = skillDef,
                viewableNode = new ViewablesCatalog.Node(skillDef.skillNameToken, false, null)
            };
            SkillDef skillDef2 = LegacyResourcesAPI.Load <GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren <SkillLocator>().utility.skillFamily.variants[0].skillDef;

            skillDef2 = SkillDef.CreateInstance <SkillDef>();
            skillDef2.activationState            = new SerializableEntityStateType(typeof(TemplarSidestep));
            skillDef2.activationStateMachineName = "Body";
            skillDef2.baseRechargeInterval       = Templar.dashCooldown.Value;
            skillDef2.baseMaxStock = Templar.dashStock.Value;
            skillDef2.beginSkillCooldownOnSkillEnd = skillDef2.beginSkillCooldownOnSkillEnd;
            skillDef2.canceledFromSprinting        = false;
            skillDef2.cancelSprintingOnActivation  = false;
            skillDef2.fullRestockOnAssign          = skillDef2.fullRestockOnAssign;
            skillDef2.interruptPriority            = skillDef2.interruptPriority;
            skillDef2.isCombatSkill         = true;
            skillDef2.mustKeyPress          = skillDef2.mustKeyPress;
            skillDef2.rechargeStock         = skillDef2.rechargeStock;
            skillDef2.requiredStock         = skillDef2.requiredStock;
            skillDef2.stockToConsume        = skillDef2.stockToConsume;
            skillDef2.icon                  = Assets.icon3b;
            skillDef2.skillDescriptionToken = "TEMPLAR_UTILITY_DODGE_DESCRIPTION";
            skillDef2.skillName             = "TEMPLAR_UTILITY_DODGE_NAME";
            skillDef2.skillNameToken        = "TEMPLAR_UTILITY_DODGE_NAME";

            Array.Resize <SkillFamily.Variant>(ref skillFamily2.variants, skillFamily2.variants.Length + 1);
            skillFamily2.variants[skillFamily2.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef     = skillDef2,
                viewableNode = new ViewablesCatalog.Node(skillDef2.skillNameToken, false, null)
            };

            Loader.entityStates.Add(typeof(TemplarOverdrive));
            Loader.entityStates.Add(typeof(TemplarSidestep));

            Loader.skillDefs.Add(skillDef);
            Loader.skillDefs.Add(skillDef2);
        }
Esempio n. 23
0
        public static void Setup()
        {
            LoadoutAPI.AddSkill(typeof(VTStates.States.Engineer.SummonDrone));
            {
                SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
                mySkillDef.activationState            = new SerializableEntityStateType(typeof(VTStates.States.Engineer.SummonDrone));
                mySkillDef.activationStateMachineName = "Weapon";
                mySkillDef.baseMaxStock                 = 2;
                mySkillDef.baseRechargeInterval         = 20f;
                mySkillDef.beginSkillCooldownOnSkillEnd = false;
                mySkillDef.canceledFromSprinting        = false;
                mySkillDef.fullRestockOnAssign          = true;
                mySkillDef.interruptPriority            = InterruptPriority.Any;
                mySkillDef.isBullets      = false;
                mySkillDef.isCombatSkill  = false;
                mySkillDef.mustKeyPress   = true;
                mySkillDef.noSprint       = false;
                mySkillDef.rechargeStock  = 1;
                mySkillDef.requiredStock  = 1;
                mySkillDef.shootDelay     = 0f;
                mySkillDef.stockToConsume = 1;
                //mySkillDef.icon = Resources.Load<Sprite>()
                mySkillDef.skillDescriptionToken = "Spawn a drone that <style=cIsUtility>inherits all your items.</style> Fires 4 shots for <style=cIsDamage>100% damage</style>. Can have up to 2.";
                mySkillDef.skillName             = "EXPANDEDSKILLS_SUMMONDRONE_SPECIAL";
                mySkillDef.skillNameToken        = "Backup Drone";

                LoadoutAPI.AddSkillDef(mySkillDef);

                GameObject   gameObject  = Resources.Load <GameObject>("prefabs/characterbodies/engibody");
                SkillLocator component   = gameObject.GetComponent <SkillLocator>();
                SkillFamily  skillFamily = component.special.skillFamily;

                Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);

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

            LoadoutAPI.AddSkill(typeof(VTStates.States.Engineer.SummonProbe));
            {
                SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
                mySkillDef.activationState            = new SerializableEntityStateType(typeof(VTStates.States.Engineer.SummonProbe));
                mySkillDef.activationStateMachineName = "Weapon";
                mySkillDef.baseMaxStock                 = 2;
                mySkillDef.baseRechargeInterval         = 40f;
                mySkillDef.beginSkillCooldownOnSkillEnd = false;
                mySkillDef.canceledFromSprinting        = false;
                mySkillDef.fullRestockOnAssign          = true;
                mySkillDef.interruptPriority            = InterruptPriority.Any;
                mySkillDef.isBullets      = false;
                mySkillDef.isCombatSkill  = false;
                mySkillDef.mustKeyPress   = true;
                mySkillDef.noSprint       = false;
                mySkillDef.rechargeStock  = 1;
                mySkillDef.requiredStock  = 1;
                mySkillDef.shootDelay     = 0f;
                mySkillDef.stockToConsume = 1;
                //mySkillDef.icon = Resources.Load<Sprite>()
                mySkillDef.skillDescriptionToken = "Spawn a miniature probe that <style=cIsUtility>inherits all your items.</style> Fires a beam for <style=cIsDamage>100% damage</style>. Can have up to 2.";
                mySkillDef.skillName             = "EXPANDEDSKILLS_SUMMONPROBE_SPECIAL";
                mySkillDef.skillNameToken        = "TR-8R Probe";

                LoadoutAPI.AddSkillDef(mySkillDef);

                GameObject   gameObject  = Resources.Load <GameObject>("prefabs/characterbodies/engibody");
                SkillLocator component   = gameObject.GetComponent <SkillLocator>();
                SkillFamily  skillFamily = component.special.skillFamily;

                Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);

                skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
                {
                    skillDef       = mySkillDef,
                    unlockableName = "",
                    viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
                };
            }
            {
                EntityStates.Mage.Weapon.FireLaserbolt.damageCoefficient = 2f;
                EntityStates.Mage.Weapon.FireLaserbolt.force             = -100f;

                SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
                mySkillDef.activationState            = new SerializableEntityStateType(typeof(EntityStates.Mage.Weapon.FireLaserbolt));
                mySkillDef.activationStateMachineName = "Weapon";
                mySkillDef.baseMaxStock                 = 1;
                mySkillDef.baseRechargeInterval         = 1f;
                mySkillDef.beginSkillCooldownOnSkillEnd = false;
                mySkillDef.canceledFromSprinting        = false;
                mySkillDef.fullRestockOnAssign          = true;
                mySkillDef.interruptPriority            = InterruptPriority.Any;
                mySkillDef.isBullets      = false;
                mySkillDef.isCombatSkill  = false;
                mySkillDef.mustKeyPress   = false;
                mySkillDef.noSprint       = false;
                mySkillDef.rechargeStock  = 1;
                mySkillDef.requiredStock  = 1;
                mySkillDef.shootDelay     = 0f;
                mySkillDef.stockToConsume = 0;
                //mySkillDef.icon = Resources.Load<Sprite>()
                mySkillDef.skillDescriptionToken = "Fire a beam that deals <style=cIsDamage>200% damage</style> and <style=cIsUtility> Brings enemies towards you </style>";
                mySkillDef.skillName             = "EXPANDEDSKILLS_BEAM_PRIMARY";
                mySkillDef.skillNameToken        = "Augmented Beam";

                LoadoutAPI.AddSkillDef(mySkillDef);

                GameObject   gameObject  = Resources.Load <GameObject>("prefabs/characterbodies/engibody");
                SkillLocator component   = gameObject.GetComponent <SkillLocator>();
                SkillFamily  skillFamily = component.primary.skillFamily;

                Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);

                skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
                {
                    skillDef       = mySkillDef,
                    unlockableName = "",
                    viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
                };
            }
            {
                SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
                mySkillDef.activationState            = new SerializableEntityStateType(typeof(VTStates.States.Engineer.MinorShield));
                mySkillDef.activationStateMachineName = "Weapon";
                mySkillDef.baseMaxStock                 = 3;
                mySkillDef.baseRechargeInterval         = 8f;
                mySkillDef.beginSkillCooldownOnSkillEnd = false;
                mySkillDef.canceledFromSprinting        = false;
                mySkillDef.fullRestockOnAssign          = true;
                mySkillDef.interruptPriority            = InterruptPriority.Any;
                mySkillDef.isBullets      = false;
                mySkillDef.isCombatSkill  = false;
                mySkillDef.mustKeyPress   = false;
                mySkillDef.noSprint       = false;
                mySkillDef.rechargeStock  = 1;
                mySkillDef.requiredStock  = 1;
                mySkillDef.shootDelay     = 0f;
                mySkillDef.stockToConsume = 0;
                //mySkillDef.icon = Resources.Load<Sprite>()
                mySkillDef.skillDescriptionToken = "Give each ally shields equal to their maximum health that last 5 seconds and shock anyone nearby them. Each ally takes one stock of this skill.";
                mySkillDef.skillName             = "EXPANDEDSKILLS_SHIELDALL_UTILITY";
                mySkillDef.skillNameToken        = "Panic Button";

                LoadoutAPI.AddSkillDef(mySkillDef);

                GameObject   gameObject  = Resources.Load <GameObject>("prefabs/characterbodies/engibody");
                SkillLocator component   = gameObject.GetComponent <SkillLocator>();
                SkillFamily  skillFamily = component.utility.skillFamily;

                Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);

                skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
                {
                    skillDef       = mySkillDef,
                    unlockableName = "",
                    viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
                };
            }
            {
                SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
                mySkillDef.activationState            = new SerializableEntityStateType(typeof(VTStates.States.Engineer.TrueShield));
                mySkillDef.activationStateMachineName = "Weapon";
                mySkillDef.baseMaxStock                 = 3;
                mySkillDef.baseRechargeInterval         = 15f;
                mySkillDef.beginSkillCooldownOnSkillEnd = false;
                mySkillDef.canceledFromSprinting        = false;
                mySkillDef.fullRestockOnAssign          = true;
                mySkillDef.interruptPriority            = InterruptPriority.Any;
                mySkillDef.isBullets      = false;
                mySkillDef.isCombatSkill  = false;
                mySkillDef.mustKeyPress   = false;
                mySkillDef.noSprint       = false;
                mySkillDef.rechargeStock  = 1;
                mySkillDef.requiredStock  = 1;
                mySkillDef.shootDelay     = 0f;
                mySkillDef.stockToConsume = 0;
                //mySkillDef.icon = Resources.Load<Sprite>()
                mySkillDef.skillDescriptionToken = "Make all allies <style=cIsUtility>immune</style> for 3 seconds,  gain <style=cIsUtility>damage Reduction</style> for 8 seconds and <style=cIsUtility>regenerate their shields</style>. Each ally takes one stock of this skill.";
                mySkillDef.skillName             = "EXPANDEDSKILLS_SHIELDALL_UTILITY";
                mySkillDef.skillNameToken        = "Panic Button";

                LoadoutAPI.AddSkillDef(mySkillDef);

                GameObject   gameObject  = Resources.Load <GameObject>("prefabs/characterbodies/engibody");
                SkillLocator component   = gameObject.GetComponent <SkillLocator>();
                SkillFamily  skillFamily = component.utility.skillFamily;

                Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);

                skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
                {
                    skillDef       = mySkillDef,
                    unlockableName = "",
                    viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
                };
            }
        }
Esempio n. 24
0
        internal static void SecondarySetup()
        {
            SkillLocator component = characterPrefab.GetComponent <SkillLocator>();

            LanguageAPI.Add("ROCKETEER_SECONDARY_DETPACK_NAME", "Sticky Grenades");
            LanguageAPI.Add("ROCKETEER_SECONDARY_DETPACK_DESCRIPTION", "Stick to the wall. Or a guy. <style=cIsDamage>600% Damage.</style>");

            // set up your primary skill def here!

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

            mySkillDef.activationState            = new SerializableEntityStateType(typeof(RocketeerAimDetpack));
            mySkillDef.activationStateMachineName = "Weapon";
            mySkillDef.baseMaxStock                 = 3;
            mySkillDef.baseRechargeInterval         = 3f;
            mySkillDef.beginSkillCooldownOnSkillEnd = true;
            mySkillDef.canceledFromSprinting        = false;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.Skill;
            mySkillDef.isCombatSkill                = true;
            mySkillDef.mustKeyPress                 = false;
            mySkillDef.rechargeStock                = 1;
            mySkillDef.requiredStock                = 1;
            mySkillDef.stockToConsume               = 1;
            mySkillDef.icon = Resources.Load <Sprite>("Textures/MiscIcons/texMysteryIcon");
            mySkillDef.skillDescriptionToken = "ROCKETEER_SECONDARY_DETPACK_DESCRIPTION";
            mySkillDef.skillName             = "ROCKETEER_SECONDARY_DETPACK_NAME";
            mySkillDef.skillNameToken        = "ROCKETEER_SECONDARY_DETPACK_NAME";

            LoadoutAPI.AddSkillDef(mySkillDef);

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

            newFamily.variants = new SkillFamily.Variant[1];
            LoadoutAPI.AddSkillFamily(newFamily);
            component.secondary.SetFieldValue("_skillFamily", newFamily);
            SkillFamily skillFamily = component.secondary.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)
             * };*/


            ContentPacks.skillDefs.Add(mySkillDef);
            ContentPacks.skillFamilies.Add(newFamily);

            LoadoutAPI.AddSkill(typeof(RocketeerAimDetpack));
        }
Esempio n. 25
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)
             * };*/
            Debug.LogWarning("finished PrimarySetup");
        }
Esempio n. 26
0
        private static void UtilitySetup()
        {
            SkillLocator component = WispSurvivor.characterPrefab.GetComponent <SkillLocator>();

            LanguageAPI.Add("WISP_SIPHON_NAME", "Siphon");
            LanguageAPI.Add("WISP_SIPHON_DESCRIPTION", "<style=cIsHealing>Tether</style> to the nearest enemy. Drain their health and convert into <style=cShrine>barrier</style>");

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

            mySkillDef.activationState            = new SerializableEntityStateType(typeof(EntityStates.WispSurvivorStates.WispSiphon));
            mySkillDef.activationStateMachineName = "Weapon";
            mySkillDef.baseMaxStock                 = 1;
            mySkillDef.baseRechargeInterval         = 1f;
            mySkillDef.beginSkillCooldownOnSkillEnd = true;
            mySkillDef.canceledFromSprinting        = false;
            mySkillDef.fullRestockOnAssign          = true;
            mySkillDef.interruptPriority            = InterruptPriority.PrioritySkill;
            mySkillDef.isBullets             = false;
            mySkillDef.isCombatSkill         = false;
            mySkillDef.mustKeyPress          = true;
            mySkillDef.noSprint              = false;
            mySkillDef.rechargeStock         = 1;
            mySkillDef.requiredStock         = 1;
            mySkillDef.shootDelay            = 1f;
            mySkillDef.stockToConsume        = 1;
            mySkillDef.icon                  = Assets.icon3_siphon;
            mySkillDef.skillDescriptionToken = "WISP_SIPHON_DESCRIPTION";
            mySkillDef.skillName             = "WISP_SIPHON_NAME";
            mySkillDef.skillNameToken        = "WISP_SIPHON_NAME";

            LoadoutAPI.AddSkillDef(mySkillDef);
            component.utility = WispSurvivor.characterPrefab.AddComponent <GenericSkill>();

            SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>();

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

            skillFamily.variants[0] = new SkillFamily.Variant
            {
                skillDef       = mySkillDef,
                unlockableName = "",
                viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
            };
            siphonSkillDef = mySkillDef;
            short siphonIndex = EntityStates.StateIndexTable.TypeToIndex(typeof(EntityStates.WispSurvivorStates.WispSiphon));

            LanguageAPI.Add("WISP_TETHER_NAME", "Tether");
            LanguageAPI.Add("WISP_TETHER_DESCRIPTION", "<style=cIsHealing>Tether</style> to the nearest ally and increase regen rate. Gain <style=cShrine>barrier</style> when they deal damage.");

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

            tetherDef.activationState            = new SerializableEntityStateType(typeof(EntityStates.WispSurvivorStates.WispTether));
            tetherDef.activationStateMachineName = "Weapon";
            tetherDef.baseMaxStock                 = 1;
            tetherDef.baseRechargeInterval         = 1f;
            tetherDef.beginSkillCooldownOnSkillEnd = true;
            tetherDef.canceledFromSprinting        = false;
            tetherDef.fullRestockOnAssign          = true;
            tetherDef.interruptPriority            = InterruptPriority.PrioritySkill;
            tetherDef.isBullets             = false;
            tetherDef.isCombatSkill         = false;
            tetherDef.mustKeyPress          = true;
            tetherDef.noSprint              = false;
            tetherDef.rechargeStock         = 1;
            tetherDef.requiredStock         = 1;
            tetherDef.shootDelay            = 1f;
            tetherDef.stockToConsume        = 1;
            tetherDef.icon                  = Assets.icon3_tether;
            tetherDef.skillDescriptionToken = "WISP_TETHER_DESCRIPTION";
            tetherDef.skillName             = "WISP_TETHER_NAME";
            tetherDef.skillNameToken        = "WISP_TETHER_NAME";

            LoadoutAPI.AddSkillDef(tetherDef);  //For some reason this isn't loading properly, so tetherIndex will always resolve to -1
            tetherSkillDef = tetherDef;
            short tetherIndex = EntityStates.StateIndexTable.TypeToIndex(typeof(EntityStates.WispSurvivorStates.WispTether));

            if (tetherIndex == -1)
            {
                Debug.LogError("Issue setting up tether skilldef! Attempting to re-add...");

                TryAddSkill(typeof(EntityStates.WispSurvivorStates.WispTether));    //So...we just add again

                tetherIndex = EntityStates.StateIndexTable.TypeToIndex(typeof(EntityStates.WispSurvivorStates.WispTether));
            }
            Debug.Log("Set up tether skilldef. Index: " + tetherIndex);

            /*
             * Debug.Log("Last indicies: ");
             * for(short i = siphonIndex; i < tetherIndex; i++)
             * {
             *  Debug.Log(i + ": " + StateIndexTable.IndexToType(i));
             * }
             */
            // 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       = tetherDef,
                unlockableName = "",
                viewableNode   = new ViewablesCatalog.Node(tetherDef.skillNameToken, false, null)
            };
        }
Esempio n. 27
0
        void UtilitySkills()
        {
            {
                SkillLocator skillLocator = myCharacter.GetComponent <SkillLocator>();

                skillLocator.utility = myCharacter.AddComponent <GenericSkill>();
                SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>();
                newFamily.variants = new SkillFamily.Variant[3];

                LoadoutAPI.AddSkillFamily(newFamily);
                skillLocator.utility.SetFieldValue("_skillFamily", newFamily);
            }

            {
                GameObject   gameObject  = myCharacter;
                SkillLocator component   = gameObject.GetComponent <SkillLocator>();
                SkillFamily  skillFamily = component.utility.skillFamily;

                SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
                mySkillDef.activationState            = new SerializableEntityStateType(typeof(EntityStates.Toolbot.ToolbotDash));
                mySkillDef.activationStateMachineName = "WeaponGun";
                mySkillDef.baseMaxStock                 = 1;
                mySkillDef.baseRechargeInterval         = 12f;
                mySkillDef.beginSkillCooldownOnSkillEnd = true;
                mySkillDef.canceledFromSprinting        = false;
                mySkillDef.fullRestockOnAssign          = true;
                mySkillDef.interruptPriority            = InterruptPriority.Any;
                mySkillDef.isBullets             = false;
                mySkillDef.isCombatSkill         = true;
                mySkillDef.mustKeyPress          = false;
                mySkillDef.noSprint              = false;
                mySkillDef.rechargeStock         = 1;
                mySkillDef.requiredStock         = 1;
                mySkillDef.shootDelay            = 1f;
                mySkillDef.stockToConsume        = 1;
                mySkillDef.icon                  = Resources.Load <GameObject>("Prefabs/CharacterBodies/toolbotbody").GetComponent <SkillLocator>().utility.skillFamily.variants[0].skillDef.icon;
                mySkillDef.skillDescriptionToken = "Gain a boost of movement";
                mySkillDef.skillName             = "PP_PLAYABLETC_Utility";
                mySkillDef.skillNameToken        = "Movement Boost";

                LoadoutAPI.AddSkillDef(mySkillDef);


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


            LoadoutAPI.AddSkill(typeof(EnterPainter));
            {
                SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
                mySkillDef.activationState            = new SerializableEntityStateType(typeof(EnterPainter));
                mySkillDef.activationStateMachineName = "WeaponGun";
                mySkillDef.baseMaxStock                 = 16;
                mySkillDef.baseRechargeInterval         = 2f;
                mySkillDef.beginSkillCooldownOnSkillEnd = true;
                mySkillDef.canceledFromSprinting        = false;
                mySkillDef.fullRestockOnAssign          = false;
                mySkillDef.interruptPriority            = InterruptPriority.PrioritySkill;
                mySkillDef.isBullets             = false;
                mySkillDef.isCombatSkill         = false;
                mySkillDef.mustKeyPress          = false;
                mySkillDef.noSprint              = true;
                mySkillDef.rechargeStock         = 1;
                mySkillDef.requiredStock         = 1;
                mySkillDef.shootDelay            = 0f;
                mySkillDef.stockToConsume        = 0;
                mySkillDef.icon                  = Resources.Load <GameObject>("Prefabs/CharacterBodies/engibody").GetComponent <SkillLocator>().utility.skillFamily.variants[1].skillDef.icon;
                mySkillDef.skillDescriptionToken = "Enter target-painting mode.";
                mySkillDef.skillName             = "PP_PLAYABLETC_PAINT";
                mySkillDef.skillNameToken        = "Target Acquisition";

                LoadoutAPI.AddSkillDef(mySkillDef);
                GameObject   gameObject  = myCharacter;
                SkillLocator component   = gameObject.GetComponent <SkillLocator>();
                SkillFamily  skillFamily = component.utility.skillFamily;

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

            LoadoutAPI.AddSkill(typeof(AllyPing));
            {
                SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
                mySkillDef.activationState            = new SerializableEntityStateType(typeof(AllyPing));
                mySkillDef.activationStateMachineName = "WeaponGun";
                mySkillDef.baseMaxStock                 = 1;
                mySkillDef.baseRechargeInterval         = 10f;
                mySkillDef.beginSkillCooldownOnSkillEnd = false;
                mySkillDef.canceledFromSprinting        = false;
                mySkillDef.fullRestockOnAssign          = false;
                mySkillDef.interruptPriority            = InterruptPriority.PrioritySkill;
                mySkillDef.isBullets             = false;
                mySkillDef.isCombatSkill         = false;
                mySkillDef.mustKeyPress          = false;
                mySkillDef.noSprint              = true;
                mySkillDef.rechargeStock         = 1;
                mySkillDef.requiredStock         = 1;
                mySkillDef.shootDelay            = 0f;
                mySkillDef.stockToConsume        = 1;
                mySkillDef.icon                  = Resources.Load <GameObject>("Prefabs/CharacterBodies/huntressbody").GetComponent <SkillLocator>().utility.skillFamily.variants[1].skillDef.icon;
                mySkillDef.skillDescriptionToken = "Command your drones to target an enemy or ally that you have pinged for 5 seconds";
                mySkillDef.skillName             = "PP_PLAYABLETC_ALLYPING";
                mySkillDef.skillNameToken        = "Additional Directives";

                LoadoutAPI.AddSkillDef(mySkillDef);
                GameObject   gameObject  = myCharacter;
                SkillLocator component   = gameObject.GetComponent <SkillLocator>();
                SkillFamily  skillFamily = component.utility.skillFamily;

                skillFamily.variants[2] =
                    new SkillFamily.Variant
                {
                    skillDef       = mySkillDef,
                    unlockableName = "",
                    viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
                };
            }
        }
        public static void Setup()
        {
            #region artificer

            LoadoutAPI.AddSkill(typeof(VTStates.States.Mage.FireSeekingProjectile));
            {
                SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
                mySkillDef.activationState            = new SerializableEntityStateType(typeof(VTStates.States.Mage.FireSeekingProjectile));
                mySkillDef.activationStateMachineName = "Weapon";
                mySkillDef.baseMaxStock                 = 4;
                mySkillDef.baseRechargeInterval         = 1.25f;
                mySkillDef.beginSkillCooldownOnSkillEnd = false;
                mySkillDef.canceledFromSprinting        = false;
                mySkillDef.fullRestockOnAssign          = true;
                mySkillDef.interruptPriority            = InterruptPriority.Frozen;
                mySkillDef.isBullets      = false;
                mySkillDef.isCombatSkill  = true;
                mySkillDef.mustKeyPress   = false;
                mySkillDef.noSprint       = false;
                mySkillDef.rechargeStock  = 1;
                mySkillDef.requiredStock  = 1;
                mySkillDef.shootDelay     = 0f;
                mySkillDef.stockToConsume = 1;
                //mySkillDef.icon = Resources.Load<Sprite>()
                mySkillDef.skillDescriptionToken = "Launch 2 <style=cIsUtility>homing</style> bolts of fire, dealing <style=cIsDamage> 80% Damage</style> each";
                mySkillDef.skillName             = "VT_FIRE_PRIMARY";
                mySkillDef.skillNameToken        = "Heat Seekers";

                LoadoutAPI.AddSkillDef(mySkillDef);

                GameObject   gameObject  = Resources.Load <GameObject>("prefabs/characterbodies/magebody");
                SkillLocator component   = gameObject.GetComponent <SkillLocator>();
                SkillFamily  skillFamily = component.primary.skillFamily;

                Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);

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

            {
                GameObject   gameObject = Resources.Load <GameObject>("prefabs/characterbodies/magebody");
                SkillLocator component  = gameObject.GetComponent <SkillLocator>();
                SkillFamily  primary    = component.primary.skillFamily;
                SkillFamily  secondary  = component.secondary.skillFamily;


                int cacheNumPrimary   = primary.variants.Length;
                int cacheNumSecondary = secondary.variants.Length;

                {
                    for (int i = 0; i < cacheNumPrimary; i++)
                    {
                        Array.Resize(ref secondary.variants, secondary.variants.Length + 1);
                        secondary.variants[secondary.variants.Length - 1] = primary.variants[i];
                    }

                    for (int i = 0; i < cacheNumSecondary; i++)
                    {
                        Array.Resize(ref primary.variants, primary.variants.Length + 1);
                        primary.variants[primary.variants.Length - 1] = secondary.variants[i];
                    }
                }
            }
            LoadoutAPI.AddSkill(typeof(VTStates.States.Mage.GravBomb));
            {
                SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
                mySkillDef.activationState            = new SerializableEntityStateType(typeof(VTStates.States.Mage.GravBomb));
                mySkillDef.activationStateMachineName = "Weapon";
                mySkillDef.baseMaxStock                 = 1;
                mySkillDef.baseRechargeInterval         = 30f;
                mySkillDef.beginSkillCooldownOnSkillEnd = true;
                mySkillDef.canceledFromSprinting        = false;
                mySkillDef.fullRestockOnAssign          = true;
                mySkillDef.interruptPriority            = InterruptPriority.PrioritySkill;
                mySkillDef.isBullets      = false;
                mySkillDef.isCombatSkill  = true;
                mySkillDef.mustKeyPress   = true;
                mySkillDef.noSprint       = false;
                mySkillDef.rechargeStock  = 1;
                mySkillDef.requiredStock  = 1;
                mySkillDef.shootDelay     = 0f;
                mySkillDef.stockToConsume = 1;
                //mySkillDef.icon = Resources.Load<Sprite>()
                mySkillDef.skillDescriptionToken = "Launch a <style=cIsUtility>tethering black hole</style> that explodes on impact with the world, dealing <style=cIsDamage> 800% Damage</style>";
                mySkillDef.skillName             = "VT_FIRE_SPECIAL";
                mySkillDef.skillNameToken        = "Gravitic Compulsion";

                LoadoutAPI.AddSkillDef(mySkillDef);

                GameObject   gameObject  = Resources.Load <GameObject>("prefabs/characterbodies/magebody");
                SkillLocator component   = gameObject.GetComponent <SkillLocator>();
                SkillFamily  skillFamily = component.special.skillFamily;

                Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);

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

            LoadoutAPI.AddSkill(typeof(VTStates.States.Mage.SummonFlameImp));
            {
                SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>();
                mySkillDef.activationState            = new SerializableEntityStateType(typeof(VTStates.States.Mage.SummonFlameImp));
                mySkillDef.activationStateMachineName = "Weapon";
                mySkillDef.baseMaxStock                 = 1;
                mySkillDef.baseRechargeInterval         = 30f;
                mySkillDef.beginSkillCooldownOnSkillEnd = true;
                mySkillDef.canceledFromSprinting        = false;
                mySkillDef.fullRestockOnAssign          = true;
                mySkillDef.interruptPriority            = InterruptPriority.PrioritySkill;
                mySkillDef.isBullets      = false;
                mySkillDef.isCombatSkill  = true;
                mySkillDef.mustKeyPress   = true;
                mySkillDef.noSprint       = false;
                mySkillDef.rechargeStock  = 1;
                mySkillDef.requiredStock  = 1;
                mySkillDef.shootDelay     = 0f;
                mySkillDef.stockToConsume = 1;
                //mySkillDef.icon = Resources.Load<Sprite>()
                mySkillDef.skillDescriptionToken = "Summon a Blazing Imp, with random items that match how many you have.";
                mySkillDef.skillName             = "VT_FIREIMP_SPECIAL";
                mySkillDef.skillNameToken        = "Summon Elemental";

                LoadoutAPI.AddSkillDef(mySkillDef);

                GameObject   gameObject  = Resources.Load <GameObject>("prefabs/characterbodies/magebody");
                SkillLocator component   = gameObject.GetComponent <SkillLocator>();
                SkillFamily  skillFamily = component.special.skillFamily;

                Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);

                skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant
                {
                    skillDef       = mySkillDef,
                    unlockableName = "EQUIPMENT_BFG_NAME",
                    viewableNode   = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null)
                };
            }
            #endregion artificer
        }
Esempio n. 29
0
        private void AssignSecondary(SkillLocator sk)
        {
            SkillFamily secondarySkillFamily = ScriptableObject.CreateInstance <SkillFamily>();

            secondarySkillFamily.defaultVariantIndex = 0u;
            secondarySkillFamily.variants            = new SkillFamily.Variant[1];
            Reflection.SetFieldValue <SkillFamily>(sk.secondary, "_skillFamily", secondarySkillFamily);

            SkillDef secondaryHeatWaveDef = SkillDef.CreateInstance <SkillDef>();

            secondaryHeatWaveDef.activationState            = new SerializableEntityStateType(typeof(HeatWave));
            secondaryHeatWaveDef.activationStateMachineName = "Weapon";
            secondaryHeatWaveDef.baseMaxStock                 = 1;
            secondaryHeatWaveDef.baseRechargeInterval         = 0f;
            secondaryHeatWaveDef.beginSkillCooldownOnSkillEnd = true;
            secondaryHeatWaveDef.canceledFromSprinting        = false;
            secondaryHeatWaveDef.dontAllowPastMaxStocks       = true;
            secondaryHeatWaveDef.forceSprintDuringState       = false;
            secondaryHeatWaveDef.fullRestockOnAssign          = true;
            secondaryHeatWaveDef.icon = Resources.Load <Sprite>(assetPrefix + ":skill2.png");
            secondaryHeatWaveDef.interruptPriority     = InterruptPriority.Skill;
            secondaryHeatWaveDef.isBullets             = true;
            secondaryHeatWaveDef.isCombatSkill         = true;
            secondaryHeatWaveDef.keywordTokens         = new string[] { "KEYWORD_PYRO_HEAT" };
            secondaryHeatWaveDef.mustKeyPress          = false;
            secondaryHeatWaveDef.noSprint              = false;
            secondaryHeatWaveDef.rechargeStock         = 1;
            secondaryHeatWaveDef.requiredStock         = 1;
            secondaryHeatWaveDef.shootDelay            = 0f;
            secondaryHeatWaveDef.skillName             = "FireBlast";
            secondaryHeatWaveDef.skillNameToken        = "PYRO_SECONDARY_NAME";
            secondaryHeatWaveDef.skillDescriptionToken = "PYRO_SECONDARY_DESC";
            secondaryHeatWaveDef.stockToConsume        = 0;
            LoadoutAPI.AddSkill(typeof(HeatWave));
            LoadoutAPI.AddSkillDef(secondaryHeatWaveDef);
            secondarySkillFamily.variants[0] = new SkillFamily.Variant
            {
                skillDef       = secondaryHeatWaveDef,
                unlockableName = "",
                viewableNode   = new ViewablesCatalog.Node(secondaryHeatWaveDef.skillNameToken, false)
            };

            SkillDef secondaryBurnDef = SkillDef.CreateInstance <SkillDef>();

            secondaryBurnDef.activationState            = new SerializableEntityStateType(typeof(SuppressiveFire));
            secondaryBurnDef.activationStateMachineName = "Weapon";
            secondaryBurnDef.baseMaxStock                 = 1;
            secondaryBurnDef.baseRechargeInterval         = 0f;
            secondaryBurnDef.beginSkillCooldownOnSkillEnd = true;
            secondaryBurnDef.canceledFromSprinting        = false;
            secondaryBurnDef.dontAllowPastMaxStocks       = true;
            secondaryBurnDef.forceSprintDuringState       = false;
            secondaryBurnDef.fullRestockOnAssign          = true;
            secondaryBurnDef.icon = Resources.Load <Sprite>(assetPrefix + ":skill2.png");
            secondaryBurnDef.interruptPriority     = InterruptPriority.Skill;
            secondaryBurnDef.isBullets             = true;
            secondaryBurnDef.isCombatSkill         = true;
            secondaryBurnDef.keywordTokens         = new string[] { "KEYWORD_PYRO_HEAT" };
            secondaryBurnDef.mustKeyPress          = false;
            secondaryBurnDef.noSprint              = true;
            secondaryBurnDef.rechargeStock         = 1;
            secondaryBurnDef.requiredStock         = 1;
            secondaryBurnDef.shootDelay            = 0f;
            secondaryBurnDef.skillName             = "SuppressiveFire";
            secondaryBurnDef.skillNameToken        = "PYRO_SECONDARY_ALT_NAME";
            secondaryBurnDef.skillDescriptionToken = "PYRO_SECONDARY_ALT_DESC";
            secondaryBurnDef.stockToConsume        = 0;
            LoadoutAPI.AddSkillDef(secondaryBurnDef);
            Array.Resize(ref secondarySkillFamily.variants, secondarySkillFamily.variants.Length + 1);
            secondarySkillFamily.variants[secondarySkillFamily.variants.Length - 1] = new SkillFamily.Variant
            {
                skillDef       = secondaryBurnDef,
                unlockableName = "",
                viewableNode   = new ViewablesCatalog.Node(secondaryBurnDef.skillNameToken, false)
            };
            LoadoutAPI.AddSkill(typeof(SuppressiveFire));
        }