private void GenericSkill_OnExecute(On.RoR2.GenericSkill.orig_OnExecute orig, GenericSkill self) { var invCount = GetCount(self.characterBody); CharacterBody vBody = self.characterBody; if (vBody.skillLocator.FindSkill(self.skillName)) { if (invCount > 0) { if (vBody.skillLocator.utility.Equals(self)) //is this redundant? { if (vBody.HasBuff(MachoBrace_Boost)) //should prevent weird stacking { vBody.RemoveBuff(MachoBrace_Boost); } vBody.AddBuff(MachoBrace_Boost); } else { if (vBody.HasBuff(MachoBrace_Boost)) { vBody.RemoveBuff(MachoBrace_Boost); } } } } orig(self); }
private void GenericSkill_OnExecute(On.RoR2.GenericSkill.orig_OnExecute orig, GenericSkill self) { CharacterBody vBody = self.characterBody; if (!vBody || !vBody.skillLocator) { return; //null check } var invCount = GetCount(self.characterBody); Vector3 corePos = Util.GetCorePosition(vBody); GameObject vGameObject = self.gameObject; if (vBody.skillLocator.FindSkill(self.skillName)) { if (invCount > 0) { if (self.characterBody.skillLocator.utility && self.characterBody.skillLocator.utility.Equals(self)) { for (int i = 0; i < invCount; i++) { ProjectileManager.instance.FireProjectile(BombPrefab, corePos, RollBombFireDirection(), vGameObject, vBody.damage * Damage, 3f, Util.CheckRoll(vBody.crit, vBody.master), DamageColorIndex.Item, null, -1f); } } } } orig(self); }
private void GenericSkill_OnExecute(On.RoR2.GenericSkill.orig_OnExecute orig, GenericSkill self) { CharacterBody vBody = self.characterBody; if (!vBody || !vBody.skillLocator) { return; //null check } var invCount = GetCount(self.characterBody); if (invCount > 0) { if (self.characterBody.baseNameToken != "MAGE_BODY_NAME") { if (self.characterBody.skillLocator.utility && vBody.skillLocator.FindSkill(self.skillName)) { if (self.characterBody.skillLocator.utility.Equals(self)) { FireAmmo(vBody); } } } } orig(self); }
private void GenericSkill_OnExecute(On.RoR2.GenericSkill.orig_OnExecute orig, GenericSkill self) { CharacterBody vBody = self.characterBody; if (vBody && vBody.inventory) { int invCount = vBody.inventory.GetItemCount(catalogIndex); if (invCount > 0) { SkillLocator skillLocation = vBody.skillLocator; if (skillLocation) { MetronomeTrackKills MetronomeTrackKills = self.gameObject.GetComponent <MetronomeTrackKills>(); if (MetronomeTrackKills && MetronomeTrackKills.enabled) { if (skillLocation.FindSkill(self.skillName)) //Updates last skill slot used { if (skillLocation.primary.Equals(self)) { MetronomeTrackKills.SetLastSkillSlot(0); } else if (skillLocation.secondary.Equals(self)) { MetronomeTrackKills.SetLastSkillSlot(1); } else if (skillLocation.utility.Equals(self)) { MetronomeTrackKills.SetLastSkillSlot(2); } else if (skillLocation.special.Equals(self)) { MetronomeTrackKills.SetLastSkillSlot(3); } //else { _logger.LogError("Metronome: Invalid Skill Slot ["+self+"] accessed!"); } } } } } } orig(self); }