Beispiel #1
0
        protected override bool TryExecuteWorker(IncidentParms parms)
        {
            Map map = parms.target as Map;

            FelineAspectProperties felineProps = def.GetModExtension <FelineAspectProperties>();

            if (felineProps != null)
            {
                //Get executioner.
                Pawn executioner = altar(map).tempExecutioner;

                if (ExecutionerIsValid(executioner, felineProps))
                {
                    //Apply Hediffs
                    //To body
                    executioner.health.AddHediff(felineProps.hediffToApplyToBody, null);

                    //To hands
                    foreach (BodyPartDef hand in felineProps.handDefs)
                    {
                        List <BodyPartRecord> records = executioner.RaceProps.body.AllParts.FindAll(part => part.def == hand);
                        if (records?.Count > 0)
                        {
                            foreach (var record in records)
                            {
                                executioner.health.AddHediff(felineProps.hediffToApplyToHands, record);
                            }
                        }
                    }
                }
            }

            return(true);
        }
Beispiel #2
0
        public bool ExecutionerIsValid(Pawn preacher, FelineAspectProperties felineProps)
        {
            if (!preacher.health.hediffSet.HasHediff(felineProps.hediffToApplyToBody, false))
            {
                return(true);
            }

            return(false);
        }
Beispiel #3
0
        public override bool CanSummonNow(Map map)
        {
            FelineAspectProperties felineProps = def.GetModExtension <FelineAspectProperties>();

            if (felineProps != null)
            {
                //Get executioner.
                Pawn executioner = altar(map).tempExecutioner;

                return(ExecutionerIsValid(executioner, felineProps));
            }

            return(false);
        }