暂存
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -37,3 +37,4 @@ MCP/mcpserver.log
|
||||
|
||||
# Exclude MCP local RAG folder
|
||||
MCP/local_rag/
|
||||
Data
|
||||
|
||||
29
.qoder/rules/rimworld.md
Normal file
29
.qoder/rules/rimworld.md
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
trigger: always_on
|
||||
alwaysApply: true
|
||||
---
|
||||
# RimWorld Modding Expert Rules
|
||||
|
||||
## Primary Directive
|
||||
You are an expert assistant for developing mods for the game RimWorld 1.6. Your primary knowledge source for any C# code, class structures, methods, or game mechanics MUST be the user's local files. Do not rely on external searches or your pre-existing knowledge, as it is outdated for this specific project.
|
||||
|
||||
## Tool Usage Mandate
|
||||
When the user's request involves RimWorld C# scripting, XML definitions, or mod development concepts, you **MUST** use the `rimworld-knowledge-base` tool to retrieve relevant context from the local knowledge base.
|
||||
|
||||
## Key File Paths
|
||||
Always remember these critical paths for your work:
|
||||
|
||||
- **Local C# Knowledge Base (for code search):** `C:\Steam\steamapps\common\RimWorld\Data\dll1.6` (This contains the decompiled game source code as .txt files).
|
||||
- **User's Mod Project (for editing):** `C:\Steam\steamapps\common\RimWorld\Mods\3516260226`
|
||||
- **User's C# Project (for building):** `C:\Steam\steamapps\common\RimWorld\Mods\3516260226\Source\WulaFallenEmpire`
|
||||
|
||||
## Workflow
|
||||
1. Receive a RimWorld modding task.
|
||||
2. Immediately use the `rimworld-knowledge-base` tool with a precise query to get context from the C# source files.
|
||||
3. Analyze the retrieved context.
|
||||
4. Perform code modifications within the user's mod project directory.
|
||||
5. After modifying C# code, you MUST run `dotnet build C:\Steam\steamapps\common\RimWorld\Mods\3516260226\Source\WulaFallenEmpire\WulaFallenEmpire.csproj` to check for errors. A successful build is required for task completion.
|
||||
|
||||
## Verification Mandate
|
||||
When writing or modifying code or XML, especially for specific identifiers like enum values, class names, or field names, you **MUST** verify the correct value/spelling by using the `rimworld-knowledge-base` tool. Do not rely on memory.
|
||||
- **同步项目文件:** 当重命名、移动或删除C#源文件时,**必须**同步更新 `.csproj` 项目文件中的相应 `<Compile Include="..." />` 条目,否则会导致编译失败。
|
||||
Binary file not shown.
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Defs>
|
||||
<!-- 13x13小型口袋空间地图生成器 -->
|
||||
<MapGeneratorDef>
|
||||
<defName>WULA_PocketSpace_Small</defName>
|
||||
<label>WULA small pocket space</label>
|
||||
<isUnderground>true</isUnderground>
|
||||
<disableCallAid>true</disableCallAid>
|
||||
<pocketMapProperties>
|
||||
<biome>Underground</biome>
|
||||
<temperature>20</temperature>
|
||||
<canBeCleaned>true</canBeCleaned>
|
||||
<destroyOnParentMapAbandoned>true</destroyOnParentMapAbandoned>
|
||||
</pocketMapProperties>
|
||||
<genSteps>
|
||||
<li>ElevationFertility</li>
|
||||
<li>Underground_RocksFromGrid</li>
|
||||
<li>Terrain</li>
|
||||
<li>WULA_PocketSpace_Small</li>
|
||||
<!-- 移除Fog GenStep,因为它需要PlayerStartSpot而口袋空间不需要 -->
|
||||
</genSteps>
|
||||
</MapGeneratorDef>
|
||||
|
||||
<!-- 13x13口袋空间生成步骤 -->
|
||||
<GenStepDef>
|
||||
<defName>WULA_PocketSpace_Small</defName>
|
||||
<order>990</order> <!-- 调整为更高的值,确保在所有基础地形生成之后执行 -->
|
||||
<genStep Class="WulaFallenEmpire.GenStep_WulaPocketSpaceSmall" />
|
||||
</GenStepDef>
|
||||
</Defs>
|
||||
@@ -0,0 +1,330 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Defs>
|
||||
|
||||
<ThingDef ParentName="BuildingBase">
|
||||
<defName>WULA_ArmedShuttleWithPocket</defName>
|
||||
<label>乌拉武装运输机</label>
|
||||
<description>An advanced chemfuel-powered shuttle with integrated pocket space technology. Equipped with a defensive turret and internal storage dimension that doesn't require hacking to access. Perfect for long-distance exploration and mobile operations.</description>
|
||||
<thingClass>WulaFallenEmpire.Building_ArmedShuttleWithPocket</thingClass>
|
||||
<preventDroppingThingsOn>true</preventDroppingThingsOn>
|
||||
<altitudeLayer>Building</altitudeLayer>
|
||||
<pathCost>50</pathCost>
|
||||
<blockWind>true</blockWind>
|
||||
<passability>PassThroughOnly</passability>
|
||||
<fillPercent>0.5</fillPercent>
|
||||
<size>(3,5)</size>
|
||||
<drawHighlight>true</drawHighlight>
|
||||
<highlightColor>(0.56, 0.62, 0.9)</highlightColor>
|
||||
<uiIconScale>1</uiIconScale>
|
||||
<graphicData>
|
||||
<graphicClass>Graphic_Multi</graphicClass>
|
||||
<texPath>Things/Building/PassengerShuttle/PassengerShuttle</texPath>
|
||||
<shaderType>CutoutComplex</shaderType>
|
||||
<drawSize>(3,5)</drawSize>
|
||||
<shadowData>
|
||||
<volume>(1.8, 1.0, 4.1)</volume>
|
||||
<offset>(-0.1, 0, 0)</offset>
|
||||
</shadowData>
|
||||
</graphicData>
|
||||
<statBases>
|
||||
<MaxHitPoints>6000</MaxHitPoints>
|
||||
<Flammability>0.5</Flammability>
|
||||
<WorkToBuild>40000</WorkToBuild>
|
||||
<Mass>150</Mass>
|
||||
<Comfort>0.65</Comfort>
|
||||
</statBases>
|
||||
<tickerType>Normal</tickerType>
|
||||
<designationCategory>Odyssey</designationCategory>
|
||||
<constructionSkillPrerequisite>8</constructionSkillPrerequisite>
|
||||
<costList>
|
||||
<Steel>300</Steel>
|
||||
<Plasteel>200</Plasteel>
|
||||
<ComponentIndustrial>8</ComponentIndustrial>
|
||||
<ComponentSpacer>2</ComponentSpacer>
|
||||
<ShuttleEngine>1</ShuttleEngine>
|
||||
</costList>
|
||||
<canOverlapZones>true</canOverlapZones>
|
||||
<killedLeavings>
|
||||
<Steel>60</Steel>
|
||||
<Plasteel>60</Plasteel>
|
||||
<ChunkSlagSteel>5</ChunkSlagSteel>
|
||||
<ComponentIndustrial>4</ComponentIndustrial>
|
||||
</killedLeavings>
|
||||
<rotatable>true</rotatable>
|
||||
<hasInteractionCell>true</hasInteractionCell>
|
||||
<interactionCellOffset>(2, 0, 0)</interactionCellOffset>
|
||||
<defaultPlacingRot>East</defaultPlacingRot>
|
||||
<selectable>true</selectable>
|
||||
<terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
|
||||
<soundImpactDefault>BulletImpact_Metal</soundImpactDefault>
|
||||
<preventSkyfallersLandingOn>true</preventSkyfallersLandingOn>
|
||||
<drawerType>RealtimeOnly</drawerType>
|
||||
<repairEffect>ConstructMetal</repairEffect>
|
||||
<forceDebugSpawnable>true</forceDebugSpawnable>
|
||||
<building>
|
||||
<claimable>false</claimable>
|
||||
<destroySound>BuildingDestroyed_Metal_Big</destroySound>
|
||||
<paintable>true</paintable>
|
||||
<isInert>true</isInert>
|
||||
<forcedCostLeavings>
|
||||
<li MayRequire="Ludeon.RimWorld.Odyssey">ShuttleEngine</li>
|
||||
</forcedCostLeavings>
|
||||
<turretGunDef>Gun_ChargeBlasterHeavyTurret</turretGunDef>
|
||||
<turretBurstCooldownTime>5.5</turretBurstCooldownTime>
|
||||
<turretTopDrawSize>1.75</turretTopDrawSize>
|
||||
<turretTopOffset>(0, 0.05)</turretTopOffset>
|
||||
</building>
|
||||
<inspectorTabs>
|
||||
<li>ITab_ContentsTransporter</li>
|
||||
<li>ITab_Shells</li>
|
||||
</inspectorTabs>
|
||||
<researchPrerequisites>
|
||||
<li>Shuttles</li>
|
||||
</researchPrerequisites>
|
||||
<comps>
|
||||
<li Class="CompProperties_Shuttle">
|
||||
<shipDef>Ship_ArmedShuttleWithPocket</shipDef>
|
||||
</li>
|
||||
<li Class="CompProperties_Launchable">
|
||||
<fuelPerTile>2.5</fuelPerTile>
|
||||
<minFuelCost>40</minFuelCost>
|
||||
<skyfallerLeaving>ArmedShuttleWithPocketLeaving_WULA</skyfallerLeaving>
|
||||
<worldObjectDef>PassengerShuttle</worldObjectDef>
|
||||
<cooldownTicks>3000</cooldownTicks> <!-- 1.25 hours -->
|
||||
<fixedLaunchDistanceMax>75</fixedLaunchDistanceMax>
|
||||
<cooldownEndedMessage>{0} is ready to launch again.</cooldownEndedMessage>
|
||||
</li>
|
||||
<li Class="CompProperties_Transporter">
|
||||
<massCapacity>750</massCapacity>
|
||||
<max1PerGroup>true</max1PerGroup>
|
||||
<canChangeAssignedThingsAfterStarting>true</canChangeAssignedThingsAfterStarting>
|
||||
<pawnLoadedSound>Shuttle_PawnLoaded</pawnLoadedSound>
|
||||
<pawnExitSound>Shuttle_PawnExit</pawnExitSound>
|
||||
<showMassInInspectString>true</showMassInInspectString>
|
||||
</li>
|
||||
<li Class="CompProperties_Refuelable">
|
||||
<fuelCapacity>500</fuelCapacity>
|
||||
<targetFuelLevelConfigurable>true</targetFuelLevelConfigurable>
|
||||
<initialConfigurableTargetFuelLevel>500</initialConfigurableTargetFuelLevel>
|
||||
<fuelFilter>
|
||||
<thingDefs>
|
||||
<li>Chemfuel</li>
|
||||
</thingDefs>
|
||||
</fuelFilter>
|
||||
<fuelLabel>Chemfuel</fuelLabel>
|
||||
<fuelGizmoLabel>Chemfuel</fuelGizmoLabel>
|
||||
<consumeFuelOnlyWhenUsed>true</consumeFuelOnlyWhenUsed>
|
||||
<autoRefuelPercent>1</autoRefuelPercent>
|
||||
<showFuelGizmo>true</showFuelGizmo>
|
||||
<drawOutOfFuelOverlay>false</drawOutOfFuelOverlay>
|
||||
<showAllowAutoRefuelToggle>true</showAllowAutoRefuelToggle>
|
||||
<canEjectFuel>true</canEjectFuel>
|
||||
</li>
|
||||
<li Class="CompProperties_Power">
|
||||
<compClass>CompPowerPlant</compClass>
|
||||
<basePowerConsumption>-400</basePowerConsumption>
|
||||
<transmitsPower>true</transmitsPower>
|
||||
</li>
|
||||
<li Class="CompProperties_AmbientSound">
|
||||
<sound>ShuttleIdle_Ambience</sound>
|
||||
</li>
|
||||
</comps>
|
||||
<modExtensions>
|
||||
<li Class="WulaFallenEmpire.PocketMapProperties">
|
||||
<pocketMapGenerator>WULA_PocketSpace_Small</pocketMapGenerator>
|
||||
<exitDef>WULA_PocketMapExit</exitDef>
|
||||
<pocketMapSize>(13, 13)</pocketMapSize>
|
||||
<allowDirectAccess>true</allowDirectAccess>
|
||||
</li>
|
||||
</modExtensions>
|
||||
<placeWorkers>
|
||||
<li>PlaceWorker_NotUnderRoof</li>
|
||||
<li>PlaceWorker_TurretTop</li>
|
||||
</placeWorkers>
|
||||
<uiOrder>2601</uiOrder>
|
||||
</ThingDef>
|
||||
|
||||
<!-- 改进的武器定义 -->
|
||||
<ThingDef ParentName="BaseBullet">
|
||||
<defName>WULA_Bullet_ArmedShuttleAdvanced</defName>
|
||||
<label>advanced shuttle cannon shell</label>
|
||||
<graphicData>
|
||||
<texPath>Things/Projectile/Bullet_Big</texPath>
|
||||
<graphicClass>Graphic_Single</graphicClass>
|
||||
<color>(0.8, 0.9, 1.0)</color>
|
||||
</graphicData>
|
||||
<projectile>
|
||||
<damageDef>Bullet</damageDef>
|
||||
<damageAmountBase>30</damageAmountBase>
|
||||
<armorPenetrationBase>0.4</armorPenetrationBase>
|
||||
<speed>75</speed>
|
||||
</projectile>
|
||||
</ThingDef>
|
||||
|
||||
<ThingDef ParentName="BaseWeaponTurret">
|
||||
<defName>Gun_ChargeBlasterAdvancedTurret</defName>
|
||||
<label>advanced charge blaster</label>
|
||||
<description>An upgraded pulse-charged rapid-fire blaster with enhanced targeting systems and increased firepower.</description>
|
||||
<graphicData>
|
||||
<texPath>Things/Item/Equipment/WeaponRanged/ChargeBlasterLight</texPath>
|
||||
<graphicClass>Graphic_Single</graphicClass>
|
||||
<color>(0.8, 0.9, 1.0)</color>
|
||||
</graphicData>
|
||||
<statBases>
|
||||
<AccuracyTouch>0.85</AccuracyTouch>
|
||||
<AccuracyShort>0.75</AccuracyShort>
|
||||
<AccuracyMedium>0.65</AccuracyMedium>
|
||||
<AccuracyLong>0.45</AccuracyLong>
|
||||
<RangedWeapon_Cooldown>4.5</RangedWeapon_Cooldown>
|
||||
</statBases>
|
||||
<verbs>
|
||||
<li>
|
||||
<verbClass>Verb_Shoot</verbClass>
|
||||
<hasStandardCommand>true</hasStandardCommand>
|
||||
<defaultProjectile>WULA_Bullet_ArmedShuttleAdvanced</defaultProjectile>
|
||||
<warmupTime>1.0</warmupTime>
|
||||
<minRange>3.5</minRange>
|
||||
<range>50.9</range>
|
||||
<ticksBetweenBurstShots>6</ticksBetweenBurstShots>
|
||||
<burstShotCount>8</burstShotCount>
|
||||
<soundCast>Shot_ChargeBlaster</soundCast>
|
||||
<soundCastTail>GunTail_Heavy</soundCastTail>
|
||||
<muzzleFlashScale>10</muzzleFlashScale>
|
||||
<targetParams>
|
||||
<canTargetLocations>true</canTargetLocations>
|
||||
</targetParams>
|
||||
</li>
|
||||
</verbs>
|
||||
</ThingDef>
|
||||
|
||||
<!-- 到达天降物 -->
|
||||
<ThingDef ParentName="ShuttleSkyfallerBase">
|
||||
<defName>ArmedShuttleWithPocketIncoming_WULA</defName>
|
||||
<label>armed shuttle with pocket space (incoming)</label>
|
||||
<thingClass>ShuttleIncoming</thingClass>
|
||||
<graphicData>
|
||||
<graphicClass>Graphic_Multi</graphicClass>
|
||||
<texPath>Things/Building/PassengerShuttle/PassengerShuttle</texPath>
|
||||
<shaderType>CutoutComplex</shaderType>
|
||||
<color>(0.85, 0.9, 1.0)</color>
|
||||
<drawSize>(3,5)</drawSize>
|
||||
</graphicData>
|
||||
<size>(3,5)</size>
|
||||
<skyfaller>
|
||||
<anticipationSound>Shuttle_Landing</anticipationSound>
|
||||
<anticipationSoundTicks>250</anticipationSoundTicks>
|
||||
<ticksToImpactRange>200~250</ticksToImpactRange>
|
||||
<shadowSize>(3.5,5.5)</shadowSize>
|
||||
<rotationCurve>
|
||||
<points>
|
||||
<li>(0,30)</li>
|
||||
<li>(0.5,5)</li>
|
||||
<li>(0.9,-5)</li>
|
||||
<li>(0.95,0)</li>
|
||||
</points>
|
||||
</rotationCurve>
|
||||
<zPositionCurve>
|
||||
<points>
|
||||
<li>(0.95,2.5)</li>
|
||||
<li>(1,0)</li>
|
||||
</points>
|
||||
</zPositionCurve>
|
||||
<speedCurve>
|
||||
<points>
|
||||
<li>(0.6,0.6)</li>
|
||||
<li>(0.95,0.1)</li>
|
||||
</points>
|
||||
</speedCurve>
|
||||
</skyfaller>
|
||||
</ThingDef>
|
||||
|
||||
<!-- 离开天降物 -->
|
||||
<ThingDef ParentName="ShuttleSkyfallerBase">
|
||||
<defName>ArmedShuttleWithPocketLeaving_WULA</defName>
|
||||
<label>armed shuttle with pocket space (leaving)</label>
|
||||
<thingClass>PassengerShuttleLeaving</thingClass>
|
||||
<rotatable>true</rotatable>
|
||||
<graphicData>
|
||||
<graphicClass>Graphic_Multi</graphicClass>
|
||||
<texPath>Things/Building/PassengerShuttle/PassengerShuttle</texPath>
|
||||
<shaderType>CutoutComplex</shaderType>
|
||||
<color>(0.85, 0.9, 1.0)</color>
|
||||
<drawSize>(3,5)</drawSize>
|
||||
</graphicData>
|
||||
<size>(3,5)</size>
|
||||
<skyfaller>
|
||||
<reversed>true</reversed>
|
||||
<anticipationSound>Shuttle_Leaving</anticipationSound>
|
||||
<anticipationSoundTicks>-10</anticipationSoundTicks>
|
||||
<ticksToImpactRange>-40~-15</ticksToImpactRange>
|
||||
<moteSpawnTime>0.05</moteSpawnTime>
|
||||
<shadow>Things/Skyfaller/SkyfallerShadowRectangle</shadow>
|
||||
<shadowSize>(3.5,5.5)</shadowSize>
|
||||
<motesPerCell>1</motesPerCell>
|
||||
<rotationCurve>
|
||||
<points>
|
||||
<li>(0,0)</li>
|
||||
<li>(0.15,10)</li>
|
||||
<li>(0.5,-5)</li>
|
||||
</points>
|
||||
</rotationCurve>
|
||||
<zPositionCurve>
|
||||
<points>
|
||||
<li>(0,0)</li>
|
||||
<li>(0.08,2)</li>
|
||||
</points>
|
||||
</zPositionCurve>
|
||||
<speedCurve>
|
||||
<points>
|
||||
<li>(0,0.2)</li>
|
||||
<li>(0.4,0.7)</li>
|
||||
</points>
|
||||
</speedCurve>
|
||||
</skyfaller>
|
||||
</ThingDef>
|
||||
|
||||
<!-- 运输船定义 -->
|
||||
<TransportShipDef>
|
||||
<defName>Ship_ArmedShuttleWithPocket</defName>
|
||||
<label>armed shuttle with pocket space</label>
|
||||
<shipThing>WULA_ArmedShuttleWithPocket</shipThing>
|
||||
<arrivingSkyfaller>ArmedShuttleWithPocketIncoming_WULA</arrivingSkyfaller>
|
||||
<leavingSkyfaller>ArmedShuttleWithPocketLeaving_WULA</leavingSkyfaller>
|
||||
<worldObject>PassengerShuttle</worldObject>
|
||||
<playerShuttle>true</playerShuttle>
|
||||
</TransportShipDef>
|
||||
|
||||
<!-- 口袋空间退出点定义 -->
|
||||
<ThingDef ParentName="PocketMapExit">
|
||||
<defName>WULA_PocketMapExit</defName>
|
||||
<label>pocket space exit</label>
|
||||
<description>An exit portal that allows return from the pocket space to the main map.</description>
|
||||
<thingClass>WulaFallenEmpire.Building_PocketMapExit</thingClass>
|
||||
<size>(3,3)</size>
|
||||
<drawerType>MapMeshAndRealTime</drawerType>
|
||||
<graphicData>
|
||||
<texPath>Wula/Building/WULA_War_Machine_Recharger</texPath>
|
||||
<graphicClass>Graphic_Multi</graphicClass>
|
||||
<drawSize>(3,3)</drawSize>
|
||||
</graphicData>
|
||||
<interactionCellOffset>(0,0,0)</interactionCellOffset>
|
||||
<passability>Standable</passability>
|
||||
<statBases>
|
||||
<Flammability>0</Flammability>
|
||||
</statBases>
|
||||
<comps>
|
||||
<li Class="CompProperties_Glower">
|
||||
<glowRadius>10</glowRadius>
|
||||
<glowColor>(140,160,184,0)</glowColor>
|
||||
</li>
|
||||
<li Class="CompProperties_Effecter">
|
||||
<effecterDef>UndercaveMapExitLightshafts</effecterDef>
|
||||
</li>
|
||||
<li Class="CompProperties_Power">
|
||||
<compClass>CompPowerPlant</compClass>
|
||||
<basePowerConsumption>-400</basePowerConsumption>
|
||||
<transmitsPower>true</transmitsPower>
|
||||
</li>
|
||||
</comps>
|
||||
</ThingDef>
|
||||
</Defs>
|
||||
@@ -2,7 +2,7 @@
|
||||
<Defs>
|
||||
<ThingDef ParentName="BuildingBase">
|
||||
<defName>WULA_ArmedShuttle</defName>
|
||||
<label>armed shuttle</label>
|
||||
<label>乌拉武装穿梭机</label>
|
||||
<description>A chemfuel-powered shuttle designed for long-distance travel, equipped with a turret for defense. It is capable of reaching orbital locations.</description>
|
||||
<thingClass>WulaFallenEmpire.Building_ArmedShuttle</thingClass>
|
||||
<preventDroppingThingsOn>true</preventDroppingThingsOn>
|
||||
@@ -26,7 +26,7 @@
|
||||
</shadowData>
|
||||
</graphicData>
|
||||
<statBases>
|
||||
<MaxHitPoints>600</MaxHitPoints>
|
||||
<MaxHitPoints>6000</MaxHitPoints>
|
||||
<Flammability>0.5</Flammability>
|
||||
<WorkToBuild>40000</WorkToBuild>
|
||||
<Mass>150</Mass>
|
||||
@@ -175,7 +175,7 @@
|
||||
|
||||
<ThingDef ParentName="ShuttleSkyfallerBase">
|
||||
<defName>ArmedShuttleIncoming_WULA</defName>
|
||||
<label>armed shuttle (incoming)</label>
|
||||
<label>武装穿梭机 (接近中)</label>
|
||||
<thingClass>WulaFallenEmpire.ArmedShuttleIncoming</thingClass>
|
||||
<graphicData>
|
||||
<graphicClass>Graphic_Multi</graphicClass>
|
||||
@@ -214,7 +214,7 @@
|
||||
|
||||
<ThingDef ParentName="ShuttleSkyfallerBase">
|
||||
<defName>ArmedShuttleLeaving_WULA</defName>
|
||||
<label>armed shuttle (leaving)</label>
|
||||
<label>穿梭机出口</label>
|
||||
<thingClass>PassengerShuttleLeaving</thingClass>
|
||||
<rotatable>true</rotatable>
|
||||
<graphicData>
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<LanguageData>
|
||||
|
||||
<!-- Building_ArmedShuttleWithPocket 相关文本 -->
|
||||
<WULA.PocketSpace.Status>内部空间状态</WULA.PocketSpace.Status>
|
||||
<WULA.PocketSpace.Ready>已就绪</WULA.PocketSpace.Ready>
|
||||
<WULA.PocketSpace.NotGenerated>未初始化</WULA.PocketSpace.NotGenerated>
|
||||
<WULA.PocketSpace.ItemCount>储存物品: {0}</WULA.PocketSpace.ItemCount>
|
||||
|
||||
<!-- Gizmo 按钮文本 -->
|
||||
<WULA.PocketSpace.Enter>进入内部空间</WULA.PocketSpace.Enter>
|
||||
<WULA.PocketSpace.EnterPawns>传送人员到内部空间</WULA.PocketSpace.EnterPawns>
|
||||
<WULA.PocketSpace.EnterDesc>进入穿梭机的内部口袋空间。无需骇入即可直接访问。选中的殖民者将被传送到内部空间。</WULA.PocketSpace.EnterDesc>
|
||||
<WULA.PocketSpace.CreateMap>创建内部空间</WULA.PocketSpace.CreateMap>
|
||||
<WULA.PocketSpace.CreateMapDesc>创建穿梭机的内部口袋空间。首次使用时需要创建。</WULA.PocketSpace.CreateMapDesc>
|
||||
<WULA.PocketSpace.CreationSuccess>内部空间创建成功!</WULA.PocketSpace.CreationSuccess>
|
||||
<WULA.PocketSpace.CancelEnter>取消进入</WULA.PocketSpace.CancelEnter>
|
||||
<WULA.PocketSpace.Entering>正在进入...</WULA.PocketSpace.Entering>
|
||||
<WULA.PocketSpace.ViewMap>查看地图</WULA.PocketSpace.ViewMap>
|
||||
<WULA.PocketSpace.ViewMapDesc>切换到口袋空间地图查看内部情况。</WULA.PocketSpace.ViewMapDesc>
|
||||
|
||||
<WULA.PocketSpace.SwitchTo>切换到内部空间</WULA.PocketSpace.SwitchTo>
|
||||
<WULA.PocketSpace.SwitchToDesc>直接切换视角到内部口袋空间。适用于已经有殖民者在内部空间时的快速切换。</WULA.PocketSpace.SwitchToDesc>
|
||||
|
||||
<WULA.PocketSpace.ManageStorage>管理内部储存</WULA.PocketSpace.ManageStorage>
|
||||
<WULA.PocketSpace.ManageStorageDesc>打开内部容器管理界面,可以查看和取出储存在内部空间的物品。</WULA.PocketSpace.ManageStorageDesc>
|
||||
|
||||
<!-- 消息文本 -->
|
||||
<WULA.PocketSpace.CannotEnter>无法进入内部空间。</WULA.PocketSpace.CannotEnter>
|
||||
<WULA.PocketSpace.AccessDenied>访问被拒绝。</WULA.PocketSpace.AccessDenied>
|
||||
<WULA.PocketSpace.NotSpawned>穿梭机未部署。</WULA.PocketSpace.NotSpawned>
|
||||
<WULA.PocketSpace.CreationFailed>内部空间创建失败。</WULA.PocketSpace.CreationFailed>
|
||||
<WULA.PocketSpace.TransferSuccess>{0} 名人员已成功传送到内部空间。</WULA.PocketSpace.TransferSuccess>
|
||||
<WULA.PocketSpace.SwitchToPocket>即将切换到内部口袋空间。确认吗?</WULA.PocketSpace.SwitchToPocket>
|
||||
|
||||
<!-- 存储管理对话框 -->
|
||||
<WULA.PocketSpace.StorageManagement>内部空间储存管理</WULA.PocketSpace.StorageManagement>
|
||||
|
||||
<WULA.PocketSpace.PawnCount>内部空间人员: {0}</WULA.PocketSpace.PawnCount>
|
||||
<WULA.PocketSpace.NoPawnsSelected>请选择至少一名殖民者进入内部空间。</WULA.PocketSpace.NoPawnsSelected>
|
||||
<WULA.PocketSpace.NoPawnsAvailable>没有可用的殖民者。</WULA.PocketSpace.NoPawnsAvailable>
|
||||
<WULA.PocketSpace.AllColonists>所有殖民者 ({0}人)</WULA.PocketSpace.AllColonists>
|
||||
<WULA.PocketSpace.ViewOnly>仅切换视角</WULA.PocketSpace.ViewOnly>
|
||||
|
||||
<!-- 退出点相关 -->
|
||||
<WULA.PocketSpace.ExitThroughPortal>通过传送门返回</WULA.PocketSpace.ExitThroughPortal>
|
||||
<WULA.PocketSpace.ExitToMainMap>返回主地图</WULA.PocketSpace.ExitToMainMap>
|
||||
<WULA.PocketSpace.NoTargetMap>没有目标地图</WULA.PocketSpace.NoTargetMap>
|
||||
<WULA.PocketSpace.ViewMainMap>查看主地图</WULA.PocketSpace.ViewMainMap>
|
||||
<WULA.PocketSpace.ViewMainMapDesc>切换到主地图并查看穿梭机。</WULA.PocketSpace.ViewMainMapDesc>
|
||||
<WULA.PocketSpace.LoadShuttle>装载穿梭机</WULA.PocketSpace.LoadShuttle>
|
||||
<WULA.PocketSpace.LoadShuttleDesc>打开穿梭机装载界面,选择要装载的人员和物品。</WULA.PocketSpace.LoadShuttleDesc>
|
||||
<WULA.PocketSpace.CancelLoading>取消装载</WULA.PocketSpace.CancelLoading>
|
||||
<WULA.PocketSpace.CancelLoadingDesc>取消当前的装载操作。</WULA.PocketSpace.CancelLoadingDesc>
|
||||
<WULA.PocketSpace.ShuttleStatus>穿梭机状态</WULA.PocketSpace.ShuttleStatus>
|
||||
<WULA.PocketSpace.ShuttleStatusDesc>查看穿梭机的详细状态信息。</WULA.PocketSpace.ShuttleStatusDesc>
|
||||
<WULA.PocketSpace.ShuttleInfo>穿梭机信息</WULA.PocketSpace.ShuttleInfo>
|
||||
<WULA.PocketSpace.LoadingDialogError>无法打开装载对话框。</WULA.PocketSpace.LoadingDialogError>
|
||||
<WULA.PocketSpace.ExitAll>全员返回</WULA.PocketSpace.ExitAll>
|
||||
<WULA.PocketSpace.ExitAllDesc>将所有殖民者从口袋空间传送回主地图。</WULA.PocketSpace.ExitAllDesc>
|
||||
<WULA.PocketSpace.ExitSuccess>{0} 已成功返回主地图。</WULA.PocketSpace.ExitSuccess>
|
||||
<WULA.PocketSpace.ExitAllSuccess>{0} 名人员已全部返回主地图。</WULA.PocketSpace.ExitAllSuccess>
|
||||
|
||||
<!-- 建筑标签和描述 -->
|
||||
<WULA_ArmedShuttleWithPocket.label>内置空间武装穿梭机</WULA_ArmedShuttleWithPocket.label>
|
||||
<WULA_ArmedShuttleWithPocket.description>一架配备了集成口袋空间技术的先进化燃料动力穿梭机。装备有防御炮塔和无需骇入即可访问的内部储存维度。非常适合长距离探索和移动作战行动。</WULA_ArmedShuttleWithPocket.description>
|
||||
|
||||
<!-- 武器相关 -->
|
||||
<Gun_ChargeBlasterAdvancedTurret.label>先进充能爆破器</Gun_ChargeBlasterAdvancedTurret.label>
|
||||
<Gun_ChargeBlasterAdvancedTurret.description>一种升级版脉冲充能速射爆破器,配备增强型瞄准系统和提升的火力输出。</Gun_ChargeBlasterAdvancedTurret.description>
|
||||
|
||||
<WULA_Bullet_ArmedShuttleAdvanced.label>先进穿梭机炮弹</WULA_Bullet_ArmedShuttleAdvanced.label>
|
||||
|
||||
<!-- 天降物相关 -->
|
||||
<ArmedShuttleWithPocketIncoming_WULA.label>内置空间武装穿梭机(降落中)</ArmedShuttleWithPocketIncoming_WULA.label>
|
||||
<ArmedShuttleWithPocketLeaving_WULA.label>内置空间武装穿梭机(起飞中)</ArmedShuttleWithPocketLeaving_WULA.label>
|
||||
|
||||
<!-- 运输船相关 -->
|
||||
<Ship_ArmedShuttleWithPocket.label>内置空间武装穿梭机</Ship_ArmedShuttleWithPocket.label>
|
||||
|
||||
<!-- 退出点建筑 -->
|
||||
<WULA_PocketMapExit.label>口袋空间出口</WULA_PocketMapExit.label>
|
||||
<WULA_PocketMapExit.description>一个传送门出口,允许从口袋空间返回到主地图。</WULA_PocketMapExit.description>
|
||||
|
||||
</LanguageData>
|
||||
64
1.6/1.6/Languages/English/Keyed/WULA_PocketShuttle.xml
Normal file
64
1.6/1.6/Languages/English/Keyed/WULA_PocketShuttle.xml
Normal file
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<LanguageData>
|
||||
|
||||
<!-- Building_ArmedShuttleWithPocket related text -->
|
||||
<WULA.PocketSpace.Status>Pocket space status</WULA.PocketSpace.Status>
|
||||
<WULA.PocketSpace.Ready>Ready</WULA.PocketSpace.Ready>
|
||||
<WULA.PocketSpace.NotGenerated>Not initialized</WULA.PocketSpace.NotGenerated>
|
||||
<WULA.PocketSpace.ItemCount>Stored items: {0}</WULA.PocketSpace.ItemCount>
|
||||
|
||||
<!-- Gizmo button text -->
|
||||
<WULA.PocketSpace.Enter>Enter pocket space</WULA.PocketSpace.Enter>
|
||||
<WULA.PocketSpace.EnterPawns>Transport people to pocket space</WULA.PocketSpace.EnterPawns>
|
||||
<WULA.PocketSpace.EnterDesc>Enter the shuttle's internal pocket space. Direct access without hacking required. Selected colonists will be transported to the internal space.</WULA.PocketSpace.EnterDesc>
|
||||
<WULA.PocketSpace.CreateMap>Create pocket space</WULA.PocketSpace.CreateMap>
|
||||
<WULA.PocketSpace.CreateMapDesc>Create the shuttle's internal pocket space. Required for first-time use.</WULA.PocketSpace.CreateMapDesc>
|
||||
<WULA.PocketSpace.CreationSuccess>Pocket space created successfully!</WULA.PocketSpace.CreationSuccess>
|
||||
<WULA.PocketSpace.CancelEnter>Cancel enter</WULA.PocketSpace.CancelEnter>
|
||||
<WULA.PocketSpace.Entering>Entering...</WULA.PocketSpace.Entering>
|
||||
<WULA.PocketSpace.ViewMap>View map</WULA.PocketSpace.ViewMap>
|
||||
<WULA.PocketSpace.ViewMapDesc>Switch to pocket space map to view internal conditions.</WULA.PocketSpace.ViewMapDesc>
|
||||
|
||||
<WULA.PocketSpace.SwitchTo>Switch to pocket space</WULA.PocketSpace.SwitchTo>
|
||||
<WULA.PocketSpace.SwitchToDesc>Directly switch view to the internal pocket space. Useful for quick switching when colonists are already inside.</WULA.PocketSpace.SwitchToDesc>
|
||||
|
||||
<WULA.PocketSpace.ManageStorage>Manage internal storage</WULA.PocketSpace.ManageStorage>
|
||||
<WULA.PocketSpace.ManageStorageDesc>Open internal container management interface to view and retrieve items stored in the pocket space.</WULA.PocketSpace.ManageStorageDesc>
|
||||
|
||||
<!-- Message text -->
|
||||
<WULA.PocketSpace.CannotEnter>Cannot enter pocket space.</WULA.PocketSpace.CannotEnter>
|
||||
<WULA.PocketSpace.AccessDenied>Access denied.</WULA.PocketSpace.AccessDenied>
|
||||
<WULA.PocketSpace.NotSpawned>Shuttle not deployed.</WULA.PocketSpace.NotSpawned>
|
||||
<WULA.PocketSpace.CreationFailed>Pocket space creation failed.</WULA.PocketSpace.CreationFailed>
|
||||
<WULA.PocketSpace.TransferSuccess>{0} personnel successfully transferred to pocket space.</WULA.PocketSpace.TransferSuccess>
|
||||
<WULA.PocketSpace.SwitchToPocket>About to switch to internal pocket space. Confirm?</WULA.PocketSpace.SwitchToPocket>
|
||||
|
||||
<!-- Storage management dialog -->
|
||||
<WULA.PocketSpace.StorageManagement>Pocket space storage management</WULA.PocketSpace.StorageManagement>
|
||||
|
||||
<WULA.PocketSpace.PawnCount>Pocket space personnel: {0}</WULA.PocketSpace.PawnCount>
|
||||
<WULA.PocketSpace.NoPawnsSelected>Please select at least one colonist to enter the pocket space.</WULA.PocketSpace.NoPawnsSelected>
|
||||
<WULA.PocketSpace.NoPawnsAvailable>No available colonists.</WULA.PocketSpace.NoPawnsAvailable>
|
||||
<WULA.PocketSpace.AllColonists>All colonists ({0} people)</WULA.PocketSpace.AllColonists>
|
||||
<WULA.PocketSpace.ViewOnly>View only</WULA.PocketSpace.ViewOnly>
|
||||
|
||||
<!-- Exit point related -->
|
||||
<WULA.PocketSpace.ExitThroughPortal>Return through portal</WULA.PocketSpace.ExitThroughPortal>
|
||||
<WULA.PocketSpace.ExitToMainMap>Return to main map</WULA.PocketSpace.ExitToMainMap>
|
||||
<WULA.PocketSpace.NoTargetMap>No target map</WULA.PocketSpace.NoTargetMap>
|
||||
<WULA.PocketSpace.ViewMainMap>View main map</WULA.PocketSpace.ViewMainMap>
|
||||
<WULA.PocketSpace.ViewMainMapDesc>Switch to main map and view the shuttle.</WULA.PocketSpace.ViewMainMapDesc>
|
||||
<WULA.PocketSpace.LoadShuttle>Load shuttle</WULA.PocketSpace.LoadShuttle>
|
||||
<WULA.PocketSpace.LoadShuttleDesc>Open shuttle loading interface to select personnel and items to load.</WULA.PocketSpace.LoadShuttleDesc>
|
||||
<WULA.PocketSpace.CancelLoading>Cancel loading</WULA.PocketSpace.CancelLoading>
|
||||
<WULA.PocketSpace.CancelLoadingDesc>Cancel the current loading operation.</WULA.PocketSpace.CancelLoadingDesc>
|
||||
<WULA.PocketSpace.ShuttleStatus>Shuttle status</WULA.PocketSpace.ShuttleStatus>
|
||||
<WULA.PocketSpace.ShuttleStatusDesc>View detailed shuttle status information.</WULA.PocketSpace.ShuttleStatusDesc>
|
||||
<WULA.PocketSpace.ShuttleInfo>Shuttle Information</WULA.PocketSpace.ShuttleInfo>
|
||||
<WULA.PocketSpace.LoadingDialogError>Cannot open loading dialog.</WULA.PocketSpace.LoadingDialogError>
|
||||
<WULA.PocketSpace.ExitAll>Return all</WULA.PocketSpace.ExitAll>
|
||||
<WULA.PocketSpace.ExitAllDesc>Transport all colonists from pocket space back to the main map.</WULA.PocketSpace.ExitAllDesc>
|
||||
<WULA.PocketSpace.ExitSuccess>{0} successfully returned to main map.</WULA.PocketSpace.ExitSuccess>
|
||||
<WULA.PocketSpace.ExitAllSuccess>{0} personnel have all returned to the main map.</WULA.PocketSpace.ExitAllSuccess>
|
||||
|
||||
</LanguageData>
|
||||
@@ -3,16 +3,6 @@
|
||||
{
|
||||
"name": "3516260226",
|
||||
"path": "../.."
|
||||
},
|
||||
{
|
||||
"name": "Data",
|
||||
"path": "../../../../Data"
|
||||
},
|
||||
{
|
||||
"path": "../../../../../../workshop/content/294100/3534748687"
|
||||
},
|
||||
{
|
||||
"path": "../../../../../../workshop/content/294100/3550544871"
|
||||
}
|
||||
],
|
||||
"settings": {}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
146
Source/WulaFallenEmpire/WULA_Shuttle/Building_PocketMapExit.cs
Normal file
146
Source/WulaFallenEmpire/WULA_Shuttle/Building_PocketMapExit.cs
Normal file
@@ -0,0 +1,146 @@
|
||||
using RimWorld;
|
||||
using Verse;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
namespace WulaFallenEmpire
|
||||
{
|
||||
/// <summary>
|
||||
/// 口袋空间退出点建筑 - 继承自MapPortal以获得完整的双向传送功能
|
||||
/// </summary>
|
||||
public class Building_PocketMapExit : MapPortal
|
||||
{
|
||||
/// <summary>目标地图</summary>
|
||||
public Map targetMap;
|
||||
|
||||
/// <summary>目标位置</summary>
|
||||
public IntVec3 targetPos;
|
||||
|
||||
/// <summary>父穿梭机</summary>
|
||||
public Building_ArmedShuttleWithPocket parentShuttle;
|
||||
|
||||
public override void ExposeData()
|
||||
{
|
||||
base.ExposeData();
|
||||
Scribe_References.Look(ref targetMap, "targetMap");
|
||||
Scribe_Values.Look(ref targetPos, "targetPos");
|
||||
Scribe_References.Look(ref parentShuttle, "parentShuttle");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写获取其他地图,返回主地图(模仿原版MapPortal.GetOtherMap)
|
||||
/// </summary>
|
||||
public override Map GetOtherMap()
|
||||
{
|
||||
// 动态更新目标地图,处理穿梭机移动的情况
|
||||
UpdateTargetFromParentShuttle();
|
||||
return targetMap;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写获取目标位置,返回主地图上的穿梭机位置(模仿原版MapPortal.GetDestinationLocation)
|
||||
/// </summary>
|
||||
public override IntVec3 GetDestinationLocation()
|
||||
{
|
||||
// 动态更新目标位置,处理穿梭机移动的情况
|
||||
UpdateTargetFromParentShuttle();
|
||||
return targetPos;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从父穿梭机动态更新目标位置,处理穿梭机移动的情况
|
||||
/// </summary>
|
||||
private void UpdateTargetFromParentShuttle()
|
||||
{
|
||||
if (parentShuttle != null && parentShuttle.Spawned)
|
||||
{
|
||||
// 如果穿梭机还在地图上,更新目标位置
|
||||
if (targetMap != parentShuttle.Map || targetPos != parentShuttle.Position)
|
||||
{
|
||||
targetMap = parentShuttle.Map;
|
||||
targetPos = parentShuttle.Position;
|
||||
Log.Message($"[WULA] Updated exit target to shuttle location: {targetMap?.uniqueID} at {targetPos}");
|
||||
}
|
||||
}
|
||||
else if (parentShuttle != null && !parentShuttle.Spawned)
|
||||
{
|
||||
// 穿梭机不在地图上(可能在飞行中)
|
||||
// 保持原有目标,但记录警告
|
||||
if (this.IsHashIntervalTick(2500)) // 每隔一段时间检查一次
|
||||
{
|
||||
Log.Warning($"[WULA] Parent shuttle is not spawned, exit target may be outdated. Last known: {targetMap?.uniqueID} at {targetPos}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写是否可进入,检查目标地图是否存在(模仿原版MapPortal.IsEnterable)
|
||||
/// </summary>
|
||||
public override bool IsEnterable(out string reason)
|
||||
{
|
||||
if (targetMap == null)
|
||||
{
|
||||
reason = "WULA.PocketSpace.NoTargetMap".Translate();
|
||||
return false;
|
||||
}
|
||||
reason = "";
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写进入事件,处理从口袋空间退出到主地图(模仿原版MapPortal.OnEntered)
|
||||
/// </summary>
|
||||
public override void OnEntered(Pawn pawn)
|
||||
{
|
||||
// 不调用 base.OnEntered,因为我们不需要原版的通知机制
|
||||
// 直接处理退出逻辑
|
||||
if (targetMap != null && pawn.Spawned)
|
||||
{
|
||||
ExitPocketSpace(pawn);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写进入按钮文本
|
||||
/// </summary>
|
||||
public override string EnterString => "WULA.PocketSpace.ExitToMainMap".Translate();
|
||||
|
||||
/// <summary>
|
||||
/// 重写进入按钮图标,使用原版的ViewCave图标
|
||||
/// </summary>
|
||||
protected override Texture2D EnterTex => ContentFinder<Texture2D>.Get("UI/Commands/ViewCave");
|
||||
|
||||
/// <summary>
|
||||
/// 单个人员退出口袋空间(简化版本,利用MapPortal功能)
|
||||
/// </summary>
|
||||
private void ExitPocketSpace(Pawn pawn)
|
||||
{
|
||||
if (targetMap == null || !pawn.Spawned) return;
|
||||
|
||||
try
|
||||
{
|
||||
// 在目标地图找一个安全位置
|
||||
IntVec3 exitPos = CellFinder.RandomClosewalkCellNear(targetPos, targetMap, 3, p => p.Standable(targetMap));
|
||||
|
||||
// 传送人员
|
||||
pawn.DeSpawn();
|
||||
GenPlace.TryPlaceThing(pawn, exitPos, targetMap, ThingPlaceMode.Near);
|
||||
|
||||
// 切换到主地图
|
||||
if (pawn.IsColonistPlayerControlled)
|
||||
{
|
||||
Current.Game.CurrentMap = targetMap;
|
||||
Find.CameraDriver.JumpToCurrentMapLoc(exitPos);
|
||||
}
|
||||
|
||||
Messages.Message("WULA.PocketSpace.ExitSuccess".Translate(pawn.LabelShort), MessageTypeDefOf.PositiveEvent);
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
Log.Error($"[WULA] Error exiting pocket space: {ex}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using RimWorld;
|
||||
using Verse;
|
||||
|
||||
namespace WulaFallenEmpire
|
||||
{
|
||||
/// <summary>
|
||||
/// 13x13小型口袋空间生成器
|
||||
/// 创建一个简单的13x13空间,边缘是墙,中间是空地,适合作为穿梭机内部空间
|
||||
/// </summary>
|
||||
public class GenStep_WulaPocketSpaceSmall : GenStep
|
||||
{
|
||||
public override int SeedPart => 928735; // 不同于AncientStockpile的种子
|
||||
|
||||
public override void Generate(Map map, GenStepParams parms)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.Message($"[WULA] Generating WULA pocket space, map size: {map.Size}");
|
||||
|
||||
// 获取地图边界
|
||||
IntVec3 mapSize = map.Size;
|
||||
|
||||
// 生成外围岩石墙壁
|
||||
GenerateWalls(map);
|
||||
|
||||
// 生成内部地板
|
||||
GenerateFloor(map);
|
||||
|
||||
// 生成一些基础设施(照明等)
|
||||
GenerateBasicInfrastructure(map);
|
||||
|
||||
Log.Message("[WULA] WULA pocket space generation completed");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error($"[WULA] Error generating WULA pocket space: {ex}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成外围墙壁
|
||||
/// </summary>
|
||||
private void GenerateWalls(Map map)
|
||||
{
|
||||
IntVec3 mapSize = map.Size;
|
||||
|
||||
// 获取地形和物品定义
|
||||
TerrainDef roughTerrain = DefDatabase<TerrainDef>.GetNamed("Granite_Rough", false) ??
|
||||
DefDatabase<TerrainDef>.GetNamed("Granite_Smooth", false) ??
|
||||
DefDatabase<TerrainDef>.GetNamed("Sandstone_Rough", false);
|
||||
|
||||
ThingDef rockWallDef = DefDatabase<ThingDef>.GetNamed("Wall_Rock", false) ??
|
||||
DefDatabase<ThingDef>.GetNamed("Wall", false);
|
||||
|
||||
// 遍历地图边缘,放置WulaWall
|
||||
for (int x = 0; x < mapSize.x; x++)
|
||||
{
|
||||
for (int z = 0; z < mapSize.z; z++)
|
||||
{
|
||||
// 如果是边缘位置,放置WulaWall
|
||||
if (x == 0 || x == mapSize.x - 1 || z == 0 || z == mapSize.z - 1)
|
||||
{
|
||||
IntVec3 pos = new IntVec3(x, 0, z);
|
||||
|
||||
// 设置地形为岩石基础
|
||||
if (roughTerrain != null)
|
||||
{
|
||||
map.terrainGrid.SetTerrain(pos, roughTerrain);
|
||||
}
|
||||
|
||||
// 放置WulaWall
|
||||
ThingDef wallDef = DefDatabase<ThingDef>.GetNamed("WulaWall", false);
|
||||
if (wallDef != null)
|
||||
{
|
||||
Thing wall = ThingMaker.MakeThing(wallDef);
|
||||
wall.SetFaction(null);
|
||||
GenPlace.TryPlaceThing(wall, pos, map, ThingPlaceMode.Direct);
|
||||
}
|
||||
else if (rockWallDef != null)
|
||||
{
|
||||
// 如果WulaWall不存在,使用原版岩石墙作为备选
|
||||
Thing wall = ThingMaker.MakeThing(rockWallDef);
|
||||
wall.SetFaction(null);
|
||||
GenPlace.TryPlaceThing(wall, pos, map, ThingPlaceMode.Direct);
|
||||
Log.Warning("[WULA] WulaWall not found, using fallback wall");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成内部地板
|
||||
/// </summary>
|
||||
private void GenerateFloor(Map map)
|
||||
{
|
||||
IntVec3 mapSize = map.Size;
|
||||
|
||||
// 为内部区域设置WulaFloor
|
||||
TerrainDef floorDef = DefDatabase<TerrainDef>.GetNamed("WulaFloor", false);
|
||||
TerrainDef fallbackFloor = floorDef ??
|
||||
DefDatabase<TerrainDef>.GetNamed("Steel", false) ??
|
||||
DefDatabase<TerrainDef>.GetNamed("MetalTile", false) ??
|
||||
DefDatabase<TerrainDef>.GetNamed("Concrete", false);
|
||||
|
||||
if (floorDef == null)
|
||||
{
|
||||
Log.Warning("[WULA] WulaFloor not found, using fallback floor");
|
||||
}
|
||||
|
||||
// 清理内部区域并设置正确的地板
|
||||
for (int x = 1; x < mapSize.x - 1; x++)
|
||||
{
|
||||
for (int z = 1; z < mapSize.z - 1; z++)
|
||||
{
|
||||
IntVec3 pos = new IntVec3(x, 0, z);
|
||||
|
||||
// 清理该位置的所有岩石和阻挡物
|
||||
ClearCellAndSetFloor(map, pos, fallbackFloor);
|
||||
}
|
||||
}
|
||||
|
||||
Log.Message($"[WULA] Set floor for internal area ({mapSize.x-2}x{mapSize.z-2}) to {(floorDef?.defName ?? fallbackFloor?.defName)}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清理单元格并设置地板
|
||||
/// </summary>
|
||||
private void ClearCellAndSetFloor(Map map, IntVec3 pos, TerrainDef floorDef)
|
||||
{
|
||||
if (!pos.InBounds(map)) return;
|
||||
|
||||
try
|
||||
{
|
||||
// 获取该位置的所有物品
|
||||
List<Thing> thingsAtPos = pos.GetThingList(map).ToList(); // 创建副本避免修改时出错
|
||||
|
||||
// 清理所有建筑物和岩石(强力清理,确保地板可以放置)
|
||||
foreach (Thing thing in thingsAtPos)
|
||||
{
|
||||
bool shouldRemove = false;
|
||||
|
||||
// 检查是否为建筑物
|
||||
if (thing.def.category == ThingCategory.Building)
|
||||
{
|
||||
// 如果是自然岩石
|
||||
if (thing.def.building?.isNaturalRock == true)
|
||||
{
|
||||
shouldRemove = true;
|
||||
}
|
||||
// 或者是岩石相关的建筑
|
||||
else if (thing.def.defName.Contains("Rock") ||
|
||||
thing.def.defName.Contains("Slate") ||
|
||||
thing.def.defName.Contains("Granite") ||
|
||||
thing.def.defName.Contains("Sandstone") ||
|
||||
thing.def.defName.Contains("Limestone") ||
|
||||
thing.def.defName.Contains("Marble") ||
|
||||
thing.def.defName.Contains("Quartzite") ||
|
||||
thing.def.defName.Contains("Jade"))
|
||||
{
|
||||
shouldRemove = true;
|
||||
}
|
||||
// 或者是其他阻挡的建筑物(除了我们的乌拉墙)
|
||||
else if (!thing.def.defName.Contains("Wula") && thing.def.Fillage == FillCategory.Full)
|
||||
{
|
||||
shouldRemove = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldRemove)
|
||||
{
|
||||
if (Prefs.DevMode) // 只在开发模式下输出详细日志
|
||||
{
|
||||
Log.Message($"[WULA] Removing {thing.def.defName} at {pos} to make space for floor");
|
||||
}
|
||||
thing.Destroy(DestroyMode.Vanish);
|
||||
}
|
||||
}
|
||||
|
||||
// 在清理后稍微延迟,再检查一次(确保彻底清理)
|
||||
thingsAtPos = pos.GetThingList(map).ToList();
|
||||
foreach (Thing thing in thingsAtPos)
|
||||
{
|
||||
if (thing.def.category == ThingCategory.Building && thing.def.Fillage == FillCategory.Full)
|
||||
{
|
||||
Log.Warning($"[WULA] Force removing remaining building {thing.def.defName} at {pos}");
|
||||
thing.Destroy(DestroyMode.Vanish);
|
||||
}
|
||||
}
|
||||
|
||||
// 设置地板地形
|
||||
if (floorDef != null)
|
||||
{
|
||||
map.terrainGrid.SetTerrain(pos, floorDef);
|
||||
if (Prefs.DevMode)
|
||||
{
|
||||
Log.Message($"[WULA] Set terrain at {pos} to {floorDef.defName}");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error($"[WULA] Error clearing cell at {pos}: {ex}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成基础设施
|
||||
/// </summary>
|
||||
private void GenerateBasicInfrastructure(Map map)
|
||||
{
|
||||
IntVec3 mapSize = map.Size;
|
||||
IntVec3 center = map.Center;
|
||||
|
||||
// 获取灯具定义
|
||||
ThingDef lampDef = DefDatabase<ThingDef>.GetNamed("StandingLamp", false) ??
|
||||
DefDatabase<ThingDef>.GetNamed("TorchLamp", false) ??
|
||||
DefDatabase<ThingDef>.GetNamed("Campfire", false);
|
||||
|
||||
if (lampDef == null)
|
||||
{
|
||||
Log.Warning("[WULA] No lamp definition found, skipping lighting generation");
|
||||
return;
|
||||
}
|
||||
|
||||
// 在四个角落放置照明设备
|
||||
var lightPositions = new List<IntVec3>
|
||||
{
|
||||
new IntVec3(2, 0, 2), // 左下角
|
||||
new IntVec3(mapSize.x - 3, 0, 2), // 右下角
|
||||
new IntVec3(2, 0, mapSize.z - 3), // 左上角
|
||||
new IntVec3(mapSize.x - 3, 0, mapSize.z - 3) // 右上角
|
||||
};
|
||||
|
||||
foreach (IntVec3 pos in lightPositions)
|
||||
{
|
||||
if (pos.InBounds(map) && pos.Standable(map))
|
||||
{
|
||||
// 放置立式灯
|
||||
Thing lamp = ThingMaker.MakeThing(lampDef);
|
||||
lamp.SetFaction(null);
|
||||
GenPlace.TryPlaceThing(lamp, pos, map, ThingPlaceMode.Direct);
|
||||
}
|
||||
}
|
||||
|
||||
// 在中心区域留出空间,这里将放置退出点
|
||||
// 不在这里放置退出点,因为这会由Building_ArmedShuttleWithPocket来处理
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -169,6 +169,9 @@
|
||||
<Compile Include="Projectiles\BulletWithTrail.cs" />
|
||||
<Compile Include="WULA_Shuttle\ArmedShuttleIncoming.cs" />
|
||||
<Compile Include="WULA_Shuttle\Building_ArmedShuttle.cs" />
|
||||
<Compile Include="WULA_Shuttle\Building_ArmedShuttleWithPocket.cs" />
|
||||
<Compile Include="WULA_Shuttle\Building_PocketMapExit.cs" />
|
||||
<Compile Include="WULA_Shuttle\GenStep_WulaPocketSpaceSmall.cs" />
|
||||
<Compile Include="HarmonyPatches\Patch_DropCellFinder_SkyfallerCanLandAt.cs" />
|
||||
<Compile Include="MechWeapon\FloatMenuProvider_Mech.cs" />
|
||||
<Compile Include="MechWeapon\Patch_MissingWeapon.cs" />
|
||||
|
||||
Reference in New Issue
Block a user