private void setRoomUnitTileState(roomUnit pUnit) { pUnit.removeStatus("sit"); pUnit.removeStatus("lay"); List<floorItem> tileItems = this.getFloorItems(pUnit.X, pUnit.Y); foreach (Items.floorItem lItem in tileItems) { if (lItem.Definition.Behaviour.canSitOnTop) { pUnit.Z = lItem.Z; pUnit.rotationHead = lItem.Rotation; pUnit.rotationBody = lItem.Rotation; pUnit.removeStatus("dance"); pUnit.addStatus("sit", "sit", stringFunctions.formatFloatForClient(lItem.Definition.topHeight), 0, null, 0, 0); } else if (lItem.Definition.Behaviour.canLayOnTop) { //pUnit.X = lItem.X; //pUnit.Y = lItem.Y; pUnit.Z = lItem.Z; pUnit.rotationBody = lItem.Rotation; pUnit.rotationHead = lItem.Rotation; pUnit.removeStatus("dance"); pUnit.removeStatus("handitem"); pUnit.addStatus("lay", "lay", stringFunctions.formatFloatForClient(lItem.Definition.topHeight) + " null", 0, null, 0, 0); } } }
public void animateTalkingUnit(roomUnit pUnit, ref string Text, bool applyEmotes) { string[] Words = Text.Split(' '); string Gesture = null; if (applyEmotes) { foreach (string Word in Words) { if (Gesture != null) break; switch (Word.ToLower()) { case ":)": case ":-)": case ":d": case ":-d": case ":p": case ":-p": case ";)": case ";-)": Gesture = "sml"; break; case ":o": Gesture = "srp"; break; case ":s": case ":-s": case ":(": case ":-(": case ":'(": case ":'-(": Gesture = "sad"; break; case ":@": case ">:(": case ">:-(": Gesture = "agr"; break; } } } int wordAmount = Words.Length; if (Gesture != null) { pUnit.addStatus("gest", "gest", Gesture, 5, null, 0, 0); if (wordAmount == 1) // Only word is the gesture emote return; } int speakSecs = 1; if (wordAmount > 1) speakSecs = wordAmount / 2; else if (wordAmount > 5) speakSecs = 5; pUnit.addStatus("talk", "talk", null, speakSecs, null, 0, 0); }