进化逻辑修改

This commit is contained in:
Tourswen
2025-09-25 02:59:53 +08:00
parent 5c2de652b9
commit c6db75ddc4
16 changed files with 239 additions and 60 deletions

Binary file not shown.

View File

@@ -70,13 +70,10 @@
<replaceExisting>true</replaceExisting>
<severity>1</severity>
</li>
<!--
错误: CompProperties_AbilityResearchPrereq 属于 AbilityDef, 不能用于 HediffDef 的 comps 列表。
<li Class="ArachnaeSwarm.CompProperties_AbilityResearchPrereq">
<requiredResearch>ARA_Technology_1WMT</requiredResearch>
<failMessage>需要科技 节点WMT-1"突破" 以解锁进化</failMessage>
</li>
-->
</comps>
</AbilityDef>
<HediffDef>
@@ -164,13 +161,10 @@
<replaceExisting>true</replaceExisting>
<severity>1</severity>
</li>
<!--
错误: CompProperties_AbilityResearchPrereq 属于 AbilityDef, 不能用于 HediffDef 的 comps 列表。
<li Class="ArachnaeSwarm.CompProperties_AbilityResearchPrereq">
<requiredResearch>ARA_Technology_2WMT</requiredResearch>
<failMessage>需要科技 节点WMT-2"突破2" 以解锁进化</failMessage>
</li>
-->
</comps>
</AbilityDef>
<HediffDef>
@@ -293,13 +287,10 @@
<replaceExisting>true</replaceExisting>
<severity>1</severity>
</li>
<!--
错误: CompProperties_AbilityResearchPrereq 属于 AbilityDef, 不能用于 HediffDef 的 comps 列表。
<li Class="ArachnaeSwarm.CompProperties_AbilityResearchPrereq">
<requiredResearch>ARA_Technology_1WMT</requiredResearch>
<failMessage>需要科技 节点WMT-1"突破" 以解锁进化</failMessage>
</li>
-->
</comps>
</AbilityDef>
<HediffDef>
@@ -393,13 +384,10 @@
<replaceExisting>true</replaceExisting>
<severity>1</severity>
</li>
<!--
错误: CompProperties_AbilityResearchPrereq 属于 AbilityDef, 不能用于 HediffDef 的 comps 列表。
<li Class="ArachnaeSwarm.CompProperties_AbilityResearchPrereq">
<requiredResearch>ARA_Technology_2WMT</requiredResearch>
<failMessage>需要科技 节点WMT-2"突破" 以解锁进化</failMessage>
</li>
-->
</comps>
</AbilityDef>
<HediffDef>
@@ -562,6 +550,11 @@
</targetParams>
</verbProperties>
<comps>
<li Class="ArachnaeSwarm.CompProperties_AbilityAddExtraExp">
<skill>Medicine</skill>
<passionGained>Major</passionGained>
<xpGainAmount>350000</xpGainAmount>
</li>
<li Class="CompProperties_AbilityGiveHediff">
<compClass>CompAbilityEffect_GiveHediff</compClass>
<hediffDef>ARA_Myrmecocystus_Production_Medicine</hediffDef>
@@ -569,13 +562,10 @@
<replaceExisting>true</replaceExisting>
<severity>1</severity>
</li>
<!--
错误: CompProperties_AbilityResearchPrereq 属于 AbilityDef, 不能用于 HediffDef 的 comps 列表。
<li Class="ArachnaeSwarm.CompProperties_AbilityResearchPrereq">
<requiredResearch>ARA_Technology_1MED</requiredResearch>
<failMessage>需要科技 节点MED-1"疗愈种" 以解锁进化</failMessage>
</li>
-->
</comps>
</AbilityDef>
<HediffDef>
@@ -678,13 +668,20 @@
<replaceExisting>true</replaceExisting>
<severity>1</severity>
</li>
<!--
错误: CompProperties_AbilityResearchPrereq 属于 AbilityDef, 不能用于 HediffDef 的 comps 列表。
<li Class="ArachnaeSwarm.CompProperties_AbilityAddExtraExp">
<skill>Melee</skill>
<passionGained>Major</passionGained>
<xpGainAmount>350000</xpGainAmount>
</li>
<li Class="ArachnaeSwarm.CompProperties_AbilityAddExtraExp">
<skill>Shooting</skill>
<passionGained>None</passionGained>
<xpGainAmount>-350000</xpGainAmount>
</li>
<li Class="ArachnaeSwarm.CompProperties_AbilityResearchPrereq">
<requiredResearch>ARA_Technology_4CLO</requiredResearch>
<failMessage>需要科技 节点CLO-4"追猎种" 以解锁进化</failMessage>
</li>
-->
</comps>
</AbilityDef>
<HediffDef>
@@ -720,6 +717,7 @@
</comps>
</HediffDef>
<!-- 迷雾种 -->
<HediffDef>
<defName>ARA_Smokepop_Base</defName>
<label>活体烟罐</label>
@@ -818,13 +816,10 @@
<replaceExisting>true</replaceExisting>
<severity>1</severity>
</li>
<!--
错误: CompProperties_AbilityResearchPrereq 属于 AbilityDef, 不能用于 HediffDef 的 comps 列表。
<li Class="ArachnaeSwarm.CompProperties_AbilityResearchPrereq">
<requiredResearch>ARA_Technology_1MED</requiredResearch>
<failMessage>需要科技 节点MED-1"制药" 以解锁进化</failMessage>
</li>
-->
</comps>
</AbilityDef>
<HediffDef>
@@ -900,7 +895,7 @@
</comps>
</HediffDef>
<!-- 迷雾-->
<!-- 盾头-->
<HediffDef>
<defName>ARA_ShieldHead_Base</defName>
<label>坚硬甲壳</label>

View File

@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<RecipeDef Abstract="True" Name="ARA_SurgeryInstallImplantBase">
<effectWorking>Surgery</effectWorking>
<soundWorking>Recipe_Surgery</soundWorking>
<workSpeedStat>MedicalOperationSpeed</workSpeedStat>
<workSkill>Medicine</workSkill>
<workSkillLearnFactor>16</workSkillLearnFactor>
<surgeryOutcomeEffect>SurgeryOutcomeBase</surgeryOutcomeEffect>
<workerClass>Recipe_InstallImplant</workerClass>
<!-- <workerClass>Recipe_InstallArtificialBodyPart</workerClass> -->
<workAmount>2500</workAmount>
<!-- <developmentalStageFilter>Child, Adult</developmentalStageFilter> -->
<skillRequirements>
<Medicine>5</Medicine>
</skillRequirements>
<recipeUsers Inherit="False">
<li>ArachnaeNode_Race_Myrmecocystus</li>
<li>ArachnaeNode_Race_ShieldHead</li>
<li>ArachnaeNode_Race_WeaponSmith</li>
<li>ArachnaeNode_Race_Fighter</li>
<li>ArachnaeNode_Race_Facehugger</li>
<li>ArachnaeNode_Race_Smokepop</li>
<li>ArachnaeNode_Race_Skyraider</li>
</recipeUsers>
<ingredients>
<li>
<filter><categories><li>Medicine</li></categories></filter>
<count>2</count>
</li>
</ingredients>
<fixedIngredientFilter>
<categories>
<li>Medicine</li>
</categories>
</fixedIngredientFilter>
</RecipeDef>
<RecipeDef ParentName="ARA_SurgeryInstallImplantBase">
<defName>ARA_Surgery_Install_Plasteel</defName>
<label>玻璃钢甲壳植入</label>
<description>为阿拉克涅虫族的甲壳植入玻璃钢,当甲壳素继续生长时,这些玻璃钢会被甲壳包裹,以形成更坚固的外骨骼,增强虫族的防御力。</description>
<descriptionHyperlinks>
<HediffDef>ARA_Plasteel_Shell_Hediff</HediffDef>
</descriptionHyperlinks>
<jobString>正在实施定向变异</jobString>
<ingredients>
<li>
<filter>
<thingDefs>
<li>Plasteel</li>
</thingDefs>
</filter>
<count>20</count>
</li>
</ingredients>
<appliedOnFixedBodyParts>
<li>ARA_Chitin_Shell</li>
</appliedOnFixedBodyParts>
<fixedIngredientFilter>
<thingDefs>
<li>Plasteel</li>
</thingDefs>
</fixedIngredientFilter>
<addsHediff>ARA_Plasteel_Shell_Hediff</addsHediff>
</RecipeDef>
<HediffDef ParentName="ImplantHediffBase">
<defName>ARA_Plasteel_Shell_Hediff</defName>
<label>玻璃钢甲壳</label>
<hediffClass>Hediff_Implant</hediffClass>
<description>阿拉克涅虫族通过直接将玻璃钢植入甲壳,使其获得了更强大的防御力。</description>
<descriptionHyperlinks>
<RecipeDef>ARA_Surgery_Install_Plasteel</RecipeDef>
</descriptionHyperlinks>
<addedPartProps>
<betterThanNatural>true</betterThanNatural>
</addedPartProps>
<stages>
<li>
<statOffsets>
<ArmorRating_Sharp>0.3</ArmorRating_Sharp>
<ArmorRating_Blunt>0.3</ArmorRating_Blunt>
</statOffsets>
<statFactors>
<IncomingDamageFactor>0.75</IncomingDamageFactor>
<StaggerDurationFactor>0</StaggerDurationFactor>
</statFactors>
</li>
</stages>
</HediffDef>
<RecipeDef ParentName="ARA_SurgeryInstallImplantBase">
<defName>ARA_Surgery_Install_Huge_Stomach</defName>
<label>额外胃囊</label>
<description>诱发阿拉克涅虫族的定向变异,使其储存营养的胃囊增大,以储存更多食物。</description>
<descriptionHyperlinks>
<HediffDef>ARA_Huge_Stomach_Hediff</HediffDef>
</descriptionHyperlinks>
<jobString>正在实施定向变异</jobString>
<ingredients>
<li>
<filter>
<thingDefs>
<li>ARA_Activated_Bacterium</li>
</thingDefs>
</filter>
<count>6</count>
</li>
</ingredients>
<appliedOnFixedBodyParts>
<li>stomach</li>
</appliedOnFixedBodyParts>
<fixedIngredientFilter>
<thingDefs>
<li>ARA_Activated_Bacterium</li>
</thingDefs>
</fixedIngredientFilter>
<addsHediff>ARA_Huge_Stomach_Hediff</addsHediff>
</RecipeDef>
<HediffDef ParentName="ImplantHediffBase">
<defName>ARA_Huge_Stomach_Hediff</defName>
<label>额外胃囊</label>
<hediffClass>Hediff_Implant</hediffClass>
<description>阿拉克涅虫族的定向变异赐予其更大的胃囊,以装下更多的营养。</description>
<descriptionHyperlinks>
<RecipeDef>ARA_Surgery_Install_Huge_Stomach</RecipeDef>
</descriptionHyperlinks>
<addedPartProps>
<betterThanNatural>true</betterThanNatural>
</addedPartProps>
<stages>
<li>
<statFactors>
<MaxNutrition>2</MaxNutrition>
</statFactors>
</li>
</stages>
</HediffDef>
</Defs>

View File

@@ -299,7 +299,7 @@
<description>允许虫族建造一种利用活体钜菌和生物质产出阿拉克涅虫蜜的建筑。</description>
<baseCost>150</baseCost>
<researchViewX>8.00</researchViewX>
<researchViewY>2.10</researchViewY>
<researchViewY>1.60</researchViewY>
<requiredResearchBuilding>ARA_ResearchBench</requiredResearchBuilding>
<prerequisites>
<li>ARA_Technology_8VXI</li>

View File

@@ -615,6 +615,8 @@
</tools>
<recipes Inherit="False">
<li>ARA_Surgery_Install_Plasteel</li>
<li>ARA_Surgery_Install_Huge_Stomach</li>
</recipes>
<comps>

View File

@@ -27,4 +27,6 @@
<MessageTrapSprung_NoInstigator>{TRAP} 被触发!</MessageTrapSprung_NoInstigator>
<delivery>{PAWN}生成了{THING}。</delivery>
<AbilitySkillChanged>{USER_labelShort}通过进化将{1}技能从{2}级转变至{3}级,并改变了热情。</AbilitySkillChanged>
</LanguageData>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 KiB

After

Width:  |  Height:  |  Size: 176 KiB

View File

@@ -1,16 +1,7 @@
{
"Version": 1,
"WorkspaceRootPath": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\building_comps\\ara_nutrientvat\\building_nutrientvat.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:building_comps\\ara_nutrientvat\\building_nutrientvat.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|e:\\steamlibrary\\steamapps\\common\\rimworld\\mods\\arachnaeswarm\\source\\arachnaeswarm\\ara_hediffdefof.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:ara_hediffdefof.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"Documents": [],
"DocumentGroupContainers": [
{
"Orientation": 0,
@@ -18,37 +9,11 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 2,
"SelectedChildIndex": -1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "ARA_HediffDefOf.cs",
"DocumentMoniker": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\ARA_HediffDefOf.cs",
"RelativeDocumentMoniker": "ARA_HediffDefOf.cs",
"ToolTip": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\ARA_HediffDefOf.cs",
"RelativeToolTip": "ARA_HediffDefOf.cs",
"ViewState": "AgIAAAAAAAAAAAAAAADwvwcAAAAnAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-09-24T14:28:58.313Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Building_NutrientVat.cs",
"DocumentMoniker": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Building_Comps\\ARA_NutrientVat\\Building_NutrientVat.cs",
"RelativeDocumentMoniker": "Building_Comps\\ARA_NutrientVat\\Building_NutrientVat.cs",
"ToolTip": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Building_Comps\\ARA_NutrientVat\\Building_NutrientVat.cs",
"RelativeToolTip": "Building_Comps\\ARA_NutrientVat\\Building_NutrientVat.cs",
"ViewState": "AgIAAFkAAAAAAAAAAAASwIsAAAAJAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-09-23T16:34:34.794Z",
"EditorCaption": ""
}
]
}

View File

@@ -0,0 +1,57 @@
using Verse;
using RimWorld;
using System.Linq;
namespace ArachnaeSwarm
{
public class CompAbilityEffect_AddExtraExp : CompAbilityEffect
{
public new CompProperties_AbilityAddExtraExp Props => (CompProperties_AbilityAddExtraExp)props;
public override void Apply(LocalTargetInfo target, LocalTargetInfo dest)
{
base.Apply(target, dest);
Pawn user = parent.pawn;
if (user == null) return;
// 1. 技能经验增益
int levelBefore = user.skills.GetSkill(Props.skill).GetLevel();
user.skills.Learn(Props.skill, Props.xpGainAmount, direct: true);
int levelAfter = user.skills.GetSkill(Props.skill).GetLevel();
// 2. 热情设置
SkillRecord targetSkillRecord = user.skills.GetSkill(Props.skill);
if (targetSkillRecord != null && !targetSkillRecord.TotallyDisabled)
{
if (targetSkillRecord.passion != Props.passionGained)
{
targetSkillRecord.passion = Props.passionGained;
}
}
// 发送通知
if (PawnUtility.ShouldSendNotificationAbout(user))
{
Messages.Message("AbilitySkillChanged".Translate(
user.LabelShort,
Props.skill.LabelCap,
levelBefore,
levelAfter,
user.Named("USER")),
user,
MessageTypeDefOf.PositiveEvent);
}
}
public override bool Valid(LocalTargetInfo target, bool throwMessages = false)
{
Pawn user = parent.pawn;
if (user == null || user.skills == null)
return false;
return base.Valid(target, throwMessages);
}
}
}

View File

@@ -0,0 +1,17 @@
using Verse;
using RimWorld;
namespace ArachnaeSwarm
{
public class CompProperties_AbilityAddExtraExp : CompProperties_AbilityEffect
{
public SkillDef skill;
public Passion passionGained = Passion.Major; // 可配置获得的热情等级,默认为大火
public float xpGainAmount = 50000f;
public CompProperties_AbilityAddExtraExp()
{
compClass = typeof(CompAbilityEffect_AddExtraExp);
}
}
}

View File

@@ -71,6 +71,8 @@
<Compile Include="Abilities\ARA_AbilitySwitch\CompAbilityEffect_GiveSwitchHediff.cs" />
<Compile Include="Abilities\ARA_AbilitySwitch\CompAbilityEffect_RemoveSwitchHediff.cs" />
<Compile Include="Abilities\ARA_AbilitySwitch\WeaponSwitch.cs" />
<Compile Include="Abilities\ARA_AddExtraExp\CompAbilityEffect_AddExtraExp.cs" />
<Compile Include="Abilities\ARA_AddExtraExp\CompProperties_AddExtraExp.cs" />
<Compile Include="Abilities\ARA_HuggingFace\CompAbilityEffect_Possess.cs" />
<Compile Include="Abilities\ARA_HuggingFace\CompProperties_AbilityPossess.cs" />
<Compile Include="Abilities\ARA_HuggingFace\Hediff_Possession.cs" />