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 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 BeAttackedTriggerCallBack(BattleAgentController self, BattleAgentController enemy) { if (!isEffective(triggerProbability)) { return; } float scaler = 1f; int healthDecrease = skillLevel * healthDecreaseBase; if (self.agent.health <= healthDecrease) { scaler = (self.agent.health - 1) / healthDecrease; healthDecrease = self.agent.health - 1; } int armorIncrease = Mathf.RoundToInt(scaler * skillLevel * attackIncreaseBase); int magicResistIncrease = Mathf.RoundToInt(scaler * skillLevel * attackIncreaseBase); self.agent.health -= healthDecrease; self.agent.attack += armorIncrease; self.agent.attackChangeFromSkill += armorIncrease; string tint = "攻击\n提升"; self.AddTintTextToQueue(tint); SetEffectAnims(self, enemy); }
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 override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy) { int armorDecrease = armorDecreaseBase * skillLevel; if (self.agent.armor < armorDecrease) { armorDecrease = self.agent.armor; } self.agent.armor -= armorDecrease; self.agent.armorChangeFromSkill -= armorDecrease; float critIncrease = critIncreaseScaler * skillLevel; self.agent.crit += critIncrease; self.agent.critChangeFromSkill += critIncrease; self.SetEffectAnim(selfEffectAnimName); self.AddTintTextToQueue("护甲\n降低"); self.AddTintTextToQueue("暴击\n提升"); }
protected override void HitTriggerCallBack(BattleAgentController self, BattleAgentController enemy) { if (!hasTriggered && isEffective(triggeredProbability)) { hasTriggered = true; int attackChange = -(int)((attackDecreaseScaler * Player.mainPlayer.agentLevel) + fixedAttackDecrease); enemy.agent.attackChangeFromSkill += attackChange; enemy.agent.attack += attackChange; //enemy.UpdateStatusPlane(); enemy.AddTintTextToQueue("攻击\n降低"); SetEffectAnims(self, enemy); } }
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 HitTriggerCallBack(BattleAgentController self, BattleAgentController enemy) { if (!isTriggered && isEffective(triggeredProbability)) { isTriggered = true; int magicResistDecrease = -(int)(magicResistDecreaseScaler * Player.mainPlayer.agentLevel + fixedMagicResistDecrease); enemy.agent.magicResistChangeFromSkill += magicResistDecrease; enemy.agent.magicResist += magicResistDecrease; //enemy.UpdateStatusPlane(); enemy.AddTintTextToQueue("抗性\n降低"); SetEffectAnims(self, enemy); } }
protected override void HitTriggerCallBack(BattleAgentController self, BattleAgentController enemy) { if (!isEffective(triggerProbability)) { return; } int magicResistDecrease = skillLevel * magicReistDecreaseBase; enemy.agent.magicResist -= magicResistDecrease; enemy.agent.magicResistChangeFromSkill -= magicResistDecrease; enemy.AddTintTextToQueue("抗性降低"); SetEffectAnims(self, enemy); }
protected override void HitTriggerCallBack(BattleAgentController self, BattleAgentController enemy) { if (!isEffective(triggerProbability)) { return; } int armorChange = skillLevel * armorDecreaseBase; enemy.agent.armorChangeFromSkill -= armorChange; enemy.agent.armor -= armorChange; enemy.AddTintTextToQueue("护甲降低"); SetEffectAnims(self, enemy); }
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 BeAttackedTriggerCallBack(BattleAgentController self, BattleAgentController enemy) { float triggerProbability = fixTriggeredProbability + skillLevel * triggeredProbabilityBase; if (!isEffective(triggerProbability)) { return; } int attackDecrease = Mathf.RoundToInt(skillLevel * attackDecreaseBase); enemy.agent.attack -= attackDecrease; enemy.agent.attackChangeFromSkill += attackDecrease; enemy.AddTintTextToQueue("攻击降低"); SetEffectAnims(self, enemy); }
//本次攻击造成额外<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) { // 提升暴击概率 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); }
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); } }
protected override void ExcuteActiveSkillLogic(BattleAgentController self, BattleAgentController enemy) { Agent targetAgent = self.agent; switch (target) { case TargetAgent.Self: targetAgent = self.agent; break; case TargetAgent.Enemy: targetAgent = enemy.agent; break; } if (!hasTriggered || canOverlay) { hasTriggered = true; string tintString = string.Empty; switch (propertyType) { case PropertyType.MaxHealth: int maxHealthRecord = targetAgent.maxHealth; targetAgent.maxHealth += (int)change; targetAgent.health = targetAgent.health * targetAgent.maxHealth / maxHealthRecord; tintString = change > 0 ? "生命上限\n提升" : "生命上限\n降低"; break; case PropertyType.MaxMana: int maxManaRecord = targetAgent.maxMana; targetAgent.maxMana += (int)change; targetAgent.mana = targetAgent.mana * targetAgent.maxMana / maxManaRecord; tintString = change > 0 ? "魔法上限\n提升" : "魔法上限\n降低"; break; case PropertyType.Attack: targetAgent.attack += (int)change; targetAgent.attackChangeFromSkill += (int)change; tintString = change > 0 ? "攻击\n提升" : "攻击\n降低"; break; case PropertyType.MagicAttack: targetAgent.magicAttack += (int)change; targetAgent.magicAttack += (int)change; tintString = change > 0 ? "魔攻\n提升" : "魔攻\n降低"; break; case PropertyType.MoveSpeed: targetAgent.moveSpeed += (int)change; targetAgent.moveSpeedChangeFromSkill += (int)change; tintString = change > 0 ? "移速\n提升" : "移速\n降低"; break; case PropertyType.Armor: targetAgent.armor += (int)change; targetAgent.armorChangeFromSkill += (int)change; tintString = change > 0 ? "护甲\n提升" : "护甲\n降低"; break; case PropertyType.MagicResist: targetAgent.magicResist += (int)change; targetAgent.magicResistChangeFromSkill += (int)change; tintString = change > 0 ? "抗性\n提升" : "抗性\n降低"; break; case PropertyType.ArmorDecrease: targetAgent.armorDecrease += (int)change; targetAgent.armorDecreaseChangeFromSkill += (int)change; tintString = change > 0 ? "护甲穿透\n提升" : "护甲穿透\n降低"; break; case PropertyType.MagicResistDecrease: targetAgent.magicResistDecrease += (int)change; targetAgent.magicResistDecreaseChangeFromSkill += (int)change; tintString = change > 0 ? "抗性穿透\n提升" : "抗性穿透\n降低"; break; case PropertyType.Crit: targetAgent.crit += change; targetAgent.critChangeFromSkill += change; tintString = change > 0 ? "暴击\n提升" : "暴击\n降低"; break; case PropertyType.Dodge: targetAgent.dodge += change; targetAgent.dodgeChangeFromSkill += change; tintString = change > 0 ? "闪避\n提升" : "闪避\n降低"; break; case PropertyType.CritHurtScaler: targetAgent.critHurtScaler += change; targetAgent.critHurtScalerChangeFromSkill += change; tintString = change > 0 ? "暴击伤害\n提升" : "暴击伤害\n降低"; break; } if (selfEffectAnimName != string.Empty) { self.SetEffectAnim(selfEffectAnimName); } if (enemyEffectAnimName != string.Empty) { enemy.SetEffectAnim(enemyEffectAnimName); } switch (target) { case TargetAgent.Self: self.AddTintTextToQueue(tintString); break; case TargetAgent.Enemy: enemy.AddTintTextToQueue(tintString); break; } } }