Skip to content

Commit

Permalink
Vamp healing and embrace now remove bad mortal hediffs Fixes #26
Browse files Browse the repository at this point in the history
  • Loading branch information
jecrell committed Jan 28, 2018
1 parent a494cc5 commit d8b8a9d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
Binary file modified Assemblies/Vampire.dll
Binary file not shown.
6 changes: 3 additions & 3 deletions Source/Vampires/Components/CompVampire.cs
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,7 @@ public void InitializeVampirism(Pawn newSire, BloodlineDef newBloodline = null,
bool firstVampire = false)
{
//Log.Message("Init");
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x is HediffVampirism_VampGiver);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.Malnutrition);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x is Hediff_Addiction);
VampireGen.RemoveMortalHediffs(AbilityUser);
VampireGen.TryGiveVampirismHediff(AbilityUser, newGeneration, newBloodline, newSire, firstVampire);
if (!firstVampire)
{
Expand Down Expand Up @@ -516,6 +514,8 @@ public void InitializeVampirism(Pawn newSire, BloodlineDef newBloodline = null,
this.Blood.CurBloodPoints = this.Blood.MaxBloodPoints;
}



public override void CompTick()
{
base.CompTick();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class DisciplineEffect_VampiricHealing : Verb_UseAbilityPawnEffect
public override void Effect(Pawn target)
{
base.Effect(target);
VampireGen.RemoveMortalHediffs(target);
VampireUtility.Heal(target);
}
}
Expand Down
26 changes: 26 additions & 0 deletions Source/Vampires/Utilities/VampireGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,32 @@ public static Pawn GenerateVampire(int generation, BloodlineDef bloodline, Pawn
//TryGiveVampirismHediff(pawn, generation, bloodline, sire, firstVampire);
return pawn;
}

/// <summary>
/// It's best to clear all of these when a vampire is initialized.
/// </summary>
public static void RemoveMortalHediffs(Pawn AbilityUser)
{
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x is HediffVampirism_VampGiver);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.Malnutrition);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x is Hediff_Addiction);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.BadBack);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.Asthma);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.Cataract);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.Carcinoma);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.Flu);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.FoodPoisoning);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.Frail);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.Heatstroke);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.Hypothermia);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.Hangover);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.Plague);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.Blindness);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.Malaria);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.ResurrectionPsychosis);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.ResurrectionSickness);
AbilityUser.health.hediffSet.hediffs.RemoveAll(x => x.def == HediffDefOf.WoundInfection);
}

}
}

0 comments on commit d8b8a9d

Please sign in to comment.