Skip to content

Commit

Permalink
1.18.1.12
Browse files Browse the repository at this point in the history
-False notifications about powerful vampires no longer appear. Fixes #51
-Vampires with animal feeding mode no longer try to feed on visitor animals. Fixes #45
-Adds a No AI option for vampires in the vampire character menu.
  • Loading branch information
jecrell committed Apr 14, 2018
1 parent 38cd9ff commit 04e61f5
Show file tree
Hide file tree
Showing 26 changed files with 146 additions and 97 deletions.
2 changes: 1 addition & 1 deletion About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<name>Rim of Madness - Vampires</name>
<author>Jecrell</author>
<targetVersion>0.18.1722</targetVersion>
<description>V1.18.1.11
<description>V1.18.1.12
Adds vampires to RimWorld.

Heavily inspired by Vampire the Masquerade, this mod introduces a disease known as vampirism.
Expand Down
Binary file modified Assemblies/Vampire.dll
Binary file not shown.
3 changes: 3 additions & 0 deletions Languages/English/Keyed/EngROMV.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>

<!-- 3-18-18 -->
<ROMV_SP_NoAI>Sunlight Policy: No AI\coden\nThis removes all AI checks regarding sunlight.</ROMV_SP_NoAI>

<!-- 1-28-18 -->
<ROMV_DeadlyOperationShort>DEADLY</ROMV_DeadlyOperationShort>

Expand Down
2 changes: 1 addition & 1 deletion Languages/Russian/DefInjected/ThingDef/AbyssalArm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<ROMV_AbyssalArmRace.label>Абиссальная рука</ROMV_AbyssalArmRace.label>
<ROMV_AbyssalArmRace.description>Массивное темное щупальце, тянущееся из бездны.</ROMV_AbyssalArmRace.description>
<ROMV_AbyssalArmRace.tools.0.label>tentacle</ROMV_AbyssalArmRace.tools.0.label>
<ROMV_AbyssalArmRace.tools.0.label>щупальце</ROMV_AbyssalArmRace.tools.0.label>
<!-- Use Leather From: GrizzlyBear -->
<!-- Use Meat From: GrizzlyBear -->
<ROMV_AbyssalArmRace_Corpse.label>мёртвая абиссальная рука</ROMV_AbyssalArmRace_Corpse.label>
Expand Down
2 changes: 1 addition & 1 deletion Languages/Russian/DefInjected/ThingDef/ROMV_Furniture.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ROMV_RoyalCoffin_Frame.label>Роскошный гроб (постройка)</ROMV_RoyalCoffin_Frame.label>

<ROMV_RoyalCoffinDouble.label>двойной роскошный гроб</ROMV_RoyalCoffinDouble.label>
<ROMV_RoyalCoffinDouble.description>Роскошно украшенное погребальное вместилище для весьма почитаемых мертвецов. Модифицировано, чтобы пара могла отдыхать вместе. (Багги пока. Не используйте это.)</ROMV_RoyalCoffinDouble.description>
<ROMV_RoyalCoffinDouble.description>Роскошно украшенное погребальное вместилище для весьма почитаемых мертвецов. Модифицировано, чтобы пара могла отдыхать вместе. (Пока Багги. Не используйте это.)</ROMV_RoyalCoffinDouble.description>
<ROMV_RoyalCoffinDouble_Blueprint_Install.label>двойной роскошный гроб (проект)</ROMV_RoyalCoffinDouble_Blueprint_Install.label>

<ROMV_SarcophagusBed.label>спальное место</ROMV_SarcophagusBed.label>
Expand Down
2 changes: 1 addition & 1 deletion Languages/Russian/DefInjected/ThingDef/Tenebrous.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!-- Use Leather From: GrizzlyBear -->
<!-- Use Meat From: GrizzlyBear -->
<ROMV_TenebrousRace_Corpse.label>труп тени</ROMV_TenebrousRace_Corpse.label>
<ROMV_TenebrousRace_Corpse.description>Мёртаое тело тени.</ROMV_TenebrousRace_Corpse.description>
<ROMV_TenebrousRace_Corpse.description>Мёртвое тело тени.</ROMV_TenebrousRace_Corpse.description>


</LanguageData>
4 changes: 0 additions & 4 deletions Languages/Russian/DefInjected/ThingDef/WarForm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

<ROMV_WarFormRace.label>Боевая форма</ROMV_WarFormRace.label>
<ROMV_WarFormRace.description>.</ROMV_WarFormRace.description>
<!-- Use Leather From: GrizzlyBear -->
<!-- Use Meat From: GrizzlyBear -->
<ROMV_WarFormRace_Corpse.label>труп боевой формы</ROMV_WarFormRace_Corpse.label>
<ROMV_WarFormRace_Corpse.description>Мёртвое тело боевой формы.</ROMV_WarFormRace_Corpse.description>


</LanguageData>
4 changes: 0 additions & 4 deletions Languages/Russian/DefInjected/ThingDef/Zulo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

<ROMV_ZuloRace.label>Зуло</ROMV_ZuloRace.label>
<ROMV_ZuloRace.description>Зуло с искаженной плотью и костями.</ROMV_ZuloRace.description>
<!-- Use Leather From: GrizzlyBear -->
<!-- Use Meat From: GrizzlyBear -->
<ROMV_ZuloRace_Corpse.label>труп Зуло</ROMV_ZuloRace_Corpse.label>
<ROMV_ZuloRace_Corpse.description>Мёртвое тело Зуло.</ROMV_ZuloRace_Corpse.description>


</LanguageData>
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
<ROMV_ClanTremere.description>Клан Тремер широко пользуется уважением как ученые и первопроходцы, маги крови. Хотя их слава хорошо известна, но их строгая цепочка командования и аура секретности часто вызывают подозрения среди других сородичей.</ROMV_ClanTremere.description>

<ROMV_ClanLasombra.label>Ласомбра</ROMV_ClanLasombra.label>
<ROMV_ClanLasombra.description>Клан Ласомбра рассматриваются как лидеры и мистики Бездны, сама тень. Использование силы теней, безжалостной тактики и применение социального дарвинизма позволило им контролировать смертное общество на протяжении большей части досовременной истории.</ROMV_ClanLasombra.description>
<ROMV_ClanLasombra.description>Клан Ласомбра рассматриваются как лидеры и мистики Бездны, сама тень. Использование силы теней, безжалостной тактики и применение социального дарвинизма позволило им контролировать смертное общество на протяжении большей части до современной истории.</ROMV_ClanLasombra.description>

<ROMV_ClanPijavica.label>Пиджавик</ROMV_ClanPijavica.label>
<ROMV_ClanPijavica.description>Клан Пиджавика, паразиты, они ходят в симуклярах, созданных из собственной зловонной крови. Полагается, что они давно изгнаны из мира, эти пиявки выжили, прятались среди сородичей, охотясь на других вампиров, а также смертных.</ROMV_ClanPijavica.description>

<ROMV_ClanGargoyle.label>Горгульи</ROMV_ClanGargoyle.label>
<ROMV_ClanGargoyle.label>Гаргульи</ROMV_ClanGargoyle.label>
<ROMV_ClanGargoyle.description>Гаргульи - не настоящий клан, а род, созданный из магии крови Клана Тремера. Их рабы, Гаргульи обладают крыльями, способны летать и затвердевать, но страдают от чудовищного внешнего вида.</ROMV_ClanGargoyle.description>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ROMV_Auspex_RevealIllusions.label>Обнаружение иллюзии</ROMV_Auspex_RevealIllusions.label>
<ROMV_Auspex_RevealIllusions.description>Показывает иллюзии, рассеивает страдания или обнаруживает скрытые местоположения на карте.</ROMV_Auspex_RevealIllusions.description>

<ROMV_Auspex_ReadMind.label>Чтение мислей</ROMV_Auspex_ReadMind.label>
<ROMV_Auspex_ReadMind.label>Чтение мыслей</ROMV_Auspex_ReadMind.label>
<ROMV_Auspex_ReadMind.description>Читает мысли цели, узнает их следующий ход и мешает им наносить вред заклинателю используя обычные средства.</ROMV_Auspex_ReadMind.description>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ROMV_Vicissitude_ShapeMonstrosity.description>Формируя плоть, эта способность реструктурирует внутреннее существо.</ROMV_Vicissitude_ShapeMonstrosity.description>

<ROMV_Vicissitude_BecomeZulo.label>Форма зуло</ROMV_Vicissitude_BecomeZulo.label>
<ROMV_Vicissitude_BecomeZulo.description>Зуло - хитиновое чудовище, усеянное костными отростками и рогами, часто включающее другие незначительные вариации собственного дизайна Дьявола в его форму.</ROMV_Vicissitude_BecomeZulo.description>
<ROMV_Vicissitude_BecomeZulo.description>Зуло - хитиновое чудовище, усеянное костными отростками и рогами, часто включающее другие незначительные вариации собственного образа Дьявола в его форму.</ROMV_Vicissitude_BecomeZulo.description>


</LanguageData>
7 changes: 7 additions & 0 deletions Languages/Russian/Keyed/EngROMV.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>

<!-- 1-28-18 -->
<ROMV_DeadlyOperationShort>СМЕРТОНОСНЫЙ</ROMV_DeadlyOperationShort>

<!-- 1-17-18 -->
<ROMV_PowerfulVampireLabel>Могущественный вампир</ROMV_PowerfulVampireLabel>
<ROMV_PowerfulVampireDesc>вампир {0} поколения {1}. Могущественные вампиры, как правило очень опасны, так что действуйте очень осторожно.</ROMV_PowerfulVampireDesc>

<!-- 1-13-18 -->
<ROMV_HI_Pain>Боль: x{0}</ROMV_HI_Pain>
<ROMV_HI_Senses>Чувства: +{0}</ROMV_HI_Senses>
Expand Down
10 changes: 7 additions & 3 deletions Source/Vampires/AI_Jobs/JobGiver_GetBlood.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public override float GetPriority(Pawn pawn)
{
return 0f;
}

if (pawn.Drafted)
{
return 0f;
Expand All @@ -45,8 +45,8 @@ public override float GetPriority(Pawn pawn)
{
//Log.Message("0d");
return 0f;

}

//HungerCategory.Starving && FoodUtility.ShouldBeFedBySomeone(pawn))
//{
// return 0f;
Expand All @@ -55,6 +55,10 @@ public override float GetPriority(Pawn pawn)
//{
// return 0f;
//}
if (Find.World.GetComponent<WorldComponent_VampireTracker>().recentVampires?.ContainsKey(pawn) ?? false)
{
return 0f;
}
if (blood.CurLevelPercentage < blood.ShouldFeedPerc)
{
//Log.Message("0e");
Expand Down Expand Up @@ -85,7 +89,7 @@ public static Job FeedJob(Pawn pawn)
{
return null;
}
if (thing != null)
if (thing != null && thing != pawn && thing.Spawned)
{
Pawn pawn2 = thing as Pawn;
if (pawn2 != null)
Expand Down
1 change: 1 addition & 0 deletions Source/Vampires/Buttons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static class TexButton
public static readonly Texture2D ROMV_PointFull = ContentFinder<Texture2D>.Get("UI/PointFull");
public static readonly Texture2D ROMV_SunlightPolicyRestricted = ContentFinder<Texture2D>.Get("UI/Icons/SunlightPolicy/SunlightPolicyRestricted");
public static readonly Texture2D ROMV_SunlightPolicyRelaxed = ContentFinder<Texture2D>.Get("UI/Icons/SunlightPolicy/SunlightPolicyRelaxed");
public static readonly Texture2D ROMV_SunlightPolicyNoAI = ContentFinder<Texture2D>.Get("UI/Icons/SunlightPolicy/SunlightPolicyNoAI");
//public static readonly Texture2D ROMV_Ashes = ContentFinder<Texture2D>.Get("Things/Item/Resource/VampireAshes", true);
}
}
9 changes: 9 additions & 0 deletions Source/Vampires/Components/CompAntiVampireWeapon.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Verse;

namespace Vampire
{
public class CompAntiVampireWeapon : ThingComp
{
public CompProperties_AntiVampireWeapon Props => props as CompProperties_AntiVampireWeapon;
}
}
13 changes: 13 additions & 0 deletions Source/Vampires/Components/CompProperties_AntiVampireWeapon.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using RimWorld;
using Verse;

namespace Vampire
{
public class CompProperties_AntiVampireWeapon : CompProperties
{
public BodyPartDef partToParalyze = BodyPartDefOf.Heart;
public float paralysisChance = 1.0f;
public float paralysisTime = 15.0f;
public float dmgSoakIgnorePercentage = 0.5f;
}
}
3 changes: 2 additions & 1 deletion Source/Vampires/Components/CompVampire.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public enum VampState : int
public enum SunlightPolicy : int
{
Relaxed = 0,
Restricted = 1
Restricted = 1,
NoAI = 2
}


Expand Down
22 changes: 16 additions & 6 deletions Source/Vampires/HarmonyPatches/HarmonyPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ public static void Vamp_CouplesLikeBiggerCaskets(Building_Grave __instance, ref
if (__instance is Building_Coffin)
{
__result = __instance.def.size.x;
Log.Message(__instance.ToString() + " " + __result.ToString());
//Log.Message(__instance.ToString() + " " + __result.ToString());
}
}

Expand Down Expand Up @@ -795,7 +795,7 @@ public static bool Vamp_AssignToCoffin(Building_Grave __instance, Pawn pawn)
//Add assignments
if (newCoffin.AssignedPawns.Count() >= newCoffin.def.size.x)
{
Log.Message("Random unassign");
//Log.Message("Random unassign");
var pawnToRemove = newCoffin.AssignedPawns.RandomElement();
newCoffin.TryUnassignPawn(pawnToRemove);
}
Expand Down Expand Up @@ -1290,10 +1290,20 @@ public static void Vamp_EndCurrentJob(Pawn_JobTracker __instance, JobCondition c
// RimWorld.Scenario
public static void Vamp_DontGenerateVampsInDaylight(Scenario __instance, Pawn pawn, PawnGenerationContext context)
{
if (pawn.IsVampire() && VampireUtility.IsDaylight(pawn) && pawn.Faction != Faction.OfPlayerSilentFail &&
pawn?.health?.hediffSet?.hediffs is List<Hediff> hdiffs)
if (pawn.IsVampire())
{
hdiffs.RemoveAll(x => x.def == VampDefOf.ROM_Vampirism);
if (VampireUtility.IsDaylight(pawn) && pawn.Faction != Faction.OfPlayerSilentFail && pawn?.health?.hediffSet?.hediffs is List<Hediff> hdiffs)
{
hdiffs.RemoveAll(x => x.def == VampDefOf.ROM_Vampirism);
}
else
{
var recentVampires = Find.World.GetComponent<WorldComponent_VampireTracker>().recentVampires;
//Log.Message("Added " + pawn.Label + " to recent vampires list");
recentVampires?.Add(pawn, 1);


}
}
}

Expand Down Expand Up @@ -1360,7 +1370,7 @@ public static void Vamp_StopThePoopStorm(IntVec3 c, Pawn pawn, ref bool __result
// RimWorld.ForbidUtility
public static void Vamp_IsForbidden(IntVec3 c, Pawn pawn, ref bool __result)
{
if (pawn.IsVampire() && VampireUtility.IsDaylight(pawn) && !c.Roofed(pawn.Map))
if (pawn.IsVampire() && (pawn.VampComp().CurrentSunlightPolicy != SunlightPolicy.NoAI && VampireUtility.IsDaylight(pawn)) && !c.Roofed(pawn.Map))
__result = true;
}

Expand Down
15 changes: 9 additions & 6 deletions Source/Vampires/HarmonyPatches/HarmonyPatches_PathFixes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ public static partial class HarmonyPatches
// Verse.ReachabilityUtility
public static void CanReach_Vampire(ref bool __result, Pawn pawn, LocalTargetInfo dest, PathEndMode peMode, Danger maxDanger, bool canBash = false, TraverseMode mode = TraverseMode.ByPawn)
{
if (__result && pawn.IsVampire() &&
(pawn.VampComp().CurrentSunlightPolicy > SunlightPolicy.Relaxed || pawn.MentalStateDef == DefDatabase<MentalStateDef>.GetNamed("ROMV_VampireBeast")) &&
VampireUtility.IsDaylight(pawn) && pawn.Faction == Faction.OfPlayerSilentFail && !pawn.Drafted)
{
if (!dest.Cell.Roofed(pawn.MapHeld)) __result = false;
}
var inBeastMentalState = pawn?.MentalStateDef == DefDatabase<MentalStateDef>.GetNamed("ROMV_VampireBeast");
var inRestrictedSunlightAIMode = pawn?.VampComp()?.CurrentSunlightPolicy == SunlightPolicy.Restricted;
var isDaylight = VampireUtility.IsDaylight(pawn);
var isPlayerCharacter = pawn?.Faction == Faction.OfPlayerSilentFail;
var isNotDrafted = !pawn?.Drafted ?? false;
var destIsNotRoofed = !dest.Cell.Roofed(pawn?.MapHeld ?? Find.VisibleMap);
if (__result && pawn.IsVampire() &&
(inRestrictedSunlightAIMode || inBeastMentalState) &&
isDaylight && isPlayerCharacter && isNotDrafted && destIsNotRoofed) __result = false;
}

//JobGiver_GetRest
Expand Down
2 changes: 1 addition & 1 deletion Source/Vampires/ScenPart_StartingVampires.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public override void Notify_PawnGenerated(Pawn pawn, PawnGenerationContext conte
HediffVampirism_VampGiver v)
{
int gen = generationRange.RandomInRange;
Log.Message("Applied generation: " + gen);
//Log.Message("Applied generation: " + gen);
v.Generation = gen;
}
}
Expand Down
36 changes: 22 additions & 14 deletions Source/Vampires/UI/VampireCardUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,30 @@ public static void DrawVampCard(Rect rect, Pawn pawn)
if (compVampire.IsVampire)
{
Rect rectVampOptions = new Rect(CharacterCardUtility.PawnCardSize.x - 105f, 150f, 30f, 30f);
if (compVampire.CurrentSunlightPolicy == SunlightPolicy.Relaxed)
switch (compVampire.CurrentSunlightPolicy)
{
TooltipHandler.TipRegion(rectVampOptions, new TipSignal("ROMV_SP_Relaxed".Translate()));
if (Widgets.ButtonImage(rectVampOptions, TexButton.ROMV_SunlightPolicyRelaxed))
{
compVampire.CurrentSunlightPolicy = SunlightPolicy.Restricted;
}
case SunlightPolicy.Relaxed:
TooltipHandler.TipRegion(rectVampOptions, new TipSignal("ROMV_SP_Relaxed".Translate()));
if (Widgets.ButtonImage(rectVampOptions, TexButton.ROMV_SunlightPolicyRelaxed))
{
compVampire.CurrentSunlightPolicy = SunlightPolicy.Restricted;
}
break;
case SunlightPolicy.Restricted:
TooltipHandler.TipRegion(rectVampOptions, new TipSignal("ROMV_SP_Restricted".Translate()));
if (Widgets.ButtonImage(rectVampOptions, TexButton.ROMV_SunlightPolicyRestricted))
{
compVampire.CurrentSunlightPolicy = SunlightPolicy.NoAI;
}
break;
case SunlightPolicy.NoAI:
TooltipHandler.TipRegion(rectVampOptions, new TipSignal("ROMV_SP_NoAI".Translate()));
if (Widgets.ButtonImage(rectVampOptions, TexButton.ROMV_SunlightPolicyNoAI))
{
compVampire.CurrentSunlightPolicy = SunlightPolicy.Relaxed;
}
break;
}
else
{
TooltipHandler.TipRegion(rectVampOptions, new TipSignal("ROMV_SP_Restricted".Translate()));
if (Widgets.ButtonImage(rectVampOptions, TexButton.ROMV_SunlightPolicyRestricted))
{
compVampire.CurrentSunlightPolicy = SunlightPolicy.Relaxed;
}
}
}

NameTriple nameTriple = pawn.Name as NameTriple;
Expand Down
Loading

0 comments on commit 04e61f5

Please sign in to comment.