override protected void OnItemExit(IItemHolder itemHolder)
 {
     if (!_is_capture)
     {
         border_img.color = idle_color;
     }
 }
Exemple #2
0
 public CPlayerInstance(FightManager fightManager, Region region, PlayerKnownList objectKnownList,
                        StatHolder stats, IItemHolder items, EffectHolder effects, IEnumerable <ICharacterData> characterDatas)
     : base(region, objectKnownList, stats, items, effects, characterDatas)
 {
     Destination  = new Position();
     FightManager = fightManager;
 }
 internal void Init(IItemHolder itemHolder, Transform originalTransform, Transform dragTransform)
 {
     _item_holder        = itemHolder;
     _original_transform = originalTransform;
     _drag_transform     = dragTransform;
     _mover.OnComplete  += OnComeBack;
     UpdateView();
 }
Exemple #4
0
 public DropIntoCommand(Item item, InventoryComponent picker, IItemHolder itemHolder)
 {
     _item              = item;
     _picker            = picker;
     _destination       = (itemHolder as StaticObject).Position;
     _itemHolder        = itemHolder;
     _item.OnDestroyed += OnObjectDestroyedOutside;
 }
 public void PlaceItemInto(Item item, IItemHolder itemHolder)
 {
     if (_inventory.Contains(item))
     {
         _inventory.Remove(item);
         itemHolder.ItemIn(item);
     }
 }
Exemple #6
0
    override protected void Receive(IItemHolder itemHolder)
    {
        if (itemHolder.Asset is DressableAsset)
        {
            DressController.TakeOff(itemHolder.Asset.TargetSlot, itemHolder.Personage);
        }

        border_img.color = idle_color;
    }
    override protected void Receive(IItemHolder itemHolder)
    {
        if (itemHolder != null)
        {
            DressController.PutOn(itemHolder.Asset, itemHolder.Asset.TargetSlot, itemHolder.Personage);
        }

        border_img.color = idle_color;
    }
    public HaulToItemHolderTask(Item item, IItemHolder itemHolder, MotionComponent motionComponent, InventoryComponent inventory)
    {
        Node itemNode        = Utils.NodeAt(item.Position);
        Node humanNode       = Utils.NodeAt(motionComponent.GridPosition);
        Node destinationNode = Utils.NodeAt((itemHolder as StaticObject).Position);

        AddCommand(new MoveCommand(motionComponent, SearchEngine.FindNodeNear(itemNode, humanNode).Position));
        AddCommand(new PickCommand(item, inventory));
        AddCommand(new MoveCommand(motionComponent, SearchEngine.FindNodeNear(destinationNode, SearchEngine.FindNodeNear(itemNode, humanNode)).Position));
        AddCommand(new DropIntoCommand(item, inventory, itemHolder));
    }
Exemple #9
0
 protected CCharacter(Region region, CharacterKnownList objectKnownList, IStatHolder stats, IItemHolder items, EffectHolder effects, IEnumerable <ICharacterData> characterDatas)
     : base(region, objectKnownList)
 {
     Stats           = stats;
     Stats.Character = this;
     Items           = items;
     Items.Character = this;
     _characterData  = new Dictionary <Type, ICharacterData>();
     foreach (var charData in characterDatas)
     {
         charData.Owner = this;
         _characterData.Add(charData.GetType(), charData);
     }
     Effects         = effects;
     Effects.Owner   = this;
     StatusListeners = new List <ICharacter>();
 }
Exemple #10
0
        public static ItemHolder getRandomItemsByLevel(IItemHolder itemsToFill, byte level)
        {
            //gets all items matching by level
            var itemsThatCanBeEquipped = ItemDBCache.Items.Values.Where(x => x.LevelReq <= level);

            //loops through all item slots and picks a random item from the above variable, that match the slot
            foreach (var slot in Enum.GetValues(typeof(ItemSlot)).Cast <ItemSlot>())
            {
                var itemsMatchinTheSlot = itemsThatCanBeEquipped.Where(x => x.Slot == slot).ToList();
                if (itemsMatchinTheSlot.Count == 0)
                {
                    continue;
                }
                itemsToFill.EquipItemOnRestore(itemsMatchinTheSlot[new Random().Next(0, itemsMatchinTheSlot.Count)].ItemId);
            }
            return((ItemHolder)itemsToFill);
        }
 override protected void Reject(IItemHolder itemHolder)
 {
     border_img.color = idle_color;
 }
Exemple #12
0
 public CBotInstance(byte level, Region region, CharacterKnownList objectKnownList, StatHolder stats, IItemHolder items, EffectHolder effects,
                     IEnumerable <ICharacterData> charData)
     : base(region, objectKnownList, stats, items, effects, charData)
 {
     Stats.SetStat <Level>(level);
     ObjectId = Math.Abs(Guid.NewGuid().GetHashCode());
     Name     = botNames[new Random().Next(0, botNames.Count)];
 }
 override protected void OnDismatchedItemEnter(IItemHolder itemHolder)
 {
     border_img.color = dismatch_color;
 }
Exemple #14
0
 protected virtual void OnMatchedItemEnter(IItemHolder itemHolder)
 {
 }
Exemple #15
0
 private bool IsMatch(IItemHolder itemHolder)
 {
     return(itemHolder.GetType() == ItemHolderType && SlotType.HasFlag(itemHolder.Asset.TargetSlot) && CanReceive(itemHolder));
 }
Exemple #16
0
 public void MoveToAnotherItemHolder(IItemHolder newItemHolder)
 {
     RemoveFromItemHolder();
     // Add to new Item Holder
     newItemHolder.AddItem(this);
 }
Exemple #17
0
 protected virtual void Reject(IItemHolder itemHolder)
 {
 }
Exemple #18
0
 protected virtual void Receive(IItemHolder itemHolder)
 {
 }
 public HaulToItemHolderJob(Type itemType, IItemHolder itemHolder) : base((itemHolder as StaticObject).Position)
 {
     _itemType     = itemType;
     _dropPosition = (itemHolder as StaticObject).Position;
     _itemHolder   = itemHolder;
 }
Exemple #20
0
 public void SetItemHolder(IItemHolder itemHolder)
 {
     this.itemHolder = itemHolder;
 }
 override protected bool CanReceive(IItemHolder itemHolder)
 {
     return(DressController.CanDress(itemHolder.Asset, SlotType));
 }
Exemple #22
0
 protected virtual bool CanReceive(IItemHolder itemHolder)
 {
     return(true);
 }
Exemple #23
0
 protected virtual void OnItemExit(IItemHolder itemHolder)
 {
 }
Exemple #24
0
 public CPlayable(Region region, PlayableKnownList objectKnownList, IStatHolder stats, IItemHolder items, EffectHolder effects, IEnumerable <ICharacterData> charData)
     : base(region, objectKnownList, stats, items, effects, charData)
 {
 }