示例#1
0
        protected virtual void ApplySkill(Skill skill, short level, bool isLeftHand, CharacterItem weapon, DamageInfo damageInfo, Dictionary <DamageElement, MinMaxFloat> allDamageAmounts, bool hasAimPosition, Vector3 aimPosition)
        {
            // Quit function when on apply skill will override default apply skill functionality
            if (skill.OnApplySkill(this, level, isLeftHand, weapon, damageInfo, allDamageAmounts, hasAimPosition, aimPosition))
            {
                return;
            }

            switch (skill.skillType)
            {
            case SkillType.Active:
                ApplySkillBuff(skill, level);
                ApplySkillSummon(skill, level);
                if (skill.skillAttackType != SkillAttackType.None)
                {
                    CharacterBuff debuff = CharacterBuff.Empty;
                    if (skill.isDebuff)
                    {
                        debuff = CharacterBuff.Create(BuffType.SkillDebuff, skill.DataId, level);
                    }
                    // TODO: some skill type will not able to change aim position by controller
                    if (!hasAimPosition && HasAimPosition)
                    {
                        hasAimPosition = true;
                        aimPosition    = AimPosition;
                    }
                    LaunchDamageEntity(isLeftHand, weapon, damageInfo, allDamageAmounts, debuff, skill.hitEffects.Id, hasAimPosition, aimPosition, Vector3.zero);
                }
                break;
            }
        }