public override bool HandleEvent(GetDisplayNameEvent E) { string desc = "[{{pink|hatches in " + IncubationPeriodDuration + "}}]"; E.AddTag(desc); return(true); }
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) { try { displayNameEvents++; //MessageQueue.AddPlayerMessage($"Running GetDisplayName Event {displayNameEvents}"); if (ParentObject is null || ParentObject.IsPlayer()) { return(true); } string factionName; Faction faction; if ((factionName = ParentObject.pBrain?.GetPrimaryFaction()) != null && (faction = Factions.get(factionName)) != null && faction.Visible) { E.AddTag($"({GetFactionString(faction)})"); } if (ParentObject.IsOwned() && (factionName = ParentObject.Owner) != null && (faction = Factions.get(ParentObject.Owner)) != null && faction.Visible) { //MessageQueue.AddPlayerMessage("Getting Owner baybee"); E.AddTag($"[{GetFactionString(faction)}]"); } } catch (Exception ex) { Debug.LogError("Failed to add Faction info to display name with exception: \n " + ex); } return(true); }
public override bool HandleEvent(GetDisplayNameEvent E) { if (this.stage > 0) { E.AddClause("&y[" + debugstring() + "&y]"); } return(true); }
public override bool HandleEvent(GetDisplayNameEvent E) { if (CheckConstrictedBy()) { E.AddTag("&y[{{green|constricted by " + ConstrictedBy.a + ConstrictedBy.DisplayNameOnly + "}}]", 0); } return(true); }
public override bool HandleEvent(GetDisplayNameEvent E) { if (base.Object.GetEffect(base.ClassName) == this) { E.AddTag("[{{C|submerged}}]"); } return(true); }
public override bool HandleEvent(GetDisplayNameEvent E) { if (!ParentObject.Understood() || !ParentObject.HasProperName) { E.AddAdjective("{{psionic|psionic}}"); } return(true); }
public override bool HandleEvent(GetDisplayNameEvent E) { try { UpdateCharges(); } catch { UpdateCharges(); } return(true); }
public override bool HandleEvent(GetDisplayNameEvent E) { if (ParentObject.GetPart <Inventory>() != null && ParentObject.GetPart <Inventory>().Objects.Count() > 0) { int count = 0; foreach (GameObject GO in ParentObject.GetPart <Inventory>().GetObjects()) { count += GO.Count; } E.AddClause(" &y[" + count + " items]"); } return(true); }
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); }