Checkpoint 5 & Checkpoint 6

This commit is contained in:
SepComet
2026-02-22 22:00:43 +08:00
parent 5fb7ea499f
commit f0abf78128
65 changed files with 3875 additions and 137 deletions
+22 -2
View File
@@ -201,6 +201,26 @@ namespace CustomUtility
// return;
// }
EnemyProjectile enemyProjectile = other as EnemyProjectile;
if (enemyProjectile != null)
{
if (!enemyProjectile.IsActive) return;
ImpactData entityImpactData = entity.GetImpactData();
ImpactData projectileImpactData = enemyProjectile.GetImpactData();
if (GetRelation(entityImpactData.Camp, projectileImpactData.Camp) == RelationType.Friendly)
{
return;
}
int entityDamageHP = CalcDamageHP(projectileImpactData.AttackBase, projectileImpactData.AttackStat,
entityImpactData.DefenseStat, entityImpactData.DodgeStat);
entity.ApplyDamage(enemyProjectile, entityDamageHP);
enemyProjectile.Expire();
return;
}
WeaponBase weapon = other as WeaponBase;
if (weapon != null)
{
@@ -220,13 +240,13 @@ namespace CustomUtility
}
}
private static int CalcDamageHP(int attack, StatProperty attackStat, StatProperty defenseStat,
public static int CalcDamageHP(int attack, StatProperty attackStat, StatProperty defenseStat,
StatProperty dodgeStat)
{
// 1. 处理闪避(闪避率取值 (0, 0.9),不允许拉满闪避)
if (dodgeStat != null)
{
if (Random.value < Mathf.Clamp(dodgeStat.Percent, 0, 0.9f)) return 0;
if (Random.value < Mathf.Clamp(dodgeStat.Value, 0, 0.9f)) return 0;
}
// 2. 处理攻击加成 最终伤害 = (基础伤害 + 伤害提升固定值) * 伤害提升率