This commit is contained in:
2025-12-18 11:45:19 +08:00
parent 539e171e1b
commit b57d1dfdd2
10 changed files with 871 additions and 338 deletions

View File

@@ -100,10 +100,6 @@ namespace ArachnaeSwarm
secondaryTargetPawn.TakeDamage(cleaveDinfo);
}
}
// 3. 创建扇形爆炸效果
CreateCleaveExplosion(casterPawn, mainTarget, this.Comp.Props.cleaveRange, this.Comp.Props.cleaveAngle);
return result;
}
@@ -146,49 +142,6 @@ namespace ArachnaeSwarm
cleaveEffect.Cleanup();
}
private void CreateCleaveExplosion(Pawn caster, Thing target, float radius, float angle)
{
if (caster.Map == null || this.Comp.Props.explosionDamageDef == null) return;
Vector3 direction = (target.Position - caster.Position).ToVector3().normalized;
float baseAngle = direction.AngleFlat();
float startAngle = baseAngle - (angle / 2f);
float endAngle = baseAngle + (angle / 2f);
GenExplosion.DoExplosion(
center: caster.Position,
map: caster.Map,
radius: radius,
damType: this.Comp.Props.explosionDamageDef,
instigator: caster,
damAmount: 0,
armorPenetration: 0,
explosionSound: null,
weapon: this.EquipmentSource?.def,
projectile: null,
intendedTarget: target,
postExplosionSpawnThingDef: null,
postExplosionSpawnChance: 0f,
postExplosionSpawnThingCount: 1,
postExplosionGasType: null,
applyDamageToExplosionCellsNeighbors: false,
preExplosionSpawnThingDef: null,
preExplosionSpawnChance: 0f,
preExplosionSpawnThingCount: 1,
chanceToStartFire: 0f,
damageFalloff: false,
direction: null, // Let affectedAngle handle the direction and arc
ignoredThings: null,
affectedAngle: new FloatRange(startAngle, endAngle),
doVisualEffects: true,
propagationSpeed: 1.7f,
excludeRadius: 0.9f,
doSoundEffects: false,
screenShakeFactor: 0.2f
);
}
public override void DrawHighlight(LocalTargetInfo target)
{
base.DrawHighlight(target);