protected override void OnDelayedAttachAsMain(Character target)
        {
            Dictionary <SkillId, SkillCastingRequirement> requirements = target.GetSkillCastingRequirements();

            foreach (KeyValuePair <SkillId, SkillCastingRequirement> pair in requirements)
            {
                if (pair.Key.Category.ShowParentSkillCategory() == ParentSkillCategory.Passive)
                {
                    continue;
                }
                if (info.Cbsmc.ShowMode() == CooldownBySecondModifierConfig.Mode.Local)
                {
                    if (!pair.Key.Equals(parentSkillId))
                    {
                        continue;
                    }
                }
                foreach (Resource res in pair.Value.Resources)
                {
                    if (res is TimeCooldownResource)
                    {
                        TimeCooldownResource tcr = (TimeCooldownResource)res;
                        tcr.ReduceRemainingTimeBy(info.Cbsmc.cdReduction * powerScale * multiplier);
                    }

                    if (res is RecoverableChargeResource)
                    {
                        RecoverableChargeResource rcr = (RecoverableChargeResource)res;
                        rcr.ReduceRemainingTimeBy(info.Cbsmc.rcReduction * powerScale * multiplier);
                    }
                }
            }
        }
예제 #2
0
        public override void OnDamageDealt(Character caster, Character target, Skill fromSkill,
                                           Modifier fromModifier, int damage)
        {
            base.OnDamageDealt(caster, target, fromSkill, fromModifier, damage);
            SkillId skillId = null;

            if (caster == modifierTarget && fromSkill != null &&
                caster.SkillId(fromSkill, ref skillId) &&
                info.Config.IsProducerInterested(skillId.Category))
            {
                Dictionary <SkillId, SkillCastingRequirement> requirements = modifierTarget.GetSkillCastingRequirements();
                foreach (KeyValuePair <SkillId, SkillCastingRequirement> pair in requirements)
                {
                    if (!info.Config.IsConsumerInterested(pair.Key.Category))
                    {
                        continue;
                    }
                    foreach (Resource res in pair.Value.Resources)
                    {
                        if (res is TimeCooldownResource)
                        {
                            TimeCooldownResource tcr = (TimeCooldownResource)res;
                            tcr.ReduceRemainingTimeBy(info.Config.cdReduction);
                        }

                        if (res is RecoverableChargeResource)
                        {
                            RecoverableChargeResource rcr = (RecoverableChargeResource)res;
                            rcr.ReduceRemainingTimeBy(info.Config.rcReduction);
                        }
                    }
                }
            }
        }