This commit is contained in:
2025-12-02 11:15:13 +08:00
parent 86d2428271
commit e3676e9908
12 changed files with 998 additions and 38 deletions

View File

@@ -0,0 +1,51 @@
using System.Collections.Generic;
using Verse;
namespace WulaFallenEmpire
{
public class CompProperties_TrapLauncher : CompProperties
{
public float detectionRadius = 10f; // 检测半径
public int scanIntervalTicks = 60; // 扫描间隔ticks
public ThingDef projectileDef; // 抛射体定义
public bool ignoreNonHostilePawns = true; // 是否忽略非敌对Pawn
public bool requireLineOfSight = true; // 是否需要视线
public int maxTargets = 1; // 最大目标数量
public int warmupTicks = 30; // 发射前预热ticks
public bool showDetectionRadius = true; // 是否显示检测半径
// 触发时的音效
public SoundDef triggerSound;
public SoundDef launchSound;
public SoundDef selfDestructSound;
// 视觉效果
public EffecterDef triggerEffect;
public EffecterDef launchEffect;
public EffecterDef selfDestructEffect;
// 扩展选项
public bool canRetarget = false; // 发射后是否可以重新锁定新目标
public int burstCount = 1; // 连发数量
public float burstDelay = 0.1f; // 连发延迟
public bool targetBuildings = false; // 是否瞄准建筑
public CompProperties_TrapLauncher()
{
this.compClass = typeof(CompTrapLauncher);
}
public override IEnumerable<string> ConfigErrors(ThingDef parentDef)
{
foreach (var error in base.ConfigErrors(parentDef))
{
yield return error;
}
if (projectileDef == null)
{
yield return $"CompProperties_TrapLauncher: projectileDef must be set for {parentDef.defName}";
}
}
}
}