public Item Generate(EItemID itemID) { Item generatedItem = null; List <IItemEffect> effects = new List <IItemEffect>(); switch (itemID) { case (EItemID.RAW_FISH): effects.Add(new Heal(20)); generatedItem = new Consumable(itemID, "Carne de pescado", effects); break; case (EItemID.RAW_SHARK): effects.Add(new Heal(80)); generatedItem = new Consumable(itemID, "Carne de tiburon", effects); break; case (EItemID.FISH_SOUP): effects.Add(new Heal(100)); generatedItem = new Consumable(itemID, "Sopa de pescados", effects); break; case (EItemID.CORAL_PIECE): generatedItem = new Item(itemID, "Pedazo de coral", effects); break; case (EItemID.CORAL_ARMOR): effects.Add(new MaxHealthIncrease(50)); generatedItem = new Equipable(itemID, "Armadura de coral", effects, EBodyPart.BODY); break; case (EItemID.FISH_SCALE): generatedItem = new Item(itemID, "Escama de pescado", effects); break; case (EItemID.SHARK_TOOTH): generatedItem = new Item(itemID, "Diente de tiburon", effects); break; case (EItemID.METAL_SCRAP): generatedItem = new Item(itemID, "Reciduo metalico", effects); break; case (EItemID.SHARK_TOOTH_KNIFE): effects.Add(new IncreaseAttackDamage(40)); generatedItem = new Equipable(itemID, "Cuchillo de diente de tiburon", effects, EBodyPart.WEAPON); break; case (EItemID.OXYGEN_TANK): effects.Add(new IncreaseOxyenCapacity(100)); generatedItem = new Equipable(itemID, "Tanque de oxigeno", effects, EBodyPart.BACK); break; } // Si no matchea con ninguno (deberia ser imposible) explota al tratar de usarlo xq es null return(generatedItem); }
public InventorySlot(TGCVector2 position, EItemID itemID, int amount, Menu menu, CustomBitmap bitmapBackground) : base(position, menu) { itemSample = ItemDatabase.Instance.Generate(itemID); this.amount = amount; itemSprite = ItemDatabase.Instance.ItemSprites[itemID]; itemSprite.Position = Position; float scalingFactor = 0.25f; itemSprite.Scaling = TGCVector2.One * scalingFactor; itemName.Text = itemSample.Name; itemName.Position = new Point((int)(itemSprite.Position.X + itemSprite.Bitmap.Size.Width * scalingFactor + 10), (int)itemSprite.Position.Y + 5); itemName.Align = TgcText2D.TextAlign.LEFT; itemName.changeFont(new Font("TimesNewRoman", 14, FontStyle.Bold)); itemName.Color = Color.DarkGray; itemDescription.Text = itemSample.Description; itemDescription.Position = new Point(itemName.Position.X, itemName.Position.Y + 30); itemDescription.Size = new Size(450, 300); itemDescription.Align = TgcText2D.TextAlign.LEFT; itemDescription.changeFont(new Font("TimesNewRoman", 11, FontStyle.Bold)); itemDescription.Color = Color.LightGray; itemAmount.Text = amount.ToString(); itemAmount.Position = new Point((int)itemSprite.Position.X, (int)itemSprite.Position.Y); itemAmount.Align = TgcText2D.TextAlign.LEFT; itemAmount.changeFont(new Font("TimesNewRoman", 14, FontStyle.Bold)); itemAmount.Color = Color.White; Size = new Size((int)(itemSprite.Bitmap.Size.Width * scalingFactor + itemDescription.Size.Width + 180), (int)(itemSprite.Bitmap.Height * scalingFactor + 30)); slotBackground = new CustomSprite(); slotBackground.Bitmap = bitmapBackground; slotBackground.Position = new TGCVector2(Position.X - 25, Position.Y - 15); // slotBackground.SrcRect = new Rectangle((int)position.X, (int)position.Y, Size.Width, Size.Height); slotBackground.SrcRect = new Rectangle(0, 0, Size.Width, Size.Height); }
public Item(EItemID id, string name, List <IItemEffect> onUseEffects) { ID = id; Name = name; this.onUseEffects = onUseEffects; }
public BluePrint(List <ItemAmount> requirements, EItemID productId) { this.requirements = requirements; ProductId = productId; }
public ItemAmount(EItemID itemId, int amount) { this.itemId = itemId; this.amount = amount; }
public Collectable(Subnautica gameInstance, string name, List <TgcMesh> meshes, TGCVector3 position, EItemID resourceID) : this(gameInstance, name, meshes, position, TGCVector3.One, TGCVector3.Empty, resourceID) { }
public Collectable(Subnautica gameInstance, string name, List <TgcMesh> meshes, TGCVector3 position, TGCVector3 scale, TGCVector3 rotation, EItemID resourceID) : base(gameInstance, name, meshes, position, scale, rotation) { this.resourceID = resourceID; }
public int Amount(EItemID itemId) => AccumulatedItems.ContainsKey(itemId) ? AccumulatedItems[itemId] : 0;
public Item GetItem(EItemID itemID) => Find(item => item.ID == itemID);
public Consumable(EItemID id, string name, List <IItemEffect> onUseEffect) : base(id, name, onUseEffect) { }
public Equipable(EItemID id, string name, List <IItemEffect> onUseEffects, EBodyPart bodyPart) : base(id, name, onUseEffects) { BodyPart = bodyPart; }