mirror of
https://github.com/Xevion/RimWorld_ResearchWhatever.git
synced 2025-12-07 03:16:21 -06:00
1.0.3
This commit is contained in:
Binary file not shown.
@@ -45,7 +45,6 @@ namespace ResearchWhatever.Patches
|
|||||||
|
|
||||||
static void Prefix(Pawn pawn, Thing t, bool forced)
|
static void Prefix(Pawn pawn, Thing t, bool forced)
|
||||||
{
|
{
|
||||||
|
|
||||||
ResearchProjectDef currentProj = Find.ResearchManager.currentProj;
|
ResearchProjectDef currentProj = Find.ResearchManager.currentProj;
|
||||||
if (currentProj != null) return;
|
if (currentProj != null) return;
|
||||||
Building_ResearchBench bench = t as Building_ResearchBench;
|
Building_ResearchBench bench = t as Building_ResearchBench;
|
||||||
@@ -62,6 +61,7 @@ namespace ResearchWhatever.Patches
|
|||||||
&& x.TechprintRequirementMet
|
&& x.TechprintRequirementMet
|
||||||
&& x.PrerequisitesCompleted
|
&& x.PrerequisitesCompleted
|
||||||
&& (x.requiredResearchBuilding == null || x.requiredResearchBuilding == bench.def && bench.hasFacilities(x.requiredResearchFacilities))
|
&& (x.requiredResearchBuilding == null || x.requiredResearchBuilding == bench.def && bench.hasFacilities(x.requiredResearchFacilities))
|
||||||
|
&& x.GetModExtension<ResearchWhateverExtansion>()?.ignore != true
|
||||||
select x);
|
select x);
|
||||||
|
|
||||||
if (projects.NullOrEmpty())
|
if (projects.NullOrEmpty())
|
||||||
@@ -70,7 +70,7 @@ namespace ResearchWhatever.Patches
|
|||||||
Messages.Message("ResearchWhateverNothingLeftToResearch".Translate(bench.Label).CapitalizeFirst(), new TargetInfo(bench.Position, bench.Map, false), MessageTypeDefOf.NeutralEvent);
|
Messages.Message("ResearchWhateverNothingLeftToResearch".Translate(bench.Label).CapitalizeFirst(), new TargetInfo(bench.Position, bench.Map, false), MessageTypeDefOf.NeutralEvent);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
projects.SortBy(x => x.CostApparent);
|
projects.SortBy(x => x.GetModExtension<ResearchWhateverExtansion>()?.lowPriority == true ? 100000000f + x.CostApparent : x.CostApparent);
|
||||||
|
|
||||||
ResearchProjectDef def = projects.First();
|
ResearchProjectDef def = projects.First();
|
||||||
projects.TryRandomElementByWeight(x => x.CostApparent == def.CostApparent ? 1f : 0f, out def);
|
projects.TryRandomElementByWeight(x => x.CostApparent == def.CostApparent ? 1f : 0f, out def);
|
||||||
|
|||||||
@@ -67,6 +67,7 @@
|
|||||||
<Compile Include="ResearchWhatever.cs" />
|
<Compile Include="ResearchWhatever.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="ResearchWhateverComp.cs" />
|
<Compile Include="ResearchWhateverComp.cs" />
|
||||||
|
<Compile Include="ResearchWhateverExtansion.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
|
|||||||
10
Source/ResearchWhatever13/ResearchWhateverExtansion.cs
Normal file
10
Source/ResearchWhatever13/ResearchWhateverExtansion.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using Verse;
|
||||||
|
|
||||||
|
namespace ResearchWhatever
|
||||||
|
{
|
||||||
|
public class ResearchWhateverExtansion : DefModExtension
|
||||||
|
{
|
||||||
|
public bool ignore = false;
|
||||||
|
public bool lowPriority = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,8 @@
|
|||||||
1.0.2
|
1.0.3
|
||||||
|
- added an extension to make it possible to ignore some research or prioritize last;
|
||||||
|
- made so repeatable research from firefoxpdm.ResearchableStatUpgrades us always bottom priority;
|
||||||
|
|
||||||
|
1.0.2
|
||||||
- option gets disabled if building is not of player faction;
|
- option gets disabled if building is not of player faction;
|
||||||
|
|
||||||
1.0.1
|
1.0.1
|
||||||
|
|||||||
Reference in New Issue
Block a user