override protected void OnItemExit(IItemHolder itemHolder) { if (!_is_capture) { border_img.color = idle_color; } }
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(); }
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); } }
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)); }
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>(); }
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; }
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; }
protected virtual void OnMatchedItemEnter(IItemHolder itemHolder) { }
private bool IsMatch(IItemHolder itemHolder) { return(itemHolder.GetType() == ItemHolderType && SlotType.HasFlag(itemHolder.Asset.TargetSlot) && CanReceive(itemHolder)); }
public void MoveToAnotherItemHolder(IItemHolder newItemHolder) { RemoveFromItemHolder(); // Add to new Item Holder newItemHolder.AddItem(this); }
protected virtual void Reject(IItemHolder itemHolder) { }
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; }
public void SetItemHolder(IItemHolder itemHolder) { this.itemHolder = itemHolder; }
override protected bool CanReceive(IItemHolder itemHolder) { return(DressController.CanDress(itemHolder.Asset, SlotType)); }
protected virtual bool CanReceive(IItemHolder itemHolder) { return(true); }
protected virtual void OnItemExit(IItemHolder itemHolder) { }
public CPlayable(Region region, PlayableKnownList objectKnownList, IStatHolder stats, IItemHolder items, EffectHolder effects, IEnumerable <ICharacterData> charData) : base(region, objectKnownList, stats, items, effects, charData) { }