public static void AddSkillVariant(SkillFamily skillFamily, NewSkillInfo nsi) { SkillDef skillDef = ScriptableObject.CreateInstance <SkillDef>(); skillDef.activationState = nsi.activationState; skillDef.activationStateMachineName = nsi.activationStateMachineName; skillDef.icon = nsi.icon; skillDef.skillName = nsi.skillName; skillDef.skillNameToken = nsi.skillNameToken; skillDef.skillDescriptionToken = nsi.skillDescriptionToken; skillDef.interruptPriority = nsi.interruptPriority; skillDef.baseRechargeInterval = nsi.baseRechargeInterval; skillDef.baseMaxStock = nsi.baseMaxStock; skillDef.rechargeStock = nsi.rechargeStock; skillDef.isBullets = nsi.isBullets; skillDef.shootDelay = nsi.shootDelay; skillDef.beginSkillCooldownOnSkillEnd = nsi.beginSkillCooldownOnSkillEnd; skillDef.requiredStock = nsi.requiredStock; skillDef.stockToConsume = nsi.stockToConsume; skillDef.isCombatSkill = nsi.isCombatSkill; skillDef.noSprint = nsi.noSprint; skillDef.canceledFromSprinting = nsi.canceledFromSprinting; skillDef.mustKeyPress = nsi.mustKeyPress; skillDef.fullRestockOnAssign = nsi.fullRestockOnAssign; SkillFamily.Variant variant = default; variant.skillDef = skillDef; variant.viewableNode = nsi.viewableNode; variant.unlockableName = nsi.unlockableName; int famVariantLength = skillFamily.variants.Length; Array.Resize(ref skillFamily.variants, famVariantLength + 1); skillFamily.variants[famVariantLength] = variant; }
private void AddPlasmoidLaunchers() { SkillAPI.AddSkill(typeof(ChargePlasmoids)); SkillFamily skillFamily = LoadoutHelper.GetSkillFamily(EngiBody, SkillSlot.Primary); ViewablesCatalog.Node viewableNode = new ViewablesCatalog.Node("UnoEngiPrimary", false); Sprite icon = Resources.Load <Sprite>("UnoTODOActualIcon"); NewSkillInfo nsi = new NewSkillInfo { activationState = new SerializableEntityStateType(typeof(ChargePlasmoids)), activationStateMachineName = "Weapon", icon = icon, viewableNode = viewableNode, unlockableName = string.Empty, skillName = "Plasmoid Launchers", skillNameToken = "UNO_ENGIPLUS_PLASMOIDS_NAME", skillDescriptionToken = "UNO_ENGIPLUS_PLASMOIDS_DESC", interruptPriority = InterruptPriority.Skill, baseRechargeInterval = 0f, baseMaxStock = 1, rechargeStock = 1, isBullets = false, shootDelay = 0f, beginSkillCooldownOnSkillEnd = false, requiredStock = 1, stockToConsume = 1, canceledFromSprinting = false, noSprint = false, isCombatSkill = true, mustKeyPress = true, fullRestockOnAssign = true }; LoadoutHelper.AddSkillVariant(skillFamily, nsi); }