Beispiel #1
0
    public static string itemDescription(itemTypes itemType)
    {
        switch (itemType)
        {
        case itemTypes.Beak:
            return("It appears to the the beak of a goose");

        case itemTypes.PlasticFork:
            return("It's an ordinary plastic fork... why did you keep this?");

        case itemTypes.KeyCard:
            return("It's a University Key Card, apparently you don't need this");

        case itemTypes.CateringCard:
            return("It's a Catering Card, food served 17:00 - 19:30");

        case itemTypes.YusuJumper:
            return("A University of York themed Jumper");

        case itemTypes.ElectionFlier:
            return("A Flier for the YUSU elections, seems like a waste of paper");

        case itemTypes.ReturnTicket:
            return("It's a 3 month old Return Ticket");

        default:
            return("error: No descrition exists for this item");
        }
    }
Beispiel #2
0
 public Tool(string name, int amount, itemTypes type, int staminaAmount)
 {
     this.name          = name;
     this.itemAmount    = amount;
     this.type          = type;
     this.staminaAmount = staminaAmount;
 }
Beispiel #3
0
    public static string itemDisplayName(itemTypes itemType)
    {
        switch (itemType)
        {
        case itemTypes.Beak:
            return("Goose Beak");

        case itemTypes.PlasticFork:
            return("Plastic Fork");

        case itemTypes.KeyCard:
            return("Key Card");

        case itemTypes.CateringCard:
            return("Catering Card");

        case itemTypes.YusuJumper:
            return("YUSU Jumper");

        case itemTypes.ElectionFlier:
            return("Election Flier");

        case itemTypes.ReturnTicket:
            return("Return Ticket");

        default:
            return("error: invalid item");
        }
    }
Beispiel #4
0
    public static int itemCost(itemTypes itemType)
    {
        switch (itemType)
        {
        case itemTypes.Beak:
            return(1);

        case itemTypes.PlasticFork:
            return(2);

        case itemTypes.KeyCard:
            return(10);

        case itemTypes.CateringCard:
            return(10);

        case itemTypes.YusuJumper:
            return(20);

        case itemTypes.ElectionFlier:
            return(3);

        case itemTypes.ReturnTicket:
            return(2);

        default:
            return(0);
        }
    }
Beispiel #5
0
    public static CombatAbility itemAbility(itemTypes itemType)
    {
        switch (itemType)
        {
        case itemTypes.Beak:
            return(new SimpleAttack(15, 40, "beak", 0, "Beak Poke"));

        case itemTypes.PlasticFork:
            return(new SimpleAttack(10, 45, "melee", 0, "Fork Stab"));

        case itemTypes.KeyCard:
            return(new SimpleAttack(10, 55, "melee", 0, "KeyCard Swing"));

        case itemTypes.CateringCard:
            return(new SimpleHeal(10, 60, 0, "Food"));

        case itemTypes.ElectionFlier:
            return(new SimpleAttack(0, 100, "melee", 0, "Canvasing"));

        case itemTypes.YusuJumper:
            return(new SimpleAttack(15, 65, "melee", 0, "Smother by merchandising"));

        case itemTypes.ReturnTicket:
            return(new SimpleAttack(20, 40, "melee", 0, "Torn Sorrow"));

        default:
            return(null);
        }
    }
Beispiel #6
0
 public HealItem(string itemName, int itemAmount, itemTypes itemType, int healingAmount)
 {
     this.itemName      = itemName;
     this.itemAmount    = itemAmount;
     this.itemType      = itemType;
     this.healingAmount = healingAmount;
 }
Beispiel #7
0
 public Money(string itemName, int itemAmount, itemTypes itemType, coinAmount cAmount)
 {
     this.itemName   = itemName;
     this.itemAmount = itemAmount;
     this.itemType   = itemType;
     this.cAmount    = cAmount;
 }
Beispiel #8
0
 public ShopItem(string name, string description, int code, int price, itemTypes itemType)
 {
     this.name        = name;
     this.description = description;
     this.code        = code;
     this.price       = price;
     this.itemType    = itemType;
 }
Beispiel #9
0
        public Task <Player[]> GetAllPlayersWithItem(itemTypes itemType)
        {
            var           builder  = Builders <Player> .Filter;
            var           filter   = builder.ElemMatch(e => e.itemList, i => i.Type == itemType.ToString());
            List <Player> _players = _collection.Find(filter).ToListAsync().Result;

            return(Task.FromResult(_players.ToArray()));
        }
Beispiel #10
0
 public Weapon(String name, int amount, itemTypes type, int damageAmount, float range, int staminaAmount)
 {
     this.name          = name;
     this.amount        = amount;
     this.type          = type;
     this.damageAmount  = damageAmount;
     this.range         = range;
     this.staminaAmount = staminaAmount;
 }
 public placeableItem(itemTypes placedType, Point dropLocation, Point pageOrigin, float scale)
 {
     _itemType = placedType;
     _pageOrigin = new Point(pageOrigin.X, pageOrigin.Y);
     this._offsetLocation_units.X = ((float)dropLocation.X - (float)pageOrigin.X) / scale;
     this._offsetLocation_units.Y = ((float)dropLocation.Y - (float)pageOrigin.Y) / scale;
     this._magnification = scale;
     this._location = dropLocation;
 }
Beispiel #12
0
 //function that searches inventory for item
 int lookForItem(itemTypes item)
 {
     for (int a = 0; a < inventory.Count; a++)
     {
         if (inventory [a].itemType == item)
         {
             return(a);
         }
     }
     return(-1);
 }
Beispiel #13
0
 public Item(string n, itemTypes type, int v, int c, string d, bool uif = true, bool uib = true, bool ts = true, bool aoe = false)
 {
     name        = n;
     itemType    = type;
     value       = v;
     count       = c;
     description = d;
     useInField  = uif;
     useInBattle = uib;
     targetSelf  = ts;
     isAOE       = aoe;
 }
Beispiel #14
0
    Business findClosestStore(itemTypes itemTypeRequired, string itemNameRequired = "", List <Business> ignore = null)
    {
        //get all businesses in world
        Business[] all      = GameObject.FindObjectsOfType <Business> ();
        Business   closest  = null;
        float      distance = Mathf.Infinity;

        //loop through every business
        foreach (Business bus in all)
        {
            //check if business is within ignore list
            if (ignore != null && ignore.Count != 0)
            {
                if (ignore.Contains(bus))
                {
                    //if so skip this business
                    continue;
                }
            }

            //check if business is open
            if (bus.open)
            {
                //search business for product
                List <Product> tempProducts = bus.SearchProducts(new ShopTest(itemTypeRequired, itemNameRequired, this));

                //check if product list exists
                if (tempProducts != null)
                {
                    //check if products exists
                    if (tempProducts.Count != 0)
                    {
                        //check if distance is less than current distance above
                        if (Vector3.Distance(transform.position, bus.buildingPosition.transform.position) < distance)
                        {
                            //if so set closest business to be this
                            distance = Vector3.Distance(transform.position, bus.transform.position);
                            closest  = bus;

                            //add all business products to list
                            onSale.Clear();
                            foreach (Product prod in tempProducts)
                            {
                                onSale.Add(prod);
                            }
                        }
                    }
                }
            }
        }
        return(closest);
    }
Beispiel #15
0
 public Item(Item item)
 {
     Stats        = item.Stats;
     ObjectSlug   = item.ObjectSlug;
     Description  = item.Description;
     ActionName   = item.ActionName;
     stackable    = item.stackable;
     ItemName     = item.ItemName;
     ItemModifier = item.ItemModifier;
     ItemType     = item.ItemType;
     ItemPrice    = item.ItemPrice;
     AbsoluteSlug = item.AbsoluteSlug;
     Uuid         = System.Guid.NewGuid();
 }
Beispiel #16
0
 public Item(List <BaseStat> Stats, string ObjectSlug, string Description, string ActionName, bool stackable,
             string ItemName, bool ItemModifier, itemTypes ItemType, string AbsoluteSlug, int ItemPrice)
 {
     this.Stats        = Stats;
     this.ObjectSlug   = ObjectSlug;
     this.Description  = Description;
     this.ActionName   = ActionName;
     this.stackable    = stackable;
     this.ItemName     = ItemName;
     this.ItemModifier = ItemModifier;
     this.ItemType     = ItemType;
     this.AbsoluteSlug = AbsoluteSlug;
     this.ItemPrice    = ItemPrice;
     Uuid = System.Guid.NewGuid();
 }
Beispiel #17
0
    public static bool itemConsumedOnUse(itemTypes itemType)
    {
        switch (itemType)
        {
        case itemTypes.Beak:
            return(false);

        case itemTypes.PlasticFork:
            return(false);

        case itemTypes.KeyCard:
            return(false);

        case itemTypes.CateringCard:
            return(false);

        default:
            return(true);
        }
    }
Beispiel #18
0
    /// <summary>
    /// [EXTENSION] - Added new item descriptions (listed in class summary)
    /// </summary>
    /// <returns>The description of the item</returns>
    /// <param name="itemType">The item type in question</param>
    public static string itemDescription(itemTypes itemType)
    {
        switch (itemType)
        {
        case itemTypes.Beak:
            return("It appears to the the beak of a goose");

        case itemTypes.PlasticFork:
            return("It's an ordinary plastic fork... why did you keep this?");

        case itemTypes.JagerGrenade:
            return("A variation on the Jägerbomb that can cause 30-40 damage");

        case itemTypes.LuckySpoon:
            return("Spin the wheel! Does anywhere between 0 and 40 damage");

        default:
            return("error: No descrition exists for this item");
        }
    }
Beispiel #19
0
    /// <summary>
    /// [EXTENSION] - Added new item display names (listed in class summary)
    /// </summary>
    /// <returns>The name to display for the item</returns>
    /// <param name="itemType">The type of item in question</param>
    public static string itemDisplayName(itemTypes itemType)
    {
        switch (itemType)
        {
        case itemTypes.Beak:
            return("Goose Beak");

        case itemTypes.PlasticFork:
            return("Plastic Fork");

        case itemTypes.JagerGrenade:
            return("JägerGrenade");

        case itemTypes.LuckySpoon:
            return("Lucky Spoon");

        default:
            return("error: invalid item");
        }
    }
Beispiel #20
0
    /// <summary>
    /// [EXTENSION] - Added new item abilities(listed in class summary)
    /// </summary>
    /// <returns>The action performed when the item is used</returns>
    /// <param name="itemType">The item type in question</param>
    public static CombatAbility itemAbility(itemTypes itemType)
    {
        switch (itemType)
        {
        case itemTypes.Beak:
            return(new SimpleAttack(1, 1, "beak", 0, "Beak Poke"));

        case itemTypes.PlasticFork:
            return(new SimpleAttack(10, 20, "melee", 0, "Fork Stab"));

        case itemTypes.JagerGrenade:
            return(new SimpleAttack(30, 40, "range", 0, "Grenade Throw"));

        case itemTypes.LuckySpoon:
            return(new SimpleAttack(0, 50, "melee", 0, "flick"));

        default:
            return(null);
        }
    }
Beispiel #21
0
    /// <summary>
    /// [EXTENSION] - Added new item properties (listed in class summary)
    /// </summary>
    /// <returns><c>true</c>, if item is consumed on use, <c>false</c> otherwise.</returns>
    /// <param name="itemType">The item type in question</param>
    public static bool itemConsumedOnUse(itemTypes itemType)
    {
        switch (itemType)
        {
        case itemTypes.Beak:
            return(false);

        case itemTypes.PlasticFork:
            return(false);

        case itemTypes.JagerGrenade:
            return(true);

        case itemTypes.LuckySpoon:
            return(false);

        default:
            return(false);
        }
    }
Beispiel #22
0
 public void setItemType(itemTypes itemType)
 {
     this.itemType = itemType;
 }
 public Task <Player[]> GetAllPlayersWithItem(itemTypes weapon)
 {
     return(repository.GetAllPlayersWithItem(weapon));
 }
Beispiel #24
0
 public placeableItem(itemTypes placedType, Point pageOrigin, float scale, itemSaveClass iSC)
 {
     _itemType = placedType;
     _pageOrigin = new Point(pageOrigin.X, pageOrigin.Y);
     this._windowLocationPMF_units.X = iSC.windowLocation.X;
     this._windowLocationPMF_units.Y = iSC.windowLocation.Y;
     this._itemLocationPMF_units.X = iSC.itemLocation.X;
     this._itemLocationPMF_units.Y = iSC.itemLocation.Y;
     this._magnification = scale;
     this._windowLocation = new Point(Convert.ToInt16(this._windowLocationPMF_units.X * scale), Convert.ToInt16(this._windowLocationPMF_units.Y * scale));
     this._itemLocation = new Point(Convert.ToInt16(this._itemLocationPMF_units.X * scale), Convert.ToInt16(this._itemLocationPMF_units.Y * scale));
 }
Beispiel #25
0
        private static object Item(itemTypes itemType)
        {
            Item item = new Item(itemType);

            return(item);
        }
Beispiel #26
0
 public Task <Player[]> GetAllPlayersWithItem([FromQuery] itemTypes weapon)
 {
     return(processor.GetAllPlayersWithItem(weapon));
 }
Beispiel #27
0
        public virtual void load(itemSaveClass iSC)
        {
            _itemType = (itemTypes)Enum.Parse(typeof(itemTypes), iSC.itemType);
            _zOrder = iSC.zOrder;
            _windowSize_units = iSC.windowSize;
            _windowLocationPMF_units = iSC.windowLocation;
            _itemSize_units = iSC.itemSize;
            _itemLocationPMF_units = iSC.itemLocation;

        }
Beispiel #28
0
 public static bool itemHasAbility(itemTypes itemType)
 {
     return(itemAbility(itemType) != null);
 }
Beispiel #29
0
 public ShopTest(itemTypes type = 0, string name = "", HumanLife life = null)
 {
     productType = type;
     productName = name;
     person      = life;
 }
Beispiel #30
0
    void Shop(itemTypes itemType, string itemName = "", bool compareProductValue = false, bool attemptDelivery = false)
    {
        //check if search for new item, if so remove ignore list
        if (lastItemSearchedFor != itemType || lastItemNameSearchFor != itemName)
        {
            ignoreForCurrent.Clear();
        }

        //check if last shop check was longer than 1 tick if so reset shop options
        if (tick - lastShopTick > 1)
        {
            ignoreForCurrent.Clear();
            currentBusiness = null;
        }

        lastShopTick          = tick;
        lastItemSearchedFor   = itemType;
        lastItemNameSearchFor = itemName;

        if (currentBusiness)
        {
            //check if shop is open
            if (currentBusiness.open)
            {
                //test if the business allows delivery
                if (currentBusiness.online && attemptDelivery)
                {
                    //if buying product from store fails
                    if (!testShop(currentBusiness, compareProductValue, true, true))
                    {
                        //check if it is possible to buy in store
                        if (currentBusiness.inStore)
                        {
                            //travel to store
                            if (Functions.checkDistanceBusiness(this, agent, currentBusiness, currentBusiness.buildingPosition.transform.position, minDist))
                            {
                                //buy product
                                testShop(currentBusiness, compareProductValue, false, false);
                                currentBusiness = null;
                            }
                        }
                        else
                        {
                            currentBusiness = null;
                        }
                    }
                    else
                    {
                        currentBusiness = null;
                    }
                }
                else
                {
                    //check if person is within range of business
                    if (Functions.checkDistanceBusiness(this, agent, currentBusiness, currentBusiness.buildingPosition.transform.position, minDist))
                    {
                        //try to buy product from store
                        testShop(currentBusiness, compareProductValue, false, false);
                        currentBusiness = null;
                    }
                }
            }
        }
        else
        {
            //find the next closest store
            currentBusiness = findClosestStore(itemType, itemName, ignoreForCurrent);
        }
    }
Beispiel #31
0
 public Seed(string name, int amount, itemTypes type)
 {
     this.seedName   = name;
     this.amountLeft = amount;
     this.type       = type;
 }
Beispiel #32
0
 public void setItemType(itemTypes type)
 {
     this.type = type;
 }