/// <summary> /// 对单个目标进行伤害处理 /// </summary> /// <param name="targeter"></param> /// <param name="attackerModel"></param> /// <param name="attacker">技能道具等情况下 attacker 为 null </param> /// <param name="factor"></param> public static void ProcessDamageOneTargeter(TileEntity targeter, EntityModel attackerModel, TileEntity attacker = null, float factor = 1.0f) { if (!targeter.IsDead()) { // 计算伤害 float damage = CalcDamageValue(targeter.model, attackerModel, attacker, factor); // 处理伤害 targeter.MakeDamage(damage); // 没死亡时附加buffer效果 if (!targeter.IsDead()) { GameBufferComponent bufferMgr = targeter.GetComponent <GameBufferComponent>(); if (bufferMgr != null) { bufferMgr.AddBuffer(attackerModel); } } else { // [特殊技能] 死亡后大回复 if (EntityTypeUtil.IsTraitBlessing(targeter.model)) { // TODO: } } // [特殊技能] 吸血 REMARK:考虑是否需要回血光效? if (attacker != null && damage > 0 && EntityTypeUtil.IsTraitSuckBlood(attackerModel)) { attacker.MakeDamage(-damage * Constants.SUCK_BLOOD_RATIO); } } }