示例#1
0
        private void CharacterBody_OnSkillActivated(On.RoR2.CharacterBody.orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill)
        {
            orig(self, skill);
            Inventory inventory = self.inventory;

            if (inventory)
            {
                var itemCount = inventory.GetItemCount(itemDef);
                if (itemCount > 0)
                {
                    if (skill.finalRechargeInterval > 0f && skill.skillDef.stockToConsume > 0)
                    {
                        var coeff = Util.ConvertAmplificationPercentageIntoReductionPercentage(cdr + cdrPerStack * (float)(itemCount - 1)) / 100f;
                        var cooldownsReducedBy = skill.finalRechargeInterval * coeff;
                        foreach (SkillSlot skillSlot in Enum.GetValues(typeof(SkillSlot)))
                        {
                            GenericSkill otherSkill = self.skillLocator.GetSkill(skillSlot);
                            if (skill != otherSkill && otherSkill != null && otherSkill.stock < otherSkill.maxStock)
                            {
                                otherSkill.rechargeStopwatch += cooldownsReducedBy;
                            }
                        }
                        var fxHelper = self.GetComponent <MysticsItemsThoughtProcessorFXHelper>();
                        if (!fxHelper)
                        {
                            fxHelper = self.gameObject.AddComponent <MysticsItemsThoughtProcessorFXHelper>();
                        }
                        fxHelper.OnTrigger(cooldownsReducedBy);
                    }
                }
            }
        }
        ////// Hooks //////

        private void CharacterBody_OnSkillActivated(On.RoR2.CharacterBody.orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill)
        {
            orig(self, skill);
            if (!NetworkServer.active)
            {
                return;
            }

            if (self && self.skillLocator &&
                !blacklistedSkills.Contains(skill.skillDef))
            {
                var count = GetCount(self);
                if (count <= 0)
                {
                    return;
                }
                var pts = self.gameObject.GetComponent <PixieTubeStopwatch>();
                if (!pts)
                {
                    pts = self.gameObject.AddComponent <PixieTubeStopwatch>();
                }
                if (!pts.CheckProc(self.skillLocator.FindSkillSlot(skill)))
                {
                    return;
                }
                for (var i = 0; i < count; i++)
                {
                    SpawnWisp(self.corePosition, self.teamComponent ? self.teamComponent.teamIndex : TeamIndex.None);
                }
            }
        }
示例#3
0
        ////// Hooks //////

        private void CharacterBody_OnSkillActivated(On.RoR2.CharacterBody.orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill)
        {
            orig(self, skill);
            var count = GetCount(self);

            if (count > 0 && skill && skill.isCombatSkill && (skill.baseRechargeInterval > 0f || self.skillLocator.FindSkillSlot(skill) == SkillSlot.Primary))
            {
                int oldCount = self.GetBuffCount(loomBuff);
                self.ClearTimedBuffs(loomBuff.buffIndex);
                self.SetBuffCount(loomBuff.buffIndex, 0);
                for (var i = 0; i < System.Math.Min(oldCount + 1, count * maxStacks); i++)
                {
                    self.AddTimedBuff(loomBuff, window, count * maxStacks);
                }
            }
        }
 private void CharacterBody_OnSkillActivated(On.RoR2.CharacterBody.orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill)
 {
     orig(self, skill);
     if (NetworkServer.active && self &&
         self.skillLocator && self.skillLocator.FindSkillSlot(skill) == SkillSlot.Utility &&
         !handledSkillDefs.Contains(skill.skillDef))
     {
         var count = GetCount(self);
         if (count <= 0)
         {
             return;
         }
         for (var i = 0; i < count; i++)
         {
             self.AddTimedBuff(genericSpeedBoostBuff, unhandledDuration, count);
         }
     }
 }
示例#5
0
        ////// Hooks //////
        #region Hooks

        private void CharacterBody_OnSkillActivated(On.RoR2.CharacterBody.orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill)
        {
            orig(self, skill);
            if (!NetworkServer.active)
            {
                return;
            }
            if (self && self.skillLocator &&
                self.skillLocator.FindSkillSlot(skill) == SkillSlot.Utility)
            {
                var count = GetCount(self);
                if (count > 0)
                {
                    var cpt = self.GetComponent <HeadsetComponent>();
                    if (!cpt)
                    {
                        cpt = self.gameObject.AddComponent <HeadsetComponent>();
                    }
                    cpt.hitsRemaining = procCount + stackProcCount * (count - 1);
                }
            }
        }