训练台(未完成)
This commit is contained in:
Binary file not shown.
@@ -160,6 +160,8 @@
|
||||
</verbProperties>
|
||||
<comps>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.2</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -254,6 +256,8 @@
|
||||
<ticksBetweenShots>3</ticksBetweenShots> <!-- 每次发射间隔12 Ticks (0.2秒) -->
|
||||
</li>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.5</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -328,6 +332,8 @@
|
||||
<ticksBetweenShots>3</ticksBetweenShots> <!-- 每次发射间隔12 Ticks (0.2秒) -->
|
||||
</li>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.5</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -368,6 +374,8 @@
|
||||
<numProjectiles>12</numProjectiles>
|
||||
</li>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.1</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -411,6 +419,8 @@
|
||||
<projectileDef>ArachnaeBase_Race_Acidcut_Proj</projectileDef>
|
||||
</li>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.2</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -463,6 +473,8 @@
|
||||
<numProjectiles>3</numProjectiles>
|
||||
</li>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.2</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -498,6 +510,8 @@
|
||||
<jobDef>CastJump</jobDef>
|
||||
<comps>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.3</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -565,6 +579,8 @@
|
||||
</verbProperties>
|
||||
<comps>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.25</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -631,6 +647,8 @@
|
||||
<maintainTicks>20</maintainTicks> <!-- Long enough for the "2nd wave" to spawn -->
|
||||
</li>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.2</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -747,6 +765,8 @@
|
||||
</verbProperties>
|
||||
<comps>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.1</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -804,6 +824,8 @@
|
||||
<jobDef>CastJump</jobDef>
|
||||
<comps>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.05</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -872,6 +894,8 @@
|
||||
</verbProperties>
|
||||
<comps>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.2</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -936,6 +960,8 @@
|
||||
</verbProperties>
|
||||
<comps>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.2</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -995,6 +1021,8 @@
|
||||
</verbProperties>
|
||||
<comps>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.2</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -1043,6 +1071,8 @@
|
||||
<jobDef>CastJump</jobDef>
|
||||
<comps>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.1</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -1078,6 +1108,8 @@
|
||||
<numProjectiles>3</numProjectiles>
|
||||
</li>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.2</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -1116,6 +1148,8 @@
|
||||
<projectileDef>ARA_Proj_Tumor</projectileDef>
|
||||
</li>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.2</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -1158,6 +1192,8 @@
|
||||
<numProjectiles>5</numProjectiles>
|
||||
</li>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.25</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
@@ -1192,6 +1228,8 @@
|
||||
<jobDef>CastJump</jobDef>
|
||||
<comps>
|
||||
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
|
||||
<customLabel>饮食</customLabel>
|
||||
<showProgressBar>true</showProgressBar>
|
||||
<needDef>Food</needDef>
|
||||
<needCost>0.1</needCost>
|
||||
<failMessage>营养值不足,需要进食</failMessage>
|
||||
|
||||
140
1.6/1.6/Defs/RecipeDefs/ARA_Training_Recipes.xml
Normal file
140
1.6/1.6/Defs/RecipeDefs/ARA_Training_Recipes.xml
Normal file
@@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Defs>
|
||||
<RecipeDef Name="ARA_SkillTraining_Abstract" Abstract="True">
|
||||
<description>根据选择的技能进行等级训练,没有花销,也不会产出什么东西,仅仅是获得工作的经验值。</description>
|
||||
<jobString>训练技能中。</jobString>
|
||||
<workAmount>500</workAmount>
|
||||
<workSpeedStat>GeneralLaborSpeed</workSpeedStat>
|
||||
<ingredients>
|
||||
</ingredients>
|
||||
<products>
|
||||
</products>
|
||||
<effectWorking>Smith</effectWorking>
|
||||
<soundWorking>Recipe_Surgery</soundWorking>
|
||||
<workSkillLearnFactor>16</workSkillLearnFactor>
|
||||
<recipeUsers>
|
||||
<li>ARA_SkillTraining_Building</li>
|
||||
</recipeUsers>
|
||||
</RecipeDef>
|
||||
|
||||
<!-- 射击技能训练 -->
|
||||
<RecipeDef ParentName="ARA_SkillTraining_Abstract">
|
||||
<defName>ARA_TrainShooting</defName>
|
||||
<label>技能训练(射击)</label>
|
||||
<workSkill>Shooting</workSkill>
|
||||
<workAmount>12000</workAmount>
|
||||
<skillRequirements>
|
||||
<Shooting>0</Shooting>
|
||||
</skillRequirements>
|
||||
</RecipeDef>
|
||||
|
||||
<!-- 近战技能训练 -->
|
||||
<RecipeDef ParentName="ARA_SkillTraining_Abstract">
|
||||
<defName>ARA_TrainMelee</defName>
|
||||
<label>技能训练(近战)</label>
|
||||
<workSkill>Melee</workSkill>
|
||||
<workAmount>10000</workAmount>
|
||||
<skillRequirements>
|
||||
<Melee>0</Melee>
|
||||
</skillRequirements>
|
||||
</RecipeDef>
|
||||
|
||||
<!-- 建造技能训练 -->
|
||||
<RecipeDef ParentName="ARA_SkillTraining_Abstract">
|
||||
<defName>ARA_TrainConstruction</defName>
|
||||
<label>技能训练(建造)</label>
|
||||
<workSkill>Construction</workSkill>
|
||||
<workAmount>15000</workAmount>
|
||||
<skillRequirements>
|
||||
<Construction>0</Construction>
|
||||
</skillRequirements>
|
||||
</RecipeDef>
|
||||
|
||||
<!-- 采矿技能训练 -->
|
||||
<RecipeDef ParentName="ARA_SkillTraining_Abstract">
|
||||
<defName>ARA_TrainMining</defName>
|
||||
<label>技能训练(采矿)</label>
|
||||
<workSkill>Mining</workSkill>
|
||||
<workAmount>18000</workAmount>
|
||||
<skillRequirements>
|
||||
<Mining>0</Mining>
|
||||
</skillRequirements>
|
||||
</RecipeDef>
|
||||
|
||||
<!-- 烹饪技能训练 -->
|
||||
<RecipeDef ParentName="ARA_SkillTraining_Abstract">
|
||||
<defName>ARA_TrainCooking</defName>
|
||||
<label>技能训练(烹饪)</label>
|
||||
<workSkill>Cooking</workSkill>
|
||||
<workAmount>8000</workAmount>
|
||||
<skillRequirements>
|
||||
<Cooking>0</Cooking>
|
||||
</skillRequirements>
|
||||
</RecipeDef>
|
||||
|
||||
<!-- 种植技能训练 -->
|
||||
<RecipeDef ParentName="ARA_SkillTraining_Abstract">
|
||||
<defName>ARA_TrainPlants</defName>
|
||||
<label>技能训练(种植)</label>
|
||||
<workSkill>Plants</workSkill>
|
||||
<workAmount>14000</workAmount>
|
||||
<skillRequirements>
|
||||
<Plants>0</Plants>
|
||||
</skillRequirements>
|
||||
</RecipeDef>
|
||||
|
||||
<!-- 动物技能训练 -->
|
||||
<RecipeDef ParentName="ARA_SkillTraining_Abstract">
|
||||
<defName>ARA_TrainAnimals</defName>
|
||||
<label>技能训练(驯兽)</label>
|
||||
<workSkill>Animals</workSkill>
|
||||
<workAmount>16000</workAmount>
|
||||
<skillRequirements>
|
||||
<Animals>0</Animals>
|
||||
</skillRequirements>
|
||||
</RecipeDef>
|
||||
|
||||
<!-- 医术技能训练 -->
|
||||
<RecipeDef ParentName="ARA_SkillTraining_Abstract">
|
||||
<defName>ARA_TrainMedicine</defName>
|
||||
<label>技能训练(医疗)</label>
|
||||
<workSkill>Medicine</workSkill>
|
||||
<workAmount>12000</workAmount>
|
||||
<skillRequirements>
|
||||
<Medicine>0</Medicine>
|
||||
</skillRequirements>
|
||||
</RecipeDef>
|
||||
|
||||
<!-- 社交技能训练 -->
|
||||
<RecipeDef ParentName="ARA_SkillTraining_Abstract">
|
||||
<defName>ARA_TrainSocial</defName>
|
||||
<label>技能训练(社交)</label>
|
||||
<workSkill>Social</workSkill>
|
||||
<workAmount>9000</workAmount>
|
||||
<skillRequirements>
|
||||
<Social>0</Social>
|
||||
</skillRequirements>
|
||||
</RecipeDef>
|
||||
|
||||
<!-- 手工技能训练 -->
|
||||
<RecipeDef ParentName="ARA_SkillTraining_Abstract">
|
||||
<defName>ARA_TrainCrafting</defName>
|
||||
<label>技能训练(手工)</label>
|
||||
<workSkill>Crafting</workSkill>
|
||||
<workAmount>13000</workAmount>
|
||||
<skillRequirements>
|
||||
<Crafting>0</Crafting>
|
||||
</skillRequirements>
|
||||
</RecipeDef>
|
||||
|
||||
<!-- 艺术技能训练 -->
|
||||
<RecipeDef ParentName="ARA_SkillTraining_Abstract">
|
||||
<defName>ARA_TrainArtistic</defName>
|
||||
<label>技能训练(艺术)</label>
|
||||
<workSkill>Artistic</workSkill>
|
||||
<workAmount>11000</workAmount>
|
||||
<skillRequirements>
|
||||
<Artistic>0</Artistic>
|
||||
</skillRequirements>
|
||||
</RecipeDef>
|
||||
</Defs>
|
||||
@@ -849,4 +849,67 @@
|
||||
</defaultStorageSettings>
|
||||
</building>
|
||||
</ThingDef>
|
||||
|
||||
<ThingDef ParentName="BenchBase">
|
||||
<defName>ARA_SkillTraining_Building</defName>
|
||||
<label>训练台</label>
|
||||
<description>训练技能</description>
|
||||
<thingClass>Building_WorkTable</thingClass>
|
||||
<drawerType>MapMeshAndRealTime</drawerType>
|
||||
<graphicData>
|
||||
<texPath>ArachnaeSwarm/Building/ARA_Shelf</texPath>
|
||||
<graphicClass>Graphic_Multi</graphicClass>
|
||||
<drawSize>(2.25,2.5)</drawSize>
|
||||
<drawOffset>(0,0,0.2)</drawOffset>
|
||||
</graphicData>
|
||||
<castEdgeShadows>true</castEdgeShadows>
|
||||
<constructEffect>ConstructMetal</constructEffect>
|
||||
<costList>
|
||||
<Steel>100</Steel>
|
||||
</costList>
|
||||
<altitudeLayer>Building</altitudeLayer>
|
||||
<fillPercent>0.5</fillPercent>
|
||||
<useHitPoints>True</useHitPoints>
|
||||
<researchPrerequisites Inherit="False">
|
||||
<li>ARA_Base_Technology</li>
|
||||
</researchPrerequisites>
|
||||
<statBases>
|
||||
<WorkToBuild>2000</WorkToBuild>
|
||||
<MaxHitPoints>180</MaxHitPoints>
|
||||
<Flammability>1.0</Flammability>
|
||||
</statBases>
|
||||
<size>(2,2)</size>
|
||||
<hasInteractionCell>True</hasInteractionCell>
|
||||
<interactionCellOffset>(0,0,-1)</interactionCellOffset>
|
||||
<designationCategory>ARA_Buildings</designationCategory>
|
||||
<uiOrder>2120</uiOrder>
|
||||
<passability>PassThroughOnly</passability>
|
||||
<pathCost>50</pathCost>
|
||||
<surfaceType>Item</surfaceType>
|
||||
<inspectorTabs>
|
||||
<li>ITab_Bills</li>
|
||||
</inspectorTabs>
|
||||
<placeWorkers>
|
||||
<li>PlaceWorker_PreventInteractionSpotOverlap</li>
|
||||
</placeWorkers>
|
||||
<building>
|
||||
<spawnedConceptLearnOpportunity>BillsTab</spawnedConceptLearnOpportunity>
|
||||
</building>
|
||||
</ThingDef>
|
||||
<WorkGiverDef>
|
||||
<defName>ARA_SkillTraining_Building_Bills</defName>
|
||||
<label>训练技能</label>
|
||||
<giverClass>WorkGiver_DoBill</giverClass>
|
||||
<workType>Smithing</workType>
|
||||
<priorityInType>75</priorityInType>
|
||||
<fixedBillGiverDefs>
|
||||
<li>ARA_SkillTraining_Building</li>
|
||||
</fixedBillGiverDefs>
|
||||
<verb>训练于</verb>
|
||||
<gerund>训练于</gerund>
|
||||
<requiredCapacities>
|
||||
<li>Manipulation</li>
|
||||
</requiredCapacities>
|
||||
<prioritizeSustains>true</prioritizeSustains>
|
||||
</WorkGiverDef>
|
||||
</Defs>
|
||||
@@ -60,4 +60,11 @@
|
||||
|
||||
<DisallowedItems>禁止物品</DisallowedItems>
|
||||
<CannotUseDisallowedFuel>{0} 不能用作 {1} 的燃料</CannotUseDisallowedFuel>
|
||||
|
||||
<ARA_NeedCost_RequiresAtLeast>需要至少 {0} {1}</ARA_NeedCost_RequiresAtLeast>
|
||||
<ARA_NeedCost_Consumption>{0}消耗</ARA_NeedCost_Consumption>
|
||||
<ARA_NeedCost_Cost>消耗: {0}</ARA_NeedCost_Cost>
|
||||
<ARA_NeedCost_Current>当前: {0}/{1}</ARA_NeedCost_Current>
|
||||
<ARA_NeedCost_Insufficient>{0}不足</ARA_NeedCost_Insufficient>
|
||||
<ARA_NeedCost_CanCast>可以施放</ARA_NeedCost_CanCast>
|
||||
</LanguageData>
|
||||
Binary file not shown.
@@ -3,28 +3,8 @@
|
||||
"WorkspaceRootPath": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\",
|
||||
"Documents": [
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|d:\\steamlibrary\\steamapps\\common\\rimworld\\mods\\arachnaeswarm\\source\\arachnaeswarm\\eventsystem\\questnode_root_eventletter.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:eventsystem\\questnode_root_eventletter.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\eventsystem\\dialog_newlayoutdisplay.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:eventsystem\\dialog_newlayoutdisplay.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\eventsystem\\dialog_customdisplay.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:eventsystem\\dialog_customdisplay.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\eventsystem\\effect.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:eventsystem\\effect.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\eventsystem\\compopencustomui.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:eventsystem\\compopencustomui.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\eventsystem\\eventuiconfigdef.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:eventsystem\\eventuiconfigdef.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
"AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|d:\\steamlibrary\\steamapps\\common\\rimworld\\mods\\arachnaeswarm\\source\\arachnaeswarm\\abilities\\ara_queenability\\compabilityeffect_needcost.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:abilities\\ara_queenability\\compabilityeffect_needcost.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
}
|
||||
],
|
||||
"DocumentGroupContainers": [
|
||||
@@ -43,75 +23,15 @@
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "QuestNode_Root_EventLetter.cs",
|
||||
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\EventSystem\\QuestNode_Root_EventLetter.cs",
|
||||
"RelativeDocumentMoniker": "EventSystem\\QuestNode_Root_EventLetter.cs",
|
||||
"ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\EventSystem\\QuestNode_Root_EventLetter.cs",
|
||||
"RelativeToolTip": "EventSystem\\QuestNode_Root_EventLetter.cs",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAgAAAA3AAAAAAAAAA==",
|
||||
"Title": "CompAbilityEffect_NeedCost.cs",
|
||||
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Abilities\\ARA_QueenAbility\\CompAbilityEffect_NeedCost.cs",
|
||||
"RelativeDocumentMoniker": "Abilities\\ARA_QueenAbility\\CompAbilityEffect_NeedCost.cs",
|
||||
"ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Abilities\\ARA_QueenAbility\\CompAbilityEffect_NeedCost.cs",
|
||||
"RelativeToolTip": "Abilities\\ARA_QueenAbility\\CompAbilityEffect_NeedCost.cs",
|
||||
"ViewState": "AgIAACUAAAAAAAAAAAAAAEgAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2025-10-07T09:56:01.195Z",
|
||||
"WhenOpened": "2025-10-08T08:23:27.533Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 1,
|
||||
"Title": "Dialog_NewLayoutDisplay.cs",
|
||||
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\EventSystem\\Dialog_NewLayoutDisplay.cs",
|
||||
"RelativeDocumentMoniker": "EventSystem\\Dialog_NewLayoutDisplay.cs",
|
||||
"ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\EventSystem\\Dialog_NewLayoutDisplay.cs",
|
||||
"RelativeToolTip": "EventSystem\\Dialog_NewLayoutDisplay.cs",
|
||||
"ViewState": "AgIAAAsAAAAAAAAAAAAuwDYAAAARAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2025-10-07T09:39:47.15Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 2,
|
||||
"Title": "Dialog_CustomDisplay.cs",
|
||||
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\EventSystem\\Dialog_CustomDisplay.cs",
|
||||
"RelativeDocumentMoniker": "EventSystem\\Dialog_CustomDisplay.cs",
|
||||
"ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\EventSystem\\Dialog_CustomDisplay.cs",
|
||||
"RelativeToolTip": "EventSystem\\Dialog_CustomDisplay.cs",
|
||||
"ViewState": "AgIAAAsAAAAAAAAAAAAuwBcAAABWAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2025-10-07T09:39:43.149Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 3,
|
||||
"Title": "Effect.cs",
|
||||
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\EventSystem\\Effect.cs",
|
||||
"RelativeDocumentMoniker": "EventSystem\\Effect.cs",
|
||||
"ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\EventSystem\\Effect.cs",
|
||||
"RelativeToolTip": "EventSystem\\Effect.cs",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAADwvwwAAAA7AAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2025-10-07T09:35:57.661Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 5,
|
||||
"Title": "EventUIConfigDef.cs",
|
||||
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\EventSystem\\EventUIConfigDef.cs",
|
||||
"RelativeDocumentMoniker": "EventSystem\\EventUIConfigDef.cs",
|
||||
"ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\EventSystem\\EventUIConfigDef.cs",
|
||||
"RelativeToolTip": "EventSystem\\EventUIConfigDef.cs",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAABYAAAAqAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2025-10-07T08:37:06.577Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 4,
|
||||
"Title": "CompOpenCustomUI.cs",
|
||||
"DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\EventSystem\\CompOpenCustomUI.cs",
|
||||
"RelativeDocumentMoniker": "EventSystem\\CompOpenCustomUI.cs",
|
||||
"ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\EventSystem\\CompOpenCustomUI.cs",
|
||||
"RelativeToolTip": "EventSystem\\CompOpenCustomUI.cs",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAADwvxQAAAAtAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2025-10-07T08:36:51.993Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using RimWorld;
|
||||
using RimWorld.Planet;
|
||||
using Verse;
|
||||
using System.Text;
|
||||
|
||||
namespace ArachnaeSwarm
|
||||
{
|
||||
@@ -9,6 +10,8 @@ namespace ArachnaeSwarm
|
||||
public NeedDef needDef;
|
||||
public float needCost;
|
||||
public string failMessage;
|
||||
public string customLabel; // 自定义显示标签
|
||||
public bool showProgressBar = true; // 是否显示进度条样式
|
||||
|
||||
public CompProperties_AbilityNeedCost()
|
||||
{
|
||||
@@ -22,18 +25,11 @@ namespace ArachnaeSwarm
|
||||
|
||||
public override bool GizmoDisabled(out string reason)
|
||||
{
|
||||
Pawn caster = parent.pawn;
|
||||
if (caster != null && caster.needs != null)
|
||||
if (!HasEnoughNeed())
|
||||
{
|
||||
if (caster.needs.TryGetNeed(Props.needDef, out Need need))
|
||||
{
|
||||
if (need.CurLevel < Props.needCost)
|
||||
{
|
||||
reason = Props.failMessage;
|
||||
reason = Props.failMessage ?? "ARA_NeedCost_RequiresAtLeast".Translate(Props.needCost, GetNeedLabel());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
reason = null;
|
||||
return false;
|
||||
}
|
||||
@@ -41,6 +37,103 @@ namespace ArachnaeSwarm
|
||||
public override void Apply(LocalTargetInfo target, LocalTargetInfo dest)
|
||||
{
|
||||
base.Apply(target, dest);
|
||||
ConsumeNeed();
|
||||
}
|
||||
|
||||
// 在工具提示中显示消耗信息
|
||||
public override string ExtraTooltipPart()
|
||||
{
|
||||
if (Props.needDef == null)
|
||||
return null;
|
||||
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
float currentLevel = GetCurrentNeedLevel();
|
||||
float maxLevel = GetMaxNeedLevel();
|
||||
bool canCast = HasEnoughNeed();
|
||||
|
||||
// 构建显示信息
|
||||
stringBuilder.AppendLine("ARA_NeedCost_Consumption".Translate(GetNeedLabel()));
|
||||
stringBuilder.AppendLine();
|
||||
|
||||
// 显示消耗和当前值
|
||||
string costColor = canCast ? "green" : "red";
|
||||
string costText = "ARA_NeedCost_Cost".Translate(Props.needCost);
|
||||
stringBuilder.AppendLine($" <color={costColor}>{costText}</color>");
|
||||
|
||||
string currentText = "ARA_NeedCost_Current".Translate(currentLevel.ToString("F1"), maxLevel.ToString("F1"));
|
||||
stringBuilder.AppendLine($" {currentText}");
|
||||
|
||||
// 显示进度条(文本模拟)
|
||||
if (Props.showProgressBar && maxLevel > 0)
|
||||
{
|
||||
stringBuilder.AppendLine();
|
||||
stringBuilder.AppendLine(GetProgressBar(currentLevel, maxLevel, Props.needCost));
|
||||
}
|
||||
|
||||
// 显示状态信息
|
||||
if (!canCast)
|
||||
{
|
||||
stringBuilder.AppendLine();
|
||||
string insufficientText = "ARA_NeedCost_Insufficient".Translate(GetNeedLabel());
|
||||
stringBuilder.AppendLine($" <color=red>✗ {insufficientText}</color>");
|
||||
}
|
||||
else
|
||||
{
|
||||
stringBuilder.AppendLine();
|
||||
string canCastText = "ARA_NeedCost_CanCast".Translate();
|
||||
stringBuilder.AppendLine($" <color=green>✓ {canCastText}</color>");
|
||||
}
|
||||
|
||||
return stringBuilder.ToString().TrimEndNewlines();
|
||||
}
|
||||
|
||||
// 文本进度条显示
|
||||
private string GetProgressBar(float current, float max, float cost)
|
||||
{
|
||||
const int barLength = 20;
|
||||
float fillPercent = current / max;
|
||||
float costPercent = cost / max;
|
||||
|
||||
int fillChars = (int)(barLength * fillPercent);
|
||||
int costChars = (int)(barLength * costPercent);
|
||||
|
||||
StringBuilder bar = new StringBuilder();
|
||||
bar.Append(" [");
|
||||
|
||||
// 已填充部分
|
||||
for (int i = 0; i < barLength; i++)
|
||||
{
|
||||
if (i < fillChars)
|
||||
{
|
||||
if (i < costChars)
|
||||
{
|
||||
bar.Append("<color=green>█</color>"); // 消耗部分
|
||||
}
|
||||
else
|
||||
{
|
||||
bar.Append("<color=yellow>█</color>"); // 剩余部分
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bar.Append("<color=grey>░</color>"); // 未填充部分
|
||||
}
|
||||
}
|
||||
|
||||
bar.Append("]");
|
||||
return bar.ToString();
|
||||
}
|
||||
|
||||
// 获取 Need 的显示标签
|
||||
private string GetNeedLabel()
|
||||
{
|
||||
return Props.customLabel ?? Props.needDef.label;
|
||||
}
|
||||
|
||||
// 消耗 Need
|
||||
private void ConsumeNeed()
|
||||
{
|
||||
Pawn caster = parent.pawn;
|
||||
if (caster != null && caster.needs != null)
|
||||
{
|
||||
@@ -50,5 +143,47 @@ namespace ArachnaeSwarm
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 检查是否有足够的 Need 来施放技能
|
||||
private bool HasEnoughNeed()
|
||||
{
|
||||
Pawn caster = parent.pawn;
|
||||
if (caster != null && caster.needs != null)
|
||||
{
|
||||
if (caster.needs.TryGetNeed(Props.needDef, out Need need))
|
||||
{
|
||||
return need.CurLevel >= Props.needCost;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 获取当前 Need 水平
|
||||
private float GetCurrentNeedLevel()
|
||||
{
|
||||
Pawn caster = parent.pawn;
|
||||
if (caster != null && caster.needs != null)
|
||||
{
|
||||
if (caster.needs.TryGetNeed(Props.needDef, out Need need))
|
||||
{
|
||||
return need.CurLevel;
|
||||
}
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
// 获取最大 Need 水平
|
||||
private float GetMaxNeedLevel()
|
||||
{
|
||||
Pawn caster = parent.pawn;
|
||||
if (caster != null && caster.needs != null)
|
||||
{
|
||||
if (caster.needs.TryGetNeed(Props.needDef, out Need need))
|
||||
{
|
||||
return need.MaxLevel;
|
||||
}
|
||||
}
|
||||
return 1f;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user