void RightBumper() { if (PlayerStateMachine.Instance.state == PlayerStateMachine.PlayerState.MOVING) { currentItem = ItemEquipped.NET; } }
public static void OnItemEquipped(int itemIndex) { if (ItemEquipped != null) { ItemEquipped.Invoke(itemIndex); } }
void LeftBumper() { if (PlayerStateMachine.Instance.state == PlayerStateMachine.PlayerState.MOVING) { currentItem = ItemEquipped.SKIMMINGROCK; } }
public void OnItemEquipped(ItemEquipped message) { // Check if we can show effects. var effects = (ParticleEffects)Manager.GetComponent(message.Slot.Root.Entity, ParticleEffects.TypeId); if (effects == null) { return; } // Get the item to get its size (for scaling offset and effect). var item = (SpaceItem)Manager.GetComponent(message.Item, Item.TypeId); // OK, add the effects, if there are any. foreach (ItemEffect effect in Manager.GetComponents(message.Item, ItemEffect.TypeId)) { var slot = (SpaceItemSlot)message.Slot; var offset = effect.Offset; var direction = effect.Direction; offset *= item.RequiredSlotSize.Scale(); slot.Accumulate(ref offset, ref direction); effects.TryAdd( effect.Id, effect.Name, item.RequiredSlotSize.Scale() * effect.Scale, direction, offset, effect.Group, effect.Group == ParticleEffects.EffectGroup.None); } }
public void OnItemEquipped(ItemEquipped message) { if (Manager.GetComponent(message.Item, Weapon.TypeId) != null) { // Weapon was equipped, track a cooldown for it. _cooldowns.Add(message.Item, 0); } }
public void Equip(IItem item) { // We don't want multiple items equipped at the same time UnequipActiveItem(); // Place this item underneath our right hand HandleItemEquipped(item); // Invoke the Event if the Event is not null ActiveItemChanged?.Invoke(ActiveItem); ItemEquipped?.Invoke(item); }
public void SwapWeapon() { if (CombatEncounter.Active?.IsEntityTurn(gameObject) == false) { return; } var mh = Slots.First(s => s.Type == EquipmentSlotType.MainHand); var oh = Slots.First(s => s.Type == EquipmentSlotType.OffHand); if (mh.Item.IsAnySkillOnCooldown() || oh.Item.IsAnySkillOnCooldown()) { throw new SkillIsOnCooldownException(); } var current = new List <Item> { mh.Item, oh.Item }; if (!mh.IsEmpty) { RemoveItemBonuses(mh.Item, mh); RemoveVisuals(mh.Item, mh); } if (!oh.IsEmpty) { RemoveItemBonuses(oh.Item, oh); RemoveVisuals(oh.Item, oh); } mh.Put(AltWeaponSet[0]); oh.Put(AltWeaponSet[1]); if (!mh.IsEmpty) { ApplyItemBonuses(mh.Item, mh); ApplyVisuals(mh.Item, mh); } if (!oh.IsEmpty) { ApplyItemBonuses(oh.Item, oh); ApplyVisuals(oh.Item, oh); } IsOnAltWeaponSet = !IsOnAltWeaponSet; SetAltWeaponSet(current); ItemEquipped?.Invoke(mh.Item); ItemEquipped?.Invoke(oh.Item); }
void UpdateSlot(ItemEquipped itemequip) { if (gameObject.activeSelf) { ItemSlot slot = equipmentSlotDict[itemequip.equipment.equipmentType]; slot.SetItem(itemequip.equipment); } else { isdirty = true; } }
public void OnItemEquipped(ItemEquipped message) { if (Manager.GetComponent(message.Item, Attribute <TAttribute> .TypeId) != null) { var attributes = ((Attributes <TAttribute>) Manager.GetComponent(message.Slot.Root.Entity, Attributes <TAttribute> .TypeId)); if (attributes != null) { attributes.RecomputeAttributes(); } } }
private void Start() { currentItem = ItemEquipped.SKIMMINGROCK; mainCam = Camera.main; controller = GetComponent <CharacterController>(); anim.SetBool("Walking", false); isGrounded = true; distanceGround = GetComponent <CharacterController>().bounds.extents.y; inTalkDistance = false; Transform particlesObject = transform.Find("Particles").gameObject.transform; jumpParticle = particlesObject.Find("JumpParticle").GetComponent <ParticleSystem>(); RunParticle = particlesObject.Find("RunParticle").GetComponent <ParticleSystem>(); InWaterWalkingParticle = transform.parent.Find("InWaterWalkingParticle").GetComponent <ParticleSystem>(); }
public void EquipItem(Equipment equipment) { //check if slot empty if (CheckEmptySlot(equipment.equipmentType)) { equipmentDict.Add(equipment.equipmentType, equipment); equipment.Equip(gameObject); ItemEquipped itemEquipped = new ItemEquipped(equipment); EventManager.Current.TriggerEvent(itemEquipped); PopupText.Instance.GenerateText("Equipped Item: " + equipment.name); } else { PopupText.Instance.GenerateText("Item in slot: " + equipment.equipmentType + " already equipped!"); } }
public void EquipIntoSlot(Item item, EquipmentSlot slot) { if (this.experience != null && item.RequiredLevel > this.experience.Experience.Level) { return; } if (item.IsEmpty) { Debug.LogError("Trying to equip empty item."); return; } if (!slot.CanEquip(item)) { Debug.LogError($"Can't equip item {item.Name} into slot with type {slot.Type}"); return; } if (IsEquipped(item)) { Unequip(item); } if (!slot.IsEmpty) { Unequip(slot.Item); } item.Type.EquipmentStrategy.Prepare(item, slot, this); item.EquipmentSlot = slot; item.Equipment = this; item.Inventory?.Remove(item); item.Inventory = this.inventory; slot.Put(item); ApplyItemBonuses(item, slot); ApplyVisuals(item, slot); ItemEquipped?.Invoke(item); }
public void Equip(IItem item) { if (ActiveItem != null) { ActiveItem.transform.SetParent(_itemRoot); ActiveItem.gameObject.SetActive(false); ItemUnEquipped?.Invoke(ActiveItem); } Debug.Log($"Equipped Item: {item.gameObject.name}"); item.transform.SetParent(rightHand); item.transform.localPosition = Vector3.zero; item.transform.localRotation = Quaternion.identity; ActiveItem = item; ActiveItem.gameObject.SetActive(true); ActiveItemChanged?.Invoke(ActiveItem); ItemEquipped?.Invoke(item); }
public override Component Copy() { var equipment = new EquipmentComponent(new List <string>(_slots)); foreach (var equippedItem in _equippedItems) { equipment._equippedItems.Add(equippedItem.Key, equippedItem.Value.Copy()); } if (ItemEquipped != null) { equipment.ItemEquipped = (ComponentEventHandler <EquipmentComponent, EventArgs <string, Entity> >)ItemEquipped.Clone(); } if (ItemUnequipped != null) { equipment.ItemUnequipped = (ComponentEventHandler <EquipmentComponent, EventArgs <string, Entity> >)ItemUnequipped.Clone(); } return(equipment); }
private void OnItemEquipped(ItemInfo itemEquipped) { ItemEventArgs itemEventArgs = new ItemEventArgs(itemEquipped); ItemEquipped?.Invoke(this, itemEventArgs); }
private void OnItemEquipped(EventData eventData) { ItemEquipped?.Invoke(eventData); }
public void OnItemEquipped(ItemEquipped message) { _changedShape.Add(message.Slot.Root.Entity); }