This commit is contained in:
Tourswen
2025-12-10 00:18:14 +08:00
parent dd32bb4306
commit c5056320ac
38 changed files with 1377 additions and 258 deletions

View File

@@ -656,92 +656,6 @@
</corePart>
</BodyDef>
<BodyDef>
<defName>WULA_Mobile_Bunker_Body</defName>
<label>猫猫地堡</label>
<corePart>
<def>Torso</def>
<height>Middle</height>
<depth>Outside</depth>
<groups>
<li>Torso</li>
</groups>
<parts>
<li>
<def>WULA_Mobile_Bunker_Bodypart</def>
<coverage>0.025</coverage>
<depth>Outside</depth>
<groups>
<li>Torso</li>
</groups>
<parts>
<li>
<def>SightSensor</def>
<coverage>0.13</coverage>
<groups>
<li>Torso</li>
</groups>
</li>
<li>
<def>WULA_AI_Core_Bodypart</def>
<coverage>0.025</coverage>
<depth>Inside</depth>
<groups>
<li>Torso</li>
</groups>
</li>
</parts>
</li>
<li>
<def>Leg</def>
<customLabel>抬碉堡的猫猫(其一)</customLabel>
<coverage>0.13</coverage>
<height>Bottom</height>
<groups>
<li>Legs</li>
</groups>
</li>
<li>
<def>Leg</def>
<customLabel>抬碉堡的猫猫(其二)</customLabel>
<coverage>0.13</coverage>
<height>Bottom</height>
<groups>
<li>Legs</li>
</groups>
</li>
<li>
<def>Leg</def>
<customLabel>抬碉堡的猫猫(其三)</customLabel>
<coverage>0.13</coverage>
<height>Bottom</height>
<groups>
<li>Legs</li>
</groups>
</li>
<li>
<def>Leg</def>
<customLabel>抬碉堡的猫猫(其四)</customLabel>
<coverage>0.13</coverage>
<height>Bottom</height>
<groups>
<li>Legs</li>
</groups>
</li>
</parts>
<parts>
<li>
<def>WULA_Outer_Armor_Bodypart</def>
<coverage>0.99</coverage>
<height>Top</height>
<groups>
<li>Torso</li>
</groups>
</li>
</parts>
</corePart>
</BodyDef>
<BodyDef>
<defName>WULA_AI_Heavy_Panzer_Body</defName>
<label>智能战车</label>

View File

@@ -287,7 +287,7 @@
<explosionCellFleck>Blast_WULA_Plasma_Explosive</explosionCellFleck>
<explosionColorCenter>(0.2, 0.8, 0.3)</explosionColorCenter>
<explosionColorEdge>(0.1, 0.9, 0.5)</explosionColorEdge>
<explosionInteriorFleck>ElectricalSpark_WULA_Plasma_Explosive</explosionInteriorFleck>
<!-- <explosionInteriorFleck>ElectricalSpark_WULA_Plasma_Explosive</explosionInteriorFleck> -->
<soundExplosion>Explosion_EMP</soundExplosion>
<combatLogRules>Damage_Bomb</combatLogRules>
</DamageDef>
@@ -431,6 +431,8 @@
<!-- <explosionCellFleck>BlastEMP</explosionCellFleck>
<explosionColorEdge>(0.8, 0.8, 0.8, 0.8)</explosionColorEdge> -->
<explosionCenterEffecter>WULA_Disturber_Turret_Bomb_Shockwave</explosionCenterEffecter>
<buildingDamageFactorImpassable>10</buildingDamageFactorImpassable>
<buildingDamageFactorPassable>10</buildingDamageFactorPassable>
<modExtensions>
<li Class="WulaFallenEmpire.DamageDefExtension_TerrainCover">
@@ -462,6 +464,8 @@
<!-- <explosionCellFleck>BlastEMP</explosionCellFleck>
<explosionColorEdge>(0.8, 0.8, 0.8, 0.8)</explosionColorEdge> -->
<explosionCenterEffecter>WULA_Disturber_Turret_Bomb_Shockwave</explosionCenterEffecter>
<buildingDamageFactorImpassable>10</buildingDamageFactorImpassable>
<buildingDamageFactorPassable>10</buildingDamageFactorPassable>
<modExtensions>
<li Class="WulaFallenEmpire.DamageDefExtension_TerrainCover">
@@ -482,6 +486,39 @@
</li> -->
</modExtensions>
</DamageDef>
<DamageDef ParentName="Bomb">
<defName>WULA_Sow_Excavator_Shoke_Damage</defName>
<label>高能震波</label>
<!-- <workerClass>WulaFallenEmpire.DamageWorker_ExtraDamage</workerClass> -->
<workerClass>WulaFallenEmpire.DamageWorker_ExplosionWithTerrain</workerClass>
<defaultDamage>1</defaultDamage>
<defaultStoppingPower>10</defaultStoppingPower>
<defaultArmorPenetration>2</defaultArmorPenetration>
<!-- <explosionCellFleck>BlastEMP</explosionCellFleck>
<explosionColorEdge>(0.8, 0.8, 0.8, 0.8)</explosionColorEdge> -->
<explosionCenterEffecter>WULA_Disturber_Turret_Bomb_Shockwave</explosionCenterEffecter>
<buildingDamageFactorImpassable>10</buildingDamageFactorImpassable>
<buildingDamageFactorPassable>10</buildingDamageFactorPassable>
<modExtensions>
<li Class="WulaFallenEmpire.DamageDefExtension_TerrainCover">
<terrainToSpawn>SoilRich</terrainToSpawn>
</li>
<!-- <li Class="WulaFallenEmpire.DamageDef_ExtraDamageExtension">
<extraLabel>穿透伤害</extraLabel>
<showExtraLog>true</showExtraLog>
<extraDamages>
<li>
<damageDef>EMP</damageDef>
<amount>60</amount>
<isPercentage>false</isPercentage>
<armorPenetration>2</armorPenetration>
</li>
</extraDamages>
</li> -->
</modExtensions>
</DamageDef>
<DamageDef ParentName="Bomb">
<defName>WULA_DarkMatterBomb</defName>

View File

@@ -144,6 +144,31 @@
</weaponTags>
<weaponMoney>9999~9999</weaponMoney>
</PawnKindDef>
<PawnKindDef ParentName="Mech_WULA_Cat_Soldier_PawnKind">
<defName>Mech_WULA_Fire_Cat</defName>
<label>CAt-55"突击猫猫"</label>
<race>Mech_WULA_Fire_Cat</race>
<combatPower>500</combatPower>
<defaultFactionType>AncientsHostile</defaultFactionType>
<destroyGearOnDrop>true</destroyGearOnDrop>
<forceDeathOnDowned>true</forceDeathOnDowned>
<forceNoDeathNotification>true</forceNoDeathNotification>
<lifeStages Inherit="False">
<li>
<bodyGraphicData>
<texPath>Wula/Things/WULA_Fire_Cat/WULA_Cat_Thin</texPath>
<maskPath>Wula/Things/WULA_Fire_Cat/AllegianceOverlays/None</maskPath>
<shaderType>CutoutWithOverlay</shaderType>
<graphicClass>Graphic_Multi</graphicClass>
<drawSize>1.2</drawSize>
</bodyGraphicData>
</li>
</lifeStages>
<weaponTags>
<li>Wula_Assault_Cat_Weapon</li>
</weaponTags>
<weaponMoney>9999~9999</weaponMoney>
</PawnKindDef>
<PawnKindDef ParentName="HeavyMechanoidKind">
<defName>Wula_AI_Heavy_Panzer</defName> <!-- 修改了defName以避免冲突 -->

View File

@@ -331,14 +331,38 @@
<parms>
<allowedThreats>Raids</allowedThreats>
<onDays>1.0</onDays>
<offDays>0.25</offDays>
<offDays>1.25</offDays>
<minSpacingDays>0.04</minSpacingDays>
<numIncidentsRange>1~2</numIncidentsRange>
<currentThreatPointsFactor>1.1</currentThreatPointsFactor>
<currentThreatPointsFactor>2.5</currentThreatPointsFactor>
<minThreatPoints>500</minThreatPoints>
</parms>
</node>
</li>
<!-- 钻机空袭 -->
<li Class="QuestNode_Delay">
<delayTicks>300000</delayTicks>
<node Class="QuestNode_Sequence">
<nodes>
<li Class="QuestNode_Letter">
<label>挖掘机袭击</label>
<letterDef>NegativeEvent</letterDef>
<text>几个高速移动的黑点正在拖着浓浓的黑烟尾迹飞向殖民地······那是什么?</text>
</li>
<li Class="QuestNode_SendSignals">
<outSignals>wulaCombatExcavatorComing</outSignals>
</li>
<li Class="WulaFallenEmpire.QuestNode_SpawnPrefabSkyfallerCaller">
<inSignal>wulaCombatExcavatorComing</inSignal>
<thingDef>WULA_Combat_Excavator_Hostile_Incoming</thingDef>
<spawnCount>4</spawnCount>
<spreadOut>true</spreadOut>
<sendMessageOnSuccess>false</sendMessageOnSuccess>
<sendMessageOnFailure>false</sendMessageOnFailure>
</li>
</nodes>
</node>
</li>
<!-- - - - - - - - -->
<!-- End conditions -->
@@ -552,7 +576,7 @@
<portraitPath>Wula/Events/Portraits/WULA_Legion_2</portraitPath>
<characterName>「军团」,P.I.A</characterName>
<descriptions>
<li>看起来你们的殖民地还不错,井井有条并且符合帝国法典和章程——你们值得一个更高位的许可,稍后我会通过运输舱把晋升许可寄给你们。\n\n此外我也将你们的支援系统重置了你们可以再次申请之前申请过的支援并且新的支援也会开放给你们。继续发展你们的殖民地我就能帮你们申请更高级的权限。\n\n帝国荣光永存。</li>
<li>哎呀,看起来好像出了一些小意外,不过你们的殖民地很好地解决了问题,井井有条并且符合帝国法典和章程——你们值得一个更高位的许可,稍后我会通过运输舱把晋升许可寄给你们。\n\n此外我也将你们的支援系统重置了你们可以再次申请之前申请过的支援并且新的支援也会开放给你们。继续发展你们的殖民地我就能帮你们申请更高级的权限。\n\n帝国荣光永存。</li>
</descriptions>
<immediateEffects>
<li>

View File

@@ -1,12 +1,22 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<IncidentDef>
<defName>WULA_GiveQuest_Intro_NewColony</defName>
<category>GiveQuest</category>
<label>乌拉帝国的新殖民地介绍</label>
<targetTags>
<li>Map_PlayerHome</li>
</targetTags>
<questScriptDef>WULA_Intro_NewColony</questScriptDef>
<workerClass>IncidentWorker_GiveQuest</workerClass>
<baseChance>0</baseChance>
</IncidentDef>
<QuestScriptDef>
<defName>WULA_Intro_NewColony</defName>
<rootSelectionWeight>0</rootSelectionWeight>
<autoAccept>false</autoAccept>
<sendAvailableLetter>true</sendAvailableLetter>
<defaultChallengeRating>1</defaultChallengeRating> <!-- 挑战等级(星级) -->
<isRootSpecial>true</isRootSpecial> <!-- 特殊任务 -->
<defaultCharity>false</defaultCharity> <!-- 是否仁善 -->
<!-- 命名规则 -->
<questNameRules>

View File

@@ -43,6 +43,90 @@
<!-- 随机 -->
<li Class="QuestNode_RandomNode">
<nodes>
<!-- 钻机空袭 -->
<li Class="QuestNode_Sequence">
<nodes>
<li Class="QuestNode_ResolveQuestName">
<rules>
<rulesStrings>
<li>questName->挖掘机空袭</li>
</rulesStrings>
</rules>
</li>
<li Class="QuestNode_ResolveQuestDescription">
<rules>
<rulesStrings>
<li>questDescription->乌拉帝国进步派叛军向殖民地发射了挖掘机集群!</li>
</rulesStrings>
</rules>
</li>
<li Class="QuestNode_Letter">
<label>挖掘机空袭</label>
<letterDef>NegativeEvent</letterDef>
<text>乌拉帝国进步派叛军向殖民地发射了挖掘机集群!</text>
</li>
<li Class="WulaFallenEmpire.QuestNode_SpawnPrefabSkyfallerCaller">
<thingDef>WULA_Combat_Excavator_Hostile_Incoming</thingDef>
<spawnCount>1</spawnCount>
<spreadOut>true</spreadOut>
<sendMessageOnSuccess>false</sendMessageOnSuccess>
<sendMessageOnFailure>false</sendMessageOnFailure>
</li>
<li Class="QuestNode_Greater">
<value1>$points</value1>
<value2>2999</value2>
<node Class="QuestNode_Sequence">
<nodes>
<li Class="WulaFallenEmpire.QuestNode_SpawnPrefabSkyfallerCaller">
<thingDef>WULA_Combat_Excavator_Hostile_Incoming</thingDef>
<spawnCount>1</spawnCount>
<spreadOut>true</spreadOut>
<sendMessageOnSuccess>false</sendMessageOnSuccess>
<sendMessageOnFailure>false</sendMessageOnFailure>
</li>
</nodes>
</node>
</li>
<li Class="QuestNode_Greater">
<value1>$points</value1>
<value2>5999</value2>
<node Class="QuestNode_Sequence">
<nodes>
<li Class="WulaFallenEmpire.QuestNode_SpawnPrefabSkyfallerCaller">
<thingDef>WULA_Combat_Excavator_Hostile_Incoming</thingDef>
<spawnCount>1</spawnCount>
<spreadOut>true</spreadOut>
<sendMessageOnSuccess>false</sendMessageOnSuccess>
<sendMessageOnFailure>false</sendMessageOnFailure>
</li>
</nodes>
</node>
</li>
<li Class="QuestNode_Greater">
<value1>$points</value1>
<value2>9999</value2>
<node Class="QuestNode_Sequence">
<nodes>
<li Class="WulaFallenEmpire.QuestNode_SpawnPrefabSkyfallerCaller">
<thingDef>WULA_Combat_Excavator_Hostile_Incoming</thingDef>
<spawnCount>2</spawnCount>
<spreadOut>true</spreadOut>
<sendMessageOnSuccess>false</sendMessageOnSuccess>
<sendMessageOnFailure>false</sendMessageOnFailure>
</li>
</nodes>
</node>
</li>
<li Class="QuestNode_ChangeFactionGoodwill">
<faction>Wula_PIA_Legion_Faction</faction>
<change>10</change>
<reason>WULA_Attack_Progressive</reason>
</li>
</nodes>
</li>
<!-- 游击队 -->
<li Class="QuestNode_Sequence">
<nodes>
@@ -60,6 +144,11 @@
</rulesStrings>
</rules>
</li>
<li Class="QuestNode_Letter">
<label>游击队攻击</label>
<letterDef>NegativeEvent</letterDef>
<text>乌拉帝国进步派叛军的派出了一支游击队攻击殖民地!</text>
</li>
<li Class="QuestNode_RandomRaid">
<faction>Wula_Progressive_Faction</faction>
<useCurrentThreatPoints>true</useCurrentThreatPoints>
@@ -68,6 +157,11 @@
<customLetterLabel TKey="LetterLabelChasing">乌拉帝国 进步派的游击队</customLetterLabel>
<customLetterText TKey="LetterTextChasing">一群乌拉帝国进步派的游击队正在攻击你的殖民地!</customLetterText>
</li>
<li Class="QuestNode_ChangeFactionGoodwill">
<faction>Wula_PIA_Legion_Faction</faction>
<change>10</change>
<reason>WULA_Attack_Progressive</reason>
</li>
</nodes>
</li>
<!-- 突击舰 -->
@@ -305,6 +399,11 @@
</nodes>
</node>
</li>
<li Class="QuestNode_ChangeFactionGoodwill">
<faction>Wula_PIA_Legion_Faction</faction>
<change>10</change>
<reason>WULA_Attack_Progressive</reason>
</li>
</nodes>
</li>
<!-- 猫猫特战 -->
@@ -326,6 +425,7 @@
</li>
<li Class="WulaFallenEmpire.QuestNode_SpawnPrefabSkyfallerCaller">
<thingDef>Mech_WULA_Cat_Cloak_Sniper_Incoming</thingDef>
<spreadOut>true</spreadOut>
<spawnCount>1</spawnCount>
<sendMessageOnSuccess>false</sendMessageOnSuccess>
<sendMessageOnFailure>false</sendMessageOnFailure>
@@ -339,6 +439,7 @@
<li Class="WulaFallenEmpire.QuestNode_SpawnPrefabSkyfallerCaller">
<thingDef>Mech_WULA_Cat_Cloak_Sniper_Incoming</thingDef>
<spawnCount>1</spawnCount>
<spreadOut>true</spreadOut>
<sendMessageOnSuccess>false</sendMessageOnSuccess>
<sendMessageOnFailure>false</sendMessageOnFailure>
</li>
@@ -353,6 +454,7 @@
<nodes>
<li Class="WulaFallenEmpire.QuestNode_SpawnPrefabSkyfallerCaller">
<thingDef>Mech_WULA_Cat_Cloak_Sniper_Incoming</thingDef>
<spreadOut>true</spreadOut>
<spawnCount>1</spawnCount>
<sendMessageOnSuccess>false</sendMessageOnSuccess>
<sendMessageOnFailure>false</sendMessageOnFailure>
@@ -368,6 +470,7 @@
<nodes>
<li Class="WulaFallenEmpire.QuestNode_SpawnPrefabSkyfallerCaller">
<thingDef>Mech_WULA_Cat_Cloak_Sniper_Incoming</thingDef>
<spreadOut>true</spreadOut>
<spawnCount>2</spawnCount>
<sendMessageOnSuccess>false</sendMessageOnSuccess>
<sendMessageOnFailure>false</sendMessageOnFailure>
@@ -380,11 +483,6 @@
</nodes>
</li>
<li Class="QuestNode_ChangeFactionGoodwill">
<faction>Wula_PIA_Legion_Faction</faction>
<change>10</change>
<reason>WULA_Attack_Progressive</reason>
</li>
<li Class="QuestNode_End" />
</nodes>
</root>

View File

@@ -506,6 +506,20 @@
<li>WULA_Colony_License_LV2_Technology</li>
</prerequisites>
</ResearchProjectDef>
<ResearchProjectDef ParentName="WULAtechBase">
<defName>WULA_Sow_Excavator_Technology</defName>
<researchViewX>7.00</researchViewX>
<researchViewY>1.50</researchViewY>
<label>挖掘机许可</label>
<description>允许殖民地申请空投挖掘机,一种一次性的工业设备,可以将附近的土壤变得适宜播种——当然也能杀人。</description>
<baseCost>1500</baseCost>
<hiddenPrerequisites>
<li>WULA_Bunker_Drop_Technology</li>
</hiddenPrerequisites>
<prerequisites>
<li>WULA_Colony_License_LV2_Technology</li>
</prerequisites>
</ResearchProjectDef>
<ResearchProjectDef ParentName="WULAtechBase">
<defName>WULA_Turret_Base_Mortar_Technology</defName>
<researchViewX>10.00</researchViewX>
@@ -518,6 +532,17 @@
<li>WULA_Synth_Armor_2_Technology</li>
</prerequisites>
</ResearchProjectDef>
<ResearchProjectDef ParentName="WULAtechBase">
<defName>WULA_Combat_Excavator_Technology</defName>
<researchViewX>9.00</researchViewX>
<researchViewY>1.50</researchViewY>
<label>战斗挖掘机许可</label>
<description>允许殖民地申请空投战斗挖掘机,一种一次性的工业设备,可以引发毁灭性的熔岩崩塌,攻击结束后会同步部署烟雾弹和机械体辅助进攻。</description>
<baseCost>3500</baseCost>
<prerequisites>
<li>WULA_Colony_License_LV3_Technology</li>
</prerequisites>
</ResearchProjectDef>
<ResearchProjectDef ParentName="WULAtechBase">
<defName>Wula_Disturber_Turret_Technology</defName>
<researchViewX>11.00</researchViewX>

View File

@@ -153,9 +153,9 @@
</li>
<!-- 开局介绍事件 -->
<li Class="ScenPart_CreateQuest">
<def>CreateQuest</def>
<questDef>WULA_Intro_NewColony</questDef>
<li Class="ScenPart_CreateIncident">
<def>CreateIncident</def>
<incident>WULA_GiveQuest_Intro_NewColony</incident>
</li>
<!-- Game start dialog -->
@@ -259,9 +259,9 @@
</li>
<!-- 开局介绍事件 -->
<li Class="ScenPart_CreateQuest">
<def>CreateQuest</def>
<questDef>WULA_Intro_NewColony</questDef>
<li Class="ScenPart_CreateIncident">
<def>CreateIncident</def>
<incident>WULA_GiveQuest_Intro_NewColony</incident>
</li>
<!-- Game start dialog -->

View File

@@ -1068,138 +1068,4 @@
</li>
</comps>
</ThingDef>
<!-- 钻机 -->
<ThingDef ParentName="BuildingBase">
<defName>WULA_Combat_Excavator</defName>
<label>战斗挖掘机</label>
<description>乌拉帝国用于发起游击战的隧道挖掘机,在指定地点部署后,钻机将通过高速旋转的刀片引发若干次地震冲击波,随后将单位一股脑放出。</description>
<thingClass>WulaFallenEmpire.Building_ExtraGraphics</thingClass>
<preventDroppingThingsOn>true</preventDroppingThingsOn>
<altitudeLayer>Building</altitudeLayer>
<pathCost>50</pathCost>
<blockWind>true</blockWind>
<passability>PassThroughOnly</passability>
<fillPercent>1</fillPercent>
<size>(1,1)</size>
<drawHighlight>true</drawHighlight>
<tradeability>None</tradeability>
<highlightColor>(0.56, 0.62, 0.9)</highlightColor>
<uiIconPath>Wula/Building/Flag/WULA_Flag_Building_A</uiIconPath>
<designationCategory>WULA_Buildings</designationCategory>
<rotatable>false</rotatable>
<graphicData>
<texPath>Wula/Building/Flag/WULA_Flag_Building_Mount</texPath>
<graphicClass>Graphic_Single</graphicClass>
<drawSize>(1,1)</drawSize>
</graphicData>
<costList>
<WULA_Alloy>4</WULA_Alloy>
</costList>
<statBases>
<MaxHitPoints>99999</MaxHitPoints>
<Flammability>0</Flammability>
<WorkToBuild>1000</WorkToBuild>
<Mass>5</Mass>
</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">
<globalAnimationSpeed>0</globalAnimationSpeed>
<globalAnimationIntensity>0</globalAnimationIntensity>
<graphicLayers>
<li>
<texturePath>Wula/Building/Flag/WULA_Flag_Building_A</texturePath>
<shaderName>MoteGlow</shaderName>
<scale>(1,1)</scale>
<drawOrder>0</drawOrder>
<offset>(0,1,2)</offset>
<animationType>RotateY</animationType>
<animationSpeed>360</animationSpeed> <!-- 比全局慢 -->
<animationIntensity>360</animationIntensity> <!-- 比全局弱 -->
<animationPhase>0</animationPhase>
</li>
<li>
<texturePath>Wula/Building/Flag/WULA_Flag_Building_Mount</texturePath>
<shaderName>Transparent</shaderName>
<scale>(1,1)</scale>
<drawOrder>1</drawOrder>
<offset>(0,1,0)</offset>
<animationSpeed>0</animationSpeed> <!-- 比全局慢 -->
<animationIntensity>0</animationIntensity> <!-- 比全局弱 -->
<animationPhase>0</animationPhase>
</li>
</graphicLayers>
</li>
</modExtensions>
<comps>
<li Class="WulaFallenEmpire.CompProperties_FactionSetter">
<factionDef>Wula_Progressive_Faction</factionDef>
<usePlayerFactionIfNull>true</usePlayerFactionIfNull>
<overrideExistingFaction>false</overrideExistingFaction>
</li>
<li Class="CompProperties_Glower">
<glowRadius>3</glowRadius>
<glowColor>(120,240,252,0)</glowColor>
</li>
<li Class="WulaFallenEmpire.CompProperties_PhaseCombatTower">
<warmupTicks>240</warmupTicks> <!-- 3秒启动期 -->
<explosionCooldownTicks>180</explosionCooldownTicks> <!-- 爆炸间隔1秒 -->
<explosions>
<li>
<damageDef>WULA_Combat_Excavator_Shoke_S_Damage</damageDef>
<radius>6</radius>
<armorPenetration>2</armorPenetration>
<damageAmount>5</damageAmount>
</li>
<li>
<damageDef>WULA_Combat_Excavator_Shoke_S_Damage</damageDef>
<radius>9</radius>
<armorPenetration>2</armorPenetration>
<damageAmount>5</damageAmount>
</li>
<li>
<damageDef>WULA_Combat_Excavator_Shoke_Damage</damageDef>
<radius>9</radius>
<armorPenetration>2</armorPenetration>
<damageAmount>5</damageAmount>
</li>
<li>
<damageDef>Smoke</damageDef>
<radius>12</radius>
<postExplosionGasType>BlindSmoke</postExplosionGasType>
<armorPenetration>2</armorPenetration>
<damageAmount>0</damageAmount>
</li>
</explosions>
<pawnKindDefs>
<li>Mech_WULA_Cat_Constructor</li>
<li>Mech_WULA_Cat_Assault</li>
</pawnKindDefs>
<spawnCount>3</spawnCount> <!-- 生成3个Pawn -->
<spawnIntervalTicks>180</spawnIntervalTicks> <!-- 每3秒生成一个 -->
</li>
</comps>
</ThingDef>
</Defs>

View File

@@ -253,9 +253,6 @@
<li>ITab_ContentsTransporter</li>
<li>ITab_Shells</li>
</inspectorTabs>
<researchPrerequisites>
<li>Shuttles</li>
</researchPrerequisites>
<comps>
<li Class="CompProperties_Shuttle">
<shipDef>Ship_ArmedShuttle</shipDef>

View File

@@ -1756,6 +1756,727 @@
</modExtensions>
</ThingDef>
<!-- 钻机 -->
<ThingDef ParentName="BuildingBase">
<defName>WULA_Combat_Excavator_Cleanzone</defName>
<label>DBm-6"战斗挖掘机"</label>
<description>清理出一块场地并准备好资源,使得乌拉帝国可以向此处投放建筑。\n\nDBm-6"战斗挖掘机"是乌拉帝国用于破坏阵地的挖掘机,从天而降部署在指定地点后,钻机将通过高速旋转的刀片引发若干次地震冲击波,随后将舱内单位一股脑放出。</description>
<uiIconPath>Wula/Building/WULA_Combat_Excavator_Icon</uiIconPath>
<minifiedDef>MinifiedThing</minifiedDef>
<tickerType>Normal</tickerType>
<tradeability>None</tradeability>
<descriptionHyperlinks>
<ThingDef>WULA_Combat_Excavator</ThingDef>
</descriptionHyperlinks>
<thingCategories Inherit="False">
<li>BuildingsMisc</li>
</thingCategories>
<graphicData>
<texPath>Wula/Building/WULA_Dropping_Building_Cleanzone</texPath>
<graphicClass>Graphic_Multi</graphicClass>
<drawSize>(1,1)</drawSize>
<damageData>
<enabled>false</enabled>
</damageData>
</graphicData>
<altitudeLayer>Building</altitudeLayer>
<passability>PassThroughOnly</passability>
<pathCost>40</pathCost>
<castEdgeShadows>false</castEdgeShadows>
<fillPercent>0.5</fillPercent>
<canOverlapZones>false</canOverlapZones>
<hasInteractionCell>false</hasInteractionCell>
<rotatable>false</rotatable>
<researchPrerequisites Inherit="False">
<li>WULA_Combat_Excavator_Technology</li>
</researchPrerequisites>
<statBases>
<MarketValue>0</MarketValue>
<MaxHitPoints>1</MaxHitPoints>
<WorkToBuild>0</WorkToBuild>
<Mass>1</Mass>
<Flammability>0</Flammability>
</statBases>
<size>(1,1)</size>
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
<resourcesFractionWhenDeconstructed>0</resourcesFractionWhenDeconstructed>
<costList Inherit="False">
<WULA_Alloy>20</WULA_Alloy>
<ComponentIndustrial>1</ComponentIndustrial>
<WULA_Excavator_Blade>1</WULA_Excavator_Blade>
</costList>
<building>
<expandHomeArea>false</expandHomeArea>
<destroySound>BuildingDestroyed_Metal_Small</destroySound>
</building>
<placeWorkers>
<li>WulaFallenEmpire.PlaceWorker_CustomRadius</li>
</placeWorkers>
<designationCategory>WULA_Buildings</designationCategory>
<comps>
<li Class="WulaFallenEmpire.CompProperties_CustomRadius">
<radius>9</radius> <!-- 半径大小 -->
<color>(0.5, 0.25, 0.25)</color> <!-- 绿色圆圈 -->
<radiusOffset>0</radiusOffset> <!-- 半径偏移 -->
<showInGUI>true</showInGUI>
<label>冲击半径</label>
<description>钻机降落后,地震波影响的最大范围</description>
<defaultVisible>true</defaultVisible>
</li>
<li Class="WulaFallenEmpire.CompProperties_SkyfallerCaller">
<skyfallerDef>WULA_Combat_Excavator_Incoming</skyfallerDef> <!-- 迫击炮塔空投类型 -->
<destroyBuilding>true</destroyBuilding>
<delayTicks>1</delayTicks>
<allowThinRoof>true</allowThinRoof>
<allowThickRoof>false</allowThickRoof>
</li>
</comps>
</ThingDef>
<ThingDef ParentName="SkyfallerBase">
<defName>WULA_Combat_Excavator_Incoming</defName>
<label>DBm-6"战斗挖掘机"(空投中)</label>
<size>(1,1)</size>
<graphicData>
<texPath>Wula/Building/WULA_Combat_Excavator_Incoming</texPath>
<graphicClass>Graphic_Single</graphicClass>
<shaderType>CutoutFlying</shaderType>
<drawSize>(4,4)</drawSize>
</graphicData>
<skyfaller>
<movementType>Accelerate</movementType>
<shadow>Things/Skyfaller/SkyfallerShadowDropPod</shadow>
<shadowSize>(2, 2)</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>WULA_Combat_Excavator</spawnThing>
</skyfaller>
<comps>
<li Class="CompProperties_Effecter">
<effecterDef>Smoke_Joint</effecterDef>
</li>
</comps>
</ThingDef>
<ThingDef ParentName="BuildingBase">
<defName>WULA_Combat_Excavator</defName>
<label>DBm-6"战斗挖掘机"</label>
<description>乌拉帝国用于破坏阵地的挖掘机,从天而降部署在指定地点后,钻机将通过高速旋转的刀片引发若干次地震冲击波,随后将舱内单位一股脑放出。</description>
<!-- <thingClass>WulaFallenEmpire.Building_ExtraGraphics</thingClass> -->
<preventDroppingThingsOn>true</preventDroppingThingsOn>
<altitudeLayer>Building</altitudeLayer>
<pathCost>50</pathCost>
<blockWind>true</blockWind>
<passability>PassThroughOnly</passability>
<fillPercent>1</fillPercent>
<size>(1,1)</size>
<drawHighlight>true</drawHighlight>
<tradeability>None</tradeability>
<highlightColor>(0.56, 0.62, 0.9)</highlightColor>
<uiIconPath>Wula/Building/WULA_Combat_Excavator_Icon</uiIconPath>
<designationCategory>WULA_Buildings</designationCategory>
<rotatable>false</rotatable>
<graphicData>
<texPath>Wula/Building/WULA_Combat_Excavator</texPath>
<graphicClass>Graphic_Single</graphicClass>
<drawSize>(4,4)</drawSize>
</graphicData>
<costList>
<WULA_Alloy>20</WULA_Alloy>
<ComponentIndustrial>1</ComponentIndustrial>
<WULA_Excavator_Blade>1</WULA_Excavator_Blade>
</costList>
<statBases>
<MaxHitPoints>5000</MaxHitPoints>
<Flammability>0</Flammability>
<WorkToBuild>1000</WorkToBuild>
<Mass>5</Mass>
</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>
<building>
<neverBuildable>true</neverBuildable>
<expandHomeArea>false</expandHomeArea>
<destroySound>BuildingDestroyed_Metal_Big</destroySound>
<paintable>true</paintable>
<isInert>true</isInert>
<deconstructible>false</deconstructible>
<forcedCostLeavings>
<li>WULA_Excavator_Blade</li>
</forcedCostLeavings>
</building>
<damageMultipliers Inherit="False">
<li>
<damageDef>WULA_Combat_Excavator_Shoke_Damage</damageDef>
<multiplier>0.01</multiplier>
</li>
<li>
<damageDef>WULA_Combat_Excavator_Shoke_S_Damage</damageDef>
<multiplier>0.01</multiplier>
</li>
<li>
<damageDef>WULA_Sow_Excavator_Shoke_Damage</damageDef>
<multiplier>0.01</multiplier>
</li>
</damageMultipliers>
<!-- <modExtensions>
<li Class="WulaFallenEmpire.ExtraGraphicsExtension">
<globalAnimationSpeed>0</globalAnimationSpeed>
<globalAnimationIntensity>0</globalAnimationIntensity>
<graphicLayers>
<li>
<texturePath>Wula/Building/Flag/WULA_Flag_Building_A</texturePath>
<shaderName>MoteGlow</shaderName>
<scale>(1,1)</scale>
<drawOrder>0</drawOrder>
<offset>(0,1,2)</offset>
<animationType>RotateY</animationType>
<animationSpeed>360</animationSpeed>
<animationIntensity>360</animationIntensity>
<animationPhase>0</animationPhase>
</li>
<li>
<texturePath>Wula/Building/Flag/WULA_Flag_Building_Mount</texturePath>
<shaderName>Transparent</shaderName>
<scale>(1,1)</scale>
<drawOrder>1</drawOrder>
<offset>(0,1,0)</offset>
<animationSpeed>0</animationSpeed>
<animationIntensity>0</animationIntensity>
<animationPhase>0</animationPhase>
</li>
</graphicLayers>
</li>
</modExtensions> -->
<comps>
<li Class="WulaFallenEmpire.CompProperties_FactionSetter">
<!-- <factionDef>Wula_Progressive_Faction</factionDef> -->
<usePlayerFactionIfNull>true</usePlayerFactionIfNull>
<overrideExistingFaction>false</overrideExistingFaction>
</li>
<li Class="CompProperties_Glower">
<glowRadius>3</glowRadius>
<glowColor>(120,240,252,0)</glowColor>
</li>
<li Class="WulaFallenEmpire.CompProperties_PhaseCombatTower">
<warmupTicks>120</warmupTicks> <!-- 3秒启动期 -->
<explosionCooldownTicks>90</explosionCooldownTicks> <!-- 爆炸间隔1秒 -->
<explosions>
<li>
<damageDef>WULA_Combat_Excavator_Shoke_S_Damage</damageDef>
<radius>6</radius>
<armorPenetration>2</armorPenetration>
<damageAmount>50</damageAmount>
<explosionSound>Wula_Disturber_Turret_Weapon_Explosive</explosionSound>
</li>
<li>
<damageDef>WULA_Combat_Excavator_Shoke_S_Damage</damageDef>
<radius>9</radius>
<armorPenetration>2</armorPenetration>
<damageAmount>50</damageAmount>
<excludeRadius>0.9</excludeRadius>
<explosionSound>Wula_Disturber_Turret_Weapon_Explosive</explosionSound>
</li>
<li>
<damageDef>WULA_Combat_Excavator_Shoke_Damage</damageDef>
<radius>9</radius>
<armorPenetration>2</armorPenetration>
<damageAmount>500</damageAmount>
<excludeRadius>0.9</excludeRadius>
<explosionSound>Wula_Disturber_Turret_Weapon_Explosive</explosionSound>
</li>
<li>
<damageDef>Smoke</damageDef>
<radius>12</radius>
<postExplosionGasType>BlindSmoke</postExplosionGasType>
<armorPenetration>2</armorPenetration>
<damageAmount>0</damageAmount>
<explosionSound>Explosion_Smoke</explosionSound>
</li>
</explosions>
<pawnKindDefs>
<li>Mech_WULA_Fire_Cat</li>
</pawnKindDefs>
<spawnCount>12</spawnCount> <!-- 生成3个Pawn -->
<spawnIntervalTicks>30</spawnIntervalTicks> <!-- 每3秒生成一个 -->
</li>
<li Class="CompProperties_Lifespan">
<lifespanTicks>9000</lifespanTicks>
</li>
</comps>
</ThingDef>
<ThingDef ParentName="BuildingBase">
<defName>WULA_Sow_Excavator_Cleanzone</defName>
<label>DSm-6"挖掘机"</label>
<description>清理出一块场地并准备好资源,使得乌拉帝国可以向此处投放建筑。\n\nDSm-6"挖掘机"是一种通过空投部署的挖掘机,钻机可以通过高速震动将附近的土壤翻出,使得整片区域变得松软易于种植。这种设备的震波杀伤力极大,工作期间切勿靠近!</description>
<uiIconPath>Wula/Building/WULA_Sow_Excavator_Icon</uiIconPath>
<minifiedDef>MinifiedThing</minifiedDef>
<tickerType>Normal</tickerType>
<tradeability>None</tradeability>
<descriptionHyperlinks>
<ThingDef>WULA_Combat_Excavator</ThingDef>
</descriptionHyperlinks>
<thingCategories Inherit="False">
<li>BuildingsMisc</li>
</thingCategories>
<graphicData>
<texPath>Wula/Building/WULA_Dropping_Building_Cleanzone</texPath>
<graphicClass>Graphic_Multi</graphicClass>
<drawSize>(1,1)</drawSize>
<damageData>
<enabled>false</enabled>
</damageData>
</graphicData>
<altitudeLayer>Building</altitudeLayer>
<passability>PassThroughOnly</passability>
<pathCost>40</pathCost>
<castEdgeShadows>false</castEdgeShadows>
<fillPercent>0.5</fillPercent>
<canOverlapZones>false</canOverlapZones>
<hasInteractionCell>false</hasInteractionCell>
<rotatable>false</rotatable>
<researchPrerequisites Inherit="False">
<li>WULA_Sow_Excavator_Technology</li>
</researchPrerequisites>
<statBases>
<MarketValue>0</MarketValue>
<MaxHitPoints>1</MaxHitPoints>
<WorkToBuild>0</WorkToBuild>
<Mass>1</Mass>
<Flammability>0</Flammability>
</statBases>
<size>(1,1)</size>
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
<resourcesFractionWhenDeconstructed>0</resourcesFractionWhenDeconstructed>
<costList>
<WULA_Alloy>50</WULA_Alloy>
<ComponentIndustrial>2</ComponentIndustrial>
<WULA_Excavator_Blade>1</WULA_Excavator_Blade>
</costList>
<building>
<expandHomeArea>false</expandHomeArea>
<destroySound>BuildingDestroyed_Metal_Small</destroySound>
</building>
<placeWorkers>
<li>WulaFallenEmpire.PlaceWorker_CustomRadius</li>
</placeWorkers>
<designationCategory>WULA_Buildings</designationCategory>
<comps>
<li Class="WulaFallenEmpire.CompProperties_CustomRadius">
<radius>13</radius> <!-- 半径大小 -->
<color>(0.5, 0.6, 0.25)</color> <!-- 绿色圆圈 -->
<radiusOffset>0</radiusOffset> <!-- 半径偏移 -->
<showInGUI>true</showInGUI>
<label>冲击半径</label>
<description>钻机降落后,地震波影响的最大范围</description>
<defaultVisible>true</defaultVisible>
</li>
<li Class="WulaFallenEmpire.CompProperties_SkyfallerCaller">
<skyfallerDef>WULA_Sow_Excavator_Incoming</skyfallerDef> <!-- 迫击炮塔空投类型 -->
<destroyBuilding>true</destroyBuilding>
<delayTicks>1</delayTicks>
<allowThinRoof>true</allowThinRoof>
<allowThickRoof>false</allowThickRoof>
</li>
</comps>
</ThingDef>
<ThingDef ParentName="SkyfallerBase">
<defName>WULA_Sow_Excavator_Incoming</defName>
<label>DSm-6"挖掘机"(空投中)</label>
<size>(1,1)</size>
<graphicData>
<texPath>Wula/Building/WULA_Combat_Excavator_Incoming</texPath>
<graphicClass>Graphic_Single</graphicClass>
<shaderType>CutoutFlying</shaderType>
<drawSize>(4,4)</drawSize>
</graphicData>
<skyfaller>
<movementType>Accelerate</movementType>
<shadow>Things/Skyfaller/SkyfallerShadowDropPod</shadow>
<shadowSize>(2, 2)</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>WULA_Sow_Excavator</spawnThing>
</skyfaller>
<comps>
<li Class="CompProperties_Effecter">
<effecterDef>Smoke_Joint</effecterDef>
</li>
</comps>
</ThingDef>
<ThingDef ParentName="BuildingBase">
<defName>WULA_Sow_Excavator</defName>
<label>DSm-6"挖掘机"</label>
<description>一种通过空投部署的挖掘机,钻机可以通过高速震动将附近的土壤翻出,使得整片区域变得松软易于种植。这种设备的震波杀伤力极大,工作期间切勿靠近!</description>
<!-- <thingClass>WulaFallenEmpire.Building_ExtraGraphics</thingClass> -->
<preventDroppingThingsOn>true</preventDroppingThingsOn>
<altitudeLayer>Building</altitudeLayer>
<pathCost>50</pathCost>
<blockWind>true</blockWind>
<passability>PassThroughOnly</passability>
<fillPercent>1</fillPercent>
<size>(1,1)</size>
<drawHighlight>true</drawHighlight>
<tradeability>None</tradeability>
<highlightColor>(0.56, 0.62, 0.9)</highlightColor>
<uiIconPath>Wula/Building/WULA_Sow_Excavator_Icon</uiIconPath>
<rotatable>false</rotatable>
<graphicData>
<texPath>Wula/Building/WULA_Combat_Excavator</texPath>
<graphicClass>Graphic_Single</graphicClass>
<drawSize>(4,4)</drawSize>
</graphicData>
<costList>
<WULA_Alloy>50</WULA_Alloy>
<ComponentIndustrial>2</ComponentIndustrial>
<WULA_Excavator_Blade>1</WULA_Excavator_Blade>
</costList>
<statBases>
<MaxHitPoints>5000</MaxHitPoints>
<Flammability>0</Flammability>
<WorkToBuild>1000</WorkToBuild>
<Mass>5</Mass>
</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>
<neverBuildable>true</neverBuildable>
<expandHomeArea>false</expandHomeArea>
<destroySound>BuildingDestroyed_Metal_Big</destroySound>
<paintable>true</paintable>
<isInert>true</isInert>
<deconstructible>false</deconstructible>
<forcedCostLeavings>
<li>WULA_Excavator_Blade</li>
</forcedCostLeavings>
</building>
<!-- <modExtensions>
<li Class="WulaFallenEmpire.ExtraGraphicsExtension">
<globalAnimationSpeed>0</globalAnimationSpeed>
<globalAnimationIntensity>0</globalAnimationIntensity>
<graphicLayers>
<li>
<texturePath>Wula/Building/Flag/WULA_Flag_Building_A</texturePath>
<shaderName>MoteGlow</shaderName>
<scale>(1,1)</scale>
<drawOrder>0</drawOrder>
<offset>(0,1,2)</offset>
<animationType>RotateY</animationType>
<animationSpeed>360</animationSpeed>
<animationIntensity>360</animationIntensity>
<animationPhase>0</animationPhase>
</li>
<li>
<texturePath>Wula/Building/Flag/WULA_Flag_Building_Mount</texturePath>
<shaderName>Transparent</shaderName>
<scale>(1,1)</scale>
<drawOrder>1</drawOrder>
<offset>(0,1,0)</offset>
<animationSpeed>0</animationSpeed>
<animationIntensity>0</animationIntensity>
<animationPhase>0</animationPhase>
</li>
</graphicLayers>
</li>
</modExtensions> -->
<damageMultipliers Inherit="False">
<li>
<damageDef>WULA_Combat_Excavator_Shoke_Damage</damageDef>
<multiplier>0.01</multiplier>
</li>
<li>
<damageDef>WULA_Combat_Excavator_Shoke_S_Damage</damageDef>
<multiplier>0.01</multiplier>
</li>
<li>
<damageDef>WULA_Sow_Excavator_Shoke_Damage</damageDef>
<multiplier>0.01</multiplier>
</li>
</damageMultipliers>
<comps>
<li Class="WulaFallenEmpire.CompProperties_FactionSetter">
<!-- <factionDef>Wula_Progressive_Faction</factionDef> -->
<usePlayerFactionIfNull>true</usePlayerFactionIfNull>
<overrideExistingFaction>false</overrideExistingFaction>
</li>
<li Class="CompProperties_Glower">
<glowRadius>3</glowRadius>
<glowColor>(120,240,252,0)</glowColor>
</li>
<li Class="WulaFallenEmpire.CompProperties_PhaseCombatTower">
<warmupTicks>120</warmupTicks> <!-- 3秒启动期 -->
<explosionCooldownTicks>90</explosionCooldownTicks> <!-- 爆炸间隔1秒 -->
<explosions>
<li>
<damageDef>WULA_Sow_Excavator_Shoke_Damage</damageDef>
<radius>6</radius>
<armorPenetration>2</armorPenetration>
<damageAmount>1</damageAmount>
<explosionSound>Wula_Disturber_Turret_Weapon_Explosive</explosionSound>
</li>
<li>
<damageDef>WULA_Sow_Excavator_Shoke_Damage</damageDef>
<radius>9</radius>
<armorPenetration>2</armorPenetration>
<damageAmount>1</damageAmount>
<explosionSound>Wula_Disturber_Turret_Weapon_Explosive</explosionSound>
</li>
<li>
<damageDef>WULA_Sow_Excavator_Shoke_Damage</damageDef>
<radius>13</radius>
<armorPenetration>2</armorPenetration>
<damageAmount>20</damageAmount>
<explosionSound>Wula_Disturber_Turret_Weapon_Explosive</explosionSound>
</li>
</explosions>
<spawnCount>0</spawnCount> <!-- 生成3个Pawn -->
<spawnIntervalTicks>30</spawnIntervalTicks> <!-- 每3秒生成一个 -->
</li>
<li Class="CompProperties_Lifespan">
<lifespanTicks>9000</lifespanTicks>
</li>
</comps>
</ThingDef>
<!-- 钻机(AI) -->
<ThingDef ParentName="SkyfallerBase">
<defName>WULA_Combat_Excavator_Hostile_Incoming</defName>
<label>DBm-6"战斗挖掘机"(空投中)</label>
<size>(1,1)</size>
<graphicData>
<texPath>Wula/Building/WULA_Combat_Excavator_Incoming</texPath>
<graphicClass>Graphic_Single</graphicClass>
<shaderType>CutoutFlying</shaderType>
<drawSize>(4,4)</drawSize>
</graphicData>
<skyfaller>
<movementType>Accelerate</movementType>
<shadow>Things/Skyfaller/SkyfallerShadowDropPod</shadow>
<shadowSize>(2, 2)</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>WULA_Combat_Excavator_Hostile</spawnThing>
</skyfaller>
<comps>
<li Class="CompProperties_Effecter">
<effecterDef>Smoke_Joint</effecterDef>
</li>
</comps>
</ThingDef>
<ThingDef ParentName="BuildingBase">
<defName>WULA_Combat_Excavator_Hostile</defName>
<label>DBm-6"战斗挖掘机"</label>
<description>乌拉帝国用于破坏阵地的挖掘机,从天而降部署在指定地点后,钻机将通过高速旋转的刀片引发若干次地震冲击波,随后将舱内单位一股脑放出。</description>
<!-- <thingClass>WulaFallenEmpire.Building_ExtraGraphics</thingClass> -->
<preventDroppingThingsOn>true</preventDroppingThingsOn>
<altitudeLayer>Building</altitudeLayer>
<pathCost>50</pathCost>
<blockWind>true</blockWind>
<passability>PassThroughOnly</passability>
<fillPercent>1</fillPercent>
<size>(1,1)</size>
<drawHighlight>true</drawHighlight>
<tradeability>None</tradeability>
<highlightColor>(0.56, 0.62, 0.9)</highlightColor>
<uiIconPath>Wula/Building/WULA_Combat_Excavator_Icon</uiIconPath>
<designationCategory>WULA_Buildings</designationCategory>
<rotatable>false</rotatable>
<graphicData>
<texPath>Wula/Building/WULA_Combat_Excavator</texPath>
<graphicClass>Graphic_Single</graphicClass>
<drawSize>(4,4)</drawSize>
</graphicData>
<costList>
<WULA_Alloy>20</WULA_Alloy>
<ComponentIndustrial>1</ComponentIndustrial>
<WULA_Excavator_Blade>1</WULA_Excavator_Blade>
</costList>
<statBases>
<MaxHitPoints>5000</MaxHitPoints>
<Flammability>0</Flammability>
<WorkToBuild>1000</WorkToBuild>
<Mass>5</Mass>
</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>
<building>
<neverBuildable>true</neverBuildable>
<expandHomeArea>false</expandHomeArea>
<destroySound>BuildingDestroyed_Metal_Big</destroySound>
<paintable>true</paintable>
<isInert>true</isInert>
<deconstructible>false</deconstructible>
<forcedCostLeavings>
<li>WULA_Excavator_Blade</li>
</forcedCostLeavings>
</building>
<damageMultipliers Inherit="False">
<li>
<damageDef>WULA_Combat_Excavator_Shoke_Damage</damageDef>
<multiplier>0.01</multiplier>
</li>
<li>
<damageDef>WULA_Combat_Excavator_Shoke_S_Damage</damageDef>
<multiplier>0.01</multiplier>
</li>
<li>
<damageDef>WULA_Sow_Excavator_Shoke_Damage</damageDef>
<multiplier>0.01</multiplier>
</li>
</damageMultipliers>
<!-- <modExtensions>
<li Class="WulaFallenEmpire.ExtraGraphicsExtension">
<globalAnimationSpeed>0</globalAnimationSpeed>
<globalAnimationIntensity>0</globalAnimationIntensity>
<graphicLayers>
<li>
<texturePath>Wula/Building/Flag/WULA_Flag_Building_A</texturePath>
<shaderName>MoteGlow</shaderName>
<scale>(1,1)</scale>
<drawOrder>0</drawOrder>
<offset>(0,1,2)</offset>
<animationType>RotateY</animationType>
<animationSpeed>360</animationSpeed>
<animationIntensity>360</animationIntensity>
<animationPhase>0</animationPhase>
</li>
<li>
<texturePath>Wula/Building/Flag/WULA_Flag_Building_Mount</texturePath>
<shaderName>Transparent</shaderName>
<scale>(1,1)</scale>
<drawOrder>1</drawOrder>
<offset>(0,1,0)</offset>
<animationSpeed>0</animationSpeed>
<animationIntensity>0</animationIntensity>
<animationPhase>0</animationPhase>
</li>
</graphicLayers>
</li>
</modExtensions> -->
<comps>
<li Class="WulaFallenEmpire.CompProperties_FactionSetter">
<factionDef>Wula_Progressive_Faction</factionDef>
<usePlayerFactionIfNull>true</usePlayerFactionIfNull>
<overrideExistingFaction>false</overrideExistingFaction>
</li>
<li Class="CompProperties_Glower">
<glowRadius>3</glowRadius>
<glowColor>(120,240,252,0)</glowColor>
</li>
<li Class="WulaFallenEmpire.CompProperties_PhaseCombatTower">
<warmupTicks>120</warmupTicks> <!-- 3秒启动期 -->
<explosionCooldownTicks>90</explosionCooldownTicks> <!-- 爆炸间隔1秒 -->
<explosions>
<li>
<damageDef>WULA_Combat_Excavator_Shoke_S_Damage</damageDef>
<radius>5</radius>
<armorPenetration>2</armorPenetration>
<damageAmount>10</damageAmount>
<explosionSound>Wula_Disturber_Turret_Weapon_Explosive</explosionSound>
</li>
<li>
<damageDef>WULA_Combat_Excavator_Shoke_S_Damage</damageDef>
<radius>7</radius>
<armorPenetration>2</armorPenetration>
<damageAmount>10</damageAmount>
<excludeRadius>0.9</excludeRadius>
<explosionSound>Wula_Disturber_Turret_Weapon_Explosive</explosionSound>
</li>
<li>
<damageDef>WULA_Combat_Excavator_Shoke_Damage</damageDef>
<radius>7</radius>
<armorPenetration>2</armorPenetration>
<damageAmount>20</damageAmount>
<excludeRadius>0.9</excludeRadius>
<explosionSound>Wula_Disturber_Turret_Weapon_Explosive</explosionSound>
</li>
<li>
<damageDef>Smoke</damageDef>
<radius>12</radius>
<postExplosionGasType>BlindSmoke</postExplosionGasType>
<armorPenetration>2</armorPenetration>
<damageAmount>0</damageAmount>
<explosionSound>Explosion_Smoke</explosionSound>
</li>
</explosions>
<pawnKindDefs>
<li>Mech_WULA_Fire_Cat</li>
</pawnKindDefs>
<spawnCount>16</spawnCount> <!-- 生成3个Pawn -->
<spawnIntervalTicks>30</spawnIntervalTicks> <!-- 每3秒生成一个 -->
</li>
<li Class="CompProperties_Lifespan">
<lifespanTicks>9000</lifespanTicks>
</li>
</comps>
</ThingDef>
<!-- 旗帜 -->
<ThingDef ParentName="BuildingBase">
<defName>WULA_Wall_Flag_Building</defName>

View File

@@ -293,7 +293,7 @@
<MaxHitPoints>50</MaxHitPoints>
</statBases>
<thingCategories>
<li>ResourcesRaw</li>
<li>Items</li>
</thingCategories>
<burnableByRecipe>false</burnableByRecipe>
<smeltable>false</smeltable>
@@ -317,7 +317,31 @@
<Mass>0.01</Mass>
</statBases>
<thingCategories>
<li>ResourcesRaw</li>
<li>Items</li>
</thingCategories>
<burnableByRecipe>false</burnableByRecipe>
<smeltable>false</smeltable>
</ThingDef>
<ThingDef ParentName="ResourceBase">
<defName>WULA_Excavator_Blade</defName>
<label>挖掘机刀片</label>
<description>DSm-6"挖掘机"和DBm-6"战斗挖掘机"所使用的刀片,质地超乎想象地坚硬,即使是使用乌拉帝国舰队的设施也无法加工这种刀片,只能从其他工业星域运输过来。\n\n乌拉帝国的进步派叛军似乎往边缘世界运了不少这个玩意难怪她们可以像不要钱一样扔钻机。</description>
<graphicData>
<texPath>Wula/Item/WULA_Excavator_Blade</texPath>
<graphicClass>Graphic_Single</graphicClass>
</graphicData>
<tradeability>None</tradeability>
<genericMarketSellable>false</genericMarketSellable>
<soundInteract>Metal_Drop</soundInteract>
<soundDrop>Metal_Drop</soundDrop>
<useHitPoints>false</useHitPoints>
<healthAffectsPrice>false</healthAffectsPrice>
<statBases>
<MarketValue>1</MarketValue>
<Mass>0.01</Mass>
</statBases>
<thingCategories>
<li>Items</li>
</thingCategories>
<burnableByRecipe>false</burnableByRecipe>
<smeltable>false</smeltable>

View File

@@ -1072,6 +1072,35 @@
</li>
</comps>
</AlienRace.ThingDef_AlienRace>
<AlienRace.ThingDef_AlienRace ParentName="Mech_WULA_Cat_Base">
<defName>Mech_WULA_Fire_Cat</defName>
<label>CAt-55"突击猫猫"</label>
<description>乌拉帝国的一种小型自律机械体,无需监管者。它们寿命有限,只会跟随某些自杀式袭击而出现。</description>
<uiIconPath>Wula/Things/WULA_Fire_Cat/WULA_Cat_Thin_south</uiIconPath>
<race>
<thinkTreeConstant>WULA_Mech_Flyer_Constant</thinkTreeConstant>
</race>
<alienRace>
<raceRestriction>
<onlyUseRaceRestrictedApparel>true</onlyUseRaceRestrictedApparel>
</raceRestriction>
<compatibility>
<isFlesh>false</isFlesh>
</compatibility>
</alienRace>
<statBases>
<ArmorRating_Sharp>0.5</ArmorRating_Sharp>
<ArmorRating_Blunt>0.5</ArmorRating_Blunt>
<!-- <WorkSpeedGlobal>2</WorkSpeedGlobal> -->
<MoveSpeed>4</MoveSpeed>
</statBases>
<comps Inherit="False">
<li Class="CompProperties_MechPowerCell">
<totalPowerTicks>10000</totalPowerTicks>
</li>
</comps>
</AlienRace.ThingDef_AlienRace>
<!-- 大型机械族 -->
<AlienRace.ThingDef_AlienRace ParentName="WULA_BaseMechanoid">
@@ -1095,7 +1124,7 @@
<ArmorRating_Heat>0.75</ArmorRating_Heat>
</statBases>
<race>
<body>WULA_Mobile_Bunker_Body</body>
<!-- <body>WULA_Mobile_Bunker_Body</body> -->
<baseBodySize>5</baseBodySize>
<lifeStageAges>
<li>

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -21,6 +21,18 @@ namespace WulaFallenEmpire
public SlateRef<bool> allowThickRoof = false;
public SlateRef<bool> allowThinRoof = true;
// 新增:是否启用分散算法
public SlateRef<bool> spreadOut = false;
// 新增:最小间隔距离(以单元格为单位)
public SlateRef<int> minSpacing = 5;
// 新增:是否只对小型目标使用分散算法
public SlateRef<bool> onlyForSmallTargets = true;
// 新增:小型目标的定义(最大尺寸)
public SlateRef<int> smallTargetMaxSize = 3;
protected override bool TestRunInt(Slate slate)
{
// 在测试运行中只检查基本条件
@@ -53,6 +65,10 @@ namespace WulaFallenEmpire
bool doSendMessageOnFailure = sendMessageOnFailure.GetValue(slate);
bool targetAllowThickRoof = allowThickRoof.GetValue(slate);
bool targetAllowThinRoof = allowThinRoof.GetValue(slate);
bool doSpreadOut = spreadOut.GetValue(slate);
int targetMinSpacing = minSpacing.GetValue(slate);
bool targetOnlyForSmallTargets = onlyForSmallTargets.GetValue(slate);
int targetSmallTargetMaxSize = smallTargetMaxSize.GetValue(slate);
if (targetThingDef == null)
{
@@ -66,36 +82,369 @@ namespace WulaFallenEmpire
return;
}
Log.Message($"[QuestNode] Attempting to spawn {targetSpawnCount} {targetThingDef.defName} on map {targetMap}");
// 创建QuestPart来延迟执行等待信号
QuestPart_SpawnPrefabSkyfallerCaller questPart = new QuestPart_SpawnPrefabSkyfallerCaller
{
thingDef = targetThingDef,
faction = targetFaction,
spawnCount = targetSpawnCount,
map = targetMap,
sendMessageOnSuccess = doSendMessageOnSuccess,
sendMessageOnFailure = doSendMessageOnFailure,
allowThickRoof = targetAllowThickRoof,
allowThinRoof = targetAllowThinRoof,
spreadOut = doSpreadOut,
minSpacing = targetMinSpacing,
onlyForSmallTargets = targetOnlyForSmallTargets,
smallTargetMaxSize = targetSmallTargetMaxSize,
inSignal = QuestGenUtility.HardcodedSignalWithQuestID(inSignal.GetValue(slate))
};
// 执行生成
int successCount = SpawnThingsAtValidLocations(targetThingDef, targetFaction, targetSpawnCount, targetMap, targetAllowThickRoof, targetAllowThinRoof);
// 将QuestPart添加到Quest中
QuestGen.quest.AddPart(questPart);
// 设置输出变量
QuestGen.slate.Set("prefabSpawnSuccessCount", questPart.successCount);
QuestGen.slate.Set("prefabSpawnRequestedCount", targetSpawnCount);
}
}
// 新增QuestPart来管理延迟执行
public class QuestPart_SpawnPrefabSkyfallerCaller : QuestPart
{
public string inSignal;
public ThingDef thingDef;
public Faction faction;
public int spawnCount = 1;
public Map map;
public bool sendMessageOnSuccess = true;
public bool sendMessageOnFailure = true;
public bool allowThickRoof = false;
public bool allowThinRoof = true;
// 新增:分散算法相关
public bool spreadOut = false;
public int minSpacing = 5;
public bool onlyForSmallTargets = true;
public int smallTargetMaxSize = 3;
// 输出变量
public int successCount = 0;
public override void ExposeData()
{
base.ExposeData();
Scribe_Values.Look(ref inSignal, "inSignal");
Scribe_Defs.Look(ref thingDef, "thingDef");
Scribe_References.Look(ref faction, "faction");
Scribe_Values.Look(ref spawnCount, "spawnCount", 1);
Scribe_References.Look(ref map, "map");
Scribe_Values.Look(ref sendMessageOnSuccess, "sendMessageOnSuccess", true);
Scribe_Values.Look(ref sendMessageOnFailure, "sendMessageOnFailure", true);
Scribe_Values.Look(ref allowThickRoof, "allowThickRoof", false);
Scribe_Values.Look(ref allowThinRoof, "allowThinRoof", true);
Scribe_Values.Look(ref spreadOut, "spreadOut", false);
Scribe_Values.Look(ref minSpacing, "minSpacing", 5);
Scribe_Values.Look(ref onlyForSmallTargets, "onlyForSmallTargets", true);
Scribe_Values.Look(ref smallTargetMaxSize, "smallTargetMaxSize", 3);
Scribe_Values.Look(ref successCount, "successCount", 0);
}
public override void Notify_QuestSignalReceived(Signal signal)
{
base.Notify_QuestSignalReceived(signal);
// 检查是否是我们等待的信号
if (!(signal.tag == inSignal))
{
return;
}
if (thingDef == null)
{
Log.Error("[QuestPart] ThingDef is null");
return;
}
if (map == null)
{
Log.Error("[QuestPart] Map is null");
return;
}
Log.Message($"[QuestPart] Received signal {inSignal}, spawning {spawnCount} {thingDef.defName} on map {map}");
// 执行生成逻辑
successCount = ExecuteSpawnLogic();
// 发送结果消息
if (successCount > 0)
{
if (doSendMessageOnSuccess)
if (sendMessageOnSuccess)
{
Messages.Message($"[Quest] Successfully spawned {successCount} {targetThingDef.label}", MessageTypeDefOf.PositiveEvent);
Messages.Message($"[Quest] Successfully spawned {successCount} {thingDef.label}", MessageTypeDefOf.PositiveEvent);
}
Log.Message($"[QuestNode] Successfully spawned {successCount}/{targetSpawnCount} {targetThingDef.defName}");
Log.Message($"[QuestPart] Successfully spawned {successCount}/{spawnCount} {thingDef.defName}");
}
else
{
if (doSendMessageOnFailure)
if (sendMessageOnFailure)
{
Messages.Message($"[Quest] Failed to spawn any {targetThingDef.label}", MessageTypeDefOf.NegativeEvent);
Messages.Message($"[Quest] Failed to spawn any {thingDef.label}", MessageTypeDefOf.NegativeEvent);
}
Log.Warning($"[QuestPart] Failed to spawn any {thingDef.defName}");
}
Log.Warning($"[QuestNode] Failed to spawn any {targetThingDef.defName}");
}
// 将结果存储到Slate中供后续节点使用
QuestGen.slate.Set("prefabSpawnSuccessCount", successCount);
QuestGen.slate.Set("prefabSpawnRequestedCount", targetSpawnCount);
private int ExecuteSpawnLogic()
{
// 检查是否应该使用分散算法
bool useSpreadOutAlgorithm = spreadOut;
if (onlyForSmallTargets)
{
// 检查目标是否为小型目标
bool isSmallTarget = thingDef.Size.x <= smallTargetMaxSize &&
thingDef.Size.z <= smallTargetMaxSize;
useSpreadOutAlgorithm = useSpreadOutAlgorithm && isSmallTarget;
if (spreadOut && !isSmallTarget)
{
Log.Message($"[QuestPart] Target {thingDef.defName} is not considered small (size {thingDef.Size.x}x{thingDef.Size.z}), not using spread-out algorithm");
}
}
// 执行生成
if (useSpreadOutAlgorithm)
{
return SpawnThingsWithSpacing(thingDef, faction, spawnCount, map, allowThickRoof, allowThinRoof, minSpacing);
}
else
{
return SpawnThingsAtValidLocations(thingDef, faction, spawnCount, map, allowThickRoof, allowThinRoof);
}
}
/// <summary>
/// 在有效位置生成多个建筑
/// 使用分散算法生成多个建筑
/// </summary>
private int SpawnThingsWithSpacing(ThingDef thingDef, Faction faction, int spawnCount, Map targetMap, bool allowThickRoof, bool allowThinRoof, int minSpacing)
{
Log.Message($"[QuestPart] Using spread-out algorithm with min spacing {minSpacing} cells");
List<IntVec3> spawnedPositions = new List<IntVec3>();
int successCount = 0;
int attempts = 0;
const int maxTotalAttempts = 500; // 总的最大尝试次数
const int maxAttemptsPerThing = 100; // 每个建筑的最大尝试次数
// 生成一个所有可能位置的列表
List<IntVec3> allPossibleCells = GeneratePossibleCells(targetMap, thingDef, allowThickRoof, allowThinRoof, 1000);
Log.Message($"[QuestPart] Found {allPossibleCells.Count} possible cells for {thingDef.defName}");
// 如果没有足够的可能位置,直接使用原算法
if (allPossibleCells.Count < spawnCount)
{
Log.Warning($"[QuestPart] Not enough possible cells ({allPossibleCells.Count}) for {spawnCount} spawns, falling back to normal algorithm");
return SpawnThingsAtValidLocations(thingDef, faction, spawnCount, targetMap, allowThickRoof, allowThinRoof);
}
for (int i = 0; i < spawnCount && attempts < maxTotalAttempts; i++)
{
bool foundPosition = false;
int attemptsForThisThing = 0;
// 尝试找到一个满足间距条件的位置
while (!foundPosition && attemptsForThisThing < maxAttemptsPerThing && attempts < maxTotalAttempts)
{
attempts++;
attemptsForThisThing++;
// 从可能位置中随机选择一个
IntVec3 candidatePos = allPossibleCells.RandomElement();
// 检查是否满足间距条件
bool meetsSpacing = true;
foreach (var existingPos in spawnedPositions)
{
float distance = candidatePos.DistanceTo(existingPos);
if (distance < minSpacing)
{
meetsSpacing = false;
break;
}
}
if (meetsSpacing)
{
// 创建并生成建筑
Thing thing = ThingMaker.MakeThing(thingDef);
if (faction != null)
{
thing.SetFaction(faction);
}
GenSpawn.Spawn(thing, candidatePos, targetMap);
spawnedPositions.Add(candidatePos);
successCount++;
foundPosition = true;
// 从可能位置列表中移除这个位置及其周围的位置(避免重复选择)
allPossibleCells.RemoveAll(cell => cell.DistanceTo(candidatePos) < minSpacing / 2);
Log.Message($"[QuestPart] Successfully spawned {thingDef.defName} at {candidatePos} (distance to nearest: {GetMinDistanceToOthers(candidatePos, spawnedPositions)})");
break;
}
}
// 如果找不到满足间距条件的位置,放宽条件
if (!foundPosition)
{
Log.Warning($"[QuestPart] Could not find position with required spacing for {thingDef.defName}, trying with reduced spacing");
// 尝试使用减半的间距
bool foundWithReducedSpacing = TrySpawnWithReducedSpacing(thingDef, faction, targetMap, spawnedPositions, allPossibleCells, minSpacing / 2, ref successCount, ref attempts);
if (!foundWithReducedSpacing)
{
// 如果还找不到,尝试不使用间距条件
Log.Warning($"[QuestPart] Still couldn't find position, falling back to no spacing requirement");
foundWithReducedSpacing = TrySpawnWithReducedSpacing(thingDef, faction, targetMap, spawnedPositions, allPossibleCells, 0, ref successCount, ref attempts);
}
if (!foundWithReducedSpacing)
{
Log.Warning($"[QuestPart] Failed to spawn {thingDef.defName} after multiple attempts");
}
}
}
Log.Message($"[QuestPart] Spread-out algorithm completed: {successCount}/{spawnCount} spawned");
return successCount;
}
/// <summary>
/// 尝试使用减小的间距生成建筑
/// </summary>
private bool TrySpawnWithReducedSpacing(ThingDef thingDef, Faction faction, Map targetMap, List<IntVec3> spawnedPositions, List<IntVec3> allPossibleCells, int reducedSpacing, ref int successCount, ref int attempts)
{
const int maxReducedAttempts = 50;
int attemptsForReduced = 0;
while (attemptsForReduced < maxReducedAttempts && attempts < 500)
{
attempts++;
attemptsForReduced++;
IntVec3 candidatePos = allPossibleCells.RandomElement();
// 检查是否满足减小的间距条件
bool meetsSpacing = true;
foreach (var existingPos in spawnedPositions)
{
float distance = candidatePos.DistanceTo(existingPos);
if (distance < reducedSpacing)
{
meetsSpacing = false;
break;
}
}
if (meetsSpacing)
{
Thing thing = ThingMaker.MakeThing(thingDef);
if (faction != null)
{
thing.SetFaction(faction);
}
GenSpawn.Spawn(thing, candidatePos, targetMap);
spawnedPositions.Add(candidatePos);
successCount++;
// 从可能位置列表中移除这个位置及其周围的位置
allPossibleCells.RemoveAll(cell => cell.DistanceTo(candidatePos) < reducedSpacing / 2);
Log.Message($"[QuestPart] Successfully spawned {thingDef.defName} at {candidatePos} with reduced spacing {reducedSpacing}");
return true;
}
}
return false;
}
/// <summary>
/// 获取到其他位置的最小距离
/// </summary>
private float GetMinDistanceToOthers(IntVec3 position, List<IntVec3> otherPositions)
{
if (otherPositions.Count == 0) return float.MaxValue;
float minDistance = float.MaxValue;
foreach (var otherPos in otherPositions)
{
if (otherPos == position) continue;
float distance = position.DistanceTo(otherPos);
if (distance < minDistance)
{
minDistance = distance;
}
}
return minDistance;
}
/// <summary>
/// 生成所有可能的位置列表
/// </summary>
private List<IntVec3> GeneratePossibleCells(Map map, ThingDef thingDef, bool allowThickRoof, bool allowThinRoof, int maxCellsToCheck)
{
List<IntVec3> possibleCells = new List<IntVec3>();
int cellsChecked = 0;
// 方法1随机采样
for (int i = 0; i < maxCellsToCheck && possibleCells.Count < maxCellsToCheck / 2; i++)
{
IntVec3 randomCell = new IntVec3(
Rand.Range(thingDef.Size.x, map.Size.x - thingDef.Size.x),
0,
Rand.Range(thingDef.Size.z, map.Size.z - thingDef.Size.z)
);
if (randomCell.InBounds(map) && IsValidForSkyfallerDrop(map, randomCell, thingDef, allowThickRoof, allowThinRoof))
{
possibleCells.Add(randomCell);
}
cellsChecked++;
}
// 方法2如果随机采样得到的数量不足尝试使用网格采样
if (possibleCells.Count < maxCellsToCheck / 4)
{
int gridStep = Mathf.Max(3, Mathf.CeilToInt(Mathf.Sqrt(map.Size.x * map.Size.z / maxCellsToCheck)));
for (int x = thingDef.Size.x; x < map.Size.x - thingDef.Size.x && possibleCells.Count < maxCellsToCheck; x += gridStep)
{
for (int z = thingDef.Size.z; z < map.Size.z - thingDef.Size.z && possibleCells.Count < maxCellsToCheck; z += gridStep)
{
IntVec3 gridCell = new IntVec3(x, 0, z);
if (gridCell.InBounds(map) && IsValidForSkyfallerDrop(map, gridCell, thingDef, allowThickRoof, allowThinRoof))
{
possibleCells.Add(gridCell);
}
cellsChecked++;
}
}
}
Log.Message($"[QuestPart] Generated {possibleCells.Count} possible cells after checking {cellsChecked} cells");
return possibleCells;
}
/// <summary>
/// 在有效位置生成多个建筑(原算法)
/// </summary>
private int SpawnThingsAtValidLocations(ThingDef thingDef, Faction faction, int spawnCount, Map targetMap, bool allowThickRoof, bool allowThinRoof)
{
@@ -120,11 +469,11 @@ namespace WulaFallenEmpire
GenSpawn.Spawn(thing, spawnPos, targetMap);
successCount++;
Log.Message($"[QuestNode] Successfully spawned {thingDef.defName} at {spawnPos} for faction {faction?.Name ?? "None"}");
Log.Message($"[QuestPart] Successfully spawned {thingDef.defName} at {spawnPos} for faction {faction?.Name ?? "None"}");
}
else
{
Log.Warning($"[QuestNode] Failed to find valid spawn position for {thingDef.defName} (attempt {attempts})");
Log.Warning($"[QuestPart] Failed to find valid spawn position for {thingDef.defName} (attempt {attempts})");
}
}
@@ -191,7 +540,7 @@ namespace WulaFallenEmpire
return potentialCells.RandomElement();
}
Log.Warning($"[QuestNode] No valid positions found for {thingDef.defName} after exhaustive search");
Log.Warning($"[QuestPart] No valid positions found for {thingDef.defName} after exhaustive search");
return IntVec3.Invalid;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 27 KiB