diff --git a/1.6/1.6/Assemblies/WulaFallenEmpire.dll b/1.6/1.6/Assemblies/WulaFallenEmpire.dll
index addba1b1..bc924a42 100644
Binary files a/1.6/1.6/Assemblies/WulaFallenEmpire.dll and b/1.6/1.6/Assemblies/WulaFallenEmpire.dll differ
diff --git a/1.6/1.6/Assemblies/WulaFallenEmpire.pdb b/1.6/1.6/Assemblies/WulaFallenEmpire.pdb
index f31330a9..899a481b 100644
Binary files a/1.6/1.6/Assemblies/WulaFallenEmpire.pdb and b/1.6/1.6/Assemblies/WulaFallenEmpire.pdb differ
diff --git a/1.6/1.6/Languages/English/DefInjected/Defs/Recipes_WULA..xml b/1.6/1.6/Languages/English/DefInjected/Defs/Recipes_WULA..xml
deleted file mode 100644
index c3e0b96e..00000000
--- a/1.6/1.6/Languages/English/DefInjected/Defs/Recipes_WULA..xml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
- Produce Wula Empire Alloy
- A high-density alloy produced by processing steel, it is the raw material for many Wula Empire equipment.
- Forging alloy
-
- Produce Wula Empire Alloy (10 pieces)
- A high-density alloy produced by processing steel, it is the raw material for many Wula Empire equipment.
- Forging alloy
-
- Manufacture Components
- Manufacture components using Wula Empire fabricators. Takes longer than a precision assembly bench and consumes more resources.
- Manufacturing components
-
- Manufacture Wula Empire Power Core
- Manufacture a Wula Empire power core, including a rechargeable capacitor and energy to supply machinery. This is the only acceptable external energy source for mechanical Wulas and a precursor for many Wula Empire products.
- Manufacturing Wula Empire power core
-
- Recharge Power Core
- Use chemfuel to recharge depleted Wula Empire power cores that have lost their energy.
- Recharging Wula Empire power core
-
- Recharge Power Cores (4)
- Use chemfuel to recharge depleted Wula Empire power cores that have lost their energy.
- Recharging Wula Empire power cores
-
- Manufacture Wula Empire Dark Matter
- Manufacture 1 unit of encapsulated dark matter, consisting of a dark matter containment device and dark matter. It is a necessary energy source for Wula Empire large-scale facilities and armaments.
- Manufacturing Wula Empire dark matter
-
- Compress Neutronium
- Manufacture 1 unit of neutronium, a powerful material that can create the hardest armor or the strongest melee weapons.
- Compressing neutronium
-
- Build URa-00 "Mechanical Wula"
- Build a URa-00 "Mechanical Wula" synth, the main species of a Wula Empire synth colony. Possesses complex, realistic simulated emotions while being a mechanoid.
-
- Build CAt-11 "Cat"
- Build a CAt-11 "Cat".
-
- Build CAt-86 "Cat Worker"
- Build a CAt-86 "Cat Worker".
-
- Build CAt-46 "Cat Assault Force"
- Build a CAt-46 "Cat Assault Force".
-
diff --git a/Source/WulaFallenEmpire/Ability/LightningBombardment.cs b/Source/WulaFallenEmpire/Ability/LightningBombardment.cs
index c80ce943..384ecf50 100644
--- a/Source/WulaFallenEmpire/Ability/LightningBombardment.cs
+++ b/Source/WulaFallenEmpire/Ability/LightningBombardment.cs
@@ -111,7 +111,7 @@ namespace WulaFallenEmpire
// 防止过多任务影响性能
if (activeCoroutines.Count >= MAX_CONCURRENT_BOMBARDMENTS)
{
- Log.Warning($"Too many concurrent bombardments on map {map}, max is {MAX_CONCURRENT_BOMBARDMENTS}");
+ WulaLog.Debug($"Too many concurrent bombardments on map {map}, max is {MAX_CONCURRENT_BOMBARDMENTS}");
return;
}
@@ -146,7 +146,7 @@ namespace WulaFallenEmpire
}
catch (Exception ex)
{
- Log.Error($"Lightning bombardment error: {ex}");
+ WulaLog.Debug($"Lightning bombardment error: {ex}");
activeCoroutines.Clear();
}
}
diff --git a/Source/WulaFallenEmpire/Ability/WULA_AbilityAreaDestruction/CompAbilityEffect_AreaDestruction.cs b/Source/WulaFallenEmpire/Ability/WULA_AbilityAreaDestruction/CompAbilityEffect_AreaDestruction.cs
index a0ea0820..98ce00c4 100644
--- a/Source/WulaFallenEmpire/Ability/WULA_AbilityAreaDestruction/CompAbilityEffect_AreaDestruction.cs
+++ b/Source/WulaFallenEmpire/Ability/WULA_AbilityAreaDestruction/CompAbilityEffect_AreaDestruction.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using RimWorld;
using UnityEngine;
using Verse;
@@ -99,14 +99,14 @@ namespace WulaFallenEmpire
// 处理目标
ProcessTarget(thing);
- Log.Message($"[AreaDestruction] Cleared overlapping object: {thing.Label} at {casterPos}");
+ WulaLog.Debug($"[AreaDestruction] Cleared overlapping object: {thing.Label} at {casterPos}");
}
}
}
}
catch (System.Exception ex)
{
- Log.Warning($"[AreaDestruction] Error clearing overlapping objects: {ex.Message}");
+ WulaLog.Debug($"[AreaDestruction] Error clearing overlapping objects: {ex.Message}");
}
}
@@ -135,7 +135,7 @@ namespace WulaFallenEmpire
}
catch (System.Exception ex)
{
- Log.Warning($"[AreaDestruction] Error playing clear effecter: {ex.Message}");
+ WulaLog.Debug($"[AreaDestruction] Error playing clear effecter: {ex.Message}");
}
}
@@ -174,7 +174,7 @@ namespace WulaFallenEmpire
}
catch (System.Exception ex)
{
- Log.Warning($"[AreaDestruction] Error playing hit effecter on {target?.Label}: {ex.Message}");
+ WulaLog.Debug($"[AreaDestruction] Error playing hit effecter on {target?.Label}: {ex.Message}");
}
}
@@ -243,11 +243,11 @@ namespace WulaFallenEmpire
building.Destroy(DestroyMode.Vanish);
// 可选:记录日志用于调试
- // Log.Message($"[AreaDestruction] Destroyed building: {buildingInfo}");
+ // WulaLog.Debug($"[AreaDestruction] Destroyed building: {buildingInfo}");
}
catch (System.Exception ex)
{
- Log.Warning($"[AreaDestruction] Error destroying building {building?.Label}: {ex.Message}");
+ WulaLog.Debug($"[AreaDestruction] Error destroying building {building?.Label}: {ex.Message}");
}
}
@@ -287,7 +287,7 @@ namespace WulaFallenEmpire
}
catch (System.Exception ex)
{
- Log.Warning($"[AreaDestruction] Error destroying body parts on {targetPawn?.Label}: {ex.Message}");
+ WulaLog.Debug($"[AreaDestruction] Error destroying body parts on {targetPawn?.Label}: {ex.Message}");
}
}
diff --git a/Source/WulaFallenEmpire/Ability/WULA_AbilityBombardment/CompAbilityEffect_Bombardment.cs b/Source/WulaFallenEmpire/Ability/WULA_AbilityBombardment/CompAbilityEffect_Bombardment.cs
index ea9d84bf..42f77da0 100644
--- a/Source/WulaFallenEmpire/Ability/WULA_AbilityBombardment/CompAbilityEffect_Bombardment.cs
+++ b/Source/WulaFallenEmpire/Ability/WULA_AbilityBombardment/CompAbilityEffect_Bombardment.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using Verse;
using UnityEngine;
using System.Collections.Generic;
@@ -36,7 +36,7 @@ namespace WulaFallenEmpire
try
{
- Log.Message($"[Bombardment] Starting bombardment at {target.Cell} with direction to {dest.Cell}");
+ WulaLog.Debug($"[Bombardment] Starting bombardment at {target.Cell} with direction to {dest.Cell}");
// 计算轰炸区域和方向(基于两个目标点)
CalculateBombardmentArea(target.Cell, dest.Cell);
@@ -50,11 +50,11 @@ namespace WulaFallenEmpire
// 开始前摇
StartWarmup();
- Log.Message($"[Bombardment] Bombardment initialized: {targetCells.Count} targets in {bombardmentRows.Count} rows");
+ WulaLog.Debug($"[Bombardment] Bombardment initialized: {targetCells.Count} targets in {bombardmentRows.Count} rows");
}
catch (System.Exception ex)
{
- Log.Error($"[Bombardment] Error starting bombardment: {ex}");
+ WulaLog.Debug($"[Bombardment] Error starting bombardment: {ex}");
}
}
@@ -253,7 +253,7 @@ namespace WulaFallenEmpire
bombardmentDirection = direction;
- Log.Message($"[Bombardment] Bombardment direction: {bombardmentDirection} (from {startCell} to {directionCell})");
+ WulaLog.Debug($"[Bombardment] Bombardment direction: {bombardmentDirection} (from {startCell} to {directionCell})");
}
private void SelectTargetCells()
@@ -294,7 +294,7 @@ namespace WulaFallenEmpire
}
targetCells = selectedCells;
- Log.Message($"[Bombardment] Selected {targetCells.Count} target cells from {areaCells.Count} area cells");
+ WulaLog.Debug($"[Bombardment] Selected {targetCells.Count} target cells from {areaCells.Count} area cells");
}
// 修复:重新组织目标格子成排,确保正确的渐进顺序
@@ -343,7 +343,7 @@ namespace WulaFallenEmpire
});
}
- Log.Message($"[Bombardment] Organized into {bombardmentRows.Count} rows in progressive order");
+ WulaLog.Debug($"[Bombardment] Organized into {bombardmentRows.Count} rows in progressive order");
}
private void StartWarmup()
@@ -359,7 +359,7 @@ namespace WulaFallenEmpire
CreateAreaEffecter();
}
- Log.Message($"[Bombardment] Warmup started: {warmupTicksRemaining} ticks remaining");
+ WulaLog.Debug($"[Bombardment] Warmup started: {warmupTicksRemaining} ticks remaining");
}
private void UpdateWarmup()
@@ -371,7 +371,7 @@ namespace WulaFallenEmpire
// 前摇结束,开始轰炸
currentState = BombardmentState.Bombarding;
nextBombardmentTick = Find.TickManager.TicksGame;
- Log.Message($"[Bombardment] Warmup completed, starting progressive bombardment");
+ WulaLog.Debug($"[Bombardment] Warmup completed, starting progressive bombardment");
}
}
@@ -384,7 +384,7 @@ namespace WulaFallenEmpire
{
// 所有排都轰炸完毕
currentState = BombardmentState.Completed;
- Log.Message($"[Bombardment] Progressive bombardment completed");
+ WulaLog.Debug($"[Bombardment] Progressive bombardment completed");
return;
}
@@ -396,7 +396,7 @@ namespace WulaFallenEmpire
currentRowIndex++;
currentCellIndex = 0;
nextBombardmentTick = Find.TickManager.TicksGame + Props.rowDelayTicks;
- Log.Message($"[Bombardment] Moving to next row {currentRowIndex + 1}/{bombardmentRows.Count}");
+ WulaLog.Debug($"[Bombardment] Moving to next row {currentRowIndex + 1}/{bombardmentRows.Count}");
return;
}
@@ -408,7 +408,7 @@ namespace WulaFallenEmpire
nextBombardmentTick = Find.TickManager.TicksGame + Props.impactDelayTicks;
// 记录轰炸进度
- Log.Message($"[Bombardment] Bombarding cell {currentCellIndex}/{currentRow.cells.Count} in row {currentRowIndex + 1}/{bombardmentRows.Count}");
+ WulaLog.Debug($"[Bombardment] Bombarding cell {currentCellIndex}/{currentRow.cells.Count} in row {currentRowIndex + 1}/{bombardmentRows.Count}");
}
private void LaunchBombardment(IntVec3 targetCell)
@@ -420,7 +420,7 @@ namespace WulaFallenEmpire
// 使用 Skyfaller
Skyfaller skyfaller = SkyfallerMaker.MakeSkyfaller(Props.skyfallerDef);
GenSpawn.Spawn(skyfaller, targetCell, parent.pawn.Map);
- Log.Message($"[Bombardment] Launched skyfaller at {targetCell}");
+ WulaLog.Debug($"[Bombardment] Launched skyfaller at {targetCell}");
}
else if (Props.projectileDef != null)
{
@@ -429,12 +429,12 @@ namespace WulaFallenEmpire
}
else
{
- Log.Error($"[Bombardment] No skyfaller or projectile defined for bombardment");
+ WulaLog.Debug($"[Bombardment] No skyfaller or projectile defined for bombardment");
}
}
catch (System.Exception ex)
{
- Log.Error($"[Bombardment] Error launching bombardment at {targetCell}: {ex}");
+ WulaLog.Debug($"[Bombardment] Error launching bombardment at {targetCell}: {ex}");
}
}
@@ -455,7 +455,7 @@ namespace WulaFallenEmpire
ProjectileHitFlags.All,
false
);
- Log.Message($"[Bombardment] Launched projectile at {targetCell}");
+ WulaLog.Debug($"[Bombardment] Launched projectile at {targetCell}");
}
}
@@ -482,7 +482,7 @@ namespace WulaFallenEmpire
bombardmentRows.Clear();
currentPreviewCells.Clear();
- Log.Message($"[Bombardment] Cleanup completed");
+ WulaLog.Debug($"[Bombardment] Cleanup completed");
}
private IntVec3 GetSafeMapPosition(IntVec3 pos, Map map)
diff --git a/Source/WulaFallenEmpire/Ability/WULA_AbilityCallSkyfaller/CompAbilityEffect_CallSkyfaller.cs b/Source/WulaFallenEmpire/Ability/WULA_AbilityCallSkyfaller/CompAbilityEffect_CallSkyfaller.cs
index 887e9ba7..e60e0d7f 100644
--- a/Source/WulaFallenEmpire/Ability/WULA_AbilityCallSkyfaller/CompAbilityEffect_CallSkyfaller.cs
+++ b/Source/WulaFallenEmpire/Ability/WULA_AbilityCallSkyfaller/CompAbilityEffect_CallSkyfaller.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using Verse;
using UnityEngine;
using System.Collections.Generic;
@@ -21,11 +21,11 @@ namespace WulaFallenEmpire
// 创建延时召唤
CallSkyfallerDelayed(target.Cell);
- Log.Message($"[CallSkyfaller] Scheduled skyfaller at {target.Cell} with {Props.delayTicks} ticks delay");
+ WulaLog.Debug($"[CallSkyfaller] Scheduled skyfaller at {target.Cell} with {Props.delayTicks} ticks delay");
}
catch (System.Exception ex)
{
- Log.Error($"[CallSkyfaller] Error calling skyfaller: {ex}");
+ WulaLog.Debug($"[CallSkyfaller] Error calling skyfaller: {ex}");
}
}
diff --git a/Source/WulaFallenEmpire/Ability/WULA_AbilityCallSkyfaller/MapComponent_SkyfallerDelayed.cs b/Source/WulaFallenEmpire/Ability/WULA_AbilityCallSkyfaller/MapComponent_SkyfallerDelayed.cs
index a71ea5a4..2e5cbb34 100644
--- a/Source/WulaFallenEmpire/Ability/WULA_AbilityCallSkyfaller/MapComponent_SkyfallerDelayed.cs
+++ b/Source/WulaFallenEmpire/Ability/WULA_AbilityCallSkyfaller/MapComponent_SkyfallerDelayed.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using RimWorld;
using Verse;
@@ -49,12 +49,12 @@ namespace WulaFallenEmpire
if (Prefs.DevMode)
{
- Log.Message($"[DelayedSkyfaller] Spawned '{delayedSkyfaller.skyfallerDef.defName}' at {delayedSkyfaller.targetCell}");
+ WulaLog.Debug($"[DelayedSkyfaller] Spawned '{delayedSkyfaller.skyfallerDef.defName}' at {delayedSkyfaller.targetCell}");
}
}
catch (System.Exception ex)
{
- Log.Error($"[DelayedSkyfaller] Error spawning skyfaller: {ex}");
+ WulaLog.Debug($"[DelayedSkyfaller] Error spawning skyfaller: {ex}");
}
}
diff --git a/Source/WulaFallenEmpire/Ability/WULA_AbilityCircularBombardment/CompAbilityEffect_CircularBombardment.cs b/Source/WulaFallenEmpire/Ability/WULA_AbilityCircularBombardment/CompAbilityEffect_CircularBombardment.cs
index e4af6f81..e8059419 100644
--- a/Source/WulaFallenEmpire/Ability/WULA_AbilityCircularBombardment/CompAbilityEffect_CircularBombardment.cs
+++ b/Source/WulaFallenEmpire/Ability/WULA_AbilityCircularBombardment/CompAbilityEffect_CircularBombardment.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using Verse;
using UnityEngine;
using System.Collections.Generic;
@@ -38,7 +38,7 @@ namespace WulaFallenEmpire
try
{
- Log.Message($"[CircularBombardment] Starting circular bombardment at {target.Cell}");
+ WulaLog.Debug($"[CircularBombardment] Starting circular bombardment at {target.Cell}");
// 设置轰炸中心
bombardmentCenter = target.Cell;
@@ -52,13 +52,13 @@ namespace WulaFallenEmpire
// 开始前摇
StartWarmup();
- Log.Message($"[CircularBombardment] Bombardment initialized: {targetCells.Count} targets, " +
+ WulaLog.Debug($"[CircularBombardment] Bombardment initialized: {targetCells.Count} targets, " +
$"{Props.simultaneousLaunches} simultaneous launches, " +
$"independent intervals: {Props.useIndependentIntervals}");
}
catch (System.Exception ex)
{
- Log.Error($"[CircularBombardment] Error starting bombardment: {ex}");
+ WulaLog.Debug($"[CircularBombardment] Error starting bombardment: {ex}");
}
}
@@ -226,7 +226,7 @@ namespace WulaFallenEmpire
}
targetCells = selectedCells;
- Log.Message($"[CircularBombardment] Selected {targetCells.Count} target cells from {areaCells.Count} area cells");
+ WulaLog.Debug($"[CircularBombardment] Selected {targetCells.Count} target cells from {areaCells.Count} area cells");
}
// 检查单元格是否有效
@@ -269,7 +269,7 @@ namespace WulaFallenEmpire
launchesCompleted = 0;
currentGroupIndex = 0;
- Log.Message($"[CircularBombardment] Warmup started: {warmupTicksRemaining} ticks remaining");
+ WulaLog.Debug($"[CircularBombardment] Warmup started: {warmupTicksRemaining} ticks remaining");
}
private void UpdateWarmup()
@@ -281,7 +281,7 @@ namespace WulaFallenEmpire
// 前摇结束,开始发射
currentState = CircularBombardmentState.Launching;
nextLaunchTick = Find.TickManager.TicksGame;
- Log.Message($"[CircularBombardment] Warmup completed, starting launches");
+ WulaLog.Debug($"[CircularBombardment] Warmup completed, starting launches");
}
}
@@ -291,7 +291,7 @@ namespace WulaFallenEmpire
if (remainingTargets.Count == 0 || launchesCompleted >= Props.maxLaunches)
{
currentState = CircularBombardmentState.Completed;
- Log.Message($"[CircularBombardment] All launches completed: {launchesCompleted}/{Props.maxLaunches}");
+ WulaLog.Debug($"[CircularBombardment] All launches completed: {launchesCompleted}/{Props.maxLaunches}");
return;
}
@@ -307,7 +307,7 @@ namespace WulaFallenEmpire
nextInnerLaunchTick = Find.TickManager.TicksGame;
currentGroupIndex++;
- Log.Message($"[CircularBombardment] Starting group {currentGroupIndex} with {currentGroupTargets.Count} targets, using independent intervals");
+ WulaLog.Debug($"[CircularBombardment] Starting group {currentGroupIndex} with {currentGroupTargets.Count} targets, using independent intervals");
}
else
{
@@ -323,7 +323,7 @@ namespace WulaFallenEmpire
// 设置下一组发射时间
nextLaunchTick = Find.TickManager.TicksGame + Props.launchIntervalTicks;
- Log.Message($"[CircularBombardment] Launched group {currentGroupIndex + 1} simultaneously: {currentGroupTargets.Count} targets");
+ WulaLog.Debug($"[CircularBombardment] Launched group {currentGroupIndex + 1} simultaneously: {currentGroupTargets.Count} targets");
}
}
@@ -338,7 +338,7 @@ namespace WulaFallenEmpire
// 当前组发射完毕
isInGroupLaunch = false;
nextLaunchTick = Find.TickManager.TicksGame + Props.launchIntervalTicks;
- Log.Message($"[CircularBombardment] Group {currentGroupIndex} completed");
+ WulaLog.Debug($"[CircularBombardment] Group {currentGroupIndex} completed");
return;
}
@@ -361,7 +361,7 @@ namespace WulaFallenEmpire
nextLaunchTick = Find.TickManager.TicksGame + Props.launchIntervalTicks;
}
- Log.Message($"[CircularBombardment] Launched target in group {currentGroupIndex} ({launchesCompleted}/{Props.maxLaunches})");
+ WulaLog.Debug($"[CircularBombardment] Launched target in group {currentGroupIndex} ({launchesCompleted}/{Props.maxLaunches})");
}
// 更新发射逻辑
@@ -384,7 +384,7 @@ namespace WulaFallenEmpire
(remainingTargets.Count == 0 && !isInGroupLaunch))
{
currentState = CircularBombardmentState.Completed;
- Log.Message($"[CircularBombardment] Bombardment completed: {launchesCompleted} launches");
+ WulaLog.Debug($"[CircularBombardment] Bombardment completed: {launchesCompleted} launches");
}
}
@@ -405,12 +405,12 @@ namespace WulaFallenEmpire
}
else
{
- Log.Error($"[CircularBombardment] No skyfaller or projectile defined");
+ WulaLog.Debug($"[CircularBombardment] No skyfaller or projectile defined");
}
}
catch (System.Exception ex)
{
- Log.Error($"[CircularBombardment] Error launching at {targetCell}: {ex}");
+ WulaLog.Debug($"[CircularBombardment] Error launching at {targetCell}: {ex}");
}
}
@@ -447,7 +447,7 @@ namespace WulaFallenEmpire
isInGroupLaunch = false;
launchesCompleted = 0;
- Log.Message($"[CircularBombardment] Cleanup completed");
+ WulaLog.Debug($"[CircularBombardment] Cleanup completed");
}
public override void CompTick()
diff --git a/Source/WulaFallenEmpire/Ability/WULA_AbilityDeleteTarget/CompAbilityEffect_DeleteTarget.cs b/Source/WulaFallenEmpire/Ability/WULA_AbilityDeleteTarget/CompAbilityEffect_DeleteTarget.cs
index 2b16dabf..b2f8c4bc 100644
--- a/Source/WulaFallenEmpire/Ability/WULA_AbilityDeleteTarget/CompAbilityEffect_DeleteTarget.cs
+++ b/Source/WulaFallenEmpire/Ability/WULA_AbilityDeleteTarget/CompAbilityEffect_DeleteTarget.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using Verse;
using UnityEngine;
using System.Collections.Generic;
@@ -64,11 +64,11 @@ namespace WulaFallenEmpire
Props.soundEffect.PlayOneShot(new TargetInfo(cell, map));
}
- Log.Message($"[DeleteTarget] Processed cell {cell}, deleted {deletionCount} objects");
+ WulaLog.Debug($"[DeleteTarget] Processed cell {cell}, deleted {deletionCount} objects");
}
catch (System.Exception ex)
{
- Log.Error($"[DeleteTarget] Error deleting objects at {cell}: {ex}");
+ WulaLog.Debug($"[DeleteTarget] Error deleting objects at {cell}: {ex}");
}
}
@@ -123,13 +123,13 @@ namespace WulaFallenEmpire
if (thing.Spawned)
{
thing.DeSpawn(DestroyMode.Vanish);
- Log.Message($"[DeleteTarget] Method1 - DeSpawn: {thingInfo}");
+ WulaLog.Debug($"[DeleteTarget] Method1 - DeSpawn: {thingInfo}");
return true;
}
}
catch (System.Exception ex1)
{
- Log.Warning($"[DeleteTarget] Method1 failed for {thingInfo}: {ex1}");
+ WulaLog.Debug($"[DeleteTarget] Method1 failed for {thingInfo}: {ex1}");
}
try
@@ -138,13 +138,13 @@ namespace WulaFallenEmpire
if (thing.Spawned)
{
ForceRemoveFromThingGrid(thing, map);
- Log.Message($"[DeleteTarget] Method2 - ForceRemoveFromThingGrid: {thingInfo}");
+ WulaLog.Debug($"[DeleteTarget] Method2 - ForceRemoveFromThingGrid: {thingInfo}");
return true;
}
}
catch (System.Exception ex2)
{
- Log.Warning($"[DeleteTarget] Method2 failed for {thingInfo}: {ex2}");
+ WulaLog.Debug($"[DeleteTarget] Method2 failed for {thingInfo}: {ex2}");
}
try
@@ -153,13 +153,13 @@ namespace WulaFallenEmpire
if (thing.Spawned)
{
ForceDespawnViaReflection(thing, map);
- Log.Message($"[DeleteTarget] Method3 - ForceDespawnViaReflection: {thingInfo}");
+ WulaLog.Debug($"[DeleteTarget] Method3 - ForceDespawnViaReflection: {thingInfo}");
return true;
}
}
catch (System.Exception ex3)
{
- Log.Warning($"[DeleteTarget] Method3 failed for {thingInfo}: {ex3}");
+ WulaLog.Debug($"[DeleteTarget] Method3 failed for {thingInfo}: {ex3}");
}
try
@@ -168,16 +168,16 @@ namespace WulaFallenEmpire
if (thing.Spawned)
{
CallInternalCleanup(thing, map);
- Log.Message($"[DeleteTarget] Method4 - CallInternalCleanup: {thingInfo}");
+ WulaLog.Debug($"[DeleteTarget] Method4 - CallInternalCleanup: {thingInfo}");
return true;
}
}
catch (System.Exception ex4)
{
- Log.Warning($"[DeleteTarget] Method4 failed for {thingInfo}: {ex4}");
+ WulaLog.Debug($"[DeleteTarget] Method4 failed for {thingInfo}: {ex4}");
}
- Log.Error($"[DeleteTarget] All methods failed for: {thingInfo}");
+ WulaLog.Debug($"[DeleteTarget] All methods failed for: {thingInfo}");
return false;
}
@@ -199,7 +199,7 @@ namespace WulaFallenEmpire
}
catch (System.Exception ex)
{
- Log.Warning($"[DeleteTarget] ForceRemoveFromThingGrid failed: {ex}");
+ WulaLog.Debug($"[DeleteTarget] ForceRemoveFromThingGrid failed: {ex}");
throw;
}
}
@@ -242,7 +242,7 @@ namespace WulaFallenEmpire
}
catch (System.Exception ex)
{
- Log.Warning($"[DeleteTarget] RemoveThingFromCell failed: {ex}");
+ WulaLog.Debug($"[DeleteTarget] RemoveThingFromCell failed: {ex}");
}
}
@@ -279,7 +279,7 @@ namespace WulaFallenEmpire
}
catch (System.Exception ex)
{
- Log.Warning($"[DeleteTarget] ForceDespawnViaReflection failed: {ex}");
+ WulaLog.Debug($"[DeleteTarget] ForceDespawnViaReflection failed: {ex}");
throw;
}
}
@@ -310,7 +310,7 @@ namespace WulaFallenEmpire
}
catch (System.Exception ex)
{
- Log.Warning($"[DeleteTarget] CallInternalCleanup failed: {ex}");
+ WulaLog.Debug($"[DeleteTarget] CallInternalCleanup failed: {ex}");
throw;
}
}
diff --git a/Source/WulaFallenEmpire/Ability/WULA_AbilityEnergyLance/CompAbilityEffect_EnergyLance.cs b/Source/WulaFallenEmpire/Ability/WULA_AbilityEnergyLance/CompAbilityEffect_EnergyLance.cs
index 9398bad1..6679acf7 100644
--- a/Source/WulaFallenEmpire/Ability/WULA_AbilityEnergyLance/CompAbilityEffect_EnergyLance.cs
+++ b/Source/WulaFallenEmpire/Ability/WULA_AbilityEnergyLance/CompAbilityEffect_EnergyLance.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using Verse;
using UnityEngine;
@@ -32,11 +32,11 @@ namespace WulaFallenEmpire
parent.pawn
);
- Log.Message($"[EnergyLance] Started {lanceDef.defName} from {target.Cell} to {dest.Cell}");
+ WulaLog.Debug($"[EnergyLance] Started {lanceDef.defName} from {target.Cell} to {dest.Cell}");
}
catch (System.Exception ex)
{
- Log.Error($"[EnergyLance] Error starting EnergyLance: {ex}");
+ WulaLog.Debug($"[EnergyLance] Error starting EnergyLance: {ex}");
}
}
diff --git a/Source/WulaFallenEmpire/Ability/WULA_AbilityEnergyLance/EnergyLance.cs b/Source/WulaFallenEmpire/Ability/WULA_AbilityEnergyLance/EnergyLance.cs
index 41f54091..edf1d8f4 100644
--- a/Source/WulaFallenEmpire/Ability/WULA_AbilityEnergyLance/EnergyLance.cs
+++ b/Source/WulaFallenEmpire/Ability/WULA_AbilityEnergyLance/EnergyLance.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using Verse;
using UnityEngine;
using System.Collections.Generic;
@@ -69,12 +69,12 @@ namespace WulaFallenEmpire
hasStarted = true;
}
- Log.Message($"[EnergyLance] Target updated to: {targetPos}, current position: {base.Position}");
+ WulaLog.Debug($"[EnergyLance] Target updated to: {targetPos}, current position: {base.Position}");
}
else
{
hasValidTarget = false;
- Log.Message("[EnergyLance] Target cleared");
+ WulaLog.Debug("[EnergyLance] Target cleared");
}
}
@@ -107,7 +107,7 @@ namespace WulaFallenEmpire
if (newCell != base.Position && newCell.InBounds(base.Map))
{
base.Position = newCell;
- Log.Message($"[EnergyLance] Moved to new cell: {newCell}");
+ WulaLog.Debug($"[EnergyLance] Moved to new cell: {newCell}");
}
// 检查是否接近目标
@@ -117,7 +117,7 @@ namespace WulaFallenEmpire
// 非常接近目标,直接设置到目标位置
exactPosition = targetVector;
base.Position = currentTargetPosition;
- Log.Message($"[EnergyLance] Reached target position: {currentTargetPosition}");
+ WulaLog.Debug($"[EnergyLance] Reached target position: {currentTargetPosition}");
}
}
else
@@ -170,7 +170,7 @@ namespace WulaFallenEmpire
// 检查是否长时间没有收到目标更新
if (hasValidTarget && Find.TickManager.TicksGame - lastTargetUpdateTick > maxIdleTicks)
{
- Log.Message("[EnergyLance] No target updates received, self-destructing");
+ WulaLog.Debug("[EnergyLance] No target updates received, self-destructing");
CompleteEnergyLance();
return;
}
@@ -202,7 +202,7 @@ namespace WulaFallenEmpire
sustainer?.End();
sustainer = null;
- Log.Message($"[EnergyLance] 光束完成 at position {base.Position}, ticksPassed: {ticksPassed}, durationTicks: {durationTicks}");
+ WulaLog.Debug($"[EnergyLance] 光束完成 at position {base.Position}, ticksPassed: {ticksPassed}, durationTicks: {durationTicks}");
// 销毁自身
Destroy();
@@ -307,7 +307,7 @@ namespace WulaFallenEmpire
// 开始音效
StartSound();
- Log.Message($"[EnergyLance] Spawned at {base.Position}, target: {endPosition}, " +
+ WulaLog.Debug($"[EnergyLance] Spawned at {base.Position}, target: {endPosition}, " +
$"exact position: {exactPosition}");
}
}
@@ -319,11 +319,11 @@ namespace WulaFallenEmpire
if (startAnimationMethod != null)
{
startAnimationMethod.Invoke(orbitalBeamComp, new object[] { durationTicks, 10, 0f });
- Log.Message("[EnergyLance] Orbital beam animation started");
+ WulaLog.Debug("[EnergyLance] Orbital beam animation started");
}
else
{
- Log.Warning("[EnergyLance] Could not find StartAnimation method on CompOrbitalBeam");
+ WulaLog.Debug("[EnergyLance] Could not find StartAnimation method on CompOrbitalBeam");
}
}
@@ -397,7 +397,7 @@ namespace WulaFallenEmpire
IntVec3 spawnPosition = end.IsValid ? end : start;
GenSpawn.Spawn(energyLance, spawnPosition, map);
- Log.Message($"[EnergyLance] Created {energyLanceDef.defName} at {spawnPosition}, target: {end}");
+ WulaLog.Debug($"[EnergyLance] Created {energyLanceDef.defName} at {spawnPosition}, target: {end}");
return energyLance;
}
}
diff --git a/Source/WulaFallenEmpire/Ability/WULA_AbilityTeleportSelf/CompAbilityEffect_TeleportSelf.cs b/Source/WulaFallenEmpire/Ability/WULA_AbilityTeleportSelf/CompAbilityEffect_TeleportSelf.cs
index d1aa2d63..855f7a1a 100644
--- a/Source/WulaFallenEmpire/Ability/WULA_AbilityTeleportSelf/CompAbilityEffect_TeleportSelf.cs
+++ b/Source/WulaFallenEmpire/Ability/WULA_AbilityTeleportSelf/CompAbilityEffect_TeleportSelf.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Linq; // 添加这个 using 指令
using RimWorld;
using UnityEngine;
@@ -141,7 +141,7 @@ namespace WulaFallenEmpire
// 记录传送调整信息(调试用)
if (finalTargetCell != target.Cell)
{
- Log.Message($"[TeleportSelf] AI传送位置从 {target.Cell} 调整到 {finalTargetCell}");
+ WulaLog.Debug($"[TeleportSelf] AI传送位置从 {target.Cell} 调整到 {finalTargetCell}");
}
}
diff --git a/Source/WulaFallenEmpire/Ability/WULA_PullTarget/CompAbilityEffect_PullTarget.cs b/Source/WulaFallenEmpire/Ability/WULA_PullTarget/CompAbilityEffect_PullTarget.cs
index 2b164c67..41d342ca 100644
--- a/Source/WulaFallenEmpire/Ability/WULA_PullTarget/CompAbilityEffect_PullTarget.cs
+++ b/Source/WulaFallenEmpire/Ability/WULA_PullTarget/CompAbilityEffect_PullTarget.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Linq;
using RimWorld;
using UnityEngine;
@@ -120,7 +120,7 @@ namespace WulaFallenEmpire
// 记录拉取信息
if (Prefs.DevMode)
{
- Log.Message($"[PullTarget] {caster.Label} 将 {targetPawn.Label} 拉取到 {finalDestination}");
+ WulaLog.Debug($"[PullTarget] {caster.Label} 将 {targetPawn.Label} 拉取到 {finalDestination}");
}
}
diff --git a/Source/WulaFallenEmpire/BuildingComp/Building_ExtraGraphics.cs b/Source/WulaFallenEmpire/BuildingComp/Building_ExtraGraphics.cs
index 78421863..c939241c 100644
--- a/Source/WulaFallenEmpire/BuildingComp/Building_ExtraGraphics.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/Building_ExtraGraphics.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using RimWorld;
using UnityEngine;
@@ -30,7 +30,7 @@ namespace WulaFallenEmpire
modExtension = def.GetModExtension();
if (modExtension == null)
{
- Log.Error($"Building_ExtraGraphics: No ExtraGraphicsExtension found for {def.defName}");
+ WulaLog.Debug($"Building_ExtraGraphics: No ExtraGraphicsExtension found for {def.defName}");
// 创建默认配置避免空引用
modExtension = new ExtraGraphicsExtension();
}
@@ -114,7 +114,7 @@ namespace WulaFallenEmpire
case "metaoverlay":
return ShaderDatabase.MetaOverlay;
default:
- Log.Warning($"Building_ExtraGraphics: Shader '{shaderName}' not found, using TransparentPostLight as fallback");
+ WulaLog.Debug($"Building_ExtraGraphics: Shader '{shaderName}' not found, using TransparentPostLight as fallback");
return ShaderDatabase.TransparentPostLight;
}
}
@@ -140,7 +140,7 @@ namespace WulaFallenEmpire
{
if (ModExtension.graphicLayers == null || ModExtension.graphicLayers.Count == 0)
{
- Log.Warning($"Building_ExtraGraphics: No graphic layers configured for {def.defName}");
+ WulaLog.Debug($"Building_ExtraGraphics: No graphic layers configured for {def.defName}");
return;
}
@@ -158,7 +158,7 @@ namespace WulaFallenEmpire
{
if (string.IsNullOrEmpty(layer.texturePath))
{
- Log.Warning($"Building_ExtraGraphics: Empty texture path in layer for {def.defName}");
+ WulaLog.Debug($"Building_ExtraGraphics: Empty texture path in layer for {def.defName}");
return;
}
@@ -223,7 +223,7 @@ namespace WulaFallenEmpire
if (mesh == null || mat == null)
{
- Log.Warning($"Building_ExtraGraphics: Unable to get mesh or material for rotating layer");
+ WulaLog.Debug($"Building_ExtraGraphics: Unable to get mesh or material for rotating layer");
return;
}
@@ -273,7 +273,7 @@ namespace WulaFallenEmpire
}
catch (Exception ex)
{
- Log.Error($"Building_ExtraGraphics: Error drawing rotating layer: {ex}");
+ WulaLog.Debug($"Building_ExtraGraphics: Error drawing rotating layer: {ex}");
}
}
@@ -347,7 +347,7 @@ namespace WulaFallenEmpire
if (DebugSettings.godMode && i == 0 && Find.TickManager.TicksGame % 60 == 0)
{
// 只在开发模式下,每60帧输出一次第一条图层的旋转信息
- Log.Message($"{layer.animationType} 图层 {i}: 角度={rotationAngle:F1}°, 时间={layerAnimationTimes[i]:F2}s, 速度={rotateSpeed}°/s");
+ WulaLog.Debug($"{layer.animationType} 图层 {i}: 角度={rotationAngle:F1}°, 时间={layerAnimationTimes[i]:F2}s, 速度={rotateSpeed}°/s");
}
break;
}
diff --git a/Source/WulaFallenEmpire/BuildingComp/Building_MapObserver.cs b/Source/WulaFallenEmpire/BuildingComp/Building_MapObserver.cs
index 63d3a62a..e75f0a0f 100644
--- a/Source/WulaFallenEmpire/BuildingComp/Building_MapObserver.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/Building_MapObserver.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using RimWorld;
using RimWorld.Planet;
using UnityEngine;
@@ -103,7 +103,7 @@ namespace WulaFallenEmpire
map.fogGrid.ClearAllFog();
// 记录日志以便调试
- Log.Message($"[MapObserver] 开始监测地图: {mapParent.Label} at tile {target.Tile}");
+ WulaLog.Debug($"[MapObserver] 开始监测地图: {mapParent.Label} at tile {target.Tile}");
}
}, "GeneratingMap", doAsynchronously: false, null);
@@ -128,12 +128,12 @@ namespace WulaFallenEmpire
if (observedMap is Settlement settlement)
{
settlement.Name = $"监测点-{thingIDNumber}";
- Log.Message($"[MapObserver] 创建新监测点: {settlement.Name} at tile {target.Tile}");
+ WulaLog.Debug($"[MapObserver] 创建新监测点: {settlement.Name} at tile {target.Tile}");
}
else
{
// 如果observedMap不是Settlement,使用Label属性
- Log.Message($"[MapObserver] 创建新监测点: {observedMap.Label} at tile {target.Tile}");
+ WulaLog.Debug($"[MapObserver] 创建新监测点: {observedMap.Label} at tile {target.Tile}");
}
}, "GeneratingMap", doAsynchronously: false, null);
@@ -165,7 +165,7 @@ namespace WulaFallenEmpire
{
Find.World.worldObjects.Remove(observedMap);
}
- Log.Message($"[MapObserver] 清理空置监测地图: {observedMap.Label}");
+ WulaLog.Debug($"[MapObserver] 清理空置监测地图: {observedMap.Label}");
}
}
@@ -176,14 +176,14 @@ namespace WulaFallenEmpire
// 断电或被关闭时停止监测
if (observedMap != null && (signal == "PowerTurnedOff" || signal == "FlickedOff"))
{
- Log.Message($"[MapObserver] 电力中断,停止监测: {observedMap.Label}");
+ WulaLog.Debug($"[MapObserver] 电力中断,停止监测: {observedMap.Label}");
StopObserving();
}
// 恢复电力时重新注册
else if (observedMap != null && (signal == "PowerTurnedOn" || signal == "FlickedOn"))
{
activeObservers.Add(this);
- Log.Message($"[MapObserver] 电力恢复,继续监测: {observedMap.Label}");
+ WulaLog.Debug($"[MapObserver] 电力恢复,继续监测: {observedMap.Label}");
}
}
diff --git a/Source/WulaFallenEmpire/BuildingComp/Building_TurretGunHasSpeed.cs b/Source/WulaFallenEmpire/BuildingComp/Building_TurretGunHasSpeed.cs
index 355306a7..d7243fb0 100644
--- a/Source/WulaFallenEmpire/BuildingComp/Building_TurretGunHasSpeed.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/Building_TurretGunHasSpeed.cs
@@ -324,7 +324,7 @@ namespace WulaFallenEmpire
// 检查是否有攻击动词
if (currentEffectiveVerb == null)
{
- Log.Error("BestShootTargetFromCurrentPosition with " + searcher.ToStringSafe() + " who has no attack verb.");
+ WulaLog.Debug("BestShootTargetFromCurrentPosition with " + searcher.ToStringSafe() + " who has no attack verb.");
return null;
}
@@ -376,7 +376,7 @@ namespace WulaFallenEmpire
// 验证攻击动词是否存在
if (verb == null)
{
- Log.Error("BestAttackTarget with " + searcher.ToStringSafe() + " who has no attack verb.");
+ WulaLog.Debug("BestAttackTarget with " + searcher.ToStringSafe() + " who has no attack verb.");
return null;
}
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_BuildingBombardment/CompBuildingBombardment.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_BuildingBombardment/CompBuildingBombardment.cs
index 2717eba6..3028c63d 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_BuildingBombardment/CompBuildingBombardment.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_BuildingBombardment/CompBuildingBombardment.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using Verse;
using UnityEngine;
using System.Collections.Generic;
@@ -41,14 +41,14 @@ namespace WulaFallenEmpire
{
currentState = BuildingBombardmentState.Bursting;
nextInnerBurstTick = Find.TickManager.TicksGame;
- Log.Message($"[BuildingBombardment] Starting burst with {currentTargets.Count} targets");
+ WulaLog.Debug($"[BuildingBombardment] Starting burst with {currentTargets.Count} targets");
}
else
{
// 没有找到目标,等待下一轮
currentState = BuildingBombardmentState.Idle;
nextBurstTick = Find.TickManager.TicksGame + Props.burstIntervalTicks;
- Log.Message($"[BuildingBombardment] No targets found, waiting for next burst");
+ WulaLog.Debug($"[BuildingBombardment] No targets found, waiting for next burst");
}
}
@@ -110,7 +110,7 @@ namespace WulaFallenEmpire
// 当前组发射完毕
currentState = BuildingBombardmentState.Idle;
nextBurstTick = Find.TickManager.TicksGame + Props.burstIntervalTicks;
- Log.Message($"[BuildingBombardment] Burst completed, waiting for next burst");
+ WulaLog.Debug($"[BuildingBombardment] Burst completed, waiting for next burst");
return;
}
@@ -125,7 +125,7 @@ namespace WulaFallenEmpire
nextInnerBurstTick = Find.TickManager.TicksGame + Props.innerBurstIntervalTicks;
}
- Log.Message($"[BuildingBombardment] Launched bombardment {currentBurstCount}/{currentTargets.Count}");
+ WulaLog.Debug($"[BuildingBombardment] Launched bombardment {currentBurstCount}/{currentTargets.Count}");
}
private void LaunchBombardment(LocalTargetInfo target)
@@ -149,7 +149,7 @@ namespace WulaFallenEmpire
}
catch (System.Exception ex)
{
- Log.Error($"[BuildingBombardment] Error launching bombardment: {ex}");
+ WulaLog.Debug($"[BuildingBombardment] Error launching bombardment: {ex}");
}
}
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_BuildingSpawner/CompBuildingSpawner.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_BuildingSpawner/CompBuildingSpawner.cs
index 8f4054e7..985d3278 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_BuildingSpawner/CompBuildingSpawner.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_BuildingSpawner/CompBuildingSpawner.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Linq;
using System.Text;
using RimWorld;
@@ -114,7 +114,7 @@ namespace WulaFallenEmpire
var facilitiesComp = flyOver.GetComp();
if (facilitiesComp == null)
{
- Log.Warning($"[BuildingSpawner] FlyOver at {flyOver.Position} has no CompFlyOverFacilities");
+ WulaLog.Debug($"[BuildingSpawner] FlyOver at {flyOver.Position} has no CompFlyOverFacilities");
continue;
}
@@ -129,7 +129,7 @@ namespace WulaFallenEmpire
}
catch (System.Exception ex)
{
- Log.Error($"[BuildingSpawner] Exception while checking for FlyOver: {ex}");
+ WulaLog.Debug($"[BuildingSpawner] Exception while checking for FlyOver: {ex}");
return false;
}
}
@@ -223,7 +223,7 @@ namespace WulaFallenEmpire
{
if (Props.buildingToSpawn == null)
{
- Log.Error("[BuildingSpawner] Building def is null!");
+ WulaLog.Debug("[BuildingSpawner] Building def is null!");
ResetCall();
return;
}
@@ -237,7 +237,7 @@ namespace WulaFallenEmpire
// 检查位置是否可用
if (!CanSpawnAtPosition(spawnPos))
{
- Log.Error($"[BuildingSpawner] Cannot spawn building at {spawnPos}");
+ WulaLog.Debug($"[BuildingSpawner] Cannot spawn building at {spawnPos}");
ResetCall();
return;
}
@@ -250,7 +250,7 @@ namespace WulaFallenEmpire
if (newBuilding == null)
{
- Log.Error("[BuildingSpawner] Failed to create building!");
+ WulaLog.Debug("[BuildingSpawner] Failed to create building!");
ResetCall();
return;
}
@@ -273,7 +273,7 @@ namespace WulaFallenEmpire
}
catch (System.Exception ex)
{
- Log.Error($"[BuildingSpawner] Error in ExecuteAutoBuildingSpawn: {ex}");
+ WulaLog.Debug($"[BuildingSpawner] Error in ExecuteAutoBuildingSpawn: {ex}");
ResetCall();
}
}
@@ -348,7 +348,7 @@ namespace WulaFallenEmpire
{
if (Props.buildingToSpawn == null)
{
- Log.Error("[BuildingSpawner] Building def is null!");
+ WulaLog.Debug("[BuildingSpawner] Building def is null!");
return;
}
@@ -371,7 +371,7 @@ namespace WulaFallenEmpire
// 检查位置是否可用
if (!CanSpawnAtPosition(spawnPos))
{
- Log.Error($"[BuildingSpawner] Cannot spawn building at {spawnPos}");
+ WulaLog.Debug($"[BuildingSpawner] Cannot spawn building at {spawnPos}");
ResetCall();
return;
}
@@ -384,7 +384,7 @@ namespace WulaFallenEmpire
if (newBuilding == null)
{
- Log.Error("[BuildingSpawner] Failed to create building!");
+ WulaLog.Debug("[BuildingSpawner] Failed to create building!");
return;
}
@@ -409,14 +409,14 @@ namespace WulaFallenEmpire
{
if (parent?.Map == null)
{
- Log.Warning($"[BuildingSpawner] Parent map is null for {parent?.LabelShort}");
+ WulaLog.Debug($"[BuildingSpawner] Parent map is null for {parent?.LabelShort}");
return false;
}
// 检查是否在地图范围内
if (!spawnPos.InBounds(parent.Map))
{
- Log.Warning($"[BuildingSpawner] Spawn position {spawnPos} is out of bounds for {parent?.LabelShort}");
+ WulaLog.Debug($"[BuildingSpawner] Spawn position {spawnPos} is out of bounds for {parent?.LabelShort}");
return false;
}
@@ -424,7 +424,7 @@ namespace WulaFallenEmpire
ThingDef buildingDef = Props.buildingToSpawn;
if (buildingDef == null)
{
- Log.Error($"[BuildingSpawner] buildingToSpawn is null for {parent?.LabelShort}");
+ WulaLog.Debug($"[BuildingSpawner] buildingToSpawn is null for {parent?.LabelShort}");
return false;
}
@@ -437,7 +437,7 @@ namespace WulaFallenEmpire
// 检查建筑是否完全在地图范围内
if (!rect.InBounds(parent.Map))
{
- Log.Warning($"[BuildingSpawner] Building rect {rect} for {buildingDef.defName} is out of bounds. Size: {buildingSize}, Position: {spawnPos}");
+ WulaLog.Debug($"[BuildingSpawner] Building rect {rect} for {buildingDef.defName} is out of bounds. Size: {buildingSize}, Position: {spawnPos}");
return false;
}
@@ -451,7 +451,7 @@ namespace WulaFallenEmpire
if (rect.minX < safeMargin || rect.minZ < safeMargin ||
rect.maxX >= pocketMap.Size.x - safeMargin || rect.maxZ >= pocketMap.Size.z - safeMargin)
{
- Log.Warning($"[BuildingSpawner] Building {buildingDef.defName} too close to pocket map edge. Rect: {rect}, Map Size: {pocketMap.Size}");
+ WulaLog.Debug($"[BuildingSpawner] Building {buildingDef.defName} too close to pocket map edge. Rect: {rect}, Map Size: {pocketMap.Size}");
return false;
}
}
@@ -461,7 +461,7 @@ namespace WulaFallenEmpire
{
if (!cell.InBounds(parent.Map))
{
- Log.Warning($"[BuildingSpawner] Cell {cell} is out of bounds for building {buildingDef.defName}");
+ WulaLog.Debug($"[BuildingSpawner] Cell {cell} is out of bounds for building {buildingDef.defName}");
return false;
}
@@ -476,7 +476,7 @@ namespace WulaFallenEmpire
// 跳过自己
if (thing != parent)
{
- Log.Warning($"[BuildingSpawner] Cell {cell} is blocked by {thing.def.defName} ({thing.LabelShort})");
+ WulaLog.Debug($"[BuildingSpawner] Cell {cell} is blocked by {thing.def.defName} ({thing.LabelShort})");
return false;
}
}
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_BuildingSpawner/CompProperties_BuildingSpawner.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_BuildingSpawner/CompProperties_BuildingSpawner.cs
index 0890f91a..2f5ddd01 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_BuildingSpawner/CompProperties_BuildingSpawner.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_BuildingSpawner/CompProperties_BuildingSpawner.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using System.Collections.Generic;
using Verse;
@@ -66,7 +66,7 @@ namespace WulaFallenEmpire
// 验证buildingToSpawn
if (buildingToSpawn != null && buildingToSpawn.category != ThingCategory.Building)
{
- Log.Error($"CompProperties_BuildingSpawner: buildingToSpawn must be a building, but got {buildingToSpawn.defName}");
+ WulaLog.Debug($"CompProperties_BuildingSpawner: buildingToSpawn must be a building, but got {buildingToSpawn.defName}");
buildingToSpawn = null;
}
}
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_EnergyLanceTurret/CompEnergyLanceTurret.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_EnergyLanceTurret/CompEnergyLanceTurret.cs
index 695f6bd9..5da4f84e 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_EnergyLanceTurret/CompEnergyLanceTurret.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_EnergyLanceTurret/CompEnergyLanceTurret.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using Verse;
using UnityEngine;
using System.Collections.Generic;
@@ -54,7 +54,7 @@ namespace WulaFallenEmpire
ResetState();
}
- Log.Message($"[EnergyLanceTurret] 炮塔生成在 {parent.Position}, 检测范围: {Props.detectionRange}");
+ WulaLog.Debug($"[EnergyLanceTurret] 炮塔生成在 {parent.Position}, 检测范围: {Props.detectionRange}");
}
// 在 StartEnergyLance 方法中修复光束创建逻辑
@@ -63,7 +63,7 @@ namespace WulaFallenEmpire
// 双重检查目标有效性
if (currentTarget == null || !IsTargetValid(currentTarget))
{
- Log.Warning($"[EnergyLanceTurret] 尝试启动能量光束但目标无效: {(currentTarget == null ? "目标为null" : "目标无效")}");
+ WulaLog.Debug($"[EnergyLanceTurret] 尝试启动能量光束但目标无效: {(currentTarget == null ? "目标为null" : "目标无效")}");
// 尝试重新寻找目标
var potentialTargets = FindPotentialTargets();
@@ -72,11 +72,11 @@ namespace WulaFallenEmpire
currentTarget = potentialTargets
.OrderBy(t => t.Position.DistanceTo(parent.Position))
.First();
- Log.Message($"[EnergyLanceTurret] 重新获取目标: {currentTarget.LabelCap}");
+ WulaLog.Debug($"[EnergyLanceTurret] 重新获取目标: {currentTarget.LabelCap}");
}
else
{
- Log.Message("[EnergyLanceTurret] 无法重新获取目标,进入冷却");
+ WulaLog.Debug("[EnergyLanceTurret] 无法重新获取目标,进入冷却");
StartCooldown();
return;
}
@@ -88,12 +88,12 @@ namespace WulaFallenEmpire
var lanceDef = Props.energyLanceDef ?? ThingDef.Named("EnergyLance");
if (lanceDef == null)
{
- Log.Error("[EnergyLanceTurret] 能量光束定义为空!");
+ WulaLog.Debug("[EnergyLanceTurret] 能量光束定义为空!");
StartCooldown();
return;
}
- Log.Message($"[EnergyLanceTurret] 创建能量光束: {lanceDef.defName} 目标: {currentTarget.LabelCap} 在 {currentTarget.Position}");
+ WulaLog.Debug($"[EnergyLanceTurret] 创建能量光束: {lanceDef.defName} 目标: {currentTarget.LabelCap} 在 {currentTarget.Position}");
// 关键修复:光束直接在目标位置生成,而不是建筑位置
activeLance = EnergyLance.MakeEnergyLance(
@@ -109,7 +109,7 @@ namespace WulaFallenEmpire
if (activeLance == null)
{
- Log.Error("[EnergyLanceTurret] 能量光束创建失败!");
+ WulaLog.Debug("[EnergyLanceTurret] 能量光束创建失败!");
StartCooldown();
return;
}
@@ -131,11 +131,11 @@ namespace WulaFallenEmpire
// 立即更新光束位置,确保光束在正确位置开始
UpdateEnergyLancePosition();
- Log.Message($"[EnergyLanceTurret] 能量光束启动成功,追踪目标: {currentTarget.LabelCap}");
+ WulaLog.Debug($"[EnergyLanceTurret] 能量光束启动成功,追踪目标: {currentTarget.LabelCap}");
}
catch (System.Exception ex)
{
- Log.Error($"[EnergyLanceTurret] 启动能量光束错误: {ex}");
+ WulaLog.Debug($"[EnergyLanceTurret] 启动能量光束错误: {ex}");
StartCooldown();
}
}
@@ -154,7 +154,7 @@ namespace WulaFallenEmpire
// 添加更多调试信息
if (debugTickCounter % 30 == 0) // 每0.5秒输出一次位置信息
{
- Log.Message($"[EnergyLanceTurret] 更新光束位置: 目标在 {currentTarget.Position}, 光束在 {activeLance.Position}");
+ WulaLog.Debug($"[EnergyLanceTurret] 更新光束位置: 目标在 {currentTarget.Position}, 光束在 {activeLance.Position}");
}
}
else if (lastTargetPosition.IsValid && Find.TickManager.TicksGame - lastPositionUpdateTick <= Props.targetUpdateInterval * 2)
@@ -209,12 +209,12 @@ namespace WulaFallenEmpire
if (debugTickCounter % 30 == 0) // 每0.5秒输出一次冷却信息
{
- Log.Message($"[EnergyLanceTurret] 冷却中: {cooldownTicksRemaining} ticks 剩余");
+ WulaLog.Debug($"[EnergyLanceTurret] 冷却中: {cooldownTicksRemaining} ticks 剩余");
}
if (cooldownTicksRemaining <= 0)
{
- Log.Message("[EnergyLanceTurret] 冷却完成,返回待机状态");
+ WulaLog.Debug("[EnergyLanceTurret] 冷却完成,返回待机状态");
currentState = TurretState.Idle;
isActive = false;
}
@@ -226,7 +226,7 @@ namespace WulaFallenEmpire
// 在预热过程中持续检查目标有效性
if (currentTarget == null || !IsTargetValid(currentTarget))
{
- Log.Message($"[EnergyLanceTurret] 预热过程中目标失效,取消预热");
+ WulaLog.Debug($"[EnergyLanceTurret] 预热过程中目标失效,取消预热");
ResetState();
return;
}
@@ -235,12 +235,12 @@ namespace WulaFallenEmpire
if (debugTickCounter % 10 == 0) // 每0.17秒输出一次预热信息
{
- Log.Message($"[EnergyLanceTurret] 预热中: {warmupTicksRemaining} ticks 剩余, 目标: {currentTarget?.LabelCap ?? "无"}");
+ WulaLog.Debug($"[EnergyLanceTurret] 预热中: {warmupTicksRemaining} ticks 剩余, 目标: {currentTarget?.LabelCap ?? "无"}");
}
if (warmupTicksRemaining <= 0)
{
- Log.Message("[EnergyLanceTurret] 预热完成,开始发射光束");
+ WulaLog.Debug("[EnergyLanceTurret] 预热完成,开始发射光束");
StartEnergyLance();
}
}
@@ -280,23 +280,23 @@ namespace WulaFallenEmpire
private void OutputDebugInfo()
{
var targets = FindPotentialTargets();
- Log.Message($"[EnergyLanceTurret] 调试信息:");
- Log.Message($" - 状态: {currentState}");
- Log.Message($" - 当前目标: {currentTarget?.LabelCap ?? "无"}");
- Log.Message($" - 目标位置: {currentTarget?.Position.ToString() ?? "无"}");
- Log.Message($" - 活跃光束: {(activeLance != null && !activeLance.Destroyed ? "是" : "否")}");
- Log.Message($" - 检测到目标数: {targets.Count}");
- Log.Message($" - 冷却剩余: {cooldownTicksRemaining}");
- Log.Message($" - 预热剩余: {warmupTicksRemaining}");
- Log.Message($" - 是否活跃: {isActive}");
- Log.Message($" - 目标丢失保护: {(targetLostTick >= 0 ? (Find.TickManager.TicksGame - targetLostTick) + " ticks前" : "无")}");
- Log.Message($" - 光束保护期: {(lanceCreationTick >= 0 ? (Find.TickManager.TicksGame - lanceCreationTick) + " ticks前创建" : "无")}");
+ WulaLog.Debug($"[EnergyLanceTurret] 调试信息:");
+ WulaLog.Debug($" - 状态: {currentState}");
+ WulaLog.Debug($" - 当前目标: {currentTarget?.LabelCap ?? "无"}");
+ WulaLog.Debug($" - 目标位置: {currentTarget?.Position.ToString() ?? "无"}");
+ WulaLog.Debug($" - 活跃光束: {(activeLance != null && !activeLance.Destroyed ? "是" : "否")}");
+ WulaLog.Debug($" - 检测到目标数: {targets.Count}");
+ WulaLog.Debug($" - 冷却剩余: {cooldownTicksRemaining}");
+ WulaLog.Debug($" - 预热剩余: {warmupTicksRemaining}");
+ WulaLog.Debug($" - 是否活跃: {isActive}");
+ WulaLog.Debug($" - 目标丢失保护: {(targetLostTick >= 0 ? (Find.TickManager.TicksGame - targetLostTick) + " ticks前" : "无")}");
+ WulaLog.Debug($" - 光束保护期: {(lanceCreationTick >= 0 ? (Find.TickManager.TicksGame - lanceCreationTick) + " ticks前创建" : "无")}");
// 输出前3个检测到的目标
for (int i = 0; i < Mathf.Min(3, targets.Count); i++)
{
var target = targets[i];
- Log.Message($" - 目标{i+1}: {target.LabelCap} 在 {target.Position}, 距离: {target.Position.DistanceTo(parent.Position):F1}");
+ WulaLog.Debug($" - 目标{i+1}: {target.LabelCap} 在 {target.Position}, 距离: {target.Position.DistanceTo(parent.Position):F1}");
}
}
@@ -317,7 +317,7 @@ namespace WulaFallenEmpire
// 更新目标
private void UpdateTarget()
{
- Log.Message($"[EnergyLanceTurret] 更新目标检查 - 状态: {currentState}, 活跃光束: {(activeLance != null && !activeLance.Destroyed ? "是" : "否")}");
+ WulaLog.Debug($"[EnergyLanceTurret] 更新目标检查 - 状态: {currentState}, 活跃光束: {(activeLance != null && !activeLance.Destroyed ? "是" : "否")}");
// 如果没有光束,寻找新目标
if (activeLance == null || activeLance.Destroyed)
@@ -333,7 +333,7 @@ namespace WulaFallenEmpire
lastTargetPosition = currentTarget.Position;
lastPositionUpdateTick = Find.TickManager.TicksGame;
targetLostTick = -1; // 重置目标丢失计时
- Log.Message($"[EnergyLanceTurret] 目标仍然有效: {currentTarget.LabelCap}");
+ WulaLog.Debug($"[EnergyLanceTurret] 目标仍然有效: {currentTarget.LabelCap}");
return;
}
@@ -344,11 +344,11 @@ namespace WulaFallenEmpire
// 寻找新目标(首次)
private void FindNewTarget()
{
- Log.Message("[EnergyLanceTurret] 寻找新目标...");
+ WulaLog.Debug("[EnergyLanceTurret] 寻找新目标...");
if (currentState != TurretState.Idle)
{
- Log.Message($"[EnergyLanceTurret] 无法寻找目标 - 当前状态: {currentState}");
+ WulaLog.Debug($"[EnergyLanceTurret] 无法寻找目标 - 当前状态: {currentState}");
return;
}
@@ -361,14 +361,14 @@ namespace WulaFallenEmpire
.OrderBy(t => t.Position.DistanceTo(parent.Position))
.First();
- Log.Message($"[EnergyLanceTurret] 发现新目标: {currentTarget.LabelCap} 在 {currentTarget.Position}");
+ WulaLog.Debug($"[EnergyLanceTurret] 发现新目标: {currentTarget.LabelCap} 在 {currentTarget.Position}");
// 开始预热
StartWarmup();
}
else
{
- Log.Message("[EnergyLanceTurret] 没有发现有效目标");
+ WulaLog.Debug("[EnergyLanceTurret] 没有发现有效目标");
}
}
@@ -378,7 +378,7 @@ namespace WulaFallenEmpire
if (activeLance == null || activeLance.Destroyed)
return;
- Log.Message("[EnergyLanceTurret] 为现有光束寻找新目标...");
+ WulaLog.Debug("[EnergyLanceTurret] 为现有光束寻找新目标...");
var potentialTargets = FindPotentialTargets();
@@ -393,7 +393,7 @@ namespace WulaFallenEmpire
lastPositionUpdateTick = Find.TickManager.TicksGame;
targetLostTick = -1; // 重置目标丢失计时
- Log.Message($"[EnergyLanceTurret] 切换到新目标: {currentTarget.LabelCap} 在 {currentTarget.Position}");
+ WulaLog.Debug($"[EnergyLanceTurret] 切换到新目标: {currentTarget.LabelCap} 在 {currentTarget.Position}");
}
else
{
@@ -401,12 +401,12 @@ namespace WulaFallenEmpire
if (targetLostTick < 0)
{
targetLostTick = Find.TickManager.TicksGame;
- Log.Message($"[EnergyLanceTurret] 目标丢失,开始保护期: {TARGET_LOST_GRACE_PERIOD} ticks");
+ WulaLog.Debug($"[EnergyLanceTurret] 目标丢失,开始保护期: {TARGET_LOST_GRACE_PERIOD} ticks");
}
currentTarget = null;
lastTargetPosition = IntVec3.Invalid;
- Log.Message("[EnergyLanceTurret] 没有有效目标,发送空位置");
+ WulaLog.Debug("[EnergyLanceTurret] 没有有效目标,发送空位置");
}
}
@@ -498,7 +498,7 @@ namespace WulaFallenEmpire
{
if (currentTarget == null)
{
- Log.Warning("[EnergyLanceTurret] 尝试开始预热但没有目标");
+ WulaLog.Debug("[EnergyLanceTurret] 尝试开始预热但没有目标");
return;
}
@@ -506,7 +506,7 @@ namespace WulaFallenEmpire
isActive = true;
currentState = TurretState.WarmingUp;
- Log.Message($"[EnergyLanceTurret] 开始预热: {warmupTicksRemaining} ticks, 目标: {currentTarget.LabelCap}");
+ WulaLog.Debug($"[EnergyLanceTurret] 开始预热: {warmupTicksRemaining} ticks, 目标: {currentTarget.LabelCap}");
}
// 更新光束目标位置
@@ -519,7 +519,7 @@ namespace WulaFallenEmpire
if (activeLance is EnergyLance energyLance)
{
energyLance.UpdateTargetPosition(targetPos);
- Log.Message($"[EnergyLanceTurret] 更新光束目标: {targetPos}");
+ WulaLog.Debug($"[EnergyLanceTurret] 更新光束目标: {targetPos}");
}
else
{
@@ -528,11 +528,11 @@ namespace WulaFallenEmpire
if (moveMethod != null)
{
moveMethod.Invoke(activeLance, new object[] { targetPos });
- Log.Message($"[EnergyLanceTurret] 通过反射更新光束目标: {targetPos}");
+ WulaLog.Debug($"[EnergyLanceTurret] 通过反射更新光束目标: {targetPos}");
}
else
{
- Log.Warning("[EnergyLanceTurret] 无法更新光束目标位置");
+ WulaLog.Debug("[EnergyLanceTurret] 无法更新光束目标位置");
}
}
}
@@ -543,7 +543,7 @@ namespace WulaFallenEmpire
if (activeLance == null || activeLance.Destroyed)
{
// 光束已销毁,进入冷却
- Log.Message("[EnergyLanceTurret] 光束已销毁,开始冷却");
+ WulaLog.Debug("[EnergyLanceTurret] 光束已销毁,开始冷却");
StartCooldown();
return;
}
@@ -558,7 +558,7 @@ namespace WulaFallenEmpire
// 检查目标丢失保护期
if (targetLostTick >= 0 && Find.TickManager.TicksGame - targetLostTick > TARGET_LOST_GRACE_PERIOD)
{
- Log.Message("[EnergyLanceTurret] 目标丢失保护期结束,销毁光束");
+ WulaLog.Debug("[EnergyLanceTurret] 目标丢失保护期结束,销毁光束");
activeLance.Destroy();
StartCooldown();
return;
@@ -567,7 +567,7 @@ namespace WulaFallenEmpire
// 检查光束是否长时间没有收到位置更新
if (Find.TickManager.TicksGame - lastPositionUpdateTick > Props.targetUpdateInterval * 3)
{
- Log.Message("[EnergyLanceTurret] 光束长时间未收到位置更新,销毁");
+ WulaLog.Debug("[EnergyLanceTurret] 光束长时间未收到位置更新,销毁");
activeLance.Destroy();
StartCooldown();
}
@@ -584,7 +584,7 @@ namespace WulaFallenEmpire
targetLostTick = -1;
currentState = TurretState.CoolingDown;
- Log.Message($"[EnergyLanceTurret] 开始冷却: {cooldownTicksRemaining} ticks");
+ WulaLog.Debug($"[EnergyLanceTurret] 开始冷却: {cooldownTicksRemaining} ticks");
}
// 绘制检测范围
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_InitialFaction/CompProperties_InitialFaction.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_InitialFaction/CompProperties_InitialFaction.cs
index 84a62023..18c72efc 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_InitialFaction/CompProperties_InitialFaction.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_InitialFaction/CompProperties_InitialFaction.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using Verse;
namespace WulaFallenEmpire
@@ -49,7 +49,7 @@ namespace WulaFallenEmpire
if (faction != null && faction != parent.Faction)
{
parent.SetFaction(faction);
- Log.Message($"Set faction for {parent.Label} to {faction.Name}");
+ WulaLog.Debug($"Set faction for {parent.Label} to {faction.Name}");
}
}
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_MechanoidRecycler/JobDriver_RecycleMechanoid.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_MechanoidRecycler/JobDriver_RecycleMechanoid.cs
index 9bc46b06..dadff0e4 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_MechanoidRecycler/JobDriver_RecycleMechanoid.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_MechanoidRecycler/JobDriver_RecycleMechanoid.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using Verse;
using Verse.AI;
using System.Collections.Generic;
@@ -45,14 +45,14 @@ namespace WulaFallenEmpire
if (Prefs.DevMode)
{
- Log.Message($"[CompAutonomousMech] {pawn.LabelCap} equipped new weapon: {newWeaponDef.LabelCap}");
+ WulaLog.Debug($"[CompAutonomousMech] {pawn.LabelCap} equipped new weapon: {newWeaponDef.LabelCap}");
}
}
}
}
catch (System.Exception ex)
{
- Log.Error($"[CompAutonomousMech] Error switching weapon for {pawn?.LabelCap}: {ex}");
+ WulaLog.Debug($"[CompAutonomousMech] Error switching weapon for {pawn?.LabelCap}: {ex}");
}
}
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_PhaseCombatTower/CompPhaseCombatTower.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_PhaseCombatTower/CompPhaseCombatTower.cs
index 2b4b72b7..05e3abfe 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_PhaseCombatTower/CompPhaseCombatTower.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_PhaseCombatTower/CompPhaseCombatTower.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using RimWorld;
using UnityEngine;
@@ -86,7 +86,7 @@ namespace WulaFallenEmpire
}
else
{
- Log.Error($"PhaseCombatTower: 找不到PawnKindDef '{pawnKindName}'");
+ WulaLog.Debug($"PhaseCombatTower: 找不到PawnKindDef '{pawnKindName}'");
}
}
}
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/ArmedShuttleIncoming.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/ArmedShuttleIncoming.cs
index f67faf19..6368d283 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/ArmedShuttleIncoming.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/ArmedShuttleIncoming.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using Verse;
using System.Linq;
using UnityEngine;
@@ -25,17 +25,17 @@ namespace WulaFallenEmpire
protected override void Impact()
{
// Re-adding debug logs for stage 6
- Log.Message($"[WULA] Stage 6: Impact - ArmedShuttleIncoming Impact() called. InnerThing (via innerContainer) is: {innerContainer.FirstOrDefault()?.ToString() ?? "NULL"}");
+ WulaLog.Debug($"[WULA] Stage 6: Impact - ArmedShuttleIncoming Impact() called. InnerThing (via innerContainer) is: {innerContainer.FirstOrDefault()?.ToString() ?? "NULL"}");
Thing innerThing = innerContainer.FirstOrDefault();
if (innerThing is Building_ArmedShuttle shuttle)
{
- Log.Message("[WULA] Stage 6: Impact - InnerThing is a Building_ArmedShuttle. Attempting to notify arrival.");
+ WulaLog.Debug("[WULA] Stage 6: Impact - InnerThing is a Building_ArmedShuttle. Attempting to notify arrival.");
shuttle.TryGetComp()?.Notify_Arrived();
}
else
{
- Log.Warning($"[WULA] Stage 6: Impact - InnerThing is NOT a Building_ArmedShuttle or is NULL. Type: {innerThing?.GetType().Name ?? "NULL"}. This is the cause of the issue.");
+ WulaLog.Debug($"[WULA] Stage 6: Impact - InnerThing is NOT a Building_ArmedShuttle or is NULL. Type: {innerThing?.GetType().Name ?? "NULL"}. This is the cause of the issue.");
}
// Calling base.Impact() will handle the actual spawning of the innerThing.
@@ -47,7 +47,7 @@ namespace WulaFallenEmpire
{
base.SpawnSetup(map, respawningAfterLoad);
// Re-adding debug logs for stage 5
- Log.Message($"[WULA] Stage 5: Landing Sequence - ArmedShuttleIncoming spawned. InnerThing (via innerContainer) is: {innerContainer.FirstOrDefault()?.ToString() ?? "NULL"}");
+ WulaLog.Debug($"[WULA] Stage 5: Landing Sequence - ArmedShuttleIncoming spawned. InnerThing (via innerContainer) is: {innerContainer.FirstOrDefault()?.ToString() ?? "NULL"}");
if (!respawningAfterLoad && !base.BeingTransportedOnGravship)
{
angle = GetAngle(0f, base.Rotation);
@@ -58,7 +58,7 @@ namespace WulaFallenEmpire
{
if (!hasImpacted)
{
- Log.Error("Destroying armed shuttle skyfaller without ever having impacted"); // Changed log message
+ WulaLog.Debug("Destroying armed shuttle skyfaller without ever having impacted"); // Changed log message
}
base.Destroy(mode);
}
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/Building_ArmedShuttle.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/Building_ArmedShuttle.cs
index 66e41fb4..ae0a93cb 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/Building_ArmedShuttle.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/Building_ArmedShuttle.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Linq;
using System.Text;
using RimWorld;
@@ -212,7 +212,7 @@ namespace WulaFallenEmpire
{
if (gun == null)
{
- Log.Error("Turret had null gun after loading. Recreating.");
+ WulaLog.Debug("Turret had null gun after loading. Recreating.");
MakeGun();
}
else
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/Building_ArmedShuttleWithPocket.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/Building_ArmedShuttleWithPocket.cs
index 99bead73..708f44a6 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/Building_ArmedShuttleWithPocket.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/Building_ArmedShuttleWithPocket.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -137,7 +137,7 @@ namespace WulaFallenEmpire
public Building_ArmedShuttleWithPocket()
{
- Log.Message("[WULA-DEBUG] Building_ArmedShuttleWithPocket constructor called");
+ WulaLog.Debug("[WULA-DEBUG] Building_ArmedShuttleWithPocket constructor called");
// 不再初始化innerContainer,只使用CompTransporter的容器
}
@@ -149,14 +149,14 @@ namespace WulaFallenEmpire
public override void PostMake()
{
- Log.Message("[WULA-DEBUG] PostMake called");
+ WulaLog.Debug("[WULA-DEBUG] PostMake called");
base.PostMake();
// 不再初始化innerContainer,只使用CompTransporter的容器
}
public override void ExposeData()
{
- Log.Message($"[WULA-DEBUG] ExposeData called, mode: {Scribe.mode}");
+ WulaLog.Debug($"[WULA-DEBUG] ExposeData called, mode: {Scribe.mode}");
base.ExposeData();
Scribe_References.Look(ref pocketMap, "pocketMap");
@@ -171,24 +171,24 @@ namespace WulaFallenEmpire
if (Scribe.mode == LoadSaveMode.PostLoadInit)
{
- Log.Message("[WULA-DEBUG] PostLoadInit: Validating components after load");
+ WulaLog.Debug("[WULA-DEBUG] PostLoadInit: Validating components after load");
// 验证CompTransporter组件是否正常
CompTransporter transporter = this.GetComp();
if (transporter == null)
{
- Log.Error("[WULA-ERROR] CompTransporter is missing after load! This will cause item storage issues.");
+ WulaLog.Debug("[WULA-ERROR] CompTransporter is missing after load! This will cause item storage issues.");
}
else
{
- Log.Message($"[WULA-DEBUG] CompTransporter loaded successfully with {transporter.innerContainer?.Count ?? 0} items");
+ WulaLog.Debug($"[WULA-DEBUG] CompTransporter loaded successfully with {transporter.innerContainer?.Count ?? 0} items");
}
}
}
public override void DeSpawn(DestroyMode mode = DestroyMode.Vanish)
{
- Log.Message($"[WULA-DEBUG] DeSpawn called with mode: {mode}");
+ WulaLog.Debug($"[WULA-DEBUG] DeSpawn called with mode: {mode}");
// 只在真正销毁时清理口袋地图,发射时保留
if (ShouldDestroyPocketMapOnDeSpawn(mode))
@@ -197,7 +197,7 @@ namespace WulaFallenEmpire
{
try
{
- Log.Message("[WULA-DEBUG] Destroying pocket map due to shuttle destruction");
+ WulaLog.Debug("[WULA-DEBUG] Destroying pocket map due to shuttle destruction");
// 将口袋空间中的物品和人员转移到主地图
TransferAllFromPocketToMainMap();
@@ -209,19 +209,19 @@ namespace WulaFallenEmpire
}
catch (Exception ex)
{
- Log.Error($"[WULA-ERROR] Error cleaning up pocket map: {ex}");
+ WulaLog.Debug($"[WULA-ERROR] Error cleaning up pocket map: {ex}");
}
}
}
else
{
- Log.Message("[WULA-DEBUG] Preserving pocket map during shuttle launch/transport");
+ WulaLog.Debug("[WULA-DEBUG] Preserving pocket map during shuttle launch/transport");
// 发射时暂停传送功能,但保留口袋空间
transportDisabled = true;
if (pocketMap != null && exit != null)
{
// 标记传送功能暂停
- Log.Message("[WULA-DEBUG] Transport functionality disabled during flight");
+ WulaLog.Debug("[WULA-DEBUG] Transport functionality disabled during flight");
}
}
@@ -249,7 +249,7 @@ namespace WulaFallenEmpire
case DestroyMode.FailConstruction: // 建造失败,删除口袋空间
return true;
default:
- Log.Warning($"[WULA-WARNING] Unknown DestroyMode: {mode}, defaulting to preserve pocket map");
+ WulaLog.Debug($"[WULA-WARNING] Unknown DestroyMode: {mode}, defaulting to preserve pocket map");
return false;
}
}
@@ -432,16 +432,16 @@ namespace WulaFallenEmpire
// 在口袋地图中心放置退出点
CreateExitPoint();
- Log.Message($"[WULA] Successfully created pocket map of size {pocketMapSize} for armed shuttle");
+ WulaLog.Debug($"[WULA] Successfully created pocket map of size {pocketMapSize} for armed shuttle");
}
else
{
- Log.Error("[WULA] Failed to create pocket map");
+ WulaLog.Debug("[WULA] Failed to create pocket map");
}
}
catch (Exception ex)
{
- Log.Error($"[WULA] Exception creating pocket map: {ex}");
+ WulaLog.Debug($"[WULA] Exception creating pocket map: {ex}");
}
}
@@ -490,16 +490,16 @@ namespace WulaFallenEmpire
}
GenPlace.TryPlaceThing(exitBuilding, exitPos, pocketMap, ThingPlaceMode.Direct);
- Log.Message($"[WULA] Created exit point at {exitPos} in pocket map");
+ WulaLog.Debug($"[WULA] Created exit point at {exitPos} in pocket map");
}
else
{
- Log.Warning("[WULA] Could not find valid position for exit point in pocket map");
+ WulaLog.Debug("[WULA] Could not find valid position for exit point in pocket map");
}
}
catch (Exception ex)
{
- Log.Error($"[WULA] Error creating exit point: {ex}");
+ WulaLog.Debug($"[WULA] Error creating exit point: {ex}");
}
}
@@ -525,7 +525,7 @@ namespace WulaFallenEmpire
}
catch (Exception ex)
{
- Log.Error($"[WULA] Error transferring pawn {pawn?.LabelShort} to pocket space: {ex}");
+ WulaLog.Debug($"[WULA] Error transferring pawn {pawn?.LabelShort} to pocket space: {ex}");
}
return false;
@@ -536,17 +536,17 @@ namespace WulaFallenEmpire
///
private void TransferAllFromPocketToMainMap()
{
- Log.Message("[WULA-DEBUG] TransferAllFromPocketToMainMap started");
+ WulaLog.Debug("[WULA-DEBUG] TransferAllFromPocketToMainMap started");
if (pocketMap == null)
{
- Log.Warning("[WULA-DEBUG] TransferAllFromPocketToMainMap: pocketMap is null, nothing to transfer");
+ WulaLog.Debug("[WULA-DEBUG] TransferAllFromPocketToMainMap: pocketMap is null, nothing to transfer");
return;
}
if (!Spawned)
{
- Log.Error("[WULA-ERROR] TransferAllFromPocketToMainMap: Shuttle not spawned, cannot transfer items");
+ WulaLog.Debug("[WULA-ERROR] TransferAllFromPocketToMainMap: Shuttle not spawned, cannot transfer items");
return;
}
@@ -556,28 +556,28 @@ namespace WulaFallenEmpire
CompTransporter transporter = this.GetComp();
if (transporter == null)
{
- Log.Error("[WULA-ERROR] CompTransporter not found on shuttle! Cannot transfer items.");
+ WulaLog.Debug("[WULA-ERROR] CompTransporter not found on shuttle! Cannot transfer items.");
return;
}
- Log.Message($"[WULA-DEBUG] Found CompTransporter with {transporter.innerContainer.Count} existing items");
+ WulaLog.Debug($"[WULA-DEBUG] Found CompTransporter with {transporter.innerContainer.Count} existing items");
// 转移所有殖民者
List pawnsToTransfer = pocketMap.mapPawns.AllPawnsSpawned.ToList();
- Log.Message($"[WULA-DEBUG] Found {pawnsToTransfer.Count} colonists to transfer");
+ WulaLog.Debug($"[WULA-DEBUG] Found {pawnsToTransfer.Count} colonists to transfer");
foreach (Pawn pawn in pawnsToTransfer)
{
if (pawn.Spawned)
{
- Log.Message($"[WULA-DEBUG] Transferring pawn: {pawn.LabelShort}");
+ WulaLog.Debug($"[WULA-DEBUG] Transferring pawn: {pawn.LabelShort}");
pawn.DeSpawn();
// 直接放入穿梭机的容器,如果失败就放到地面
if (!transporter.innerContainer.TryAdd(pawn))
{
- Log.Warning($"[WULA-WARNING] Container full, placing pawn {pawn.LabelShort} near shuttle");
+ WulaLog.Debug($"[WULA-WARNING] Container full, placing pawn {pawn.LabelShort} near shuttle");
// 如果容器满了,放到穿梭机附近
IntVec3 spawnPos = CellFinder.RandomClosewalkCellNear(this.Position, this.Map, 5,
p => p.Standable(this.Map) && !p.GetThingList(this.Map).Any(t => t is Pawn));
@@ -585,16 +585,16 @@ namespace WulaFallenEmpire
if (spawnPos.IsValid)
{
GenPlace.TryPlaceThing(pawn, spawnPos, this.Map, ThingPlaceMode.Near);
- Log.Message($"[WULA-DEBUG] Placed pawn {pawn.LabelShort} at {spawnPos}");
+ WulaLog.Debug($"[WULA-DEBUG] Placed pawn {pawn.LabelShort} at {spawnPos}");
}
else
{
- Log.Error($"[WULA-ERROR] Could not find valid position for pawn {pawn.LabelShort}");
+ WulaLog.Debug($"[WULA-ERROR] Could not find valid position for pawn {pawn.LabelShort}");
}
}
else
{
- Log.Message($"[WULA-DEBUG] Successfully added pawn {pawn.LabelShort} to container");
+ WulaLog.Debug($"[WULA-DEBUG] Successfully added pawn {pawn.LabelShort} to container");
}
}
}
@@ -603,46 +603,46 @@ namespace WulaFallenEmpire
List itemsToTransfer = pocketMap.listerThings.AllThings
.Where(t => t.def.category == ThingCategory.Item && t.def.EverHaulable).ToList();
- Log.Message($"[WULA-DEBUG] Found {itemsToTransfer.Count} items to transfer");
+ WulaLog.Debug($"[WULA-DEBUG] Found {itemsToTransfer.Count} items to transfer");
foreach (Thing item in itemsToTransfer)
{
if (item.Spawned)
{
- Log.Message($"[WULA-DEBUG] Transferring item: {item.LabelShort} (stack: {item.stackCount})");
+ WulaLog.Debug($"[WULA-DEBUG] Transferring item: {item.LabelShort} (stack: {item.stackCount})");
item.DeSpawn();
// 直接使用穿梭机的主容器
if (!transporter.innerContainer.TryAdd(item))
{
- Log.Warning($"[WULA-WARNING] Container full, dropping item {item.LabelShort} near shuttle");
+ WulaLog.Debug($"[WULA-WARNING] Container full, dropping item {item.LabelShort} near shuttle");
// 如果容器满了,丢到穿梭机附近(玩家可以手动重新装载)
IntVec3 dropPos = CellFinder.RandomClosewalkCellNear(this.Position, this.Map, 3);
if (dropPos.IsValid)
{
GenPlace.TryPlaceThing(item, dropPos, this.Map, ThingPlaceMode.Near);
Messages.Message($"容器已满:{item.LabelShort} 被放置在穿梭机附近", this, MessageTypeDefOf.CautionInput);
- Log.Message($"[WULA-DEBUG] Dropped item {item.LabelShort} at {dropPos}");
+ WulaLog.Debug($"[WULA-DEBUG] Dropped item {item.LabelShort} at {dropPos}");
}
else
{
- Log.Error($"[WULA-ERROR] Could not find valid drop position for item {item.LabelShort}");
+ WulaLog.Debug($"[WULA-ERROR] Could not find valid drop position for item {item.LabelShort}");
}
}
else
{
- Log.Message($"[WULA-DEBUG] Successfully added item {item.LabelShort} to container");
+ WulaLog.Debug($"[WULA-DEBUG] Successfully added item {item.LabelShort} to container");
}
}
}
- Log.Message($"[WULA-DEBUG] Transfer complete. Container now has {transporter.innerContainer.Count} total items");
- Log.Message($"[WULA-SUCCESS] Transferred {pawnsToTransfer.Count} pawns and {itemsToTransfer.Count} items from pocket space");
+ WulaLog.Debug($"[WULA-DEBUG] Transfer complete. Container now has {transporter.innerContainer.Count} total items");
+ WulaLog.Debug($"[WULA-SUCCESS] Transferred {pawnsToTransfer.Count} pawns and {itemsToTransfer.Count} items from pocket space");
}
catch (Exception ex)
{
- Log.Error($"[WULA-ERROR] Error transferring from pocket map: {ex}");
- Log.Error($"[WULA-ERROR] Stack trace: {ex.StackTrace}");
+ WulaLog.Debug($"[WULA-ERROR] Error transferring from pocket map: {ex}");
+ WulaLog.Debug($"[WULA-ERROR] Stack trace: {ex.StackTrace}");
}
}
@@ -927,19 +927,19 @@ namespace WulaFallenEmpire
pocketExit.targetMap = this.Map;
pocketExit.targetPos = this.Position;
pocketExit.parentShuttle = this;
- Log.Message($"[WULA] Updated pocket map exit target to shuttle location: {this.Map?.uniqueID} at {this.Position}");
+ WulaLog.Debug($"[WULA] Updated pocket map exit target to shuttle location: {this.Map?.uniqueID} at {this.Position}");
}
}
else
{
// 穿梭机不在地图上(可能在飞行中),记录警告但保持原有目标
- Log.Warning($"[WULA] Shuttle not spawned, pocket map exit target may be outdated. Current target: {pocketExit.targetMap?.uniqueID} at {pocketExit.targetPos}");
+ WulaLog.Debug($"[WULA] Shuttle not spawned, pocket map exit target may be outdated. Current target: {pocketExit.targetMap?.uniqueID} at {pocketExit.targetPos}");
}
}
}
catch (Exception ex)
{
- Log.Error($"[WULA] Error updating exit point target: {ex}");
+ WulaLog.Debug($"[WULA] Error updating exit point target: {ex}");
}
}
@@ -967,13 +967,13 @@ namespace WulaFallenEmpire
{
if (Prefs.DevMode)
{
- Log.Message($"[WULA] Auto-synced pocket items. Current status: {GetPocketSpaceDebugInfo()}");
+ WulaLog.Debug($"[WULA] Auto-synced pocket items. Current status: {GetPocketSpaceDebugInfo()}");
}
}
}
catch (Exception ex)
{
- Log.Error($"[WULA] Error during auto-sync: {ex}");
+ WulaLog.Debug($"[WULA] Error during auto-sync: {ex}");
}
}
}
@@ -983,7 +983,7 @@ namespace WulaFallenEmpire
///
public override void SpawnSetup(Map map, bool respawningAfterLoad)
{
- Log.Message($"[WULA-DEBUG] SpawnSetup called: map={map?.uniqueID}, respawning={respawningAfterLoad}");
+ WulaLog.Debug($"[WULA-DEBUG] SpawnSetup called: map={map?.uniqueID}, respawning={respawningAfterLoad}");
// 保存旧位置信息
Map oldMap = this.Map;
@@ -997,19 +997,19 @@ namespace WulaFallenEmpire
// 验证口袋地图的父级对象是否存在于世界列表中
if (pocketMap.Parent is PocketMapParent pocketParent && !Find.World.pocketMaps.Contains(pocketParent))
{
- Log.Warning($"[WULA] Pocket map parent for map ID {pocketMap.uniqueID} was not found in the world list. Re-adding it to prevent data loss.");
+ WulaLog.Debug($"[WULA] Pocket map parent for map ID {pocketMap.uniqueID} was not found in the world list. Re-adding it to prevent data loss.");
Find.World.pocketMaps.Add(pocketParent);
}
// 验证口袋地图本身是否存在于游戏地图列表中
if (!Find.Maps.Contains(pocketMap))
{
- Log.Warning($"[WULA] Pocket map ID {pocketMap.uniqueID} was not found in the game's map list. Re-registering it.");
+ WulaLog.Debug($"[WULA] Pocket map ID {pocketMap.uniqueID} was not found in the game's map list. Re-registering it.");
// 在重新添加前,进行安全检查,防止添加已损坏的地图
if (!Find.Maps.Contains(pocketMap) && (pocketMap.mapPawns == null || pocketMap.Tile < 0))
{
- Log.Error("[WULA] Cannot re-register a corrupted pocket map. The contents of the pocket space are likely lost. This is a critical error.");
+ WulaLog.Debug("[WULA] Cannot re-register a corrupted pocket map. The contents of the pocket space are likely lost. This is a critical error.");
Messages.Message("WULA.PocketSpace.MapInvalidAndRecovering".Translate(), this, MessageTypeDefOf.NegativeEvent);
pocketMap = null;
pocketMapGenerated = false;
@@ -1018,7 +1018,7 @@ namespace WulaFallenEmpire
{
// 重新注册地图,使其再次“激活”
Current.Game.AddMap(pocketMap);
- Log.Message($"[WULA] Pocket map {pocketMap.uniqueID} successfully re-registered.");
+ WulaLog.Debug($"[WULA] Pocket map {pocketMap.uniqueID} successfully re-registered.");
}
}
}
@@ -1030,23 +1030,23 @@ namespace WulaFallenEmpire
CompTransporter transporter = this.GetComp();
if (transporter == null)
{
- Log.Error("[WULA-ERROR] CompTransporter missing in SpawnSetup! This will cause serious issues.");
+ WulaLog.Debug("[WULA-ERROR] CompTransporter missing in SpawnSetup! This will cause serious issues.");
}
else
{
- Log.Message($"[WULA-DEBUG] CompTransporter found with {transporter.innerContainer?.Count ?? 0} items");
+ WulaLog.Debug($"[WULA-DEBUG] CompTransporter found with {transporter.innerContainer?.Count ?? 0} items");
}
// 如果是从飞行状态恢复,重新启用传送功能
if (transportDisabled)
{
- Log.Message("[WULA-DEBUG] Re-enabling transport functionality after landing");
+ WulaLog.Debug("[WULA-DEBUG] Re-enabling transport functionality after landing");
transportDisabled = false;
// 如果有口袋空间,确保退出点正确连接到新地图
if (pocketMapGenerated && pocketMap != null && exit != null)
{
- Log.Message($"[WULA-DEBUG] Reconnecting pocket space exit to new map: {map?.uniqueID} at {this.Position}");
+ WulaLog.Debug($"[WULA-DEBUG] Reconnecting pocket space exit to new map: {map?.uniqueID} at {this.Position}");
// 退出点会在 UpdateExitPointTarget 中自动更新
}
}
@@ -1055,25 +1055,25 @@ namespace WulaFallenEmpire
if (def.HasModExtension())
{
var portalProps = def.GetModExtension();
- Log.Message($"[WULA-DEBUG] Loading portal properties from ThingDef");
+ WulaLog.Debug($"[WULA-DEBUG] Loading portal properties from ThingDef");
if (portalProps.pocketMapGenerator != null)
{
mapGenerator = portalProps.pocketMapGenerator;
- Log.Message($"[WULA-DEBUG] Set mapGenerator: {mapGenerator.defName}");
+ WulaLog.Debug($"[WULA-DEBUG] Set mapGenerator: {mapGenerator.defName}");
}
if (portalProps.exitDef != null)
{
exitDef = portalProps.exitDef;
- Log.Message($"[WULA-DEBUG] Set exitDef: {exitDef.defName}");
+ WulaLog.Debug($"[WULA-DEBUG] Set exitDef: {exitDef.defName}");
}
if (portalProps.pocketMapSize != IntVec2.Zero)
{
pocketMapSize = portalProps.pocketMapSize;
- Log.Message($"[WULA-DEBUG] Set pocketMapSize: {pocketMapSize}");
+ WulaLog.Debug($"[WULA-DEBUG] Set pocketMapSize: {pocketMapSize}");
}
allowDirectAccess = portalProps.allowDirectAccess;
- Log.Message($"[WULA-DEBUG] Set allowDirectAccess: {allowDirectAccess}");
+ WulaLog.Debug($"[WULA-DEBUG] Set allowDirectAccess: {allowDirectAccess}");
}
// 初始化地图生成器和退出点定义(如果 XML 中没有配置)
@@ -1082,23 +1082,23 @@ namespace WulaFallenEmpire
mapGenerator = DefDatabase.GetNamed("AncientStockpile", false)
?? DefDatabase.GetNamed("Base_Player", false)
?? MapGeneratorDefOf.Base_Player;
- Log.Message($"[WULA-DEBUG] Using fallback mapGenerator: {mapGenerator.defName}");
+ WulaLog.Debug($"[WULA-DEBUG] Using fallback mapGenerator: {mapGenerator.defName}");
}
if (exitDef == null)
{
exitDef = DefDatabase.GetNamed("WULA_PocketMapExit", false)
?? ThingDefOf.Door;
- Log.Message($"[WULA-DEBUG] Using fallback exitDef: {exitDef.defName}");
+ WulaLog.Debug($"[WULA-DEBUG] Using fallback exitDef: {exitDef.defName}");
}
// 如果位置发生了变化,记录日志
if (oldMap != null && (oldMap != map || oldPos != this.Position))
{
- Log.Message($"[WULA-DEBUG] Shuttle moved from {oldMap?.uniqueID}:{oldPos} to {map?.uniqueID}:{this.Position}, updating pocket map exit target");
+ WulaLog.Debug($"[WULA-DEBUG] Shuttle moved from {oldMap?.uniqueID}:{oldPos} to {map?.uniqueID}:{this.Position}, updating pocket map exit target");
}
- Log.Message($"[WULA-DEBUG] SpawnSetup completed successfully");
+ WulaLog.Debug($"[WULA-DEBUG] SpawnSetup completed successfully");
}
#endregion
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/Building_PocketMapExit.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/Building_PocketMapExit.cs
index 3ca890fe..50c577d9 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/Building_PocketMapExit.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/Building_PocketMapExit.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using Verse;
using System.Collections.Generic;
using System.Linq;
@@ -61,7 +61,7 @@ namespace WulaFallenEmpire
{
targetMap = parentShuttle.Map;
targetPos = parentShuttle.Position;
- Log.Message($"[WULA] Updated exit target to shuttle location: {targetMap?.uniqueID} at {targetPos}");
+ WulaLog.Debug($"[WULA] Updated exit target to shuttle location: {targetMap?.uniqueID} at {targetPos}");
}
}
else if (parentShuttle != null && !parentShuttle.Spawned)
@@ -70,7 +70,7 @@ namespace WulaFallenEmpire
// 保持原有目标,但记录警告
if (this.IsHashIntervalTick(2500)) // 每隔一段时间检查一次
{
- Log.Warning($"[WULA] Parent shuttle is not spawned, exit target may be outdated. Last known: {targetMap?.uniqueID} at {targetPos}");
+ WulaLog.Debug($"[WULA] Parent shuttle is not spawned, exit target may be outdated. Last known: {targetMap?.uniqueID} at {targetPos}");
}
}
}
@@ -160,7 +160,7 @@ namespace WulaFallenEmpire
}
catch (System.Exception ex)
{
- Log.Error($"[WULA] Error exiting pocket space: {ex}");
+ WulaLog.Debug($"[WULA] Error exiting pocket space: {ex}");
}
}
}
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/Dialog_ArmedShuttleTransfer.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/Dialog_ArmedShuttleTransfer.cs
index 8041f4d9..352ebb82 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/Dialog_ArmedShuttleTransfer.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/Dialog_ArmedShuttleTransfer.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using RimWorld;
@@ -146,7 +146,7 @@ namespace WulaFallenEmpire
}
else
{
- Log.Error($"[WULA-ERROR] Could not find valid drop position for item {item.LabelShort} in pocket map.");
+ WulaLog.Debug($"[WULA-ERROR] Could not find valid drop position for item {item.LabelShort} in pocket map.");
item.Destroy(); // 实在没地方放,就销毁
}
}
@@ -212,7 +212,7 @@ namespace WulaFallenEmpire
}
if (transferableOneWay.things.Contains(t))
{
- Log.Error("Tried to add the same thing twice to TransferableOneWay: " + t);
+ WulaLog.Debug("Tried to add the same thing twice to TransferableOneWay: " + t);
}
else
{
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/GenStep_WulaPocketSpaceSmall.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/GenStep_WulaPocketSpaceSmall.cs
index fe569049..782654b2 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/GenStep_WulaPocketSpaceSmall.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/GenStep_WulaPocketSpaceSmall.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using RimWorld;
@@ -21,7 +21,7 @@ namespace WulaFallenEmpire
{
try
{
- Log.Message($"[WULA] Generating WULA pocket space, map size: {map.Size}");
+ WulaLog.Debug($"[WULA] Generating WULA pocket space, map size: {map.Size}");
// 获取地图边界
IntVec3 mapSize = map.Size;
@@ -32,7 +32,7 @@ namespace WulaFallenEmpire
// 生成内部地板
GenerateFloor(map);
- Log.Message("[WULA] WULA pocket space generation completed");
+ WulaLog.Debug("[WULA] WULA pocket space generation completed");
// 添加预制件生成
// 如果指定了预制件Def名称,则加载并生成
@@ -42,17 +42,17 @@ namespace WulaFallenEmpire
if (customPrefabDef != null)
{
GeneratePrefab(map, customPrefabDef);
- Log.Message($"[WULA] Generated custom prefab: {customPrefabDef.defName}");
+ WulaLog.Debug($"[WULA] Generated custom prefab: {customPrefabDef.defName}");
}
else
{
- Log.Warning($"[WULA] Custom prefab '{prefabDefName}' not found. Skipping prefab generation.");
+ WulaLog.Debug($"[WULA] Custom prefab '{prefabDefName}' not found. Skipping prefab generation.");
}
}
}
catch (Exception ex)
{
- Log.Error($"[WULA] Error generating WULA pocket space: {ex}");
+ WulaLog.Debug($"[WULA] Error generating WULA pocket space: {ex}");
}
}
@@ -103,7 +103,7 @@ namespace WulaFallenEmpire
Thing wall = ThingMaker.MakeThing(rockWallDef);
wall.SetFaction(null);
GenPlace.TryPlaceThing(wall, pos, map, ThingPlaceMode.Direct);
- Log.Warning("[WULA] WulaWall not found, using fallback wall");
+ WulaLog.Debug("[WULA] WulaWall not found, using fallback wall");
}
}
}
@@ -126,7 +126,7 @@ namespace WulaFallenEmpire
if (floorDef == null)
{
- Log.Warning("[WULA] WulaFloor not found, using fallback floor");
+ WulaLog.Debug("[WULA] WulaFloor not found, using fallback floor");
}
// 清理内部区域并设置正确的地板
@@ -141,7 +141,7 @@ namespace WulaFallenEmpire
}
}
- Log.Message($"[WULA] Set floor for internal area ({mapSize.x-2}x{mapSize.z-2}) to {(floorDef?.defName ?? fallbackFloor?.defName)}");
+ WulaLog.Debug($"[WULA] Set floor for internal area ({mapSize.x-2}x{mapSize.z-2}) to {(floorDef?.defName ?? fallbackFloor?.defName)}");
}
///
@@ -192,7 +192,7 @@ namespace WulaFallenEmpire
{
if (Prefs.DevMode) // 只在开发模式下输出详细日志
{
- Log.Message($"[WULA] Removing {thing.def.defName} at {pos} to make space for floor");
+ WulaLog.Debug($"[WULA] Removing {thing.def.defName} at {pos} to make space for floor");
}
thing.Destroy(DestroyMode.Vanish);
}
@@ -204,7 +204,7 @@ namespace WulaFallenEmpire
{
if (thing.def.category == ThingCategory.Building && thing.def.Fillage == FillCategory.Full)
{
- Log.Warning($"[WULA] Force removing remaining building {thing.def.defName} at {pos}");
+ WulaLog.Debug($"[WULA] Force removing remaining building {thing.def.defName} at {pos}");
thing.Destroy(DestroyMode.Vanish);
}
}
@@ -215,13 +215,13 @@ namespace WulaFallenEmpire
map.terrainGrid.SetTerrain(pos, floorDef);
if (Prefs.DevMode)
{
- Log.Message($"[WULA] Set terrain at {pos} to {floorDef.defName}");
+ WulaLog.Debug($"[WULA] Set terrain at {pos} to {floorDef.defName}");
}
}
}
catch (Exception ex)
{
- Log.Error($"[WULA] Error clearing cell at {pos}: {ex}");
+ WulaLog.Debug($"[WULA] Error clearing cell at {pos}: {ex}");
}
}
@@ -232,7 +232,7 @@ namespace WulaFallenEmpire
{
if (prefabDef == null)
{
- Log.Error("[WULA] PrefabDef is null, cannot generate prefab.");
+ WulaLog.Debug("[WULA] PrefabDef is null, cannot generate prefab.");
return;
}
@@ -271,7 +271,7 @@ namespace WulaFallenEmpire
{
// 这里需要递归调用GeneratePrefab,但为了简化,暂时只处理顶层
// 实际项目中,可能需要更复杂的逻辑来处理子预制件的位置和旋转
- Log.Warning($"[WULA] Sub-prefabs are not fully supported in this simple generator: {subPrefabData.data.def.defName}");
+ WulaLog.Debug($"[WULA] Sub-prefabs are not fully supported in this simple generator: {subPrefabData.data.def.defName}");
}
}
}
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/PocketSpaceThingHolder.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/PocketSpaceThingHolder.cs
index 291d1b22..5ac1ada8 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/PocketSpaceThingHolder.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/PocketSpaceThingHolder.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using Verse;
@@ -50,7 +50,7 @@ namespace WulaFallenEmpire
public void Notify_ThingAdded(Thing t)
{
// 这里可以添加逻辑来处理物品被添加到口袋空间的情况
- Log.Message($"[WULA] Item {t.LabelCap} added to pocket space container.");
+ WulaLog.Debug($"[WULA] Item {t.LabelCap} added to pocket space container.");
}
///
@@ -59,7 +59,7 @@ namespace WulaFallenEmpire
public void Notify_ThingRemoved(Thing t)
{
// 这里可以添加逻辑来处理物品被从口袋空间移除的情况
- Log.Message($"[WULA] Item {t.LabelCap} removed from pocket space container.");
+ WulaLog.Debug($"[WULA] Item {t.LabelCap} removed from pocket space container.");
}
public void ExposeData()
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_SkyfallerCaller/CompPrefabSkyfallerCaller.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_SkyfallerCaller/CompPrefabSkyfallerCaller.cs
index 235e6591..ac0d7ce7 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_SkyfallerCaller/CompPrefabSkyfallerCaller.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_SkyfallerCaller/CompPrefabSkyfallerCaller.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using System.Collections.Generic;
using System.Linq;
using Verse;
@@ -37,7 +37,7 @@ namespace WulaFallenEmpire
var prefab = DefDatabase.GetNamed(PropsPrefab.prefabDefName, false);
if (prefab == null)
{
- Log.Error($"[PrefabSkyfallerCaller] Could not find PrefabDef named {PropsPrefab.prefabDefName}");
+ WulaLog.Debug($"[PrefabSkyfallerCaller] Could not find PrefabDef named {PropsPrefab.prefabDefName}");
return new List(); // Return empty list to avoid null reference
}
@@ -69,7 +69,7 @@ namespace WulaFallenEmpire
// Final material check before launching
if (!HasEnoughMaterials())
{
- Log.Warning($"[PrefabSkyfallerCaller] Aborting skyfaller call due to insufficient materials at the last moment.");
+ WulaLog.Debug($"[PrefabSkyfallerCaller] Aborting skyfaller call due to insufficient materials at the last moment.");
ResetCall(); // Reset the calling state
return;
}
@@ -114,7 +114,7 @@ namespace WulaFallenEmpire
}
else
{
- Log.Error($"[PrefabSkyfallerCaller] Failed to create Skyfaller_PrefabSpawner. Created thing is of type {thing.GetType().FullName}. Def: {Props.skyfallerDef.defName}, ThingClass: {Props.skyfallerDef.thingClass.FullName}");
+ WulaLog.Debug($"[PrefabSkyfallerCaller] Failed to create Skyfaller_PrefabSpawner. Created thing is of type {thing.GetType().FullName}. Def: {Props.skyfallerDef.defName}, ThingClass: {Props.skyfallerDef.thingClass.FullName}");
// Fallback: spawn as normal skyfaller if possible, or just abort
if (thing is Skyfaller normalSkyfaller)
{
@@ -138,7 +138,7 @@ namespace WulaFallenEmpire
if (roof != null && !roof.isThickRoof && Props.allowThinRoof)
{
- Log.Message($"[PrefabSkyfallerCaller] Destroying thin roof at {targetPos}");
+ WulaLog.Debug($"[PrefabSkyfallerCaller] Destroying thin roof at {targetPos}");
parent.Map.roofGrid.SetRoof(targetPos, null);
// 生成屋顶破坏效果
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_SkyfallerCaller/CompSkyfallerCaller.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_SkyfallerCaller/CompSkyfallerCaller.cs
index 97387825..a7916e2e 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_SkyfallerCaller/CompSkyfallerCaller.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_SkyfallerCaller/CompSkyfallerCaller.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Linq;
using RimWorld;
using RimWorld.Planet;
@@ -79,7 +79,7 @@ namespace WulaFallenEmpire
}
}
- Log.Message($"[SkyfallerCaller] Found {allFlyOvers.Count} FlyOvers on map");
+ WulaLog.Debug($"[SkyfallerCaller] Found {allFlyOvers.Count} FlyOvers on map");
foreach (var thing in allFlyOvers)
{
@@ -89,28 +89,28 @@ namespace WulaFallenEmpire
var facilitiesComp = flyOver.GetComp();
if (facilitiesComp == null)
{
- Log.Warning($"[SkyfallerCaller] FlyOver at {flyOver.Position} has no CompFlyOverFacilities");
+ WulaLog.Debug($"[SkyfallerCaller] FlyOver at {flyOver.Position} has no CompFlyOverFacilities");
continue;
}
if (facilitiesComp.HasFacility("BuildingdropperFacility"))
{
- Log.Message($"[SkyfallerCaller] Found valid FlyOver at {flyOver.Position} with BuildingdropperFacility");
+ WulaLog.Debug($"[SkyfallerCaller] Found valid FlyOver at {flyOver.Position} with BuildingdropperFacility");
return true;
}
else
{
- Log.Message($"[SkyfallerCaller] FlyOver at {flyOver.Position} missing BuildingdropperFacility. Has: {string.Join(", ", facilitiesComp.GetActiveFacilities())}");
+ WulaLog.Debug($"[SkyfallerCaller] FlyOver at {flyOver.Position} missing BuildingdropperFacility. Has: {string.Join(", ", facilitiesComp.GetActiveFacilities())}");
}
}
}
- Log.Message("[SkyfallerCaller] No FlyOver with BuildingdropperFacility found");
+ WulaLog.Debug("[SkyfallerCaller] No FlyOver with BuildingdropperFacility found");
return false;
}
catch (System.Exception ex)
{
- Log.Error($"[SkyfallerCaller] Exception while checking for FlyOver: {ex}");
+ WulaLog.Debug($"[SkyfallerCaller] Exception while checking for FlyOver: {ex}");
return false;
}
}
@@ -146,7 +146,7 @@ namespace WulaFallenEmpire
callTick = Find.TickManager.TicksGame + Props.autoCallDelayTicks;
calling = true;
- Log.Message($"[SkyfallerCaller] Scheduled auto-call for non-player building {parent.Label} at tick {callTick}");
+ WulaLog.Debug($"[SkyfallerCaller] Scheduled auto-call for non-player building {parent.Label} at tick {callTick}");
}
}
@@ -185,11 +185,11 @@ namespace WulaFallenEmpire
{
try
{
- Log.Message($"[SkyfallerCaller] Executing auto skyfaller call for non-player building at {parent.Position}");
+ WulaLog.Debug($"[SkyfallerCaller] Executing auto skyfaller call for non-player building at {parent.Position}");
if (Props.skyfallerDef == null)
{
- Log.Error("[SkyfallerCaller] Skyfaller def is null!");
+ WulaLog.Debug("[SkyfallerCaller] Skyfaller def is null!");
ResetCall();
return;
}
@@ -202,19 +202,19 @@ namespace WulaFallenEmpire
Skyfaller skyfaller = SkyfallerMaker.MakeSkyfaller(Props.skyfallerDef);
if (skyfaller == null)
{
- Log.Error("[SkyfallerCaller] Failed to create skyfaller!");
+ WulaLog.Debug("[SkyfallerCaller] Failed to create skyfaller!");
ResetCall();
return;
}
IntVec3 spawnPos = parent.Position;
- Log.Message($"[SkyfallerCaller] Spawning auto skyfaller at {spawnPos}");
+ WulaLog.Debug($"[SkyfallerCaller] Spawning auto skyfaller at {spawnPos}");
GenSpawn.Spawn(skyfaller, spawnPos, parent.Map);
if (Props.destroyBuilding)
{
- Log.Message($"[SkyfallerCaller] Destroying non-player building {parent.Label}");
+ WulaLog.Debug($"[SkyfallerCaller] Destroying non-player building {parent.Label}");
parent.Destroy(DestroyMode.Vanish);
}
@@ -228,7 +228,7 @@ namespace WulaFallenEmpire
}
catch (System.Exception ex)
{
- Log.Error($"[SkyfallerCaller] Error in ExecuteAutoSkyfallerCall: {ex}");
+ WulaLog.Debug($"[SkyfallerCaller] Error in ExecuteAutoSkyfallerCall: {ex}");
ResetCall();
}
}
@@ -263,7 +263,7 @@ namespace WulaFallenEmpire
return;
}
- Log.Message($"[SkyfallerCaller] Starting skyfaller call from {parent.Label} at {parent.Position}");
+ WulaLog.Debug($"[SkyfallerCaller] Starting skyfaller call from {parent.Label} at {parent.Position}");
calling = true;
used = true;
@@ -295,11 +295,11 @@ namespace WulaFallenEmpire
protected virtual void ExecuteSkyfallerCall()
{
- Log.Message($"[SkyfallerCaller] Executing skyfaller call at {parent.Position}");
+ WulaLog.Debug($"[SkyfallerCaller] Executing skyfaller call at {parent.Position}");
if (Props.skyfallerDef == null)
{
- Log.Error("[SkyfallerCaller] Skyfaller def is null!");
+ WulaLog.Debug("[SkyfallerCaller] Skyfaller def is null!");
return;
}
@@ -307,7 +307,7 @@ namespace WulaFallenEmpire
var resourceCheck = CheckAndConsumeMaterials();
if (!resourceCheck.HasEnoughMaterials)
{
- Log.Message($"[SkyfallerCaller] Aborting skyfaller call due to insufficient materials.");
+ WulaLog.Debug($"[SkyfallerCaller] Aborting skyfaller call due to insufficient materials.");
ResetCall();
return;
}
@@ -322,18 +322,18 @@ namespace WulaFallenEmpire
Skyfaller skyfaller = SkyfallerMaker.MakeSkyfaller(Props.skyfallerDef);
if (skyfaller == null)
{
- Log.Error("[SkyfallerCaller] Failed to create skyfaller!");
+ WulaLog.Debug("[SkyfallerCaller] Failed to create skyfaller!");
return;
}
IntVec3 spawnPos = parent.Position;
- Log.Message($"[SkyfallerCaller] Spawning skyfaller at {spawnPos}");
+ WulaLog.Debug($"[SkyfallerCaller] Spawning skyfaller at {spawnPos}");
GenSpawn.Spawn(skyfaller, spawnPos, parent.Map);
if (Props.destroyBuilding)
{
- Log.Message($"[SkyfallerCaller] Destroying building {parent.Label}");
+ WulaLog.Debug($"[SkyfallerCaller] Destroying building {parent.Label}");
parent.Destroy(DestroyMode.Vanish);
}
@@ -350,7 +350,7 @@ namespace WulaFallenEmpire
if (roof != null && !roof.isThickRoof && Props.allowThinRoof)
{
- Log.Message($"[SkyfallerCaller] Destroying thin roof at {targetPos}");
+ WulaLog.Debug($"[SkyfallerCaller] Destroying thin roof at {targetPos}");
parent.Map.roofGrid.SetRoof(targetPos, null);
// 生成屋顶破坏效果
@@ -670,7 +670,7 @@ namespace WulaFallenEmpire
// 在非 God Mode 下,这个方法不应该被调用
// 实际的消耗在 CheckAndConsumeMaterials 中处理
- Log.Warning("[SkyfallerCaller] ConsumeMaterials called in non-God mode, this shouldn't happen");
+ WulaLog.Debug("[SkyfallerCaller] ConsumeMaterials called in non-God mode, this shouldn't happen");
}
// 其余方法保持不变...
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_SkyfallerCaller/DebugActions_PrefabSkyfallerCaller.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_SkyfallerCaller/DebugActions_PrefabSkyfallerCaller.cs
index 6d7fed40..7f5fc9cf 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_SkyfallerCaller/DebugActions_PrefabSkyfallerCaller.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_SkyfallerCaller/DebugActions_PrefabSkyfallerCaller.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Linq;
using RimWorld;
using UnityEngine;
@@ -18,7 +18,7 @@ namespace WulaFallenEmpire
if (!eligibleDefs.Any())
{
- Log.Warning("[Debug] No ThingDefs found with CompProperties_PrefabSkyfallerCaller");
+ WulaLog.Debug("[Debug] No ThingDefs found with CompProperties_PrefabSkyfallerCaller");
return;
}
@@ -43,7 +43,7 @@ namespace WulaFallenEmpire
if (!eligibleDefs.Any())
{
- Log.Warning("[Debug] No ThingDefs found with CompProperties_PrefabSkyfallerCaller");
+ WulaLog.Debug("[Debug] No ThingDefs found with CompProperties_PrefabSkyfallerCaller");
return;
}
@@ -85,7 +85,7 @@ namespace WulaFallenEmpire
var currentMap = Find.CurrentMap;
if (currentMap == null)
{
- Log.Warning("[Debug] No current map found");
+ WulaLog.Debug("[Debug] No current map found");
return;
}
@@ -97,11 +97,11 @@ namespace WulaFallenEmpire
var compProps = thingDef.comps.OfType().FirstOrDefault();
if (compProps == null)
{
- Log.Warning($"[Debug] Could not find CompProperties_PrefabSkyfallerCaller for {thingDef.defName}");
+ WulaLog.Debug($"[Debug] Could not find CompProperties_PrefabSkyfallerCaller for {thingDef.defName}");
return;
}
- Log.Message($"[Debug] Looking for spawn positions for {thingDef.defName} (Size: {thingDef.Size})");
+ WulaLog.Debug($"[Debug] Looking for spawn positions for {thingDef.defName} (Size: {thingDef.Size})");
for (int i = 0; i < spawnCount && attempts < maxAttempts; i++)
{
@@ -120,11 +120,11 @@ namespace WulaFallenEmpire
GenSpawn.Spawn(thing, spawnPos, currentMap);
successCount++;
- Log.Message($"[Debug] Successfully spawned {thingDef.defName} at {spawnPos} for faction {faction?.Name ?? "None"}");
+ WulaLog.Debug($"[Debug] Successfully spawned {thingDef.defName} at {spawnPos} for faction {faction?.Name ?? "None"}");
}
else
{
- Log.Warning($"[Debug] Failed to find valid spawn position for {thingDef.defName} (attempt {attempts})");
+ WulaLog.Debug($"[Debug] Failed to find valid spawn position for {thingDef.defName} (attempt {attempts})");
}
}
@@ -144,7 +144,7 @@ namespace WulaFallenEmpire
var potentialCells = new List();
// 策略1:首先尝试玩家基地附近的开放区域
- Log.Message($"[Debug] Searching near base area...");
+ WulaLog.Debug($"[Debug] Searching near base area...");
var baseCells = GetOpenAreaCellsNearBase(map, thingDef.Size);
foreach (var cell in baseCells)
{
@@ -157,12 +157,12 @@ namespace WulaFallenEmpire
if (potentialCells.Count > 0)
{
- Log.Message($"[Debug] Found {potentialCells.Count} positions near base");
+ WulaLog.Debug($"[Debug] Found {potentialCells.Count} positions near base");
return potentialCells.RandomElement();
}
// 策略2:搜索整个地图的开阔区域
- Log.Message($"[Debug] Searching open areas...");
+ WulaLog.Debug($"[Debug] Searching open areas...");
var openAreas = FindOpenAreas(map, thingDef.Size, 1000);
foreach (var cell in openAreas)
{
@@ -175,12 +175,12 @@ namespace WulaFallenEmpire
if (potentialCells.Count > 0)
{
- Log.Message($"[Debug] Found {potentialCells.Count} positions in open areas");
+ WulaLog.Debug($"[Debug] Found {potentialCells.Count} positions in open areas");
return potentialCells.RandomElement();
}
// 策略3:使用随机采样
- Log.Message($"[Debug] Trying random sampling...");
+ WulaLog.Debug($"[Debug] Trying random sampling...");
for (int i = 0; i < 500; i++)
{
IntVec3 randomCell = new IntVec3(
@@ -198,11 +198,11 @@ namespace WulaFallenEmpire
if (potentialCells.Count > 0)
{
- Log.Message($"[Debug] Found {potentialCells.Count} positions via random sampling");
+ WulaLog.Debug($"[Debug] Found {potentialCells.Count} positions via random sampling");
return potentialCells.RandomElement();
}
- Log.Warning($"[Debug] No valid positions found for {thingDef.defName}");
+ WulaLog.Debug($"[Debug] No valid positions found for {thingDef.defName}");
return IntVec3.Invalid;
}
@@ -415,12 +415,12 @@ namespace WulaFallenEmpire
}
}
- Log.Message($"[Debug] Force cleared {clearedCount} objects for skyfaller drop");
+ WulaLog.Debug($"[Debug] Force cleared {clearedCount} objects for skyfaller drop");
return clearedCount > 0;
}
catch (System.Exception ex)
{
- Log.Error($"[Debug] Error force clearing area: {ex}");
+ WulaLog.Debug($"[Debug] Error force clearing area: {ex}");
return false;
}
}
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_SkyfallerCaller/Skyfaller_PrefabSpawner.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_SkyfallerCaller/Skyfaller_PrefabSpawner.cs
index 778c79b2..ba926121 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_SkyfallerCaller/Skyfaller_PrefabSpawner.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_SkyfallerCaller/Skyfaller_PrefabSpawner.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using Verse;
namespace WulaFallenEmpire
@@ -13,14 +13,14 @@ namespace WulaFallenEmpire
// Don't spawn the innerThing, we are spawning a prefab instead.
if (string.IsNullOrEmpty(prefabDefName))
{
- Log.Error("[Skyfaller_PrefabSpawner] prefabDefName is null or empty. Cannot spawn prefab.");
+ WulaLog.Debug("[Skyfaller_PrefabSpawner] prefabDefName is null or empty. Cannot spawn prefab.");
return;
}
PrefabDef prefabDef = DefDatabase.GetNamed(prefabDefName, false);
if (prefabDef == null)
{
- Log.Error($"[Skyfaller_PrefabSpawner] Could not find PrefabDef named {prefabDefName}.");
+ WulaLog.Debug($"[Skyfaller_PrefabSpawner] Could not find PrefabDef named {prefabDefName}.");
return;
}
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_StorageTurret/CompStorageTurret.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_StorageTurret/CompStorageTurret.cs
index 604af7ba..1a67fdde 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_StorageTurret/CompStorageTurret.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_StorageTurret/CompStorageTurret.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using UnityEngine;
using Verse;
@@ -372,7 +372,7 @@ namespace WulaFallenEmpire
// 确保 parent 不为 null
if (_parent == null || _parent.parent == null)
{
- Log.Warning("[StorageTurret] Parent is null when updating gun verbs");
+ WulaLog.Debug("[StorageTurret] Parent is null when updating gun verbs");
return;
}
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_Teleporter/CompMapTeleporter.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_Teleporter/CompMapTeleporter.cs
index 779ee395..65fc6bba 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_Teleporter/CompMapTeleporter.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_Teleporter/CompMapTeleporter.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using RimWorld;
@@ -157,7 +157,7 @@ namespace WulaFallenEmpire
warmupTicksLeft--;
if (warmupTicksLeft % 60 == 0)
{
- Log.Message($"[WULA] Teleport warmup: {warmupTicksLeft} ticks left.");
+ WulaLog.Debug($"[WULA] Teleport warmup: {warmupTicksLeft} ticks left.");
foreach (var member in GroupMembers)
{
Props.warmupEffecter?.Spawn(member.parent, member.parent.Map).Cleanup();
@@ -166,7 +166,7 @@ namespace WulaFallenEmpire
if (warmupTicksLeft <= 0)
{
- Log.Message("[WULA] Warmup finished. Attempting teleport...");
+ WulaLog.Debug("[WULA] Warmup finished. Attempting teleport...");
TryTeleport();
isWarmingUp = false;
}
@@ -335,7 +335,7 @@ namespace WulaFallenEmpire
private void TryTeleport()
{
- Log.Message($"[WULA] TryTeleport called. Target valid: {target.IsValid}, Tile: {target.Tile}, Cell: {target.Cell}");
+ WulaLog.Debug($"[WULA] TryTeleport called. Target valid: {target.IsValid}, Tile: {target.Tile}, Cell: {target.Cell}");
if (!target.IsValid)
{
@@ -349,7 +349,7 @@ namespace WulaFallenEmpire
if (targetMap == null)
{
- Log.Message($"[WULA] Target map is null. Generating map for tile {target.Tile}...");
+ WulaLog.Debug($"[WULA] Target map is null. Generating map for tile {target.Tile}...");
targetMap = GetOrGenerateTargetMap(target.Tile);
if (targetMap == null)
{
@@ -360,7 +360,7 @@ namespace WulaFallenEmpire
targetCell = targetMap.Center;
}
- Log.Message($"[WULA] Teleporting to map {targetMap.Index}, cell {targetCell}");
+ WulaLog.Debug($"[WULA] Teleporting to map {targetMap.Index}, cell {targetCell}");
TeleportContents(targetMap, targetCell);
}
@@ -402,7 +402,7 @@ namespace WulaFallenEmpire
List thingsToTeleport = new List();
List> terrainToTeleport = new List>();
- Log.Message($"[WULA] Collecting data from {cells.Count} cells in group");
+ WulaLog.Debug($"[WULA] Collecting data from {cells.Count} cells in group");
// 1. 收集数据
HashSet collectedThings = new HashSet();
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_TransformAtFullCapacity/CompTransformAtFullCapacity.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_TransformAtFullCapacity/CompTransformAtFullCapacity.cs
index 1dbea549..93d7d529 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_TransformAtFullCapacity/CompTransformAtFullCapacity.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_TransformAtFullCapacity/CompTransformAtFullCapacity.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using System.Collections.Generic;
using UnityEngine;
using Verse;
@@ -164,7 +164,7 @@ namespace WulaFallenEmpire
// 播放转换效果
PlayTransformEffects(position, map);
- Log.Message($"[TransformSystem] Building -> Pawn transformation completed at {position}. Path grid updated.");
+ WulaLog.Debug($"[TransformSystem] Building -> Pawn transformation completed at {position}. Path grid updated.");
}
}
}
diff --git a/Source/WulaFallenEmpire/BuildingComp/WULA_TransformAtFullCapacity/CompTransformIntoBuilding.cs b/Source/WulaFallenEmpire/BuildingComp/WULA_TransformAtFullCapacity/CompTransformIntoBuilding.cs
index 78516b20..b85f2908 100644
--- a/Source/WulaFallenEmpire/BuildingComp/WULA_TransformAtFullCapacity/CompTransformIntoBuilding.cs
+++ b/Source/WulaFallenEmpire/BuildingComp/WULA_TransformAtFullCapacity/CompTransformIntoBuilding.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using System.Collections.Generic;
using UnityEngine;
using Verse;
@@ -288,7 +288,7 @@ namespace WulaFallenEmpire
lastValidationResult = null;
lastValidationReason = null;
- Log.Message($"[TransformSystem] Pawn -> Building transformation completed at {desiredPosition}. Path grid updated.");
+ WulaLog.Debug($"[TransformSystem] Pawn -> Building transformation completed at {desiredPosition}. Path grid updated.");
}
}
}
diff --git a/Source/WulaFallenEmpire/Damage/DamageWorker_ExplosionWithTerrain.cs b/Source/WulaFallenEmpire/Damage/DamageWorker_ExplosionWithTerrain.cs
index e7867667..279cb527 100644
--- a/Source/WulaFallenEmpire/Damage/DamageWorker_ExplosionWithTerrain.cs
+++ b/Source/WulaFallenEmpire/Damage/DamageWorker_ExplosionWithTerrain.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Linq;
using RimWorld;
using UnityEngine;
@@ -46,7 +46,7 @@ namespace WulaFallenEmpire
// 检查单元格是否可影响
if (!terrainCover.CanAffectCell(cell, map, out string reason))
{
- Log.Message($"Cannot affect cell {cell}: {reason}");
+ WulaLog.Debug($"Cannot affect cell {cell}: {reason}");
return;
}
@@ -59,7 +59,7 @@ namespace WulaFallenEmpire
Plant plant = cell.GetPlant(map);
if (plant != null && plant.def.plant.treeCategory == TreeCategory.Super)
{
- Log.Message($"Large tree at {cell}, skipping");
+ WulaLog.Debug($"Large tree at {cell}, skipping");
return;
}
@@ -78,11 +78,11 @@ namespace WulaFallenEmpire
// 设置新地形
map.terrainGrid.SetTerrain(cell, terrainCover.terrainToSpawn);
- Log.Message($"Applied terrain {terrainCover.terrainToSpawn.defName} to cell {cell}");
+ WulaLog.Debug($"Applied terrain {terrainCover.terrainToSpawn.defName} to cell {cell}");
}
else
{
- Log.Message($"Cannot build terrain {terrainCover.terrainToSpawn.defName} at cell {cell}");
+ WulaLog.Debug($"Cannot build terrain {terrainCover.terrainToSpawn.defName} at cell {cell}");
}
}
}
diff --git a/Source/WulaFallenEmpire/Damage/DamageWorker_ExtraDamage.cs b/Source/WulaFallenEmpire/Damage/DamageWorker_ExtraDamage.cs
index d808e5e9..03d95e3d 100644
--- a/Source/WulaFallenEmpire/Damage/DamageWorker_ExtraDamage.cs
+++ b/Source/WulaFallenEmpire/Damage/DamageWorker_ExtraDamage.cs
@@ -1,4 +1,4 @@
-using RimWorld;
+using RimWorld;
using Verse;
using System.Collections.Generic;
@@ -36,7 +36,7 @@ namespace WulaFallenEmpire
// 调试信息
if (Prefs.DevMode)
{
- Log.Message($"应用额外伤害: {extraDamage.damageDef.defName} 伤害值: {extraDamage.amount}");
+ WulaLog.Debug($"应用额外伤害: {extraDamage.damageDef.defName} 伤害值: {extraDamage.amount}");
}
}
}
diff --git a/Source/WulaFallenEmpire/EventSystem/AI/AIHistoryManager.cs b/Source/WulaFallenEmpire/EventSystem/AI/AIHistoryManager.cs
index 13cdb02e..321ac1d0 100644
--- a/Source/WulaFallenEmpire/EventSystem/AI/AIHistoryManager.cs
+++ b/Source/WulaFallenEmpire/EventSystem/AI/AIHistoryManager.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
@@ -57,7 +57,7 @@ namespace WulaFallenEmpire.EventSystem.AI
}
catch (Exception ex)
{
- Log.Error($"[WulaFallenEmpire] Failed to load AI history from {path}: {ex}");
+ WulaLog.Debug($"[WulaFallenEmpire] Failed to load AI history from {path}: {ex}");
}
}
@@ -75,7 +75,7 @@ namespace WulaFallenEmpire.EventSystem.AI
}
catch (Exception ex)
{
- Log.Error($"[WulaFallenEmpire] Failed to save AI history to {path}: {ex}");
+ WulaLog.Debug($"[WulaFallenEmpire] Failed to save AI history to {path}: {ex}");
}
}
@@ -92,7 +92,7 @@ namespace WulaFallenEmpire.EventSystem.AI
}
catch (Exception ex)
{
- Log.Error($"[WulaFallenEmpire] Failed to clear AI history at {path}: {ex}");
+ WulaLog.Debug($"[WulaFallenEmpire] Failed to clear AI history at {path}: {ex}");
}
}
diff --git a/Source/WulaFallenEmpire/EventSystem/AI/SimpleAIClient.cs b/Source/WulaFallenEmpire/EventSystem/AI/SimpleAIClient.cs
index 32604963..335afe24 100644
--- a/Source/WulaFallenEmpire/EventSystem/AI/SimpleAIClient.cs
+++ b/Source/WulaFallenEmpire/EventSystem/AI/SimpleAIClient.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
@@ -25,7 +25,7 @@ namespace WulaFallenEmpire.EventSystem.AI
{
if (string.IsNullOrEmpty(_baseUrl))
{
- Log.Error("[WulaAI] Base URL is missing.");
+ WulaLog.Debug("[WulaAI] Base URL is missing.");
return null;
}
@@ -69,8 +69,8 @@ namespace WulaFallenEmpire.EventSystem.AI
string jsonBody = jsonBuilder.ToString();
if (Prefs.DevMode)
{
- Log.Message($"[WulaAI] Sending request to {endpoint} (model={_model}, messages={messages?.Count ?? 0})");
- Log.Message($"[WulaAI] Request body (truncated):\n{TruncateForLog(jsonBody)}");
+ WulaLog.Debug($"[WulaAI] Sending request to {endpoint} (model={_model}, messages={messages?.Count ?? 0})");
+ WulaLog.Debug($"[WulaAI] Request body (truncated):\n{TruncateForLog(jsonBody)}");
}
using (UnityWebRequest request = new UnityWebRequest(endpoint, "POST"))
@@ -93,14 +93,14 @@ namespace WulaFallenEmpire.EventSystem.AI
if (request.result == UnityWebRequest.Result.ConnectionError || request.result == UnityWebRequest.Result.ProtocolError)
{
- Log.Error($"[WulaAI] API Error: {request.error}\nResponse (truncated): {TruncateForLog(request.downloadHandler.text)}");
+ WulaLog.Debug($"[WulaAI] API Error: {request.error}\nResponse (truncated): {TruncateForLog(request.downloadHandler.text)}");
return null;
}
string responseText = request.downloadHandler.text;
if (Prefs.DevMode)
{
- Log.Message($"[WulaAI] Raw Response (truncated): {TruncateForLog(responseText)}");
+ WulaLog.Debug($"[WulaAI] Raw Response (truncated): {TruncateForLog(responseText)}");
}
return ExtractContent(responseText);
}
@@ -181,7 +181,7 @@ namespace WulaFallenEmpire.EventSystem.AI
}
catch (Exception ex)
{
- Log.Error($"[WulaAI] Error parsing response: {ex}");
+ WulaLog.Debug($"[WulaAI] Error parsing response: {ex}");
}
return null;
}
diff --git a/Source/WulaFallenEmpire/EventSystem/AI/Tools/Tool_SendReinforcement.cs b/Source/WulaFallenEmpire/EventSystem/AI/Tools/Tool_SendReinforcement.cs
index 61babbb7..63de8aee 100644
--- a/Source/WulaFallenEmpire/EventSystem/AI/Tools/Tool_SendReinforcement.cs
+++ b/Source/WulaFallenEmpire/EventSystem/AI/Tools/Tool_SendReinforcement.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -129,7 +129,7 @@ namespace WulaFallenEmpire.EventSystem.AI.Tools
float baseMaxPoints = StorytellerUtility.DefaultThreatPointsNow(map);
float adjustedMaxPoints = baseMaxPoints * goodwillFactor * 1.5f;
- Log.Message($"[WulaAI] send_reinforcement: totalCost={totalCost}, adjustedMaxPoints={adjustedMaxPoints}");
+ WulaLog.Debug($"[WulaAI] send_reinforcement: totalCost={totalCost}, adjustedMaxPoints={adjustedMaxPoints}");
if (totalCost > adjustedMaxPoints)
{
return $"Error: Total cost {totalCost} exceeds limit {adjustedMaxPoints:F0}. Reduce unit count.";
diff --git a/Source/WulaFallenEmpire/EventSystem/AI/UI/Dialog_AIConversation.cs b/Source/WulaFallenEmpire/EventSystem/AI/UI/Dialog_AIConversation.cs
index 196ec3c8..610b04c5 100644
--- a/Source/WulaFallenEmpire/EventSystem/AI/UI/Dialog_AIConversation.cs
+++ b/Source/WulaFallenEmpire/EventSystem/AI/UI/Dialog_AIConversation.cs
@@ -127,7 +127,7 @@ You are 'The Legion', a super AI of the Wula Empire. Your personality is authori
}
catch (Exception ex)
{
- Log.Error($"[WulaAI] Failed to persist AI history: {ex}");
+ WulaLog.Debug($"[WulaAI] Failed to persist AI history: {ex}");
}
}
@@ -143,7 +143,7 @@ You are 'The Legion', a super AI of the Wula Empire. Your personality is authori
}
else
{
- Log.Warning($"[WulaAI] Failed to load portrait: {path}");
+ WulaLog.Debug($"[WulaAI] Failed to load portrait: {path}");
}
}
@@ -173,7 +173,7 @@ You are 'The Legion', a super AI of the Wula Empire. Your personality is authori
}
else
{
- Log.Warning($"[WulaAI] Portrait ID {id} not found.");
+ WulaLog.Debug($"[WulaAI] Portrait ID {id} not found.");
}
}
@@ -578,7 +578,7 @@ Example (changing to a neutral expression):
var phase = (RequestPhase)phaseIndex;
if (Prefs.DevMode)
{
- Log.Message($"[WulaAI] ===== Turn {phaseIndex}/4 ({phase}) =====");
+ WulaLog.Debug($"[WulaAI] ===== Turn {phaseIndex}/4 ({phase}) =====");
}
bool toolsEnabled = phase != RequestPhase.Reply;
@@ -592,7 +592,7 @@ Example (changing to a neutral expression):
{
if (Prefs.DevMode)
{
- Log.Message($"[WulaAI] Turn {phaseIndex}/4 reply request (attempt {attempts + 1})");
+ WulaLog.Debug($"[WulaAI] Turn {phaseIndex}/4 reply request (attempt {attempts + 1})");
}
string reply = await client.GetChatCompletionAsync(systemInstruction, _history);
if (string.IsNullOrEmpty(reply))
@@ -622,7 +622,7 @@ Example (changing to a neutral expression):
if (Prefs.DevMode)
{
- Log.Message($"[WulaAI] Turn {phaseIndex}/4 tool request");
+ WulaLog.Debug($"[WulaAI] Turn {phaseIndex}/4 tool request");
}
string response = await client.GetChatCompletionAsync(systemInstruction, _history);
if (string.IsNullOrEmpty(response))
@@ -638,7 +638,7 @@ Example (changing to a neutral expression):
PersistHistory();
if (Prefs.DevMode)
{
- Log.Message($"[WulaAI] Turn {phaseIndex}/4 missing XML; retrying once");
+ WulaLog.Debug($"[WulaAI] Turn {phaseIndex}/4 missing XML; retrying once");
}
response = await client.GetChatCompletionAsync(systemInstruction, _history);
if (string.IsNullOrEmpty(response))
@@ -652,7 +652,7 @@ Example (changing to a neutral expression):
{
if (Prefs.DevMode)
{
- Log.Warning($"[WulaAI] Turn {phaseIndex}/4 still missing XML after retry; forcing ");
+ WulaLog.Debug($"[WulaAI] Turn {phaseIndex}/4 still missing XML after retry; forcing ");
}
response = phase == RequestPhase.Cosmetic
? "2"
@@ -666,7 +666,7 @@ Example (changing to a neutral expression):
PersistHistory();
if (Prefs.DevMode)
{
- Log.Message("[WulaAI] Turn 3/4 missing ; retrying once");
+ WulaLog.Debug("[WulaAI] Turn 3/4 missing ; retrying once");
}
string retry = await client.GetChatCompletionAsync(systemInstruction, _history);
@@ -678,7 +678,7 @@ Example (changing to a neutral expression):
{
if (Prefs.DevMode)
{
- Log.Warning("[WulaAI] Turn 3/4 still missing after retry; forcing default expression_id=2");
+ WulaLog.Debug("[WulaAI] Turn 3/4 still missing after retry; forcing default expression_id=2");
}
response = "2";
}
@@ -689,7 +689,7 @@ Example (changing to a neutral expression):
}
catch (Exception ex)
{
- Log.Error($"[WulaAI] Exception in RunPhasedRequestAsync: {ex}");
+ WulaLog.Debug($"[WulaAI] Exception in RunPhasedRequestAsync: {ex}");
_currentResponse = "Wula_AI_Error_Internal".Translate(ex.Message);
}
finally
@@ -792,7 +792,7 @@ Example (changing to a neutral expression):
if (Prefs.DevMode)
{
- Log.Message($"[WulaAI] Executing tool (phase {phase}): {toolName} with args: {argsXml}");
+ WulaLog.Debug($"[WulaAI] Executing tool (phase {phase}): {toolName} with args: {argsXml}");
}
string signature = $"{toolName}:{Regex.Replace(argsXml ?? "", @"\s+", " ").Trim()}";
@@ -918,7 +918,7 @@ Example (changing to a neutral expression):
}
catch (Exception ex)
{
- Log.Error($"[WulaAI] Exception in GenerateResponse: {ex}");
+ WulaLog.Debug($"[WulaAI] Exception in GenerateResponse: {ex}");
_currentResponse = "Wula_AI_Error_Internal".Translate(ex.Message);
}
finally
@@ -1069,7 +1069,7 @@ Example (changing to a neutral expression):
if (tool == null)
{
string errorMsg = $"Error: Tool '{toolName}' not found.";
- Log.Error($"[WulaAI] {errorMsg}");
+ WulaLog.Debug($"[WulaAI] {errorMsg}");
combinedResults.AppendLine(errorMsg);
continue;
}
@@ -1084,7 +1084,7 @@ Example (changing to a neutral expression):
if (Prefs.DevMode)
{
- Log.Message($"[WulaAI] Executing tool: {toolName} with args: {argsXml}");
+ WulaLog.Debug($"[WulaAI] Executing tool: {toolName} with args: {argsXml}");
}
// Record tool signature for loop detection (before execution, so errors also count)
@@ -1096,7 +1096,7 @@ Example (changing to a neutral expression):
if (Prefs.DevMode && !string.IsNullOrEmpty(result))
{
string toLog = result.Length <= 2000 ? result : result.Substring(0, 2000) + $"... (truncated, total {result.Length} chars)";
- Log.Message($"[WulaAI] Tool '{toolName}' result: {toLog}");
+ WulaLog.Debug($"[WulaAI] Tool '{toolName}' result: {toLog}");
}
if (toolName == "modify_goodwill")
@@ -1154,7 +1154,7 @@ Example (changing to a neutral expression):
}
catch (Exception ex)
{
- Log.Error($"[WulaAI] Exception in HandleXmlToolUsage: {ex}");
+ WulaLog.Debug($"[WulaAI] Exception in HandleXmlToolUsage: {ex}");
_history.Add(("tool", $"Error processing tool call: {ex.Message}"));
PersistHistory();
await GenerateResponse(isContinuation: true);
@@ -1535,7 +1535,7 @@ Example (changing to a neutral expression):
}
catch (Exception ex)
{
- Log.Error($"[WulaAI] Failed to clear AI history: {ex}");
+ WulaLog.Debug($"[WulaAI] Failed to clear AI history: {ex}");
}
Messages.Message("已清除 AI 对话上下文历史。", MessageTypeDefOf.NeutralEvent);
diff --git a/Source/WulaFallenEmpire/EventSystem/CompOpenCustomUI.cs b/Source/WulaFallenEmpire/EventSystem/CompOpenCustomUI.cs
index 2281ab41..c365f69c 100644
--- a/Source/WulaFallenEmpire/EventSystem/CompOpenCustomUI.cs
+++ b/Source/WulaFallenEmpire/EventSystem/CompOpenCustomUI.cs
@@ -1,4 +1,4 @@
-using System; // Required for Activator
+using System; // Required for Activator
using RimWorld;
using Verse;
using System.Collections.Generic;
@@ -51,7 +51,7 @@ namespace WulaFallenEmpire
}
else
{
- Log.Error($"[CompOpenCustomUI] Could not find EventDef named '{Props.uiDefName}'.");
+ WulaLog.Debug($"[CompOpenCustomUI] Could not find EventDef named '{Props.uiDefName}'.");
}
});
diff --git a/Source/WulaFallenEmpire/EventSystem/Condition/ConditionBase.cs b/Source/WulaFallenEmpire/EventSystem/Condition/ConditionBase.cs
index 4101f051..61ea7569 100644
--- a/Source/WulaFallenEmpire/EventSystem/Condition/ConditionBase.cs
+++ b/Source/WulaFallenEmpire/EventSystem/Condition/ConditionBase.cs
@@ -1,4 +1,4 @@
-using Verse;
+using Verse;
using RimWorld;
namespace WulaFallenEmpire
@@ -58,7 +58,7 @@ namespace WulaFallenEmpire
}
catch (System.Exception e)
{
- Log.Warning($"[EventSystem] Condition_VariableEquals: Could not compare '{variable}' and '{compareValueStr}'. Error: {e.Message}");
+ WulaLog.Debug($"[EventSystem] Condition_VariableEquals: Could not compare '{variable}' and '{compareValueStr}'. Error: {e.Message}");
reason = "Type mismatch or parsing error during comparison.";
return false;
}
@@ -89,7 +89,7 @@ namespace WulaFallenEmpire
var eventVarManager = Find.World.GetComponent();
if (!eventVarManager.HasVariable(name))
{
- Log.Message($"[EventSystem] {GetType().Name}: Variable '{name}' not found, defaulting to 0f.");
+ WulaLog.Debug($"[EventSystem] {GetType().Name}: Variable '{name}' not found, defaulting to 0f.");
eventVarManager.SetVariable(name, 0f);
}
@@ -102,13 +102,13 @@ namespace WulaFallenEmpire
if (float.IsNaN(compareValue))
{
reason = $"Comparison variable '{valueVariableName}' not set or not a number.";
- Log.Warning($"[EventSystem] {GetType().Name} check for '{name}' failed: {reason}");
+ WulaLog.Debug($"[EventSystem] {GetType().Name} check for '{name}' failed: {reason}");
return false;
}
}
bool met = Compare(variable, compareValue);
- Log.Message($"[EventSystem] {GetType().Name} check: Name='{name}', CurrentValue='{variable}', CompareValue='{compareValue}', Met={met}");
+ WulaLog.Debug($"[EventSystem] {GetType().Name} check: Name='{name}', CurrentValue='{variable}', CompareValue='{compareValue}', Met={met}");
if (!met)
{
reason = $"Requires {name} {GetOperatorString()} {compareValue} (Current: {variable})";
@@ -195,12 +195,12 @@ namespace WulaFallenEmpire
}
catch (System.Exception e)
{
- Log.Warning($"[EventSystem] Condition_VariableNotEqual: Could not compare '{variable}' and '{compareValueStr}'. Error: {e.Message}");
+ WulaLog.Debug($"[EventSystem] Condition_VariableNotEqual: Could not compare '{variable}' and '{compareValueStr}'. Error: {e.Message}");
reason = "Type mismatch or parsing error during comparison.";
return false;
}
- Log.Message($"[EventSystem] Condition_VariableNotEqual check: Name='{name}', Type='{variable?.GetType().Name ?? "null"}', CurrentValue='{variable}', CompareValue='{compareValueStr}', Met={met}");
+ WulaLog.Debug($"[EventSystem] Condition_VariableNotEqual check: Name='{name}', Type='{variable?.GetType().Name ?? "null"}', CurrentValue='{variable}', CompareValue='{compareValueStr}', Met={met}");
if (!met)
{
reason = $"Requires {name} != {compareValueStr} (Current: {variable})";
diff --git a/Source/WulaFallenEmpire/EventSystem/Condition/Condition_FlagExists.cs b/Source/WulaFallenEmpire/EventSystem/Condition/Condition_FlagExists.cs
index 68bef5a7..0d4704fc 100644
--- a/Source/WulaFallenEmpire/EventSystem/Condition/Condition_FlagExists.cs
+++ b/Source/WulaFallenEmpire/EventSystem/Condition/Condition_FlagExists.cs
@@ -1,4 +1,4 @@
-using Verse;
+using Verse;
using RimWorld;
namespace WulaFallenEmpire
@@ -40,7 +40,7 @@ namespace WulaFallenEmpire
}
}
- Log.Message($"[EventSystem] Condition_FlagExists check: Flag='{flagName}', Exists={flagExists}, Reason='{reason}'");
+ WulaLog.Debug($"[EventSystem] Condition_FlagExists check: Flag='{flagName}', Exists={flagExists}, Reason='{reason}'");
return flagExists;
}
}
diff --git a/Source/WulaFallenEmpire/EventSystem/DelayedActionManager.cs b/Source/WulaFallenEmpire/EventSystem/DelayedActionManager.cs
index 1a91e009..be73fc1a 100644
--- a/Source/WulaFallenEmpire/EventSystem/DelayedActionManager.cs
+++ b/Source/WulaFallenEmpire/EventSystem/DelayedActionManager.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using RimWorld;
using RimWorld.Planet;
@@ -60,7 +60,7 @@ namespace WulaFallenEmpire
}
catch (Exception ex)
{
- Log.Error($"[WulaFallenEmpire] Error executing delayed action for event '{delayedAction.eventDefName}': {ex}");
+ WulaLog.Debug($"[WulaFallenEmpire] Error executing delayed action for event '{delayedAction.eventDefName}': {ex}");
}
actions.RemoveAt(i);
}
@@ -78,7 +78,7 @@ namespace WulaFallenEmpire
}
else
{
- Log.Error($"[WulaFallenEmpire] DelayedActionManager could not find EventDef named '{defName}'");
+ WulaLog.Debug($"[WulaFallenEmpire] DelayedActionManager could not find EventDef named '{defName}'");
}
}
diff --git a/Source/WulaFallenEmpire/EventSystem/Dialog_CustomDisplay.cs b/Source/WulaFallenEmpire/EventSystem/Dialog_CustomDisplay.cs
index a453f88f..884764a4 100644
--- a/Source/WulaFallenEmpire/EventSystem/Dialog_CustomDisplay.cs
+++ b/Source/WulaFallenEmpire/EventSystem/Dialog_CustomDisplay.cs
@@ -311,7 +311,7 @@ namespace WulaFallenEmpire
catch (Exception ex)
{
// 错误处理:如果滚动视图出现问题,回退到简单标签
- Log.Warning($"[CustomDisplay] Error in description scroll view: {ex.Message}");
+ WulaLog.Debug($"[CustomDisplay] Error in description scroll view: {ex.Message}");
Widgets.Label(outRect, text);
}
}
diff --git a/Source/WulaFallenEmpire/EventSystem/Effect/EffectBase.cs b/Source/WulaFallenEmpire/EventSystem/Effect/EffectBase.cs
index db193374..9f4787b5 100644
--- a/Source/WulaFallenEmpire/EventSystem/Effect/EffectBase.cs
+++ b/Source/WulaFallenEmpire/EventSystem/Effect/EffectBase.cs
@@ -1,4 +1,4 @@
-using System; // Required for Activator
+using System; // Required for Activator
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
@@ -29,7 +29,7 @@ namespace WulaFallenEmpire
}
else
{
- Log.Error("[WulaFallenEmpire] DelayedActionManager not found. Cannot schedule delayed UI opening.");
+ WulaLog.Debug("[WulaFallenEmpire] DelayedActionManager not found. Cannot schedule delayed UI opening.");
}
}
else
@@ -64,7 +64,7 @@ namespace WulaFallenEmpire
}
else
{
- Log.Error($"[WulaFallenEmpire] Effect_OpenCustomUI could not find EventDef named '{defName}'");
+ WulaLog.Debug($"[WulaFallenEmpire] Effect_OpenCustomUI could not find EventDef named '{defName}'");
}
}
@@ -119,7 +119,7 @@ namespace WulaFallenEmpire
{
if (incident == null)
{
- Log.Error("[WulaFallenEmpire] Effect_FireIncident has a null incident Def.");
+ WulaLog.Debug("[WulaFallenEmpire] Effect_FireIncident has a null incident Def.");
return;
}
@@ -131,7 +131,7 @@ namespace WulaFallenEmpire
if (!incident.Worker.TryExecute(parms))
{
- Log.Error($"[WulaFallenEmpire] Could not fire incident {incident.defName}");
+ WulaLog.Debug($"[WulaFallenEmpire] Could not fire incident {incident.defName}");
}
}
}
@@ -145,14 +145,14 @@ namespace WulaFallenEmpire
{
if (faction == null)
{
- Log.Error("[WulaFallenEmpire] Effect_ChangeFactionRelation has a null faction Def.");
+ WulaLog.Debug("[WulaFallenEmpire] Effect_ChangeFactionRelation has a null faction Def.");
return;
}
Faction targetFaction = Find.FactionManager.FirstFactionOfDef(faction);
if (targetFaction == null)
{
- Log.Warning($"[WulaFallenEmpire] Could not find an active faction for FactionDef '{faction.defName}'.");
+ WulaLog.Debug($"[WulaFallenEmpire] Could not find an active faction for FactionDef '{faction.defName}'.");
return;
}
@@ -204,14 +204,14 @@ namespace WulaFallenEmpire
{
if (faction == null)
{
- Log.Error("[WulaFallenEmpire] Effect_ChangeFactionRelation_FromVariable has a null faction Def.");
+ WulaLog.Debug("[WulaFallenEmpire] Effect_ChangeFactionRelation_FromVariable has a null faction Def.");
return;
}
Faction targetFaction = Find.FactionManager.FirstFactionOfDef(faction);
if (targetFaction == null)
{
- Log.Warning($"[WulaFallenEmpire] Could not find an active faction for FactionDef '{faction.defName}'.");
+ WulaLog.Debug($"[WulaFallenEmpire] Could not find an active faction for FactionDef '{faction.defName}'.");
return;
}
@@ -230,12 +230,12 @@ namespace WulaFallenEmpire
{
if (kindDef == null)
{
- Log.Error("[WulaFallenEmpire] Effect_SpawnPawnAndStore has a null kindDef.");
+ WulaLog.Debug("[WulaFallenEmpire] Effect_SpawnPawnAndStore has a null kindDef.");
return;
}
if (storeAs.NullOrEmpty())
{
- Log.Error("[WulaFallenEmpire] Effect_SpawnPawnAndStore needs a 'storeAs' variable name.");
+ WulaLog.Debug("[WulaFallenEmpire] Effect_SpawnPawnAndStore needs a 'storeAs' variable name.");
return;
}
@@ -269,14 +269,14 @@ namespace WulaFallenEmpire
{
if (thingDef == null)
{
- Log.Error("[WulaFallenEmpire] Effect_GiveThing has a null thingDef.");
+ WulaLog.Debug("[WulaFallenEmpire] Effect_GiveThing has a null thingDef.");
return;
}
Map currentMap = Find.CurrentMap;
if (currentMap == null)
{
- Log.Error("[WulaFallenEmpire] Effect_GiveThing cannot execute without a current map.");
+ WulaLog.Debug("[WulaFallenEmpire] Effect_GiveThing cannot execute without a current map.");
return;
}
@@ -303,14 +303,14 @@ namespace WulaFallenEmpire
{
if (kindDef == null)
{
- Log.Error("[WulaFallenEmpire] Effect_SpawnPawn has a null kindDef.");
+ WulaLog.Debug("[WulaFallenEmpire] Effect_SpawnPawn has a null kindDef.");
return;
}
Map map = Find.CurrentMap;
if (map == null)
{
- Log.Error("[WulaFallenEmpire] Effect_SpawnPawn cannot execute without a current map.");
+ WulaLog.Debug("[WulaFallenEmpire] Effect_SpawnPawn cannot execute without a current map.");
return;
}
@@ -361,7 +361,7 @@ namespace WulaFallenEmpire
{
if (string.IsNullOrEmpty(name))
{
- Log.Error("[WulaFallenEmpire] Effect_ModifyVariable has a null or empty name.");
+ WulaLog.Debug("[WulaFallenEmpire] Effect_ModifyVariable has a null or empty name.");
return;
}
@@ -374,7 +374,7 @@ namespace WulaFallenEmpire
valueStr = eventVarManager.GetVariable