Esempio n. 1
0
 public Consumable(Vector2 position)
 {
     pos = position;
     rect = new BoundingRectangle(position, 10);
     int randNum = Game1.random.Next(3);
     switch (randNum)
     {
         case 0:
             cType = ConsumableType.MASS;
             draw = new DrawOscillate(SpriteDatabase.GetAnimation("pwr_mass"), .4f);
             break;
         case 1:
             cType = ConsumableType.SLIP;
             draw = new DrawOscillate(SpriteDatabase.GetAnimation("pwr_slick"), .4f);
             break;
         case 2:
             cType = ConsumableType.SPEED;
             draw = new DrawOscillate(SpriteDatabase.GetAnimation("pwr_speed"), .4f);
             break;
         case 3:
             cType = ConsumableType.TURN;
             draw = new DrawOscillate(SpriteDatabase.GetAnimation("pwr_turn"), .4f);
             break;
     }
 }
Esempio n. 2
0
 public Consumable(ConsumableType type, float degree, int quantity)
 {
     this.type     = type;
     this.degree   = degree;
     this.quantity = quantity;
     displayType   = "Potion";
 }
Esempio n. 3
0
    public Consumable(string name, float baseValue, ConsumableType type, int potency)
        : base(name, baseValue)
    {
        this.type = type;

        this.potency = potency;
    }
Esempio n. 4
0
 public Consumable(SerializationInfo info, StreamingContext ctxt)
     : base(info, ctxt)
 {
     this.consumabletype = (ConsumableType)info.GetValue("consumabletype", typeof(int));
     this.effectiveness = (int)info.GetValue("effectiveness", typeof(int));
     this.count = (int)info.GetValue("count", typeof(int));
 }
Esempio n. 5
0
    private void FixedUpdate()
    {
        PointConsumableArrow();

        if (needsReset || Player.Instance.transform.position.y > transform.position.y + 12f)
        {
            consumableType = (ConsumableType)Random.Range(0, (int)ConsumableType.COUNT);
            switch (consumableType)
            {
            case ConsumableType.AddArmor:
                currentRenderer.sprite = armorSprite;
                break;

            case ConsumableType.Invincible:
                currentRenderer.sprite = invincibleSprite;
                break;

            case ConsumableType.AddHP:
                currentRenderer.sprite = hpSprite;
                break;

            case ConsumableType.AddAmmo:
                currentRenderer.sprite = ammoSprite;
                break;

            default:
                Debug.Log("Not a consumable");
                break;
            }

            needsReset = false;
        }
    }
Esempio n. 6
0
 private int CalculatePrice(ConsumableType consumable)
 {
     if (consumableIDDictionary.ContainsKey(consumable))
     {
         PickupObject databaseObject = PickupObjectDatabase.GetById(consumableIDDictionary[consumable]);
         if (databaseObject != null)
         {
             int price = databaseObject.PurchasePrice;
             GameLevelDefinition lastLoadedLevelDefinition = GameManager.Instance.GetLastLoadedLevelDefinition();
             float num4        = (lastLoadedLevelDefinition == null) ? 1f : lastLoadedLevelDefinition.priceMultiplier;
             float moddedPrice = price * num4;
             if (LastOwner)
             {
                 moddedPrice = price * LastOwner.stats.GetStatValue(PlayerStats.StatType.GlobalPriceMultiplier);
                 return(Mathf.RoundToInt(moddedPrice));
             }
             else
             {
                 return(Mathf.RoundToInt(moddedPrice));
             }
         }
         else
         {
             return(420);
         }
     }
     else
     {
         return(69);
     }
 }
Esempio n. 7
0
 public Consumable(int itemid)
     : base(itemid)
 {
     this.consumabletype = this.setConsumableType(itemid);
     this.effectiveness = int.Parse(ItemStats.GetStat(itemid, "effectiveness"));
     this.count = 1;
 }
Esempio n. 8
0
		public Item(ConsumableType type_,string name_,string symbol_,Color color_){
			itype = type_;
			quantity = 1;
			ignored = false;
			do_not_stack = false;
			name = name_;
			the_name = "the " + name;
			switch(name[0]){
			case 'a':
			case 'e':
			case 'i':
			case 'o':
			case 'u':
			case 'A':
			case 'E':
			case 'I':
			case 'O':
			case 'U':
				a_name = "an " + name;
				break;
			default:
				a_name = "a " + name;
				break;
			}
			symbol = symbol_;
			color = color_;
			row = -1;
			col = -1;
			light_radius = 0;
		}
Esempio n. 9
0
    public void ResetShop(int nbrOfItem)
    {
        for (int i = 0; i < nbrOfItem; i++)
        {
            GameObject itemUI = Instantiate(Resources.Load("Prefabs/ShopItem")) as GameObject;
            itemUI.transform.SetParent(transform);

            GearType randomGearType = (GearType)Random.Range(0, System.Enum.GetValues(typeof(GearType)).Length);
            string   gearName       = "";
            int      cost           = 0;
            if (randomGearType == GearType.Weapon)
            {
                WeaponType randomWeaponType = (WeaponType)Random.Range(0, System.Enum.GetValues(typeof(WeaponType)).Length);
                switch (randomWeaponType)
                {
                case WeaponType.NormalGun:
                    gearName = "Normal Gun";
                    cost     = 20;
                    break;

                case WeaponType.UziGun:
                    gearName = "UZI Gun";
                    cost     = 30;
                    break;

                case WeaponType.ShotGun:
                    gearName = "ShotGun";
                    cost     = 40;
                    break;

                default:
                    break;
                }
            }
            else if (randomGearType == GearType.Consumable)
            {
                ConsumableType randomConsumableType = (ConsumableType)Random.Range(0, System.Enum.GetValues(typeof(ConsumableType)).Length);
                switch (randomConsumableType)
                {
                case ConsumableType.HealingPotion:
                    gearName = "HealingPotion";
                    break;

                default:
                    break;
                }
            }

            if (gearName == "")
            {
                Debug.LogError("Error in random gear generation");
                return;
            }
            ShopItem item = itemUI.GetComponent <ShopItem>();
            item.InitializeShopItem(itemUI, cost, gearName, this, playerController);
            shopItems.Add(item);
            item.gameObject.SetActive(false);
        }
    }
Esempio n. 10
0
 public Consumable(int itemid, string name, int weight, int value, int speed, ItemType type, System.Drawing.Image picture, ConsumableType consumabletype, int effectiveness, int count)
     : base(itemid, name, weight, value, speed, type)
 {
     this.picture = picture;
     this.consumabletype = consumabletype;
     this.effectiveness = effectiveness;
     this.count = count;
 }
 public void Collected(ConsumableType collectable, int amount)
 {
     if (characterInventory == null)
     {
         return;
     }
     characterInventory.AddItem(collectable, amount);
 }
Esempio n. 12
0
 public void Init(int itemId, string itemName, string itemDesc, Sprite itemIcon, ConsumableType type, int amount)
 {
     this.itemID          = itemId;
     this.itemName        = itemName;
     this.itemDescription = itemDesc;
     this.itemIcon        = itemIcon;
     this.consumableType  = type;
     this.amount          = amount;
 }
Esempio n. 13
0
    //物品列表-更新
    public void UpdateList(ConsumableType consumableType, int slotLevelLimit)
    {
        List <int> itemObjects = new List <int>();

        for (int i = 0; i < gc.consumableNum.Count; i++)
        {
            if (gc.consumableNum[i] > 0)
            {
                if (consumableType == ConsumableType.None)
                {
                    itemObjects.Add(i);
                }
                else
                {
                    if (DataManager.mConsumableDict[i].Type == consumableType && DataManager.mConsumableDict[i].SlotLevel <= slotLevelLimit)
                    {
                        itemObjects.Add(i);
                    }
                }
            }
        }

        GameObject go;

        for (int i = 0; i < itemObjects.Count; i++)
        {
            if (i < itemGoPool.Count)
            {
                go = itemGoPool[i];
                itemGoPool[i].transform.GetComponent <RectTransform>().localScale = Vector2.one;
            }
            else
            {
                go = Instantiate(Resources.Load("Prefab/UILabel/Label_Consumable")) as GameObject;
                go.transform.SetParent(itemListGo.transform);
                itemGoPool.Add(go);
            }

            int row = i == 0 ? 0 : (i % 9);
            int col = i == 0 ? 0 : (i / 9);
            go.GetComponent <RectTransform>().anchoredPosition     = new Vector2(row * 50f, col * -50f);
            go.transform.GetChild(0).GetComponent <Image>().sprite = Resources.Load <Sprite>("Image/Other/" + DataManager.mConsumableDict[itemObjects[i]].Pic);
            go.transform.GetChild(1).GetComponent <Text>().text    = gc.consumableNum[itemObjects[i]].ToString();
            go.transform.GetComponent <InteractiveLabel>().index   = itemObjects[i];
            int ID = itemObjects[i];
            go.transform.GetComponent <Button>().onClick.AddListener(delegate() {
                UpdateSelectedPos(new Vector2(row * 50f, col * -50f));
                nowItemID = ID;
                UpdateInfo(ID);
            });
        }
        for (int i = itemObjects.Count; i < itemGoPool.Count; i++)
        {
            itemGoPool[i].transform.GetComponent <RectTransform>().localScale = Vector2.zero;
        }
        itemListGo.transform.GetComponent <RectTransform>().sizeDelta = new Vector2(455f, Mathf.Max(442f, (itemObjects.Count / 9) * 50f));
    }
Esempio n. 14
0
 public void SetField(string fieldName, object value)
 {
     switch (fieldName)
     {
     case nameof(ConsumableType):
         ConsumableType = (ConsumableType)Enum.ToObject(typeof(ConsumableType), value);
         break;
     }
 }
 public Consumable(string name, int id, int max, int amt, int res, ConsumableType type)
 {
     Name          = name;
     ID            = id;
     maxAmount     = max;
     Amount        = amt;
     restoreAmount = res;
     ctype         = type;
 }
Esempio n. 16
0
        public SaveItem(InventoryItem item)
        {
            if (item is ToolItem)
            {
                type = ItemType.TOOL;
            }
            else if (item is MineralItem)
            {
                type = ItemType.MINERAL;
            }
            else if (item is ConsumableItem)
            {
                type = ItemType.CONSUMABLE;
            }
            else
            {
                type = ItemType.OTHER;
            }

            itemName   = item.ItemName;
            itemText   = item.ItemText;
            value      = item.Value;
            spriteName = item.SpriteName;

            switch (type)
            {
            case ItemType.TOOL:
                ToolItem t = item as ToolItem;

                toolType  = t.Type;
                inputType = t.InputType;
                power     = t.Power;
                precision = t.Precision;
                sustainedBreakCooldown = t.SustainedBreakCooldown;
                breakRadius            = t.BreakRadius;
                break;

            case ItemType.MINERAL:
                MineralItem m = item as MineralItem;

                modelName = m.ModelName;
                colorR    = m.Color.r;
                colorG    = m.Color.g;
                colorB    = m.Color.b;
                break;

            case ItemType.CONSUMABLE:
                ConsumableItem c = item as ConsumableItem;

                consumableType = c.Type;
                strength       = c.Strength;
                duration       = c.Duration;
                break;
            }
        }
 public void UseItem(ConsumableType requestedType)
 {
     foreach (Slot s in inventorySlots)
     {
         if (s.slotType.Equals(requestedType))
         {
             s.UseItem();
             return;
         }
     }
 }
Esempio n. 18
0
        public ConsumableInfo GetConsumableInfo(ConsumableType CType)
        {
            ConsumableInfo info = null;

            if (this.Consumables != null)
            {
                info = this.Consumables.Find(c => c.Type == CType);
                return(info);
            }
            return(info);
        }
Esempio n. 19
0
        public void SetValues(string itemName, string itemText, int value, string spriteName, ConsumableType type, float strength, int duration)
        {
            this.spriteName = spriteName;
            this.itemName   = itemName;
            this.itemText   = itemText;
            this.value      = value;

            this.type     = type;
            this.strength = strength;
            this.duration = duration;
        }
 public void AddItem(ConsumableType requestedType, int amount = 1)
 {
     foreach (Slot s in inventorySlots)
     {
         if (s.slotType.Equals(requestedType))
         {
             s.AddItem(amount);
             return;
         }
     }
 }
		/// <summary>
		/// Creates the consumable in the scene for local players to interact with
		/// </summary>
		/// <returns>The consumable.</returns>
		/// <param name="type">Type.</param>
		/// <param name="position">Position.</param>
		public static GameObject createConsumable(ConsumableType type, Vector3 position){

			// Get a reference to what we want to create
			GameObject consumableRef = getReferenceToType (type);

			// Instantiate the reference into the scene.
			GameObject consumable = (GameObject)GameObject.Instantiate (consumableRef, position, Quaternion.identity);

			return consumable;

		}
        public bool HasItem(ConsumableType requestedType)
        {
            foreach (Slot s in inventorySlots)
            {
                if (s.slotType.Equals(requestedType))
                {
                    return(s.HasItems());
                }
            }

            return(false);
        }
        public bool HasSpace(ConsumableType requestedType)
        {
            foreach (Slot s in inventorySlots)
            {
                if (s.slotType.Equals(requestedType) && s.HasSpace())
                {
                    return(true);
                }
            }

            return(false);
        }
Esempio n. 24
0
    public override void BeginExecution(Entity stateEntity, ActionContext action, Otto actor)
    {
        base.BeginExecution(stateEntity, action, actor);

        AnimationComplete = false;
        m_Animator.SetTrigger(k_Consumables);

        var dispenser = action.GetTrait <Dispenser>(1);

        m_ConsumableType = dispenser.ConsumableType;
        m_Animator.SetTrigger(m_ConsumableType == ConsumableType.Apple ? k_PocketFood : k_PocketDrink);
    }
Esempio n. 25
0
    public override void BeginExecution(StateData state, ActionKey action, Otto actor)
    {
        base.BeginExecution(state, action, actor);

        AnimationComplete = false;
        m_Animator.SetTrigger(k_Consumables);

        var dispenser = state.GetTraitOnObjectAtIndex <Dispenser>(action[1]);

        m_ConsumableType = dispenser.ConsumableType;
        m_Animator.SetTrigger(m_ConsumableType == ConsumableType.Apple ? k_PocketFood : k_PocketDrink);
    }
Esempio n. 26
0
        public static string ToDescription(this ConsumableType type)
        {
            var    attributes  = (DescriptionAttribute[])type.GetType().GetField(type.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false);
            string description = attributes.Length > 0 ? attributes[0].Description : string.Empty;
            string result      = string.Empty;

            if (!string.IsNullOrEmpty(description))
            {
                result = typeof(LanguageData).GetProperty(description).GetValue(null, null) as string;
            }
            return(result);
        }
        public int GetItemStock(ConsumableType requestedType)
        {
            foreach (Slot s in inventorySlots)
            {
                if (s.slotType.Equals(requestedType))
                {
                    return(s.StockItem);
                }
            }

            return(-1);
        }
Esempio n. 28
0
        private void SetConsumableTo(ConsumableType consumable)
        {
            if (spriteDefDictionary.ContainsKey(consumable))
            {
                base.sprite.SetSprite(DeliveryBox.spriteIDs[spriteDefDictionary[consumable]]);
            }
            else
            {
                base.sprite.SetSprite(DeliveryBox.spriteIDs[0]);
            }

            CurrentConsumable = consumable;
        }
Esempio n. 29
0
    public override void BeginExecution(StateData state, ActionKey action, Otto actor)
    {
        base.BeginExecution(state, action, actor);

        var inventory = state.GetTraitOnObjectAtIndex <Inventory>(action[1]);

        m_ConsumableType = inventory.ConsumableType;
        m_NeedType       = inventory.SatisfiesNeed;
        m_NeedReduction  = inventory.NeedReduction;

        m_Animator.SetTrigger(k_Consumables);
        m_Animator.SetTrigger(m_ConsumableType == ConsumableType.Apple ? k_EatFromPocket : k_DrinkFromPocket);
    }
		/// <summary>
		/// Keeps accessing the resources folder all in one place so that
		/// if anything changes in there, you only have to update this one method 
		/// and no where else in the code when it comes to consumables
		/// </summary>
		/// <returns>The reference to type.</returns>
		/// <param name="type">Type.</param>
		private static GameObject getReferenceToType(ConsumableType type){

			switch(type){

			case ConsumableType.Battery:
				return Resources.Load<GameObject> ("Consumables/Battery");

			default:
				return null;

			}

		}
Esempio n. 31
0
        public override IConsumable GetConsumableFactory(ConsumableType consumableType)
        {
            switch (consumableType)
            {
            case ConsumableType.Potion:
                IConsumable potion = new Potion();
                return(potion);

            case ConsumableType.Food:
                IConsumable food = new Food();
                return(food);
            }
            return(null);
        }
Esempio n. 32
0
    public override void BeginExecution(Entity stateEntity, ActionContext action, Otto actor)
    {
        base.BeginExecution(stateEntity, action, actor);

        var ecsAction = action;
        var inventory = ecsAction.GetTrait <Inventory>(1);

        m_ConsumableType = inventory.ConsumableType;
        m_NeedType       = inventory.SatisfiesNeed;
        m_NeedReduction  = inventory.NeedReduction;

        m_Animator.SetTrigger(k_Consumables);
        m_Animator.SetTrigger(m_ConsumableType == ConsumableType.Apple ? k_EatFromPocket : k_DrinkFromPocket);
    }
Esempio n. 33
0
        public override void FrameFeed()
        {
            if (characterInventory == null)
            {
                characterInventory = agent.RequestComponent <CharacterInventoryComponent>();
                return;
            }

            ConsumableType smokeItem = ConsumableType.Bomb;

            if (InputConfig.SmokeBomb() && characterInventory.HasItem(smokeItem))
            {
                characterInventory.UseItem(smokeItem);
                Fire();
            }
        }
Esempio n. 34
0
    public static Consumable CreateVitalPot()
    {
        //init

        Consumable consum = new Consumable();

        //decide what type of pot to make
        ConsumableType consumType = ConsumableType.Health;

        consumType = GM.GetRandomEnum <ConsumableType>();

        consum.ConsumType = consumType;

        //return the new item
        return(consum);
    }
Esempio n. 35
0
        private void AddPicture(ConsumableType CType)
        {
            PictureBox pb = (PictureBox)PlacementCollection["consumable" + LastControl];

            pb.AccessibleName = CType.ToString();

            if (imageMap.ContainsKey(CType))
            {
                pb.Image = imageMap[CType];
            }
            else
            {
                pb.Image = null;
            }
            pb.Refresh();
            pb.Visible = true;
        }
Esempio n. 36
0
        public void SetField(string fieldName, object value)
        {
            switch (fieldName)
            {
            case nameof(ConsumableType):
                ConsumableType = (ConsumableType)Enum.ToObject(typeof(ConsumableType), value);
                break;

            case nameof(Amount):
                Amount = (System.Int64)value;
                break;

            case nameof(SatisfiesNeed):
                SatisfiesNeed = (NeedType)Enum.ToObject(typeof(NeedType), value);
                break;

            case nameof(NeedReduction):
                NeedReduction = (System.Int64)value;
                break;
            }
        }
Esempio n. 37
0
 public Consumable(Vector2 position, ConsumableType type)
 {
     pos = position;
     rect = new BoundingRectangle(position, 10);
     cType = type;
     switch (type)
     {
         case ConsumableType.MASS:
             draw = new DrawOscillate(SpriteDatabase.GetAnimation("pwr_mass"), .4f);
             break;
         case ConsumableType.SLIP:
             draw = new DrawOscillate(SpriteDatabase.GetAnimation("pwr_slick"), .4f);
             break;
         case ConsumableType.SPEED:
             draw = new DrawOscillate(SpriteDatabase.GetAnimation("pwr_speed"), .4f);
             break;
         case ConsumableType.TURN:
             draw = new DrawOscillate(SpriteDatabase.GetAnimation("pwr_turn"), .4f);
             break;
     }
 }
Esempio n. 38
0
    private void AddConsumableDrops(BattleEndWindow battleEndWindow)
    {
        // Get Consumables
        int consumableDrops = Random.Range(stageInfo.consumableDropCountMin, stageInfo.consumableDropCountMax + 1);
        Dictionary <ConsumableType, int> consumablesCount = new Dictionary <ConsumableType, int>();

        for (int i = 0; i < consumableDrops; i++)
        {
            ConsumableType consumable = GameManager.Instance.GetRandomConsumable();
            GameManager.Instance.PlayerStats.consumables[consumable]++;
            if (!consumablesCount.ContainsKey(consumable))
            {
                consumablesCount.Add(consumable, 0);
            }
            consumablesCount[consumable]++;
        }

        foreach (KeyValuePair <ConsumableType, int> keyValue in consumablesCount)
        {
            battleEndWindow.AddToBodyText(keyValue.Key.ToString() + " +" + keyValue.Value + "\n");
        }
    }
Esempio n. 39
0
 public Item(Item i,int r,int c)
 {
     type = i.type;
     quantity = 1;
     charges = i.charges;
     other_data = i.other_data;
     switch(type){
     case ConsumableType.INVISIBILITY:
         charges = R.Between(2,3);
         break;
     case ConsumableType.DUST_STORM:
     case ConsumableType.SLUMBER:
     case ConsumableType.TELEKINESIS:
         charges = R.Between(2,6);
         break;
     //case ConsumableType.DIGGING:
     case ConsumableType.FLESH_TO_FIRE:
         charges = R.Between(3,6);
         break;
     case ConsumableType.REACH:
         charges = R.Between(4,7);
         break;
     case ConsumableType.WEBS:
         charges = R.Between(4,9);
         break;
     }
     ignored = false;
     do_not_stack = proto[type].do_not_stack;
     revealed_by_light = proto[type].revealed_by_light;
     name = i.name;
     a_name = i.a_name;
     the_name = i.the_name;
     symbol = i.symbol;
     color = i.color;
     row = r;
     col = c;
     light_radius = i.light_radius;
     sprite_offset = i.sprite_offset;
 }
Esempio n. 40
0
 public static void ShowKnownItems(Dict<ConsumableType,bool> IDed)
 {
     MouseUI.PushButtonMap();
     UI.draw_bottom_commands = false;
     UI.darken_status_bar = true;
     const int width = 25;
     List<ConsumableType> potion_order = new List<ConsumableType>{ConsumableType.STONEFORM,ConsumableType.CLOAKING,ConsumableType.VAMPIRISM,ConsumableType.HEALING,ConsumableType.MYSTIC_MIND,ConsumableType.SILENCE,ConsumableType.REGENERATION,ConsumableType.ROOTS,ConsumableType.BRUTISH_STRENGTH,ConsumableType.HASTE};
     List<ConsumableType> scroll_order = new List<ConsumableType>{ConsumableType.SUNLIGHT,ConsumableType.DARKNESS,ConsumableType.BLINKING,ConsumableType.RENEWAL,ConsumableType.FIRE_RING,ConsumableType.CALLING,ConsumableType.KNOWLEDGE,ConsumableType.PASSAGE,ConsumableType.THUNDERCLAP,ConsumableType.RAGE,ConsumableType.ENCHANTMENT,ConsumableType.TIME,ConsumableType.TRAP_CLEARING};
     List<ConsumableType> orb_order = new List<ConsumableType>{ConsumableType.BREACHING,ConsumableType.FREEZING,ConsumableType.SHIELDING,ConsumableType.BLADES,ConsumableType.CONFUSION,ConsumableType.FLAMES,ConsumableType.DETONATION,ConsumableType.PAIN,ConsumableType.TELEPORTAL,ConsumableType.FOG};
     List<ConsumableType> wand_order = new List<ConsumableType>{ConsumableType.DUST_STORM,ConsumableType.SLUMBER,ConsumableType.TELEKINESIS,ConsumableType.REACH,ConsumableType.INVISIBILITY,ConsumableType.WEBS,ConsumableType.FLESH_TO_FIRE};
     List<colorstring> potions = new List<colorstring>();
     List<colorstring> scrolls = new List<colorstring>();
     List<colorstring> orbs = new List<colorstring>();
     List<colorstring> wands = new List<colorstring>();
     List<List<colorstring>> string_lists = new List<List<colorstring>>{potions,scrolls,orbs,wands};
     int list_idx = 0;
     foreach(List<ConsumableType> item_list in new List<List<ConsumableType>>{potion_order,scroll_order,orb_order,wand_order}){
         int item_idx = 0;
         while(item_idx + 1 < item_list.Count){
             ConsumableType[] ct = new ConsumableType[2];
             string[] name = new string[2];
             Color[] ided_color = new Color[2];
             for(int i=0;i<2;++i){
                 ct[i] = item_list[item_idx + i];
                 name[i] = ct[i].ToString()[0] + ct[i].ToString().Substring(1).ToLower();
                 name[i] = name[i].Replace('_',' ');
                 if(IDed[ct[i]]){
                     ided_color[i] = Color.Cyan;
                 }
                 else{
                     ided_color[i] = Color.DarkGray;
                 }
             }
             int num_spaces = width - (name[0].Length + name[1].Length);
             string_lists[list_idx].Add(new colorstring(name[0],ided_color[0],"".PadRight(num_spaces),Color.Black,name[1],ided_color[1]));
             item_idx += 2;
         }
         if(item_list.Count % 2 == 1){
             ConsumableType ct = item_list.Last();
             string name = (ct.ToString()[0] + ct.ToString().Substring(1).ToLower()).Replace('_',' ');
             //name = name[i].Replace('_',' ');
             Color ided_color = Color.DarkGray;
             if(IDed[ct]){
                 ided_color = Color.Cyan;
             }
             int num_spaces = width - name.Length;
             string_lists[list_idx].Add(new colorstring(name,ided_color,"".PadRight(num_spaces),Color.Black));
         }
         ++list_idx;
     }
     Screen.WriteMapString(0,0,"".PadRight(COLS,'-'));
     for(int i=1;i<ROWS+2;++i){
         Screen.WriteMapString(i,0,"".PadToMapSize());
     }
     Screen.WriteMapString(ROWS+2,0,"".PadRight(COLS,'-'));
     const Color label_color = Color.Yellow;
     const int first_column_offset = 2;
     const int second_column_offset = first_column_offset + 35;
     const int first_item_row = 4;
     Screen.WriteMapString(first_item_row - 1,8 + first_column_offset,"- Potions -",label_color);
     Screen.WriteMapString(first_item_row - 1,7 + second_column_offset,"- Scrolls -",label_color);
     int line = first_item_row;
     foreach(colorstring s in potions){
         Screen.WriteMapString(line,first_column_offset,s);
         ++line;
     }
     line = first_item_row;
     foreach(colorstring s in scrolls){
         Screen.WriteMapString(line,second_column_offset,s);
         ++line;
     }
     const int second_item_row = first_item_row + 11;
     Screen.WriteMapString(second_item_row - 1,9 + first_column_offset,"- Orbs -",label_color);
     Screen.WriteMapString(second_item_row - 1,8 + second_column_offset,"- Wands -",label_color);
     line = second_item_row;
     foreach(colorstring s in orbs){
         Screen.WriteMapString(line,first_column_offset,s);
         ++line;
     }
     line = second_item_row;
     foreach(colorstring s in wands){
         Screen.WriteMapString(line,second_column_offset,s);
         ++line;
     }
     B.DisplayNow("Discovered item types: ");
     Screen.CursorVisible = true;
     Input.ReadKey();
     MouseUI.PopButtonMap();
     UI.draw_bottom_commands = true;
     UI.darken_status_bar = false;
 }
Esempio n. 41
0
 public static Item Create(ConsumableType type,int r,int c)
 {
     Item i = null;
     if(M.tile.BoundsCheck(r,c)){
         if(M.tile[r,c].inv == null){
             i = new Item(proto[type],r,c);
             if(i.light_radius > 0){
                 i.UpdateRadius(0,i.light_radius);
             }
             M.tile[r,c].inv = i;
             if(type == ConsumableType.BLAST_FUNGUS){
                 i.ignored = true;
             }
         }
         else{
             if(M.tile[r,c].inv.type == type){
                 M.tile[r,c].inv.quantity++;
                 return M.tile[r,c].inv;
             }
         }
     }
     else{
         i = new Item(proto[type],r,c);
     }
     return i;
 }
Esempio n. 42
0
 private static void Define(ConsumableType type_,string name_,char symbol_,Color color_)
 {
     proto[type_] = new Item(type_,name_,symbol_,color_);
 }
Esempio n. 43
0
 public static int Rarity(ConsumableType type)
 {
     switch(type){
     case ConsumableType.ENCHANTMENT:
         return 7;
     case ConsumableType.REACH:
     case ConsumableType.INVISIBILITY:
     case ConsumableType.FLESH_TO_FIRE:
     case ConsumableType.TELEKINESIS:
         return 6;
     case ConsumableType.SLUMBER:
         return 5;
     case ConsumableType.WEBS:
     case ConsumableType.DUST_STORM:
         return 4;
     case ConsumableType.REGENERATION:
     case ConsumableType.SILENCE:
     case ConsumableType.SUNLIGHT:
     case ConsumableType.DARKNESS:
     case ConsumableType.CALLING:
     case ConsumableType.TRAP_CLEARING:
     case ConsumableType.FIRE_RING:
     case ConsumableType.RAGE:
     case ConsumableType.BREACHING:
     case ConsumableType.SHIELDING:
     case ConsumableType.BLADES:
         return 3;
     case ConsumableType.ROOTS:
     case ConsumableType.VAMPIRISM:
     case ConsumableType.TIME:
     case ConsumableType.RENEWAL:
     case ConsumableType.THUNDERCLAP:
     case ConsumableType.FOG:
     case ConsumableType.DETONATION:
     case ConsumableType.TELEPORTAL:
     case ConsumableType.PAIN:
     case ConsumableType.CONFUSION:
         return 2;
     case ConsumableType.BANDAGES:
     case ConsumableType.FLINT_AND_STEEL:
     case ConsumableType.BLAST_FUNGUS:
     case ConsumableType.MAGIC_TRINKET:
         return 0;
     default:
         return 1;
     }
 }
 public ConsumableSpawnpoint(Vector2 pos, ConsumableType type)
 {   
     myConsumable = new Consumable(pos,type);
     spawnDelay = Game1.random.Next(MIN_SPAWN_DELAY,MAX_SPAWN_DELAY);
 }
Esempio n. 45
0
 public Consumable(int _id, string _name, string _description, uint _value, ConsumableType _type, int _amountRegenerated, Uri _icon)
 {
     id = _id;
     name = _name;
     description = _description;
     value = _value;
     type = _type;
     amountRegenerated = _amountRegenerated;
     stackable = true;
     icon = _icon;
 }
Esempio n. 46
0
 public Item(ConsumableType type_,string name_,char symbol_,Color color_)
 {
     type = type_;
     quantity = 1;
     charges = 0;
     other_data = 0;
     ignored = false;
     do_not_stack = false;
     revealed_by_light = false;
     name = name_;
     the_name = "the " + name;
     switch(name[0]){
     case 'a':
     case 'e':
     case 'i':
     case 'o':
     case 'u':
     case 'A':
     case 'E':
     case 'I':
     case 'O':
     case 'U':
         a_name = "an " + name;
         break;
     default:
         a_name = "a " + name;
         break;
     }
     symbol = symbol_;
     color = color_;
     row = -1;
     col = -1;
     light_radius = 0;
     sprite_offset = new pos(0,1);
 }
Esempio n. 47
0
 public ItemType(ConsumableType consumableType)
     : this(BaseType.Consumable, (int)consumableType)
 { }
 public Consumable(String name, ConsumableType type)
     : base(name, ItemType.Consumable)
 {
     m_consumableType = type;
 }
Esempio n. 49
0
 public static Item Prototype(ConsumableType type)
 {
     return proto[type];
 }
Esempio n. 50
0
 public static string NameOfItemType(ConsumableType type)
 {
     switch(type){
     case ConsumableType.HEALING:
     case ConsumableType.REGENERATION:
     case ConsumableType.STONEFORM:
     case ConsumableType.VAMPIRISM:
     case ConsumableType.BRUTISH_STRENGTH:
     case ConsumableType.ROOTS:
     case ConsumableType.HASTE:
     case ConsumableType.SILENCE:
     case ConsumableType.CLOAKING:
     case ConsumableType.MYSTIC_MIND:
         return "potion";
     case ConsumableType.BLINKING:
     case ConsumableType.PASSAGE:
     case ConsumableType.TIME:
     case ConsumableType.KNOWLEDGE:
     case ConsumableType.SUNLIGHT:
     case ConsumableType.DARKNESS:
     case ConsumableType.RENEWAL:
     case ConsumableType.CALLING:
     case ConsumableType.TRAP_CLEARING:
     case ConsumableType.ENCHANTMENT:
     case ConsumableType.THUNDERCLAP:
     case ConsumableType.FIRE_RING:
     case ConsumableType.RAGE:
         return "scroll";
     case ConsumableType.FREEZING:
     case ConsumableType.FLAMES:
     case ConsumableType.FOG:
     case ConsumableType.DETONATION:
     case ConsumableType.BREACHING:
     case ConsumableType.SHIELDING:
     case ConsumableType.TELEPORTAL:
     case ConsumableType.PAIN:
     case ConsumableType.CONFUSION:
     case ConsumableType.BLADES:
         return "orb";
     case ConsumableType.DUST_STORM:
     case ConsumableType.FLESH_TO_FIRE:
     case ConsumableType.INVISIBILITY:
     case ConsumableType.REACH:
     case ConsumableType.SLUMBER:
     case ConsumableType.TELEKINESIS:
     case ConsumableType.WEBS:
         return "wand";
     case ConsumableType.BANDAGES:
     case ConsumableType.FLINT_AND_STEEL:
     case ConsumableType.BLAST_FUNGUS:
         return "other";
     default:
         return "unknown item";
     }
 }
		/// <summary>
		/// Creates a photon gameobject instance over the network so everyone
		/// can interact with the consumable
		/// </summary>
		/// <returns>The photon consumable.</returns>
		/// <param name="type">Type of consumable</param>
		/// <param name="position">Position in the scene</param>
		public static GameObject createPhotonConsumable(ConsumableType type, Vector3 position){

			return null;

		}
Esempio n. 52
0
		public static int Rarity(ConsumableType type){
			switch(type){
			case ConsumableType.TOXIN_IMMUNITY:
			case ConsumableType.CLARITY:
			case ConsumableType.TELEPORTATION:
			case ConsumableType.SUNLIGHT:
			case ConsumableType.DARKNESS:
			case ConsumableType.PRISMATIC:
			case ConsumableType.HEALING:
			case ConsumableType.REGENERATION:
			case ConsumableType.CLOAKING:
			case ConsumableType.FOG:
				//plus the potion of 'brutish strength'
				return 2;
			default:
				return 1;
			}
		}
Esempio n. 53
0
 public void IncreasePowerUp(ConsumableType cType)
 {
     switch (cType)
     {
         case ConsumableType.MASS:
             numberOfSteroids++;
             break;
         case ConsumableType.SLIP:
             numberOfGrease++;
             break;
         case ConsumableType.SPEED:
             numberOfRedBull++;
             break;
         case ConsumableType.TURN:
             numberOfSneakers++;
             break;
     }
 }
Esempio n. 54
0
 public static Item Create(ConsumableType type,Actor a)
 {
     Item i = null;
     if(a.InventoryCount() < Global.MAX_INVENTORY_SIZE){
         i = new Item(proto[type],-1,-1);
         a.GetItem(i);
         /*foreach(Item held in a.inv){
             if(held.type == type && !held.do_not_stack){
                 held.quantity++;
                 return held;
             }
         }
         a.inv.Add(i);*/
     }
     else{
         i = Create(type,a.row,a.col);
     }
     return i;
 }