private void FixedUpdate() { BaseAI baseAIComponent = master.GetComponent <BaseAI>(); if (baseAIComponent) { SkillLocator skillComponent = gameObject.GetComponent <SkillLocator>(); if (skillComponent) { CharacterBody targetBody = baseAIComponent.currentEnemy.characterBody; if (targetBody && (!targetBody.characterMotor || !targetBody.characterMotor.isGrounded)) { skillComponent.primary.SetSkillOverride(body, airSkill, GenericSkill.SkillOverridePriority.Replacement); } else { skillComponent.primary.UnsetSkillOverride(body, airSkill, GenericSkill.SkillOverridePriority.Replacement); } } retargetTimer -= Time.fixedDeltaTime; if (retargetTimer <= 0) { if (!baseAIComponent.currentEnemy.hasLoS) { baseAIComponent.currentEnemy.Reset(); baseAIComponent.ForceAcquireNearestEnemyIfNoCurrentEnemy(); SetCooldown(); } } } }
// Token: 0x060023CE RID: 9166 RVA: 0x000A8464 File Offset: 0x000A6664 private void FixedUpdate() { float fillAmount = 0f; if (this.hudElement.targetCharacterBody) { SkillLocator component = this.hudElement.targetCharacterBody.GetComponent <SkillLocator>(); if (component && component.secondary) { EntityStateMachine stateMachine = component.secondary.stateMachine; if (stateMachine) { ScopeSniper scopeSniper = stateMachine.state as ScopeSniper; if (scopeSniper != null) { fillAmount = scopeSniper.charge; } } } } if (this.image) { this.image.fillAmount = fillAmount; } }
public BanditTimer(CharacterBody b, SkillLocator o, float l, DamageType dt) { body = b; skillLocator = o; length = l; damageType = dt; }
public static void BuildMegaMushrums() { megaMushrum = Resources.Load <GameObject>("prefabs/characterbodies/MiniMushroomBody").InstantiateClone("MegaMushrumBody", true); megaMushrumMaster = Resources.Load <GameObject>("prefabs/charactermasters/MiniMushroomMaster").InstantiateClone("MegaMushrumMaster", true); projectile = Resources.Load <GameObject>("prefabs/projectiles/SporeGrenadeProjectile").InstantiateClone("MegaSporeGrenadeProjectile", false); dotZone = Resources.Load <GameObject>("prefabs/projectiles/SporeGrenadeProjectileDotZone").InstantiateClone("MegaSporeGrenadeProjectileDotZone", false); skillLocator = megaMushrum.GetComponent <SkillLocator>(); BaseHelpers.RegisterNewBody(megaMushrum); BaseHelpers.RegisterNewMaster(megaMushrumMaster); BaseHelpers.RegisterNewProjectile(megaMushrum); BaseHelpers.RegisterNewProjectile(dotZone); megaMushrumMaster.GetComponent <CharacterMaster>().bodyPrefab = megaMushrum; BuildBody(); BuildDirectorCard(); SetupMegaMushrumSize(); RebuildSkillDrivers(); RebuildSkills(); Createprojectile(); Main.logger.LogInfo("Built Mega Mushrums!"); }
public static SkillFamily GetSkillFamily(GameObject body, SkillSlot slot) { SkillLocator sl = body.GetComponent <SkillLocator>(); GenericSkill skill; switch (slot) { case SkillSlot.Primary: skill = sl.primary; break; case SkillSlot.Secondary: skill = sl.secondary; break; case SkillSlot.Utility: skill = sl.utility; break; case SkillSlot.Special: skill = sl.special; break; default: skill = sl.primary; break; } return(skill.skillFamily); }
private void RW_SetupGenericSkills() { foreach (GenericSkill g in this.RW_body.GetComponents <GenericSkill>()) { MonoBehaviour.DestroyImmediate(g); } SkillLocator SL = this.RW_body.AddOrGetComponent <SkillLocator>(); if (!SL.primary) { SL.primary = this.RW_body.AddComponent <GenericSkill>(); } if (!SL.secondary) { SL.secondary = this.RW_body.AddComponent <GenericSkill>(); } if (!SL.utility) { SL.utility = this.RW_body.AddComponent <GenericSkill>(); } if (!SL.special) { SL.special = this.RW_body.AddComponent <GenericSkill>(); } }
public static SkillFamily GetSkillFamily(GameObject prefab, SkillSlot slot) { SkillLocator skillLocator = prefab.GetComponent <SkillLocator>(); if (skillLocator) { switch (slot) { case SkillSlot.Primary: return(skillLocator.primary.skillFamily); case SkillSlot.Secondary: return(skillLocator.secondary.skillFamily); case SkillSlot.Utility: return(skillLocator.utility.skillFamily); case SkillSlot.Special: return(skillLocator.special.skillFamily); default: return(skillLocator.primary.skillFamily); } } return(null); }
/// <summary> /// Creates an EmptySkillFamily. Be sure to call DestroyGenericSkillComponents before doing this. /// </summary> /// <param name="survivor"></param> public static void CreateEmptySkillFamily(GameObject survivor) { SkillLocator skillLocator = survivor.GetComponent <SkillLocator>(); skillLocator.SetFieldValue <GenericSkill[]>("allSkills", new GenericSkill[0]); { skillLocator.primary = survivor.AddComponent <GenericSkill>(); SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>(); newFamily.variants = new SkillFamily.Variant[1]; EnigmaticThunder.Modules.Loadouts.RegisterSkillFamily(newFamily); skillLocator.primary.SetFieldValue("_skillFamily", newFamily); } { skillLocator.secondary = survivor.AddComponent <GenericSkill>(); SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>(); newFamily.variants = new SkillFamily.Variant[1]; EnigmaticThunder.Modules.Loadouts.RegisterSkillFamily(newFamily); skillLocator.secondary.SetFieldValue("_skillFamily", newFamily); } { skillLocator.utility = survivor.AddComponent <GenericSkill>(); SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>(); newFamily.variants = new SkillFamily.Variant[1]; EnigmaticThunder.Modules.Loadouts.RegisterSkillFamily(newFamily); skillLocator.utility.SetFieldValue("_skillFamily", newFamily); } { skillLocator.special = survivor.AddComponent <GenericSkill>(); SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>(); newFamily.variants = new SkillFamily.Variant[1]; EnigmaticThunder.Modules.Loadouts.RegisterSkillFamily(newFamily); skillLocator.special.SetFieldValue("_skillFamily", newFamily); } }
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) * };*/ }
public void Awake() { this.body = base.GetComponent <CharacterBody>(); var model = base.GetComponent <ModelLocator>(); var modelTransform = model.modelTransform; this.childLocator = modelTransform.GetComponent <ChildLocator>(); this.rightDrillBone = childLocator.FindChild("RightHandDrill"); this.leftDrillBone = childLocator.FindChild("LeftHandDrill"); this.drillRushHitboxPivot = childLocator.FindChild("DrillRushHitboxPivot"); this.animator = modelTransform.GetComponent <Animator>(); this.setStateOnHurt = base.GetComponent <SetStateOnHurt>(); this.skillLocator = base.GetComponent <SkillLocator>(); if (this.setStateOnHurt) { this.defaultCanBeFrozen = setStateOnHurt.canBeFrozen; this.defaultCanBeStunned = setStateOnHurt.canBeStunned; this.defaultCanBeHitStunned = setStateOnHurt.canBeHitStunned; } if (this.skillLocator) { this.yokoSkill = this.skillLocator.secondary; } On.RoR2.CharacterBody.RecalculateStats += CharacterBody_RecalculateStats; On.RoR2.CharacterBody.AddBuff_BuffDef += CharacterBody_AddBuff_BuffDef; On.RoR2.CharacterBody.AddTimedBuff_BuffDef_float += CharacterBody_AddTimedBuff_BuffDef_float; On.RoR2.CharacterBody.AddTimedBuff_BuffDef_float_int += CharacterBody_AddTimedBuff_BuffDef_float_int; }
// try and setup our character, if we hit an error we set it to false //TODO: Find a way to stop it from checking whilst in main menu/lobby menu private static void GetCharacter() { try { LocalNetworkUser = null; foreach (NetworkUser readOnlyInstance in NetworkUser.readOnlyInstancesList) { //localplayer == you! if (readOnlyInstance.isLocalPlayer) { LocalNetworkUser = readOnlyInstance; LocalPlayer = LocalNetworkUser.master; LocalPlayerInv = LocalPlayer.GetComponent <Inventory>(); //gets player inventory LocalHealth = LocalPlayer.GetBody().GetComponent <HealthComponent>(); //gets players local health numbers LocalSkills = LocalPlayer.GetBody().GetComponent <SkillLocator>(); //gets current for local character skills Localbody = LocalPlayer.GetBody().GetComponent <CharacterBody>(); //gets all stats for local character LocalMotor = LocalPlayer.GetBody().GetComponent <CharacterMotor>(); if (LocalPlayer.alive) { _CharacterCollected = true; } else { _CharacterCollected = false; } } } } catch (Exception e) { _CharacterCollected = false; } }
private void FixedUpdate() { if (this.hudElement.targetCharacterBody) { SkillLocator component = this.hudElement.targetCharacterBody.GetComponent <SkillLocator>(); if (component && component.secondary) { EntityStateMachine stateMachine = component.secondary.stateMachine; if (stateMachine) { SecondaryScope scopeSniper = stateMachine.state as SecondaryScope; if (scopeSniper != null && scopeSniper.scopeComponent != null && scopeSniper.scopeComponent.IsScoped) { if (component.secondary.stock > 0) { image.color = chargeColor; image.fillAmount = scopeSniper.scopeComponent.charge; } else { image.color = rechargeColor; image.fillAmount = 1f - component.secondary.rechargeStopwatch / component.secondary.CalculateFinalRechargeInterval(); } } } } } }
// Token: 0x060020EC RID: 8428 RVA: 0x0009A958 File Offset: 0x00098B58 private void RebuildLocal() { SurvivorDef survivorDef = SurvivorCatalog.GetSurvivorDef(this.selectedSurvivorIndex); this.survivorName.text = survivorDef.displayNameToken; if (survivorDef.descriptionToken != null) { this.survivorDescription.text = Language.GetString(survivorDef.descriptionToken); } SkillLocator component = survivorDef.bodyPrefab.GetComponent <SkillLocator>(); if (component) { this.RebuildStrip(this.primarySkillStrip, component.primary); this.RebuildStrip(this.secondarySkillStrip, component.secondary); this.RebuildStrip(this.utilitySkillStrip, component.utility); this.RebuildStrip(this.specialSkillStrip, component.special); this.RebuildStrip(this.passiveSkillStrip, component.passiveSkill); } Image[] array = this.primaryColorImages; for (int i = 0; i < array.Length; i++) { array[i].color = survivorDef.primaryColor; } TextMeshProUGUI[] array2 = this.primaryColorTexts; for (int i = 0; i < array2.Length; i++) { array2[i].color = survivorDef.primaryColor; } }
public static void banditskilldescriptions(GameObject bandit) { SkillLocator component = bandit.GetComponent <SkillLocator>(); component.primary.skillNameToken = "Rapidshot"; component.primary.skillDescriptionToken = "Shoots a pistol with 8 bullets for <color=#FFFF00>" + Primary.damageCoefficient.ToString("P0").Replace(" ", string.Empty) + " damage</color>. Able to quickshoot if skillbutton is clicked in rapid succession."; component.secondary.skillNameToken = "Lights out"; component.secondary.skillDescriptionToken = "Shoots a finishing shot for <color=#FFFF00>"; component.secondary.skillDescriptionToken += Secondary.damageCoefficient.ToString("P0").Replace(" ", string.Empty); component.secondary.skillDescriptionToken += " damage</color>. On direct kill"; if (EntityStates.Bandit.Timer.Timer.flag) { component.secondary.skillDescriptionToken += " or on kill " + EntityStates.Bandit.Timer.Timer.timeStart.ToString() + " seconds after a hit"; } component.secondary.skillDescriptionToken += " with <color=#ADD8E6>Lights out</color> resets cooldown."; component.utility.skillNameToken = "Smokescreen"; component.utility.skillDescriptionToken = "Jumps into a Smokescreen. grants a <color=#ADD8E6>speed up</color> and <color=#ADD8E6>invisible</color> buff for <color=#FFFF00>" + EntityStates.Commando.CommandoWeapon.CastSmokescreen.stealthDuration.ToString() + " seconds </color>. deal <color=#ADD8E6>stun</color> for <color=#FFFF00>" + EntityStates.Commando.CommandoWeapon.CastSmokescreen.damageCoefficient.ToString("P0").Replace(" ", string.Empty) + " damage</color> to the surrounding area."; component.special.skillNameToken = "Mortar"; component.special.skillDescriptionToken = "Shoots an grenade which turn into mini stun grenades which give <color=#ADD8E6>stun</color> debuff"; }
public static void CreateSkillFamilies(SkillLocator skillLocator, GameObject myCharacter) { skillLocator.SetFieldValue <GenericSkill[]>("allSkills", new GenericSkill[0]); { skillLocator.primary = myCharacter.AddComponent <GenericSkill>(); SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>(); newFamily.variants = new SkillFamily.Variant[1]; LoadoutAPI.AddSkillFamily(newFamily); skillLocator.primary.SetFieldValue("_skillFamily", newFamily); } { skillLocator.secondary = myCharacter.AddComponent <GenericSkill>(); SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>(); newFamily.variants = new SkillFamily.Variant[1]; LoadoutAPI.AddSkillFamily(newFamily); skillLocator.secondary.SetFieldValue("_skillFamily", newFamily); } { skillLocator.utility = myCharacter.AddComponent <GenericSkill>(); SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>(); newFamily.variants = new SkillFamily.Variant[1]; LoadoutAPI.AddSkillFamily(newFamily); skillLocator.utility.SetFieldValue("_skillFamily", newFamily); } { skillLocator.special = myCharacter.AddComponent <GenericSkill>(); SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>(); newFamily.variants = new SkillFamily.Variant[1]; LoadoutAPI.AddSkillFamily(newFamily); skillLocator.special.SetFieldValue("_skillFamily", newFamily); } }
private static void SpecialSetup() { SkillLocator component = WispSurvivor.characterPrefab.GetComponent <SkillLocator>(); LanguageAPI.Add("EXAMPLESURVIVOR_SPECIAL_BURST_NAME", "Burst"); LanguageAPI.Add("EXAMPLESURVIVOR_SPECIAL_BURST_DESCRIPTION", "Shatter your barrier for <style=cIsDamage>700-800%</style> damage. " + "If tethered, duplicate explosion on target."); // set up your primary skill def here! SkillDef mySkillDef = ScriptableObject.CreateInstance <SkillDef>(); mySkillDef.activationState = new SerializableEntityStateType(typeof(EntityStates.WispSurvivorStates.WispBurst)); mySkillDef.activationStateMachineName = "Weapon"; mySkillDef.baseMaxStock = 1; mySkillDef.baseRechargeInterval = 7f; mySkillDef.beginSkillCooldownOnSkillEnd = true; mySkillDef.canceledFromSprinting = false; mySkillDef.fullRestockOnAssign = true; mySkillDef.interruptPriority = InterruptPriority.Skill; mySkillDef.isBullets = false; mySkillDef.isCombatSkill = true; mySkillDef.mustKeyPress = true; mySkillDef.noSprint = false; mySkillDef.rechargeStock = 1; mySkillDef.requiredStock = 1; mySkillDef.shootDelay = 1f; mySkillDef.stockToConsume = 1; mySkillDef.icon = Assets.icon4; mySkillDef.skillDescriptionToken = "EXAMPLESURVIVOR_SPECIAL_BURST_DESCRIPTION"; mySkillDef.skillName = "EXAMPLESURVIVOR_SPECIAL_BURST_NAME"; mySkillDef.skillNameToken = "EXAMPLESURVIVOR_SPECIAL_BURST_NAME"; LoadoutAPI.AddSkillDef(mySkillDef); component.special = WispSurvivor.characterPrefab.AddComponent <GenericSkill>(); SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>(); newFamily.variants = new SkillFamily.Variant[1]; LoadoutAPI.AddSkillFamily(newFamily); component.special.SetFieldValue("_skillFamily", newFamily); SkillFamily skillFamily = component.special.skillFamily; skillFamily.variants[0] = new SkillFamily.Variant { skillDef = mySkillDef, unlockableName = "", viewableNode = new ViewablesCatalog.Node(mySkillDef.skillNameToken, false, null) }; // add this code after defining a new skilldef if you're adding an alternate skill /*Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); * skillFamily.variants[skillFamily.variants.Length - 1] = new SkillFamily.Variant * { * skillDef = newSkillDef, * unlockableName = "", * viewableNode = new ViewablesCatalog.Node(newSkillDef.skillNameToken, false, null) * };*/ }
private void Banditspecial(GameObject gameObject) { SkillLocator component = gameObject.GetComponent <SkillLocator>(); GenericSkill special = component.special; GenericSkill genericSkill = gameObject.AddComponent <GenericSkill>(); genericSkill.skillName = "Mortar"; genericSkill.baseRechargeInterval = 5f; genericSkill.baseMaxStock = 1; genericSkill.rechargeStock = 1; genericSkill.isBullets = false; genericSkill.shootDelay = 0.3f; genericSkill.beginSkillCooldownOnSkillEnd = false; genericSkill.stateMachine = component.special.stateMachine; genericSkill.activationState = new SerializableEntityStateType(typeof(EntityStates.Toolbot.AimStunDrone)); genericSkill.interruptPriority = InterruptPriority.Skill; genericSkill.isCombatSkill = true; genericSkill.noSprint = false; genericSkill.canceledFromSprinting = false; genericSkill.mustKeyPress = true; genericSkill.requiredStock = 1; genericSkill.stockToConsume = 1; genericSkill.hasExecutedSuccessfully = false; genericSkill.icon = special.icon; Destroy(special); SkillManagement.SetSkill(ref genericSkill, typeof(EntityStates.Toolbot.AimStunDrone)); component.special = genericSkill; }
private void SetComponents() { skillLocator = HenryBody.GetComponent <SkillLocator>(); characterBody = HenryBody.GetComponent <CharacterBody>(); SetCharacterBody(); }
internal static void AddUtilitySkill(GameObject targetPrefab, SkillDef skillDef) { SkillLocator skillLocator = targetPrefab.GetComponent <SkillLocator>(); SkillFamily skillFamily = skillLocator.utility.skillFamily; AddSkillToFamily(skillDef, skillFamily); }
private void ReplaceSkillDefs() { SkillLocator skillLocator = this.gameObject.GetComponent <SkillLocator>(); skillLocator.primary.SetBaseSkill(Modules.Enemies.Nemry.swordPrimaryDef); skillLocator.secondary.SetBaseSkill(Modules.Enemies.Nemry.swordSecondaryDef); skillLocator.utility.SetBaseSkill(Modules.Enemies.Nemry.swordUtilityDef); skillLocator.special.SetBaseSkill(Modules.Enemies.Nemry.swordSpecialDef); }
public static void SetUtility(GameObject gameObject) { SkillLocator component = gameObject.GetComponent <SkillLocator>(); GenericSkill skillslot = component.utility; SkillManagement.SetSkill(ref skillslot, typeof(NewUtility)); component.utility = skillslot; //config(); }
private void RW_DoPassive() { SkillLocator sl = this.RW_body.GetComponent <SkillLocator>(); sl.passiveSkill.enabled = true; sl.passiveSkill.icon = this.RW_assetBundle.LoadAsset <Sprite>("Assets/__EXPORT/WispyPassiveIcon2.png"); sl.passiveSkill.skillNameToken = "WISP_SURVIVOR_PASSIVE_NAME"; sl.passiveSkill.skillDescriptionToken = "WISP_SURVIVOR_PASSIVE_DESC"; }
public static void SetSecondary(GameObject gameObject) { SkillLocator component = gameObject.GetComponent <SkillLocator>(); GenericSkill skillslot = component.secondary; SkillManagement.SetSkill(ref skillslot, typeof(PrepSecondary)); component.secondary = skillslot; config(); }
public void missInit(int MissileCapacity, int NumMissiles, bool MissilesActive, SkillLocator skillLocator) { missileCapacity = MissileCapacity; numMissiles = NumMissiles; missilesActive = MissilesActive; SetNumMissiles(numMissiles); reference = skillLocator; missIni = true; }
private void AssignSkills(GameObject bodyObject) { SkillLocator skills = bodyObject.GetComponent <SkillLocator>(); AssignPrimary(skills); AssignSecondary(skills); AssignUtility(skills); AssignSpecial(skills); }
private void RW_SetupSkillFamilies() { SkillLocator skillLocator = this.RW_body.GetComponent <SkillLocator>(); this.RW_skillFamilies = new SkillFamily[4]; this.RW_skillFamilies[0] = GetNewSkillFamily(skillLocator.primary); this.RW_skillFamilies[1] = GetNewSkillFamily(skillLocator.secondary); this.RW_skillFamilies[2] = GetNewSkillFamily(skillLocator.utility); this.RW_skillFamilies[3] = GetNewSkillFamily(skillLocator.special); }
public virtual void OverrideSkills() { CloudUtils.CreateEmptySkills(bodyPrefab); SkillLocator locator = bodyPrefab.GetComponent <SkillLocator>(); CreatePrimary(locator, locator.primary.skillFamily); CreateSecondary(locator, locator.secondary.skillFamily); CreateUtility(locator, locator.utility.skillFamily); CreateSpecial(locator, locator.special.skillFamily); }
internal static void UltSetup() { { SkillLocator component = characterPrefab.GetComponent <SkillLocator>(); LanguageAPI.Add("ROCKETEER_ULT_NAME", "Big Booma Cannon"); LanguageAPI.Add("ROCKETEER_ULT_DESCRIPTION", "Ready to go, Boss. " + "Each rocket does <style=cIsDamage>1500% damage</style> and takes <style=cIsDamage>12 seconds</style> to recharge. " + "When launched each rocket increases the damage of all rockets additively by <style=cIsDamage>175%</style>. Hold up to <style=cIsDamage>5</style>."); // set up your primary skill def here! chargeUltDef = ScriptableObject.CreateInstance <SkillDef>(); chargeUltDef.activationState = new SerializableEntityStateType(typeof(RocketeerChargeUlt)); chargeUltDef.activationStateMachineName = "Weapon"; chargeUltDef.baseMaxStock = 5; chargeUltDef.baseRechargeInterval = 12f; chargeUltDef.beginSkillCooldownOnSkillEnd = true; chargeUltDef.canceledFromSprinting = false; chargeUltDef.fullRestockOnAssign = true; chargeUltDef.interruptPriority = InterruptPriority.Skill; chargeUltDef.isCombatSkill = true; chargeUltDef.mustKeyPress = false; chargeUltDef.rechargeStock = 1; chargeUltDef.requiredStock = 1; chargeUltDef.stockToConsume = 0; chargeUltDef.icon = Resources.Load <Sprite>("Textures/MiscIcons/texMysteryIcon"); chargeUltDef.skillDescriptionToken = "ROCKETEER_ULT_DESCRIPTION"; chargeUltDef.skillName = "ROCKETEER_ULT_NAME"; chargeUltDef.skillNameToken = "ROCKETEER_ULT_NAME"; LoadoutAPI.AddSkillDef(chargeUltDef); component.special = characterPrefab.AddComponent <GenericSkill>(); SkillFamily newFamily = ScriptableObject.CreateInstance <SkillFamily>(); newFamily.variants = new SkillFamily.Variant[1]; LoadoutAPI.AddSkillFamily(newFamily); component.special.SetFieldValue("_skillFamily", newFamily); SkillFamily skillFamily = component.special.skillFamily; skillFamily.variants[0] = new SkillFamily.Variant { skillDef = chargeUltDef, unlockableName = "", viewableNode = new ViewablesCatalog.Node(chargeUltDef.skillNameToken, false, null) }; // add this code after defining a new skilldef if you're adding an alternate skill ContentPacks.skillDefs.Add(chargeUltDef); ContentPacks.skillFamilies.Add(newFamily); } }
private void Awake() { // Get all relevant components; this.characterBody = this.gameObject.GetComponent <CharacterBody>(); this.model = this.gameObject.GetComponentInChildren <CharacterModel>(); this.modelSkinController = this.gameObject.GetComponentInChildren <ModelSkinController>(); this.childLocator = this.gameObject.GetComponentInChildren <ChildLocator>(); this.skillLocator = this.gameObject.GetComponentInChildren <SkillLocator>(); this.modelLocator = this.gameObject.GetComponent <ModelLocator>(); this.jetStopwatch = new Stopwatch(); }
public void blam(SkillLocator skillLocator) { GenericSkill[] skills = { skillLocator?.primary, skillLocator?.secondary, skillLocator?.special }; foreach (var skill in skills) { while (skill?.stock < skill?.maxStock) { skill?.RunRecharge(1f); } } }