1
This commit is contained in:
Binary file not shown.
@@ -53,6 +53,7 @@
|
|||||||
<WULA_Alloy>4</WULA_Alloy>
|
<WULA_Alloy>4</WULA_Alloy>
|
||||||
</costList>
|
</costList>
|
||||||
<building>
|
<building>
|
||||||
|
<isInert>false</isInert>
|
||||||
<destroySound>BuildingDestroyed_Metal_Small</destroySound>
|
<destroySound>BuildingDestroyed_Metal_Small</destroySound>
|
||||||
<isAirtight>false</isAirtight>
|
<isAirtight>false</isAirtight>
|
||||||
<isStuffableAirtight>false</isStuffableAirtight>
|
<isStuffableAirtight>false</isStuffableAirtight>
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
<defName>WULA_OrbitalTradeBeacon</defName>
|
<defName>WULA_OrbitalTradeBeacon</defName>
|
||||||
<label>乌拉轨道输送信标</label>
|
<label>乌拉轨道输送信标</label>
|
||||||
<thingClass>Building_OrbitalTradeBeacon</thingClass>
|
<thingClass>Building_OrbitalTradeBeacon</thingClass>
|
||||||
|
<thingCategories Inherit="False">
|
||||||
|
<li>BuildingsMisc</li>
|
||||||
|
</thingCategories>
|
||||||
<graphicData>
|
<graphicData>
|
||||||
<texPath>Things/Building/Misc/DropBeacon</texPath>
|
<texPath>Things/Building/Misc/DropBeacon</texPath>
|
||||||
<graphicClass>Graphic_Single</graphicClass>
|
<graphicClass>Graphic_Single</graphicClass>
|
||||||
@@ -52,7 +55,7 @@
|
|||||||
</placeWorkers>
|
</placeWorkers>
|
||||||
<designationHotKey>Misc2</designationHotKey>
|
<designationHotKey>Misc2</designationHotKey>
|
||||||
<researchPrerequisites>
|
<researchPrerequisites>
|
||||||
<li>Techprint_WULA_Colony_License_LV1_Technology</li>
|
<li>WULA_Colony_License_LV1_Technology</li>
|
||||||
</researchPrerequisites>
|
</researchPrerequisites>
|
||||||
</ThingDef>
|
</ThingDef>
|
||||||
<!-- 舰队 -->
|
<!-- 舰队 -->
|
||||||
@@ -672,7 +675,6 @@
|
|||||||
<description>乌拉帝国行星封锁机关的旗帜,没什么用但是可以宣示乌拉帝国的主权。</description>
|
<description>乌拉帝国行星封锁机关的旗帜,没什么用但是可以宣示乌拉帝国的主权。</description>
|
||||||
<thingClass>Building</thingClass>
|
<thingClass>Building</thingClass>
|
||||||
<category>Building</category>
|
<category>Building</category>
|
||||||
<altitudeLayer>Building</altitudeLayer>
|
|
||||||
<passability>PassThroughOnly</passability>
|
<passability>PassThroughOnly</passability>
|
||||||
<designationCategory>WULA_Buildings</designationCategory>
|
<designationCategory>WULA_Buildings</designationCategory>
|
||||||
<selectable>true</selectable>
|
<selectable>true</selectable>
|
||||||
@@ -723,8 +725,9 @@
|
|||||||
<label>天锁</label>
|
<label>天锁</label>
|
||||||
<description>天锁</description>
|
<description>天锁</description>
|
||||||
<thingClass>Building</thingClass>
|
<thingClass>Building</thingClass>
|
||||||
|
<thingClass>WulaFallenEmpire.Building_ExtraGraphics</thingClass>
|
||||||
<preventDroppingThingsOn>true</preventDroppingThingsOn>
|
<preventDroppingThingsOn>true</preventDroppingThingsOn>
|
||||||
<altitudeLayer>Building</altitudeLayer>
|
<altitudeLayer>MetaOverlays</altitudeLayer>
|
||||||
<pathCost>50</pathCost>
|
<pathCost>50</pathCost>
|
||||||
<blockWind>true</blockWind>
|
<blockWind>true</blockWind>
|
||||||
<passability>PassThroughOnly</passability>
|
<passability>PassThroughOnly</passability>
|
||||||
@@ -738,24 +741,27 @@
|
|||||||
<shaderType>TransparentPostLight</shaderType>
|
<shaderType>TransparentPostLight</shaderType>
|
||||||
<drawSize>(3,3)</drawSize>
|
<drawSize>(3,3)</drawSize>
|
||||||
<color>(195,195,195,255)</color>
|
<color>(195,195,195,255)</color>
|
||||||
|
<shadowData>
|
||||||
|
<volume>(4, 4, 4)</volume>
|
||||||
|
<offset>(0,0,-0.1)</offset>
|
||||||
|
</shadowData>
|
||||||
</graphicData>
|
</graphicData>
|
||||||
<statBases>
|
<statBases>
|
||||||
<MaxHitPoints>100</MaxHitPoints>
|
<MaxHitPoints>35000</MaxHitPoints>
|
||||||
<Flammability>0.5</Flammability>
|
<Flammability>0</Flammability>
|
||||||
<WorkToBuild>36000</WorkToBuild>
|
<WorkToBuild>1</WorkToBuild>
|
||||||
<Mass>125</Mass>
|
<Mass>125</Mass>
|
||||||
<Comfort>0.65</Comfort>
|
|
||||||
</statBases>
|
</statBases>
|
||||||
<costList>
|
<costList>
|
||||||
<WULA_Alloy>50</WULA_Alloy>
|
<WULA_Alloy>5000</WULA_Alloy>
|
||||||
<ComponentIndustrial>1</ComponentIndustrial>
|
|
||||||
</costList>
|
</costList>
|
||||||
<!-- <designationCategory>WULA_Buildings</designationCategory> -->
|
<castEdgeShadows>true</castEdgeShadows>
|
||||||
|
<designationCategory>WULA_Buildings</designationCategory>
|
||||||
<tickerType>Normal</tickerType>
|
<tickerType>Normal</tickerType>
|
||||||
<canOverlapZones>true</canOverlapZones>
|
<canOverlapZones>true</canOverlapZones>
|
||||||
<rotatable>true</rotatable>
|
<rotatable>true</rotatable>
|
||||||
<hasInteractionCell>false</hasInteractionCell>
|
<hasInteractionCell>false</hasInteractionCell>
|
||||||
<defaultPlacingRot>East</defaultPlacingRot>
|
<defaultPlacingRot>North</defaultPlacingRot>
|
||||||
<selectable>true</selectable>
|
<selectable>true</selectable>
|
||||||
<terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
|
<terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
|
||||||
<soundImpactDefault>BulletImpact_Metal</soundImpactDefault>
|
<soundImpactDefault>BulletImpact_Metal</soundImpactDefault>
|
||||||
@@ -768,13 +774,61 @@
|
|||||||
<paintable>true</paintable>
|
<paintable>true</paintable>
|
||||||
<isInert>true</isInert>
|
<isInert>true</isInert>
|
||||||
</building>
|
</building>
|
||||||
|
<modExtensions>
|
||||||
|
<li Class="WulaFallenEmpire.ExtraGraphicsExtension">
|
||||||
|
<globalHoverSpeed>0</globalHoverSpeed>
|
||||||
|
<globalHoverIntensity>0</globalHoverIntensity>
|
||||||
|
|
||||||
|
<graphicLayers>
|
||||||
|
<li>
|
||||||
|
<texturePath>Wula/Building/WULA_Sky_Lock/WULA_Sky_Lock_B</texturePath>
|
||||||
|
<shaderName>Transparent</shaderName>
|
||||||
|
<scale>(4,350)</scale>
|
||||||
|
<drawOrder>1</drawOrder>
|
||||||
|
<offset>(0,1,123.75)</offset>
|
||||||
|
<hoverSpeed>0</hoverSpeed> <!-- 比全局慢 -->
|
||||||
|
<hoverIntensity>0</hoverIntensity> <!-- 比全局弱 -->
|
||||||
|
<hoverPhase>0</hoverPhase>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<texturePath>Wula/Building/WULA_Sky_Lock/WULA_Sky_Lock_A</texturePath>
|
||||||
|
<shaderName>Transparent</shaderName>
|
||||||
|
<scale>(4,4)</scale>
|
||||||
|
<drawOrder>0</drawOrder>
|
||||||
|
<offset>(0,1,0)</offset>
|
||||||
|
<hoverSpeed>0</hoverSpeed> <!-- 比全局慢 -->
|
||||||
|
<hoverIntensity>0</hoverIntensity> <!-- 比全局弱 -->
|
||||||
|
<hoverPhase>0</hoverPhase>
|
||||||
|
</li>
|
||||||
|
</graphicLayers>
|
||||||
|
</li>
|
||||||
|
</modExtensions>
|
||||||
<comps>
|
<comps>
|
||||||
<li Class="WulaFallenEmpire.CompProperties_DamageReceiver">
|
<li Class="WulaFallenEmpire.CompProperties_AreaShield">
|
||||||
<maxDamageCapacity>5000</maxDamageCapacity>
|
<radius>7</radius>
|
||||||
<damageDecayRate>10</damageDecayRate>
|
<baseHitPoints>20</baseHitPoints>
|
||||||
<damageDecayInterval>30</damageDecayInterval>
|
<rechargeDelay>2400</rechargeDelay>
|
||||||
<showDamageBar>true</showDamageBar>
|
<rechargeHitPointsIntervalTicks>30</rechargeHitPointsIntervalTicks>
|
||||||
<canBeDestroyedByDamage>true</canBeDestroyedByDamage>
|
|
||||||
|
<!-- 效果器配置 -->
|
||||||
|
<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>1</reflectChance>
|
||||||
|
<reflectAngleRange>30</reflectAngleRange>
|
||||||
|
<reflectCost>0</reflectCost>
|
||||||
|
<reflectEffecter>Interceptor_BlockedProjectile</reflectEffecter>
|
||||||
</li>
|
</li>
|
||||||
</comps>
|
</comps>
|
||||||
</ThingDef>
|
</ThingDef>
|
||||||
|
|||||||
@@ -1,103 +1,101 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Defs>
|
<Defs>
|
||||||
<!-- Prefab Spawner Skyfaller -->
|
<ThingDef ParentName="BuildingBase">
|
||||||
<ThingDef ParentName="SkyfallerBase">
|
<defName>WULA_Prefab_Cleanzone_NewColonyBase_Beacon</defName>
|
||||||
<defName>WULA_Prefab_Incoming</defName>
|
<label>乌拉预制件空投信标-小型前哨站</label>
|
||||||
<label>乌拉帝国建筑(空投中)</label>
|
<description>一个用于呼叫建筑的信标,用于快速建造一个小型前哨站。</description>
|
||||||
<thingClass>WulaFallenEmpire.Skyfaller_PrefabSpawner</thingClass>
|
<uiIconPath>Wula/Building/Linked/WULA_Fortress_Wall_MenuIcon</uiIconPath>
|
||||||
<size>(13,13)</size>
|
<tickerType>Normal</tickerType>
|
||||||
<graphicData>
|
<graphicData>
|
||||||
<texPath>Wula/Building/Linked/WULA_Fortress_Wall_MenuIcon</texPath>
|
<texPath>Wula/Building/WULA_Dropping_Building_Cleanzone_Plus</texPath>
|
||||||
<graphicClass>Graphic_Single</graphicClass>
|
<graphicClass>Graphic_Multi</graphicClass>
|
||||||
<shaderType>CutoutFlying</shaderType>
|
<drawSize>(13,13)</drawSize>
|
||||||
<drawSize>(13,13)</drawSize>
|
<damageData>
|
||||||
</graphicData>
|
<enabled>false</enabled>
|
||||||
<skyfaller>
|
</damageData>
|
||||||
<movementType>Accelerate</movementType>
|
</graphicData>
|
||||||
<shadow>Things/Skyfaller/SkyfallerShadowDropPod</shadow>
|
<rotatable>false</rotatable>
|
||||||
<shadowSize>(13, 13)</shadowSize>
|
<neverMultiSelect>false</neverMultiSelect>
|
||||||
<anticipationSound>DropPod_Fall</anticipationSound>
|
<blockLight>false</blockLight>
|
||||||
<anticipationSoundTicks>100</anticipationSoundTicks>
|
<holdsRoof>false</holdsRoof>
|
||||||
<impactSound>Explosion_Vaporize</impactSound>
|
<coversFloor>false</coversFloor>
|
||||||
<moteSpawnTime>0.05</moteSpawnTime>
|
<blockWind>false</blockWind>
|
||||||
<motesPerCell>1</motesPerCell>
|
<altitudeLayer>BuildingOnTop</altitudeLayer>
|
||||||
<cameraShake>1</cameraShake>
|
<passability>PassThroughOnly</passability>
|
||||||
<angleCurve>
|
<pathCost>0</pathCost>
|
||||||
<points>
|
<castEdgeShadows>false</castEdgeShadows>
|
||||||
<li>(0,0)</li>
|
<useStuffTerrainAffordance>false</useStuffTerrainAffordance>
|
||||||
<li>(1, 1)</li>
|
<staticSunShadowHeight Inherit="False" IsNull="True" />
|
||||||
</points>
|
<fillPercent>0</fillPercent>
|
||||||
</angleCurve>
|
<canOverlapZones>false</canOverlapZones>
|
||||||
</skyfaller>
|
<terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
|
||||||
<comps>
|
<statBases>
|
||||||
<li Class="CompProperties_Effecter">
|
<MaxHitPoints>1</MaxHitPoints>
|
||||||
<effecterDef>Smoke_Joint</effecterDef>
|
<WorkToBuild>0</WorkToBuild>
|
||||||
</li>
|
<Mass>1</Mass>
|
||||||
</comps>
|
<Flammability>0</Flammability>
|
||||||
</ThingDef>
|
</statBases>
|
||||||
|
<size>(13,13)</size>
|
||||||
<ThingDef ParentName="BuildingBase">
|
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
|
||||||
<defName>WULA_Prefab_Cleanzone_NewColonyBase_Beacon</defName>
|
<resourcesFractionWhenDeconstructed>1</resourcesFractionWhenDeconstructed>
|
||||||
<label>乌拉预制件空投信标-小型前哨站</label>
|
<stuffCategories Inherit="False" />
|
||||||
<description>一个用于呼叫建筑的信标,用于快速建造一个小型前哨站。</description>
|
<researchPrerequisites Inherit="False">
|
||||||
<uiIconPath>Wula/Building/Linked/WULA_Fortress_Wall_MenuIcon</uiIconPath>
|
<li>WULA_Structure_Technology</li>
|
||||||
<tickerType>Normal</tickerType>
|
</researchPrerequisites>
|
||||||
<graphicData>
|
<costStuffCount>0</costStuffCount>
|
||||||
<texPath>Wula/Building/WULA_Dropping_Building_Cleanzone</texPath>
|
<costList>
|
||||||
<graphicClass>Graphic_Multi</graphicClass>
|
<WULA_Alloy>4</WULA_Alloy>
|
||||||
<drawSize>(13,13)</drawSize>
|
</costList>
|
||||||
<damageData>
|
<building>
|
||||||
<enabled>false</enabled>
|
<destroySound>BuildingDestroyed_Metal_Small</destroySound>
|
||||||
</damageData>
|
<isAirtight>false</isAirtight>
|
||||||
</graphicData>
|
<isStuffableAirtight>false</isStuffableAirtight>
|
||||||
<rotatable>false</rotatable>
|
</building>
|
||||||
<neverMultiSelect>false</neverMultiSelect>
|
<comps>
|
||||||
<blockLight>false</blockLight>
|
<li Class="WulaFallenEmpire.CompProperties_PrefabSkyfallerCaller">
|
||||||
<holdsRoof>false</holdsRoof>
|
<prefabDefName>WULA_NewColonyBase</prefabDefName>
|
||||||
<coversFloor>false</coversFloor>
|
<freePrefab>true</freePrefab>
|
||||||
<blockWind>false</blockWind>
|
<skyfallerDef>WULA_Prefab_Incoming</skyfallerDef>
|
||||||
<altitudeLayer>Building</altitudeLayer>
|
<destroyBuilding>true</destroyBuilding>
|
||||||
<passability>PassThroughOnly</passability>
|
<delayTicks>1</delayTicks>
|
||||||
<pathCost>0</pathCost>
|
<allowThinRoof>true</allowThinRoof>
|
||||||
<castEdgeShadows>false</castEdgeShadows>
|
<allowThickRoof>false</allowThickRoof>
|
||||||
<useStuffTerrainAffordance>false</useStuffTerrainAffordance>
|
</li>
|
||||||
<staticSunShadowHeight Inherit="False" IsNull="True" />
|
</comps>
|
||||||
<fillPercent>0</fillPercent>
|
</ThingDef>
|
||||||
<canOverlapZones>false</canOverlapZones>
|
<!-- Prefab Spawner Skyfaller -->
|
||||||
<terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
|
<ThingDef ParentName="SkyfallerBase">
|
||||||
<statBases>
|
<defName>WULA_Prefab_Incoming</defName>
|
||||||
<MaxHitPoints>1</MaxHitPoints>
|
<label>乌拉帝国建筑(空投中)</label>
|
||||||
<WorkToBuild>0</WorkToBuild>
|
<thingClass>WulaFallenEmpire.Skyfaller_PrefabSpawner</thingClass>
|
||||||
<Mass>1</Mass>
|
<size>(13,13)</size>
|
||||||
<Flammability>0</Flammability>
|
<graphicData>
|
||||||
</statBases>
|
<texPath>Wula/Building/WULA_Prefab_Incoming</texPath>
|
||||||
<size>(13,13)</size>
|
<graphicClass>Graphic_Single</graphicClass>
|
||||||
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
|
<shaderType>CutoutFlying</shaderType>
|
||||||
<resourcesFractionWhenDeconstructed>1</resourcesFractionWhenDeconstructed>
|
<drawSize>(19,19)</drawSize>
|
||||||
<stuffCategories Inherit="False"/>
|
</graphicData>
|
||||||
<researchPrerequisites Inherit="False">
|
<skyfaller>
|
||||||
<li>WULA_Structure_Technology</li>
|
<movementType>Accelerate</movementType>
|
||||||
</researchPrerequisites>
|
<shadow>Things/Skyfaller/SkyfallerShadowDropPod</shadow>
|
||||||
<costStuffCount>0</costStuffCount>
|
<shadowSize>(13, 13)</shadowSize>
|
||||||
<costList>
|
<anticipationSound>DropPod_Fall</anticipationSound>
|
||||||
<WULA_Alloy>4</WULA_Alloy>
|
<anticipationSoundTicks>100</anticipationSoundTicks>
|
||||||
</costList>
|
<impactSound>Explosion_Vaporize</impactSound>
|
||||||
<building>
|
<moteSpawnTime>0.05</moteSpawnTime>
|
||||||
<destroySound>BuildingDestroyed_Metal_Small</destroySound>
|
<motesPerCell>1</motesPerCell>
|
||||||
<isAirtight>false</isAirtight>
|
<cameraShake>1</cameraShake>
|
||||||
<isStuffableAirtight>false</isStuffableAirtight>
|
<angleCurve>
|
||||||
</building>
|
<points>
|
||||||
<comps>
|
<li>(0,0)</li>
|
||||||
<li Class="WulaFallenEmpire.CompProperties_PrefabSkyfallerCaller">
|
<li>(1, 1)</li>
|
||||||
<prefabDefName>WULA_NewColonyBase</prefabDefName>
|
</points>
|
||||||
<freePrefab>true</freePrefab>
|
</angleCurve>
|
||||||
<skyfallerDef>WULA_Prefab_Incoming</skyfallerDef>
|
</skyfaller>
|
||||||
<destroyBuilding>true</destroyBuilding>
|
<comps>
|
||||||
<delayTicks>1</delayTicks>
|
<li Class="CompProperties_Effecter">
|
||||||
<allowThinRoof>true</allowThinRoof>
|
<effecterDef>Smoke_Joint</effecterDef>
|
||||||
<allowThickRoof>false</allowThickRoof>
|
</li>
|
||||||
</li>
|
</comps>
|
||||||
</comps>
|
</ThingDef>
|
||||||
</ThingDef>
|
|
||||||
|
|
||||||
</Defs>
|
</Defs>
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
</researchPrerequisites>
|
</researchPrerequisites>
|
||||||
<statBases>
|
<statBases>
|
||||||
<MaxHitPoints>1</MaxHitPoints>
|
<MaxHitPoints>1</MaxHitPoints>
|
||||||
<WorkToBuild>1</WorkToBuild>
|
<WorkToBuild>0</WorkToBuild>
|
||||||
<Mass>1</Mass>
|
<Mass>1</Mass>
|
||||||
<Flammability>0</Flammability>
|
<Flammability>0</Flammability>
|
||||||
</statBases>
|
</statBases>
|
||||||
|
|||||||
@@ -1672,13 +1672,12 @@
|
|||||||
<reflectCost>0</reflectCost>
|
<reflectCost>0</reflectCost>
|
||||||
<reflectEffecter>Interceptor_BlockedProjectile</reflectEffecter>
|
<reflectEffecter>Interceptor_BlockedProjectile</reflectEffecter>
|
||||||
</li>
|
</li>
|
||||||
<li Class="WulaFallenEmpire.CompProperties_DamageTransfer">
|
<li Class="WulaFallenEmpire.CompProperties_DamageInterceptor">
|
||||||
<damageTransferRatio>0.75</damageTransferRatio>
|
<damageTransferRatio>1</damageTransferRatio>
|
||||||
<maxTransferRange>25</maxTransferRange>
|
<targetBuildingDefName>WULA_Sky_Lock</targetBuildingDefName>
|
||||||
<requireLineOfSight>false</requireLineOfSight>
|
|
||||||
<healthThreshold>
|
<healthThreshold>
|
||||||
<min>0.1</min>
|
<min>0</min>
|
||||||
<max>0.9</max>
|
<max>1</max>
|
||||||
</healthThreshold>
|
</healthThreshold>
|
||||||
</li>
|
</li>
|
||||||
<!-- 飞行组件 -->
|
<!-- 飞行组件 -->
|
||||||
|
|||||||
@@ -1,20 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<Defs>
|
<Defs>
|
||||||
<ThoughtDef>
|
|
||||||
<defName>WULA_Energy_Furnace_Though_Hunger</defName>
|
|
||||||
<workerClass>ThoughtWorker_Hediff</workerClass>
|
|
||||||
<hediff>WULA_Energy_Furnace_Hediff_Hunger</hediff>
|
|
||||||
<validWhileDespawned>true</validWhileDespawned>
|
|
||||||
<developmentalStageFilter>Baby, Child, Adult</developmentalStageFilter>
|
|
||||||
<stages>
|
|
||||||
<li>
|
|
||||||
<label>小馋猫</label>
|
|
||||||
<description>我要疯狂偷吃能源核心,这真是太爽了!</description>
|
|
||||||
<baseMoodEffect>20</baseMoodEffect>
|
|
||||||
</li>
|
|
||||||
</stages>
|
|
||||||
</ThoughtDef>
|
|
||||||
|
|
||||||
<ThoughtDef>
|
<ThoughtDef>
|
||||||
<defName>Mech_WULA_Cat_Cute_Though</defName>
|
<defName>Mech_WULA_Cat_Cute_Though</defName>
|
||||||
<workerClass>ThoughtWorker_Hediff</workerClass>
|
<workerClass>ThoughtWorker_Hediff</workerClass>
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 936 KiB |
BIN
Content/Textures/Wula/Building/WULA_Prefab_Incoming.png
Normal file
BIN
Content/Textures/Wula/Building/WULA_Prefab_Incoming.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 705 KiB |
BIN
Content/Textures/Wula/Building/WULA_Sky_Lock/WULA_Sky_Lock_A.png
Normal file
BIN
Content/Textures/Wula/Building/WULA_Sky_Lock/WULA_Sky_Lock_A.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 234 KiB |
BIN
Content/Textures/Wula/Building/WULA_Sky_Lock/WULA_Sky_Lock_B.png
Normal file
BIN
Content/Textures/Wula/Building/WULA_Sky_Lock/WULA_Sky_Lock_B.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 83 KiB |
@@ -1,107 +0,0 @@
|
|||||||
using RimWorld;
|
|
||||||
using Verse;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace WulaFallenEmpire
|
|
||||||
{
|
|
||||||
public class CompDamageReceiver : ThingComp
|
|
||||||
{
|
|
||||||
private CompProperties_DamageReceiver Props => (CompProperties_DamageReceiver)props;
|
|
||||||
|
|
||||||
private float currentDamage;
|
|
||||||
private int lastDamageTick;
|
|
||||||
|
|
||||||
public float CurrentDamage => currentDamage;
|
|
||||||
public float MaxDamageCapacity => Props.maxDamageCapacity;
|
|
||||||
public float DamageRatio => currentDamage / Props.maxDamageCapacity;
|
|
||||||
|
|
||||||
public override void PostExposeData()
|
|
||||||
{
|
|
||||||
base.PostExposeData();
|
|
||||||
Scribe_Values.Look(ref currentDamage, "currentDamage", 0f);
|
|
||||||
Scribe_Values.Look(ref lastDamageTick, "lastDamageTick", 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void CompTick()
|
|
||||||
{
|
|
||||||
base.CompTick();
|
|
||||||
|
|
||||||
// 定期衰减伤害
|
|
||||||
if (Find.TickManager.TicksGame % Props.damageDecayInterval == 0 && currentDamage > 0)
|
|
||||||
{
|
|
||||||
currentDamage = Mathf.Max(0f, currentDamage - Props.damageDecayRate);
|
|
||||||
|
|
||||||
// 如果伤害为0,重置最后伤害时间
|
|
||||||
if (currentDamage <= 0f)
|
|
||||||
{
|
|
||||||
lastDamageTick = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 接收伤害
|
|
||||||
/// </summary>
|
|
||||||
public bool ReceiveDamage(float damageAmount, Pawn sourcePawn = null)
|
|
||||||
{
|
|
||||||
float oldDamage = currentDamage;
|
|
||||||
currentDamage += damageAmount;
|
|
||||||
lastDamageTick = Find.TickManager.TicksGame;
|
|
||||||
|
|
||||||
// 检查是否超过容量
|
|
||||||
if (currentDamage >= Props.maxDamageCapacity)
|
|
||||||
{
|
|
||||||
if (Props.canBeDestroyedByDamage)
|
|
||||||
{
|
|
||||||
// 摧毁建筑
|
|
||||||
parent.Destroy(DestroyMode.Vanish);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// 只是达到上限,不再接收更多伤害
|
|
||||||
currentDamage = Props.maxDamageCapacity;
|
|
||||||
}
|
|
||||||
return false; // 无法接收更多伤害
|
|
||||||
}
|
|
||||||
|
|
||||||
// 触发效果
|
|
||||||
OnDamageReceived(damageAmount, sourcePawn);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnDamageReceived(float damageAmount, Pawn sourcePawn)
|
|
||||||
{
|
|
||||||
// 记录日志
|
|
||||||
Log.Message($"[DamageReceiver] {parent.Label} 接收 {damageAmount} 点伤害,当前伤害: {currentDamage}/{Props.maxDamageCapacity}");
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void PostDraw()
|
|
||||||
{
|
|
||||||
base.PostDraw();
|
|
||||||
|
|
||||||
// 绘制伤害条
|
|
||||||
if (Props.showDamageBar && currentDamage > 0f)
|
|
||||||
{
|
|
||||||
Vector3 drawPos = parent.DrawPos;
|
|
||||||
drawPos.y += 0.5f; // 在建筑上方显示
|
|
||||||
|
|
||||||
GenDraw.DrawFillableBar(new GenDraw.FillableBarRequest
|
|
||||||
{
|
|
||||||
center = drawPos,
|
|
||||||
size = new Vector2(1f, 0.15f),
|
|
||||||
fillPercent = DamageRatio,
|
|
||||||
filledMat = SolidColorMaterials.SimpleSolidColorMaterial(Color.red),
|
|
||||||
unfilledMat = SolidColorMaterials.SimpleSolidColorMaterial(Color.gray),
|
|
||||||
margin = 0.1f,
|
|
||||||
rotation = Rot4.North
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取接收器状态
|
|
||||||
public string GetStatusString()
|
|
||||||
{
|
|
||||||
return $"伤害吸收: {currentDamage:F0}/{Props.maxDamageCapacity:F0} ({DamageRatio * 100:F1}%)";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
using RimWorld;
|
|
||||||
using Verse;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Verse.Sound;
|
|
||||||
|
|
||||||
namespace WulaFallenEmpire
|
|
||||||
{
|
|
||||||
public class CompDamageTransfer : ThingComp
|
|
||||||
{
|
|
||||||
private CompProperties_DamageTransfer Props => (CompProperties_DamageTransfer)props;
|
|
||||||
private Pawn Pawn => (Pawn)parent;
|
|
||||||
|
|
||||||
public override void PostPostApplyDamage(DamageInfo dinfo, float totalDamageDealt)
|
|
||||||
{
|
|
||||||
base.PostPostApplyDamage(dinfo, totalDamageDealt);
|
|
||||||
|
|
||||||
// 检查是否应该转移伤害
|
|
||||||
if (ShouldTransferDamage(dinfo, totalDamageDealt))
|
|
||||||
{
|
|
||||||
TryTransferDamage(dinfo, totalDamageDealt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool ShouldTransferDamage(DamageInfo dinfo, float totalDamageDealt)
|
|
||||||
{
|
|
||||||
if (parent == null || !parent.Spawned)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// 检查生命值阈值
|
|
||||||
if (Pawn.health != null)
|
|
||||||
{
|
|
||||||
float healthRatio = Pawn.health.summaryHealth.SummaryHealthPercent;
|
|
||||||
if (healthRatio < Props.healthThreshold.min || healthRatio > Props.healthThreshold.max)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检查伤害类型
|
|
||||||
if (!Props.transferAllDamageTypes)
|
|
||||||
{
|
|
||||||
// 这里可以添加特定伤害类型检查
|
|
||||||
// 例如:只转移物理伤害,不转移火焰伤害等
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TryTransferDamage(DamageInfo dinfo, float totalDamageDealt)
|
|
||||||
{
|
|
||||||
// 计算转移的伤害量
|
|
||||||
float transferDamage = totalDamageDealt * Props.damageTransferRatio;
|
|
||||||
|
|
||||||
// 寻找可用的伤害接收器
|
|
||||||
CompDamageReceiver receiver = FindAvailableDamageReceiver();
|
|
||||||
if (receiver != null)
|
|
||||||
{
|
|
||||||
// 执行伤害转移
|
|
||||||
if (receiver.ReceiveDamage(transferDamage, Pawn))
|
|
||||||
{
|
|
||||||
OnDamageTransferred(dinfo, transferDamage, receiver);
|
|
||||||
|
|
||||||
// 记录日志
|
|
||||||
Log.Message($"[DamageTransfer] {Pawn.LabelShort} 将 {transferDamage} 点伤害转移至 {receiver.parent.Label}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private CompDamageReceiver FindAvailableDamageReceiver()
|
|
||||||
{
|
|
||||||
if (parent?.Map == null)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
var map = parent.Map;
|
|
||||||
var faction = parent.Faction;
|
|
||||||
|
|
||||||
// 搜索范围内的同派系建筑
|
|
||||||
foreach (var thing in GenRadial.RadialDistinctThingsAround(parent.Position, map, Props.maxTransferRange, true))
|
|
||||||
{
|
|
||||||
if (thing is Building building &&
|
|
||||||
building.Faction == faction &&
|
|
||||||
building != parent)
|
|
||||||
{
|
|
||||||
var receiver = building.TryGetComp<CompDamageReceiver>();
|
|
||||||
if (receiver != null && receiver.CurrentDamage < receiver.MaxDamageCapacity)
|
|
||||||
{
|
|
||||||
// 检查视线(如果需要)
|
|
||||||
if (Props.requireLineOfSight)
|
|
||||||
{
|
|
||||||
if (!GenSight.LineOfSight(parent.Position, building.Position, map))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
return receiver;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnDamageTransferred(DamageInfo dinfo, float transferDamage, CompDamageReceiver receiver)
|
|
||||||
{
|
|
||||||
// 创建转移效果
|
|
||||||
if (Props.transferEffecter != null)
|
|
||||||
{
|
|
||||||
Effecter effect = Props.transferEffecter.Spawn();
|
|
||||||
effect.Trigger(new TargetInfo(parent.Position, parent.Map), new TargetInfo(receiver.parent.Position, parent.Map));
|
|
||||||
effect.Cleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 播放音效
|
|
||||||
if (Props.transferSound != null)
|
|
||||||
{
|
|
||||||
Props.transferSound.PlayOneShot(new TargetInfo(parent.Position, parent.Map));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取组件状态
|
|
||||||
public string GetStatusString()
|
|
||||||
{
|
|
||||||
return $"伤害转移: {Props.damageTransferRatio * 100}% (范围: {Props.maxTransferRange})";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
using RimWorld;
|
|
||||||
using Verse;
|
|
||||||
|
|
||||||
namespace WulaFallenEmpire
|
|
||||||
{
|
|
||||||
public class CompProperties_DamageReceiver : CompProperties
|
|
||||||
{
|
|
||||||
public float maxDamageCapacity = 1000f; // 最大伤害容量
|
|
||||||
public float damageDecayRate = 5f; // 每 tick 衰减的伤害量
|
|
||||||
public float damageDecayInterval = 60f; // 伤害衰减间隔(ticks)
|
|
||||||
public bool showDamageBar = true; // 是否显示伤害条
|
|
||||||
public bool canBeDestroyedByDamage = true; // 是否可以被伤害摧毁
|
|
||||||
|
|
||||||
public CompProperties_DamageReceiver()
|
|
||||||
{
|
|
||||||
compClass = typeof(CompDamageReceiver);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
using RimWorld;
|
|
||||||
using Verse;
|
|
||||||
|
|
||||||
namespace WulaFallenEmpire
|
|
||||||
{
|
|
||||||
public class CompProperties_DamageTransfer : CompProperties
|
|
||||||
{
|
|
||||||
public float damageTransferRatio = 0.8f; // 伤害转移比例 (80%)
|
|
||||||
public float maxTransferRange = 30f; // 最大转移范围
|
|
||||||
public bool requireLineOfSight = false; // 是否需要视线
|
|
||||||
public bool transferAllDamageTypes = true; // 是否转移所有伤害类型
|
|
||||||
public FloatRange healthThreshold = new FloatRange(0f, 1f); // 生命值阈值(低于此值才触发)
|
|
||||||
|
|
||||||
// 效果设置
|
|
||||||
public EffecterDef transferEffecter;
|
|
||||||
public SoundDef transferSound;
|
|
||||||
|
|
||||||
public CompProperties_DamageTransfer()
|
|
||||||
{
|
|
||||||
compClass = typeof(CompDamageTransfer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
using HarmonyLib;
|
|
||||||
using RimWorld;
|
|
||||||
using Verse;
|
|
||||||
|
|
||||||
namespace WulaFallenEmpire
|
|
||||||
{
|
|
||||||
[HarmonyPatch(typeof(Pawn), "PostApplyDamage")]
|
|
||||||
public static class Patch_Pawn_PostApplyDamage
|
|
||||||
{
|
|
||||||
[HarmonyPostfix]
|
|
||||||
public static void Postfix(Pawn __instance, DamageInfo dinfo, float totalDamageDealt)
|
|
||||||
{
|
|
||||||
// 检查Pawn是否有伤害转移组件
|
|
||||||
var transferComp = __instance.TryGetComp<CompDamageTransfer>();
|
|
||||||
if (transferComp != null)
|
|
||||||
{
|
|
||||||
// 组件会在PostPostApplyDamage中自动处理
|
|
||||||
// 这里主要用于调试和日志记录
|
|
||||||
Log.Message($"[DamageTransfer] {__instance.LabelShort} 受到 {totalDamageDealt} 点伤害,转移组件已激活");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[HarmonyPatch(typeof(Pawn), "PreApplyDamage")]
|
|
||||||
public static class Patch_Pawn_PreApplyDamage
|
|
||||||
{
|
|
||||||
[HarmonyPrefix]
|
|
||||||
public static bool Prefix(Pawn __instance, ref DamageInfo dinfo, out bool __state)
|
|
||||||
{
|
|
||||||
__state = false;
|
|
||||||
|
|
||||||
// 检查Pawn是否有伤害转移组件
|
|
||||||
var transferComp = __instance.TryGetComp<CompDamageTransfer>();
|
|
||||||
if (transferComp != null && __instance.Spawned && !__instance.Dead)
|
|
||||||
{
|
|
||||||
// 这里可以添加预处理逻辑
|
|
||||||
// 例如:在某些条件下完全阻止伤害
|
|
||||||
__state = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
[HarmonyPostfix]
|
|
||||||
public static void Postfix(Pawn __instance, DamageInfo dinfo, bool __state)
|
|
||||||
{
|
|
||||||
if (__state)
|
|
||||||
{
|
|
||||||
// 后处理逻辑
|
|
||||||
// 例如:记录伤害转移统计
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,137 @@
|
|||||||
|
using RimWorld;
|
||||||
|
using Verse;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Verse.Sound;
|
||||||
|
using HarmonyLib;
|
||||||
|
|
||||||
|
namespace WulaFallenEmpire
|
||||||
|
{
|
||||||
|
public class CompDamageInterceptor : ThingComp
|
||||||
|
{
|
||||||
|
private CompProperties_DamageInterceptor Props => (CompProperties_DamageInterceptor)props;
|
||||||
|
private Pawn Pawn => (Pawn)parent;
|
||||||
|
|
||||||
|
// 使用Harmony补丁在伤害应用前完全拦截
|
||||||
|
public bool PreApplyDamage(ref DamageInfo dinfo)
|
||||||
|
{
|
||||||
|
if (!ShouldInterceptDamage(dinfo))
|
||||||
|
return true; // 继续应用伤害
|
||||||
|
|
||||||
|
// 计算要转移的伤害量(完全拦截)
|
||||||
|
float transferDamage = dinfo.Amount * Props.damageTransferRatio;
|
||||||
|
|
||||||
|
// 寻找可用的目标建筑
|
||||||
|
Building targetBuilding = FindTargetBuilding();
|
||||||
|
if (targetBuilding != null)
|
||||||
|
{
|
||||||
|
// 将伤害完全转移到建筑
|
||||||
|
ApplyDamageToBuilding(transferDamage, targetBuilding, dinfo);
|
||||||
|
OnDamageIntercepted(dinfo, transferDamage, targetBuilding);
|
||||||
|
|
||||||
|
// 完全拦截伤害 - 将伤害设置为0
|
||||||
|
dinfo.SetAmount(0f);
|
||||||
|
|
||||||
|
Log.Message($"[DamageInterceptor] {Pawn.LabelShort} 完全拦截 {transferDamage} 点伤害并转移至 {targetBuilding.Label},自身承受0伤害");
|
||||||
|
|
||||||
|
return true; // 继续应用修改后的伤害(0伤害)
|
||||||
|
}
|
||||||
|
|
||||||
|
return true; // 没有找到建筑,正常应用伤害
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool ShouldInterceptDamage(DamageInfo dinfo)
|
||||||
|
{
|
||||||
|
if (parent == null || !parent.Spawned || Pawn.Dead)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// 检查生命值阈值
|
||||||
|
if (Pawn.health != null)
|
||||||
|
{
|
||||||
|
float healthRatio = Pawn.health.summaryHealth.SummaryHealthPercent;
|
||||||
|
if (healthRatio < Props.healthThreshold.min || healthRatio > Props.healthThreshold.max)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Building FindTargetBuilding()
|
||||||
|
{
|
||||||
|
if (parent?.Map == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var map = parent.Map;
|
||||||
|
var faction = parent.Faction;
|
||||||
|
|
||||||
|
// 在全图范围内搜索目标建筑
|
||||||
|
List<Building> targetBuildings = new List<Building>();
|
||||||
|
foreach (var building in map.listerBuildings.allBuildingsColonist)
|
||||||
|
{
|
||||||
|
if (building.def.defName == Props.targetBuildingDefName &&
|
||||||
|
!building.Destroyed)
|
||||||
|
{
|
||||||
|
// 检查派系(如果需要)
|
||||||
|
if (Props.requireSameFaction && building.Faction != faction)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
targetBuildings.Add(building);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 随机选择一个建筑
|
||||||
|
if (targetBuildings.Count > 0)
|
||||||
|
{
|
||||||
|
return targetBuildings.RandomElement();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 将伤害直接应用到目标建筑的生命值上
|
||||||
|
/// </summary>
|
||||||
|
private void ApplyDamageToBuilding(float damageAmount, Building building, DamageInfo originalDinfo)
|
||||||
|
{
|
||||||
|
// 创建新的伤害信息,使用原始伤害类型
|
||||||
|
DamageInfo buildingDamage = new DamageInfo(
|
||||||
|
originalDinfo.Def, // 使用相同的伤害类型
|
||||||
|
damageAmount,
|
||||||
|
originalDinfo.ArmorPenetrationInt,
|
||||||
|
originalDinfo.Angle,
|
||||||
|
originalDinfo.Instigator,
|
||||||
|
originalDinfo.HitPart,
|
||||||
|
originalDinfo.Weapon,
|
||||||
|
originalDinfo.Category,
|
||||||
|
originalDinfo.IntendedTarget
|
||||||
|
);
|
||||||
|
|
||||||
|
// 对建筑造成伤害
|
||||||
|
building.TakeDamage(buildingDamage);
|
||||||
|
|
||||||
|
Log.Message($"[DamageInterceptor] 对建筑 {building.Label} 造成 {damageAmount} 点伤害,剩余生命值: {building.HitPoints}/{building.MaxHitPoints}");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDamageIntercepted(DamageInfo dinfo, float interceptDamage, Building targetBuilding)
|
||||||
|
{
|
||||||
|
// 创建拦截效果
|
||||||
|
if (Props.interceptEffecter != null)
|
||||||
|
{
|
||||||
|
Effecter effect = Props.interceptEffecter.Spawn();
|
||||||
|
effect.Trigger(new TargetInfo(parent.Position, parent.Map), new TargetInfo(targetBuilding.Position, parent.Map));
|
||||||
|
effect.Cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 播放音效
|
||||||
|
if (Props.interceptSound != null)
|
||||||
|
{
|
||||||
|
Props.interceptSound.PlayOneShot(new TargetInfo(parent.Position, parent.Map));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取组件状态
|
||||||
|
public string GetStatusString()
|
||||||
|
{
|
||||||
|
return $"伤害拦截: {Props.damageTransferRatio * 100}% → {Props.targetBuildingDefName}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
using RimWorld;
|
||||||
|
using Verse;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Verse.Sound;
|
||||||
|
|
||||||
|
namespace WulaFallenEmpire
|
||||||
|
{
|
||||||
|
public class CompDamageRelay : ThingComp
|
||||||
|
{
|
||||||
|
private CompProperties_DamageRelay Props => (CompProperties_DamageRelay)props;
|
||||||
|
private Building Building => (Building)parent;
|
||||||
|
|
||||||
|
public override void PostPostApplyDamage(DamageInfo dinfo, float totalDamageDealt)
|
||||||
|
{
|
||||||
|
base.PostPostApplyDamage(dinfo, totalDamageDealt);
|
||||||
|
|
||||||
|
// 检查是否应该传递伤害
|
||||||
|
if (ShouldRelayDamage(dinfo, totalDamageDealt))
|
||||||
|
{
|
||||||
|
TryRelayDamage(dinfo, totalDamageDealt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool ShouldRelayDamage(DamageInfo dinfo, float totalDamageDealt)
|
||||||
|
{
|
||||||
|
if (parent == null || !parent.Spawned || parent.Destroyed)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// 检查生命值阈值
|
||||||
|
float healthRatio = (float)Building.HitPoints / Building.MaxHitPoints;
|
||||||
|
if (healthRatio < Props.healthThreshold.min || healthRatio > Props.healthThreshold.max)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TryRelayDamage(DamageInfo dinfo, float totalDamageDealt)
|
||||||
|
{
|
||||||
|
// 计算传递的伤害量
|
||||||
|
float relayDamage = totalDamageDealt * Props.damageRelayRatio;
|
||||||
|
|
||||||
|
// 寻找可用的同派系建筑
|
||||||
|
Building targetBuilding = FindAvailableBuilding();
|
||||||
|
if (targetBuilding != null)
|
||||||
|
{
|
||||||
|
// 执行伤害传递
|
||||||
|
ApplyDamageToBuilding(relayDamage, targetBuilding, dinfo);
|
||||||
|
OnDamageRelayed(dinfo, relayDamage, targetBuilding);
|
||||||
|
|
||||||
|
// 记录日志
|
||||||
|
Log.Message($"[DamageRelay] {Building.Label} 将 {relayDamage} 点伤害传递给 {targetBuilding.Label}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Building FindAvailableBuilding()
|
||||||
|
{
|
||||||
|
if (parent?.Map == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var map = parent.Map;
|
||||||
|
var faction = parent.Faction;
|
||||||
|
|
||||||
|
// 在全图范围内搜索建筑
|
||||||
|
List<Building> availableBuildings = new List<Building>();
|
||||||
|
foreach (var building in map.listerBuildings.allBuildingsColonist)
|
||||||
|
{
|
||||||
|
if (building != parent && !building.Destroyed)
|
||||||
|
{
|
||||||
|
// 检查派系(如果需要)
|
||||||
|
if (Props.relayOnlyToSameFaction && building.Faction != faction)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
availableBuildings.Add(building);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 随机选择一个建筑
|
||||||
|
if (availableBuildings.Count > 0)
|
||||||
|
{
|
||||||
|
return availableBuildings.RandomElement();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 将伤害直接应用到目标建筑的生命值上
|
||||||
|
/// </summary>
|
||||||
|
private void ApplyDamageToBuilding(float damageAmount, Building building, DamageInfo originalDinfo)
|
||||||
|
{
|
||||||
|
// 创建新的伤害信息,使用原始伤害类型
|
||||||
|
DamageInfo buildingDamage = new DamageInfo(
|
||||||
|
originalDinfo.Def, // 使用相同的伤害类型
|
||||||
|
damageAmount,
|
||||||
|
originalDinfo.ArmorPenetrationInt,
|
||||||
|
originalDinfo.Angle,
|
||||||
|
originalDinfo.Instigator,
|
||||||
|
originalDinfo.HitPart,
|
||||||
|
originalDinfo.Weapon,
|
||||||
|
originalDinfo.Category,
|
||||||
|
originalDinfo.IntendedTarget
|
||||||
|
);
|
||||||
|
|
||||||
|
// 对建筑造成伤害
|
||||||
|
building.TakeDamage(buildingDamage);
|
||||||
|
|
||||||
|
Log.Message($"[DamageRelay] 对建筑 {building.Label} 造成 {damageAmount} 点伤害,剩余生命值: {building.HitPoints}/{building.MaxHitPoints}");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDamageRelayed(DamageInfo dinfo, float relayDamage, Building targetBuilding)
|
||||||
|
{
|
||||||
|
// 创建传递效果
|
||||||
|
if (Props.relayEffecter != null)
|
||||||
|
{
|
||||||
|
Effecter effect = Props.relayEffecter.Spawn();
|
||||||
|
effect.Trigger(new TargetInfo(parent.Position, parent.Map), new TargetInfo(targetBuilding.Position, parent.Map));
|
||||||
|
effect.Cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 播放音效
|
||||||
|
if (Props.relaySound != null)
|
||||||
|
{
|
||||||
|
Props.relaySound.PlayOneShot(new TargetInfo(parent.Position, parent.Map));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取组件状态
|
||||||
|
public string GetStatusString()
|
||||||
|
{
|
||||||
|
return $"伤害传递: {Props.damageRelayRatio * 100}%";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using RimWorld;
|
||||||
|
using Verse;
|
||||||
|
|
||||||
|
namespace WulaFallenEmpire
|
||||||
|
{
|
||||||
|
public class CompProperties_DamageInterceptor : CompProperties
|
||||||
|
{
|
||||||
|
public float damageTransferRatio = 1f; // 完全拦截并转移伤害
|
||||||
|
public string targetBuildingDefName = "WULA_Sky_Lock"; // 目标建筑类型
|
||||||
|
public bool requireSameFaction = true; // 是否需要同派系
|
||||||
|
public FloatRange healthThreshold = new FloatRange(0f, 1f); // 生命值阈值范围
|
||||||
|
|
||||||
|
// 效果设置
|
||||||
|
public EffecterDef interceptEffecter;
|
||||||
|
public SoundDef interceptSound;
|
||||||
|
|
||||||
|
public CompProperties_DamageInterceptor()
|
||||||
|
{
|
||||||
|
compClass = typeof(CompDamageInterceptor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using RimWorld;
|
||||||
|
using Verse;
|
||||||
|
|
||||||
|
namespace WulaFallenEmpire
|
||||||
|
{
|
||||||
|
public class CompProperties_DamageRelay : CompProperties
|
||||||
|
{
|
||||||
|
public float damageRelayRatio = 0.3f; // 继续传递伤害的比例
|
||||||
|
public bool relayOnlyToSameFaction = true; // 是否只传递给同派系建筑
|
||||||
|
public FloatRange healthThreshold = new FloatRange(0.1f, 1f); // 生命值阈值(低于此值才开始传递)
|
||||||
|
|
||||||
|
// 效果设置
|
||||||
|
public EffecterDef relayEffecter;
|
||||||
|
public SoundDef relaySound;
|
||||||
|
|
||||||
|
public CompProperties_DamageRelay()
|
||||||
|
{
|
||||||
|
compClass = typeof(CompDamageRelay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
using HarmonyLib;
|
||||||
|
using RimWorld;
|
||||||
|
using Verse;
|
||||||
|
|
||||||
|
namespace WulaFallenEmpire
|
||||||
|
{
|
||||||
|
[HarmonyPatch(typeof(Pawn), "PreApplyDamage")]
|
||||||
|
public static class Patch_Pawn_PreApplyDamage
|
||||||
|
{
|
||||||
|
[HarmonyPrefix]
|
||||||
|
public static bool Prefix(Pawn __instance, ref DamageInfo dinfo)
|
||||||
|
{
|
||||||
|
// 检查Pawn是否有伤害拦截组件
|
||||||
|
var interceptorComp = __instance.TryGetComp<CompDamageInterceptor>();
|
||||||
|
if (interceptorComp != null)
|
||||||
|
{
|
||||||
|
Log.Message($"[DamageInterceptor] {__instance.LabelShort} 即将受到 {dinfo.Amount} 点伤害,拦截组件激活");
|
||||||
|
|
||||||
|
// 让拦截组件处理伤害
|
||||||
|
return interceptorComp.PreApplyDamage(ref dinfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true; // 继续正常处理伤害
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HarmonyPatch(typeof(Pawn), "PostApplyDamage")]
|
||||||
|
public static class Patch_Pawn_PostApplyDamage
|
||||||
|
{
|
||||||
|
[HarmonyPostfix]
|
||||||
|
public static void Postfix(Pawn __instance, DamageInfo dinfo, float totalDamageDealt)
|
||||||
|
{
|
||||||
|
// 记录实际承受的伤害
|
||||||
|
var interceptorComp = __instance.TryGetComp<CompDamageInterceptor>();
|
||||||
|
if (interceptorComp != null && totalDamageDealt == 0f)
|
||||||
|
{
|
||||||
|
Log.Message($"[DamageInterceptor] {__instance.LabelShort} 成功拦截所有伤害,实际承受0点伤害");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -270,11 +270,11 @@
|
|||||||
<Compile Include="ThingComp\WULA_AreaTeleporter\ThingComp_AreaTeleporter.cs" />
|
<Compile Include="ThingComp\WULA_AreaTeleporter\ThingComp_AreaTeleporter.cs" />
|
||||||
<Compile Include="ThingComp\WULA_CustomUniqueWeapon\CompCustomUniqueWeapon.cs" />
|
<Compile Include="ThingComp\WULA_CustomUniqueWeapon\CompCustomUniqueWeapon.cs" />
|
||||||
<Compile Include="ThingComp\WULA_CustomUniqueWeapon\CompProperties_CustomUniqueWeapon.cs" />
|
<Compile Include="ThingComp\WULA_CustomUniqueWeapon\CompProperties_CustomUniqueWeapon.cs" />
|
||||||
<Compile Include="ThingComp\WULA_DamageReceiver\CompDamageReceiver.cs" />
|
<Compile Include="ThingComp\WULA_DamageTransaction\CompDamageInterceptor.cs" />
|
||||||
<Compile Include="ThingComp\WULA_DamageReceiver\CompDamageTransfer.cs" />
|
<Compile Include="ThingComp\WULA_DamageTransaction\CompDamageRelay.cs" />
|
||||||
<Compile Include="ThingComp\WULA_DamageReceiver\CompProperties_DamageReceiver.cs" />
|
<Compile Include="ThingComp\WULA_DamageTransaction\CompProperties_DamageInterceptor.cs" />
|
||||||
<Compile Include="ThingComp\WULA_DamageReceiver\CompProperties_DamageTransfer.cs" />
|
<Compile Include="ThingComp\WULA_DamageTransaction\CompProperties_DamageRelay.cs" />
|
||||||
<Compile Include="ThingComp\WULA_DamageReceiver\Patch_Pawn_DamageTransfer.cs" />
|
<Compile Include="ThingComp\WULA_DamageTransaction\Patch_Pawn_PreApplyDamage.cs" />
|
||||||
<Compile Include="ThingComp\WULA_GiveHediffsInRange\CompGiveHediffsInRange.cs" />
|
<Compile Include="ThingComp\WULA_GiveHediffsInRange\CompGiveHediffsInRange.cs" />
|
||||||
<Compile Include="ThingComp\WULA_GiveHediffsInRange\CompProperties_GiveHediffsInRange.cs" />
|
<Compile Include="ThingComp\WULA_GiveHediffsInRange\CompProperties_GiveHediffsInRange.cs" />
|
||||||
<Compile Include="ThingComp\WULA_MechRepairKit\CompUseEffect_FixAllHealthConditions.cs" />
|
<Compile Include="ThingComp\WULA_MechRepairKit\CompUseEffect_FixAllHealthConditions.cs" />
|
||||||
|
|||||||
Binary file not shown.
BIN
美术与文本源文件/Wula/Building/WULA_Sky_Lock.sai2
Normal file
BIN
美术与文本源文件/Wula/Building/WULA_Sky_Lock.sai2
Normal file
Binary file not shown.
Reference in New Issue
Block a user