示例#1
0
        public void SpecialPostAdd(DamageInfo?dinfo)
        {
            base.CompPostPostAdd(dinfo);

            this.parent.pawn.health.RestorePart(this.parent.Part, this.parent, false);
            for (int i = 0; i < this.parent.Part.parts.Count; i++)
            {
                if (this.parent.Part.Index == 1)
                {
                    Hediff_MissingPart hediff_MissingPart = (Hediff_MissingPart)HediffMaker.MakeHediff(HediffDefOf.MissingBodyPart, this.parent.pawn, null);
                    hediff_MissingPart.IsFresh    = true;
                    hediff_MissingPart.lastInjury = HediffDefOf.SurgicalCut;
                    hediff_MissingPart.Part       = this.parent.Part.parts[i];
                    this.parent.pawn.health.hediffSet.AddDirect(hediff_MissingPart, null, null);
                }
                else if (this.Props.generateModule)
                {
                    HediffWithComps hediff_BodyPartModule = (HediffWithComps)HediffMaker.MakeHediff(MSE_HediffDefOf.MSE_BodyPartModule, this.parent.pawn, null);
                    hediff_BodyPartModule.Part = this.parent.Part.parts[i];
                    this.parent.pawn.health.hediffSet.AddDirect(hediff_BodyPartModule, null, null);
                }
            }

            MSE_VanillaExtender.HediffApplyHediffs(this.parent, this.parent.pawn, this.parent.Part);
        }
        public override void PostAdd(DamageInfo?dinfo)
        {
            if (base.Part == null)
            {
                Log.Error("Part is null. It should be set before PostAdd for " + this.def + ".", false);
                return;
            }

            this.pawn.health.RestorePart(base.Part, this, false);
            for (int i = 0; i < base.Part.parts.Count; i++)
            {
                if (base.Part.Index == 1)
                {
                    Hediff_MissingPart hediff_MissingPart = (Hediff_MissingPart)HediffMaker.MakeHediff(HediffDefOf.MissingBodyPart, this.pawn, null);
                    hediff_MissingPart.IsFresh    = true;
                    hediff_MissingPart.lastInjury = HediffDefOf.SurgicalCut;
                    hediff_MissingPart.Part       = base.Part.parts[i];
                    this.pawn.health.hediffSet.AddDirect(hediff_MissingPart, null, null);
                }
                else
                {
                    Hediff_BodyPartModule hediff_BodyPartModule = (Hediff_BodyPartModule)HediffMaker.MakeHediff(MSE_HediffDefOf.MSE_BodyPartModule, this.pawn, null);
                    hediff_BodyPartModule.Part = base.Part.parts[i];
                    this.pawn.health.hediffSet.AddDirect(hediff_BodyPartModule, null, null);
                }
            }

            MSE_VanillaExtender.HediffApplyHediffs(this, this.pawn, base.Part);
        }
示例#3
0
        public void SpecialPostAdd(DamageInfo?dinfo)
        {
            base.CompPostPostAdd(dinfo);

            this.parent.pawn.health.RestorePart(this.parent.Part, this.parent, false);
            for (int i = 0; i < this.parent.Part.parts.Count; i++)
            {
                HediffWithComps hediff_BodyPartModule = (HediffWithComps)HediffMaker.MakeHediff(MSE_HediffDefOf.MSE_BodyPartModule, this.parent.pawn, null);
                hediff_BodyPartModule.Part = this.parent.Part.parts[i];
                this.parent.pawn.health.hediffSet.AddDirect(hediff_BodyPartModule, null, null);
            }

            MSE_VanillaExtender.HediffApplyHediffs(this.parent, this.parent.pawn, this.parent.Part);
        }
示例#4
0
        public override void PostAdd(DamageInfo?dinfo)
        {
            if (base.Part == null)
            {
                Log.Error("Part module is null. It should be set before PostAdd for " + this.def + ".", false);
                return;
            }

            this.pawn.health.RestorePart(base.Part, this, false);
            for (int i = 0; i < base.Part.parts.Count; i++)
            {
                Hediff_BodyPartModule hediff_BodyPartModule = (Hediff_BodyPartModule)HediffMaker.MakeHediff(MSE_HediffDefOf.MSE_BodyPartModule, this.pawn, null);
                hediff_BodyPartModule.Part = base.Part.parts[i];
                this.pawn.health.hediffSet.AddDirect(hediff_BodyPartModule, null, null);
            }

            MSE_VanillaExtender.HediffApplyHediffs(this, this.pawn, base.Part);
        }