Skip to content

Commit

Permalink
Added extra notices / warnings for blood extraction for vials / packs F…
Browse files Browse the repository at this point in the history
…ixes #16
  • Loading branch information
jecrell committed Jan 28, 2018
1 parent 5513fe7 commit 0114061
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
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>

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

<!-- 1-17-18 -->
<ROMV_PowerfulVampireLabel>Powerful Vampire</ROMV_PowerfulVampireLabel>
<ROMV_PowerfulVampireDesc>{0} is a {1} generation vampire. Powerful vampires tend to be extra dangerous, so tread lightly.</ROMV_PowerfulVampireDesc>
Expand Down
2 changes: 1 addition & 1 deletion Source/Vampires/Utilities/BloodItemUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static class BloodItemUtility
public static bool ExtractionWillKill(Pawn extractee, bool isBloodPack = false)
{
int amt = isBloodPack ? AMT_BLOODPACK : AMT_BLOODVIAL;
if (extractee?.BloodNeed()?.CurBloodPoints <= amt)
if (extractee?.BloodNeed() is Need_Blood bn && (bn.CurBloodPoints <= amt || bn.DrainingIsDeadly))
return true;
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions Source/Vampires/Workers/Recipe_ExtractBloodPack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeD

public override bool IsViolationOnPawn(Pawn pawn, BodyPartRecord part, Faction billDoerFaction)
{
if (BloodItemUtility.ExtractionWillKill(pawn))
if (BloodItemUtility.ExtractionWillKill(pawn, true))
{
Messages.Message("ROMV_DeadlyOperation".Translate(pawn.Label), MessageTypeDefOf.NegativeEvent);
}
Expand Down Expand Up @@ -77,7 +77,7 @@ public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer,

public override string GetLabelWhenUsedOn(Pawn pawn, BodyPartRecord part)
{
return recipe.LabelCap + " (" + BloodTypeUtility.BloodType(pawn).GetLabel() + ")";
return recipe.LabelCap + " (" + BloodTypeUtility.BloodType(pawn).GetLabel() + ")" + ((BloodItemUtility.ExtractionWillKill(pawn, true)) ? " (" + "ROMV_DeadlyOperationShort".Translate() + ")" : "");
}
}
}
2 changes: 1 addition & 1 deletion Source/Vampires/Workers/Recipe_ExtractBloodVial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer,

public override string GetLabelWhenUsedOn(Pawn pawn, BodyPartRecord part)
{
return recipe.LabelCap + " (" + BloodTypeUtility.BloodType(pawn).GetLabel() + ")";
return recipe.LabelCap + " (" + BloodTypeUtility.BloodType(pawn).GetLabel() + ")" + ((BloodItemUtility.ExtractionWillKill(pawn)) ? " (" + "ROMV_DeadlyOperationShort".Translate() + ")" : "");
}
}
}

0 comments on commit 0114061

Please sign in to comment.