This commit is contained in:
Tourswen
2025-11-14 00:45:12 +08:00
parent 04cef5ad30
commit 30f541a7cc
45 changed files with 751 additions and 227 deletions

View File

@@ -62,7 +62,10 @@
</costList>
<recipeMaker>
<researchPrerequisite>WULA_Colony_License_LV1_Technology</researchPrerequisite>
<recipeUsers Inherit="False"/>
<recipeUsers>
<li>WULA_Cube_Productor_Cleanzone</li>
</recipeUsers>
</recipeMaker>
<!-- <techHediffsTags>
<li>FieldHand</li>
@@ -84,7 +87,10 @@
</costList>
<recipeMaker Inherit="False">
<researchPrerequisite>WULA_Synth_Addons_Technology</researchPrerequisite>
<recipeUsers Inherit="False"/>
<recipeUsers>
<li>WULA_Cube_Productor_Cleanzone</li>
</recipeUsers>
</recipeMaker>
<comps>
<li Class="CompProperties_Usable">
@@ -202,7 +208,10 @@
</graphicData>
<recipeMaker Inherit="False">
<researchPrerequisite>WULA_Synth_Addons_Technology</researchPrerequisite>
<recipeUsers Inherit="False"/>
<recipeUsers>
<li>WULA_Cube_Productor_Cleanzone</li>
</recipeUsers>
</recipeMaker>
<costList>
<Steel>200</Steel>
@@ -265,7 +274,10 @@
</costList>
<recipeMaker Inherit="False">
<researchPrerequisite>WULA_Synth_Addons_Technology</researchPrerequisite>
<recipeUsers Inherit="False"/>
<recipeUsers>
<li>WULA_Cube_Productor_Cleanzone</li>
</recipeUsers>
</recipeMaker>
<comps>
<li Class="CompProperties_Usable">
@@ -346,7 +358,10 @@
</thingSetMakerTags>
<recipeMaker>
<researchPrerequisite>WULA_Synth_Addons_2_Technology</researchPrerequisite>
<recipeUsers Inherit="False"/>
<recipeUsers>
<li>WULA_Cube_Productor_Cleanzone</li>
</recipeUsers>
</recipeMaker>
<statBases>
<Mass>0.3</Mass>
@@ -464,7 +479,10 @@
</thingSetMakerTags>
<recipeMaker>
<researchPrerequisite>WULA_Synth_Addons_2_Technology</researchPrerequisite>
<recipeUsers Inherit="False"/>
<recipeUsers>
<li>WULA_Cube_Productor_Cleanzone</li>
</recipeUsers>
</recipeMaker>
<statBases>
<Mass>0.3</Mass>
@@ -550,7 +568,10 @@
</thingSetMakerTags>
<recipeMaker>
<researchPrerequisite>WULA_Synth_Addons_2_Technology</researchPrerequisite>
<recipeUsers Inherit="False"/>
<recipeUsers>
<li>WULA_Cube_Productor_Cleanzone</li>
</recipeUsers>
</recipeMaker>
<statBases>
<Mass>0.3</Mass>
@@ -646,7 +667,10 @@
<researchPrerequisites>
<li>WULA_Synth_Addons_2_Technology</li>
</researchPrerequisites>
<recipeUsers Inherit="False"/>
<recipeUsers>
<li>WULA_Cube_Productor_Cleanzone</li>
</recipeUsers>
</recipeMaker>
<statBases>
<Mass>0.3</Mass>
@@ -707,7 +731,10 @@
</costList>
<recipeMaker>
<researchPrerequisite>WULA_Colony_License_LV1_Technology</researchPrerequisite>
<recipeUsers Inherit="False"/>
<recipeUsers>
<li>WULA_Cube_Productor_Cleanzone</li>
</recipeUsers>
</recipeMaker>
</ThingDef>
<ThingDef ParentName="MechanitorImplantCraftableBase">
@@ -723,7 +750,10 @@
</costList>
<recipeMaker Inherit="False">
<researchPrerequisite>WULA_Synth_Addons_Technology</researchPrerequisite>
<recipeUsers Inherit="False"/>
<recipeUsers>
<li>WULA_Cube_Productor_Cleanzone</li>
</recipeUsers>
</recipeMaker>
<comps>
<li Class="CompProperties_Usable">
@@ -813,7 +843,10 @@
</costList>
<recipeMaker Inherit="False">
<researchPrerequisite>WULA_Synth_Addons_Technology</researchPrerequisite>
<recipeUsers Inherit="False"/>
<recipeUsers>
<li>WULA_Cube_Productor_Cleanzone</li>
</recipeUsers>
</recipeMaker>
<comps>
<li Class="CompProperties_Usable">
@@ -996,7 +1029,10 @@
</thingSetMakerTags>
<recipeMaker>
<researchPrerequisite>WULA_Synth_Antenna_Technology</researchPrerequisite>
<recipeUsers Inherit="False"/>
<recipeUsers>
<li>WULA_Cube_Productor_Cleanzone</li>
</recipeUsers>
</recipeMaker>
<statBases>
<Mass>0.3</Mass>
@@ -1134,7 +1170,10 @@
</thingSetMakerTags>
<recipeMaker>
<researchPrerequisite>WULA_Synth_Addons_2_Technology</researchPrerequisite>
<recipeUsers Inherit="False"/>
<recipeUsers>
<li>WULA_Cube_Productor_Cleanzone</li>
</recipeUsers>
</recipeMaker>
<statBases>
<Mass>0.3</Mass>
@@ -1279,7 +1318,10 @@
</thingSetMakerTags>
<recipeMaker>
<researchPrerequisite>WULA_Synth_Addons_Technology</researchPrerequisite>
<recipeUsers Inherit="False"/>
<recipeUsers>
<li>WULA_Cube_Productor_Cleanzone</li>
</recipeUsers>
</recipeMaker>
<statBases>
<Mass>0.3</Mass>
@@ -1397,7 +1439,7 @@
<researchPrerequisites>
<li>WULA_Shutdown_Technology</li>
</researchPrerequisites>
<uiIconThing>WULA_Charge_Cube_No_Power</uiIconThing>
<uiIconPath>Wula/UI/Commands/WULA_Shutdown_Synth</uiIconPath>
<surgeryOutcomeEffect IsNull="True" />
<!-- Always succeeds -->
<anesthetize>false</anesthetize>
@@ -1420,7 +1462,7 @@
<workerClass>Recipe_RemoveHediff</workerClass>
<jobString>正在重启合成人。</jobString>
<successfullyRemovedHediffMessage>{0} 成功重启了 {1}。</successfullyRemovedHediffMessage>
<uiIconThing>WULA_Charge_Cube</uiIconThing>
<uiIconPath>Wula/UI/Commands/WULA_Synth_Power_On</uiIconPath>
<removesHediff>WULA_Shutdown_Synth_Hediff</removesHediff>
<surgeryOutcomeEffect IsNull="True" />
<!-- Always succeeds -->

View File

@@ -4,7 +4,6 @@
<defName>Wula_PawnKind</defName>
<label>机械乌拉</label>
<race>WulaSpecies</race>
<defaultFactionDef>PlayerColony</defaultFactionDef>
<lifeStages>
<li>
<bodyGraphicData>
@@ -47,9 +46,8 @@
<PawnKindDef ParentName="NonCombatLightMechanoidKind">
<defName>Mech_WULA_Cat</defName>
<label>乌拉猫猫</label>
<label>CAt-11"猫猫"</label>
<race>Mech_WULA_Cat</race>
<defaultFactionType>PlayerColony</defaultFactionType>
<allowInMechClusters>False</allowInMechClusters>
<lifeStages>
<li>
@@ -85,7 +83,7 @@
</PawnKindDef>
<PawnKindDef ParentName="Mech_WULA_Cat_Soldier_PawnKind">
<defName>Mech_WULA_Cat_Constructor</defName>
<label>土木乌拉猫猫</label>
<label>CAt-86"猫猫劳工"</label>
<race>Mech_WULA_Cat_Constructor</race>
<weaponTags>
<li>Wula_Constructor_Cat_Weapon</li>
@@ -105,7 +103,7 @@
</PawnKindDef>
<PawnKindDef ParentName="Mech_WULA_Cat_Soldier_PawnKind">
<defName>Mech_WULA_Cat_Assault</defName>
<label>突击乌拉猫猫</label>
<label>CAt-46"猫猫冲锋队"</label>
<race>Mech_WULA_Cat_Assault</race>
<combatPower>500</combatPower>
<lifeStages Inherit="False">

View File

@@ -187,60 +187,12 @@
<displayPriority>100</displayPriority>
<researchPrerequisites>
<li>WULA_Colony_License_LV1_Technology</li>
<li>WULA_Synth_Charge_Cube_Technology</li>
</researchPrerequisites>
</RecipeDef>
<RecipeDef>
<defName>Make_WULA_Charge_Cube_Group</defName>
<label>制造乌拉帝国能源核心4个</label>
<description>制造4块乌拉帝国能源核心包括可复冲的电容器与供给机械运转的能量这是机械乌拉唯一可接受的外部输入性能量来源也是多种乌拉帝国产物的前体。</description>
<jobString>正在制造乌拉帝国能源核心</jobString>
<workSpeedStat>GeneralLaborSpeed</workSpeedStat>
<!-- <requiredGiverWorkType>Crafting</requiredGiverWorkType> -->
<effectWorking>Smith</effectWorking>
<soundWorking>Recipe_Smith</soundWorking>
<!-- 允许混合成分 -->
<allowMixingIngredients>true</allowMixingIngredients>
<ingredients Inherit="False">
<li>
<filter>
<thingDefs>
<li>Steel</li>
</thingDefs>
</filter>
<count>8</count>
</li>
<li>
<filter>
<thingDefs>
<li>Chemfuel</li>
</thingDefs>
</filter>
<count>8</count>
</li>
<li>
<filter>
<thingDefs>
<li>ComponentIndustrial</li>
</thingDefs>
</filter>
<count>4</count>
</li>
</ingredients>
<products>
<WULA_Charge_Cube>4</WULA_Charge_Cube>
</products>
<workSkill>Crafting</workSkill>
<displayPriority>100</displayPriority>
<researchPrerequisites>
<li>WULA_Colony_License_LV1_Technology</li>
</researchPrerequisites>
</RecipeDef>
<RecipeDef>
<defName>Recharge_WULA_Charge_Cube</defName>
<label>以化合燃料充能能源核心</label>
<label>充能能源核心</label>
<description>使用化合燃料,将被使用过的失去能量的乌拉帝国能源核心重新充能。</description>
<jobString>正在为乌拉帝国能源核心充能</jobString>
<workSpeedStat>GeneralLaborSpeed</workSpeedStat>
@@ -283,53 +235,13 @@
<displayPriority>100</displayPriority>
<researchPrerequisites>
<li>WULA_Colony_License_LV1_Technology</li>
<li>WULA_Synth_Charge_Cube_Technology</li>
</researchPrerequisites>
</RecipeDef>
<RecipeDef>
<defName>Recharge_WULA_Charge_Cube_Energy</defName>
<label>充能能源核心</label>
<description>使用电力,将被使用过的失去能量的乌拉帝国能源核心重新充能。</description>
<jobString>正在为乌拉帝国能源核心充能</jobString>
<workSpeedStat>GeneralLaborSpeed</workSpeedStat>
<!-- <requiredGiverWorkType>Crafting</requiredGiverWorkType> -->
<effectWorking>Smith</effectWorking>
<soundWorking>Recipe_Smith</soundWorking>
<workAmount>300</workAmount>
<!-- 允许混合成分 -->
<allowMixingIngredients>true</allowMixingIngredients>
<ingredients Inherit="False">
<li>
<filter>
<thingDefs>
<li>Steel</li>
</thingDefs>
</filter>
<count>2</count>
</li>
<li>
<filter>
<thingDefs>
<li>WULA_Charge_Cube_No_Power</li>
</thingDefs>
</filter>
<count>1</count>
</li>
</ingredients>
<products>
<WULA_Charge_Cube>1</WULA_Charge_Cube>
</products>
<workSkill>Crafting</workSkill>
<displayPriority>100</displayPriority>
<researchPrerequisites>
<li>WULA_Colony_License_LV1_Technology</li>
</researchPrerequisites>
</RecipeDef>
<RecipeDef>
<defName>Recharge_WULA_Charge_Cube_Energy_Group</defName>
<defName>Recharge_WULA_Charge_Cube_Group</defName>
<label>充能能源核心4个</label>
<description>使用电力,将被使用过的失去能量的乌拉帝国能源核心重新充能。</description>
<description>使用化合燃料,将被使用过的失去能量的乌拉帝国能源核心重新充能。</description>
<jobString>正在为乌拉帝国能源核心充能</jobString>
<workSpeedStat>GeneralLaborSpeed</workSpeedStat>
<!-- <requiredGiverWorkType>Crafting</requiredGiverWorkType> -->
@@ -339,6 +251,14 @@
<!-- 允许混合成分 -->
<allowMixingIngredients>true</allowMixingIngredients>
<ingredients Inherit="False">
<li>
<filter>
<thingDefs>
<li>Chemfuel</li>
</thingDefs>
</filter>
<count>8</count>
</li>
<li>
<filter>
<thingDefs>
@@ -363,7 +283,7 @@
<displayPriority>100</displayPriority>
<researchPrerequisites>
<li>WULA_Colony_License_LV1_Technology</li>
<li>WULA_Synth_Charge_Cube_Technology</li>
</researchPrerequisites>
</RecipeDef>
@@ -416,4 +336,40 @@
</descriptionHyperlinks>
<researchPrerequisite>WULA_Synth_Productor_Technology</researchPrerequisite>
</RecipeDef>
<RecipeDef ParentName="BaseMechanoidRecipe">
<defName>WULA_Build_Mech_WULA_Cat</defName>
<label>建造CAt-11"猫猫"</label>
<description>建造一台CAt-11"猫猫"。</description>
<products>
<Mech_WULA_Cat>1</Mech_WULA_Cat>
</products>
<descriptionHyperlinks>
<ThingDef>Mech_WULA_Cat</ThingDef>
</descriptionHyperlinks>
<researchPrerequisite>WULA_Bunker_Drop_Technology</researchPrerequisite>
</RecipeDef>
<RecipeDef ParentName="BaseMechanoidRecipe">
<defName>WULA_Build_Mech_WULA_Cat_Constructor</defName>
<label>建造CAt-86"猫猫劳工"</label>
<description>建造一台CAt-86"猫猫劳工"。</description>
<products>
<Mech_WULA_Cat_Constructor>1</Mech_WULA_Cat_Constructor>
</products>
<descriptionHyperlinks>
<ThingDef>Mech_WULA_Cat_Constructor</ThingDef>
</descriptionHyperlinks>
<researchPrerequisite>WULA_Bunker_Drop_Technology</researchPrerequisite>
</RecipeDef>
<RecipeDef ParentName="BaseMechanoidRecipe">
<defName>WULA_Build_Mech_WULA_Cat_Assault</defName>
<label>建造CAt-46"猫猫冲锋队"</label>
<description>建造一台CAt-46"猫猫冲锋队"。</description>
<products>
<Mech_WULA_Cat_Assault>1</Mech_WULA_Cat_Assault>
</products>
<descriptionHyperlinks>
<ThingDef>Mech_WULA_Cat_Assault</ThingDef>
</descriptionHyperlinks>
<researchPrerequisite>WULA_Bunker_Drop_Technology</researchPrerequisite>
</RecipeDef>
</Defs>

View File

@@ -517,6 +517,20 @@
<li>WULA_Colony_License_LV3_Technology</li>
</prerequisites>
</ResearchProjectDef>
<ResearchProjectDef ParentName="WULAtechBase">
<defName>WULA_Synth_Charge_Cube_Technology</defName>
<researchViewX>6.00</researchViewX>
<researchViewY>1.50</researchViewY>
<label>能源核心加工许可</label>
<description>获取构建能源核心的知识,用以在脱离充电站的情况下为机械乌拉补充能量。</description>
<baseCost>800</baseCost>
<hiddenPrerequisites>
<li>WULA_Synth_Addons_Technology</li>
</hiddenPrerequisites>
<prerequisites>
<li>WULA_Colony_License_LV2_Technology</li>
</prerequisites>
</ResearchProjectDef>
<!-- <ResearchProjectDef ParentName="WULAtechBase">
<defName>WULA_Adv_WorkTable_Technology</defName>

View File

@@ -791,6 +791,9 @@
</statBases>
<recipes>
<li>WULA_Build_Wula_Synth</li>
<li>WULA_Build_Mech_WULA_Cat</li>
<li>WULA_Build_Mech_WULA_Cat_Constructor</li>
<li>WULA_Build_Mech_WULA_Cat_Assault</li>
</recipes>
<size>(3,3)</size>
<uiOrder>2120</uiOrder>
@@ -963,9 +966,6 @@
<ComponentIndustrial>2</ComponentIndustrial>
<WULA_Charge_Cube>1</WULA_Charge_Cube>
</costList>
<researchPrerequisites>
<li>WULA_Bunker_Drop_Technology</li>
</researchPrerequisites>
<comps>
<li Class="CompProperties_Glower">
<glowRadius>6</glowRadius>
@@ -1288,9 +1288,8 @@
<li>Make_WULA_Alloy</li>
<li>Make_WULA_Alloy_Group</li>
<li>Make_WULA_Charge_Cube</li>
<li>Make_WULA_Charge_Cube_Group</li>
<li>Recharge_WULA_Charge_Cube_Energy</li>
<li>Recharge_WULA_Charge_Cube_Energy_Group</li>
<li>Recharge_WULA_Charge_Cube</li>
<li>Recharge_WULA_Charge_Cube_Group</li>
<li>Make_Component_By_WULA_Cube_Productor</li>
<li>Make_WULA_Dark_Matter_Item</li>
<li>Make_WULA_Neutronium</li>
@@ -1434,6 +1433,7 @@
<description>一台使用暗物质湮灭反应提供能量的乌拉帝国发电机,需要消耗暗物质作为燃料且消耗速率很高,但是拥有普通发电机望尘莫及的发电能力。为了在野战环境下随炮塔群一起空投,这种发电机的装甲层设计的非常厚实。</description>
<thingClass>Building</thingClass>
<drawerType>MapMeshAndRealTime</drawerType>
<altitudeLayer>BuildingOnTop</altitudeLayer>
<graphicData>
<texPath>Wula/Building/Wula_DarkEnergy_Generators</texPath>
<graphicClass>Graphic_Single</graphicClass>
@@ -1444,7 +1444,6 @@
<offset>(-0.03,0,-0.1)</offset>
</shadowData>
</graphicData>
<altitudeLayer>Building</altitudeLayer>
<passability>PassThroughOnly</passability>
<fillPercent>0</fillPercent>
<pathCost>50</pathCost>

View File

@@ -76,7 +76,7 @@
<drawSize>(9,9)</drawSize>
</graphicData>
<skyfaller>
<movementType>Decelerate</movementType>
<movementType>Accelerate</movementType>
<shadow>Things/Skyfaller/SkyfallerShadowDropPod</shadow>
<shadowSize>(6, 6)</shadowSize>
<anticipationSound>DropPod_Fall</anticipationSound>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<Defs>
<!-- 仅在开局时刷出 -->
<!-- 舰队 -->
<ThingDef ParentName="BuildingBase">
<defName>WULA_Fake_Mothership_Beacon_Building</defName>
<label>帝国母舰信标</label>
@@ -57,7 +57,7 @@
<aircraftDef>WULA_MotherShip_Entity</aircraftDef>
<aircraftCount>1</aircraftCount>
<skyfallerLeaving></skyfallerLeaving>
<autoLaunchEnabled>true</autoLaunchEnabled>
<autoLaunchDelayTicks>1</autoLaunchDelayTicks>
<autoLaunchOnConstruction>true</autoLaunchOnConstruction>
@@ -87,6 +87,7 @@
<passability>PassThroughOnly</passability>
<fillPercent>1</fillPercent>
<size>(3,3)</size>
<uiIconPath>Wula/Building/WULA_Fake_BattleShip_Beacon_Building</uiIconPath>
<drawHighlight>true</drawHighlight>
<highlightColor>(0.56, 0.62, 0.9)</highlightColor>
<graphicData>
@@ -121,20 +122,12 @@
<isInert>true</isInert>
</building>
<comps>
<li Class="WulaFallenEmpire.CompProperties_FactionSetter">
<!-- <factionDef>Mechanoid</factionDef> 不写默认玩家派系-->
<usePlayerFactionIfNull>true</usePlayerFactionIfNull>
<overrideExistingFaction>false</overrideExistingFaction>
</li>
<li Class="WulaFallenEmpire.CompProperties_AircraftHangar">
<aircraftDef>WULA_BattleShip_Entity</aircraftDef>
<aircraftCount>1</aircraftCount>
<skyfallerLeaving></skyfallerLeaving>
<autoLaunchEnabled>true</autoLaunchEnabled>
<autoLaunchDelayTicks>1</autoLaunchDelayTicks>
<autoLaunchOnConstruction>true</autoLaunchOnConstruction>
<autoLaunchOnPowerOn>false</autoLaunchOnPowerOn>
<autoLaunchEnabled>false</autoLaunchEnabled>
</li>
</comps>
</ThingDef>
@@ -203,7 +196,7 @@
<aircraftDef>WULA_AircraftCarrier_Entity</aircraftDef>
<aircraftCount>1</aircraftCount>
<skyfallerLeaving></skyfallerLeaving>
<autoLaunchEnabled>true</autoLaunchEnabled>
<autoLaunchDelayTicks>1</autoLaunchDelayTicks>
<autoLaunchOnConstruction>true</autoLaunchOnConstruction>
@@ -233,6 +226,7 @@
<passability>PassThroughOnly</passability>
<fillPercent>1</fillPercent>
<size>(3,3)</size>
<uiIconPath>Wula/Building/WULA_Fake_ConstructionShip_Beacon_Building</uiIconPath>
<drawHighlight>true</drawHighlight>
<highlightColor>(0.56, 0.62, 0.9)</highlightColor>
<graphicData>
@@ -260,9 +254,6 @@
<drawerType>RealtimeOnly</drawerType>
<repairEffect>ConstructMetal</repairEffect>
<forceDebugSpawnable>true</forceDebugSpawnable>
<researchPrerequisites Inherit="False">
<li>WULA_Aircraft_Carrier_Technology</li>
</researchPrerequisites>
<building>
<expandHomeArea>false</expandHomeArea>
<destroySound>BuildingDestroyed_Metal_Big</destroySound>
@@ -279,7 +270,7 @@
<aircraftDef>WULA_ConstructionShip_Entity</aircraftDef>
<aircraftCount>1</aircraftCount>
<skyfallerLeaving></skyfallerLeaving>
<autoLaunchEnabled>true</autoLaunchEnabled>
<autoLaunchDelayTicks>1</autoLaunchDelayTicks>
<autoLaunchOnConstruction>true</autoLaunchOnConstruction>
@@ -342,7 +333,7 @@
<comps>
</comps>
</ThingDef> -->
<!-- 战机 -->
<ThingDef ParentName="BuildingBase">
<defName>WULA_Fake_Fighter_Drone_Building</defName>
@@ -398,7 +389,7 @@
<aircraftDef>WULA_Fighter_Drone_Entity</aircraftDef>
<aircraftCount>1</aircraftCount>
<skyfallerLeaving>WULA_Fighter_Drone_Leaving</skyfallerLeaving>
<autoLaunchEnabled>false</autoLaunchEnabled>
</li>
</comps>
@@ -514,7 +505,7 @@
<aircraftDef>WULA_Striker_Entity</aircraftDef>
<aircraftCount>1</aircraftCount>
<skyfallerLeaving></skyfallerLeaving>
<autoLaunchEnabled>false</autoLaunchEnabled>
</li>
</comps>
@@ -585,7 +576,7 @@
<aircraftDef>WULA_Bomber_Entity</aircraftDef>
<aircraftCount>1</aircraftCount>
<skyfallerLeaving></skyfallerLeaving>
<autoLaunchEnabled>false</autoLaunchEnabled>
</li>
</comps>
@@ -596,4 +587,139 @@
<description>什么这是个记录数量用的thingdef你不应该在任何场合下看到这个。</description>
<thingClass>Thing</thingClass>
</ThingDef>
<ThingDef ParentName="BuildingBase">
<defName>WULA_Holographic_Flag_Building</defName>
<label>P.I.A全息旗帜</label>
<description>乌拉帝国行星封锁机关的全息旗帜,没什么用但是可以宣示乌拉帝国的主权。</description>
<thingClass>WulaFallenEmpire.Building_ExtraGraphics</thingClass>
<preventDroppingThingsOn>true</preventDroppingThingsOn>
<altitudeLayer>BuildingOnTop</altitudeLayer>
<pathCost>50</pathCost>
<blockWind>true</blockWind>
<passability>PassThroughOnly</passability>
<fillPercent>1</fillPercent>
<size>(1,1)</size>
<drawHighlight>true</drawHighlight>
<highlightColor>(0.56, 0.62, 0.9)</highlightColor>
<uiIconPath>Wula/Building/Flag/WULA_Flag_Building_A</uiIconPath>
<rotatable>false</rotatable>
<graphicData>
<texPath>Wula/Building/Flag/WULA_Flag_Building_Mount</texPath>
<graphicClass>Graphic_Single</graphicClass>
<drawSize>(1,1)</drawSize>
</graphicData>
<statBases>
<MaxHitPoints>600</MaxHitPoints>
<Flammability>0.5</Flammability>
<WorkToBuild>1000</WorkToBuild>
<Mass>125</Mass>
<Comfort>0.65</Comfort>
</statBases>
<tickerType>Normal</tickerType>
<canOverlapZones>true</canOverlapZones>
<hasInteractionCell>false</hasInteractionCell>
<defaultPlacingRot>North</defaultPlacingRot>
<selectable>true</selectable>
<terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
<soundImpactDefault>BulletImpact_Metal</soundImpactDefault>
<preventSkyfallersLandingOn>true</preventSkyfallersLandingOn>
<drawerType>RealtimeOnly</drawerType>
<repairEffect>ConstructMetal</repairEffect>
<forceDebugSpawnable>true</forceDebugSpawnable>
<designationCategory>WULA_Buildings</designationCategory>
<building>
<expandHomeArea>false</expandHomeArea>
<destroySound>BuildingDestroyed_Metal_Big</destroySound>
<paintable>true</paintable>
<isInert>true</isInert>
</building>
<modExtensions>
<li Class="WulaFallenEmpire.ExtraGraphicsExtension">
<globalHoverSpeed>0</globalHoverSpeed>
<globalHoverIntensity>0</globalHoverIntensity>
<graphicLayers>
<li>
<texturePath>Wula/Building/Flag/WULA_Flag_Building_A</texturePath>
<scale>(3,3)</scale>
<drawOrder>0</drawOrder>
<offset>(0,0,3)</offset>
<hoverSpeed>1.5</hoverSpeed> <!-- 比全局慢 -->
<hoverIntensity>0.2</hoverIntensity> <!-- 比全局弱 -->
<hoverPhase>0</hoverPhase>
</li>
<li>
<texturePath>Wula/Building/Flag/WULA_Flag_Building_Mount</texturePath>
<scale>(1,1)</scale>
<drawOrder>1</drawOrder>
<offset>(0,0,0)</offset>
<hoverSpeed>0</hoverSpeed> <!-- 比全局慢 -->
<hoverIntensity>0</hoverIntensity> <!-- 比全局弱 -->
<hoverPhase>0</hoverPhase>
</li>
</graphicLayers>
</li>
</modExtensions>
<comps>
<li Class="CompProperties_Glower">
<glowRadius>3</glowRadius>
<glowColor>(120,240,252,0)</glowColor>
</li>
</comps>
</ThingDef>
<ThingDef ParentName="BuildingBase">
<defName>WULA_Wall_Flag_Building</defName>
<label>P.I.A旗帜</label>
<description>乌拉帝国行星封锁机关的旗帜,没什么用但是可以宣示乌拉帝国的主权。</description>
<thingClass>Building</thingClass>
<category>Building</category>
<altitudeLayer>Building</altitudeLayer>
<passability>PassThroughOnly</passability>
<designationCategory>WULA_Buildings</designationCategory>
<selectable>true</selectable>
<fillPercent>0.20</fillPercent>
<pathCost>14</pathCost>
<leaveResourcesWhenKilled>false</leaveResourcesWhenKilled>
<soundImpactDefault>BulletImpact_Metal</soundImpactDefault>
<uiIconPath>Wula/Building/Flag/WULA_Flag_Building_B_north</uiIconPath>
<noRightClickDraftAttack>true</noRightClickDraftAttack>
<rotatable>true</rotatable>
<graphicData>
<texPath>Wula/Building/Flag/WULA_Flag_Building_B</texPath>
<graphicClass>Graphic_Multi</graphicClass>
<drawSize>(0.7,0.75)</drawSize>
<drawOffsetNorth>(0,0,0.7)</drawOffsetNorth>
<drawOffsetSouth>(0,0,-0.7)</drawOffsetSouth>
<drawOffsetWest>(-0.6,0,0.1)</drawOffsetWest>
<drawOffsetEast>(0.6,0,0.1)</drawOffsetEast>
<damageData>
<enabled>false</enabled>
</damageData>
</graphicData>
<altitudeLayer>BuildingOnTop</altitudeLayer>
<costList>
<Steel>15</Steel>
</costList>
<statBases>
<MaxHitPoints>50</MaxHitPoints>
<Flammability>1.0</Flammability>
<WorkToBuild>330</WorkToBuild>
<MaxHitPoints>35</MaxHitPoints>
<Mass>2</Mass>
</statBases>
<uiOrder>2991</uiOrder>
<passability>Standable</passability>
<terrainAffordanceNeeded IsNull="True" />
<pathCost>0</pathCost>
<overrideMinifiedRot>North</overrideMinifiedRot>
<minifiedDrawOffset>(0, 0, 0.2)</minifiedDrawOffset>
<building>
<isEdifice>false</isEdifice>
<isAttachment>true</isAttachment>
</building>
<placeWorkers>
<li>Placeworker_AttachedToWall</li>
</placeWorkers>
</ThingDef>
</Defs>

View File

@@ -72,7 +72,7 @@
<escortFlyOverDef>WULA_Striker_Escort</escortFlyOverDef>
<!-- 生成配置 -->
<spawnIntervalTicks>300</spawnIntervalTicks> <!-- 5秒 -->
<spawnIntervalTicks>1000</spawnIntervalTicks> <!-- 5秒 -->
<maxEscorts>20</maxEscorts>
<spawnCount>1</spawnCount>
@@ -116,7 +116,7 @@
<escortFlyOverDef>WULA_Bomber_Escort</escortFlyOverDef>
<!-- 生成配置 -->
<spawnIntervalTicks>750</spawnIntervalTicks> <!-- 5秒 -->
<spawnIntervalTicks>1350</spawnIntervalTicks> <!-- 5秒 -->
<maxEscorts>10</maxEscorts>
<spawnCount>1</spawnCount>
@@ -372,6 +372,95 @@
<li>HarborFacility</li>
</availableFacilities>
</li>
<!-- 伴飞 -->
<li Class="WulaFallenEmpire.CompProperties_FlyOverEscort">
<escortFlyOverDef>WULA_Striker_Escort</escortFlyOverDef>
<!-- 生成配置 -->
<spawnIntervalTicks>1000</spawnIntervalTicks> <!-- 5秒 -->
<maxEscorts>20</maxEscorts>
<spawnCount>1</spawnCount>
<!-- 位置配置 -->
<spawnDistance>0</spawnDistance>
<lateralOffset>100</lateralOffset>
<verticalOffset>5</verticalOffset>
<useRandomOffset>true</useRandomOffset>
<minSafeDistanceBetweenEscorts>10</minSafeDistanceBetweenEscorts> <!-- 伴飞物之间的距离 -->
<minSafeDistanceFromMain>70</minSafeDistanceFromMain> <!-- 与主飞行物的距离检查 -->
<!-- 飞行配置 -->
<escortSpeedMultiplier>8</escortSpeedMultiplier> <!-- 比主舰稍快 -->
<escortAltitudeOffset>10</escortAltitudeOffset> <!-- 比主舰稍高 -->
<mirrorMovement>false</mirrorMovement>
<!-- 行为配置 -->
<spawnOnStart>true</spawnOnStart>
<destroyWithParent>false</destroyWithParent>
<continuousSpawning>true</continuousSpawning>
<!-- 外观配置 -->
<useParentRotation>true</useParentRotation>
<!-- 缩放区间配置 -->
<escortScaleRange>
<min>0.3</min>
<max>0.6</max>
</escortScaleRange>
<!-- 高度遮罩配置 -->
<useHeightMask>true</useHeightMask>
<heightMaskAlphaRange>
<min>0.6</min>
<max>0.8</max>
</heightMaskAlphaRange>
<heightMaskColor>(0.7,0.85,1.0,1.0)</heightMaskColor>
<heightMaskScaleMultiplier>1.3</heightMaskScaleMultiplier>
</li>
<li Class="WulaFallenEmpire.CompProperties_FlyOverEscort">
<escortFlyOverDef>WULA_Bomber_Escort</escortFlyOverDef>
<!-- 生成配置 -->
<spawnIntervalTicks>1350</spawnIntervalTicks> <!-- 5秒 -->
<maxEscorts>10</maxEscorts>
<spawnCount>1</spawnCount>
<!-- 位置配置 -->
<spawnDistance>0</spawnDistance>
<lateralOffset>130</lateralOffset>
<verticalOffset>5</verticalOffset>
<useRandomOffset>true</useRandomOffset>
<minSafeDistanceBetweenEscorts>10</minSafeDistanceBetweenEscorts> <!-- 伴飞物之间的距离 -->
<minSafeDistanceFromMain>70</minSafeDistanceFromMain> <!-- 与主飞行物的距离检查 -->
<!-- 飞行配置 -->
<escortSpeedMultiplier>5</escortSpeedMultiplier> <!-- 比主舰稍快 -->
<escortAltitudeOffset>10</escortAltitudeOffset> <!-- 比主舰稍高 -->
<mirrorMovement>false</mirrorMovement>
<!-- 行为配置 -->
<spawnOnStart>true</spawnOnStart>
<destroyWithParent>false</destroyWithParent>
<continuousSpawning>true</continuousSpawning>
<!-- 外观配置 -->
<useParentRotation>true</useParentRotation>
<!-- 缩放区间配置 -->
<escortScaleRange>
<min>0.3</min>
<max>0.6</max>
</escortScaleRange>
<!-- 高度遮罩配置 -->
<useHeightMask>true</useHeightMask>
<heightMaskAlphaRange>
<min>0.6</min>
<max>0.8</max>
</heightMaskAlphaRange>
<heightMaskColor>(0.7,0.85,1.0,1.0)</heightMaskColor>
<heightMaskScaleMultiplier>1.3</heightMaskScaleMultiplier>
</li>
</comps>
</ThingDef>
<ThingDef ParentName="EtherealThingBase">

View File

@@ -5,7 +5,7 @@
<label>合金</label>
<description>由乌拉帝国工艺加工得到的高密度合金,是许多乌拉帝国装备的原材料。</description>
<graphicData>
<texPath>Wula/Item/WULA_Neutronium</texPath>
<texPath>Wula/Item/WULA_Alloy</texPath>
<graphicClass>Graphic_Single</graphicClass>
</graphicData>
<tradeability>None</tradeability>

View File

@@ -2174,7 +2174,7 @@
<defName>WULA_MW_Cheat_Weapon_Ability</defName>
<label>放逐之门</label>
<description>使得目标立刻被放逐——无视一切保护措施,将其从存档中永远擦除。</description>
<iconPath>Wula/UI/Abilities/WULA_MW_Cheat_Weapon_Ability</iconPath>
<iconPath>Wula/UI/Abilities/WULA_RW_Auto_GL_Smoke_Ability</iconPath>
<writeCombatLog>True</writeCombatLog>
<showPsycastEffects>False</showPsycastEffects>
<hotKey>Misc11</hotKey>

View File

@@ -727,9 +727,7 @@
<ComponentIndustrial>6</ComponentIndustrial>
</costList>
<recipeMaker>
<recipeUsers Inherit="False">
<li>WULA_WeaponArmor_Productor</li>
</recipeUsers>
<researchPrerequisite>WULA_Synth_Productor_Technology</researchPrerequisite>
</recipeMaker>
<comps>
@@ -882,6 +880,7 @@
<ThingDef Abstract="True" Name="Mech_WULA_Cat_Base" ParentName="WULA_BaseMechanoid">
<statBases>
<MoveSpeed>5</MoveSpeed>
<WorkToMake>1500</WorkToMake>
<WastepacksPerRecharge MayRequire="Ludeon.RimWorld.Biotech">0</WastepacksPerRecharge>
</statBases>
@@ -897,6 +896,9 @@
<filthCountRange>1~2</filthCountRange>
</deathAction>
</race>
<recipeMaker>
<researchPrerequisite>WULA_Bunker_Drop_Technology</researchPrerequisite>
</recipeMaker>
<comps>
<li Class="CompProperties_CauseHediff_AoE">
<hediff>Mech_WULA_Cat_Cute</hediff>
@@ -953,7 +955,7 @@
<ThingDef ParentName="Mech_WULA_Cat_Base">
<defName>Mech_WULA_Cat_Assault</defName>
<label>CAt-46"猫猫冲锋队"</label>
<description>乌拉帝国的一种小型自律机械体无需监管者可以执行搬运、狩猎和割除任务身着轻甲装备了一把DLa-4"云母"突击步枪附下挂刺刀,可以给敌方造成不小的麻烦。</description>
<description>乌拉帝国的一种小型自律机械体无需监管者可以执行搬运、狩猎和割除任务身着轻甲装备了一把DLa-1"页岩",可以给敌方造成不小的麻烦。</description>
<uiIconPath>Wula/Things/WULA_Assault_Cat/WULA_Cat_Thin_south</uiIconPath>
<race>
<mechEnabledWorkTypes Inherit="False">

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,206 @@
using System;
using System.Collections.Generic;
using RimWorld;
using UnityEngine;
using Verse;
using System.Linq;
namespace WulaFallenEmpire
{
public class Building_ExtraGraphics : Building
{
// 通过 ModExtension 配置的图形数据
private ExtraGraphicsExtension modExtension;
// 图形缓存
private Dictionary<string, Graphic> graphicsCache = new Dictionary<string, Graphic>();
// 动画状态 - 每个图层的独立浮动
private Dictionary<int, float> layerHoverOffsets = new Dictionary<int, float>();
private Dictionary<int, float> layerAnimationTimes = new Dictionary<int, float>();
private int lastTick = -1;
public ExtraGraphicsExtension ModExtension
{
get
{
if (modExtension == null)
{
modExtension = def.GetModExtension<ExtraGraphicsExtension>();
if (modExtension == null)
{
Log.Error($"Building_ExtraGraphics: No ExtraGraphicsExtension found for {def.defName}");
// 创建默认配置避免空引用
modExtension = new ExtraGraphicsExtension();
}
}
return modExtension;
}
}
// 重写 Graphic 属性返回 null完全自定义渲染
public override Graphic Graphic => null;
// 获取缓存的图形
private Graphic GetCachedGraphic(string texturePath, Vector2 scale, Color color)
{
string cacheKey = $"{texturePath}_{scale.x}_{scale.y}_{color}";
if (!graphicsCache.TryGetValue(cacheKey, out Graphic graphic))
{
graphic = GraphicDatabase.Get<Graphic_Single>(
texturePath,
ShaderDatabase.TransparentPostLight,
scale,
color);
graphicsCache[cacheKey] = graphic;
}
return graphic;
}
// 完全重写 DrawAt 方法,实现自定义渲染系统
protected override void DrawAt(Vector3 drawLoc, bool flip = false)
{
// 不调用基类的 DrawAt完全自定义渲染
// 更新悬浮动画
UpdateHoverAnimation();
// 绘制所有配置的图形层
DrawGraphicLayers(drawLoc, flip);
}
// 绘制所有图形层
private void DrawGraphicLayers(Vector3 baseDrawPos, bool flip)
{
if (ModExtension.graphicLayers == null || ModExtension.graphicLayers.Count == 0)
{
Log.Warning($"Building_ExtraGraphics: No graphic layers configured for {def.defName}");
return;
}
// 按层级排序,确保正确的绘制顺序
var sortedLayers = ModExtension.graphicLayers.OrderBy(layer => layer.drawOrder).ToList();
foreach (var layer in sortedLayers)
{
DrawGraphicLayer(baseDrawPos, flip, layer);
}
}
// 绘制单个图形层
private void DrawGraphicLayer(Vector3 baseDrawPos, bool flip, GraphicLayerData layer)
{
if (string.IsNullOrEmpty(layer.texturePath))
{
Log.Warning($"Building_ExtraGraphics: Empty texture path in layer for {def.defName}");
return;
}
// 获取图形
Graphic graphic = GetCachedGraphic(layer.texturePath, layer.scale, layer.color);
// 计算图层浮动偏移
float hoverOffset = 0f;
if (layer.enableHover)
{
int layerIndex = ModExtension.graphicLayers.IndexOf(layer);
if (layerHoverOffsets.ContainsKey(layerIndex))
{
hoverOffset = layerHoverOffsets[layerIndex];
}
}
// 最终绘制位置 = 基础位置 + 图层偏移 + 浮动偏移
Vector3 drawPos = baseDrawPos + layer.offset;
drawPos.z += hoverOffset;
// 绘制图形
graphic.Draw(drawPos, flip ? base.Rotation.Opposite : base.Rotation, this, 0f);
}
// 更新每个图层的独立悬浮动画
private void UpdateHoverAnimation()
{
int currentTick = Find.TickManager.TicksGame;
if (currentTick != lastTick)
{
// 更新每个图层的动画
for (int i = 0; i < ModExtension.graphicLayers.Count; i++)
{
var layer = ModExtension.graphicLayers[i];
if (layer.enableHover)
{
// 初始化动画时间
if (!layerAnimationTimes.ContainsKey(i))
{
layerAnimationTimes[i] = 0f;
}
// 更新动画时间
layerAnimationTimes[i] += Time.deltaTime;
// 计算该图层的悬浮偏移
float hoverSpeed = layer.hoverSpeed > 0 ? layer.hoverSpeed : ModExtension.globalHoverSpeed;
float hoverIntensity = layer.hoverIntensity > 0 ? layer.hoverIntensity : ModExtension.globalHoverIntensity;
float hoverOffset = Mathf.Sin(layerAnimationTimes[i] * hoverSpeed + layer.hoverPhase) * hoverIntensity;
layerHoverOffsets[i] = hoverOffset;
}
}
lastTick = currentTick;
}
}
// 保存和加载
public override void ExposeData()
{
base.ExposeData();
// 保存自定义状态(如果需要)
}
}
// 主要的 ModExtension 定义
public class ExtraGraphicsExtension : DefModExtension
{
// 全局悬浮参数(作为默认值)
public float globalHoverSpeed = 2f; // 全局悬浮速度
public float globalHoverIntensity = 0.1f; // 全局悬浮强度
// 图形层配置
public List<GraphicLayerData> graphicLayers = new List<GraphicLayerData>();
public ExtraGraphicsExtension()
{
// 默认配置,避免空列表
if (graphicLayers == null)
{
graphicLayers = new List<GraphicLayerData>();
}
}
}
// 单个图形层的配置数据
public class GraphicLayerData
{
// 基础配置
public string texturePath; // 纹理路径(必需)
public Vector2 scale = Vector2.one; // 缩放比例
public Color color = Color.white; // 颜色
public int drawOrder = 0; // 绘制顺序(数字小的先绘制)
// 位置配置 - 使用环世界坐标系
// X: 左右偏移, Y: 图层深度, Z: 上下偏移
public Vector3 offset = Vector3.zero;
// 独立悬浮配置
public bool enableHover = true; // 是否启用悬浮
public float hoverSpeed = 0f; // 悬浮速度0表示使用全局速度
public float hoverIntensity = 0f; // 悬浮强度0表示使用全局强度
public float hoverPhase = 0f; // 悬浮相位(用于错开浮动)
}
}

View File

@@ -312,71 +312,118 @@ namespace WulaFallenEmpire
return validSpots;
}
// 新增:分配物品到空投舱,包含材质处理
// 在 Building_GlobalWorkTable.cs 中修改 DistributeItemsToPods 方法
private List<List<Thing>> DistributeItemsToPods(GlobalStorageWorldComponent storage, int podCount)
{
List<List<Thing>> podContents = new List<List<Thing>>();
// 初始化空投舱内容列表
for (int i = 0; i < podCount; i++)
{
podContents.Add(new List<Thing>());
}
// 获取所有输出物品并转换为Thing列表
List<Thing> allItems = new List<Thing>();
// 首先处理机械体,因为需要特殊处理
foreach (var kvp in storage.outputStorage.ToList())
{
if (kvp.Value <= 0) continue;
ThingDef thingDef = kvp.Key;
int remainingCount = kvp.Value;
// 如果是Pawn需要特殊处理
if (thingDef.race != null)
{
Log.Message($"[Airdrop] Processing {remainingCount} pawns of type {thingDef.defName}");
// 对于Pawn每个单独生成
for (int i = 0; i < remainingCount; i++)
{
PawnKindDef randomPawnKind = GetRandomPawnKindForType(thingDef);
if (randomPawnKind != null)
{
Pawn pawn = PawnGenerator.GeneratePawn(randomPawnKind, Faction.OfPlayer);
allItems.Add(pawn);
try
{
Pawn pawn = PawnGenerator.GeneratePawn(randomPawnKind, Faction.OfPlayer);
// 确保Pawn处于活跃状态
if (pawn != null)
{
// 设置Pawn为可用的状态
pawn.health.Reset();
pawn.drafter = new Pawn_DraftController(pawn);
allItems.Add(pawn);
Log.Message($"[Airdrop] Successfully generated pawn: {pawn.Label}");
}
else
{
Log.Error("[Airdrop] Generated pawn is null");
}
}
catch (System.Exception ex)
{
Log.Error($"[Airdrop] Error generating pawn: {ex}");
}
}
else
{
Log.Error($"[Airdrop] Could not find suitable PawnKindDef for {thingDef.defName}");
}
}
// 立即从存储中移除已处理的机械体
storage.RemoveFromOutputStorage(thingDef, remainingCount);
}
else
}
// 然后处理普通物品
foreach (var kvp in storage.outputStorage.ToList())
{
if (kvp.Value <= 0) continue;
ThingDef thingDef = kvp.Key;
int remainingCount = kvp.Value;
// 跳过已经处理的机械体
if (thingDef.race != null) continue;
Log.Message($"[Airdrop] Processing {remainingCount} items of type {thingDef.defName}");
// 对于普通物品,按照堆叠限制分割
while (remainingCount > 0)
{
// 对于普通物品,按照堆叠限制分割
while (remainingCount > 0)
int stackSize = Mathf.Min(remainingCount, thingDef.stackLimit);
Thing thing = CreateThingWithMaterial(thingDef, stackSize);
if (thing != null)
{
int stackSize = Mathf.Min(remainingCount, thingDef.stackLimit);
Thing thing = CreateThingWithMaterial(thingDef, stackSize);
allItems.Add(thing);
remainingCount -= stackSize;
}
else
{
Log.Error($"[Airdrop] Failed to create thing: {thingDef.defName}");
break;
}
}
// 从存储中移除已处理的物品
storage.RemoveFromOutputStorage(thingDef, kvp.Value);
}
if (allItems.Count == 0)
{
Log.Message("[Airdrop] No items to distribute");
return podContents;
}
Log.Message($"[Airdrop] Total items to distribute: {allItems.Count}");
// 平均分配物品到空投舱
int currentPod = 0;
foreach (Thing item in allItems)
{
podContents[currentPod].Add(item);
currentPod = (currentPod + 1) % podCount;
if (item != null)
{
podContents[currentPod].Add(item);
currentPod = (currentPod + 1) % podCount;
}
}
// 从存储中移除已分配的物品
foreach (var kvp in storage.outputStorage.ToList())
// 记录分配结果
for (int i = 0; i < podContents.Count; i++)
{
storage.outputStorage[kvp.Key] = 0;
Log.Message($"[Airdrop] Pod {i} contains {podContents[i].Count} items");
}
return podContents;
}
@@ -431,94 +478,127 @@ namespace WulaFallenEmpire
return defaultThing;
}
// 在 Building_GlobalWorkTable.cs 中修改 GetRandomPawnKindForType 方法
// 改 GetRandomPawnKindForType 方法
private PawnKindDef GetRandomPawnKindForType(ThingDef pawnType)
{
if (pawnType.race == null) return null;
// 获取建筑拥有者派系
Faction buildingFaction = this.Faction;
if (buildingFaction == null)
if (pawnType.race == null)
{
Log.Warning("Building has no faction, cannot select appropriate pawn kind");
Log.Error($"[Airdrop] GetRandomPawnKindForType: {pawnType.defName} is not a pawn type");
return null;
}
// 获取工作台的派系
Faction workTableFaction = this.Faction;
if (workTableFaction == null)
{
Log.Error($"[Airdrop] Work table has no faction");
return null;
}
Log.Message($"[Airdrop] Work table faction: {workTableFaction.def.defName}");
// 获取该种族的所有PawnKindDef
var availableKinds = DefDatabase<PawnKindDef>.AllDefs
.Where(kind => kind.race == pawnType)
.ToList();
if (availableKinds.Count == 0) return null;
// 按优先级分组
if (availableKinds.Count == 0)
{
Log.Error($"[Airdrop] No PawnKindDef found for race: {pawnType.defName}");
return null;
}
Log.Message($"[Airdrop] Found {availableKinds.Count} PawnKindDefs for {pawnType.defName}");
// 最高优先级与工作台派系完全相同的PawnKind
var matchingFactionKinds = availableKinds
.Where(kind => kind.defaultFactionDef != null &&
kind.defaultFactionDef == buildingFaction.def)
kind.defaultFactionDef == workTableFaction.def)
.ToList();
if (matchingFactionKinds.Count > 0)
{
var selected = matchingFactionKinds.RandomElement();
Log.Message($"[Airdrop] Selected matching faction PawnKind: {selected.defName} (faction: {workTableFaction.def.defName})");
return selected;
}
// 次高优先级玩家派系的PawnKind如果工作台是玩家派系
if (workTableFaction.IsPlayer)
{
var playerFactionKinds = availableKinds
.Where(kind => kind.defaultFactionDef != null &&
(kind.defaultFactionDef == FactionDefOf.PlayerColony ||
kind.defaultFactionDef == FactionDefOf.PlayerTribe))
.ToList();
if (playerFactionKinds.Count > 0)
{
var selected = playerFactionKinds.RandomElement();
Log.Message($"[Airdrop] Selected player faction PawnKind: {selected.defName}");
return selected;
}
}
// 备选没有特定派系的PawnKind
var noFactionKinds = availableKinds
.Where(kind => kind.defaultFactionDef == null)
.ToList();
// 排除与建筑派系不同的PawnKind
var excludedKinds = availableKinds
.Where(kind => kind.defaultFactionDef != null &&
kind.defaultFactionDef != buildingFaction.def)
.ToList();
// 优先级选择
PawnKindDef selectedKind = null;
// 1. 最高优先级与建筑派系相同的PawnKind
if (matchingFactionKinds.Count > 0)
if (noFactionKinds.Count > 0)
{
selectedKind = matchingFactionKinds.RandomElement();
var selected = noFactionKinds.RandomElement();
Log.Message($"[Airdrop] Selected no-faction PawnKind: {selected.defName}");
return selected;
}
// 2. 备选没有defaultFactionDef的PawnKind
else if (noFactionKinds.Count > 0)
{
selectedKind = noFactionKinds.RandomElement();
}
// 3. 没有符合条件的PawnKind
else
{
Log.Warning($"No suitable PawnKind found for {pawnType.defName} with building faction {buildingFaction.def.defName}");
return null;
}
// 最后选择任何可用的PawnKind
var selectedKind = availableKinds.RandomElement();
Log.Message($"[Airdrop] Selected fallback PawnKind: {selectedKind.defName}");
return selectedKind;
}
// 新增:创建空投舱
// 修改 CreateDropPod 方法
private bool CreateDropPod(IntVec3 dropCell, List<Thing> contents)
{
try
{
if (contents == null || contents.Count == 0)
return false;
// 创建空投舱信息
ActiveTransporterInfo dropPodInfo = new ActiveTransporterInfo();
// 添加所有物品到空投舱
foreach (Thing thing in contents)
{
dropPodInfo.innerContainer.TryAdd(thing, true);
Log.Warning("[Airdrop] CreateDropPod: contents is null or empty");
return false;
}
// 设置空投舱参数
Log.Message($"[Airdrop] Creating drop pod at {dropCell} with {contents.Count} items");
// 检查目标单元格是否有效
if (!dropCell.IsValid || !dropCell.InBounds(Map))
{
Log.Error($"[Airdrop] Invalid drop cell: {dropCell}");
return false;
}
// 创建空投舱信息 - 使用 DropPodInfo 而不是 ActiveTransporterInfo
ActiveTransporterInfo dropPodInfo = new ActiveTransporterInfo();
dropPodInfo.openDelay = 180; // 3秒后打开
dropPodInfo.leaveSlag = true;
// 创建容器并添加物品
ThingOwner container = new ThingOwner<Thing>();
foreach (Thing thing in contents)
{
if (thing != null)
{
if (!container.TryAdd(thing, true))
{
Log.Error($"[Airdrop] Failed to add {thing.Label} to drop pod");
}
else
{
Log.Message($"[Airdrop] Added {thing.Label} to drop pod");
}
}
}
if (container.Count == 0)
{
Log.Warning("[Airdrop] No items were successfully added to drop pod");
return false;
}
dropPodInfo.innerContainer = container;
// 生成空投舱
DropPodUtility.MakeDropPodAt(dropCell, Map, dropPodInfo);
Log.Message($"[Airdrop] Successfully created drop pod at {dropCell}");
return true;
}
catch (System.Exception ex)
{
Log.Error($"Failed to create drop pod at {dropCell}: {ex}");
Log.Error($"[Airdrop] Failed to create drop pod at {dropCell}: {ex}");
return false;
}
}

View File

@@ -86,6 +86,7 @@
<Compile Include="Ability\WULA_AbilityEnergyLance\EnergyLance.cs" />
<Compile Include="Ability\WULA_AbilityEnergyLance\EnergyLanceExtension.cs" />
<Compile Include="Ability\WULA_AbilityCallSkyfaller\CompAbilityEffect_CallSkyfaller.cs" />
<Compile Include="BuildingComp\Building_ExtraGraphics.cs" />
<Compile Include="BuildingComp\Building_MapObserver.cs" />
<Compile Include="BuildingComp\WULA_BuildingBombardment\CompBuildingBombardment.cs" />
<Compile Include="Ability\WULA_AbilityCallSkyfaller\CompProperties_AbilityCallSkyfaller.cs" />

11
mod.vdf Normal file
View File

@@ -0,0 +1,11 @@
"workshopitem"
{
"appid" "294100"
"contentfolder" "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\WulaFallenEmpireTest"
"previewfile" "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\WulaFallenEmpireTest\\About\\Preview.png"
"visibility" "0"
"title" "WulaFallenEmpire V2"
"changenote" "1.6"
"publishedfileid" "3604325124"
}