Exemplo n.º 1
0
        protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy)
        {
            int hurt = fixHurt + hurtBase * skillLevel;

            enemy.AddHurtAndShow(hurt, HurtType.Physical, self.towards);


            enemy.PlayShakeAnim();

            enemy.SetEffectAnim(enemyEffectAnimName);


            float roleAnimScaler = enemy.GetRoleAnimTimeScaler();

            roleAnimScaler *= (1 - attackSpeedDecreaseScalerBase);

            if (roleAnimScaler < 0.6f)
            {
                return;
            }
            else
            {
                // 敌方行动速度减慢
                enemy.SetRoleAnimTimeScale(roleAnimScaler);
                enemy.SetEffectAnim(CommonData.paralyzedEffectName, null, 0, 0);
            }
        }
Exemplo n.º 2
0
        protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy)
        {
            int armorCal = enemy.agent.armor - self.agent.armorDecrease / 2;

            if (armorCal < -50)
            {
                armorCal = -50;
            }

            int actualHurt = Mathf.RoundToInt(hurt / (armorCal / 100f + 1));

            enemy.AddHurtAndShow(actualHurt, HurtType.Physical, self.towards);

            enemy.PlayShakeAnim();


            if (triggeredCount < maxOverlayCount)
            {
                triggeredCount++;

                enemy.agent.armor += -armorChange;
                enemy.agent.armorChangeFromSkill += -armorChange;

                enemy.agent.magicResist += -magicResistChange;
                enemy.agent.magicResistChangeFromSkill += -magicResistChange;

                enemy.SetEffectAnim(enemyEffectAnimName);

                enemy.AddTintTextToQueue("护甲\n降低");
                enemy.AddTintTextToQueue("抗性\n降低");
            }

            //enemy.UpdateStatusPlane();
        }
Exemplo n.º 3
0
        protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy)
        {
            int armorCal = enemy.agent.armor - self.agent.armorDecrease / 2;

            if (armorCal < -50)
            {
                armorCal = -50;
            }

            int actualHurt = Mathf.RoundToInt(hurt / (armorCal / 100f + 1));

            enemy.AddHurtAndShow(actualHurt, HurtType.Physical, self.towards);

            enemy.PlayShakeAnim();

            if (enemyEffectAnimName != string.Empty)
            {
                enemy.SetEffectAnim(enemyEffectAnimName);
            }

            enemy.SetEffectAnim(continuousEffectAnimName, null, 0, healthLoseDuration);

            if (healthDurativeLoseCoroutine != null)
            {
                StopCoroutine(healthDurativeLoseCoroutine);
            }

            healthDurativeLoseCoroutine = DurativeHurt(self, enemy);

            StartCoroutine(healthDurativeLoseCoroutine);
        }
Exemplo n.º 4
0
        protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy)
        {
            // 原始魔法伤害
            int hurt = self.agent.magicAttack + hurtBase * skillLevel + fixHurt;

            int magicResistCal = enemy.agent.magicResist - self.agent.magicResistDecrease / 2;

            if (magicResistCal < -50)
            {
                magicResistCal = -50;
            }

            // 结算抗性和抗性穿透之后的实际伤害
            hurt = Mathf.RoundToInt(hurt / (magicResistCal / 100f + 1));

            if (hurt < 0)
            {
                hurt = 0;
            }

            // 伤害生效并显示
            enemy.AddHurtAndShow(hurt, HurtType.Magical, self.towards);

            // 敌方被击中后退
            enemy.PlayShakeAnim();

            // 播放技能特效
            enemy.SetEffectAnim(enemyEffectAnimName);
        }
Exemplo n.º 5
0
        protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy)
        {
            int magicResistCal = enemy.agent.magicResist - self.agent.magicResistDecrease / 2;

            if (magicResistCal < -50)
            {
                magicResistCal = -50;
            }

            int acutalHurt = Mathf.RoundToInt(hurt / (magicResistCal / 100f + 1));

            enemy.AddHurtAndShow(acutalHurt, HurtType.Magical, self.towards);

            //enemy.UpdateStatusPlane();

            if (selfEffectAnimName != string.Empty)
            {
                self.SetEffectAnim(selfEffectAnimName);
            }

            if (enemyEffectAnimName != string.Empty)
            {
                enemy.SetEffectAnim(enemyEffectAnimName);
            }

            enemy.PlayShakeAnim();
        }
Exemplo n.º 6
0
        protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy)
        {
            int armorCal = enemy.agent.armor - self.agent.armorDecrease / 2;

            if (armorCal < -50)
            {
                armorCal = -50;
            }


            int actualHurt = Mathf.RoundToInt(hurt / (armorCal / 100f + 1));

            enemy.AddHurtAndShow(actualHurt, HurtType.Physical, self.towards);

            enemy.SetEffectAnim(enemyEffectAnimName);

            if (!hasTriggered)
            {
                enemy.agent.attack += -attackDecrease;

                enemy.agent.attackChangeFromSkill += -attackDecrease;

                hasTriggered = true;

                enemy.AddTintTextToQueue("攻击\n降低");
            }

            enemy.PlayShakeAnim();
        }
Exemplo n.º 7
0
        protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy)
        {
            int armorCal = enemy.agent.armor - self.agent.armorDecrease / 2;

            if (armorCal < -50)
            {
                armorCal = -50;
            }

            int acutalHurt = Mathf.RoundToInt(hurt / (armorCal / 100f + 1));

            enemy.AddHurtAndShow(acutalHurt, HurtType.Physical, self.towards);

            enemy.PlayShakeAnim();

            enemy.SetEffectAnim(enemyEffectAnimName, null, 0, 0);

            enemy.SetRoleAnimTimeScale(1 - actionSpeedDecrease);
        }
Exemplo n.º 8
0
        protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy)
        {
            int hurt = self.agent.magicAttack + fixHurt + hurtBase * skillLevel;

            int magicResistCal = enemy.agent.magicResist - self.agent.magicResistDecrease / 2;

            if (magicResistCal < -50)
            {
                magicResistCal = -50;
            }

            hurt = Mathf.RoundToInt(hurt / (magicResistCal / 100f + 1));

            if (hurt < 0)
            {
                hurt = 0;
            }

            // 伤害生效并显示
            enemy.AddHurtAndShow(hurt, HurtType.Magical, self.towards);

            enemy.SetEffectAnim(enemyEffectAnimName);

            // 敌方被击中后退
            enemy.PlayShakeAnim();

            float roleAnimScaler = enemy.GetRoleAnimTimeScaler();

            roleAnimScaler *= (1 - attackSpeedDecreaseScalerBase);

            if (roleAnimScaler < 0.6f)
            {
                return;
            }
            else
            {
                // 敌方行动速度减慢
                enemy.SetRoleAnimTimeScale(roleAnimScaler);
                enemy.SetEffectAnim(CommonData.frozenEffectName, null, 0, 0);
            }
        }
Exemplo n.º 9
0
        //本次攻击造成额外<color=orange> 技能等级×20+30</color>点魔法伤害,
        //并使敌人中毒,每秒损失<color=orange> 技能等级×1%×物理攻击</color> 的生命, 持续4s

        protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy)
        {
            int physicalHurt = fixHurt + hurtBase * skillLevel + self.agent.attack;

            int armorCal = enemy.agent.armor - self.agent.armorDecrease / 2;

            if (armorCal < -50)
            {
                armorCal = -50;
            }

            physicalHurt = Mathf.RoundToInt(physicalHurt / (armorCal / 100f + 1));

            enemy.AddHurtAndShow(physicalHurt, HurtType.Physical, self.towards);

            enemy.PlayShakeAnim();

            enemy.SetEffectAnim(enemyEffectAnimName);

            int magicAttackGain = magicAttackGainBase * skillLevel;

            self.agent.magicAttack += magicAttackGain;

            self.agent.magicAttackChangeFromSkill += magicAttackGain;

            self.AddTintTextToQueue("魔攻\n提升");

            //enemy.SetEffectAnim(enemyEffectAnimName, null, 0, poisonDuration);

            //poisonBase = (int)(self.agent.attack * poisonScaler * skillLevel) + fixPoisonHurt;

            //         // 中毒后的持续伤害
            //if (poisonCoroutine != null) {
            //	StopCoroutine (poisonCoroutine);
            //}

            //poisonCoroutine = Poison (self, enemy);

            //StartCoroutine (poisonCoroutine);
        }
Exemplo n.º 10
0
        protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy)
        {
            int healthDecrease = (int)(skillLevel * healthDecreaseScaler * self.agent.armor + fixHealthDecrease);

            enemy.AddHurtAndShow(healthDecrease, HurtType.Physical, self.towards);

            enemy.PlayShakeAnim();

            enemy.SetEffectAnim(enemyEffectAnimName);


            hasTriggered = true;

            int armorIncrease = skillLevel * armorGainBase;

            self.agent.armor += armorIncrease;
            self.agent.armorChangeFromSkill += armorIncrease;

            self.AddTintTextToQueue("护甲\n提升");

            self.SetEffectAnim(selfEffectAnimName);
        }
Exemplo n.º 11
0
        protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy)
        {
            int actualHurt = 0;

            switch (hurtType)
            {
            case HurtType.Physical:
                int armorCal = enemy.agent.armor - self.agent.armorDecrease / 2;

                if (armorCal < -50)
                {
                    armorCal = -50;
                }

                actualHurt = (int)(fixHurt / (armorCal / 100f + 1));

                break;

            case HurtType.Magical:

                int magicResistCal = enemy.agent.magicResist - self.agent.magicResistDecrease / 2;

                if (magicResistCal < -50)
                {
                    magicResistCal = -50;
                }

                actualHurt = (int)(self.agent.magicAttack / (magicResistCal / 100f + 1));

                break;
            }

            enemy.AddHurtAndShow(actualHurt, hurtType, self.towards);

            enemy.PlayShakeAnim();

            enemy.SetEffectAnim(enemyEffectAnimName);
        }
Exemplo n.º 12
0
        protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy)
        {
            int armorCal = enemy.agent.armor - self.agent.armorDecrease / 2;

            if (armorCal < -50)
            {
                armorCal = -50;
            }
            int actualPhysicalHurt = Mathf.RoundToInt(physicalHurt / (armorCal / 100f + 1));

            int magicResistCal = enemy.agent.magicResist - self.agent.magicResistDecrease / 2;

            if (magicResistCal < -50)
            {
                magicResistCal = -50;
            }

            int actualMagicalHurt = Mathf.RoundToInt(magicalHurt / (magicResistCal / 100f + 1));

            enemy.AddHurtAndShow(actualPhysicalHurt, HurtType.Physical, self.towards);

            enemy.AddHurtAndShow(actualMagicalHurt, HurtType.Magical, self.towards);

            //enemy.UpdateStatusPlane();

            enemy.PlayShakeAnim();

            enemy.SetEffectAnim(enemyEffectAnimName, null, 0, durativeHurtDuration);

            if (durativeHurtCoroutine != null)
            {
                StopCoroutine(durativeHurtCoroutine);
            }

            durativeHurtCoroutine = DurativeHurt(self, enemy);

            StartCoroutine(durativeHurtCoroutine);
        }
Exemplo n.º 13
0
        protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy)
        {
            // 提升暴击概率
            float crit = self.agent.crit + critScalerGain;

            // 普通攻击的伤害
            int hurt = self.agent.attack;

            // 判断是否暴击,暴击后伤害提升为暴击伤害
            if (isEffective(crit))
            {
                hurt = (int)(hurt * self.agent.critHurtScaler);
                enemy.AddTintTextToQueue("暴击");
            }

            // 加上技能产生的额外伤害
            hurt += hurtBase * skillLevel + fixHurt;

            int armorCal = enemy.agent.armor - self.agent.armorDecrease / 2;

            if (armorCal < -50)
            {
                armorCal = -50;
            }

            // 与对方护甲进行结算后得出实际伤害
            hurt = Mathf.RoundToInt(hurt / (armorCal / 100f + 1));

            // 伤害生效并显示
            enemy.AddHurtAndShow(hurt, HurtType.Physical, self.towards);

            // 敌方做被击中的后退动作
            enemy.PlayShakeAnim();

            enemy.SetEffectAnim(enemyEffectAnimName);
        }
Exemplo n.º 14
0
        public int skillSourceValue;        //魔法伤害值


        protected override void ExcuteNoneTriggeredSkillLogic(BattleAgentController self, BattleAgentController enemy)
        {
            // 执行攻击触发事件回调
            for (int i = 0; i < self.attackTriggerExcutors.Count; i++)
            {
                TriggeredSkillExcutor excutor = self.attackTriggerExcutors[i];
                switch (excutor.triggerSource)
                {
                case SkillEffectTarget.Self:
                    excutor.triggeredCallback(self, enemy);
                    break;

                case SkillEffectTarget.Enemy:
                    excutor.triggeredCallback(enemy, self);
                    break;
                }
            }

            // 敌方执行被攻击触发事件回调
            for (int i = 0; i < enemy.beAttackedTriggerExcutors.Count; i++)
            {
                TriggeredSkillExcutor excutor = enemy.beAttackedTriggerExcutors[i];
                switch (excutor.triggerSource)
                {
                case SkillEffectTarget.Self:
                    excutor.triggeredCallback(enemy, self);
                    break;

                case SkillEffectTarget.Enemy:
                    excutor.triggeredCallback(self, enemy);
                    break;
                }
            }

            //计算对方闪避率(敌方的基础闪避率 - 己方的闪避修正)
            int   enemyDodge       = enemy.propertyCalculator.dodge;
            float dodgeProbability = dodgeSeed * enemyDodge / (1 + dodgeSeed * enemyDodge) - self.propertyCalculator.dodgeFixScaler;

            //判断对方是否闪避成功
            if (isEffective(dodgeProbability))
            {
                enemy.propertyCalculator.specialAttackResult = SpecialAttackResult.Miss;
                enemy.AddFightTextToQueue(string.Empty, SpecialAttackResult.Miss);
                return;
            }

            enemy.PlayShakeAnim();

            //原始魔法伤害值
            self.propertyCalculator.magicalHurtToEnemy += skillSourceValue;

            SetEffectAnims(self, enemy);

            // 执行己方攻击命中的回调
            for (int i = 0; i < self.hitTriggerExcutors.Count; i++)
            {
                TriggeredSkillExcutor excutor = self.hitTriggerExcutors[i];
                switch (excutor.triggerSource)
                {
                case SkillEffectTarget.Self:
                    excutor.triggeredCallback(self, enemy);
                    break;

                case SkillEffectTarget.Enemy:
                    excutor.triggeredCallback(enemy, self);
                    break;
                }
            }


            // 执行敌方被击中的回调
            for (int i = 0; i < enemy.beHitTriggerExcutors.Count; i++)
            {
                TriggeredSkillExcutor excutor = enemy.beHitTriggerExcutors[i];
                switch (excutor.triggerSource)
                {
                case SkillEffectTarget.Self:
                    excutor.triggeredCallback(enemy, self);
                    break;

                case SkillEffectTarget.Enemy:
                    excutor.triggeredCallback(self, enemy);
                    break;
                }
            }


            self.propertyCalculator.CalculateAgentHealth();
            enemy.propertyCalculator.CalculateAgentHealth();


            self.UpdateFightStatus();
            enemy.UpdateFightStatus();

            self.UpdateStatusPlane();
            enemy.UpdateStatusPlane();

            self.propertyCalculator.ResetAllHurt();
            enemy.propertyCalculator.ResetAllHurt();
        }
Exemplo n.º 15
0
        protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy)
        {
            // 如果是玩家角色,则在每次攻击时重设攻速
            if (self is BattlePlayerController)
            {
                int attackSpeedInt = 0;

                for (int i = 0; i < self.agent.allEquipedEquipments.Length; i++)
                {
                    Equipment equipment = self.agent.allEquipedEquipments[i];
                    if (equipment.itemId == -1)
                    {
                        continue;
                    }

                    if (equipment.equipmentType == EquipmentType.Weapon)
                    {
                        attackSpeedInt = (int)equipment.attackSpeed;
                        break;
                    }
                }

                for (int i = 0; i < self.agent.attachedPermanentPassiveSkills.Count; i++)
                {
                    PermanentPassiveSkill permanentPassiveSkill = self.agent.attachedPermanentPassiveSkills[i];
                    if (permanentPassiveSkill is JiSu)
                    {
                        attackSpeedInt++;
                        break;
                    }
                }

                if (attackSpeedInt > 3)
                {
                    attackSpeedInt = 3;
                }

                (self.agent as Player).attackSpeed = (AttackSpeed)attackSpeedInt;
            }

            SetEffectAnims(self, enemy);

            // 执行攻击触发事件回调
            for (int i = 0; i < self.attackTriggerExcutors.Count; i++)
            {
                TriggeredSkillExcutor excutor = self.attackTriggerExcutors[i];
                excutor.triggeredCallback(self, enemy);
            }

            // 敌方执行被攻击触发事件回调
            for (int i = 0; i < enemy.beAttackedTriggerExcutors.Count; i++)
            {
                TriggeredSkillExcutor excutor = enemy.beAttackedTriggerExcutors[i];
                excutor.triggeredCallback(enemy, self);
            }

            //计算对方闪避率(敌方的基础闪避率 - 己方的闪避修正)
            float enemyDodge = enemy.agent.dodge;

            //判断对方是否闪避成功
            if (isEffective(enemyDodge))
            {
                enemy.AddTintTextToQueue("闪避");
                return;
            }

            int actualPhysicalHurt = 0;
            int actualMagicalHurt  = 0;

            if (self.agent.attack > 0)
            {
                //int oriPhysicalHurt = self.agent.attack + self.agent.armorDecrease / 4;

                int oriPhysicalHurt = self.agent.attack;

                float crit = self.agent.crit;

                if (isEffective(crit))
                {
                    enemy.AddTintTextToQueue("暴击");
                    oriPhysicalHurt = (int)(oriPhysicalHurt * self.agent.critHurtScaler);
                }

                int armorCal = enemy.agent.armor - self.agent.armorDecrease / 2;

                if (armorCal < -50)
                {
                    armorCal = -50;
                }

                actualPhysicalHurt = (int)(oriPhysicalHurt / (armorCal / 100f + 1));


                //actualPhysicalHurt = oriPhysicalHurt - enemy.agent.armor / 4;

                if (actualPhysicalHurt < 0)
                {
                    actualPhysicalHurt = 0;
                }

                enemy.AddHurtAndShow(actualPhysicalHurt, HurtType.Physical, self.towards);
            }

            if (self.agent.magicAttack > 0)
            {
                int magicResistCal = enemy.agent.magicResist - self.agent.magicResistDecrease / 2;

                if (magicResistCal < -50)
                {
                    magicResistCal = -50;
                }

                actualMagicalHurt = (int)(self.agent.magicAttack / (magicResistCal / 100f + 1));

                if (actualMagicalHurt < 0)
                {
                    actualMagicalHurt = 0;
                }

                enemy.AddHurtAndShow(actualMagicalHurt, HurtType.Magical, self.towards);
            }

            enemy.PlayShakeAnim();

            self.agent.physicalHurtToEnemy = actualPhysicalHurt;
            self.agent.magicalHurtToEnemy  = actualMagicalHurt;

            // 执行己方攻击命中的回调
            for (int i = 0; i < self.hitTriggerExcutors.Count; i++)
            {
                TriggeredSkillExcutor excutor = self.hitTriggerExcutors[i];
                excutor.triggeredCallback(self, enemy);
            }

            // 执行敌方被击中的回调
            for (int i = 0; i < enemy.beHitTriggerExcutors.Count; i++)
            {
                TriggeredSkillExcutor excutor = enemy.beHitTriggerExcutors[i];
                excutor.triggeredCallback(enemy, self);
            }
        }