Example #1
0
        private void RegisterSkills(GameObject sephPrefab)
        {
            // first get the locator
            var locator = sephPrefab.GetComponentInChildren <SkillLocator>();

            // passive?
            locator.passiveSkill.enabled = true;
            locator.passiveSkill.skillDescriptionToken = "Attacks from Sephiroths Masamune leech life on hit.";
            locator.passiveSkill.skillNameToken        = "Masamune";
            locator.passiveSkill.icon = Assets.SephIcon;

            // create skill def for primary
            SkillDef primaryDef = SkillDef.CreateInstance <SkillDef>();

            primaryDef.activationState = new EntityStates.SerializableEntityStateType(typeof(EntityStates.Sephiroth.Primary));
            var field2 = typeof(EntityStates.SerializableEntityStateType)?.GetField("_typeName", BindingFlags.NonPublic | BindingFlags.Instance);

            field2?.SetValue(primaryDef.activationState, typeof(EntityStates.Sephiroth.Primary)?.AssemblyQualifiedName);
            primaryDef.baseRechargeInterval         = 1f;
            primaryDef.baseMaxStock                 = 1;
            primaryDef.rechargeStock                = 1;
            primaryDef.skillName                    = "SephSwipe";
            primaryDef.skillNameToken               = "Heartless Angel";
            primaryDef.skillDescriptionToken        = "Sephiroth unleashes a barrage of deadly precise attacks at high speed.";
            primaryDef.activationStateMachineName   = locator.secondary.skillFamily.variants[0].skillDef.activationStateMachineName;
            primaryDef.isBullets                    = false;
            primaryDef.beginSkillCooldownOnSkillEnd = true;
            primaryDef.interruptPriority            = EntityStates.InterruptPriority.Any;
            primaryDef.isCombatSkill                = true;
            primaryDef.noSprint = false;
            primaryDef.canceledFromSprinting = false;
            primaryDef.mustKeyPress          = true;
            primaryDef.requiredStock         = 1;
            primaryDef.stockToConsume        = 0;
            primaryDef.icon = Assets.SephIcon;

            // skill family for primary
            var primaryFam = SkillFamily.CreateInstance <SkillFamily>();

            primaryFam.defaultVariantIndex = 0;
            SkillFamily.Variant[] variantsPrimary = new SkillFamily.Variant[1];
            variantsPrimary[0] = new SkillFamily.Variant()
            {
                skillDef = primaryDef, unlockableName = "", viewableNode = new ViewablesCatalog.Node("M1", false)
            };
            primaryFam.variants = variantsPrimary;
            ((ScriptableObject)primaryFam).name = "sephPrimary";

            //primary
            SkillAPI.AddSkill(typeof(EntityStates.Sephiroth.Primary));
            SkillAPI.AddSkillDef(primaryDef);
            SkillAPI.AddSkillFamily(primaryFam);

            // add skills to player
            locator.primary.SetFieldValue <SkillFamily>("_skillFamily", primaryFam);
        }
Example #2
0
        private void AssignUtility(SkillLocator sk)
        {
            JetpackStateMachineSetup(sk.gameObject);

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

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

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

            utilityJetpackDef.activationState            = new SerializableEntityStateType(typeof(Jetpack));
            utilityJetpackDef.activationStateMachineName = "Jetpack";
            utilityJetpackDef.baseMaxStock                 = 1;
            utilityJetpackDef.baseRechargeInterval         = 5f;
            utilityJetpackDef.beginSkillCooldownOnSkillEnd = true;
            utilityJetpackDef.canceledFromSprinting        = false;
            utilityJetpackDef.dontAllowPastMaxStocks       = true;
            utilityJetpackDef.forceSprintDuringState       = true;
            utilityJetpackDef.fullRestockOnAssign          = true;
            utilityJetpackDef.icon = Resources.Load <Sprite>(assetPrefix + ":skill3.png");
            utilityJetpackDef.interruptPriority     = InterruptPriority.Skill;
            utilityJetpackDef.isBullets             = false;
            utilityJetpackDef.isCombatSkill         = false;
            utilityJetpackDef.keywordTokens         = new string[] { "KEYWORD_PYRO_HEAT" };
            utilityJetpackDef.mustKeyPress          = false;
            utilityJetpackDef.noSprint              = false;
            utilityJetpackDef.rechargeStock         = 1;
            utilityJetpackDef.requiredStock         = 1;
            utilityJetpackDef.shootDelay            = 0f;
            utilityJetpackDef.skillName             = "Jetpack";
            utilityJetpackDef.skillNameToken        = "PYRO_UTILITY_NAME";
            utilityJetpackDef.skillDescriptionToken = "PYRO_UTILITY_DESC";
            utilityJetpackDef.stockToConsume        = 1;
            LoadoutAPI.AddSkill(typeof(Jetpack));
            LoadoutAPI.AddSkillDef(utilityJetpackDef);
            utilitySkillFamily.variants[0] = new SkillFamily.Variant
            {
                skillDef       = utilityJetpackDef,
                unlockableName = "",
                viewableNode   = new ViewablesCatalog.Node(utilityJetpackDef.skillNameToken, false)
            };
        }
Example #3
0
        private void AssignPrimary(SkillLocator sk)
        {
            SkillFamily primarySkillFamily = ScriptableObject.CreateInstance <SkillFamily>();

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

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

            primaryScorchDef.activationState            = new SerializableEntityStateType(typeof(Scorch));
            primaryScorchDef.activationStateMachineName = "Weapon";
            primaryScorchDef.baseMaxStock                 = 1;
            primaryScorchDef.baseRechargeInterval         = 0f;
            primaryScorchDef.beginSkillCooldownOnSkillEnd = false;
            primaryScorchDef.canceledFromSprinting        = false;
            primaryScorchDef.dontAllowPastMaxStocks       = true;
            primaryScorchDef.forceSprintDuringState       = false;
            primaryScorchDef.fullRestockOnAssign          = true;
            primaryScorchDef.icon = Resources.Load <Sprite>(assetPrefix + ":skill1.png");
            primaryScorchDef.interruptPriority     = InterruptPriority.Any;
            primaryScorchDef.isBullets             = true;
            primaryScorchDef.isCombatSkill         = true;
            primaryScorchDef.keywordTokens         = new string[] { };
            primaryScorchDef.mustKeyPress          = false;
            primaryScorchDef.noSprint              = true;
            primaryScorchDef.rechargeStock         = 1;
            primaryScorchDef.requiredStock         = 1;
            primaryScorchDef.shootDelay            = 0f;
            primaryScorchDef.skillName             = "Scorch";
            primaryScorchDef.skillNameToken        = "PYRO_PRIMARY_NAME";
            primaryScorchDef.skillDescriptionToken = "PYRO_PRIMARY_DESC";
            primaryScorchDef.stockToConsume        = 1;
            LoadoutAPI.AddSkill(typeof(Scorch));
            LoadoutAPI.AddSkillDef(primaryScorchDef);
            primarySkillFamily.variants[0] = new SkillFamily.Variant
            {
                skillDef       = primaryScorchDef,
                unlockableName = "",
                viewableNode   = new ViewablesCatalog.Node(primaryScorchDef.skillNameToken, false)
            };
        }
        public SkillDef GetSkillDefinition(string activationStateMachineName)
        {
            SkillDef primaryDef = SkillDef.CreateInstance <SkillDef>();

            primaryDef.activationState              = new EntityStates.SerializableEntityStateType(typeof(Primary));
            primaryDef.baseRechargeInterval         = 1f;
            primaryDef.baseMaxStock                 = 5;
            primaryDef.rechargeStock                = 1;
            primaryDef.skillName                    = "MySkillName";
            primaryDef.skillNameToken               = "My Name Token";
            primaryDef.skillDescriptionToken        = "This is the description of the primary skill.";
            primaryDef.activationStateMachineName   = activationStateMachineName;
            primaryDef.isBullets                    = false;
            primaryDef.beginSkillCooldownOnSkillEnd = true;
            primaryDef.interruptPriority            = EntityStates.InterruptPriority.Skill;
            primaryDef.isCombatSkill                = true;
            primaryDef.noSprint = false;
            primaryDef.canceledFromSprinting = false;
            primaryDef.mustKeyPress          = true;
            primaryDef.requiredStock         = 1;
            primaryDef.stockToConsume        = 1;
            return(primaryDef);
        }
        public void Start()
        {
            #region cfg
            BlastDamage        = base.Config.Wrap <float>("Blast", "Damage", "How much damage Blast deals. Default: 2", 2f);
            BlastMagnetism     = base.Config.Wrap <float>("Blast", "Radius", "How wide Blast shots are. Default: 0.2, 0 disables smart collision", 0.2f);
            BlastMaxFireRate   = base.Config.Wrap <float>("Blast", "Auto firerate", "Time between shots while autofiring. Default: 0.3", 0.3f);
            BlastMinFireRate   = base.Config.Wrap <float>("Blast", "Max firerate", "Time between shots while mashing. Default: 0.2", 0.2f);
            BlastReloadTime    = base.Config.Wrap <float>("Blast", "Reload Time", "Time it takes to reload Blast. Default: 1, 0 removes reload", 1f);
            BlastMagSize       = base.Config.Wrap <int>("Blast", "Mag Size", "How many slugs Blast can shoot before reloading. Default: 8", 8);
            BlastSpread        = base.Config.Wrap <float>("Blast", "Spread", "How much spread each shot adds. Default: 0.25", 0.25f);
            BlastForce         = base.Config.Wrap <float>("Blast", "Force", "How much push force each shot has. Default: 1000", 1000f);
            BlastReloadScaling = base.Config.Wrap <bool>("Blast", "Reload Speed Scaling", "Scale reload speed with attack speed. Default: true", true);

            LightsOutCooldown       = base.Config.Wrap <float>("Lights Out", "Cooldown", "How long it takes for Lights Out to recharge. Default: 6", 6f);
            LightsOutDamage         = base.Config.Wrap <float>("Lights Out", "Damage", "How much damage Lights Out deals. Default: 6", 6f);
            LightsOutDuration       = base.Config.Wrap <float>("Lights Out", "Duration", "Length of the shooting animation. Default: 0.6", 0.6f);
            LightsOutForce          = base.Config.Wrap <float>("Lights Out", "Force", "How much push force each shot has. Default: 1000", 1000f);
            LightsOutIgnoreArmor    = base.Config.Wrap <bool>("Lights Out", "Ignores Armor", "Makes Lights Out ignore armor. This makes it not receive any benefits from Weaken/Shattering Justice. Default: false", false);
            LightsOutReloadsPrimary = base.Config.Wrap <bool>("Lights Out", "Reload Primary On-Use", "Automatically reload your primary when using Lights Out. Default: true", true);
            LightsOutSecondary      = base.Config.Wrap <bool>("Lights Out", "Use as Secondary", "Use Lights Out in the secondary slot. False puts it in the Special slot. Default: true", true);

            SmokeCooldown    = base.Config.Wrap <float>("Smokebomb", "Cooldown", "How long Smokebomb takes to recharge. Default: 6", 6f);
            SmokeDamage      = base.Config.Wrap <float>("Smokebomb", "Damage", "How much damage Smokebomb deals. Default: 2", 2f);
            SmokeRadius      = base.Config.Wrap <float>("Smokebomb", "Radius", "How large the stun aura is. Default: 10", 10f);
            SmokeMinDuration = base.Config.Wrap <float>("Smokebomb", "MinDuration", "How long a player must wait before being able to attack after entering cloak. Default: 0.4", 0.4f);
            SmokeDuration    = base.Config.Wrap <float>("Smokebomb", "Invis Duration", "How long Smokebomb's Invisibility lasts. Default: 3", 3f);

            GrenCooldown    = base.Config.Wrap <float>("Grenade Toss", "Cooldown", "How long Grenade Toss takes to recharge. Default: 6", 6f);
            GrenDamage      = base.Config.Wrap <float>("Grenade Toss", "Damage", "How much damage Grenade Toss deals. Default: 4", 4f);
            GrenRadius      = base.Config.Wrap <float>("Grenade Toss", "Radius", "Grenade explosive radius. Default: 8", 8f);
            AcidBombEnabled = base.Config.Wrap <bool>("Grenade Toss", "Weaken on Hit", "Replace Grenade Toss with a weakening Acid Bomb. Default: true", true);

            LightsOutExecute = base.Config.Wrap <bool>("zExperimental: Lights Out Execute", "Execute Low HP Enemies", "Experimental: Lights Out executes enemies below a certain HP. This setting is host-based. Default: true", true);
            LightsOutExecutePercentageBase = base.Config.Wrap <float>("zExperimental: Lights Out Execute", "Execute HP Percentage", "Experimental: HP percentage where Lights Out executes. Default: 0.2", 0.2f);

            LightsOutLevelScalingEnabled = base.Config.Wrap <bool>("zExperimental: Lights Out Damage Scaling", "Damage Scaling", "Experimental: Lights Out gains extra damage with each level. Default: false", false);
            LightsOutLevelScalingRate    = base.Config.Wrap <float>("zExperimental: Lights Out Damage Scaling", "Damage Scaling Rate", "Experimental: How much extra damage Lights Out gains each level. Default: 0.1", 0.1f);
            LightsOutLevelScalingMax     = base.Config.Wrap <float>("zExperimental: Lights Out Damage Scaling", "Damage Scaling Max", "Experimental: How much extra damage Lights Out can gain in total. Default: 4", 4f);

            #endregion

            GameObject banditBody = Resources.Load <GameObject>("prefabs/characterbodies/banditbody");
            banditBody.GetComponent <CharacterBody>().preferredPodPrefab = Resources.Load <GameObject>("prefabs/networkedobjects/survivorpod");
            SkillLocator   skillComponent = banditBody.GetComponent <SkillLocator>();
            GenericSkill[] banditSkills   = banditBody.GetComponents <GenericSkill>();

            banditBody.GetComponent <CharacterBody>().baseRegen  = 1f;
            banditBody.GetComponent <CharacterBody>().levelRegen = 0.2f;

            #region primary
            SkillDef primaryDef = SkillDef.CreateInstance <SkillDef>();
            primaryDef.activationState = new EntityStates.SerializableEntityStateType(typeof(EntityStates.Bandit.Blast));
            var field = typeof(EntityStates.SerializableEntityStateType)?.GetField("_typeName", BindingFlags.NonPublic | BindingFlags.Instance);
            field?.SetValue(primaryDef.activationState, typeof(EntityStates.Bandit.Blast)?.AssemblyQualifiedName);

            primaryDef.baseRechargeInterval = BlastReloadTime.Value;
            if (BlastReloadTime.Value == 0f)
            {
                primaryDef.baseMaxStock = 1;
            }
            else
            {
                primaryDef.baseMaxStock  = BlastMagSize.Value;
                primaryDef.rechargeStock = BlastMagSize.Value;
            }
            Blast.bulletRadius = BlastMagnetism.Value;
            if (BlastMagnetism.Value == 0f)
            {
                Blast.blastSmartCollision = false;
            }
            Blast.spreadBloomValue           = BlastSpread.Value;
            Blast.damageCoefficient          = BlastDamage.Value;
            Blast.baseMaxDuration            = BlastMaxFireRate.Value;
            Blast.baseMinDuration            = BlastMinFireRate.Value;
            Blast.force                      = BlastForce.Value;
            Blast.reloadScaling              = BlastReloadScaling.Value;
            primaryDef.skillDescriptionToken = "Fire a powerful slug for <color=#E5C962>" + Blast.damageCoefficient.ToString("P0").Replace(" ", "") + " damage.</color>";
            if (BlastReloadTime.Value > 0f && BlastMagSize.Value > 1)
            {
                primaryDef.skillDescriptionToken += " Reload every " + BlastMagSize.Value + " shots.";
            }

            primaryDef.skillName                    = "Blast";
            primaryDef.skillNameToken               = "Blast";
            primaryDef.activationStateMachineName   = skillComponent.primary.skillFamily.variants[0].skillDef.activationStateMachineName;
            primaryDef.isBullets                    = true;
            primaryDef.shootDelay                   = 0;
            primaryDef.beginSkillCooldownOnSkillEnd = false;
            primaryDef.interruptPriority            = EntityStates.InterruptPriority.Any;
            primaryDef.isCombatSkill                = true;
            primaryDef.noSprint = true;
            primaryDef.canceledFromSprinting = false;
            primaryDef.mustKeyPress          = false;
            primaryDef.icon           = skillComponent.primary.skillFamily.variants[0].skillDef.icon;
            primaryDef.requiredStock  = 1;
            primaryDef.stockToConsume = 1;
            skillComponent.primary.skillFamily.variants[0].skillDef = primaryDef;
            #endregion
            #region secondary
            SkillDef secondaryDef = SkillDef.CreateInstance <SkillDef>();
            secondaryDef.activationState = new EntityStates.SerializableEntityStateType(typeof(EntityStates.Bandit.PrepLightsOut));
            field = typeof(EntityStates.SerializableEntityStateType)?.GetField("_typeName", BindingFlags.NonPublic | BindingFlags.Instance);
            field?.SetValue(secondaryDef.activationState, typeof(EntityStates.Bandit.PrepLightsOut)?.AssemblyQualifiedName);
            secondaryDef.baseRechargeInterval = LightsOutCooldown.Value;
            FireLightsOut.damageCoefficient   = LightsOutDamage.Value;
            FireLightsOut.force                    = LightsOutForce.Value;
            PrepLightsOut.baseDuration             = LightsOutDuration.Value;
            FireLightsOut.gainDamageWithLevel      = LightsOutLevelScalingEnabled.Value;
            FireLightsOut.gainDamgeWithLevelAmount = LightsOutLevelScalingRate.Value;
            FireLightsOut.gainDamgeWithLevelMax    = LightsOutLevelScalingMax.Value;
            PrepLightsOut.reloadPrimary            = LightsOutReloadsPrimary.Value;
            if (LightsOutIgnoreArmor.Value)
            {
                FireLightsOut.ignoreArmor = true;
            }
            else
            {
                FireLightsOut.ignoreArmor = false;
            }
            secondaryDef.skillDescriptionToken = "Take aim with a revolver, <color=#E5C962>dealing " + FireLightsOut.damageCoefficient.ToString("P0").Replace(" ", "") + " damage.</color> If the ability <color=#E5C962>kills an enemy,</color> <color=#95CDE5>skill cooldowns are all reset to 0.</color>";
            if (LightsOutLevelScalingEnabled.Value)
            {
                secondaryDef.skillDescriptionToken += " Gains an extra <color=#E5C962>" + LightsOutLevelScalingRate.Value.ToString("P0").Replace(" ", "") + " damage</color> per level.";
            }
            if (LightsOutExecute.Value)
            {
                secondaryDef.skillDescriptionToken += " Enemies are instantly killed if their <color=#E5C962>health drops below " + LightsOutExecutePercentageBase.Value.ToString("P0").Replace(" ", "") + ".</color>";
            }
            if (FireLightsOut.ignoreArmor)
            {
                secondaryDef.skillDescriptionToken += " <color=#E5C962> Ignores armor.</color>";
            }
            secondaryDef.skillNameToken             = "Lights Out";
            secondaryDef.skillName                  = "LightsOut";
            secondaryDef.baseMaxStock               = 1;
            secondaryDef.rechargeStock              = 1;
            secondaryDef.isBullets                  = false;
            secondaryDef.shootDelay                 = 0.3f;
            secondaryDef.activationStateMachineName = skillComponent.secondary.skillFamily.variants[0].skillDef.activationStateMachineName;
            secondaryDef.icon = skillComponent.secondary.skillFamily.variants[0].skillDef.icon;
            secondaryDef.interruptPriority            = EntityStates.InterruptPriority.Skill;
            secondaryDef.beginSkillCooldownOnSkillEnd = false;
            secondaryDef.isCombatSkill         = true;
            secondaryDef.canceledFromSprinting = false;
            secondaryDef.mustKeyPress          = false;
            secondaryDef.requiredStock         = 1;
            secondaryDef.stockToConsume        = 1;
            #endregion
            #region utility
            skillComponent.utility.skillFamily.variants[0].skillDef.baseRechargeInterval         = SmokeCooldown.Value;
            skillComponent.utility.skillFamily.variants[0].skillDef.beginSkillCooldownOnSkillEnd = true;
            EntityStates.Commando.CommandoWeapon.CastSmokescreenNoDelay.damageCoefficient        = SmokeDamage.Value;
            EntityStates.Commando.CommandoWeapon.CastSmokescreenNoDelay.radius = SmokeRadius.Value;
            EntityStates.Commando.CommandoWeapon.CastSmokescreenNoDelay.minimumStateDuration = SmokeMinDuration.Value;
            EntityStates.Commando.CommandoWeapon.CastSmokescreenNoDelay.duration             = SmokeDuration.Value;
            skillComponent.utility.skillFamily.variants[0].skillDef.skillNameToken           = "Smokebomb";
            skillComponent.utility.skillFamily.variants[0].skillDef.skillDescriptionToken    = "<color=#95CDE5>Turn invisible.</color> After " + EntityStates.Commando.CommandoWeapon.CastSmokescreenNoDelay.duration.ToString("N1") + " seconds or after using another ability, surprise and <color=#E5C962>stun enemies for " + EntityStates.Commando.CommandoWeapon.CastSmokescreenNoDelay.damageCoefficient.ToString("P0").Replace(" ", "") + " damage.</color>";
            #endregion
            #region special
            SkillDef specialDef = SkillDef.CreateInstance <SkillDef>();
            specialDef.activationState = new EntityStates.SerializableEntityStateType(typeof(EntityStates.Bandit.GrenadeToss));
            field = typeof(EntityStates.SerializableEntityStateType)?.GetField("_typeName", BindingFlags.NonPublic | BindingFlags.Instance);
            field?.SetValue(specialDef.activationState, typeof(EntityStates.Bandit.GrenadeToss)?.AssemblyQualifiedName);

            if (!AcidBombEnabled.Value)
            {
                specialDef.skillNameToken = "Grenade Toss";
            }
            else
            {
                specialDef.skillNameToken = "Acid Bomb";
            }
            specialDef.baseRechargeInterval = GrenCooldown.Value;
            Resources.Load <GameObject>("prefabs/projectiles/banditgrenadeprojectile").GetComponent <ProjectileImpactExplosion>().blastRadius = GrenRadius.Value;
            GrenadeToss.damageCoefficient = GrenDamage.Value;
            if (AcidBombEnabled.Value)
            {
                Resources.Load <GameObject>("prefabs/projectiles/banditgrenadeprojectile").GetComponent <ProjectileDamage>().damageType = DamageType.WeakOnHit;
            }
            Resources.Load <GameObject>("prefabs/projectiles/banditgrenadeprojectile").GetComponent <ProjectileImpactExplosion>().blastProcCoefficient = 1f;
            Resources.Load <GameObject>("prefabs/projectiles/banditgrenadeprojectile").GetComponent <ProjectileImpactExplosion>().falloffModel         = BlastAttack.FalloffModel.None;

            specialDef.skillDescriptionToken = "Toss an explosive <color=#E5C962>in a straight line</color> for <color=#E5C962>" + GrenadeToss.damageCoefficient.ToString("P0").Replace(" ", "") + " damage.</color>";
            if (AcidBombEnabled.Value)
            {
                specialDef.skillDescriptionToken += " Enemies caught in the blast are <color=#E5C962>Weakened,</color> reducing their movement speed, armor, and damage.";
            }
            specialDef.skillName     = "Grenade";
            specialDef.icon          = skillComponent.special.skillFamily.variants[0].skillDef.icon;
            specialDef.shootDelay    = 0.08f;
            specialDef.baseMaxStock  = 1;
            specialDef.rechargeStock = 1;
            specialDef.isBullets     = false;
            specialDef.beginSkillCooldownOnSkillEnd = false;
            specialDef.activationStateMachineName   = skillComponent.special.skillFamily.variants[0].skillDef.activationStateMachineName;
            specialDef.interruptPriority            = EntityStates.InterruptPriority.Skill;
            specialDef.isCombatSkill         = true;
            specialDef.noSprint              = false;
            specialDef.canceledFromSprinting = false;
            specialDef.mustKeyPress          = false;
            specialDef.requiredStock         = 1;
            specialDef.stockToConsume        = 1;
            #endregion

            if (LightsOutSecondary.Value)
            {
                skillComponent.secondary.skillFamily.variants[0].skillDef = secondaryDef;
                skillComponent.special.skillFamily.variants[0].skillDef   = specialDef;
            }
            else
            {
                skillComponent.secondary.skillFamily.variants[0].skillDef = specialDef;
                skillComponent.special.skillFamily.variants[0].skillDef   = secondaryDef;
                PrepLightsOut.isSecondary = false;
            }

            SkillAPI.AddSkill(typeof(EntityStates.Bandit.Blast));
            SkillAPI.AddSkill(typeof(EntityStates.Bandit.PrepLightsOut));
            SkillAPI.AddSkill(typeof(EntityStates.Bandit.FireLightsOut));
            SkillAPI.AddSkill(typeof(EntityStates.Bandit.GrenadeToss));

            SkillAPI.AddSkillFamily(skillComponent.primary.skillFamily);
            SkillAPI.AddSkillFamily(skillComponent.secondary.skillFamily);
            SkillAPI.AddSkillFamily(skillComponent.utility.skillFamily);
            SkillAPI.AddSkillFamily(skillComponent.special.skillFamily);
        }
Example #6
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);
        }
Example #7
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);
        }
Example #8
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);
        }
Example #9
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);
        }
Example #10
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));
        }
Example #11
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));
        }