protected void SetEffectAnims(TriggerInfo triggerInfo, BattleAgentController self, BattleAgentController enemy) { // 播放技能对应的己方(释放技能方)技能特效动画 switch (triggerInfo.triggerSource) { case SkillEffectTarget.Self: //如果被动逻辑由自己执行 if (selfEffectAnimName != string.Empty) { self.SetEffectAnim(selfEffectAnimName); } if (enemyEffectAnimName != string.Empty) { enemy.SetEffectAnim(enemyEffectAnimName); } break; // 播放技能对应的敌方(技能目标方)的技能特效动画 case SkillEffectTarget.Enemy: // 如果被动逻辑由对方执行 if (selfEffectAnimName != string.Empty) { enemy.SetEffectAnim(selfEffectAnimName); } if (enemyEffectAnimName != string.Empty) { self.SetEffectAnim(enemyEffectAnimName); } break; } }
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); } }
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); }
protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy) { enemy.SetEffectAnim(enemyEffectAnimName); enemy.SetEffectAnim(continuousEffectAnimName, null, 0, hurtDuration); if (poisonCoroutine != null) { StopCoroutine(poisonCoroutine); } poisonCoroutine = DurativeHurt(self, enemy); StartCoroutine(poisonCoroutine); }
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); }
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(); }
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(); }
protected override void BeAttackedTriggerCallBack(BattleAgentController self, BattleAgentController enemy) { int manaDecrease = skillLevel * manaDecreaseBase; if (self.agent.mana < manaDecrease) { return; } float triggerProbability = fixTriggerProbability + skillLevel * triggerProbabilityBase; if (!isEffective(triggerProbability)) { return; } int healthIncrease = skillLevel * healthIncreaseBase + self.agent.healthRecovery; self.agent.mana -= manaDecrease; self.AddHealthGainAndShow(healthIncrease); self.SetEffectAnim(selfEffectAnimName); //self.UpdateStatusPlane(); }
protected override void ExcuteConsumablesSkillLogic(BattleAgentController self) { if (selfEffectAnimName != string.Empty) { self.SetEffectAnim(selfEffectAnimName, null); } // 如果没有状态名称,则默认不是触发状态,直接执行技能 if (statusName == "") { Excute(self); return; } List <TriggeredSkill> sameStatusSkills = self.propertyCalculator.GetTriggeredSkillsWithSameStatus(statusName); // 如果技能效果不可叠加,则被影响人身上原有的同种状态技能效果全部取消,并从战斗结算器中移除这些技能 if (!canOverlay) { for (int i = 0; i < sameStatusSkills.Count; i++) { TriggeredSkill ts = sameStatusSkills [i]; ts.CancelSkillEffect(ts != this); } } // 执行技能 Excute(self); }
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(); }
protected void SetEffectAnims(BattleAgentController self) { // 播放技能对应的己方(释放技能方)技能特效动画 if (selfEffectAnimName != string.Empty) { self.SetEffectAnim(selfEffectAnimName); } }
protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy) { int manaGain = (int)(skillLevel * manaRecoveryScaler * self.agent.magicAttack + fixManaRecovery + self.agent.magicRecovery); self.AddManaGainAndShow(manaGain); self.SetEffectAnim(selfEffectAnimName); }
protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy) { int healthGain = (int)(skillLevel * self.agent.armor * healthGainScaler + fixHealthGain + self.agent.healthRecovery); self.AddHealthGainAndShow(healthGain); self.SetEffectAnim(selfEffectAnimName); }
protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy) { // 计算生命回复值 int healthGain = skillLevel * healthGainBase + fixHealthGain + self.agent.healthRecovery; // 生命回复生效 self.AddHealthGainAndShow(healthGain); self.SetEffectAnim(selfEffectAnimName); }
/// <summary> /// 播放技能特效动画 /// </summary> /// <param name="self">Self.</param> /// <param name="enemy">Enemy.</param> public void SetEffectAnims(BattleAgentController self, BattleAgentController enemy) { if (selfEffectAnimName != string.Empty) { self.SetEffectAnim(selfEffectAnimName, null); } if (enemyEffectAnimName != string.Empty) { enemy.SetEffectAnim(enemyEffectAnimName, null); } }
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); } }
private void EscapeCallBack(BattleAgentController self, BattleAgentController enemy) { int fadeStep = fixFadeStep + fadeStepGainBase * skillLevel; BattlePlayerController battlePlayer = self as BattlePlayerController; if (battlePlayer.agent.health <= 0) { return; } int oriFadeStepsLeft = battlePlayer.fadeStepsLeft; if (oriFadeStepsLeft == 0) { self.SetEffectAnim(selfEffectAnimName, null, 0, 0); } battlePlayer.fadeStepsLeft = Mathf.Max(oriFadeStepsLeft, fadeStep); enemy.QuitFight(); ExploreManager.Instance.EnableExploreInteractivity(); ExploreManager.Instance.currentEnteredMapEvent = null; BattlePlayerController bpCtr = self as BattlePlayerController; bpCtr.PlayRoleAnim(CommonData.roleIdleAnimName, 0, null); bpCtr.escapeFromFight = true; bpCtr.isInEscaping = false; bpCtr.enemy = null; bpCtr.FixPositionToStandard(); MapWalkableEvent mwe = enemy.GetComponent <MapWalkableEvent> (); ExploreManager.Instance.MapWalkableEventsStartAction(); mwe.RefreshWalkableInfoWhenQuit(enemy.isDead); if (!mwe.isInMoving) { mwe.QuitFightAndDelayMove(5); } ExploreManager.Instance.expUICtr.QuitFight(); }
protected override void HitTriggerCallBack(BattleAgentController self, BattleAgentController enemy) { if (isEffective(triggeredProbability)) { enemy.SetRoleAnimTimeScale(1 - fixedAttackSpeedDecreaseScaler * Player.mainPlayer.agentLevel - fixedAttackSpeedDecrease); enemy.AddTintTextToQueue("攻速\n降低"); if (!effectAnimTriggered) { enemy.SetEffectAnim(enemyEffectAnimName, null, 0, 0); effectAnimTriggered = true; } } }
protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy) { int gain = Mathf.RoundToInt(self.agent.maxMana * skillLevel * increaseScaler) + fixIncrease; self.agent.armor += gain; self.agent.armorChangeFromSkill += gain; self.agent.magicResist += gain; self.agent.magicResistChangeFromSkill += gain; self.AddTintTextToQueue("护甲提升"); self.AddTintTextToQueue("抗性提升"); self.SetEffectAnim(selfEffectAnimName); }
protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy) { int enemyAttackChange = enemyAttackDecreaseBase * skillLevel; int selfAttackChange = selfAttackIncreaseBase * skillLevel; self.agent.attack += selfAttackChange; self.agent.attackChangeFromSkill += selfAttackChange; enemy.agent.attack -= enemyAttackChange; enemy.agent.attackChangeFromSkill -= enemyAttackChange; enemy.AddTintTextToQueue("攻击\n降低"); self.AddTintTextToQueue("攻击\n提升"); self.SetEffectAnim(selfEffectAnimName); enemy.SetEffectAnim(enemyEffectAnimName); }
protected override void HitTriggerCallBack(BattleAgentController self, BattleAgentController enemy) { float triggerProbability = fixTriggerProbability + skillLevel * triggerProbabilityBase; if (!isEffective(triggerProbability)) { return; } int healthAbsorb = Mathf.RoundToInt(self.agent.magicalHurtToEnemy * healthAbsorbScaler + self.agent.healthRecovery); self.AddHealthGainAndShow(healthAbsorb); self.UpdateStatusPlane(); self.SetEffectAnim(selfEffectAnimName); }
protected override void HitTriggerCallBack(BattleAgentController self, BattleAgentController enemy) { if (!isEffective(triggerProbability)) { return; } enemy.SetEffectAnim(enemyEffectAnimName, null, 0, 3f); if (poisonCoroutine != null) { StopCoroutine(poisonCoroutine); } poisonCoroutine = DurativePoison(self, enemy); StartCoroutine(poisonCoroutine); }
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); }
protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy) { int healthGain = (int)(self.agent.maxHealth * healthRecoverScaler); //self.agent.health += healthGain; self.AddHealthGainAndShow(healthGain); if (selfEffectAnimName != string.Empty) { self.SetEffectAnim(selfEffectAnimName); } if (enemyEffectAnimName != string.Empty) { enemy.SetEffectAnim(enemyEffectAnimName); } //self.UpdateStatusPlane(); }
protected override void HitTriggerCallBack(BattleAgentController self, BattleAgentController enemy) { if (!isEffective(triggerdProbability)) { return; } poisonHurt = skillLevel * healthDecreaseBase; if (poisonCoroutine != null) { StopCoroutine(poisonCoroutine); } poisonCoroutine = Poison(self, enemy); StartCoroutine(poisonCoroutine); enemy.SetEffectAnim(enemyEffectAnimName, null, 0, poisonDuration); }
protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy) { int healthDecrease = skillLevel * healthDecreaseBase; float scaler = 1f; if (self.agent.health <= healthDecrease) { scaler = (self.agent.health - 1) / healthDecrease; healthDecrease = self.agent.health - 1; } self.agent.health -= healthDecrease; int manaIncrease = Mathf.RoundToInt(scaler * skillLevel * manaIncreaseScaler * self.agent.attack + fixManaIncrease) + self.agent.magicRecovery; self.AddManaGainAndShow(manaIncrease); self.SetEffectAnim(selfEffectAnimName); }
//本次攻击造成额外<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); }
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); }
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); }
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); }