This commit is contained in:
Tourswen
2025-11-06 02:14:36 +08:00
parent f01c35e95e
commit 762c5db4cf
29 changed files with 702 additions and 467 deletions

View File

@@ -9,7 +9,6 @@
<description>[PAWN_nameDef] 是产自科鲁普星区的合成人。这片星区是一个四战之地——由于其地处边缘且地缘政治复杂,乌拉帝国从未真正掌控这片星区,但是此处优秀的稀有水晶和异星天然气使得帝国不愿放弃此星区的掌控。\n\n在此处生产的合成人使用的战略物资远高于其他星区这使得其拥有更高的机体耐久和更低的能量消耗并且内置了一定的战斗和手工能力。</description>
<skillGains>
<Shooting>3</Shooting>
<Crafting>4</Crafting>
</skillGains>
<spawnCategories>
<li>Wula_Backstory_Categories</li>
@@ -24,7 +23,7 @@
<HediffDef>
<defName>WULA_Child_Backstory01_Hediff</defName>
<label>产地:科鲁普</label>
<description>[PAWN_nameDef] 是产自科鲁普星区的合成人。在此处生产的合成人使用的战略物资远高于其他星区,这使得其拥有更高的机体耐久和更低的能量消耗,并且内置了一定的战斗能力。</description>
<description>在此处生产的合成人使用的战略物资远高于其他星区,这使得其拥有更高的机体耐久和更低的能量消耗,并且内置了一定的战斗能力。</description>
<hediffClass>HediffWithComps</hediffClass>
<everCurableByItem>false</everCurableByItem>
<duplicationAllowed>false</duplicationAllowed>
@@ -63,7 +62,7 @@
<HediffDef>
<defName>WULA_Child_Backstory02_Hediff</defName>
<label>产地:代达罗斯</label>
<description>[PAWN_nameDef] 是产自代达罗斯星区的合成人。从此生产的合成人配置了强大的生产系统,使得它们可以抵消此型合成人在采矿和建造上的天然劣势。</description>
<description>从此生产的合成人配置了强大的生产系统,使得它们可以抵消此型合成人在采矿和建造上的天然劣势。</description>
<hediffClass>HediffWithComps</hediffClass>
<everCurableByItem>false</everCurableByItem>
<duplicationAllowed>false</duplicationAllowed>
@@ -104,7 +103,7 @@
<HediffDef>
<defName>WULA_Child_Backstory03_Hediff</defName>
<label>产地:皇宫区</label>
<description>[PAWN_nameDef] 是产自代达罗斯星区的合成人。此处生产的合成人通常是比其他星区的合成人更加精致和风度翩翩,这使得她们在社交和艺术上拥有得天独厚的优势。</description>
<description>此处生产的合成人通常是比其他星区的合成人更加精致和风度翩翩,这使得她们在社交和艺术上拥有得天独厚的优势。</description>
<hediffClass>HediffWithComps</hediffClass>
<everCurableByItem>false</everCurableByItem>
<duplicationAllowed>false</duplicationAllowed>
@@ -142,7 +141,7 @@
<HediffDef>
<defName>WULA_Child_Backstory04_Hediff</defName>
<label>产地:德尔塔</label>
<description>[PAWN_nameDef] 是产自代达罗斯星区的合成人。此处生产的合成人作为专门的战争机械而设计,结构简单易维护,拥有无可争议的战斗能力,但是不太擅长其他的工作。</description>
<description>此处生产的合成人作为专门的战争机械而设计,结构简单易维护,拥有无可争议的战斗能力,但是不太擅长其他的工作。</description>
<hediffClass>HediffWithComps</hediffClass>
<everCurableByItem>false</everCurableByItem>
<duplicationAllowed>false</duplicationAllowed>
@@ -164,4 +163,148 @@
</li>
</stages>
</HediffDef>
<AlienRace.AlienBackstoryDef>
<defName>WULA_Child_Backstory05</defName>
<ignoreIllegalLabelCharacterConfigError>False</ignoreIllegalLabelCharacterConfigError>
<slot>Childhood</slot>
<title>产地:瑟利斯</title>
<titleShort>瑟利斯</titleShort>
<description>[PAWN_nameDef] 是产自瑟利斯星区的合成人。瑟利斯星区是乌拉帝国科研中心,尽管帝国的基础科技已经陷入事实上的停滞,但是帝国内的有志之士还是对星区中无尽的知识贮藏趋之若鹜。不过这一带生产的合成人经常被抽调去本地的秘密项目,不太容易有机会调往其他星区。\n\n此处生产的合成人是科研特化型号她们非常擅长于研究并且是少数能直接操纵机械族的合成人——尽管乌拉帝国的机械族都是自律机械。</description>
<skillGains>
<Intellectual>6</Intellectual>
</skillGains>
<spawnCategories>
<li>Wula_Backstory_Categories</li>
</spawnCategories>
<requiredWorkTags>None</requiredWorkTags>
<forcedHediffs>
<li>WULA_Child_Backstory05_Hediff</li>
</forcedHediffs>
<forcedTraitsChance>
</forcedTraitsChance>
</AlienRace.AlienBackstoryDef>
<HediffDef>
<defName>WULA_Child_Backstory05_Hediff</defName>
<label>产地:瑟利斯</label>
<description>此处生产的合成人是科研特化型号,她们非常擅长于研究,并且是少数能直接操纵机械族的合成人——尽管乌拉帝国的机械族都是自律机械。</description>
<hediffClass>HediffWithComps</hediffClass>
<everCurableByItem>false</everCurableByItem>
<duplicationAllowed>false</duplicationAllowed>
<keepOnBodyPartRestoration>True</keepOnBodyPartRestoration>
<isBad>false</isBad>
<stages>
<li>
<statOffsets>
<MechBandwidth>3</MechBandwidth>
<MechControlGroups>1</MechControlGroups>
</statOffsets>
</li>
</stages>
</HediffDef>
<AlienRace.AlienBackstoryDef>
<defName>WULA_Child_Backstory06</defName>
<ignoreIllegalLabelCharacterConfigError>False</ignoreIllegalLabelCharacterConfigError>
<slot>Childhood</slot>
<title>产地:玛瑞克</title>
<titleShort>玛瑞克</titleShort>
<description>[PAWN_nameDef] 是产自玛瑞克星区的合成人。玛瑞克星区是一个相较于其他星区都要庞大的农业型星区。这里有多个天文位置得天独厚的行星适合进行农业生产,使其得以源源不断地向乌拉帝国输送大量的食材。\n\n这个星域生产的合成人通常内置了家政和农业系统使得她们非常善于处理一些杂事。此外她们经久耐用的射击使其在自然条件下的磨损速度比其他星区的合成人要慢很多。</description>
<skillGains>
<Cooking>4</Cooking>
<Plants>4</Plants>
<Animals>4</Animals>
</skillGains>
<spawnCategories>
<li>Wula_Backstory_Categories</li>
</spawnCategories>
<requiredWorkTags>None</requiredWorkTags>
<forcedHediffs>
<li>WULA_Child_Backstory06_Hediff</li>
</forcedHediffs>
<forcedTraitsChance>
</forcedTraitsChance>
</AlienRace.AlienBackstoryDef>
<HediffDef>
<defName>WULA_Child_Backstory06_Hediff</defName>
<label>产地:玛瑞克</label>
<description>这个星域生产的合成人通常内置了家政和农业系统,使得她们非常善于处理一些杂事。此外她们经久耐用的射击使其在自然条件下的磨损速度比其他星区的合成人要慢很多。</description>
<hediffClass>HediffWithComps</hediffClass>
<everCurableByItem>false</everCurableByItem>
<duplicationAllowed>false</duplicationAllowed>
<keepOnBodyPartRestoration>True</keepOnBodyPartRestoration>
<isBad>false</isBad>
<stages>
<li>
<statFactors>
<WULA_MaintenanceDegradationFactor>0.5</WULA_MaintenanceDegradationFactor>
</statFactors>
</li>
</stages>
</HediffDef>
<AlienRace.AlienBackstoryDef>
<defName>WULA_Child_Backstory07</defName>
<ignoreIllegalLabelCharacterConfigError>False</ignoreIllegalLabelCharacterConfigError>
<slot>Childhood</slot>
<title>产地:戴森</title>
<titleShort>戴森</titleShort>
<description>[PAWN_nameDef] 是产自戴森星区的合成人。戴森星区集中建立了大量天文级别的巨型空间结构,是昔日乌拉帝国雄厚国力的直接体现。如此多的巨型结构自然需要大量高适应性的合成人参与维护。\n\n诞生于此的合成人拥有强大的手工系统她们的纳米修复被设计用于在极端环境下实现自持修复因此修复消耗要低于其他星区的合成人。</description>
<skillGains>
<Crafting>5</Crafting>
<Medicine>4</Medicine>
</skillGains>
<spawnCategories>
<li>Wula_Backstory_Categories</li>
</spawnCategories>
<requiredWorkTags>None</requiredWorkTags>
<forcedHediffs>
<li>WULA_Child_Backstory07_Hediff</li>
</forcedHediffs>
<forcedTraitsChance>
</forcedTraitsChance>
</AlienRace.AlienBackstoryDef>
<HediffDef>
<defName>WULA_Child_Backstory07_Hediff</defName>
<label>产地:戴森</label>
<description>诞生于此的合成人拥有强大的手工系统,她们的纳米修复被设计用于在极端环境下实现自持修复,因此修复消耗要低于其他星区的合成人。</description>
<hediffClass>HediffWithComps</hediffClass>
<everCurableByItem>false</everCurableByItem>
<duplicationAllowed>false</duplicationAllowed>
<keepOnBodyPartRestoration>True</keepOnBodyPartRestoration>
<isBad>false</isBad>
<stages>
<li>
<statFactors>
<WULA_NanoRepairCostPerHP>0.75</WULA_NanoRepairCostPerHP>
<WULA_NanoRepairCooldownAfterDamage>0.5</WULA_NanoRepairCooldownAfterDamage>
</statFactors>
</li>
</stages>
</HediffDef>
<AlienRace.AlienBackstoryDef>
<defName>WULA_Child_Backstory99</defName>
<ignoreIllegalLabelCharacterConfigError>False</ignoreIllegalLabelCharacterConfigError>
<slot>Childhood</slot>
<title>产地:未知</title>
<titleShort>未知产地</titleShort>
<description>[PAWN_nameDef] 的产地无法追溯——或许是某个星区的高仿品,或许是被回收之后非法再加工的机体,总之她们身体上的机体编号要么是伪造的,要么就干脆没有机体编号。\n\n这些野生的机械乌拉什么都会一点但是没什么特别擅长的。</description>
<skillGains>
<Shooting>2</Shooting>
<Melee>2</Melee>
<Construction>2</Construction>
<Mining>2</Mining>
<Cooking>2</Cooking>
<Plants>2</Plants>
<Animals>2</Animals>
<Crafting>2</Crafting>
<Artistic>2</Artistic>
<Medicine>2</Medicine>
<Social>2</Social>
<Intellectual>2</Intellectual>
</skillGains>
<spawnCategories>
<li>Wula_Backstory_Categories</li>
</spawnCategories>
<requiredWorkTags>None</requiredWorkTags>
<forcedTraitsChance>
</forcedTraitsChance>
</AlienRace.AlienBackstoryDef>
</Defs>

View File

@@ -77,8 +77,8 @@
<activeSeverity>0.5</activeSeverity>
<inactiveSeverity>1.5</inactiveSeverity>
<minEnergyThreshold>0.1</minEnergyThreshold>
<repairCostPerHP>0.02</repairCostPerHP>
<repairCooldownAfterDamage>600</repairCooldownAfterDamage>
<repairCostPerHP>0.03</repairCostPerHP>
<!-- <repairCooldownAfterDamage>600</repairCooldownAfterDamage> -->
</li>
</comps>
</HediffDef>

View File

@@ -4,6 +4,7 @@
<defName>WULA_Synth</defName>
<label>乌拉帝国机械</label>
<displayOrder>160</displayOrder>
<displayAllByDefault>true</displayAllByDefault>
</StatCategoryDef>
<!-- 机械能量 -->
@@ -16,6 +17,10 @@
<defaultBaseValue>1</defaultBaseValue>
<!-- <maxValue>1</maxValue> -->
<toStringStyle>PercentZero</toStringStyle>
<showOnPawns>true</showOnPawns>
<showOnHumanlikes>true</showOnHumanlikes>
<showOnMechanoids>false</showOnMechanoids>
<workerClass>WulaFallenEmpire.StatWorker_Energy</workerClass>
</StatDef>
<StatDef>
<defName>WulaEnergyFallRateFactor</defName>
@@ -25,6 +30,10 @@
<defaultBaseValue>1</defaultBaseValue>
<minValue>0</minValue>
<toStringStyle>PercentZero</toStringStyle>
<showOnPawns>true</showOnPawns>
<showOnHumanlikes>true</showOnHumanlikes>
<showOnMechanoids>false</showOnMechanoids>
<workerClass>WulaFallenEmpire.StatWorker_Energy</workerClass>
</StatDef>
<!-- 纳米修复相关统计 -->
@@ -33,21 +42,25 @@
<label>纳米修复能量消耗</label>
<description>纳米修复系统修复每点生命值所消耗的能量。</description>
<category>WULA_Synth</category>
<defaultBaseValue>0.1</defaultBaseValue>
<defaultBaseValue>0.03</defaultBaseValue>
<toStringStyle>PercentZero</toStringStyle>
<showOnPawns>true</showOnPawns>
<showOnHumanlikes>true</showOnHumanlikes>
<showOnMechanoids>true</showOnMechanoids>
<showOnDrones>true</showOnDrones>
<showOnDrones>false</showOnDrones>
<workerClass>WulaFallenEmpire.StatWorker_NanoRepair</workerClass>
</StatDef>
<StatDef>
<defName>WULA_NanoRepairCooldownAfterDamage</defName>
<label>纳米修复冷却时间</label>
<description>受到伤害后纳米修复系统进入冷却的时间()。</description>
<description>受到伤害后纳米修复系统进入冷却的时间()。</description>
<category>WULA_Synth</category>
<defaultBaseValue>300</defaultBaseValue>
<defaultBaseValue>600</defaultBaseValue>
<toStringStyle>Integer</toStringStyle>
<showOnPawns>true</showOnPawns>
<showOnHumanlikes>true</showOnHumanlikes>
<showOnMechanoids>true</showOnMechanoids>
<showOnDrones>true</showOnDrones>
<showOnDrones>false</showOnDrones>
<workerClass>WulaFallenEmpire.StatWorker_NanoRepair</workerClass>
</StatDef>
@@ -58,7 +71,7 @@
<description>乌拉帝国合成人维护需求退化速率的乘数。数值越高,机械乌拉越容易陷入低维护状态。</description>
<category>WULA_Synth</category>
<defaultBaseValue>1.0</defaultBaseValue>
<toStringStyle>FloatTwo</toStringStyle>
<toStringStyle>PercentZero</toStringStyle>
<showOnMechanoids>true</showOnMechanoids>
<showOnDrones>true</showOnDrones>
<workerClass>WulaFallenEmpire.StatWorker_Maintenance</workerClass>
@@ -69,7 +82,7 @@
<description>影响乌拉帝国合成人维护状态阈值的乘数。数值越高,越容易陷入低维护带来的减益状态。</description>
<category>WULA_Synth</category>
<defaultBaseValue>1.0</defaultBaseValue>
<toStringStyle>FloatTwo</toStringStyle>
<toStringStyle>PercentZero</toStringStyle>
<showOnMechanoids>true</showOnMechanoids>
<showOnDrones>true</showOnDrones>
<workerClass>WulaFallenEmpire.StatWorker_Maintenance</workerClass>
@@ -89,11 +102,11 @@
<!-- 具体的状态阈值乘数 -->
<StatDef>
<defName>WULA_MaintenanceMinorBreakdownThresholdFactor</defName>
<label>轻微故障等级阈值</label>
<label>轻微故障等级阈值乘数</label>
<description>影响乌拉帝国合成人进入轻微故障阈值的乘数。数值越高,越容易进入轻微故障状态。</description>
<category>WULA_Synth</category>
<defaultBaseValue>1.0</defaultBaseValue>
<toStringStyle>FloatTwo</toStringStyle>
<toStringStyle>PercentZero</toStringStyle>
<showOnMechanoids>true</showOnMechanoids>
<showOnDrones>true</showOnDrones>
<workerClass>WulaFallenEmpire.StatWorker_Maintenance</workerClass>
@@ -104,7 +117,7 @@
<description>影响乌拉帝国合成人进入严重故障阈值的乘数。数值越高,越容易进入严重故障状态。</description>
<category>WULA_Synth</category>
<defaultBaseValue>1.0</defaultBaseValue>
<toStringStyle>FloatTwo</toStringStyle>
<toStringStyle>PercentZero</toStringStyle>
<showOnMechanoids>true</showOnMechanoids>
<showOnDrones>true</showOnDrones>
<workerClass>WulaFallenEmpire.StatWorker_Maintenance</workerClass>
@@ -115,7 +128,7 @@
<description>影响乌拉帝国合成人进入完全故障阈值的乘数。数值越高,越容易进入完全故障状态。</description>
<category>WULA_Synth</category>
<defaultBaseValue>1.0</defaultBaseValue>
<toStringStyle>FloatTwo</toStringStyle>
<toStringStyle>PercentZero</toStringStyle>
<showOnMechanoids>true</showOnMechanoids>
<showOnDrones>true</showOnDrones>
<workerClass>WulaFallenEmpire.StatWorker_Maintenance</workerClass>

View File

@@ -370,6 +370,7 @@
<edgeType>Hard</edgeType>
<renderPrecedence>70</renderPrecedence>
<isPaintable>true</isPaintable>
<designationCategory>WULA_Buildings</designationCategory>
<statBases>
<Beauty>3</Beauty>
<WorkToBuild>100</WorkToBuild>
@@ -986,8 +987,8 @@
<!-- 充电器 -->
<ThingDef ParentName="BuildingBase">
<defName>WULA_Machine_Recharger_Cleanzone</defName>
<label>乌拉帝国充电</label>
<description>清理出一块场地并准备好资源,使得乌拉帝国母舰可以向此处投放建筑。建造好的信标可以收起或移至他处,但是必须要有母舰或者后勤舰在上空才能投送建筑。\n\n乌拉帝国充电站是能够储存大量电量并允许所有大小类型的乌拉帝国机械体进行充电的充电站,不支持合成人的充能。由于其根基埋于地下,因此不会阻碍其他殖民者和机械体在其上面的移动。</description>
<label>乌拉帝国地下维护</label>
<description>清理出一块场地并准备好资源,使得乌拉帝国母舰可以向此处投放建筑。建造好的信标可以收起或移至他处,但是必须要有母舰或者后勤舰在上空才能投送建筑。\n\n乌拉帝国地下维护站是能够储存大量电量并允许所有大小类型的乌拉帝国机械体进行充电的充电站,不支持合成人的充能。由于其根基埋于地下,因此不会阻碍其他殖民者和机械体在其上面的移动。</description>
<uiIconPath>Wula/Building/WULA_Machine_Recharger</uiIconPath>
<minifiedDef>MinifiedThing</minifiedDef>
<tickerType>Normal</tickerType>
@@ -1042,7 +1043,7 @@
</ThingDef>
<ThingDef ParentName="SkyfallerBase">
<defName>WULA_Machine_Recharger_Incoming</defName>
<label>乌拉帝国充电站(空投中)</label>
<label>乌拉帝国地下维护站(空投中)</label>
<size>(3,3)</size>
<graphicData>
<texPath>Wula/Building/WULA_Machine_Recharger_Incoming</texPath>
@@ -1076,7 +1077,7 @@
</ThingDef>
<ThingDef ParentName="BaseMechCharger">
<defName>WULA_Machine_Recharger</defName>
<label>乌拉帝国充电</label>
<label>乌拉帝国地下维护</label>
<description>一个能够储存大量电量并允许所有大小类型的乌拉帝国机械体进行充电的充电站,不支持合成人的充能。由于其根基埋于地下,因此不会阻碍其他殖民者和机械体在其上面的移动。</description>
<graphicData>
<texPath>Wula/Building/WULA_Machine_Recharger</texPath>
@@ -1149,4 +1150,160 @@
</li>
</comps>
</ThingDef>
<!---->
<ThingDef ParentName="BuildingBase">
<defName>WULA_Charging_Station_Synth_Cleanzone</defName>
<label>合成人充电站</label>
<description>清理出一块场地并准备好资源,使得乌拉帝国母舰可以向此处投放建筑。建造好的信标可以收起或移至他处,但是必须要有母舰或者后勤舰在上空才能投送建筑。\n\n合成人充电站是一台供乌拉帝国合成人进行机体充能和改装的检修站当机械乌拉需要充电时会优先前往此处充电。</description>
<uiIconPath>Wula/Building/WULA_Charging_Station_Synth_south</uiIconPath>
<minifiedDef>MinifiedThing</minifiedDef>
<tickerType>Normal</tickerType>
<thingCategories Inherit="False">
<li>BuildingsMisc</li>
</thingCategories>
<graphicData>
<texPath>Wula/Building/WULA_Dropping_Building_12_Cleanzone</texPath>
<graphicClass>Graphic_Multi</graphicClass>
<drawSize>(1.8,2)</drawSize>
<damageData>
<enabled>false</enabled>
</damageData>
</graphicData>
<altitudeLayer>Building</altitudeLayer>
<passability>PassThroughOnly</passability>
<castEdgeShadows>false</castEdgeShadows>
<fillPercent>0.5</fillPercent>
<canOverlapZones>false</canOverlapZones>
<pathCost>0</pathCost>
<hasInteractionCell>false</hasInteractionCell>
<rotatable>false</rotatable>
<!-- <interactionCellOffset>(0,0,-2)</interactionCellOffset> -->
<statBases>
<MaxHitPoints>1</MaxHitPoints>
<WorkToBuild>1</WorkToBuild>
<Mass>1</Mass>
<Flammability>0</Flammability>
</statBases>
<size>(1,2)</size>
<constructionSkillPrerequisite>0</constructionSkillPrerequisite>
<resourcesFractionWhenDeconstructed>1</resourcesFractionWhenDeconstructed>
<costList>
<Steel>50</Steel>
<ComponentIndustrial>1</ComponentIndustrial>
</costList>
<building>
<destroySound>BuildingDestroyed_Metal_Small</destroySound>
</building>
<designationCategory>WULA_Buildings</designationCategory>
<comps>
<li Class="WulaFallenEmpire.CompProperties_SkyfallerCaller">
<skyfallerDef>WULA_Charging_Station_Synth_Incoming</skyfallerDef> <!-- 替换为您想要的Skyfaller类型 -->
<destroyBuilding>true</destroyBuilding>
<delayTicks>1</delayTicks>
<requiredFlyOverType>WULA_Flyover_BaseBuilder</requiredFlyOverType>
<allowThinRoof>true</allowThinRoof>
<allowThickRoof>false</allowThickRoof>
<requiredFlyOverLabel>乌拉帝国母舰或后勤舰</requiredFlyOverLabel> <!-- 新增显示标签 -->
</li>
</comps>
</ThingDef>
<ThingDef ParentName="SkyfallerBase">
<defName>WULA_Charging_Station_Synth_Incoming</defName>
<label>合成人充电站(空投中)</label>
<size>(1,2)</size>
<graphicData>
<texPath>Wula/Building/WULA_Charging_Station_Synth_Incoming</texPath>
<graphicClass>Graphic_Single</graphicClass>
<shaderType>CutoutFlying</shaderType>
<drawSize>(1.8,2)</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_Charging_Station_Synth</spawnThing>
</skyfaller>
<comps>
<li Class="CompProperties_Effecter">
<effecterDef>Smoke_Joint</effecterDef>
</li>
</comps>
</ThingDef>
<ThingDef ParentName="BasicBedBase">
<defName>WULA_Charging_Station_Synth</defName>
<thingClass>Building_Bed</thingClass>
<label>合成人充电站</label>
<description>一台供乌拉帝国合成人进行机体充能和改装的检修站,当机械乌拉需要充电时会优先前往此处充电。</description>
<tickerType>Normal</tickerType>
<graphicData>
<texPath>Wula/Building/WULA_Charging_Station_Synth</texPath>
<graphicClass>Graphic_Multi</graphicClass>
<drawSize>(1.8,2)</drawSize>
<damageData>
<enabled>false</enabled>
</damageData>
<shadowData>
<volume>(0.8, 1.5, 0.9)</volume>
<!-- <offset>(-0.05, 0, 0.35)</offset> -->
</shadowData>
</graphicData>
<designationCategory Inherit="False" IsNull="True" />
<staticSunShadowHeight Inherit="False" IsNull="True" />
<castEdgeShadows>False</castEdgeShadows>
<statBases>
<Comfort>0.75</Comfort>
<MaxHitPoints>140</MaxHitPoints>
<Beauty>1</Beauty>
<WorkToBuild>800</WorkToBuild>
<Mass>30</Mass>
<MedicalTendQualityOffset>10</MedicalTendQualityOffset>
</statBases>
<size>(1,2)</size>
<costList>
<Steel>1</Steel>
</costList>
<uiOrder>2010</uiOrder>
<fillPercent>0.5</fillPercent>
<researchPrerequisites Inherit="False">
<li>WULA_Base_Technology</li>
</researchPrerequisites>
<stuffCategories Inherit="False" IsNull="True" />
<building>
<paintable>false</paintable>
<bed_showSleeperBody>true</bed_showSleeperBody>
<bed_healPerDay>0</bed_healPerDay>
</building>
<comps>
<li Class="WulaFallenEmpire.CompProperties_FactionSetter">
<!-- <factionDef>Mechanoid</factionDef> 不写默认玩家派系-->
<usePlayerFactionIfNull>true</usePlayerFactionIfNull>
<overrideExistingFaction>false</overrideExistingFaction>
</li>
<li Class="CompProperties_Power">
<compClass>CompPowerTrader</compClass>
<basePowerConsumption>200</basePowerConsumption>
</li>
<li Class="CompProperties_Glower">
<glowRadius>4</glowRadius>
<glowColor>(120,240,252,0)</glowColor>
</li>
<li Class="WulaFallenEmpire.CompProperties_ChargingBed">
<hediffDef>WULA_ChargingHediff</hediffDef>
<raceDefName>WulaSpecies</raceDefName>
</li>
</comps>
</ThingDef>
</Defs>

View File

@@ -128,77 +128,6 @@
</building>
</ThingDef>
<!---->
<ThingDef ParentName="BasicBedBase">
<defName>WULA_Charging_Station_Synth</defName>
<thingClass>Building_Bed</thingClass>
<label>合成人充电站</label>
<description>一台供乌拉帝国合成人进行机体充能和改装的检修站,当机械乌拉需要充电时会优先前往此处充电。</description>
<tickerType>Normal</tickerType>
<graphicData>
<texPath>Wula/Building/WULA_Charging_Station_Synth</texPath>
<graphicClass>Graphic_Multi</graphicClass>
<drawSize>(1,2)</drawSize>
<damageData>
<enabled>false</enabled>
</damageData>
<shadowData>
<volume>(0.8, 1.5, 0.9)</volume>
<!-- <offset>(-0.05, 0, 0.35)</offset> -->
</shadowData>
</graphicData>
<staticSunShadowHeight Inherit="False" IsNull="True" />
<castEdgeShadows>False</castEdgeShadows>
<statBases>
<Comfort>0.75</Comfort>
<MaxHitPoints>140</MaxHitPoints>
<Beauty>1</Beauty>
<WorkToBuild>800</WorkToBuild>
<Mass>30</Mass>
<MedicalTendQualityOffset>10</MedicalTendQualityOffset>
</statBases>
<size>(1,2)</size>
<costList>
<Steel>50</Steel>
<ComponentIndustrial>1</ComponentIndustrial>
<WULA_Charge_Cube>1</WULA_Charge_Cube>
</costList>
<uiOrder>2010</uiOrder>
<fillPercent>0.5</fillPercent>
<designationCategory>WULA_Buildings</designationCategory>
<researchPrerequisites Inherit="False">
<li>WULA_Base_Technology</li>
</researchPrerequisites>
<stuffCategories Inherit="False" IsNull="True" />
<building>
<paintable>false</paintable>
<bed_showSleeperBody>true</bed_showSleeperBody>
<bed_healPerDay>0</bed_healPerDay>
</building>
<placeWorkers>
<li>PlaceWorker_GlowRadius</li>
</placeWorkers>
<comps>
<li Class="CompProperties_Power">
<compClass>CompPowerTrader</compClass>
<basePowerConsumption>200</basePowerConsumption>
</li>
<li Class="CompProperties_Glower">
<glowRadius>12</glowRadius>
<!--<glowColor>(105,204,204,0)</glowColor>-->
<!-- 蓝色 -->
<!-- <glowColor>(79, 96, 119, 0)</glowColor> -->
<!-- 红色 -->
<glowColor>(177, 0, 31, 0)</glowColor>
<colorPickerEnabled>true</colorPickerEnabled>
<darklightToggle>true</darklightToggle>
</li>
<li Class="WulaFallenEmpire.CompProperties_ChargingBed">
<hediffDef>WULA_ChargingHediff</hediffDef>
<raceDefName>WulaSpecies</raceDefName>
</li>
</comps>
</ThingDef>
<!-- 防御炮 -->
<ThingDef ParentName="BuildingBase">

View File

@@ -237,18 +237,26 @@
<WULA_NanoRepairCooldownAfterDamage_Desc>受到伤害后纳米修复系统进入冷却的时间。数值越低,系统响应越快。</WULA_NanoRepairCooldownAfterDamage_Desc>
<!-- 纳米修复统计解释文本 -->
<WULA_NanoRepair_Properties>纳米修复系统属性:</WULA_NanoRepair_Properties>
<WULA_NanoRepair_CostPerHP_Line>• 每点生命值修复消耗: {0}</WULA_NanoRepair_CostPerHP_Line>
<WULA_NanoRepair_MinEnergyThreshold_Line>• 最低启动能量阈值: {0}</WULA_NanoRepair_MinEnergyThreshold_Line>
<WULA_NanoRepair_CooldownAfterDamage_Line>• 伤害后冷却时间: {1} 秒</WULA_NanoRepair_CooldownAfterDamage_Line>
<WULA_NanoRepair_SystemStatus_Line>• 系统状态: {0}</WULA_NanoRepair_SystemStatus_Line>
<WULA_NanoRepair_CostPerHP_Line>\n• 每点生命值修复消耗电量: {0}</WULA_NanoRepair_CostPerHP_Line>
<WULA_NanoRepair_MinEnergyThreshold_Line>\n• 最低启动能量阈值: {0}</WULA_NanoRepair_MinEnergyThreshold_Line>
<WULA_NanoRepair_CooldownAfterDamage_Line>\n• 伤害后冷却时间: {1} 秒</WULA_NanoRepair_CooldownAfterDamage_Line>
<WULA_NanoRepair_SystemStatus_Line>\n• 系统状态: {0}</WULA_NanoRepair_SystemStatus_Line>
<WULA_NanoRepair_SystemStatus_Enabled>已启用</WULA_NanoRepair_SystemStatus_Enabled>
<WULA_NanoRepair_SystemStatus_Disabled>已禁用</WULA_NanoRepair_SystemStatus_Disabled>
<WULA_RepairCostPerHP>每点生命值修复消耗电量: {0}</WULA_RepairCostPerHP>
<!-- 维护系统统计解释 -->
<WULA_Maintenance_Properties>维护系统属性:</WULA_Maintenance_Properties>
<WULA_Maintenance_DegradationFactor_Explanation>• 阈值前退化速率: {0}/天\n• 阈值后退化速率: {1}/天\n• 阈值天数: {2}天</WULA_Maintenance_DegradationFactor_Explanation>
<WULA_Maintenance_StatusThresholdFactor_Explanation>• 轻微故障阈值: {0}\n• 严重故障阈值: {1}\n• 完全故障阈值: {2}</WULA_Maintenance_StatusThresholdFactor_Explanation>
<WULA_Maintenance_DamageToMaintenanceFactor_Explanation>• 伤害转换因子: {0}/点伤害</WULA_Maintenance_DamageToMaintenanceFactor_Explanation>
<WULA_Maintenance_MinorBreakdownThreshold_Explanation>• 轻微故障阈值: {0}</WULA_Maintenance_MinorBreakdownThreshold_Explanation>
<WULA_Maintenance_MajorBreakdownThreshold_Explanation>• 严重故障阈值: {0}</WULA_Maintenance_MajorBreakdownThreshold_Explanation>
<WULA_Maintenance_CriticalFailureThreshold_Explanation>• 完全故障阈值: {0}</WULA_Maintenance_CriticalFailureThreshold_Explanation>
<WULA_Maintenance_DegradationFactor_Explanation>\n• 阈值前退化速率: {0}/天\n• 阈值后退化速率: {1}/天\n• 阈值天数: {2}天</WULA_Maintenance_DegradationFactor_Explanation>
<WULA_Maintenance_StatusThresholdFactor_Explanation>\n• 轻微故障阈值: {0}\n• 严重故障阈值: {1}\n• 完全故障阈值: {2}</WULA_Maintenance_StatusThresholdFactor_Explanation>
<WULA_Maintenance_DamageToMaintenanceFactor_Explanation>\n• 维护伤害: {0}/点伤害</WULA_Maintenance_DamageToMaintenanceFactor_Explanation>
<WULA_Maintenance_MinorBreakdownThreshold_Explanation>\n• 轻微故障阈值: {0}</WULA_Maintenance_MinorBreakdownThreshold_Explanation>
<WULA_Maintenance_MajorBreakdownThreshold_Explanation>\n• 严重故障阈值: {0}</WULA_Maintenance_MajorBreakdownThreshold_Explanation>
<WULA_Maintenance_CriticalFailureThreshold_Explanation>\n• 完全故障阈值: {0}</WULA_Maintenance_CriticalFailureThreshold_Explanation>
<!-- StatWorker_Energy -->
<WULA_Energy_Properties>能量系统属性:</WULA_Energy_Properties>
<WULA_Energy_MaxLevelOffset_PawnExplanation>机械乌拉能量上限偏移量:影响该个体的最大能量储备。</WULA_Energy_MaxLevelOffset_PawnExplanation>
<WULA_Energy_FallRateFactor_PawnExplanation>机械乌拉能量消耗速度:影响该个体的能量消耗速率。</WULA_Energy_FallRateFactor_PawnExplanation>
<WULA_Energy_RaceProperties>种族能量属性:</WULA_Energy_RaceProperties>
<WULA_Energy_MaxLevelOffset_RaceExplanation>机械乌拉能量上限偏移量:影响该种族的最大能量储备。</WULA_Energy_MaxLevelOffset_RaceExplanation>
<WULA_Energy_FallRateFactor_RaceExplanation>机械乌拉能量消耗速度:影响该种族的能量消耗速率。</WULA_Energy_FallRateFactor_RaceExplanation>
</LanguageData>

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 212 KiB

View File

@@ -1,4 +1,4 @@
// Building_GlobalWorkTable.cs (调整为每秒处理)
// Building_GlobalWorkTable.cs 中移除材质相关代码
using RimWorld;
using System.Collections.Generic;
using System.Linq;
@@ -15,7 +15,7 @@ namespace WulaFallenEmpire
private CompPowerTrader powerComp;
private CompBreakdownable breakdownableComp;
private int lastProcessTick = -1;
private const int ProcessInterval = 1; // 改为每tick处理以实现每秒1工作量
private const int ProcessInterval = 1;
public Building_GlobalWorkTable()
{
@@ -35,12 +35,10 @@ namespace WulaFallenEmpire
breakdownableComp = GetComp<CompBreakdownable>();
}
// 在 Building_GlobalWorkTable 类中修改 Tick 方法
protected override void Tick()
{
base.Tick();
// 修复改为每60 ticks1秒处理一次避免每tick处理导致的精度问题
if (Find.TickManager.TicksGame % 60 == 0 &&
Find.TickManager.TicksGame != lastProcessTick)
{
@@ -226,7 +224,7 @@ namespace WulaFallenEmpire
return validSpots;
}
// 新增:分配物品到空投舱
// 简化:分配物品到空投舱,移除材质相关代码
private List<List<Thing>> DistributeItemsToPods(GlobalStorageWorldComponent storage, int podCount)
{
List<List<Thing>> podContents = new List<List<Thing>>();
@@ -266,7 +264,7 @@ namespace WulaFallenEmpire
while (remainingCount > 0)
{
int stackSize = Mathf.Min(remainingCount, thingDef.stackLimit);
Thing thing = ThingMaker.MakeThing(thingDef);
Thing thing = ThingMaker.MakeThing(thingDef); // 不再传递材质参数
thing.stackCount = stackSize;
allItems.Add(thing);
remainingCount -= stackSize;
@@ -330,25 +328,6 @@ namespace WulaFallenEmpire
kind.defaultFactionDef != buildingFaction.def)
.ToList();
// 记录调试信息
if (DebugSettings.godMode)
{
Log.Message($"[DEBUG] PawnKind selection for {pawnType.defName}:");
Log.Message($" Building faction: {buildingFaction.def.defName}");
Log.Message($" Matching faction kinds: {matchingFactionKinds.Count}");
Log.Message($" No faction kinds: {noFactionKinds.Count}");
Log.Message($" Excluded kinds: {excludedKinds.Count}");
foreach (var kind in matchingFactionKinds)
Log.Message($" Matching: {kind.defName} (faction: {kind.defaultFactionDef?.defName ?? "null"})");
foreach (var kind in noFactionKinds)
Log.Message($" No faction: {kind.defName}");
foreach (var kind in excludedKinds)
Log.Message($" Excluded: {kind.defName} (faction: {kind.defaultFactionDef?.defName})");
}
// 优先级选择
PawnKindDef selectedKind = null;
@@ -356,15 +335,11 @@ namespace WulaFallenEmpire
if (matchingFactionKinds.Count > 0)
{
selectedKind = matchingFactionKinds.RandomElement();
if (DebugSettings.godMode)
Log.Message($"[DEBUG] Selected matching faction kind: {selectedKind.defName}");
}
// 2. 备选没有defaultFactionDef的PawnKind
else if (noFactionKinds.Count > 0)
{
selectedKind = noFactionKinds.RandomElement();
if (DebugSettings.godMode)
Log.Message($"[DEBUG] Selected no-faction kind: {selectedKind.defName}");
}
// 3. 没有符合条件的PawnKind
else
@@ -376,7 +351,6 @@ namespace WulaFallenEmpire
return selectedKind;
}
// 新增:创建空投舱
private bool CreateDropPod(IntVec3 dropCell, List<Thing> contents)
{

View File

@@ -1,4 +1,4 @@
// GlobalProductionOrder.cs (修正材质属性读取)
// GlobalProductionOrder.cs (移除所有材质相关代码)
using RimWorld;
using System.Collections.Generic;
using System.Linq;
@@ -15,9 +15,6 @@ namespace WulaFallenEmpire
public int currentCount = 0;
public bool paused = true;
// 材质选择:存储配方选择的材质(只有支持材质的配方才有)
public ThingDef chosenStuff = null;
// 生产状态
public ProductionState state = ProductionState.Waiting;
@@ -45,28 +42,6 @@ namespace WulaFallenEmpire
}
}
// 新增:检查订单是否已经开始生产(一旦开始就不能修改材质)
public bool HasStartedProduction => state == ProductionState.Producing || currentCount > 0;
// 修正:检查产物是否支持材质选择
public bool SupportsStuffChoice
{
get
{
if (recipe?.products == null || recipe.products.Count == 0)
return false;
var productDef = recipe.products[0].thingDef;
if (productDef == null)
return false;
// 检查产物是否有stuffCategories且costStuffCount > 0
return productDef.stuffCategories != null &&
productDef.stuffCategories.Count > 0 &&
productDef.costStuffCount > 0;
}
}
// 修正获取产物的ThingDef
public ThingDef ProductDef => recipe?.products?.Count > 0 ? recipe.products[0].thingDef : null;
@@ -78,62 +53,22 @@ namespace WulaFallenEmpire
Scribe_Values.Look(ref paused, "paused", true);
Scribe_Values.Look(ref _progress, "progress", 0f);
Scribe_Values.Look(ref state, "state", ProductionState.Waiting);
Scribe_Defs.Look(ref chosenStuff, "chosenStuff");
// 修复:加载后验证数据
if (Scribe.mode == LoadSaveMode.PostLoadInit)
{
progress = _progress;
UpdateState();
// 确保材质选择有效
if (SupportsStuffChoice && chosenStuff == null)
{
InitializeStuffChoice();
}
}
}
// 修正:初始化材质选择
public void InitializeStuffChoice()
{
if (!SupportsStuffChoice) return;
var availableStuff = GetAvailableStuffForProduct();
if (availableStuff.Count > 0)
{
chosenStuff = availableStuff[0];
}
}
// 修正:获取产物的可用材质列表
public List<ThingDef> GetAvailableStuffForProduct()
{
var availableStuff = new List<ThingDef>();
if (ProductDef?.stuffCategories != null)
{
foreach (var stuffCategory in ProductDef.stuffCategories)
{
var stuffInCategory = DefDatabase<ThingDef>.AllDefs
.Where(def => def.IsStuff && def.stuffProps?.categories != null && def.stuffProps.categories.Contains(stuffCategory))
.ToList();
availableStuff.AddRange(stuffInCategory);
}
}
return availableStuff.Distinct().ToList();
}
// 修正HasEnoughResources 方法,考虑选择的材质
// 简化HasEnoughResources 方法,移除材质检查
public bool HasEnoughResources()
{
var globalStorage = Find.World.GetComponent<GlobalStorageWorldComponent>();
if (globalStorage == null) return false;
// 检查固定消耗costList
// 检查固定消耗costList
foreach (var ingredient in recipe.ingredients)
{
bool hasEnoughForThisIngredient = false;
@@ -154,26 +89,16 @@ namespace WulaFallenEmpire
return false;
}
// 检查材质消耗(如果支持材质选择)
if (SupportsStuffChoice && chosenStuff != null)
{
int requiredStuffCount = ProductDef.costStuffCount;
int availableStuffCount = globalStorage.GetInputStorageCount(chosenStuff);
if (availableStuffCount < requiredStuffCount)
return false;
}
return true;
}
// 修正ConsumeResources 方法,考虑选择的材质
// 简化ConsumeResources 方法,移除材质消耗
public bool ConsumeResources()
{
var globalStorage = Find.World.GetComponent<GlobalStorageWorldComponent>();
if (globalStorage == null) return false;
// 消耗固定资源costList
// 消耗固定资源costList
foreach (var ingredient in recipe.ingredients)
{
bool consumedThisIngredient = false;
@@ -197,19 +122,10 @@ namespace WulaFallenEmpire
return false;
}
// 消耗材质(如果支持材质选择)
if (SupportsStuffChoice && chosenStuff != null)
{
int requiredStuffCount = ProductDef.costStuffCount;
if (!globalStorage.RemoveFromInputStorage(chosenStuff, requiredStuffCount))
return false;
}
return true;
}
// 修正GetIngredientsTooltip 方法,显示固定消耗和可选材质
// 简化GetIngredientsTooltip 方法,显示固定消耗
public string GetIngredientsTooltip()
{
StringBuilder sb = new StringBuilder();
@@ -240,34 +156,6 @@ namespace WulaFallenEmpire
}
}
// 材质消耗(如果支持材质选择)
if (SupportsStuffChoice)
{
sb.AppendLine();
sb.AppendLine("WULA_StuffMaterial".Translate() + ":");
if (chosenStuff != null)
{
int requiredStuffCount = ProductDef.costStuffCount;
int availableStuffCount = globalStorage?.GetInputStorageCount(chosenStuff) ?? 0;
string stuffDisplay = $"{requiredStuffCount} {chosenStuff.LabelCap}";
if (availableStuffCount >= requiredStuffCount)
{
sb.AppendLine($" <color=green>{stuffDisplay} (Selected)</color>");
}
else
{
sb.AppendLine($" <color=red>{stuffDisplay} (Selected)</color>");
}
}
else
{
sb.AppendLine($" <color=yellow>{"WULA_NoStuffSelected".Translate()}</color>");
}
}
// 产品
sb.AppendLine();
sb.AppendLine("WULA_Products".Translate() + ":");
@@ -279,13 +167,6 @@ namespace WulaFallenEmpire
// 工作量信息
sb.AppendLine();
sb.AppendLine("WULA_WorkAmount".Translate() + ": " + GetWorkAmount().ToStringWorkAmount());
// 添加材质选择状态信息
if (HasStartedProduction && SupportsStuffChoice)
{
sb.AppendLine();
sb.AppendLine("<color=yellow>Material choice is locked because production has started.</color>");
}
return sb.ToString();
}

View File

@@ -1,11 +1,11 @@
// GlobalStorageWorldComponent.cs (移除材质相关存储)
using LudeonTK;
using RimWorld;
using RimWorld.Planet;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using Verse;
using UnityEngine;
namespace WulaFallenEmpire
{
@@ -111,6 +111,7 @@ namespace WulaFallenEmpire
Log.Message("Added test resources to global storage");
}
}
[DebugAction("WULA", "Spawn All Products", actionType = DebugActionType.Action)]
public static void DebugSpawnAllProducts()
{

View File

@@ -1,4 +1,4 @@
// ITab_GlobalBills.cs (添加图标支持)
// ITab_GlobalBills.cs (移除材质选择功能)
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -57,13 +57,6 @@ namespace WulaFallenEmpire
{
Find.WindowStack.Add(new FloatMenu(GenerateRecipeOptions()));
}
// 绘制鼠标悬停信息 - 使用简单的Tooltip方式
if (mouseoverOrder != null)
{
// 使用Tooltip显示材料信息不绘制额外窗口
// 信息已经在DoOrderRow中的TooltipHandler显示
}
}
// 新增:存储查看按钮
@@ -72,8 +65,6 @@ namespace WulaFallenEmpire
// 绘制按钮
if (Widgets.ButtonText(rect, "WULA_ViewStorage".Translate()))
{
// 点击按钮时也可以做一些事情,比如打开详细存储窗口
// 暂时只显示Tooltip
SoundDefOf.Click.PlayOneShotOnCamera();
}
@@ -111,7 +102,6 @@ namespace WulaFallenEmpire
{
foreach (var kvp in inputItems)
{
// 使用正确的图标格式并保留名称
sb.AppendLine($" {kvp.Value} {kvp.Key.LabelCap}");
}
}
@@ -136,21 +126,13 @@ namespace WulaFallenEmpire
{
foreach (var kvp in outputItems)
{
// 使用正确的图标格式并保留名称
sb.AppendLine($" {kvp.Value} {kvp.Key.LabelCap}");
}
}
// 添加存储统计信息
sb.AppendLine();
sb.AppendLine("WULA_StorageStats".Translate());
sb.AppendLine($" {inputItems.Count} {("WULA_InputItems".Translate())}");
sb.AppendLine($" {outputItems.Count} {("WULA_OutputItems".Translate())}");
return sb.ToString();
}
// 修改:将开发者模式按钮改为上帝模式按钮
private void DoGodModeButtons(Rect rect)
{
@@ -182,7 +164,6 @@ namespace WulaFallenEmpire
globalStorage.AddToInputStorage(componentDef, 100);
Messages.Message("Added 200 Steel and 100 Components to global storage", MessageTypeDefOf.PositiveEvent);
Log.Message("[GOD MODE] Added test resources");
}
}
@@ -227,7 +208,6 @@ namespace WulaFallenEmpire
}
Messages.Message($"Spawned {totalSpawned} items at worktable location", MessageTypeDefOf.PositiveEvent);
Log.Message($"[GOD MODE] Spawned {totalSpawned} output products");
}
}
@@ -271,7 +251,9 @@ namespace WulaFallenEmpire
Widgets.EndScrollView();
return result;
}// 在 ITab_GlobalBills.cs 中修正材质选择功能
}
// 简化DoOrderRow 方法,移除材质选择按钮
private bool DoOrderRow(Rect rect, GlobalProductionOrder order)
{
Widgets.DrawHighlightIfMouseover(rect);
@@ -351,17 +333,6 @@ namespace WulaFallenEmpire
Rect pauseButtonRect = new Rect(currentX - buttonWidth, buttonY, buttonWidth, 25f);
currentX -= (buttonWidth + buttonSpacing);
// 材质选择按钮(如果支持材质选择且未开始生产)
Rect stuffButtonRect = new Rect(0f, 0f, 0f, 0f);
bool showStuffButton = false;
if (order.SupportsStuffChoice && !order.HasStartedProduction)
{
showStuffButton = true;
stuffButtonRect = new Rect(currentX - buttonWidth, buttonY, buttonWidth, 25f);
currentX -= (buttonWidth + buttonSpacing);
}
// 上帝模式:立刻完成按钮
Rect completeButtonRect = new Rect(currentX - buttonWidth, buttonY, buttonWidth, 25f);
@@ -381,29 +352,6 @@ namespace WulaFallenEmpire
SoundDefOf.Click.PlayOneShotOnCamera();
}
// 绘制材质选择按钮
if (showStuffButton)
{
string stuffButtonText = order.chosenStuff != null ?
order.chosenStuff.LabelCap :
"WULA_ChooseStuff".Translate();
if (Widgets.ButtonText(stuffButtonRect, stuffButtonText))
{
ShowStuffSelectionMenu(order);
SoundDefOf.Click.PlayOneShotOnCamera();
}
// 为材质选择按钮添加Tooltip
if (Mouse.IsOver(stuffButtonRect))
{
string tooltip = order.chosenStuff != null ?
$"WULA_CurrentStuff".Translate(order.chosenStuff.LabelCap) :
"WULA_ChooseStuffTooltip".Translate();
TooltipHandler.TipRegion(stuffButtonRect, tooltip);
}
}
// 绘制上帝模式按钮(仅上帝模式下可见)
if (DebugSettings.godMode && order.state != GlobalProductionOrder.ProductionState.Completed)
{
@@ -438,104 +386,8 @@ namespace WulaFallenEmpire
return Mouse.IsOver(rect);
}
// 修正:显示材质选择菜单
private void ShowStuffSelectionMenu(GlobalProductionOrder order)
{
if (order.HasStartedProduction)
{
Messages.Message("WULA_CannotChangeStuffAfterStart".Translate(), MessageTypeDefOf.RejectInput);
return;
}
if (!order.SupportsStuffChoice)
{
Messages.Message("WULA_RecipeDoesNotSupportStuff".Translate(), MessageTypeDefOf.RejectInput);
return;
}
var availableStuff = order.GetAvailableStuffForProduct();
if (availableStuff.Count == 0)
{
Messages.Message("WULA_NoStuffAvailable".Translate(), MessageTypeDefOf.RejectInput);
return;
}
List<FloatMenuOption> options = new List<FloatMenuOption>();
var globalStorage = Find.World.GetComponent<GlobalStorageWorldComponent>();
foreach (var stuffDef in availableStuff)
{
var stuffDefCopy = stuffDef;
// 计算所需数量
int requiredStuffCount = order.ProductDef.costStuffCount;
int availableCount = globalStorage?.GetInputStorageCount(stuffDefCopy) ?? 0;
// 构建显示文本
string label = $"{stuffDefCopy.LabelCap} ({requiredStuffCount} needed)";
if (availableCount < requiredStuffCount)
{
label += $" <color=red>(Only {availableCount} available)</color>";
}
else
{
label += $" <color=green>({availableCount} available)</color>";
}
// 添加材质属性信息
if (stuffDefCopy.stuffProps != null)
{
label += $"\n - {"WULA_Commonality".Translate()}: {stuffDefCopy.stuffProps.commonality}";
if (stuffDefCopy.stuffProps.stuffAdjective != null)
{
label += $"\n - {"WULA_Adjective".Translate()}: {stuffDefCopy.stuffProps.stuffAdjective}";
}
}
options.Add(new FloatMenuOption(
label: label,
action: () =>
{
order.chosenStuff = stuffDefCopy;
Messages.Message($"WULA_StuffSelected".Translate(stuffDefCopy.LabelCap), MessageTypeDefOf.TaskCompletion);
},
shownItemForIcon: stuffDefCopy
));
}
// 添加"自动选择"选项
options.Add(new FloatMenuOption(
label: "WULA_AutoSelectStuff".Translate(),
action: () =>
{
// 选择库存最充足的材质
var bestStuff = availableStuff
.OrderByDescending(stuff => globalStorage?.GetInputStorageCount(stuff) ?? 0)
.ThenBy(stuff => stuff.stuffProps?.commonality ?? 1f)
.FirstOrDefault();
if (bestStuff != null)
{
order.chosenStuff = bestStuff;
Messages.Message($"WULA_StuffAutoSelected".Translate(bestStuff.LabelCap), MessageTypeDefOf.TaskCompletion);
}
}
));
// 添加"清除选择"选项(如果当前有选择)
if (order.chosenStuff != null)
{
options.Add(new FloatMenuOption(
label: "WULA_ClearStuffSelection".Translate(),
action: () =>
{
order.chosenStuff = null;
Messages.Message("WULA_StuffSelectionCleared".Translate(), MessageTypeDefOf.TaskCompletion);
}
));
}
Find.WindowStack.Add(new FloatMenu(options));
}
// 修正:在添加订单时初始化材质选择
// 简化:在添加订单时移除材质初始化
private List<FloatMenuOption> GenerateRecipeOptions()
{
var options = new List<FloatMenuOption>();
@@ -555,15 +407,8 @@ namespace WulaFallenEmpire
paused = true
};
// 初始化材质选择(如果支持)
if (newOrder.SupportsStuffChoice)
{
newOrder.InitializeStuffChoice();
}
SelTable.globalOrderStack.AddOrder(newOrder);
SoundDefOf.Click.PlayOneShotOnCamera();
Log.Message($"[DEBUG] Added order for {recipe.defName}");
},
shownItemForIcon: recipe.UIIconThing,
thingStyle: null,
@@ -659,7 +504,6 @@ namespace WulaFallenEmpire
// 显示完成消息
Messages.Message($"GOD MODE: Completed order for {order.recipe.LabelCap} ({remainingCount} units)", MessageTypeDefOf.PositiveEvent);
Log.Message($"[GOD MODE] Force completed order: {order.recipe.defName}, produced {remainingCount} units");
}
public override void TabUpdate()

View File

@@ -11,8 +11,8 @@ namespace WulaFallenEmpire
public float activeSeverity = 0.5f; // 有能量且损伤时的严重性
public float inactiveSeverity = 1.5f; // 其他情况的严重性
public float minEnergyThreshold = 0.1f; // 最低能量阈值
public float repairCostPerHP = 0.1f; // 每点生命值修复的能量消耗
public int repairCooldownAfterDamage = 300; // 受到伤害后的修复冷却时间
public float repairCostPerHP = 0.03f; // 每点生命值修复的能量消耗
public int repairCooldownAfterDamage = 600; // 受到伤害后的修复冷却时间
// 新增:与 StatDef 的关联
public StatDef repairCostStatDef;
public StatDef cooldownStatDef;

View File

@@ -9,7 +9,7 @@ namespace WulaFallenEmpire
{
private NeedDefExtension_Energy ext;
private NeedDefExtension_Energy Ext
public NeedDefExtension_Energy Ext
{
get
{

View File

@@ -8,7 +8,7 @@ namespace WulaFallenEmpire
{
public class Need_Maintenance : Need
{
private MaintenanceNeedExtension Extension => def.GetModExtension<MaintenanceNeedExtension>();
public MaintenanceNeedExtension Extension => def.GetModExtension<MaintenanceNeedExtension>();
// 上次维护的天数
private float daysSinceLastMaintenance = 0f;

View File

@@ -0,0 +1,180 @@
// StatWorker_Energy.cs - 处理能量相关的统计量
using RimWorld;
using Verse;
using System.Collections.Generic;
namespace WulaFallenEmpire
{
public class StatWorker_Energy : StatWorker
{
public override bool ShouldShowFor(StatRequest req)
{
if (!base.ShouldShowFor(req))
return false;
// 处理 ThingDef 的情况(种族定义)
if (req.Def is ThingDef thingDef)
{
// 检查是否为 WulaSpecies 种族
return thingDef.defName == "WulaSpecies";
}
// 检查是否为 Pawn
if (req.Thing is Pawn pawn)
{
// 检查是否有能量需求
return HasEnergyNeed(pawn);
}
return false;
}
public override float GetValueUnfinalized(StatRequest req, bool applyPostProcess = true)
{
// 关键修复:调用基类方法让 RimWorld 的统计系统处理所有修正
float baseValue = base.GetValueUnfinalized(req, applyPostProcess);
if (req.Thing is Pawn pawn)
{
return GetStatValueForPawn(stat.defName, pawn, baseValue);
}
else if (req.Def is ThingDef thingDef && thingDef.defName == "WulaSpecies")
{
// 对于 WulaSpecies 种族,返回经过修正的值
return GetDefaultValueForStat(stat.defName, baseValue);
}
return baseValue;
}
public override string GetExplanationUnfinalized(StatRequest req, ToStringNumberSense numberSense)
{
var explanation = base.GetExplanationUnfinalized(req, numberSense);
// 添加自定义解释
if (req.Thing is Pawn pawn)
{
explanation += "\n\n" + GetEnergyExplanationForPawn(stat.defName, pawn);
}
else if (req.Def is ThingDef thingDef && thingDef.defName == "WulaSpecies")
{
explanation += "\n\n" + GetEnergyExplanationForRace(stat.defName);
}
return explanation;
}
private bool HasEnergyNeed(Pawn pawn)
{
// 使用反射或其他方式检查是否有能量需求,或者直接返回 true 对于 WulaSpecies
if (pawn?.def?.defName == "WulaSpecies")
return true;
// 如果有具体的能量需求类,可以在这里检查
// return pawn?.needs?.TryGetNeed<Need_Energy>() != null;
return false;
}
private float GetStatValueForPawn(string statDefName, Pawn pawn, float baseValue)
{
// 对于 WulaSpecies 种族,返回基于其特性的值
if (pawn.def.defName == "WulaSpecies")
{
switch (statDefName)
{
case "WulaEnergyMaxLevelOffset":
return CalculateEnergyMaxLevelOffset(pawn, baseValue);
case "WulaEnergyFallRateFactor":
return CalculateEnergyFallRateFactor(pawn, baseValue);
default:
return baseValue;
}
}
return baseValue;
}
private float GetDefaultValueForStat(string statDefName, float baseValue)
{
// 关键修复:使用基础值而不是固定值
switch (statDefName)
{
case "WulaEnergyMaxLevelOffset":
return baseValue; // 使用统计系统修正后的值
case "WulaEnergyFallRateFactor":
return baseValue; // 使用统计系统修正后的值
default:
return baseValue;
}
}
private float CalculateEnergyMaxLevelOffset(Pawn pawn, float baseValue)
{
// 计算能量上限偏移量,使用基础值作为起点
// 这里可以根据 pawn 的特性计算
return baseValue;
}
private float CalculateEnergyFallRateFactor(Pawn pawn, float baseValue)
{
// 计算能量下降速率因子,使用基础值作为起点
// 这里可以根据 pawn 的特性计算
return baseValue;
}
private string GetEnergyExplanationForPawn(string statDefName, Pawn pawn)
{
var explanation = "WULA_Energy_Properties".Translate();
switch (statDefName)
{
case "WulaEnergyMaxLevelOffset":
explanation += "\n" + "WULA_Energy_MaxLevelOffset_PawnExplanation".Translate();
break;
case "WulaEnergyFallRateFactor":
explanation += "\n" + "WULA_Energy_FallRateFactor_PawnExplanation".Translate();
break;
}
return explanation;
}
private string GetEnergyExplanationForRace(string statDefName)
{
var explanation = "WULA_Energy_RaceProperties".Translate();
switch (statDefName)
{
case "WulaEnergyMaxLevelOffset":
explanation += "\n" + "WULA_Energy_MaxLevelOffset_RaceExplanation".Translate();
break;
case "WulaEnergyFallRateFactor":
explanation += "\n" + "WULA_Energy_FallRateFactor_RaceExplanation".Translate();
break;
}
return explanation;
}
public override IEnumerable<Dialog_InfoCard.Hyperlink> GetInfoCardHyperlinks(StatRequest req)
{
foreach (var hyperlink in base.GetInfoCardHyperlinks(req))
{
yield return hyperlink;
}
// 添加能量系统的超链接
var energyNeedDef = DefDatabase<NeedDef>.GetNamedSilentFail("WULA_Energy");
if (energyNeedDef != null)
{
yield return new Dialog_InfoCard.Hyperlink(energyNeedDef);
}
}
}
}

View File

@@ -23,6 +23,9 @@ namespace WulaFallenEmpire
public override float GetValueUnfinalized(StatRequest req, bool applyPostProcess = true)
{
// 关键修复:调用基类方法让 RimWorld 的统计系统处理所有修正
float baseValue = base.GetValueUnfinalized(req, applyPostProcess);
if (req.Thing is Pawn pawn)
{
var maintenanceNeed = GetMaintenanceNeed(pawn);
@@ -30,11 +33,11 @@ namespace WulaFallenEmpire
if (maintenanceNeed != null && extension != null)
{
return GetStatValueForMaintenance(stat.defName, maintenanceNeed, extension);
return GetStatValueForMaintenance(stat.defName, maintenanceNeed, extension, baseValue);
}
}
return stat.defaultBaseValue;
return baseValue;
}
public override string GetExplanationUnfinalized(StatRequest req, ToStringNumberSense numberSense)
@@ -71,30 +74,31 @@ namespace WulaFallenEmpire
return maintenanceNeed?.Extension;
}
private float GetStatValueForMaintenance(string statDefName, Need_Maintenance need, MaintenanceNeedExtension extension)
private float GetStatValueForMaintenance(string statDefName, Need_Maintenance need, MaintenanceNeedExtension extension, float baseValue)
{
// 关键修复:使用基础值而不是固定值
switch (statDefName)
{
case "WULA_MaintenanceDegradationFactor":
return CalculateDegradationFactor(need, extension);
return CalculateDegradationFactor(need, extension, baseValue);
case "WULA_MaintenanceStatusThresholdFactor":
return CalculateStatusThresholdFactor(need, extension);
return CalculateStatusThresholdFactor(need, extension, baseValue);
case "WULA_MaintenanceDamageToMaintenanceFactor":
return CalculateDamageToMaintenanceFactor(need, extension);
return CalculateDamageToMaintenanceFactor(need, extension, baseValue);
case "WULA_MaintenanceMinorBreakdownThresholdFactor":
return CalculateMinorBreakdownThresholdFactor(need, extension);
return CalculateMinorBreakdownThresholdFactor(need, extension, baseValue);
case "WULA_MaintenanceMajorBreakdownThresholdFactor":
return CalculateMajorBreakdownThresholdFactor(need, extension);
return CalculateMajorBreakdownThresholdFactor(need, extension, baseValue);
case "WULA_MaintenanceCriticalFailureThresholdFactor":
return CalculateCriticalFailureThresholdFactor(need, extension);
return CalculateCriticalFailureThresholdFactor(need, extension, baseValue);
default:
return stat.defaultBaseValue;
return baseValue;
}
}
@@ -132,44 +136,44 @@ namespace WulaFallenEmpire
return explanation;
}
// 计算各种统计值的方法
private float CalculateDegradationFactor(Need_Maintenance need, MaintenanceNeedExtension extension)
// 计算各种统计值的方法 - 现在接受基础值参数
private float CalculateDegradationFactor(Need_Maintenance need, MaintenanceNeedExtension extension, float baseValue)
{
// 基础退化速率乘数
return 1.0f; // 默认值,可以根据需要调整
// 基础退化速率乘数,使用统计系统修正后的值
return baseValue;
}
private float CalculateStatusThresholdFactor(Need_Maintenance need, MaintenanceNeedExtension extension)
private float CalculateStatusThresholdFactor(Need_Maintenance need, MaintenanceNeedExtension extension, float baseValue)
{
// 状态阈值乘数
return 1.0f; // 默认值,可以根据需要调整
// 状态阈值乘数,使用统计系统修正后的值
return baseValue;
}
private float CalculateDamageToMaintenanceFactor(Need_Maintenance need, MaintenanceNeedExtension extension)
private float CalculateDamageToMaintenanceFactor(Need_Maintenance need, MaintenanceNeedExtension extension, float baseValue)
{
// 伤害到维护度的转换因子
return extension?.damageToMaintenanceFactor ?? 0.01f;
// 伤害到维护度的转换因子,使用统计系统修正后的值
return baseValue;
}
private float CalculateMinorBreakdownThresholdFactor(Need_Maintenance need, MaintenanceNeedExtension extension)
private float CalculateMinorBreakdownThresholdFactor(Need_Maintenance need, MaintenanceNeedExtension extension, float baseValue)
{
// 轻微故障阈值乘数
return 1.0f; // 默认值
// 轻微故障阈值乘数,使用统计系统修正后的值
return baseValue;
}
private float CalculateMajorBreakdownThresholdFactor(Need_Maintenance need, MaintenanceNeedExtension extension)
private float CalculateMajorBreakdownThresholdFactor(Need_Maintenance need, MaintenanceNeedExtension extension, float baseValue)
{
// 严重故障阈值乘数
return 1.0f; // 默认值
// 严重故障阈值乘数,使用统计系统修正后的值
return baseValue;
}
private float CalculateCriticalFailureThresholdFactor(Need_Maintenance need, MaintenanceNeedExtension extension)
private float CalculateCriticalFailureThresholdFactor(Need_Maintenance need, MaintenanceNeedExtension extension, float baseValue)
{
// 完全故障阈值乘数
return 1.0f; // 默认值
// 完全故障阈值乘数,使用统计系统修正后的值
return baseValue;
}
// 解释文本生成方法
// 解释文本生成方法(保持不变)
private string GetDegradationFactorExplanation(Need_Maintenance need, MaintenanceNeedExtension extension)
{
return "WULA_Maintenance_DegradationFactor_Explanation".Translate(

View File

@@ -13,6 +13,18 @@ namespace WulaFallenEmpire
if (!base.ShouldShowFor(req))
return false;
// 处理 ThingDef 的情况(种族定义)
if (req.Def is ThingDef thingDef)
{
// 检查是否为 WulaSpecies 种族
if (thingDef.defName == "WulaSpecies")
{
// 对于 WulaSpecies 种族,只在有纳米修复 hediff 时显示
return HasNanoRepairForRace(thingDef);
}
return false;
}
// 检查是否为 Pawn
if (req.Thing is Pawn pawn)
{
@@ -24,24 +36,24 @@ namespace WulaFallenEmpire
public override float GetValueUnfinalized(StatRequest req, bool applyPostProcess = true)
{
// 关键修复:调用基类方法让 RimWorld 的统计系统处理所有修正
float baseValue = base.GetValueUnfinalized(req, applyPostProcess);
if (req.Thing is Pawn pawn)
{
var nanoComp = GetNanoRepairComp(pawn);
if (nanoComp != null)
{
// 根据请求的 StatDef 返回相应的值
if (stat.defName == "WULA_NanoRepairCostPerHP")
{
return nanoComp.Props.repairCostPerHP;
}
else if (stat.defName == "WULA_NanoRepairCooldownAfterDamage")
{
return nanoComp.Props.repairCooldownAfterDamage;
}
return GetStatValueForNanoRepair(stat.defName, nanoComp, baseValue);
}
}
else if (req.Def is ThingDef thingDef && thingDef.defName == "WulaSpecies")
{
// 对于 WulaSpecies 种族,返回经过修正的值
return GetDefaultValueForStat(stat.defName, baseValue);
}
return stat.defaultBaseValue;
return baseValue;
}
public override string GetExplanationUnfinalized(StatRequest req, ToStringNumberSense numberSense)
@@ -56,10 +68,21 @@ namespace WulaFallenEmpire
explanation += "\n\n" + GetNanoRepairExplanation(nanoComp);
}
}
else if (req.Def is ThingDef thingDef && thingDef.defName == "WulaSpecies")
{
explanation += "\n\n" + GetNanoRepairExplanationForRace();
}
return explanation;
}
private bool HasNanoRepairForRace(ThingDef raceDef)
{
// 检查该种族是否有纳米修复 hediff
// 这里可以添加更复杂的逻辑来检查种族是否有纳米修复能力
return raceDef.defName == "WulaSpecies";
}
private bool HasNanoRepairHediff(Pawn pawn)
{
if (pawn?.health?.hediffSet?.hediffs == null)
@@ -90,6 +113,40 @@ namespace WulaFallenEmpire
return null;
}
private float GetStatValueForNanoRepair(string statDefName, HediffComp_NanoRepair nanoComp, float baseValue)
{
// 关键修复:使用基础值而不是固定值
var props = nanoComp.Props;
switch (statDefName)
{
case "WULA_NanoRepairCostPerHP":
return baseValue; // 使用统计系统修正后的值
case "WULA_NanoRepairCooldownAfterDamage":
return baseValue; // 使用统计系统修正后的值
default:
return baseValue;
}
}
private float GetDefaultValueForStat(string statDefName, float baseValue)
{
// 关键修复:使用基础值而不是固定值
switch (statDefName)
{
case "WULA_NanoRepairCostPerHP":
return baseValue; // 使用统计系统修正后的值
case "WULA_NanoRepairCooldownAfterDamage":
return baseValue; // 使用统计系统修正后的值
default:
return baseValue;
}
}
private string GetNanoRepairExplanation(HediffComp_NanoRepair nanoComp)
{
var props = nanoComp.Props;
@@ -113,6 +170,24 @@ namespace WulaFallenEmpire
return explanation;
}
private string GetNanoRepairExplanationForRace()
{
var explanation = "WULA_NanoRepair_RaceProperties".Translate();
if (stat.defName == "WULA_NanoRepairCostPerHP")
{
explanation += "WULA_NanoRepair_CostPerHP_RaceLine".Translate(stat.defaultBaseValue.ToStringPercent());
}
else if (stat.defName == "WULA_NanoRepairCooldownAfterDamage")
{
explanation += "WULA_NanoRepair_CooldownAfterDamage_RaceLine".Translate(
stat.defaultBaseValue,
(stat.defaultBaseValue / 60f).ToString("F1"));
}
return explanation;
}
public override IEnumerable<Dialog_InfoCard.Hyperlink> GetInfoCardHyperlinks(StatRequest req)
{
foreach (var hyperlink in base.GetInfoCardHyperlinks(req))

View File

@@ -15,11 +15,11 @@ namespace WulaFallenEmpire
DefOfHelper.EnsureInitializedInCtor(typeof(ThingDefOf_WULA));
}
}
[DefOf]
public static class JobDefOf_WULA
{
public static JobDef WULA_EnterMaintenancePod;
public static JobDef WULA_HaulToMaintenancePod;
static JobDefOf_WULA()
@@ -27,6 +27,7 @@ namespace WulaFallenEmpire
DefOfHelper.EnsureInitializedInCtor(typeof(JobDefOf_WULA));
}
}
[DefOf]
public static class WulaStatDefOf
{
@@ -38,4 +39,27 @@ namespace WulaFallenEmpire
DefOfHelper.EnsureInitializedInCtor(typeof(WulaStatDefOf));
}
}
}
[DefOf]
public static class WulaNeedDefOf
{
public static NeedDef WULA_Energy;
static WulaNeedDefOf()
{
DefOfHelper.EnsureInitializedInCtor(typeof(WulaNeedDefOf));
}
}
[DefOf]
public static class WulaStatCategoryDefOf
{
public static StatCategoryDef WULA_Synth;
static WulaStatCategoryDefOf()
{
DefOfHelper.EnsureInitializedInCtor(typeof(WulaStatCategoryDefOf));
}
}
}

View File

@@ -156,6 +156,8 @@
<Compile Include="Pawn\WULA_Maintenance\MaintenanceNeedExtension.cs" />
<Compile Include="Pawn\WULA_Maintenance\Need_Maintenance.cs" />
<Compile Include="Pawn\WULA_Maintenance\WorkGiver_DoMaintenance.cs" />
<Compile Include="Stat\StatWorker_Energy.cs" />
<Compile Include="Stat\StatWorker_Maintenance.cs" />
<Compile Include="Stat\StatWorker_NanoRepair.cs" />
<Compile Include="ThingComp\CompAndPatch_GiveHediffOnShot.cs" />
<Compile Include="ThingComp\CompApparelInterceptor.cs" />