コード例 #1
0
        private IEnumerator DurativeHurt(BattleAgentController self, BattleAgentController enemy)
        {
            int count = 0;

            while (count < healthLoseDuration)
            {
                if (enemy != null && !enemy.isDead)
                {
                    enemy.AddHurtAndShow(healthLoseBase, HurtType.Physical, self.towards);

                    bool fightEnd = enemy.CheckFightEnd();

                    enemy.UpdateStatusPlane();

                    if (fightEnd)
                    {
                        yield break;
                    }

                    yield return(new WaitForSeconds(1.0f));
                }


                count++;
            }
        }
コード例 #2
0
        private IEnumerator Poison(BattleAgentController self, BattleAgentController enemy)
        {
            int count = 0;

            //int hurt = poisonBase * skillLevel + self.agent.extraPoisonHurt;

            while (count < poisonDuration)
            {
                if (enemy != null && !enemy.isDead)
                {
                    enemy.AddHurtAndShow(poisonHurt, HurtType.Physical, self.towards);

                    bool fightEnd = enemy.CheckFightEnd();

                    enemy.UpdateStatusPlane();

                    if (fightEnd)
                    {
                        yield break;
                    }

                    yield return(new WaitForSeconds(1.0f));
                }

                count++;
            }
        }
コード例 #3
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);
        }
コード例 #4
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();
        }
コード例 #5
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);
            }
        }
コード例 #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.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();
        }
コード例 #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 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);
        }
コード例 #8
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();
        }
コード例 #9
0
        private IEnumerator DurativePoison(BattleAgentController self, BattleAgentController enemy)
        {
            int count = 0;

            int hurt = durativeHurtBase * skillLevel + extraHurtBase;

            while (count < duration)
            {
                if (enemy != null && !enemy.isDead)
                {
                    SetEffectAnims(self, enemy);

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

                    bool fightEnd = enemy.CheckFightEnd();

                    enemy.UpdateStatusPlane();

                    if (fightEnd)
                    {
                        yield break;
                    }

                    yield return(new WaitForSeconds(1f));
                }

                count++;
            }
        }
コード例 #10
0
        protected override void HitTriggerCallBack(BattleAgentController self, BattleAgentController enemy)
        {
            int hurt = Mathf.RoundToInt(skillLevel * hurtBase);

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

            //enemy.UpdateStatusPlane ();
        }
コード例 #11
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);
        }
コード例 #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 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);
        }
コード例 #13
0
        protected override void BeHitTriggerCallBack(BattleAgentController self, BattleAgentController enemy)
        {
            float triggeredProbability = fixTriggerProbability + triggeredProbabilityBase * skillLevel;

            if (isEffective(triggeredProbability))
            {
                int hurt = Mathf.RoundToInt(self.agent.armor * refrectScaler);

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

                //enemy.UpdateStatusPlane();

                SetEffectAnims(self, enemy);

                if (sfxName != string.Empty)
                {
                    GameManager.Instance.soundManager.PlayAudioClip(sfxName);
                }
            }
        }
コード例 #14
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);
            }
        }
コード例 #15
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);
        }
コード例 #16
0
        private IEnumerator DurativeHurt(BattleAgentController self, BattleAgentController enemy)
        {
            int count = 0;

            while (count < hurtDuration)
            {
                if (enemy != null && !enemy.isDead)
                {
                    SetEffectAnims(self, enemy);

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

                    enemy.CheckFightEnd();

                    enemy.UpdateStatusPlane();

                    yield return(new WaitForSeconds(1f));
                }

                count++;
            }
        }
コード例 #17
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);
        }
コード例 #18
0
ファイル: FixHurt.cs プロジェクト: stephenhou2/NewWordJourney
        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);
        }
コード例 #19
0
        protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy)
        {
            // 计算原始伤害值
            int hurt = self.agent.attack + fixHurt + hurtBase * skillLevel;

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

            if (armorCal < -50)
            {
                armorCal = -50;
            }
            // 结算护甲和护甲穿透后的伤害
            hurt = Mathf.RoundToInt(hurt / (armorCal / 100f + 1));
            // 吸血值
            int healthGain = (int)(hurt * absorbScaler + self.agent.healthRecovery);

            // 伤害生效
            enemy.AddHurtAndShow(hurt, HurtType.Physical, self.towards);
            // 生命回复生效
            self.AddHealthGainAndShow(healthGain);

            enemy.SetEffectAnim(enemyEffectAnimName);
        }
コード例 #20
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);
        }
コード例 #21
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);
            }
        }