暂存
This commit is contained in:
Binary file not shown.
@@ -127,14 +127,20 @@ namespace ArachnaeSwarm
|
||||
|
||||
// --- AOE Damage Logic ---
|
||||
// Damage other hostiles in the path.
|
||||
float aoeDamage = this.initialDamage + (((Vector3)StartVecInfo.GetValue(this) - this.DrawPos).magnitude * this.damagePerTile);
|
||||
var aoeDinfo = new DamageInfo(this.collisionDamageDef, aoeDamage, 1f, -1, this.FlyingPawn);
|
||||
float distanceTravelled = ((Vector3)StartVecInfo.GetValue(this) - this.DrawPos).magnitude;
|
||||
float currentAOEDamage = this.initialDamage + (distanceTravelled * this.damagePerTile);
|
||||
|
||||
foreach (var thing in GenRadial.RadialDistinctThingsAround(this.Position, this.Map, 1.0f, false))
|
||||
{
|
||||
if (thing != this.FlyingPawn && thing != this && thing != primaryTarget.Thing)
|
||||
{
|
||||
if (thing is Pawn pawn && !pawn.Downed && pawn.HostileTo(this.FlyingPawn))
|
||||
{
|
||||
// --- CRITICAL FIX ---
|
||||
// Create a *new* DamageInfo object for each target.
|
||||
// Reusing the same dinfo object causes its damage value to be modified (e.g., by armor),
|
||||
// resulting in subsequent targets taking zero damage.
|
||||
var aoeDinfo = new DamageInfo(this.collisionDamageDef, currentAOEDamage, 1f, -1, this.FlyingPawn);
|
||||
pawn.TakeDamage(aoeDinfo);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user