public override bool HandleEvent(GetDisplayNameEvent E) { try { if (!NeedsSynergyPrefix) { return(true); } GameObject Tail = ParentObject; GameObject Owner = Tail.Equipped; Mutations HasSynergyMutation = Owner.GetPart <Mutations>(); int Synergies = SynergyMutations.Count(HasSynergyMutation.HasMutation); if (Synergies >= 3) { return(true); } foreach (var kv in SynergyEffects) { if (HasSynergyMutation.HasMutation(kv.Key)) { E.AddBase(kv.Value.Prefix, DescriptionBuilder.ORDER_ADJUST_EARLY); } } } catch { } return(base.HandleEvent(E)); }
public override bool HandleEvent(GetDisplayNameEvent E) { if (ParentObject.Understood()) { if (XRLCore.Core.Game != null && XRLCore.Core.Game.ZoneManager != null && (NameCache == null || XRLCore.Core.Game.ZoneManager.NameUpdateTick > NameCacheTick)) { Teleporter part = ParentObject.GetPart <Teleporter>(); if (part != null) { string destinationZone = part.DestinationZone; if (!string.IsNullOrEmpty(destinationZone)) { string text = XRLCore.Core.Game.ZoneManager.GetZoneReferenceDisplayName(destinationZone); if (!string.IsNullOrEmpty(text)) { text += " "; } NameCache = text; } } NameCacheTick = XRLCore.Core.Game.ZoneManager.NameUpdateTick; } if (!string.IsNullOrEmpty(NameCache)) { string text2 = E.DB.PrimaryBase; int num = 10; if (text2 == null) { text2 = "emergency recoiler"; } else { num = E.DB[text2]; E.DB.Remove(text2); } StringBuilder stringBuilder = Event.NewStringBuilder(); stringBuilder.Append(NameCache); if (text2.StartsWith("random-point ")) { stringBuilder.Append(text2.Substring(13)); } else { stringBuilder.Append(text2); } E.AddBase(stringBuilder.ToString(), num - 10); } } return(true); }