/// <summary> /// Gets the formatted object name for the passed object and a specified quantity. /// </summary> /// <returns>The formatted object name U.</returns> /// <param name="objInt">Object int.</param> /// <param name="Quantity">Quantity that I want to display</param> public string GetFormattedObjectNameUW(ObjectInteraction objInt, int Quantity) { //Eventually this will return things like proper quants etc. string output = GetString(4, objInt.item_id); if ((objInt.isQuant() == true) && (objInt.isEnchanted() == false)) { if (output.Contains("&")) { //string is split into a singular and plural if ((objInt.link > 1) && (Quantity > 1)) { //Plural description output = objInt.link + " " + output.Split('&')[1]; } else { output = output.Split('&')[0]; } } else { output = output.Replace("a_", Quantity + "_"); output = output.Replace("an_", Quantity + "_"); output = output.Replace("some_", Quantity + "_"); } } else { if (output.Contains("&")) { output = output.Split('&')[0]; } } output = output.Replace("_", " "); return(GetString(1, str_you_see_) + output); }
/// <summary> /// Gets the formatted object name with a description of its qualty. (EG smell fish.) /// </summary> /// <returns>The formatted object name U.</returns> /// <param name="objInt">Object int.</param> /// <param name="QualityString">Quality string.</param> public string GetFormattedObjectNameUW(ObjectInteraction objInt, string QualityString) { //Eventually this will return things like proper quants etc. string output = GetString(4, objInt.item_id); if (output == null) { output = ""; } if ((objInt.isQuant() == true) && (output.Contains("&")) && (objInt.isEnchanted() == false)) { if (objInt.link > 1) { //Plural description output = objInt.link + " " + output.Split('&')[1]; } else { output = output.Split('&')[0]; } } else { if (output.Contains("&")) { output = output.Split('&')[0]; } } string isThisAVowel = QualityString.Substring(0, 1).ToUpper(); if ( (isThisAVowel == "A") || (isThisAVowel == "E") || (isThisAVowel == "I") || (isThisAVowel == "O") || (isThisAVowel == "U") ) { if (output.Contains("a_")) { output = output.Replace("a_", "an " + QualityString + " "); } else { if (output.Contains("_")) { output = output.Replace("_", " " + QualityString + " "); } else { output = QualityString + " " + output + " "; } } } else { if (output.Contains("an_")) { output = output.Replace("an_", "a " + QualityString + " "); } else { if (output.Contains("_")) { output = output.Replace("_", " " + QualityString + " "); } else { output = QualityString + " " + output + " "; } } } //output =output.Replace("_", " " + QualityString + " "); return(GetString(1, str_you_see_) + output); }