Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public bool ExecutionerIsValid(Pawn preacher, FelineAspectProperties felineProps)
        {
            if (!preacher.health.hediffSet.HasHediff(felineProps.hediffToApplyToBody, false))
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 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);
        }