| | |
| | | using UnityEngine.UI; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using DG.Tweening; |
| | |
| | | using TowerDefense.Agents; |
| | | using Core.Health; |
| | | using TowerDefense.UI.HUD; |
| | | using TowerDefense.Towers; |
| | | using TowerDefense.Towers.Projectiles; |
| | | |
| | | /** |
| | | * 水精灵技能-冷冻气息控制脚本 |
| | |
| | | /// </summary> |
| | | /// <param name="waveLineId">哪条兵线</param> |
| | | /// <param name="damage">伤害值</param> |
| | | public void ReleaseFreeze(int waveLineId, float damage, IAlignmentProvider alignmentProvider) |
| | | public void ReleaseFreeze(int waveLineId, Tower tower, IAlignmentProvider alignmentProvider) |
| | | { |
| | | WaveLineAgentInsMgr[] agentInsMgrs = AgentInsManager.instance.GetWaveLineList(); |
| | | WaveLineAgentInsMgr waveLineAgentInsMgr = agentInsMgrs[waveLineId]; |
| | |
| | | |
| | | if (agent.AgentType == SpawnAgentType.Normal) |
| | | { |
| | | float damage = GetFinalDamage(tower, agent); |
| | | bool needFrost = BallisticAttack.HandleWaterFrost(201, agent, ref damage); |
| | | agent.addSpeedSlowRate(0.15f); |
| | | agent.PlayOnHitImmediately(); |
| | | EndlessGameUI.instance.generateBloodText(agent.position, damage); |
| | | EndlessGameUI.instance.FloatSlowDownWord(agent.position); |
| | | agent.TakeDamage(damage, agent.position, alignmentProvider); |
| | | |
| | | if (agent.isDead) |
| | | ++deathCount; |
| | | else if (needFrost) |
| | | { |
| | | agent.IsFrost = true; |
| | | agent.FrostRemainTime = FrostTimeAdd.DefaultFrostTime; |
| | | FrostTimeAdd frostTimeAdd = (FrostTimeAdd)EndlessBuffManager.instance.GetBuffInstanceByType(EndlessBuffEffectType.FrostTimeAdd); |
| | | |
| | | if (frostTimeAdd != null) |
| | | agent.FrostRemainTime = frostTimeAdd.GetFrostTime(201); |
| | | } |
| | | } |
| | | else if (agent.AgentType == SpawnAgentType.BubbleBomb) |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessBossSkillBubbleBombGetHit, (agent as BubbleBombAgent).Id); |
| | |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessOneTimeKillCount, deathCount); |
| | | } |
| | | |
| | | private float GetFinalDamage(Tower tower, Agent agent) |
| | | { |
| | | if (tower == null || agent == null) return 0; |
| | | |
| | | int elfId = 201; |
| | | // 基础伤害 = elf_info 基础攻击力 * elf_upgrade 攻击比率 / 1000f |
| | | float basicDamage = ElfInfoData.GetBasicDamage(elfId, tower.currentLevel); |
| | | elf_info info = ElfInfoData.GetDataById(elfId); |
| | | |
| | | // 处理PVE无尽模式,buff增加的伤害 |
| | | if (EndlessBuffManager.instanceExists) |
| | | basicDamage += EndlessBuffManager.instance.ProcessEndlessBuffAttack(basicDamage, elfId); |
| | | |
| | | bool crit = BallisticAttack.IsCrit(elfId); |
| | | |
| | | if (crit) |
| | | { |
| | | float basicCritDamageRate = info != null ? info.b_critdmg / 1000f : 0f; |
| | | basicDamage *= 1 + basicCritDamageRate + BallisticAttack.GetCritDamageRate(elfId); |
| | | } |
| | | |
| | | return basicDamage; |
| | | } |
| | | |
| | | public void PlayFreezeEffect(int waveLineId) |
| | | { |
| | | WaveLineAgentInsMgr[] agentInsMgrs = AgentInsManager.instance.GetWaveLineList(); |