コード例 #1
0
 override protected void OnItemExit(IItemHolder itemHolder)
 {
     if (!_is_capture)
     {
         border_img.color = idle_color;
     }
 }
コード例 #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;
 }
コード例 #3
0
 internal void Init(IItemHolder itemHolder, Transform originalTransform, Transform dragTransform)
 {
     _item_holder        = itemHolder;
     _original_transform = originalTransform;
     _drag_transform     = dragTransform;
     _mover.OnComplete  += OnComeBack;
     UpdateView();
 }
コード例 #4
0
 public DropIntoCommand(Item item, InventoryComponent picker, IItemHolder itemHolder)
 {
     _item              = item;
     _picker            = picker;
     _destination       = (itemHolder as StaticObject).Position;
     _itemHolder        = itemHolder;
     _item.OnDestroyed += OnObjectDestroyedOutside;
 }
コード例 #5
0
 public void PlaceItemInto(Item item, IItemHolder itemHolder)
 {
     if (_inventory.Contains(item))
     {
         _inventory.Remove(item);
         itemHolder.ItemIn(item);
     }
 }
コード例 #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;
    }
コード例 #7
0
    override protected void Receive(IItemHolder itemHolder)
    {
        if (itemHolder != null)
        {
            DressController.PutOn(itemHolder.Asset, itemHolder.Asset.TargetSlot, itemHolder.Personage);
        }

        border_img.color = idle_color;
    }
コード例 #8
0
    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));
    }
コード例 #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>();
 }
コード例 #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);
        }
コード例 #11
0
 override protected void Reject(IItemHolder itemHolder)
 {
     border_img.color = idle_color;
 }
コード例 #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)];
 }
コード例 #13
0
 override protected void OnDismatchedItemEnter(IItemHolder itemHolder)
 {
     border_img.color = dismatch_color;
 }
コード例 #14
0
 protected virtual void OnMatchedItemEnter(IItemHolder itemHolder)
 {
 }
コード例 #15
0
 private bool IsMatch(IItemHolder itemHolder)
 {
     return(itemHolder.GetType() == ItemHolderType && SlotType.HasFlag(itemHolder.Asset.TargetSlot) && CanReceive(itemHolder));
 }
コード例 #16
0
 public void MoveToAnotherItemHolder(IItemHolder newItemHolder)
 {
     RemoveFromItemHolder();
     // Add to new Item Holder
     newItemHolder.AddItem(this);
 }
コード例 #17
0
 protected virtual void Reject(IItemHolder itemHolder)
 {
 }
コード例 #18
0
 protected virtual void Receive(IItemHolder itemHolder)
 {
 }
コード例 #19
0
 public HaulToItemHolderJob(Type itemType, IItemHolder itemHolder) : base((itemHolder as StaticObject).Position)
 {
     _itemType     = itemType;
     _dropPosition = (itemHolder as StaticObject).Position;
     _itemHolder   = itemHolder;
 }
コード例 #20
0
 public void SetItemHolder(IItemHolder itemHolder)
 {
     this.itemHolder = itemHolder;
 }
コード例 #21
0
 override protected bool CanReceive(IItemHolder itemHolder)
 {
     return(DressController.CanDress(itemHolder.Asset, SlotType));
 }
コード例 #22
0
 protected virtual bool CanReceive(IItemHolder itemHolder)
 {
     return(true);
 }
コード例 #23
0
 protected virtual void OnItemExit(IItemHolder itemHolder)
 {
 }
コード例 #24
0
 public CPlayable(Region region, PlayableKnownList objectKnownList, IStatHolder stats, IItemHolder items, EffectHolder effects, IEnumerable <ICharacterData> charData)
     : base(region, objectKnownList, stats, items, effects, charData)
 {
 }