public static string OnModuleExamine(string existingDescription, NWObject examinedObject) { if (examinedObject.ObjectType != ObjectType.Item) { return(existingDescription); } NWItem examinedItem = (examinedObject.Object); if (examinedItem.GetLocalFloat("DURABILITY_MAX") <= 0f) { return(existingDescription); } string description = ColorTokenService.Orange("Durability: "); float durability = GetDurability(examinedItem); if (durability <= 0.0f) { description += ColorTokenService.Red(Convert.ToString(durability)); } else { description += ColorTokenService.White(FormatDurability(durability)); } description += ColorTokenService.White(" / " + FormatDurability(GetMaxDurability(examinedItem))); return(existingDescription + "\n\n" + description); }
public static string OnModuleExamine(string existingDescription, NWObject examinedObject) { int plantID = examinedObject.GetLocalInt("PLANT_ID"); if (plantID <= 0) { return(existingDescription); } if (examinedObject.ObjectType != _.OBJECT_TYPE_ITEM) { return(existingDescription); } Plant plant = DataService.SingleOrDefault <Plant>(x => x.ID == plantID); if (plant == null) { return(existingDescription); } existingDescription += ColorTokenService.Orange("This item can be planted. Farming skill required: " + plant.Level) + "\n\n"; return(existingDescription); }
private static void OnModuleNWNXChat() { ChatChannelType channel = (ChatChannelType)NWNXChat.GetChannel(); // So we're going to play with a couple of channels here. // - PlayerTalk, PlayerWhisper, PlayerParty, and PlayerShout are all IC channels. These channels // are subject to emote colouring and language translation. (see below for more info). // - PlayerParty is an IC channel with special behaviour. Those outside of the party but within // range may listen in to the party chat. (see below for more information). // - PlayerShout sends a holocom message server-wide through the DMTell channel. // - PlayerDM echoes back the message received to the sender. bool inCharacterChat = channel == ChatChannelType.PlayerTalk || channel == ChatChannelType.PlayerWhisper || channel == ChatChannelType.PlayerParty || channel == ChatChannelType.PlayerShout; bool messageToDm = channel == ChatChannelType.PlayerDM; if (!inCharacterChat && !messageToDm) { // We don't much care about traffic on the other channels. return; } NWObject sender = NWNXChat.GetSender(); string message = NWNXChat.GetMessage().Trim(); if (string.IsNullOrWhiteSpace(message)) { // We can't handle empty messages, so skip it. return; } if (ChatCommandService.CanHandleChat(sender, message) || BaseService.CanHandleChat(sender) || CraftService.CanHandleChat(sender) || MarketService.CanHandleChat(sender.Object) || MessageBoardService.CanHandleChat(sender) || ItemService.CanHandleChat(sender)) { // This will be handled by other services, so just bail. return; } if (channel == ChatChannelType.PlayerDM) { // Simply echo the message back to the player. NWNXChat.SendMessage((int)ChatChannelType.ServerMessage, "(Sent to DM) " + message, sender, sender); return; } // At this point, every channel left is one we want to manually handle. NWNXChat.SkipMessage(); // If this is a shout message, and the holonet is disabled, we disallow it. if (channel == ChatChannelType.PlayerShout && sender.IsPC && sender.GetLocalInt("DISPLAY_HOLONET") == FALSE) { NWPlayer player = sender.Object; player.SendMessage("You have disabled the holonet and cannot send this message."); return; } List <ChatComponent> chatComponents; // Quick early out - if we start with "//" or "((", this is an OOC message. bool isOOC = false; if (message.Length >= 2 && (message.Substring(0, 2) == "//" || message.Substring(0, 2) == "((")) { ChatComponent component = new ChatComponent { m_Text = message, m_CustomColour = true, m_ColourRed = 64, m_ColourGreen = 64, m_ColourBlue = 64, m_Translatable = false }; chatComponents = new List <ChatComponent> { component }; if (channel == ChatChannelType.PlayerShout) { _.SendMessageToPC(sender, "Out-of-character messages cannot be sent on the Holonet."); return; } isOOC = true; } else { if (EmoteStyleService.GetEmoteStyle(sender) == EmoteStyle.Regular) { chatComponents = SplitMessageIntoComponents_Regular(message); } else { chatComponents = SplitMessageIntoComponents_Novel(message); } // For any components with colour, set the emote colour. foreach (ChatComponent component in chatComponents) { if (component.m_CustomColour) { component.m_ColourRed = 0; component.m_ColourGreen = 255; component.m_ColourBlue = 0; } } } // Now, depending on the chat channel, we need to build a list of recipients. bool needsAreaCheck = false; float distanceCheck = 0.0f; // The sender always wants to see their own message. List <NWObject> recipients = new List <NWObject> { sender }; // This is a server-wide holonet message (that receivers can toggle on or off). if (channel == ChatChannelType.PlayerShout) { recipients.AddRange(NWModule.Get().Players.Where(player => player.GetLocalInt("DISPLAY_HOLONET") == TRUE)); recipients.AddRange(AppCache.ConnectedDMs); } // This is the normal party chat, plus everyone within 20 units of the sender. else if (channel == ChatChannelType.PlayerParty) { // Can an NPC use the playerparty channel? I feel this is safe ... NWPlayer player = sender.Object; recipients.AddRange(player.PartyMembers.Cast <NWObject>().Where(x => x != sender)); recipients.AddRange(AppCache.ConnectedDMs); needsAreaCheck = true; distanceCheck = 20.0f; } // Normal talk - 20 units. else if (channel == ChatChannelType.PlayerTalk) { needsAreaCheck = true; distanceCheck = 20.0f; } // Whisper - 4 units. else if (channel == ChatChannelType.PlayerWhisper) { needsAreaCheck = true; distanceCheck = 4.0f; } if (needsAreaCheck) { recipients.AddRange(sender.Area.Objects.Where(obj => obj.IsPC && _.GetDistanceBetween(sender, obj) <= distanceCheck)); recipients.AddRange(AppCache.ConnectedDMs.Where(dm => dm.Area == sender.Area && _.GetDistanceBetween(sender, dm) <= distanceCheck)); } // Now we have a list of who is going to actually receive a message, we need to modify // the message for each recipient then dispatch them. foreach (NWObject obj in recipients.Distinct()) { // Generate the final message as perceived by obj. StringBuilder finalMessage = new StringBuilder(); if (channel == ChatChannelType.PlayerShout) { finalMessage.Append("[Holonet] "); } else if (channel == ChatChannelType.PlayerParty) { finalMessage.Append("[Comms] "); if (obj.IsDM) { // Convenience for DMs - append the party members. finalMessage.Append("{ "); int count = 0; NWPlayer player = sender.Object; List <NWCreature> partyMembers = player.PartyMembers.ToList(); foreach (NWCreature otherPlayer in partyMembers) { string name = otherPlayer.Name; finalMessage.Append(name.Substring(0, Math.Min(name.Length, 10))); ++count; if (count >= 3) { finalMessage.Append(", ..."); break; } else if (count != partyMembers.Count) { finalMessage.Append(","); } } finalMessage.Append(" } "); } } SkillType language = LanguageService.GetActiveLanguage(sender); // Wookiees cannot speak any other language (but they can understand them). // Swap their language if they attempt to speak in any other language. CustomRaceType race = (CustomRaceType)_.GetRacialType(sender); if (race == CustomRaceType.Wookiee && language != SkillType.Shyriiwook) { LanguageService.SetActiveLanguage(sender, SkillType.Shyriiwook); language = SkillType.Shyriiwook; } int colour = LanguageService.GetColour(language); byte r = (byte)(colour >> 24 & 0xFF); byte g = (byte)(colour >> 16 & 0xFF); byte b = (byte)(colour >> 8 & 0xFF); if (language != SkillType.Basic) { string languageName = LanguageService.GetName(language); finalMessage.Append(ColorTokenService.Custom($"[{languageName}] ", r, g, b)); } foreach (ChatComponent component in chatComponents) { string text = component.m_Text; if (component.m_Translatable && language != SkillType.Basic) { text = LanguageService.TranslateSnippetForListener(sender, obj.Object, language, component.m_Text); if (colour != 0) { text = ColorTokenService.Custom(text, r, g, b); } } if (component.m_CustomColour) { text = ColorTokenService.Custom(text, component.m_ColourRed, component.m_ColourGreen, component.m_ColourBlue); } finalMessage.Append(text); } // Dispatch the final message - method depends on the original chat channel. // - Shout and party is sent as DMTalk. We do this to get around the restriction that // the PC needs to be in the same area for the normal talk channel. // We could use the native channels for these but the [shout] or [party chat] labels look silly. // - Talk and whisper are sent as-is. ChatChannelType finalChannel = channel; if (channel == ChatChannelType.PlayerShout || channel == ChatChannelType.PlayerParty) { finalChannel = ChatChannelType.DMTalk; } // There are a couple of colour overrides we want to use here. // - One for holonet (shout). // - One for comms (party chat). string finalMessageColoured = finalMessage.ToString(); if (channel == ChatChannelType.PlayerShout) { finalMessageColoured = ColorTokenService.Custom(finalMessageColoured, 0, 180, 255); } else if (channel == ChatChannelType.PlayerParty) { finalMessageColoured = ColorTokenService.Orange(finalMessageColoured); } NWNXChat.SendMessage((int)finalChannel, finalMessageColoured, sender, obj); } MessageHub.Instance.Publish(new OnChatProcessed(sender, channel, isOOC)); }
public static string PrismaticString() { return(ColorTokenService.Red("p") + ColorTokenService.Orange("r") + ColorTokenService.Yellow("i") + ColorTokenService.Green("s") + ColorTokenService.Blue("m") + ColorTokenService.LightPurple("a") + ColorTokenService.Purple("t") + ColorTokenService.White("i") + ColorTokenService.Black("c")); }
public static string OnModuleExamine(string existingDescription, NWObject examinedObject) { if (examinedObject.ObjectType != OBJECT_TYPE_ITEM) { return(existingDescription); } NWItem examinedItem = (examinedObject.Object); string description = ""; if (examinedItem.RecommendedLevel > 0) { description += ColorTokenService.Orange("Recommended Level: ") + examinedItem.RecommendedLevel + "\n"; } if (examinedItem.LevelIncrease > 0) { description += ColorTokenService.Orange("Level Increase: ") + examinedItem.LevelIncrease + "\n"; } if (examinedItem.AssociatedSkillType > 0) { Skill skill = DataService.Skill.GetByID((int)examinedItem.AssociatedSkillType); description += ColorTokenService.Orange("Associated Skill: ") + skill.Name + "\n"; } if (examinedItem.CustomAC > 0) { if (ShieldBaseItemTypes.Contains(examinedItem.BaseItemType)) { description += ColorTokenService.Orange("Damage Immunity: ") + (10 + examinedItem.CustomAC / 3) + "\n"; } else if (ArmorBaseItemTypes.Contains(examinedItem.BaseItemType)) { description += ColorTokenService.Orange("AC: ") + examinedItem.CustomAC + "\n"; } else { description += ColorTokenService.Red("AC (ignored due to item type): ") + examinedItem.CustomAC + "\n"; } } if (examinedItem.HPBonus > 0) { description += ColorTokenService.Orange("HP Bonus: ") + examinedItem.HPBonus + "\n"; } if (examinedItem.FPBonus > 0) { description += ColorTokenService.Orange("FP Bonus: ") + examinedItem.FPBonus + "\n"; } if (examinedItem.StructureBonus > 0) { description += ColorTokenService.Orange("Structure Bonus: ") + examinedItem.StructureBonus + "\n"; } if (examinedItem.StrengthBonus > 0) { description += ColorTokenService.Orange("Strength Bonus: ") + examinedItem.StrengthBonus + "\n"; } if (examinedItem.DexterityBonus > 0) { description += ColorTokenService.Orange("Dexterity Bonus: ") + examinedItem.DexterityBonus + "\n"; } if (examinedItem.ConstitutionBonus > 0) { description += ColorTokenService.Orange("Constitution Bonus: ") + examinedItem.ConstitutionBonus + "\n"; } if (examinedItem.WisdomBonus > 0) { description += ColorTokenService.Orange("Wisdom Bonus: ") + examinedItem.WisdomBonus + "\n"; } if (examinedItem.IntelligenceBonus > 0) { description += ColorTokenService.Orange("Intelligence Bonus: ") + examinedItem.IntelligenceBonus + "\n"; } if (examinedItem.CharismaBonus > 0) { description += ColorTokenService.Orange("Charisma Bonus: ") + examinedItem.CharismaBonus + "\n"; } if (examinedItem.CooldownRecovery > 0) { description += ColorTokenService.Orange("Cooldown Recovery: +") + examinedItem.CooldownRecovery + "%\n"; } else if (examinedItem.CooldownRecovery < 0) { description += ColorTokenService.Orange("Cooldown Recovery: -") + examinedItem.CooldownRecovery + "%\n"; } if (examinedItem.HarvestingBonus > 0) { description += ColorTokenService.Orange("Harvesting Bonus: ") + examinedItem.HarvestingBonus + "\n"; } if (examinedItem.CraftBonusArmorsmith > 0) { description += ColorTokenService.Orange("Armorsmith Bonus: ") + examinedItem.CraftBonusArmorsmith + "\n"; } if (examinedItem.CraftBonusEngineering > 0) { description += ColorTokenService.Orange("Engineering Bonus: ") + examinedItem.CraftBonusEngineering + "\n"; } if (examinedItem.CraftBonusFabrication > 0) { description += ColorTokenService.Orange("Fabrication Bonus: ") + examinedItem.CraftBonusFabrication + "\n"; } if (examinedItem.CraftBonusWeaponsmith > 0) { description += ColorTokenService.Orange("Weaponsmith Bonus: ") + examinedItem.CraftBonusWeaponsmith + "\n"; } if (examinedItem.CraftBonusCooking > 0) { description += ColorTokenService.Orange("Cooking Bonus: ") + examinedItem.CraftBonusCooking + "\n"; } if (examinedItem.CraftTierLevel > 0) { description += ColorTokenService.Orange("Tool Level: ") + examinedItem.CraftTierLevel + "\n"; } if (examinedItem.EnmityRate != 0) { description += ColorTokenService.Orange("Enmity: ") + examinedItem.EnmityRate + "%\n"; } if (examinedItem.LuckBonus > 0) { description += ColorTokenService.Orange("Luck Bonus: ") + examinedItem.LuckBonus + "\n"; } if (examinedItem.MeditateBonus > 0) { description += ColorTokenService.Orange("Meditate Bonus: ") + examinedItem.MeditateBonus + "\n"; } if (examinedItem.RestBonus > 0) { description += ColorTokenService.Orange("Rest Bonus: ") + examinedItem.RestBonus + "\n"; } if (examinedItem.ScanningBonus > 0) { description += ColorTokenService.Orange("Scanning Bonus: ") + examinedItem.ScanningBonus + "\n"; } if (examinedItem.ScavengingBonus > 0) { description += ColorTokenService.Orange("Scavenging Bonus: ") + examinedItem.ScavengingBonus + "\n"; } if (examinedItem.MedicineBonus > 0) { description += ColorTokenService.Orange("Medicine Bonus: ") + examinedItem.MedicineBonus + "\n"; } if (examinedItem.HPRegenBonus > 0) { description += ColorTokenService.Orange("HP Regen Bonus: ") + examinedItem.HPRegenBonus + "\n"; } if (examinedItem.FPRegenBonus > 0) { description += ColorTokenService.Orange("FP Regen Bonus: ") + examinedItem.FPRegenBonus + "\n"; } if (examinedItem.PilotingBonus > 0) { description += ColorTokenService.Orange("Piloting Bonus: ") + examinedItem.PilotingBonus + "\n"; } if (examinedItem.BaseAttackBonus > 0) { if (WeaponBaseItemTypes.Contains(examinedItem.BaseItemType)) { description += ColorTokenService.Orange("Base Attack Bonus: ") + examinedItem.BaseAttackBonus + "\n"; } else { description += ColorTokenService.Red("Base Attack Bonus (ignored due to item type): ") + examinedItem.BaseAttackBonus + "\n"; } } if (examinedItem.SneakAttackBonus > 0) { description += ColorTokenService.Orange("Sneak Attack Bonus: ") + examinedItem.SneakAttackBonus + "\n"; } if (examinedItem.DamageBonus > 0) { if (WeaponBaseItemTypes.Contains(examinedItem.BaseItemType)) { description += ColorTokenService.Orange("Damage Bonus: ") + examinedItem.DamageBonus + "\n"; } else { description += ColorTokenService.Red("Damage Bonus (ignored due to item type): ") + examinedItem.DamageBonus + "\n"; } } if (examinedItem.CustomItemType != CustomItemType.None) { string itemTypeProper = string.Concat(examinedItem.CustomItemType.ToString().Select(x => char.IsUpper(x) ? " " + x : x.ToString())).TrimStart(' '); description += ColorTokenService.Orange("Item Type: ") + itemTypeProper + "\n"; } // Check for properties that can only be applied to limited things, and flag them here. // Attack bonus, damage, base attack bonus: weapons only // AC - armor items only. ItemProperty ip = _.GetFirstItemProperty(examinedItem); while (_.GetIsItemPropertyValid(ip) == TRUE) { if (_.GetItemPropertyType(ip) == (int)CustomItemPropertyType.ComponentBonus) { switch (_.GetItemPropertySubType(ip)) { case (int)ComponentBonusType.ACUp: { description += ColorTokenService.Cyan("AC can only be applied to Shields, Armor and Helmets. On other items, it will be ignored.\n"); break; } case (int)ComponentBonusType.DamageUp: case (int)ComponentBonusType.AttackBonusUp: case (int)ComponentBonusType.BaseAttackBonusUp: { description += ColorTokenService.Cyan("Damage Up, Attack Bonus Up and Base Attack Bonus Up can only be applied to weapons (including gloves). On other items, it will be ignored.\n"); break; } } } ip = _.GetNextItemProperty(examinedItem); } return(existingDescription + "\n" + description); }
public static string OnModuleExamine(string existingDescription, NWPlayer examiner, NWObject examinedObject) { if (examinedObject.ObjectType != OBJECT_TYPE_ITEM) { return(existingDescription); } NWItem examinedItem = (examinedObject.Object); string description = ""; if (examinedItem.RecommendedLevel > 0) { description += ColorTokenService.Orange("Recommended Level: ") + examinedItem.RecommendedLevel + "\n"; } if (examinedItem.LevelIncrease > 0) { description += ColorTokenService.Orange("Level Increase: ") + examinedItem.LevelIncrease + "\n"; } if (examinedItem.AssociatedSkillType > 0) { Skill skill = DataService.Get <Skill>((int)examinedItem.AssociatedSkillType); description += ColorTokenService.Orange("Associated Skill: ") + skill.Name + "\n"; } if (examinedItem.CustomAC > 0) { description += ColorTokenService.Orange("AC: ") + examinedItem.CustomAC + "\n"; } if (examinedItem.HPBonus > 0) { description += ColorTokenService.Orange("HP Bonus: ") + examinedItem.HPBonus + "\n"; } if (examinedItem.FPBonus > 0) { description += ColorTokenService.Orange("FP Bonus: ") + examinedItem.FPBonus + "\n"; } if (examinedItem.StructureBonus > 0) { description += ColorTokenService.Orange("Structure Bonus: ") + examinedItem.StructureBonus + "\n"; } if (examinedItem.StrengthBonus > 0) { description += ColorTokenService.Orange("Strength Bonus: ") + examinedItem.StrengthBonus + "\n"; } if (examinedItem.DexterityBonus > 0) { description += ColorTokenService.Orange("Dexterity Bonus: ") + examinedItem.DexterityBonus + "\n"; } if (examinedItem.ConstitutionBonus > 0) { description += ColorTokenService.Orange("Constitution Bonus: ") + examinedItem.ConstitutionBonus + "\n"; } if (examinedItem.WisdomBonus > 0) { description += ColorTokenService.Orange("Wisdom Bonus: ") + examinedItem.WisdomBonus + "\n"; } if (examinedItem.IntelligenceBonus > 0) { description += ColorTokenService.Orange("Intelligence Bonus: ") + examinedItem.IntelligenceBonus + "\n"; } if (examinedItem.CharismaBonus > 0) { description += ColorTokenService.Orange("Charisma Bonus: ") + examinedItem.CharismaBonus + "\n"; } if (examinedItem.CastingSpeed > 0) { description += ColorTokenService.Orange("Activation Speed: +") + examinedItem.CastingSpeed + "%\n"; } else if (examinedItem.CastingSpeed < 0) { description += ColorTokenService.Orange("Activation Penalty: -") + examinedItem.CastingSpeed + "%\n"; } if (examinedItem.HarvestingBonus > 0) { description += ColorTokenService.Orange("Harvesting Bonus: ") + examinedItem.HarvestingBonus + "\n"; } if (examinedItem.CraftBonusArmorsmith > 0) { description += ColorTokenService.Orange("Armorsmith Bonus: ") + examinedItem.CraftBonusArmorsmith + "\n"; } if (examinedItem.CraftBonusEngineering > 0) { description += ColorTokenService.Orange("Engineering Bonus: ") + examinedItem.CraftBonusEngineering + "\n"; } if (examinedItem.CraftBonusFabrication > 0) { description += ColorTokenService.Orange("Fabrication Bonus: ") + examinedItem.CraftBonusFabrication + "\n"; } if (examinedItem.CraftBonusWeaponsmith > 0) { description += ColorTokenService.Orange("Weaponsmith Bonus: ") + examinedItem.CraftBonusWeaponsmith + "\n"; } if (examinedItem.CraftBonusCooking > 0) { description += ColorTokenService.Orange("Cooking Bonus: ") + examinedItem.CraftBonusCooking + "\n"; } if (examinedItem.CraftTierLevel > 0) { description += ColorTokenService.Orange("Tool Level: ") + examinedItem.CraftTierLevel + "\n"; } if (examinedItem.EnmityRate != 0) { description += ColorTokenService.Orange("Enmity: ") + examinedItem.EnmityRate + "%\n"; } if (examinedItem.ForcePotencyBonus > 0) { description += ColorTokenService.Orange("Force Potency Bonus: ") + examinedItem.ForcePotencyBonus + "\n"; } if (examinedItem.ForceAccuracyBonus > 0) { description += ColorTokenService.Orange("Force Accuracy Bonus: ") + examinedItem.ForceAccuracyBonus + "\n"; } if (examinedItem.ForceDefenseBonus > 0) { description += ColorTokenService.Orange("Force Defense Bonus: ") + examinedItem.ForceDefenseBonus + "\n"; } if (examinedItem.ElectricalPotencyBonus > 0) { description += ColorTokenService.Orange("Electrical Potency Bonus: ") + examinedItem.ElectricalPotencyBonus + "\n"; } if (examinedItem.MindPotencyBonus > 0) { description += ColorTokenService.Orange("Mind Potency Bonus: ") + examinedItem.MindPotencyBonus + "\n"; } if (examinedItem.LightPotencyBonus > 0) { description += ColorTokenService.Orange("Light Potency Bonus: ") + examinedItem.LightPotencyBonus + "\n"; } if (examinedItem.DarkPotencyBonus > 0) { description += ColorTokenService.Orange("Dark Potency Bonus: ") + examinedItem.DarkPotencyBonus + "\n"; } if (examinedItem.ElectricalDefenseBonus > 0) { description += ColorTokenService.Orange("Electrical Defense Bonus: ") + examinedItem.ElectricalDefenseBonus + "\n"; } if (examinedItem.MindDefenseBonus > 0) { description += ColorTokenService.Orange("Mind Defense Bonus: ") + examinedItem.MindDefenseBonus + "\n"; } if (examinedItem.LightDefenseBonus > 0) { description += ColorTokenService.Orange("Light Defense Bonus: ") + examinedItem.LightDefenseBonus + "\n"; } if (examinedItem.DarkDefenseBonus > 0) { description += ColorTokenService.Orange("Dark Defense Bonus: ") + examinedItem.DarkDefenseBonus + "\n"; } if (examinedItem.LuckBonus > 0) { description += ColorTokenService.Orange("Luck Bonus: ") + examinedItem.LuckBonus + "\n"; } if (examinedItem.MeditateBonus > 0) { description += ColorTokenService.Orange("Meditate Bonus: ") + examinedItem.MeditateBonus + "\n"; } if (examinedItem.RestBonus > 0) { description += ColorTokenService.Orange("Rest Bonus: ") + examinedItem.RestBonus + "\n"; } if (examinedItem.ScanningBonus > 0) { description += ColorTokenService.Orange("Scanning Bonus: ") + examinedItem.ScanningBonus + "\n"; } if (examinedItem.ScavengingBonus > 0) { description += ColorTokenService.Orange("Scavenging Bonus: ") + examinedItem.ScavengingBonus + "\n"; } if (examinedItem.MedicineBonus > 0) { description += ColorTokenService.Orange("Medicine Bonus: ") + examinedItem.MedicineBonus + "\n"; } if (examinedItem.HPRegenBonus > 0) { description += ColorTokenService.Orange("HP Regen Bonus: ") + examinedItem.HPRegenBonus + "\n"; } if (examinedItem.FPRegenBonus > 0) { description += ColorTokenService.Orange("FP Regen Bonus: ") + examinedItem.FPRegenBonus + "\n"; } if (examinedItem.BaseAttackBonus > 0) { description += ColorTokenService.Orange("Base Attack Bonus: ") + examinedItem.BaseAttackBonus + "\n"; } if (examinedItem.SneakAttackBonus > 0) { description += ColorTokenService.Orange("Sneak Attack Bonus: ") + examinedItem.SneakAttackBonus + "\n"; } if (examinedItem.DamageBonus > 0) { description += ColorTokenService.Orange("Damage Bonus: ") + examinedItem.DamageBonus + "\n"; } if (examinedItem.CustomItemType != CustomItemType.None) { string itemTypeProper = string.Concat(examinedItem.CustomItemType.ToString().Select(x => char.IsUpper(x) ? " " + x : x.ToString())).TrimStart(' '); description += ColorTokenService.Orange("Item Type: ") + itemTypeProper + "\n"; } return(existingDescription + "\n" + description); }