public override void PawnDied(Corpse corpse) { for (int i = 0; i < 3; i++) { MoteMaker.ThrowSmoke(corpse.DrawPos, corpse.Map, Rand.Range(.5f, 1.1f)); } TM_MoteMaker.ThrowGenericMote(TorannMagicDefOf.Mote_Ghost, corpse.DrawPos, corpse.Map, 1f, .25f, 0f, .25f, 0, Rand.Range(2f, 3f), 0, 0); //MoteMaker.ThrowHeatGlow(corpse.Position, corpse.Map, 1f); List <Thing> rewards = new List <Thing>(); Thing arcalleum = ThingMaker.MakeThing(TorannMagicDefOf.TM_Arcalleum, null); if (corpse.Faction != Faction.OfPlayer) { if (corpse.InnerPawn.def == TorannMagicDefOf.TM_SkeletonR) { arcalleum.stackCount = Rand.Range(4, 8); rewards.Add(arcalleum); } else if (corpse.InnerPawn.def == TorannMagicDefOf.TM_GiantSkeletonR) { arcalleum.stackCount = Rand.Range(25, 60); rewards.Add(arcalleum); } else if (corpse.InnerPawn.def == TorannMagicDefOf.TM_SkeletonLichR) { arcalleum.stackCount = Rand.Range(40, 80); rewards.Add(arcalleum); Thing tome = ThingMaker.MakeThing(TM_Data.MageBookList().RandomElement(), null); tome.stackCount = 1; rewards.Add(tome); ItemCollectionGenerator_Internal_Arcane icg = new ItemCollectionGenerator_Internal_Arcane(); List <Thing> icgThings = new List <Thing>(); icgThings = icg.Generate(2000, icgThings); rewards.AddRange(icgThings); } for (int i = 0; i < rewards.Count; i++) { GenPlace.TryPlaceThing(rewards[i], corpse.Position, corpse.Map, ThingPlaceMode.Near); } } corpse.Destroy(); }
protected override bool TryCastShot() { Pawn caster = base.CasterPawn; Pawn pawn = this.currentTarget.Thing as Pawn; CompAbilityUserMagic comp = pawn.TryGetComp <CompAbilityUserMagic>(); bool flag = pawn != null; if (flag) { int num = 1; if (!pawn.DestroyedOrNull() && pawn.health != null || pawn.health.hediffSet != null && !pawn.Dead) { bool success = false; List <TMDefs.TM_CategoryHediff> mechaniteList = HediffCategoryList.Named("TM_Category_Hediffs").mechanites; using (IEnumerator <Hediff> enumerator = pawn.health.hediffSet.GetHediffs <Hediff>().GetEnumerator()) { while (enumerator.MoveNext()) { Hediff rec = enumerator.Current; bool flag2 = num > 0; if (TM_Data.MechaniteList().Contains(rec.def)) { foreach (TMDefs.TM_CategoryHediff chd in mechaniteList) { if (chd.hediffDefname.Contains(rec.def.defName)) { if (comp != null) { if (chd.requiredSkillName != "TM_Purify_ver") { verVal = comp.MagicData.AllMagicPowerSkills.FirstOrDefault((MagicPowerSkill x) => x.label == chd.requiredSkillName).level; } if (chd.powerSkillName != "TM_Purify_pwr") { pwrVal = comp.MagicData.AllMagicPowerSkills.FirstOrDefault((MagicPowerSkill x) => x.label == chd.powerSkillName).level; } } if (verVal >= chd.requiredSkillLevel) { if (chd.removeOnCure) { if (Rand.Chance((chd.chanceToRemove + (chd.powerSkillAdjustment * pwrVal)) * arcaneDmg)) { pawn.health.RemoveHediff(rec); if (chd.replacementHediffDefname != "") { HealthUtility.AdjustSeverity(pawn, HediffDef.Named(chd.replacementHediffDefname), chd.replacementHediffSeverity); } success = true; num--; break; } else { MoteMaker.ThrowText(pawn.DrawPos, pawn.Map, "Failed to remove " + rec.Label + " ..."); } break; } else { rec.Severity -= ((chd.severityReduction + (chd.powerSkillAdjustment * pwrVal)) * arcaneDmg); if ((rec.Severity < 0)) { if (chd.replacementHediffDefname != "") { HealthUtility.AdjustSeverity(pawn, HediffDef.Named(chd.replacementHediffDefname), chd.replacementHediffSeverity); } } success = true; num--; break; } } } } } else { if (rec.def.defName == "SensoryMechanites") { pawn.health.RemoveHediff(rec); HealthUtility.AdjustSeverity(pawn, TorannMagicDefOf.TM_ReprogrammedSenMechanites_HD, .001f); num--; success = true; break; } else if (rec.def.defName == "FibrousMechanites") { pawn.health.RemoveHediff(rec); HealthUtility.AdjustSeverity(pawn, TorannMagicDefOf.TM_ReprogrammedFibMechanites_HD, .001f); num--; success = true; break; } else if (rec.def.defName == "LymphaticMechanites") { pawn.health.RemoveHediff(rec); HealthUtility.AdjustSeverity(pawn, TorannMagicDefOf.TM_ReprogrammedLymMechanites_HD, .001f); num--; success = true; break; } } } } if (success) { TM_MoteMaker.ThrowRegenMote(pawn.Position.ToVector3(), pawn.Map, 1.5f); MoteMaker.ThrowText(pawn.DrawPos, pawn.Map, "Mechanite Reprogramming" + ": " + StringsToTranslate.AU_CastSuccess, -1f); } else { Messages.Message("TM_CureDiseaseTypeFail".Translate(), MessageTypeDefOf.NegativeEvent); MoteMaker.ThrowText(pawn.DrawPos, pawn.Map, "Mechanite Reprogramming" + ": " + StringsToTranslate.AU_CastFailure, -1f); } } else { MoteMaker.ThrowText(pawn.DrawPos, pawn.Map, "Mechanite Reprogramming" + ": " + StringsToTranslate.AU_CastFailure, -1f); } } return(false); }
protected override bool TryCastShot() { Pawn caster = base.CasterPawn; Pawn pawn = this.currentTarget.Thing as Pawn; CompAbilityUserMagic comp = caster.TryGetComp <CompAbilityUserMagic>(); MagicPowerSkill pwr = comp.MagicData.MagicPowerSkill_CureDisease.FirstOrDefault((MagicPowerSkill x) => x.label == "TM_CureDisease_pwr"); MagicPowerSkill ver = comp.MagicData.MagicPowerSkill_CureDisease.FirstOrDefault((MagicPowerSkill x) => x.label == "TM_CureDisease_ver"); verVal = ver.level; pwrVal = pwr.level; this.arcaneDmg = caster.GetComp <CompAbilityUserMagic>().arcaneDmg; if (caster.story.traits.HasTrait(TorannMagicDefOf.Faceless)) { MightPowerSkill mpwr = caster.GetComp <CompAbilityUserMight>().MightData.MightPowerSkill_Mimic.FirstOrDefault((MightPowerSkill x) => x.label == "TM_Mimic_pwr"); MightPowerSkill mver = caster.GetComp <CompAbilityUserMight>().MightData.MightPowerSkill_Mimic.FirstOrDefault((MightPowerSkill x) => x.label == "TM_Mimic_ver"); pwrVal = mpwr.level; verVal = mver.level; } bool flag = pawn != null; if (flag) { int num = 1; float sevAdjustment = 0; if (pwrVal >= 2) { //apply immunity buff, 60k ticks in a day if (pwrVal == 3) { HealthUtility.AdjustSeverity(pawn, TorannMagicDefOf.TM_DiseaseImmunity2HD, 5); pawn.health.hediffSet.GetFirstHediffOfDef(TorannMagicDefOf.TM_DiseaseImmunity2HD).TryGetComp <HediffComp_DiseaseImmunity>().verVal = verVal; } else { HealthUtility.AdjustSeverity(pawn, TorannMagicDefOf.TM_DiseaseImmunityHD, 3); } } if (pwrVal >= 1) { sevAdjustment = 5; } else { sevAdjustment = (Rand.Range(0f, 1f) * this.arcaneDmg); } if (sevAdjustment >= .25f) { bool success = false; using (IEnumerator <Hediff> enumerator = pawn.health.hediffSet.GetHediffs <Hediff>().GetEnumerator()) { while (enumerator.MoveNext()) { Hediff rec = enumerator.Current; bool flag2 = num > 0; if (TM_Data.AddictionList().Contains(rec.def)) { List <TMDefs.TM_CategoryHediff> diseaseList = HediffCategoryList.Named("TM_Category_Hediffs").diseases; foreach (TMDefs.TM_CategoryHediff chd in diseaseList) { if (chd.hediffDefname.Contains(rec.def.defName)) { if (comp != null && chd.requiredSkillName != "TM_Purify_ver") { pwrVal = comp.MagicData.AllMagicPowerSkills.FirstOrDefault((MagicPowerSkill x) => x.label == chd.powerSkillName).level; verVal = comp.MagicData.AllMagicPowerSkills.FirstOrDefault((MagicPowerSkill x) => x.label == chd.requiredSkillName).level; } if (verVal >= chd.requiredSkillLevel) { if (chd.removeOnCure) { if (Rand.Chance((chd.chanceToRemove + (chd.powerSkillAdjustment * pwrVal)) * arcaneDmg)) { pawn.health.RemoveHediff(rec); if (chd.replacementHediffDefname != "") { HealthUtility.AdjustSeverity(pawn, HediffDef.Named(chd.replacementHediffDefname), chd.replacementHediffSeverity); } success = true; num--; } else { MoteMaker.ThrowText(pawn.DrawPos, pawn.Map, "Failed to remove " + rec.Label + " ..."); } break; } else { if (((rec.Severity - (chd.severityReduction + (chd.powerSkillAdjustment * pwrVal)) * arcaneDmg <= 0))) { if (chd.replacementHediffDefname != "") { HealthUtility.AdjustSeverity(pawn, HediffDef.Named(chd.replacementHediffDefname), chd.replacementHediffSeverity); } success = true; } rec.Severity -= ((chd.severityReduction + (chd.powerSkillAdjustment * pwrVal)) * arcaneDmg); num--; break; } } } } } else { if (rec.def.defName == "WoundInfection" || rec.def.defName.Contains("Flu") || rec.def.defName == "Animal_Flu" || rec.def.defName.Contains("Infection")) { //rec.Severity -= sevAdjustment; pawn.health.RemoveHediff(rec); success = true; } if (verVal >= 1 && (rec.def.defName == "GutWorms" || rec.def == HediffDefOf.Malaria || rec.def == HediffDefOf.FoodPoisoning)) { //rec.Severity -= sevAdjustment; pawn.health.RemoveHediff(rec); success = true; } if (verVal >= 2 && (rec.def.defName == "SleepingSickness" || rec.def.defName == "MuscleParasites") || rec.def == HediffDefOf.Scaria) { //rec.Severity -= sevAdjustment; pawn.health.RemoveHediff(rec); success = true; } if (verVal == 3 && (rec.def.makesSickThought && rec.def.isBad)) { //rec.Severity -= sevAdjustment; if (rec.def.defName == "BloodRot") { rec.Severity = 0.01f; MoteMaker.ThrowText(pawn.DrawPos, pawn.Map, "Tended Blood Rot", -1f); rec.Tended_NewTemp(1f, 1f); TM_MoteMaker.ThrowRegenMote(pawn.Position.ToVector3(), pawn.Map, 1.5f); return(false); } else if (rec.def.defName == "Abasia") { //do nothing } else { pawn.health.RemoveHediff(rec); success = true; } } } if (success) { break; } } } if (success == true) { TM_MoteMaker.ThrowRegenMote(pawn.Position.ToVector3(), pawn.Map, 1.5f); MoteMaker.ThrowText(pawn.DrawPos, pawn.Map, "Cure Disease" + ": " + StringsToTranslate.AU_CastSuccess, -1f); } else { Messages.Message("TM_CureDiseaseTypeFail".Translate(), MessageTypeDefOf.NegativeEvent); MoteMaker.ThrowText(pawn.DrawPos, pawn.Map, "Cure Disease" + ": " + StringsToTranslate.AU_CastFailure, -1f); } } else { MoteMaker.ThrowText(pawn.DrawPos, pawn.Map, "Cure Disease" + ": " + StringsToTranslate.AU_CastFailure, -1f); } } return(false); }
public static List <Thing> Generate(int totalMarketValue) { List <Thing> outThings = new List <Thing>(); outThings.Clear(); for (int j = 0; j < 10; j++) { //Torn Scripts if (Rand.Chance(0.3f) && (totalMarketValue - collectiveMarketValue) > TorannMagicDefOf.Torn_BookOfArcanist.BaseMarketValue * .8f) { Thing thing = ThingMaker.MakeThing(TM_Data.MageTornScriptList().RandomElement(), null); if (thing != null) { outThings.Add(thing); collectiveMarketValue += thing.MarketValue; } } //Arcane Scripts if (Rand.Chance(ArcaneScriptChance) && (totalMarketValue - collectiveMarketValue) > TorannMagicDefOf.BookOfArcanist.BaseMarketValue * .8f) { Thing thing = ThingMaker.MakeThing(TM_Data.AllBooksList().RandomElement(), null); if (thing != null) { outThings.Add(thing); collectiveMarketValue += thing.MarketValue; } } //Mana Potions if (Rand.Chance(0.2f) && (totalMarketValue - collectiveMarketValue) > TorannMagicDefOf.ManaPotion.BaseMarketValue * ManaPotionRange.RandomInRange) { int randomInRange = ManaPotionRange.RandomInRange; for (int i = 0; i < randomInRange; i++) { Thing thing = ThingMaker.MakeThing(TorannMagicDefOf.ManaPotion, null); thing.stackCount = ManaPotionRange.RandomInRange; outThings.Add(thing); collectiveMarketValue += thing.MarketValue * thing.stackCount; } } //Gemstones if (Rand.Chance(GemstoneChance) && (totalMarketValue - collectiveMarketValue) > 1000f) { int randomInRange = GemstoneCountRange.RandomInRange; for (int i = 0; i < randomInRange; i++) { List <Thing> gemstoneZero = new List <Thing>(); Thing item = null; ItemCollectionGenerator_Gemstones icg_g = new ItemCollectionGenerator_Gemstones(); icg_g.Generate(1000, gemstoneZero); item = gemstoneZero[0]; if (item != null) { outThings.Add(item); collectiveMarketValue += item.MarketValue; } } } //Syrrium if (Rand.Chance(LuciferiumChance) && (totalMarketValue - collectiveMarketValue) > TorannMagicDefOf.TM_Syrrium.BaseMarketValue * LuciferiumCountRange.RandomInRange) { Thing thing = ThingMaker.MakeThing(TorannMagicDefOf.TM_Syrrium, null); thing.stackCount = LuciferiumCountRange.RandomInRange; outThings.Add(thing); collectiveMarketValue += thing.MarketValue * thing.stackCount; } //Raw Magicyte if (Rand.Chance(DrugChance)) { Thing thing = ThingMaker.MakeThing(TorannMagicDefOf.RawMagicyte, null); thing.stackCount = RawMagicyteRange.RandomInRange; outThings.Add(thing); collectiveMarketValue += thing.MarketValue * thing.stackCount; } //Master Spells if (Rand.Chance(MasterSpellChance) && (totalMarketValue - collectiveMarketValue) > TorannMagicDefOf.SpellOf_Blizzard.BaseMarketValue) { Thing thing = ThingMaker.MakeThing(TM_Data.MasterSpellList().RandomElement(), null); if (thing != null) { outThings.Add(thing); collectiveMarketValue += thing.MarketValue; } } //Spells if (Rand.Chance(SpellChance) && (totalMarketValue - collectiveMarketValue) > 1000f) { Thing thing = ThingMaker.MakeThing(TM_Data.StandardSpellList().RandomElement(), null); if (thing != null) { outThings.Add(thing); collectiveMarketValue += thing.MarketValue; } } //Skills if (Rand.Chance(SpellChance) && (totalMarketValue - collectiveMarketValue) > 800f) { int randomInRange = SkillCountRange.RandomInRange; Thing thing = ThingMaker.MakeThing(TM_Data.StandardSkillList().RandomElement(), null); if (thing != null) { outThings.Add(thing); collectiveMarketValue += thing.MarketValue; } } } return(outThings); }
protected override bool TryCastShot() { Pawn caster = this.CasterPawn; Pawn pawn = this.currentTarget.Thing as Pawn; CompAbilityUserMagic comp = caster.GetComp <CompAbilityUserMagic>(); if (comp != null && !caster.story.traits.HasTrait(TorannMagicDefOf.Faceless)) { MagicPowerSkill pwr = comp.MagicData.MagicPowerSkill_Purify.FirstOrDefault((MagicPowerSkill x) => x.label == "TM_Purify_pwr"); MagicPowerSkill ver = comp.MagicData.MagicPowerSkill_Purify.FirstOrDefault((MagicPowerSkill x) => x.label == "TM_Purify_ver"); pwrVal = pwr.level; verVal = ver.level; arcaneDmg = comp.arcaneDmg; } else if (caster.story.traits.HasTrait(TorannMagicDefOf.Faceless)) { MightPowerSkill mpwr = caster.GetComp <CompAbilityUserMight>().MightData.MightPowerSkill_Mimic.FirstOrDefault((MightPowerSkill x) => x.label == "TM_Mimic_pwr"); MightPowerSkill mver = caster.GetComp <CompAbilityUserMight>().MightData.MightPowerSkill_Mimic.FirstOrDefault((MightPowerSkill x) => x.label == "TM_Mimic_ver"); pwrVal = mpwr.level; verVal = mver.level; arcaneDmg = caster.GetComp <CompAbilityUserMight>().mightPwr; } bool flag = pawn != null && !pawn.Dead; if (flag) { int num = Mathf.RoundToInt(1f + (.4f * verVal)); using (IEnumerator <BodyPartRecord> enumerator = pawn.health.hediffSet.GetInjuredParts().GetEnumerator()) { while (enumerator.MoveNext()) { BodyPartRecord rec = enumerator.Current; bool flag2 = num > 0; if (flag2) { int num2 = 1 + verVal; IEnumerable <Hediff_Injury> arg_BB_0 = pawn.health.hediffSet.GetHediffs <Hediff_Injury>(); Func <Hediff_Injury, bool> arg_BB_1; arg_BB_1 = ((Hediff_Injury injury) => injury.Part == rec); foreach (Hediff_Injury current in arg_BB_0.Where(arg_BB_1)) { bool flag4 = num2 > 0; if (flag4) { bool flag5 = !current.CanHealNaturally() && current.IsPermanent(); if (flag5) { if (rec.def.tags.Contains(BodyPartTagDefOf.ConsciousnessSource)) { if (pwrVal >= 1) { current.Heal(pwrVal * arcaneDmg); num--; num2--; } } else { current.Heal((2f + pwrVal * 2) * arcaneDmg); //current.Heal(5.0f + (float)pwrVal * 3f); // power affects how much to heal num--; num2--; } TM_MoteMaker.ThrowRegenMote(pawn.Position.ToVector3Shifted(), pawn.Map, .6f); TM_MoteMaker.ThrowRegenMote(pawn.Position.ToVector3Shifted(), pawn.Map, .4f); } } } } } } //if (pawn.RaceProps.Humanlike) //{ using (IEnumerator <Hediff> enumerator = pawn.health.hediffSet.GetHediffs <Hediff>().GetEnumerator()) { while (enumerator.MoveNext()) { Hediff rec = enumerator.Current; bool flag2 = num > 0; if (flag2) { if (TM_Data.AilmentList().Contains(rec.def)) { List <TMDefs.TM_CategoryHediff> ailmentList = HediffCategoryList.Named("TM_Category_Hediffs").ailments; foreach (TMDefs.TM_CategoryHediff chd in ailmentList) { if (chd.hediffDefname.Contains(rec.def.defName)) { pwrVal = comp.MagicData.AllMagicPowerSkills.FirstOrDefault((MagicPowerSkill x) => x.label == chd.powerSkillName).level; verVal = comp.MagicData.AllMagicPowerSkills.FirstOrDefault((MagicPowerSkill x) => x.label == chd.requiredSkillName).level; if (verVal >= chd.requiredSkillLevel) { if (chd.removeOnCure) { if (Rand.Chance((chd.chanceToRemove + (chd.powerSkillAdjustment * pwrVal)) * arcaneDmg)) { pawn.health.RemoveHediff(rec); if (chd.replacementHediffDefname != "") { HealthUtility.AdjustSeverity(pawn, HediffDef.Named(chd.replacementHediffDefname), chd.replacementHediffSeverity); } num--; } else { MoteMaker.ThrowText(pawn.DrawPos, pawn.Map, "Failed to remove " + rec.Label + " ..."); } break; } else { if ((rec.Severity - (chd.severityReduction + (chd.powerSkillAdjustment * pwrVal)) * arcaneDmg) <= 0 && chd.replacementHediffDefname != "") { HealthUtility.AdjustSeverity(pawn, HediffDef.Named(chd.replacementHediffDefname), chd.replacementHediffSeverity); } rec.Heal((chd.severityReduction + (chd.powerSkillAdjustment * pwrVal)) * arcaneDmg); num--; } } } } } else { if (rec.def.defName == "Cataract" || rec.def.defName == "HearingLoss" || rec.def.defName.Contains("ToxicBuildup")) { rec.Heal(.4f + .3f * pwrVal); num--; } if ((rec.def.defName == "Blindness" || rec.def.defName.Contains("Asthma") || rec.def.defName == "Cirrhosis" || rec.def.defName == "ChemicalDamageModerate") && verVal >= 1) { rec.Heal(.3f + .2f * pwrVal); if (rec.def.defName.Contains("Asthma")) { pawn.health.RemoveHediff(rec); } num--; } if ((rec.def.defName == "Frail" || rec.def.defName == "BadBack" || rec.def.defName.Contains("Carcinoma") || rec.def.defName == "ChemicalDamageSevere") && verVal >= 2) { rec.Heal(.25f + .2f * pwrVal); num--; } if ((rec.def.defName.Contains("Alzheimers") || rec.def.defName == "Dementia" || rec.def.defName.Contains("HeartArteryBlockage") || rec.def.defName == "PsychicShock" || rec.def.defName == "CatatonicBreakdown") && verVal >= 3) { rec.Heal(.15f + .15f * pwrVal); num--; } if (rec.def.defName.Contains("Abasia") && verVal >= 3) { if (Rand.Chance(.25f + (.05f * pwrVal))) { pawn.health.RemoveHediff(pawn.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("Abasia"))); num--; } else { MoteMaker.ThrowText(pawn.DrawPos, pawn.Map, "Failed to remove Abasia..."); } } } TM_MoteMaker.ThrowRegenMote(pawn.Position.ToVector3Shifted(), pawn.Map, .6f); TM_MoteMaker.ThrowRegenMote(pawn.Position.ToVector3Shifted(), pawn.Map, .4f); } } } //} using (IEnumerator <Hediff_Addiction> enumerator = pawn.health.hediffSet.GetHediffs <Hediff_Addiction>().GetEnumerator()) { while (enumerator.MoveNext()) { Hediff_Addiction rec = enumerator.Current; bool flag2 = num > 0; if (flag2) { if (TM_Data.AddictionList().Contains(rec.def)) { List <TMDefs.TM_CategoryHediff> addictionList = HediffCategoryList.Named("TM_Category_Hediffs").addictions; foreach (TMDefs.TM_CategoryHediff chd in addictionList) { if (chd.hediffDefname.Contains(rec.def.defName)) { pwrVal = comp.MagicData.AllMagicPowerSkills.FirstOrDefault((MagicPowerSkill x) => x.label == chd.powerSkillName).level; verVal = comp.MagicData.AllMagicPowerSkills.FirstOrDefault((MagicPowerSkill x) => x.label == chd.requiredSkillName).level; if (verVal >= chd.requiredSkillLevel) { if (chd.removeOnCure) { if (Rand.Chance((chd.chanceToRemove + (chd.powerSkillAdjustment * pwrVal)) * arcaneDmg)) { pawn.health.RemoveHediff(rec); if (chd.replacementHediffDefname != "") { HealthUtility.AdjustSeverity(pawn, HediffDef.Named(chd.replacementHediffDefname), chd.replacementHediffSeverity); } num--; } else { MoteMaker.ThrowText(pawn.DrawPos, pawn.Map, "Failed to remove " + rec.Label + " ..."); } break; } else { if (rec.Chemical.defName == "Luciferium" && ((rec.Severity - (chd.severityReduction + (chd.powerSkillAdjustment * pwrVal)) * arcaneDmg <= 0))) { Hediff luciHigh = pawn.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("LuciferiumHigh"), false); pawn.health.RemoveHediff(luciHigh); } rec.Severity -= ((chd.severityReduction + (chd.powerSkillAdjustment * pwrVal)) * arcaneDmg); num--; } } } } } else { if (rec.Chemical.defName == "Alcohol" || rec.Chemical.defName == "Smokeleaf") { rec.Severity -= ((.3f + .3f * pwrVal) * arcaneDmg); num--; } if ((rec.Chemical.defName == "GoJuice" || rec.Chemical.defName == "WakeUp") && verVal >= 1) { rec.Severity -= ((.25f + .25f * pwrVal) * arcaneDmg); num--; } if (rec.Chemical.defName == "Psychite" && verVal >= 2) { rec.Severity -= ((.25f + .25f * pwrVal) * arcaneDmg); num--; } if (verVal >= 3) { if (rec.Chemical.defName == "Luciferium" && (rec.Severity - ((.15f + .15f * pwrVal) * arcaneDmg) < 0)) { Hediff luciHigh = pawn.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("LuciferiumHigh"), false); pawn.health.RemoveHediff(luciHigh); } rec.Severity -= ((.15f + .15f * pwrVal) * arcaneDmg); num--; } } TM_MoteMaker.ThrowRegenMote(pawn.Position.ToVector3Shifted(), pawn.Map, .6f); TM_MoteMaker.ThrowRegenMote(pawn.Position.ToVector3Shifted(), pawn.Map, .4f); } } } } return(true); }