进化逻辑修改
This commit is contained in:
Binary file not shown.
@@ -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": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user