Ejemplo n.º 1
0
 public void AssociateWithLog(LogEntry_DamageResult log)
 {
     if (log != null)
     {
         Pawn hitPawn = this.hitThing as Pawn;
         if (hitPawn != null)
         {
             List <BodyPartRecord> list = null;
             List <bool>           recipientPartsDestroyed = null;
             if (!this.parts.NullOrEmpty <BodyPartRecord>() && hitPawn != null)
             {
                 list = this.parts.Distinct <BodyPartRecord>().ToList <BodyPartRecord>();
                 recipientPartsDestroyed = (from part in list
                                            select hitPawn.health.hediffSet.GetPartHealth(part) <= 0f).ToList <bool>();
             }
             log.FillTargets(list, recipientPartsDestroyed, this.deflected);
         }
         if (this.hediffs != null)
         {
             for (int i = 0; i < this.hediffs.Count; i++)
             {
                 this.hediffs[i].combatLogEntry = new WeakReference <LogEntry>(log);
                 this.hediffs[i].combatLogText  = log.ToGameStringFromPOV(null, false);
             }
         }
     }
 }
Ejemplo n.º 2
0
            public void AssociateWithLog(LogEntry_DamageResult log)
            {
                if (log == null)
                {
                    return;
                }
                Pawn hitPawn = hitThing as Pawn;

                if (hitPawn != null)
                {
                    List <BodyPartRecord> list = null;
                    List <bool>           recipientPartsDestroyed = null;
                    if (!parts.NullOrEmpty() && hitPawn != null)
                    {
                        list = parts.Distinct().ToList();
                        recipientPartsDestroyed = list.Select((BodyPartRecord part) => hitPawn.health.hediffSet.GetPartHealth(part) <= 0f).ToList();
                    }
                    log.FillTargets(list, recipientPartsDestroyed, deflected);
                }
                if (hediffs != null)
                {
                    for (int i = 0; i < hediffs.Count; i++)
                    {
                        hediffs[i].combatLogEntry = new WeakReference <LogEntry>(log);
                        hediffs[i].combatLogText  = log.ToGameStringFromPOV(null);
                    }
                }
            }