Skip to content

Commit ff9bdbf

Browse files
committed
git commit from PowerShell in C#Call of Cthulhu - Cosmic Horrors Star vampires no longer show when they are hunting someone. This change should help improve tension for the arrival of star vampires.
1 parent da5b4a0 commit ff9bdbf

File tree

10 files changed

+32
-6
lines changed

10 files changed

+32
-6
lines changed

About/About.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<name>Call of Cthulhu - Cosmic Horrors</name>
44
<author>Jecrell</author>
55
<targetVersion>0.19.0</targetVersion>
6-
<description>1.19.0.4 (10-03-2018)
6+
<description>1.19.0.5 (10-09-2018)
77

88
This mod recreates the minor races of H.P. Lovecraft's weird fiction mythos in RimWorld. They behave the same as hostile factions that raid colonies such as mechanoids or insectoids. They are deadlier, however.
99

@@ -44,6 +44,10 @@ Brachiaraidos, Cory Bonifay, CrankyPeanut, E_T, Finwej, Jan Koutsky, Jonathan, K
4444
========================
4545
Changelog
4646
========================
47+
1.19.0.5 (10-09-2018)
48+
========================
49+
Star vampires no longer show when they are hunting someone. This change should help improve tension for the arrival of star vampires.
50+
4751
1.19.0.4 (10-03-2018)
4852
========================
4953
Fixes tradeability problems with cosmic horrors. Disables trade tags for CHs as well.

About/Changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
1.19.0.5 (10-09-2018)
2+
========================
3+
Star vampires no longer show when they are hunting someone. This change should help improve tension for the arrival of star vampires.
4+
15
1.19.0.4 (10-03-2018)
26
========================
37
Fixes tradeability problems with cosmic horrors. Disables trade tags for CHs as well.

About/Version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.19.0.4
1+
1.19.0.5

Assemblies/CosmicHorror.dll

512 Bytes
Binary file not shown.

Defs/PawnKindDefs_CosmicHorrors/CH_KindsStarVampire.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@
416416
<regenInterval>0</regenInterval>
417417
<sanityLossRate>0.04</sanityLossRate>
418418
<painFactor>0.5</painFactor>
419+
<huntAlert>false</huntAlert>
419420
</li>
420421
</modExtensions>
421422
</ThingDef>

Defs/ThingDefs_Races/CH_Races.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<race>
1818
<bloodDef>ROM_Filth_BloodCosmicHorror</bloodDef>
1919
<foodType>None</foodType>
20+
<trainability>None</trainability>
2021
<fleshType>ROM_StrangeFlesh</fleshType>
2122
<useMeatFrom>Bear_Grizzly</useMeatFrom>
2223
<manhunterOnDamageChance>1</manhunterOnDamageChance>

Source/CosmicHorrorPawnExtension.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace CosmicHorror
55
public class PawnExtension : DefModExtension
66
{
77
public bool invisible = false;
8+
public bool huntAlert = true;
89
public float regenRate = 0.0f;
910
public int regenInterval = 0;
1011
public float sanityLossRate = 0.03f;

Source/HarmonyCosmicHorrors.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ static HarmonyPatches()
2020
var type = typeof(HarmonyPatches);
2121
harmony.Patch(AccessTools.Method(typeof(AttackTargetFinder), nameof(AttackTargetFinder.BestAttackTarget)),
2222
new HarmonyMethod(type, nameof(BestAttackTargetPrefix)), null);
23+
harmony.Patch(AccessTools.Method(typeof(JobDriver_PredatorHunt), "CheckWarnPlayer"),
24+
new HarmonyMethod(type, nameof(CheckWarnPlayer_Prefix)), null);
2325
//harmony.Patch(AccessTools.Constructor(AccessTools.TypeByName("Wound"), new Type[] { typeof(Pawn) }), null, null, new HarmonyMethod(typeof(HarmonyPatches), nameof(WoundConstructorTranspiler)));
2426
harmony.Patch(AccessTools.Method(typeof(ThingSelectionUtility), nameof(ThingSelectionUtility.SelectableByMapClick)), null, new HarmonyMethod(type, nameof(SelectableByMapClickPostfix)));
2527
harmony.Patch(AccessTools.Method(typeof(HediffSet), "CalculatePain"), new HarmonyMethod(type, "CalculatePain_PreFix"), null);
@@ -31,6 +33,19 @@ static HarmonyPatches()
3133
new HarmonyMethod(type, nameof(GenerateStartingApparelFor_PreFix)), null, null);
3234
}
3335

36+
//JobDriver_PredatorHunt
37+
public static bool CheckWarnPlayer_Prefix(JobDriver_PredatorHunt __instance)
38+
{
39+
if (__instance?.pawn?.def != null &&
40+
__instance.pawn.def.HasModExtension<CosmicHorror.PawnExtension>()
41+
&& !__instance.pawn.def.GetModExtension<CosmicHorror.PawnExtension>().huntAlert)
42+
{
43+
Traverse.Create(__instance).Field("notifiedPlayerAttacking").SetValue(true);
44+
return false;
45+
}
46+
return true;
47+
}
48+
3449
public static bool GenerateStartingApparelFor_PreFix(Pawn pawn, PawnGenerationRequest request)
3550
{
3651
PawnExtension pawnEx = pawn?.def?.GetModExtension<PawnExtension>();

Source/obj/Debug/CosmicHorror.dll

512 Bytes
Binary file not shown.

updateinfo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
Call of Cthulhu - Cosmic Horrors Update
66
====================
7-
Version: 1.19.0.3
7+
Version: 1.19.0.4
88
Updated: 10-03-2018
9-
Description: Cosmic horrors are no longer affected by sand in eyes and other terrain hediff effects
9+
Description: Fixes tradeability problems with cosmic horrors. Disables trade tags for CHs as well.
1010
====================
1111

1212
Download now on...
@@ -25,9 +25,9 @@ Discuss the mod on...
2525
[img width=260]https://raw.githubusercontent.com/Rim-Of-Madness-Team/Call-of-Cthulhu---Cosmic-Horrors/master/About/Preview.png[/img]
2626
[hr]
2727
[b]Call of Cthulhu - Cosmic Horrors
28-
Version: 1.19.0.3
28+
Version: 1.19.0.4
2929
Updated: 10-03-2018
30-
Description: [color=orange]Cosmic horrors are no longer affected by sand in eyes and other terrain hediff effects[/color]
30+
Description: [color=orange]Fixes tradeability problems with cosmic horrors. Disables trade tags for CHs as well.[/color]
3131
[hr]
3232
[b]Download now on...[/b]
3333
[url=https://www.patreon.com/posts/cosmic-horrors-0-21060828]Patreon[/url]

0 commit comments

Comments
 (0)