public override void GetInfoText(StringBuilder infotext) { if (!entity.Alive) { if (entity.WatchedAttributes.HasAttribute("deathReason")) { EnumDamageSource dmgSource = (EnumDamageSource)entity.WatchedAttributes.GetInt("deathReason"); if (dmgSource == EnumDamageSource.Fall) { infotext.AppendLine(Lang.Get("Looks crushed. Won't be able to harvest as much from this carcass.")); } } string deathByEntityLangCode = entity.WatchedAttributes.GetString("deathByEntity"); if (deathByEntityLangCode != null && !entity.WatchedAttributes.HasAttribute("deathByPlayer")) { if (deathByEntityLangCode.Contains("wolf")) { infotext.AppendLine(Lang.Get("deadcreature-eaten-wolf")); } else { infotext.AppendLine(Lang.Get("deadcreature-eaten")); } } } if (AnimalWeight >= 0.95f) { infotext.AppendLine(Lang.Get("creature-weight-good")); } else if (AnimalWeight >= 0.75f) { infotext.AppendLine(Lang.Get("creature-weight-ok")); } else if (AnimalWeight >= 0.5f) { infotext.AppendLine(Lang.Get("creature-weight-low")); } else { infotext.AppendLine(Lang.Get("creature-weight-starving")); } base.GetInfoText(infotext); }
public override void GetInfoText(StringBuilder infotext) { if (!entity.Alive) { if (entity.WatchedAttributes.HasAttribute("deathReason")) { EnumDamageSource dmgSource = (EnumDamageSource)entity.WatchedAttributes.GetInt("deathReason"); if (dmgSource == EnumDamageSource.Fall) { infotext.AppendLine(Lang.Get("Looks crushed. Won't be able to harvest as much from this carcass.")); } } string deathByEntityLangCode = entity.WatchedAttributes.GetString("deathByEntity"); if (deathByEntityLangCode != null && !entity.WatchedAttributes.HasAttribute("deathByPlayer")) { infotext.AppendLine(Lang.Get("Looks eaten by another creature. Won't be able to harvest as much from this carcass.")); } } base.GetInfoText(infotext); }