public Rooted(uint _uid, Entity _affected) : base(_uid, _affected) { name = "Rooted"; description = "You can not move."; icon = "status_stun"; }
public void AddParticleSystem(Entity ent, string systemName) { ParticleSettings settings = IoCManager.Resolve<IResourceManager>().GetParticles(systemName); if (settings != null) { //Add it. } }
public ExampleEffect(uint _uid, Entity _affected) //Do not add more parameters to the constructors or bad things happen. : base(_uid, _affected) { name = "Example Effect"; description = "This is an example..."; icon = "status_example"; isDebuff = false; }
public ContextMenu(Entity entity, Vector2D creationPos, IResourceManager resourceManager, IUserInterfaceManager userInterfaceManager, bool showExamine = true) { _owningEntity = entity; _resourceManager = resourceManager; _userInterfaceManager = userInterfaceManager; var entries = new List<ContextMenuEntry>(); var replies = new List<ComponentReplyMessage>(); entity.SendMessage(this, ComponentMessageType.ContextGetEntries, replies); if (replies.Any()) entries = (List<ContextMenuEntry>) replies.First(x => x.MessageType == ComponentMessageType.ContextGetEntries).ParamsList[0]; if (showExamine) { var examineButton = new ContextMenuButton( new ContextMenuEntry {ComponentMessage = "examine", EntryName = "Examine", IconName = "context_eye"}, _buttonSize, _resourceManager); examineButton.Selected += ContextSelected; _buttons.Add(examineButton); examineButton.Update(0); } var sVarButton = new ContextMenuButton( new ContextMenuEntry {ComponentMessage = "svars", EntryName = "SVars", IconName = "context_eye"}, _buttonSize, _resourceManager); sVarButton.Selected += ContextSelected; _buttons.Add(sVarButton); sVarButton.Update(0); foreach (ContextMenuEntry entry in entries) { var newButton = new ContextMenuButton(entry, _buttonSize, _resourceManager); newButton.Selected += ContextSelected; _buttons.Add(newButton); newButton.Update(0); } float currY = creationPos.Y; foreach (ContextMenuButton button in _buttons) { button.Position = new Point((int) creationPos.X, (int) currY); currY += _buttonSize.Y; } ClientArea = new Rectangle((int) creationPos.X, (int) creationPos.Y, (int) _buttonSize.X, _buttons.Count()*(int) _buttonSize.Y); }
private void SetNewState(ItemComponentState state) { if(state.Holder != null && (Holder == null || Holder.Uid != state.Holder)) { Holder = Owner.EntityManager.GetEntity((int)state.Holder); HoldingHand = state.InventoryLocation; } if(Holder != null && state.Holder == null) { Holder = null; HoldingHand = state.InventoryLocation; } }
public void SendDropEntity(Entity ent) { Owner.SendComponentNetworkMessage(this, NetDeliveryMethod.ReliableOrdered, ComponentMessageType.DropEntityInHand, ent.Uid); }
public void SendInventoryRemove(Entity ent) { Owner.SendComponentNetworkMessage(this, NetDeliveryMethod.ReliableUnordered, ComponentMessageType.InventoryRemove, ent.Uid); }
public bool ContainsEntity(Entity entity) { return ContainedEntities.Contains(entity); }
public override void Dispose() { foreach (ContextMenuButton button in _buttons) button.Dispose(); _buttons.Clear(); _owningEntity = null; _userInterfaceManager.RemoveFocus(); _userInterfaceManager.RemoveComponent(this); base.Dispose(); }
public override void OnAdd(Entity owner) { base.OnAdd(owner); _light.SetState(LightState.Off); }