新机械体

This commit is contained in:
Tourswen
2025-11-28 23:53:52 +08:00
parent 744c110ab8
commit 728d52259c
37 changed files with 678 additions and 244 deletions

View File

@@ -3,12 +3,36 @@
<QuestEditor_Library.CustomMapDataDef>
<defName>Wula_PIA_Legion_Escort_Traitor_Map</defName>
<label>失联的前哨站</label>
<size>(64, 1, 64)</size>
<size>(50, 1, 46)</size>
<isPart>true</isPart>
<commonality>0</commonality>
<pawns>
<li>
<key>(32, 0, 31)</key>
<key>(18, 0, 17)</key>
<value>
<li>
<dataName>AttackerC</dataName>
<kind>Wula_PIA_Light_Unit</kind>
<count>1</count>
<faction>AncientsHostile</faction>
<spawnType>MapGeneration</spawnType>
</li>
</value>
</li>
<li>
<key>(25, 0, 17)</key>
<value>
<li>
<dataName>AttackerB</dataName>
<kind>Wula_PIA_Light_Unit</kind>
<count>1</count>
<faction>AncientsHostile</faction>
<spawnType>MapGeneration</spawnType>
</li>
</value>
</li>
<li>
<key>(21, 0, 21)</key>
<value>
<li>
<dataName>Traitor</dataName>
@@ -22,253 +46,272 @@
</li>
</value>
</li>
<li>
<key>(27, 0, 23)</key>
<value>
<li>
<dataName>AttackerA</dataName>
<kind>Wula_PIA_Light_Unit</kind>
<count>1</count>
<faction>AncientsHostile</faction>
<spawnType>MapGeneration</spawnType>
</li>
</value>
</li>
</pawns>
<terrainsRect>
<li>
<key>WulaFloor</key>
<value>
<li>(23,25,50,35)</li>
<li>(28,23,42,24)</li>
<li>(32,20,34,22)</li>
<li>(31,22,31,22)</li>
<li>(35,21,37,22)</li>
<li>(39,18,41,22)</li>
<li>(38,22,38,22)</li>
<li>(43,24,45,24)</li>
<li>(34,36,48,36)</li>
<li>(34,37,47,37)</li>
<li>(34,38,46,38)</li>
<li>(35,39,46,40)</li>
<li>(37,41,46,43)</li>
<li>(37,44,44,46)</li>
<li>(12,15,39,25)</li>
<li>(17,13,31,14)</li>
<li>(21,10,23,12)</li>
<li>(20,12,20,12)</li>
<li>(24,11,26,12)</li>
<li>(28,8,30,12)</li>
<li>(27,12,27,12)</li>
<li>(23,26,37,26)</li>
<li>(32,14,34,14)</li>
<li>(23,27,36,27)</li>
<li>(23,28,35,28)</li>
<li>(24,29,35,30)</li>
<li>(26,31,35,33)</li>
<li>(26,34,33,36)</li>
</value>
</li>
</terrainsRect>
<thingDatas>
<li>
<def>WULA_GlobalStorageSenderPod</def>
<faction>Wula_PIA_Legion_Faction</faction>
<def>Sandbags</def>
<stuff>Cloth</stuff>
<faction>WULA_Awakened_Synth</faction>
<allRect>
<li>(40,42,40,42)</li>
<li>(42,42,42,42)</li>
</allRect>
</li>
<li>
<def>WULA_OrbitalTradeBeacon</def>
<faction>Wula_PIA_Legion_Faction</faction>
<allRect>
<li>(40,27,40,27)</li>
<li>(41,43,41,43)</li>
</allRect>
</li>
<li>
<def>WulaWall</def>
<faction>Wula_PIA_Legion_Faction</faction>
<allRect>
<li>(22,23,24,24)</li>
<li>(22,25,22,25)</li>
<li>(27,20,32,20)</li>
<li>(19,28,22,28)</li>
<li>(26,22,27,23)</li>
<li>(27,21,28,21)</li>
<li>(25,24,26,24)</li>
<li>(19,29,19,32)</li>
<li>(22,27,22,27)</li>
<li>(34,16,39,17)</li>
<li>(21,33,22,35)</li>
<li>(37,18,38,21)</li>
<li>(22,36,23,37)</li>
<li>(29,31,29,36)</li>
<li>(37,22,37,25)</li>
<li>(24,37,24,38)</li>
<li>(30,33,30,36)</li>
<li>(25,38,27,38)</li>
<li>(41,20,42,21)</li>
<li>(42,22,48,22)</li>
<li>(31,36,33,36)</li>
<li>(43,23,48,23)</li>
<li>(33,37,33,38)</li>
<li>(48,24,48,28)</li>
<li>(46,28,47,28)</li>
<li>(35,41,36,47)</li>
<li>(51,26,52,31)</li>
<li>(37,47,45,47)</li>
<li>(51,33,52,37)</li>
<li>(47,41,48,43)</li>
<li>(45,44,47,44)</li>
<li>(45,45,46,46)</li>
</allRect>
</li>
<li>
<def>Filth_RubbleBuilding</def>
<allRect>
<li>(20,26,22,26)</li>
<li>(29,18,29,18)</li>
<li>(32,19,32,19)</li>
<li>(33,18,33,18)</li>
<li>(20,32,20,33)</li>
<li>(39,18,40,18)</li>
<li>(40,19,40,19)</li>
<li>(29,37,31,37)</li>
<li>(28,38,28,38)</li>
<li>(42,28,42,28)</li>
<li>(36,36,36,36)</li>
<li>(35,38,35,38)</li>
<li>(34,40,34,40)</li>
<li>(38,37,38,37)</li>
<li>(50,24,50,24)</li>
<li>(33,45,33,45)</li>
<li>(41,38,41,38)</li>
<li>(51,25,51,25)</li>
<li>(52,24,52,24)</li>
<li>(50,35,50,35)</li>
<li>(49,40,50,40)</li>
<li>(50,39,52,39)</li>
</allRect>
</li>
<li>
<def>Filth_Trash</def>
<allRect>
<li>(29,25,29,25)</li>
<li>(25,29,25,29)</li>
<li>(35,23,36,23)</li>
<li>(42,29,42,29)</li>
<li>(45,32,45,32)</li>
<li>(5,9,8,9)</li>
<li>(5,10,5,12)</li>
<li>(16,4,17,4)</li>
<li>(16,5,16,6)</li>
<li>(17,3,19,3)</li>
<li>(3,18,4,18)</li>
<li>(3,19,3,21)</li>
<li>(4,21,4,21)</li>
<li>(23,1,26,1)</li>
<li>(6,29,6,30)</li>
<li>(7,30,7,31)</li>
<li>(8,31,9,31)</li>
<li>(34,2,36,2)</li>
<li>(36,3,36,3)</li>
<li>(6,36,6,39)</li>
<li>(38,6,41,6)</li>
<li>(7,39,9,39)</li>
<li>(41,7,41,9)</li>
<li>(17,39,17,41)</li>
<li>(21,39,21,41)</li>
<li>(18,41,20,41)</li>
<li>(44,19,46,19)</li>
<li>(27,42,31,42)</li>
<li>(45,22,46,22)</li>
<li>(46,20,46,21)</li>
<li>(45,27,46,27)</li>
<li>(46,28,46,29)</li>
<li>(32,44,34,44)</li>
<li>(41,38,41,41)</li>
<li>(38,41,40,41)</li>
<li>(48,32,48,34)</li>
</allRect>
</li>
<li>
<def>Filth_Slime</def>
<allRect>
<li>(18,15,18,15)</li>
<li>(21,24,21,24)</li>
<li>(31,12,31,12)</li>
<li>(28,26,28,26)</li>
<li>(15,36,15,36)</li>
<li>(32,24,32,24)</li>
<li>(41,13,41,13)</li>
<li>(40,24,40,24)</li>
<li>(22,42,22,42)</li>
<li>(31,41,31,41)</li>
<li>(45,27,45,27)</li>
<li>(54,13,54,13)</li>
<li>(30,47,30,47)</li>
<li>(47,32,47,32)</li>
<li>(44,38,44,38)</li>
<li>(52,41,52,41)</li>
<li>(45,50,45,50)</li>
</allRect>
</li>
<li>
<def>Corpse_WulaSpecies</def>
<rotation>2</rotation>
<allRect>
<li>(18,15,18,15)</li>
<li>(21,24,21,24)</li>
<li>(31,12,31,12)</li>
<li>(28,26,28,26)</li>
<li>(15,36,15,36)</li>
<li>(32,24,32,24)</li>
<li>(41,13,41,13)</li>
<li>(40,24,40,24)</li>
<li>(22,42,22,42)</li>
<li>(31,41,31,41)</li>
<li>(45,27,45,27)</li>
<li>(54,13,54,13)</li>
<li>(30,47,30,47)</li>
<li>(47,32,47,32)</li>
<li>(44,38,44,38)</li>
<li>(52,41,52,41)</li>
<li>(45,50,45,50)</li>
<li>(7,5,7,5)</li>
<li>(10,14,10,14)</li>
<li>(20,2,20,2)</li>
<li>(17,16,17,16)</li>
<li>(21,14,21,14)</li>
<li>(4,26,4,26)</li>
<li>(30,3,30,3)</li>
<li>(29,14,29,14)</li>
<li>(11,32,11,32)</li>
<li>(20,31,20,31)</li>
<li>(34,17,34,17)</li>
<li>(19,37,19,37)</li>
<li>(36,22,36,22)</li>
<li>(43,3,43,3)</li>
<li>(33,28,33,28)</li>
<li>(41,31,41,31)</li>
<li>(34,40,34,40)</li>
</allRect>
</li>
<li>
<def>WULA_Wall_Flag_Building</def>
<faction>Wula_PIA_Legion_Faction</faction>
<allRect>
<li>(34,15,34,15)</li>
<li>(39,15,39,15)</li>
<li>(23,5,23,5)</li>
<li>(28,5,28,5)</li>
</allRect>
</li>
<li>
<def>WulaWall</def>
<faction>Wula_PIA_Legion_Faction</faction>
<allRect>
<li>(11,13,13,14)</li>
<li>(11,15,11,15)</li>
<li>(16,10,21,10)</li>
<li>(15,12,16,13)</li>
<li>(16,11,17,11)</li>
<li>(8,18,11,18)</li>
<li>(14,14,15,14)</li>
<li>(11,17,11,17)</li>
<li>(8,19,8,22)</li>
<li>(23,6,28,7)</li>
<li>(10,23,11,25)</li>
<li>(26,8,27,11)</li>
<li>(18,21,18,26)</li>
<li>(11,26,12,27)</li>
<li>(26,12,26,15)</li>
<li>(19,23,19,26)</li>
<li>(13,27,13,28)</li>
<li>(14,28,16,28)</li>
<li>(30,10,31,11)</li>
<li>(20,26,22,26)</li>
<li>(31,12,37,12)</li>
<li>(32,13,37,13)</li>
<li>(22,27,22,28)</li>
<li>(24,31,25,37)</li>
<li>(35,18,37,18)</li>
<li>(37,14,37,17)</li>
<li>(40,16,41,21)</li>
<li>(26,37,34,37)</li>
<li>(40,23,41,27)</li>
<li>(36,31,37,33)</li>
<li>(34,34,36,34)</li>
<li>(34,35,35,36)</li>
</allRect>
</li>
<li>
<def>WULA_Holographic_Flag_Building</def>
<faction>Wula_PIA_Legion_Faction</faction>
<allRect>
<li>(13,7,13,7)</li>
<li>(34,7,34,7)</li>
<li>(14,33,14,33)</li>
<li>(41,35,41,35)</li>
</allRect>
</li>
<li>
<def>Wula_Base_Laser_Turret</def>
<faction>Wula_PIA_Legion_Faction</faction>
<allRect>
<li>(18,21,18,21)</li>
<li>(19,47,19,47)</li>
<li>(50,18,50,18)</li>
<li>(50,49,50,49)</li>
<li>(7,11,7,11)</li>
<li>(8,37,8,37)</li>
<li>(39,8,39,8)</li>
<li>(39,39,39,39)</li>
</allRect>
</li>
<li>
<def>Corpse_Wula_AI_Heavy_Panzer</def>
<rotation>2</rotation>
<position>(42,0,30)</position>
</li>
<li>
<def>WULA_Holographic_Flag_Building</def>
<faction>Wula_PIA_Legion_Faction</faction>
<def>Filth_RubbleBuilding</def>
<allRect>
<li>(24,17,24,17)</li>
<li>(45,17,45,17)</li>
<li>(25,43,25,43)</li>
<li>(52,45,52,45)</li>
<li>(9,16,11,16)</li>
<li>(18,8,18,8)</li>
<li>(21,9,21,9)</li>
<li>(22,8,22,8)</li>
<li>(9,22,9,23)</li>
<li>(28,8,29,8)</li>
<li>(29,9,29,9)</li>
<li>(18,27,20,27)</li>
<li>(17,28,17,28)</li>
<li>(31,18,31,18)</li>
<li>(25,26,25,26)</li>
<li>(24,28,24,28)</li>
<li>(23,30,23,30)</li>
<li>(27,27,27,27)</li>
<li>(30,28,30,28)</li>
<li>(22,35,22,35)</li>
<li>(39,14,39,14)</li>
<li>(40,15,40,15)</li>
<li>(41,14,41,14)</li>
<li>(39,25,39,25)</li>
<li>(38,30,39,30)</li>
<li>(39,29,41,29)</li>
</allRect>
</li>
<li>
<def>WulaDoor</def>
<faction>Wula_PIA_Legion_Faction</faction>
<position>(40,0,20)</position>
<position>(29,0,10)</position>
</li>
<li>
<def>Stool</def>
<stuff>WULA_Alloy</stuff>
<faction>Wula_PIA_Legion_Faction</faction>
<position>(31,0,34)</position>
<def>AncientTank</def>
<position>(45,0,12)</position>
</li>
<li>
<def>WULA_Cube_Productor</def>
<faction>Wula_PIA_Legion_Faction</faction>
<position>(31,0,35)</position>
<def>Filth_Trash</def>
<allRect>
<li>(18,15,18,15)</li>
<li>(14,19,14,19)</li>
<li>(24,13,25,13)</li>
<li>(31,19,31,19)</li>
<li>(34,22,34,22)</li>
</allRect>
</li>
<li>
<def>WULA_Charging_Station_Synth</def>
<faction>Wula_PIA_Legion_Faction</faction>
<allRect>
<li>(43,24,43,24)</li>
<li>(45,24,45,24)</li>
<li>(47,24,47,24)</li>
<li>(32,14,32,14)</li>
<li>(34,14,34,14)</li>
<li>(36,14,36,14)</li>
</allRect>
</li>
<li>
<def>WULA_Machine_Recharger</def>
<faction>Wula_PIA_Legion_Faction</faction>
<allRect>
<li>(25,27,25,27)</li>
<li>(25,32,25,32)</li>
<li>(14,17,14,17)</li>
<li>(14,22,14,22)</li>
</allRect>
</li>
<li>
<def>AncientTank</def>
<faction>PlayerColony</faction>
<position>(56,0,22)</position>
<def>WULA_OrbitalTradeBeacon</def>
<faction>Wula_PIA_Legion_Faction</faction>
<allRect>
<li>(29,17,29,17)</li>
<li>(30,33,30,33)</li>
</allRect>
</li>
<li>
<def>ChessTable</def>
<stuff>WoodLog</stuff>
<faction>WULA_Awakened_Synth</faction>
<position>(35,0,17)</position>
</li>
<li>
<def>Stool</def>
<stuff>WULA_Alloy</stuff>
<faction>Wula_PIA_Legion_Faction</faction>
<position>(20,0,24)</position>
</li>
<li>
<def>WULA_Cube_Productor</def>
<faction>Wula_PIA_Legion_Faction</faction>
<position>(20,0,25)</position>
</li>
<li>
<def>AncientPipes</def>
<faction>PlayerColony</faction>
<allRect>
<li>(10,38,13,38)</li>
<li>(10,39,11,41)</li>
<li>(13,39,13,39)</li>
<li>(18,37,18,37)</li>
<li>(7,27,7,27)</li>
<li>(0,28,2,28)</li>
<li>(0,29,0,31)</li>
<li>(2,29,2,29)</li>
</allRect>
</li>
<li>
<def>WULA_GlobalStorageSenderPod</def>
<faction>Wula_PIA_Legion_Faction</faction>
<allRect>
<li>(29,32,29,32)</li>
<li>(31,32,31,32)</li>
</allRect>
</li>
</thingDatas>
<lordDatas>
<li>
<name>default</name>
<lordJobData Class="QuestEditor_Library.LordJobData" />
<faction></faction>
</li>
</lordDatas>
</QuestEditor_Library.CustomMapDataDef>
</Defs>

View File

@@ -282,6 +282,25 @@
</children>
</EffecterDef>
<DamageDef ParentName="StunBase">
<defName>WULA_Mech_Drop</defName>
<label>EMP</label>
<externalViolenceForMechanoids>true</externalViolenceForMechanoids>
<deathMessage>{0} has been EMPed to death.</deathMessage>
<harmsHealth>false</harmsHealth>
<impactSoundType>Electric</impactSoundType>
<defaultDamage>50</defaultDamage>
<explosionSnowMeltAmount>0</explosionSnowMeltAmount>
<!-- <explosionCellFleck>BlastEMP</explosionCellFleck> -->
<!-- <explosionColorEdge>(0.8, 0.8, 0.8, 0.8)</explosionColorEdge>
<explosionInteriorFleck>ElectricalSpark</explosionInteriorFleck> -->
<soundExplosion>Explosion_Vaporize</soundExplosion>
<combatLogRules>Damage_EMP</combatLogRules>
<causeStun>true</causeStun>
<stunResistStat MayRequireAnyOf="Ludeon.RimWorld.Biotech,Ludeon.RimWorld.Anomaly">EMPResistance</stunResistStat>
<stunAdaptationTicks>2200</stunAdaptationTicks>
<explosionCenterEffecter>GiantExplosion</explosionCenterEffecter>
</DamageDef>
<DamageDef ParentName="StunBase">
<defName>WULA_Mech_EMP_Drop</defName>
<label>EMP</label>

View File

@@ -196,6 +196,31 @@
<li>Wula_AI_Heavy_Panzer_Weapon</li>
</weaponTags>
</PawnKindDef>
<PawnKindDef ParentName="HeavyMechanoidKind">
<defName>Wula_Mech_Mobile_Shield</defName> <!-- 修改了defName以避免冲突 -->
<label>MSm-8"放射盾"</label>
<race>Wula_Mech_Mobile_Shield</race>
<combatPower>500</combatPower>
<allowInMechClusters>false</allowInMechClusters>
<defaultFactionType>PlayerColony</defaultFactionType>
<canMeleeAttack>false</canMeleeAttack>
<lifeStages>
<li>
<bodyGraphicData>
<texPath>Wula/Things/WULA_Mobile_Shield/Bodies/Naked_Thin</texPath>
<maskPath>Wula/Things/WULA_Cat/AllegianceOverlays/None</maskPath>
<shaderType>CutoutWithOverlay</shaderType>
<graphicClass>Graphic_Multi</graphicClass>
<drawSize>5</drawSize>
<shadowData>
<volume>(1.4, 1.8, 1.4)</volume>
</shadowData>
</bodyGraphicData>
</li>
</lifeStages>
<controlGroupPortraitZoom>0.7</controlGroupPortraitZoom>
</PawnKindDef>
<PawnKindDef ParentName="HeavyMechanoidKind">
<defName>WULA_Mobile_Bunker</defName> <!-- 修改了defName以避免冲突 -->

View File

@@ -1,8 +1,8 @@
<Defs>
<PrefabDef>
<PrefabDef>
<defName>NewPrefab</defName> <!-- rename -->
<size>(13,14)</size>
</PrefabDef>
</PrefabDef>
<PrefabDef>
<defName>WULA_NewColonyBase</defName> <!-- rename -->

View File

@@ -17,9 +17,9 @@
<rootSelectionWeight>0</rootSelectionWeight>
<autoAccept>true</autoAccept>
<sendAvailableLetter>false</sendAvailableLetter>
<defaultChallengeRating>4</defaultChallengeRating> <!-- 挑战等级(星级) -->
<isRootSpecial>true</isRootSpecial> <!-- 特殊任务 -->
<defaultCharity>false</defaultCharity> <!-- 是否仁善 -->
<defaultChallengeRating>4</defaultChallengeRating>
<isRootSpecial>true</isRootSpecial>
<defaultCharity>false</defaultCharity>
<!-- 命名规则 -->
<questNameRules>
<rulesStrings>
@@ -59,7 +59,7 @@
<!-- 受到伤害后,断爪立刻敌对 -->
<li Class="QuestNode_SetFaction">
<inSignal>Traitor.0.TookDamageFromPlayer</inSignal>
<inSignal>Traitor.0.TookDamage</inSignal>
<faction>AncientsHostile</faction>
</li>
@@ -67,6 +67,9 @@
<li Class="QuestNode_Signal">
<inSignal>Traitor.0.Killed</inSignal>
<!-- 等待特定信号再打开窗口 -->
</li>
<li Class="QuestNode_Signal">
<inSignal>Traitor.0.FinallyHostile</inSignal>
<node Class="QuestNode_End">
<outcome>Success</outcome>
<sendStandardLetter>true</sendStandardLetter>

View File

@@ -334,10 +334,21 @@
<li>WULA_Colony_License_LV1_Technology</li>
</prerequisites>
</ResearchProjectDef>
<ResearchProjectDef ParentName="WULAtechBase">
<defName>Wula_Fusion_Generators_Technology</defName>
<researchViewX>1.00</researchViewX>
<researchViewY>3.80</researchViewY>
<label>聚变发电空投许可</label>
<description>允许殖民地申请空投聚变发电机,一种输出功率不高但是维护极其容易的发电机。</description>
<baseCost>600</baseCost>
<prerequisites>
<li>WULA_Colony_License_LV1_Technology</li>
</prerequisites>
</ResearchProjectDef>
<ResearchProjectDef ParentName="WULAtechBase">
<defName>WULA_DarkEnergy_Generators_Technology</defName>
<researchViewX>10.00</researchViewX>
<researchViewY>2.70</researchViewY>
<researchViewX>9.00</researchViewX>
<researchViewY>3.80</researchViewY>
<label>暗物质发电空投许可</label>
<description>允许殖民地申请空投暗物质发电机,一种输出功率极为恐怖却非常消耗资源的发电机。</description>
<baseCost>600</baseCost>
@@ -388,7 +399,21 @@
<researchViewX>5.00</researchViewX>
<researchViewY>5.60</researchViewY>
<label>战车空投许可</label>
<description>允许殖民地申请空投HAp-6"战车",乌拉帝国的中型战争机械,以悬浮的方式穿梭于战场之上,使用穿透力强大的战车炮和导弹打击敌方。</description>
<description>允许殖民地申请空投HAp-6"战车",乌拉帝国的中型战争机械,以悬浮的方式穿梭于战场之上,使用穿透力强大的战车炮、火箭弹和臼炮打击敌方。</description>
<baseCost>800</baseCost>
<hiddenPrerequisites>
<li>WULA_Synth_Productor_Technology</li>
</hiddenPrerequisites>
<prerequisites>
<li>WULA_Colony_License_LV2_Technology</li>
</prerequisites>
</ResearchProjectDef>
<ResearchProjectDef ParentName="WULAtechBase">
<defName>Wula_Mech_Mobile_Shield_Technology</defName>
<researchViewX>6.00</researchViewX>
<researchViewY>5.60</researchViewY>
<label>放射盾空投许可</label>
<description>允许殖民地申请空投MSm-8"放射盾",乌拉帝国的中型战争机械,一种多足机械体,拥有密不透风的反射盾的同时,还可以灼烧那些企图进入护盾区域内的宵小之辈。</description>
<baseCost>800</baseCost>
<hiddenPrerequisites>
<li>WULA_Synth_Productor_Technology</li>

View File

@@ -43,7 +43,7 @@
</statBases>
<size>(1,1)</size>
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
<resourcesFractionWhenDeconstructed>1</resourcesFractionWhenDeconstructed>
<resourcesFractionWhenDeconstructed>0</resourcesFractionWhenDeconstructed>
<stuffCategories Inherit="False"/>
<researchPrerequisites Inherit="False">
<li>WULA_Structure_Technology</li>
@@ -57,6 +57,7 @@
<destroySound>BuildingDestroyed_Metal_Small</destroySound>
<isAirtight>false</isAirtight>
<isStuffableAirtight>false</isStuffableAirtight>
<isPlaceOverableWall>false</isPlaceOverableWall>
</building>
<designationCategory>WULA_Buildings</designationCategory>
<comps>
@@ -446,7 +447,7 @@
</statBases>
<size>(3,3)</size>
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
<resourcesFractionWhenDeconstructed>1</resourcesFractionWhenDeconstructed>
<resourcesFractionWhenDeconstructed>0</resourcesFractionWhenDeconstructed>
<researchPrerequisites Inherit="False">
<li>WULA_Synth_Maintain_Technology</li>
</researchPrerequisites>
@@ -645,7 +646,7 @@
<Flammability>0</Flammability>
</statBases>
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
<resourcesFractionWhenDeconstructed>1</resourcesFractionWhenDeconstructed>
<resourcesFractionWhenDeconstructed>0</resourcesFractionWhenDeconstructed>
<costList>
<WULA_Alloy>40</WULA_Alloy>
<ComponentIndustrial>2</ComponentIndustrial>
@@ -876,7 +877,7 @@
</statBases>
<size>(3,3)</size>
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
<resourcesFractionWhenDeconstructed>1</resourcesFractionWhenDeconstructed>
<resourcesFractionWhenDeconstructed>0</resourcesFractionWhenDeconstructed>
<costList>
<WULA_Alloy>20</WULA_Alloy>
<ComponentIndustrial>1</ComponentIndustrial>
@@ -1044,7 +1045,7 @@
</statBases>
<size>(1,2)</size>
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
<resourcesFractionWhenDeconstructed>1</resourcesFractionWhenDeconstructed>
<resourcesFractionWhenDeconstructed>0</resourcesFractionWhenDeconstructed>
<costList>
<WULA_Alloy>30</WULA_Alloy>
<ComponentIndustrial>1</ComponentIndustrial>
@@ -1204,7 +1205,7 @@
</statBases>
<size>(1,1)</size>
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
<resourcesFractionWhenDeconstructed>1</resourcesFractionWhenDeconstructed>
<resourcesFractionWhenDeconstructed>0</resourcesFractionWhenDeconstructed>
<costList>
<Steel>50</Steel>
<ComponentIndustrial>1</ComponentIndustrial>
@@ -1380,7 +1381,7 @@
</statBases>
<size>(5,5)</size>
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
<resourcesFractionWhenDeconstructed>1</resourcesFractionWhenDeconstructed>
<resourcesFractionWhenDeconstructed>0</resourcesFractionWhenDeconstructed>
<costList>
<WULA_Alloy>50</WULA_Alloy>
<WULA_Dark_Matter_Item>2</WULA_Dark_Matter_Item>
@@ -1569,7 +1570,7 @@
<rotatable>false</rotatable>
<terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
<researchPrerequisites Inherit="False">
<li>WULA_DarkEnergy_Generators_Technology</li>
<li>Wula_Fusion_Generators_Technology</li>
</researchPrerequisites>
<statBases>
<MaxHitPoints>1</MaxHitPoints>
@@ -1579,7 +1580,7 @@
</statBases>
<size>(3,3)</size>
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
<resourcesFractionWhenDeconstructed>1</resourcesFractionWhenDeconstructed>
<resourcesFractionWhenDeconstructed>0</resourcesFractionWhenDeconstructed>
<costList>
<WULA_Alloy>40</WULA_Alloy>
<ComponentIndustrial>2</ComponentIndustrial>

View File

@@ -49,7 +49,7 @@
</statBases>
<size>(3,3)</size>
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
<resourcesFractionWhenDeconstructed>1</resourcesFractionWhenDeconstructed>
<resourcesFractionWhenDeconstructed>0</resourcesFractionWhenDeconstructed>
<building>
<destroySound>BuildingDestroyed_Metal_Small</destroySound>
</building>
@@ -96,7 +96,7 @@
</angleCurve>
<!-- <spawnThing></spawnThing> -->
<explosionRadius>6</explosionRadius>
<explosionDamage>WULA_Mech_EMP_Drop</explosionDamage>
<explosionDamage>WULA_Mech_Drop</explosionDamage>
<explosionDamageFactor>0</explosionDamageFactor>
</skyfaller>
<comps>
@@ -161,7 +161,7 @@
</statBases>
<size>(3,3)</size>
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
<resourcesFractionWhenDeconstructed>1</resourcesFractionWhenDeconstructed>
<resourcesFractionWhenDeconstructed>0</resourcesFractionWhenDeconstructed>
<building>
<destroySound>BuildingDestroyed_Metal_Small</destroySound>
</building>
@@ -208,7 +208,7 @@
</angleCurve>
<!-- <spawnThing></spawnThing> -->
<explosionRadius>6</explosionRadius>
<explosionDamage>WULA_Mech_EMP_Drop</explosionDamage>
<explosionDamage>WULA_Mech_Drop</explosionDamage>
<explosionDamageFactor>0</explosionDamageFactor>
</skyfaller>
<comps>
@@ -224,6 +224,118 @@
</comps>
</ThingDef>
<!-- 放射盾 -->
<ThingDef ParentName="BuildingBase">
<defName>WULA_Mobile_Shield_Cleanzone</defName>
<label>MSm-8"放射盾"</label>
<description>清理出一块场地并准备好资源,使得乌拉帝国母舰可以向此处投放大型战争机械。建造好的信标可以收起或移至他处。\n\n放射盾是乌拉帝国的中型战争机械常被用于镇压异族聚居地的暴动。它形状非常奇怪根本分不出头在哪但是不要因此小瞧这个机械体——它能释放强大的立场盾在很大一片区域内反射大量炮火并且机体放射出来的辐射会严重地杀伤进入反射盾范围内的敌人。在相关许可开放后它甚至可以支持机械乌拉使用其内置的相位场进行区域传送。</description>
<uiIconPath>Wula/Things/WULA_Mobile_Shield/WULA_Mobile_Shield_Incoming</uiIconPath>
<uiIconScale>1.33</uiIconScale>
<uiIconOffset>(0, -0.1)</uiIconOffset>
<minifiedDef>MinifiedThing</minifiedDef>
<tickerType>Normal</tickerType>
<descriptionHyperlinks>
<ThingDef>Wula_AI_Heavy_Panzer</ThingDef>
</descriptionHyperlinks>
<thingCategories Inherit="False">
<li>BuildingsMisc</li>
</thingCategories>
<graphicData>
<texPath>Wula/Building/WULA_Dropping_Building_Cleanzone</texPath>
<graphicClass>Graphic_Multi</graphicClass>
<drawSize>(3,3)</drawSize>
<damageData>
<enabled>false</enabled>
</damageData>
</graphicData>
<costList Inherit="False">
<WULA_Alloy>300</WULA_Alloy>
<WULA_Charge_Cube>18</WULA_Charge_Cube>
<ComponentSpacer>2</ComponentSpacer>
<Uranium>50</Uranium>
</costList>
<altitudeLayer>Building</altitudeLayer>
<passability>PassThroughOnly</passability>
<castEdgeShadows>false</castEdgeShadows>
<fillPercent>0.5</fillPercent>
<canOverlapZones>false</canOverlapZones>
<pathCost>0</pathCost>
<hasInteractionCell>false</hasInteractionCell>
<rotatable>false</rotatable>
<researchPrerequisites Inherit="False">
<li>Wula_AI_Heavy_Panzer_Technology</li>
</researchPrerequisites>
<statBases>
<MaxHitPoints>1</MaxHitPoints>
<WorkToBuild>1</WorkToBuild>
<Mass>1</Mass>
<Flammability>0</Flammability>
</statBases>
<size>(3,3)</size>
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
<resourcesFractionWhenDeconstructed>0</resourcesFractionWhenDeconstructed>
<building>
<destroySound>BuildingDestroyed_Metal_Small</destroySound>
</building>
<placeWorkers>
<li>WulaFallenEmpire.PlaceWorker_CustomRadius</li>
</placeWorkers>
<designationCategory>WULA_Buildings</designationCategory>
<comps>
<li Class="WulaFallenEmpire.CompProperties_SkyfallerCaller">
<skyfallerDef>WULA_Mobile_Shield_Incoming</skyfallerDef> <!-- 替换为您想要的Skyfaller类型 -->
<destroyBuilding>true</destroyBuilding>
<delayTicks>1</delayTicks>
<allowThinRoof>true</allowThinRoof>
<allowThickRoof>false</allowThickRoof>
</li>
</comps>
</ThingDef>
<ThingDef ParentName="SkyfallerBase">
<defName>WULA_Mobile_Shield_Incoming</defName>
<label>MSm-8"放射盾"(空投中)</label>
<size>(1,1)</size>
<thingClass>WulaFallenEmpire.Skyfaller_PawnSpawner</thingClass>
<graphicData>
<texPath>Wula/Things/WULA_Mobile_Shield/WULA_Mobile_Shield_Incoming</texPath>
<graphicClass>Graphic_Single</graphicClass>
<shaderType>CutoutFlying</shaderType>
<drawSize>(5,5)</drawSize>
</graphicData>
<skyfaller>
<movementType>Accelerate</movementType>
<shadow>Things/Skyfaller/SkyfallerShadowDropPod</shadow>
<shadowSize>(5, 5)</shadowSize>
<anticipationSound>DropPod_Fall</anticipationSound>
<anticipationSoundTicks>100</anticipationSoundTicks>
<impactSound>Explosion_Vaporize</impactSound>
<moteSpawnTime>0.05</moteSpawnTime>
<motesPerCell>1</motesPerCell>
<cameraShake>1</cameraShake>
<angleCurve>
<points>
<li>(0,0)</li>
<li>(1, 1)</li>
</points>
</angleCurve>
<!-- <spawnThing></spawnThing> -->
<explosionRadius>6</explosionRadius>
<explosionDamage>WULA_Mech_Drop</explosionDamage>
<explosionDamageFactor>0</explosionDamageFactor>
</skyfaller>
<comps>
<li Class="CompProperties_Effecter">
<effecterDef>Smoke_Joint</effecterDef>
</li>
<li Class="WulaFallenEmpire.CompProperties_SkyfallerPawnSpawner">
<pawnKind>Wula_Mech_Mobile_Shield</pawnKind>
<faction>PlayerColony</faction>
<spawnDrafted>true</spawnDrafted>
<spawnHostile>false</spawnHostile>
</li>
</comps>
</ThingDef>
<!-- 陆行舰 -->
<ThingDef ParentName="BuildingBase">
<defName>Wula_Mech_Mobile_Factory_Cleanzone</defName>
@@ -272,7 +384,7 @@
</costList>
<size>(3,3)</size>
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
<resourcesFractionWhenDeconstructed>1</resourcesFractionWhenDeconstructed>
<resourcesFractionWhenDeconstructed>0</resourcesFractionWhenDeconstructed>
<building>
<destroySound>BuildingDestroyed_Metal_Small</destroySound>
</building>

View File

@@ -96,6 +96,9 @@
<li Class="CompProperties_Effecter">
<effecterDef>Smoke_Joint</effecterDef>
</li>
<li Class="WulaFallenEmpire.CompProperties_SkyfallerFaction">
<!-- 不设置 factionDef默认使用玩家派系 -->
</li>
</comps>
</ThingDef>
</Defs>

View File

@@ -1374,6 +1374,107 @@
</li>
</comps>
</AlienRace.ThingDef_AlienRace>
<AlienRace.ThingDef_AlienRace ParentName="WULA_BaseMechanoid">
<defName>Wula_Mech_Mobile_Shield</defName> <!-- 修改了defName以避免冲突 -->
<label>MSm-8"放射盾"</label>
<description>乌拉帝国的中型战争机械,常被用于镇压异族聚居地的暴动。它形状非常奇怪,根本分不出头在哪,但是不要因此小瞧这个机械体——它能释放强大的立场盾,在很大一片区域内反射大量炮火,并且机体放射出来的辐射会严重地杀伤进入反射盾范围内的敌人。在相关许可开放后,它甚至可以支持机械乌拉使用其内置的相位场进行区域传送。</description>
<alienRace>
<raceRestriction>
<onlyUseRaceRestrictedApparel>true</onlyUseRaceRestrictedApparel>
<onlyUseRaceRestrictedWeapons>true</onlyUseRaceRestrictedWeapons>
</raceRestriction>
<compatibility>
<isFlesh>false</isFlesh>
</compatibility>
</alienRace>
<statBases>
<BandwidthCost>1</BandwidthCost>
<MoveSpeed>3</MoveSpeed>
</statBases>
<race>
<body>Mech_Warqueen</body>
<baseBodySize>50</baseBodySize>
<lifeStageAges>
<li>
<def>MechanoidFullyFormed</def>
<minAge>0</minAge>
<soundCall>Pawn_Wula_Mech_Mobile_Factory_Call</soundCall>
</li>
</lifeStageAges>
<baseHealthScale>5</baseHealthScale>
</race>
<tools Inherit="False">
<li>
<label>碾压</label>
<capacities>
<li>Blunt</li>
</capacities>
<power>360</power>
<cooldownTime>8</cooldownTime>
<linkedBodyPartsGroup>Torso</linkedBodyPartsGroup>
<ensureLinkedBodyPartsGroupAlwaysUsable>true</ensureLinkedBodyPartsGroupAlwaysUsable>
</li>
</tools>
<comps>
<!-- 护盾无法在此绘制 -->
<li Class="WulaFallenEmpire.CompProperties_AreaShield">
<radius>15</radius>
<baseHitPoints>300</baseHitPoints>
<rechargeDelay>2400</rechargeDelay>
<rechargeHitPointsIntervalTicks>30</rechargeHitPointsIntervalTicks>
<!-- 效果器配置 -->
<absorbEffecter>Interceptor_BlockedProjectile</absorbEffecter>
<interceptEffecter>Interceptor_BlockedProjectile</interceptEffecter>
<breakEffecter>Shield_Break</breakEffecter>
<reactivateEffecter>BulletShieldGenerator_Reactivate</reactivateEffecter>
<color>(0.9, 0.2, 0.2, 0.5)</color> <!-- 护盾气泡的颜色 (RGBA) -->
<!-- 拦截设置 -->
<interceptGroundProjectiles>true</interceptGroundProjectiles>
<interceptNonHostileProjectiles>false</interceptNonHostileProjectiles>
<interceptAirProjectiles>true</interceptAirProjectiles>
<!-- 反射设置 -->
<canReflect>true</canReflect>
<reflectChance>0.85</reflectChance>
<reflectAngleRange>30</reflectAngleRange>
<reflectCost>0</reflectCost>
<reflectEffecter>Interceptor_BlockedProjectile</reflectEffecter>
</li>
<li Class="WulaFallenEmpire.CompProperties_AreaDamage">
<radius>15</radius>
<damageIntervalTicks>30</damageIntervalTicks>
<damageDef>Wula_Dark_Matter_Beam</damageDef>
<damageAmount>15</damageAmount>
<scaleWithPsychicSensitivity>false</scaleWithPsychicSensitivity>
<affectFriendly>false</affectFriendly>
<affectNeutral>false</affectNeutral>
<affectHostile>true</affectHostile>
<affectBuildings>false</affectBuildings>
<ignoreFactionRelations>false</ignoreFactionRelations>
<startEnabled>false</startEnabled>
<toggleLabel>热辐射</toggleLabel>
<toggleDescription>MSm-8"放射盾"可以打开外壳,蒸发胆敢靠近其的敌军——这同时会使得它伤害附近所有的散落物品。</toggleDescription>
<toggleIconPath>Wula/UI/Commands/Wula_Psi_Titan_AreaDamage</toggleIconPath>
</li>
<!-- 区域传送组件 -->
<li Class="WulaFallenEmpire.CompProperties_AreaTeleporter">
<teleportRadius>20</teleportRadius>
<stunTicks>60</stunTicks>
<allowedRaces>
<li>WulaSpecies</li>
</allowedRaces>
<onlyPawnsInSameFaction>true</onlyPawnsInSameFaction>
<entryEffecter>Skip_Entry</entryEffecter>
<exitEffecter>Skip_Exit</exitEffecter>
<teleportSound>Psycast_Skip_Entry</teleportSound>
</li>
</comps>
</AlienRace.ThingDef_AlienRace>
<AlienRace.ThingDef_AlienRace ParentName="WULA_BaseMechanoid">
<defName>Wula_Mech_Mobile_Factory</defName> <!-- 修改了defName以避免冲突 -->
<label>MFm-2"陆行舰"</label>
@@ -1695,21 +1796,6 @@
<toggleDescription>MFm-2"陆行舰"可以将舰身稍微下沉一些并创造低压区,以碾压靠近的敌军——这同时会使得它伤害附近所有的散落物品。</toggleDescription>
<toggleIconPath>Wula/UI/Commands/Wula_Mech_Mobile_Factory_AreaDamage</toggleIconPath>
</li>
<li Class="WulaFallenEmpire.CompProperties_AreaTeleporter">
<teleportRadius>20</teleportRadius>
<stunTicks>60</stunTicks>
<allowedRaces>
<li>WulaSpecies</li>
</allowedRaces>
<onlyPawnsInSameFaction>true</onlyPawnsInSameFaction>
<entryEffecter>Skip_Entry</entryEffecter>
<exitEffecter>Skip_Exit</exitEffecter>
<teleportSound>Psycast_Skip_Entry</teleportSound>
</li>
</comps>
</AlienRace.ThingDef_AlienRace>
<ThingDef ParentName="BaseMechanoidWalker">

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 KiB

View File

@@ -4,6 +4,7 @@ using System.Text;
using UnityEngine;
using Verse;
using Verse.AI;
using LudeonTK;
namespace WulaFallenEmpire
{
@@ -222,6 +223,23 @@ namespace WulaFallenEmpire
}
yield return spawnCommand;
// 开发模式按钮:立即结束冷却
if (Prefs.DevMode && IsCooldownActive)
{
Command_Action devCommand = new Command_Action
{
defaultLabel = "Dev: 立即结束冷却",
defaultDesc = "立即结束转换冷却时间",
action = () =>
{
// 将生成时间设置为足够早,使冷却立即结束
spawnTick = Find.TickManager.TicksGame - (24 * 2500 + 1);
Messages.Message("转换冷却已立即结束", MessageTypeDefOf.SilentInput);
}
};
yield return devCommand;
}
}
// 回收附近机械族
@@ -334,6 +352,22 @@ namespace WulaFallenEmpire
return Mathf.Max(0, remainingTicks / 2500f);
}
// 开发模式方法:立即结束冷却
[DebugAction("机械族回收器", "立即结束冷却", actionType = DebugActionType.Action, allowedGameStates = AllowedGameStates.Playing)]
public static void DevEndCooldown()
{
Building_MechanoidRecycler selectedRecycler = Find.Selector.SingleSelectedThing as Building_MechanoidRecycler;
if (selectedRecycler != null)
{
selectedRecycler.spawnTick = Find.TickManager.TicksGame - (24 * 2500 + 1);
Messages.Message("转换冷却已立即结束", MessageTypeDefOf.SilentInput);
}
else
{
Messages.Message("请先选择一个机械族回收器", MessageTypeDefOf.RejectInput);
}
}
public override void ExposeData()
{
base.ExposeData();

View File

@@ -6,6 +6,7 @@ namespace WulaFallenEmpire
public class Skyfaller_PrefabSpawner : Skyfaller
{
public string prefabDefName;
private Faction prefabFaction; // 缓存派系信息
protected override void SpawnThings()
{
@@ -23,8 +24,30 @@ namespace WulaFallenEmpire
return;
}
// 获取派系信息
Faction faction = GetPrefabFaction();
// Correct parameter order based on compiler error: prefabDef, map, position, rotation
PrefabUtility.SpawnPrefab(prefabDef, base.Map, base.Position, base.Rotation);
PrefabUtility.SpawnPrefab(prefabDef, base.Map, base.Position, base.Rotation, faction);
}
private Faction GetPrefabFaction()
{
// 如果已经缓存了派系信息,直接返回
if (prefabFaction != null)
return prefabFaction;
// 检查是否有 CompSkyfallerFaction 组件
var factionComp = this.TryGetComp<CompSkyfallerFaction>();
if (factionComp != null)
{
prefabFaction = factionComp.GetFactionForPrefab();
return prefabFaction;
}
// 如果没有组件,默认使用玩家派系
prefabFaction = Faction.OfPlayer;
return prefabFaction;
}
public override void ExposeData()

View File

@@ -0,0 +1,16 @@
using RimWorld;
using Verse;
namespace WulaFallenEmpire
{
public class CompProperties_SkyfallerFaction : CompProperties
{
public FactionDef factionDef;
public bool usePlayerFactionIfNull = true; // 如果 factionDef 为 null 时使用玩家派系
public CompProperties_SkyfallerFaction()
{
compClass = typeof(CompSkyfallerFaction);
}
}
}

View File

@@ -0,0 +1,30 @@
using RimWorld;
using Verse;
namespace WulaFallenEmpire
{
public class CompSkyfallerFaction : ThingComp
{
public CompProperties_SkyfallerFaction Props => (CompProperties_SkyfallerFaction)props;
public Faction GetFactionForPrefab()
{
// 如果指定了派系定义,使用该派系
if (Props.factionDef != null)
{
Faction faction = Find.FactionManager.FirstFactionOfDef(Props.factionDef);
if (faction != null)
return faction;
}
// 如果没有指定派系定义,根据设置决定
if (Props.usePlayerFactionIfNull)
{
return Faction.OfPlayer;
}
// 如果都不满足,返回 null使用默认行为
return null;
}
}
}

View File

@@ -114,12 +114,12 @@ namespace WulaFallenEmpire
Pawn newPawn = PawnGenerator.GeneratePawn(request);
// 添加转换组件,只传递建筑定义,不传递数量
// 关键修改传递当前的机械族数量6个
var transformComp = newPawn.GetComp<CompTransformIntoBuilding>();
if (transformComp != null)
{
// 只设置建筑定义,不设置恢复数量
transformComp.SetRestoreData(parent.def);
// 传递建筑定义和机械族数量
transformComp.SetRestoreData(parent.def, Props.requiredCapacity);
}
else
{
@@ -133,8 +133,8 @@ namespace WulaFallenEmpire
transformComp.props = compProps;
newPawn.AllComps.Add(transformComp);
transformComp.Initialize(compProps);
// 只设置建筑定义,不设置恢复数量
transformComp.SetRestoreData(parent.def);
// 传递建筑定义和机械族数量
transformComp.SetRestoreData(parent.def, Props.requiredCapacity);
}
// 移除建筑
@@ -149,7 +149,8 @@ namespace WulaFallenEmpire
Find.Selector.Select(newPawn);
}
Messages.Message("WULA_BuildingTransformedToPawn".Translate(parent.Label, newPawn.LabelCap), MessageTypeDefOf.PositiveEvent);
Messages.Message("WULA_BuildingTransformedToPawn".Translate(parent.Label, newPawn.LabelCap, Props.requiredCapacity),
MessageTypeDefOf.PositiveEvent);
// 播放转换效果
PlayTransformEffects(position, map);

View File

@@ -11,8 +11,9 @@ namespace WulaFallenEmpire
private CompProperties_TransformIntoBuilding Props => (CompProperties_TransformIntoBuilding)props;
private Pawn Pawn => (Pawn)parent;
// 恢复数据 - 存储建筑定义,不存储数量
// 恢复数据 - 存储建筑定义和机械族数量
private ThingDef restoreBuildingDef;
private int restoreMechCount = 6; // 默认6个符合你的需求
// 缓存校验结果
private bool? lastValidationResult = null;
@@ -28,13 +29,14 @@ namespace WulaFallenEmpire
{
base.PostExposeData();
Scribe_Defs.Look(ref restoreBuildingDef, "restoreBuildingDef");
// 移除存储数量的保存
Scribe_Values.Look(ref restoreMechCount, "restoreMechCount", 6); // 默认6个
}
// 设置恢复数据 - 设置建筑定义
public void SetRestoreData(ThingDef buildingDef)
// 设置恢复数据 - 设置建筑定义和机械族数量
public void SetRestoreData(ThingDef buildingDef, int mechCount = 6)
{
restoreBuildingDef = buildingDef;
restoreMechCount = mechCount;
}
public override IEnumerable<Gizmo> CompGetGizmosExtra()
@@ -73,6 +75,10 @@ namespace WulaFallenEmpire
sb.AppendLine();
sb.Append("WULA_WillRestoreTo".Translate(restoreBuildingDef.LabelCap));
// 显示恢复的机械族数量
sb.AppendLine();
sb.Append("WULA_RestoreMechCount".Translate(restoreMechCount));
// 显示目标建筑的最大存储容量
var recyclerProps = restoreBuildingDef.GetCompProperties<CompProperties_MechanoidRecycler>();
if (recyclerProps != null)
@@ -231,8 +237,12 @@ namespace WulaFallenEmpire
Building newBuilding = (Building)GenSpawn.Spawn(buildingDef, desiredPosition, map, WipeMode.Vanish);
newBuilding.SetFaction(faction);
// 不再恢复机械族计数,新建筑为空状态
// 如果需要,可以在这里设置初始状态,但不再传递之前的数量
// 关键修改:恢复机械族数量
var recycler = newBuilding as Building_MechanoidRecycler;
if (recycler != null)
{
recycler.SetMechanoidCount(restoreMechCount);
}
// 添加建筑转换组件
var transformComp = newBuilding.TryGetComp<CompTransformAtFullCapacity>();
@@ -256,7 +266,8 @@ namespace WulaFallenEmpire
Find.Selector.Select(newBuilding);
}
Messages.Message("WULA_PawnDeployedAsBuilding".Translate(Pawn.LabelCap, newBuilding.Label), MessageTypeDefOf.PositiveEvent);
Messages.Message("WULA_PawnDeployedAsBuilding".Translate(Pawn.LabelCap, newBuilding.Label, restoreMechCount),
MessageTypeDefOf.PositiveEvent);
// 播放转换效果
PlayTransformEffects(desiredPosition, map);

View File

@@ -124,6 +124,8 @@
<Compile Include="BuildingComp\WULA_SkyfallerCaller\CompProperties_PrefabSkyfallerCaller.cs" />
<Compile Include="BuildingComp\WULA_SkyfallerCaller\Skyfaller_PrefabSpawner.cs" />
<Compile Include="BuildingComp\WULA_SkyfallerCaller\WulaSkyfallerWorldComponent.cs" />
<Compile Include="BuildingComp\WULA_SkyfallerCaller\WULA_SkyfallerFactioncs\CompProperties_SkyfallerFaction.cs" />
<Compile Include="BuildingComp\WULA_SkyfallerCaller\WULA_SkyfallerFactioncs\CompSkyfallerFaction.cs" />
<Compile Include="BuildingComp\WULA_StorageTurret\CompProperties_StorageTurret.cs" />
<Compile Include="BuildingComp\WULA_StorageTurret\CompStorageTurret.cs" />
<Compile Include="BuildingComp\WULA_TransformAtFullCapacity\CompProperties_TransformAtFullCapacity.cs" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB