public Overhead(BaseEntity ownerEntity, MessageType msgType, string text, int font, int hue) : base(ownerEntity.Serial) { m_ownerEntity = ownerEntity; m_text = text; m_font = font; m_hue = hue; m_msgType = msgType; m_needsRender = true; }
public ContainerGump(BaseEntity containerItem, int gumpID) : base(containerItem.Serial, 0) { m_data = UltimaData.ContainerData.GetData(gumpID); m_item = (Container)containerItem; IsMovable = true; AddControl(new GumpPicContainer(this, 0, 0, 0, m_data.GumpID, 0, m_item)); LastControl.MakeDragger(this); LastControl.MakeCloseTarget(this); m_tickerText = (HtmlGump)AddControl(new HtmlGump(this, 0, 50, 50, 0, 0, 0, 0, string.Empty)); }
public MapObjectText(Position3D position, BaseEntity ownerEntity, string text, int hue, int fontID) : base(position) { OwnerEntity = ownerEntity; Hue = hue; FontID = fontID; // set up draw data m_draw_texture = Texture = ASCIIText.GetTextTexture(text, 1); m_draw_width = m_draw_texture.Width; m_draw_height = m_draw_texture.Height; m_draw_X = (m_draw_width >> 1) - 22 - (int)((Position.X_offset - Position.Y_offset) * 22); m_draw_Y = ((int)Position.Z_offset * 4) + m_draw_height - 44 - (int)((Position.X_offset + Position.Y_offset) * 22); m_draw_hue = Utility.GetHueVector(Hue); m_pickType = PickTypes.PickObjects; m_draw_flip = false; }
public MapObjectItem(int itemID, Position3D position, int direction, BaseEntity ownerEntity, int hue) : base(position) { ItemID = itemID; OwnerEntity = ownerEntity; Facing = direction; Hue = hue; // set up draw data m_draw_texture = UltimaData.ArtData.GetStaticTexture(ItemID); m_draw_width = m_draw_texture.Width; m_draw_height = m_draw_texture.Height; m_draw_X = (m_draw_width >> 1) - 22; m_draw_Y = (int)(Z * 4) + m_draw_height - 44; m_draw_hue = Utility.GetHueVector(Hue); m_pickType = PickTypes.PickObjects; m_draw_flip = false; }
public MapObjectMobile(Position3D position, int facing, int action, float frame, BaseEntity ownerEntity) : base(position) { if (frame >= 1.0f) return; m_layers = new MapObjectMobileLayer[(int)EquipLayer.LastUserValid]; Facing = facing; Action = action; m_frame = frame; OwnerEntity = ownerEntity; // set pick type m_pickType = PickTypes.PickObjects; // set up draw data m_draw_flip = (Facing > 4) ? true : false; m_draw_IsometricOverlap = true; }
public MapObjectCorpse(Position3D position, int direction, BaseEntity ownerEntity, int nHue, int bodyID, float frame) : base(0x2006, position, direction, ownerEntity, nHue) { BodyID = bodyID; FrameIndex = (int)(frame * UltimaData.BodyConverter.DeathAnimationFrameCount(bodyID)); UltimaData.AnimationFrame iFrame = getFrame(); if (iFrame == null) { m_noDraw = true; return; } m_draw_texture = iFrame.Texture; m_draw_width = m_draw_texture.Width; m_draw_height = m_draw_texture.Height; m_draw_X = iFrame.Center.X - 22; m_draw_Y = iFrame.Center.Y + (int)(Z * 4) + m_draw_height - 22; m_draw_hue = Utility.GetHueVector(Hue); m_pickType = PickTypes.PickObjects; m_draw_flip = false; }
private static void getStartZ(BaseEntity m, Map map, Vector3 loc, List<Item> itemList, out int zLow, out int zTop) { int xCheck = (int)loc.X, yCheck = (int)loc.Y; MapTile mapTile = map.GetMapTile(xCheck, yCheck, false); if (mapTile == null) { zLow = int.MinValue; zTop = int.MinValue; } MapObjectGround landTile = mapTile.GroundTile; //map.Tiles.GetLandTile(xCheck, yCheck); bool landBlocks = (UltimaData.TileData.LandData[landTile.ItemID & 0x3FFF].Flags & TileFlag.Impassable) != 0; //(TileData.LandTable[landTile.ID & 0x3FFF].Flags & TileFlag.Impassable) != 0; // if (landBlocks && m.CanSwim && (TileData.LandTable[landTile.ID & 0x3FFF].Flags & TileFlag.Wet) != 0) // landBlocks = false; // else if (m.CantWalk && (TileData.LandTable[landTile.ID & 0x3FFF].Flags & TileFlag.Wet) == 0) // landBlocks = true; int landLow = 0, landCenter = 0, landTop = 0; landCenter = map.GetAverageZ(xCheck, yCheck, ref landLow, ref landTop); bool considerLand = !landTile.Ignored; int zCenter = zLow = zTop = 0; bool isSet = false; if (considerLand && !landBlocks && loc.Z >= landCenter) { zLow = landLow; zCenter = landCenter; if (!isSet || landTop > zTop) zTop = landTop; isSet = true; } MapObjectStatic[] staticTiles = mapTile.GetStatics().ToArray(); for (int i = 0; i < staticTiles.Length; ++i) { MapObjectStatic tile = staticTiles[i]; UltimaData.ItemData id = UltimaData.TileData.ItemData[tile.ItemID & 0x3FFF]; int calcTop = ((int)tile.Z + id.CalcHeight); if ((!isSet || calcTop >= zCenter) && ((id.Flags & TileFlag.Surface) != 0) && loc.Z >= calcTop) { // || (m.CanSwim && (id.Flags & TileFlag.Wet) != 0) // if (m.CantWalk && (id.Flags & TileFlag.Wet) == 0) // continue; zLow = (int)tile.Z; zCenter = calcTop; int top = (int)tile.Z + id.Height; if (!isSet || top > zTop) zTop = top; isSet = true; } } for (int i = 0; i < itemList.Count; ++i) { Item item = itemList[i]; UltimaData.ItemData id = item.ItemData; int calcTop = item.Z + id.CalcHeight; if ((!isSet || calcTop >= zCenter) && ((id.Flags & TileFlag.Surface) != 0) && loc.Z >= calcTop) { // || (m.CanSwim && (id.Flags & TileFlag.Wet) != 0) // if (m.CantWalk && (id.Flags & TileFlag.Wet) == 0) // continue; zLow = item.Z; zCenter = calcTop; int top = item.Z + id.Height; if (!isSet || top > zTop) zTop = top; isSet = true; } } if (!isSet) zLow = zTop = (int)loc.Z; else if (loc.Z > zTop) zTop = (int)loc.Z; }
public Movement(BaseEntity entity) { m_entity = entity; m_currentPosition = new Position3D(); m_moveEvents = new MoveEvents(); }
public void SaveLastParent() { if (Parent != null) { m_lastParent = Parent; m_lastParent_X = X; m_lastParent_Y = Y; } else { m_lastParent = null; } }
// used by ultimaclient. public static Gump OpenContainerGump(BaseEntity entity) { Gump gump; if ((gump = (Gump)UltimaEngine.UserInterface.GetControl(entity.Serial)) != null) { gump.Dispose(); } gump = new ContainerGump(entity, ((Container)entity).ItemID); UltimaEngine.UserInterface.AddControl(gump, 64, 64); return gump; }
// used by itemgumpling, paperdollinteractable, topmenu, worldinput. public static void DoubleClick(BaseEntity item) { s_Client.Send(new DoubleClickPacket(item.Serial)); }