Skip to content

Commit 63be0d0

Browse files
committed
v2.0.0: Update to 1.3
1 parent dc03fc9 commit 63be0d0

File tree

8 files changed

+81
-34
lines changed

8 files changed

+81
-34
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,4 +253,6 @@ paket-files/
253253

254254
# Python Tools for Visual Studio (PTVS)
255255
__pycache__/
256-
*.pyc
256+
*.pyc
257+
258+
*/Assemblies/*
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Defs>
3+
<HistoryEventDef>
4+
<defName>RequestedIntel</defName>
5+
<label>requested intelligence</label>
6+
</HistoryEventDef>
7+
</Defs>

About/About.xml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
<ModMetaData>
2-
<name>Call For Intel</name>
3-
<author>8Z</author>
2+
<name>Call For Intel</name>
3+
<author>8Z</author>
44
<packageId>8Z.CallForIntel</packageId>
5-
<supportedVersions>
6-
<li>1.2</li>
7-
</supportedVersions>
8-
<description>Call other factions to get quests at will!</description>
9-
<url>https://steamcommunity.com/id/8Z/myworkshopfiles/?appid=294100</url>
10-
<loadAfter>
11-
<li>Brrainz.Harmony</li>
12-
</loadAfter>
5+
<supportedVersions>
6+
<li>1.2</li>
7+
<li>1.3</li>
8+
</supportedVersions>
9+
<description>Call other factions to get quests at will!</description>
10+
<url>https://steamcommunity.com/sharedfiles/filedetails/?id=2240610130</url>
11+
<modDependencies>
12+
<li>
13+
<packageId>brrainz.harmony</packageId>
14+
<displayName>Harmony</displayName>
15+
<steamWorkshopUrl>steam://url/CommunityFilePage/2009463077</steamWorkshopUrl>
16+
<downloadUrl>https://github.com/pardeike/HarmonyRimWorld/releases/latest</downloadUrl>
17+
</li>
18+
</modDependencies>
1319
</ModMetaData>

About/Manifest.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<Manifest>
3+
<version>2.0.0</version>
4+
<manifestUri></manifestUri>
5+
<downloadUri></downloadUri>
6+
<showCrossPromotions>true</showCrossPromotions>
7+
</Manifest>

CallForIntel.sln

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27004.2009
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.2.32630.192
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CallForIntel", "Source\CallForIntel.csproj", "{D7D21B4A-1DA7-41D8-B202-C58CA8FA62AA}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Release|Any CPU = Release|Any CPU
11+
V12|Any CPU = V12|Any CPU
12+
V13|Any CPU = V13|Any CPU
1113
EndGlobalSection
1214
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1315
{D7D21B4A-1DA7-41D8-B202-C58CA8FA62AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
1416
{D7D21B4A-1DA7-41D8-B202-C58CA8FA62AA}.Release|Any CPU.Build.0 = Release|Any CPU
17+
{D7D21B4A-1DA7-41D8-B202-C58CA8FA62AA}.V12|Any CPU.ActiveCfg = V12|Any CPU
18+
{D7D21B4A-1DA7-41D8-B202-C58CA8FA62AA}.V12|Any CPU.Build.0 = V12|Any CPU
19+
{D7D21B4A-1DA7-41D8-B202-C58CA8FA62AA}.V13|Any CPU.ActiveCfg = V13|Any CPU
20+
{D7D21B4A-1DA7-41D8-B202-C58CA8FA62AA}.V13|Any CPU.Build.0 = V13|Any CPU
1521
EndGlobalSection
1622
GlobalSection(SolutionProperties) = preSolution
1723
HideSolutionNode = FALSE

Common/Assemblies/CallForIntel.dll

-13 KB
Binary file not shown.

Source/CallForIntel.cs

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
using System;
55
using System.Collections.Generic;
66
using System.Linq;
7-
using System.Reflection;
7+
88
using Verse;
9-
using VFE_Settlers.Workers;
109

1110
namespace CallForIntel
1211
{
@@ -16,14 +15,15 @@ static class MyPatcher
1615
{
1716
static MyPatcher()
1817
{
19-
Harmony harmony = new Harmony("rimworld.8z.callforintel");
18+
Harmony harmony = new Harmony("com.theonly8z.callforintel");
2019
harmony.PatchAll();
2120
}
2221

2322
}
2423

2524
// A class that holds an action (function that generates intel) and a relative weight
2625
// Used to generate a intel for a specfic choice when multiple are possible
26+
2727
public class WeightedIntel
2828
{
2929
public int weight;
@@ -57,26 +57,40 @@ public static void Choose(List<WeightedIntel> intel, Faction faction)
5757
// Best to pop a notification or something
5858
faction.lastTraderRequestTick = Find.TickManager.TicksGame;
5959
Find.LetterStack.ReceiveLetter("IntelFailedLabel", "IntelFailedDialouge".Translate(faction.leader).CapitalizeFirst(), LetterDefOf.NeutralEvent);
60-
6160
}
6261
}
6362

63+
#if V12
6464
[HarmonyPatch(typeof(FactionDialogMaker))]
6565
[HarmonyPatch("FactionDialogFor")]
66+
#elif V13
67+
[HarmonyPatch(typeof(FactionDialogMaker), nameof(FactionDialogMaker.FactionDialogFor))]
68+
#endif
6669
public static class FactionDialogMakerPatch
6770
{
6871

6972
static string[] VikingHunts = { "VFEV_FenrirHunt", "VFEV_LothurrHunt", "VFEV_NjorunHunt", "VFEV_OdinHunt", "VFEV_ThrumboHunt" };
7073

74+
static void ChargeGoodwill(Faction faction, int amount)
75+
{
76+
faction.lastTraderRequestTick = Find.TickManager.TicksGame;
77+
78+
// Function changed in 1.3 to use a HistoryEventDef instead of a translation string for "reason".
79+
#if V12
80+
faction.TryAffectGoodwillWith(Faction.OfPlayer, -amount, canSendMessage: false, canSendHostilityLetter: true, "GoodwillChangedReason_RequestedIntel".Translate());
81+
#elif V13
82+
faction.TryAffectGoodwillWith(Faction.OfPlayer, -amount, canSendMessage: false, canSendHostilityLetter: true, (HistoryEventDef)GenDefDatabase.GetDef(typeof(HistoryEventDef), "RequestedIntel"));
83+
#endif
84+
}
85+
7186
static void GenerateIntelQuest(Faction faction, string name, int goodwill)
7287
{
7388
Slate slate = new Slate();
7489
slate.Set("points", StorytellerUtility.DefaultThreatPointsNow(Find.World));
7590
slate.Set("asker", faction.leader);
7691
Quest newQuest = QuestUtility.GenerateQuestAndMakeAvailable(DefDatabase<QuestScriptDef>.GetNamed(name), slate);
7792
QuestUtility.SendLetterQuestAvailable(newQuest);
78-
faction.lastTraderRequestTick = Find.TickManager.TicksGame;
79-
faction.TryAffectGoodwillWith(Faction.OfPlayer, -goodwill, canSendMessage: false, canSendHostilityLetter: true, "GoodwillChangedReason_RequestedIntel".Translate());
93+
ChargeGoodwill(faction, -goodwill);
8094
}
8195

8296
static void GenerateIntelIncident(Faction faction, string name, IncidentParms parms, int goodwill)
@@ -85,8 +99,7 @@ static void GenerateIntelIncident(Faction faction, string name, IncidentParms pa
8599
bool execute = incident.Worker.TryExecute(parms);
86100
if (execute)
87101
{
88-
faction.lastTraderRequestTick = Find.TickManager.TicksGame;
89-
faction.TryAffectGoodwillWith(Faction.OfPlayer, -goodwill, canSendMessage: false, canSendHostilityLetter: true, "GoodwillChangedReason_RequestedIntel".Translate());
102+
ChargeGoodwill(faction, -goodwill);
90103
} else
91104
{
92105
// It is possible to fail a incident execution, in which case we do not charge goodwill

Source/CallForIntel.csproj

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,40 @@
2121
<WarningLevel>4</WarningLevel>
2222
<Prefer32Bit>false</Prefer32Bit>
2323
</PropertyGroup>
24+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'V12|AnyCPU'">
25+
<OutputPath>bin\V12\</OutputPath>
26+
<Optimize>true</Optimize>
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<LangVersion>7.3</LangVersion>
29+
<ErrorReport>prompt</ErrorReport>
30+
<DefineConstants>V12</DefineConstants>
31+
</PropertyGroup>
32+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'V13|AnyCPU'">
33+
<OutputPath>bin\V13\</OutputPath>
34+
<Optimize>true</Optimize>
35+
<PlatformTarget>AnyCPU</PlatformTarget>
36+
<LangVersion>7.3</LangVersion>
37+
<ErrorReport>prompt</ErrorReport>
38+
<DefineConstants>V13</DefineConstants>
39+
</PropertyGroup>
2440
<ItemGroup>
25-
<Reference Include="0Harmony">
26-
<HintPath>..\..\..\..\..\..\..\_RimWorld\Harmony\net472\0Harmony.dll</HintPath>
41+
<Reference Include="0Harmony, Version=2.2.2.0, Culture=neutral, processorArchitecture=MSIL">
42+
<SpecificVersion>False</SpecificVersion>
43+
<HintPath>..\..\..\..\..\..\..\_Rimworld\0Harmony.dll</HintPath>
2744
</Reference>
2845
<Reference Include="Assembly-CSharp">
2946
<HintPath>..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
30-
<Private>False</Private>
3147
</Reference>
3248
<Reference Include="System" />
3349
<Reference Include="System.Core" />
3450
<Reference Include="System.Xml.Linq" />
3551
<Reference Include="System.Data.DataSetExtensions" />
3652
<Reference Include="System.Data" />
3753
<Reference Include="System.Xml" />
38-
<Reference Include="UnityEngine">
39-
<HintPath>..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
40-
<Private>False</Private>
41-
</Reference>
4254
<None Include="..\About\**" />
4355
<None Include="..\Common\Defs\**" />
4456
<None Include="..\Common\Languages\**" />
4557
<None Include="..\Common\Patches\**" />
46-
<Reference Include="VFE_Settlers">
47-
<HintPath>..\..\..\..\..\workshop\content\294100\2052918119\1.2\Assemblies\VFE_Settlers.dll</HintPath>
48-
</Reference>
49-
<Reference Include="Warmup">
50-
<HintPath>..\..\..\..\..\workshop\content\294100\2052918119\1.2\Assemblies\Warmup.dll</HintPath>
51-
</Reference>
5258
</ItemGroup>
5359
<ItemGroup>
5460
<Compile Include="CallForIntel.cs" />

0 commit comments

Comments
 (0)