diff --git a/Assets/IMG/Aseprite/Inv_Orb.aseprite b/Assets/IMG/Aseprite/Inv_Orb.aseprite new file mode 100644 index 0000000..ed2fe47 Binary files /dev/null and b/Assets/IMG/Aseprite/Inv_Orb.aseprite differ diff --git a/Assets/IMG/Aseprite/Inv_Orb.aseprite.meta b/Assets/IMG/Aseprite/Inv_Orb.aseprite.meta new file mode 100644 index 0000000..6fb0b2a --- /dev/null +++ b/Assets/IMG/Aseprite/Inv_Orb.aseprite.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3f6be14d1694eb4408591d1e68a5cfff +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/IMG/Aseprite/Inv_SmallShield.aseprite b/Assets/IMG/Aseprite/Inv_SmallShield.aseprite new file mode 100644 index 0000000..ed2fe47 Binary files /dev/null and b/Assets/IMG/Aseprite/Inv_SmallShield.aseprite differ diff --git a/Assets/IMG/Aseprite/Inv_SmallShield.aseprite.meta b/Assets/IMG/Aseprite/Inv_SmallShield.aseprite.meta new file mode 100644 index 0000000..c42d912 --- /dev/null +++ b/Assets/IMG/Aseprite/Inv_SmallShield.aseprite.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2bf51c089eab8374081e48c57ff1db8a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Equipment.meta b/Assets/Resources/Equipment.meta new file mode 100644 index 0000000..654e100 --- /dev/null +++ b/Assets/Resources/Equipment.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d4b27d99cb613ad4c88565f07da83e76 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/IMG/Inventory/Inv_Amulet.png b/Assets/Resources/Equipment/Inv_Amulet.png similarity index 100% rename from Assets/IMG/Inventory/Inv_Amulet.png rename to Assets/Resources/Equipment/Inv_Amulet.png diff --git a/Assets/IMG/Inventory/Inv_Amulet.png.meta b/Assets/Resources/Equipment/Inv_Amulet.png.meta similarity index 100% rename from Assets/IMG/Inventory/Inv_Amulet.png.meta rename to Assets/Resources/Equipment/Inv_Amulet.png.meta diff --git a/Assets/IMG/Inventory/Inv_Boots.png b/Assets/Resources/Equipment/Inv_Boots.png similarity index 100% rename from Assets/IMG/Inventory/Inv_Boots.png rename to Assets/Resources/Equipment/Inv_Boots.png diff --git a/Assets/IMG/Inventory/Inv_Boots.png.meta b/Assets/Resources/Equipment/Inv_Boots.png.meta similarity index 100% rename from Assets/IMG/Inventory/Inv_Boots.png.meta rename to Assets/Resources/Equipment/Inv_Boots.png.meta diff --git a/Assets/IMG/Inventory/Inv_Chest.png b/Assets/Resources/Equipment/Inv_Chest.png similarity index 100% rename from Assets/IMG/Inventory/Inv_Chest.png rename to Assets/Resources/Equipment/Inv_Chest.png diff --git a/Assets/IMG/Inventory/Inv_Chest.png.meta b/Assets/Resources/Equipment/Inv_Chest.png.meta similarity index 100% rename from Assets/IMG/Inventory/Inv_Chest.png.meta rename to Assets/Resources/Equipment/Inv_Chest.png.meta diff --git a/Assets/IMG/Inventory/Inv_Helmet.png b/Assets/Resources/Equipment/Inv_Helmet.png similarity index 100% rename from Assets/IMG/Inventory/Inv_Helmet.png rename to Assets/Resources/Equipment/Inv_Helmet.png diff --git a/Assets/IMG/Inventory/Inv_Helmet.png.meta b/Assets/Resources/Equipment/Inv_Helmet.png.meta similarity index 100% rename from Assets/IMG/Inventory/Inv_Helmet.png.meta rename to Assets/Resources/Equipment/Inv_Helmet.png.meta diff --git a/Assets/IMG/Inventory/Inv_Ring.png b/Assets/Resources/Equipment/Inv_Ring.png similarity index 100% rename from Assets/IMG/Inventory/Inv_Ring.png rename to Assets/Resources/Equipment/Inv_Ring.png diff --git a/Assets/IMG/Inventory/Inv_Ring.png.meta b/Assets/Resources/Equipment/Inv_Ring.png.meta similarity index 100% rename from Assets/IMG/Inventory/Inv_Ring.png.meta rename to Assets/Resources/Equipment/Inv_Ring.png.meta diff --git a/Assets/IMG/Inventory/Inv_Shoulders.png b/Assets/Resources/Equipment/Inv_Shoulders.png similarity index 100% rename from Assets/IMG/Inventory/Inv_Shoulders.png rename to Assets/Resources/Equipment/Inv_Shoulders.png diff --git a/Assets/IMG/Inventory/Inv_Shoulders.png.meta b/Assets/Resources/Equipment/Inv_Shoulders.png.meta similarity index 100% rename from Assets/IMG/Inventory/Inv_Shoulders.png.meta rename to Assets/Resources/Equipment/Inv_Shoulders.png.meta diff --git a/Assets/Resources/Equipment/Mage.meta b/Assets/Resources/Equipment/Mage.meta new file mode 100644 index 0000000..036415f --- /dev/null +++ b/Assets/Resources/Equipment/Mage.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9e9270ba6468bb041994fbff1ba9e266 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Equipment/Thief.meta b/Assets/Resources/Equipment/Thief.meta new file mode 100644 index 0000000..0fcb259 --- /dev/null +++ b/Assets/Resources/Equipment/Thief.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bcaeb0ed29c00804a9e7c9a28cf8c0f9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Equipment/Warrior.meta b/Assets/Resources/Equipment/Warrior.meta new file mode 100644 index 0000000..edb911f --- /dev/null +++ b/Assets/Resources/Equipment/Warrior.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 26391f484fb6d0848aa88175939e6ad6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Inventory.cs b/Assets/Scripts/Inventory.cs index 7e2a285..e0799c2 100644 --- a/Assets/Scripts/Inventory.cs +++ b/Assets/Scripts/Inventory.cs @@ -51,7 +51,8 @@ namespace Assets.Scripts { slots[j].GetComponent().setItem(item); itemAdded = true; - slots[j].GetComponent().color = Color.red; + slots[j].GetComponent().color = item.rarityColor; + slots[j].GetComponent().texture = item.image; break; } } @@ -80,15 +81,19 @@ namespace Assets.Scripts private void checkInventoryColors() { + Item item; for (int i = 0; i < slots.Length; i++) { - if (slots[i].GetComponent().getItem() != null) + item = slots[i].GetComponent().getItem(); + if (item != null) { - slots[i].GetComponent().color = Color.red; + slots[i].GetComponent().color = item.rarityColor; + slots[i].GetComponent().texture = item.image; } else { slots[i].GetComponent().color = Color.white; + slots[i].GetComponent().texture = null; } } } @@ -96,6 +101,7 @@ namespace Assets.Scripts private void checkEquipColors() { GameObject slot = head; + Item item; for (int i = 0; i < 8; i++) { switch (i) @@ -125,9 +131,11 @@ namespace Assets.Scripts slot = ring; break; } - if (slot.GetComponent().getEquip() != null) + item = slot.GetComponent().getEquip(); + if (item != null) { - slot.GetComponent().color = Color.red; + slot.GetComponent().color = item.rarityColor; + slot.GetComponent().texture = item.image; } else { @@ -150,9 +158,9 @@ namespace Assets.Scripts { switch (place) { - case ItemPlace.SHIELD: + case ItemPlace.LEFTHAND: return leftHand.GetComponent().getEquip(); - case ItemPlace.WEAPON: + case ItemPlace.RIGHTHAND: return rightHand.GetComponent().getEquip(); case ItemPlace.HELMET: return head.GetComponent().getEquip(); diff --git a/Assets/Scripts/InventorySlot.cs b/Assets/Scripts/InventorySlot.cs index 44248ac..b006b5a 100644 --- a/Assets/Scripts/InventorySlot.cs +++ b/Assets/Scripts/InventorySlot.cs @@ -18,6 +18,7 @@ namespace Assets.Scripts private void Start() { tooltip = GameObject.Find("TooltipHandler").GetComponent(); + loadImages(); } public void updateCurrentBag(int currentBag) @@ -154,5 +155,41 @@ namespace Assets.Scripts { equip = null; } + + private void loadImages() + { + Texture image = null; + switch (place) + { + case ItemPlace.LEFTHAND: + image = Resources.Load("Equipment/" + GameObject.Find("Player").GetComponent().getClass().classname + "/Inv_LeftHand"); + break; + case ItemPlace.RIGHTHAND: + image = Resources.Load("Equipment/" + GameObject.Find("Player").GetComponent().getClass().classname + "/Inv_RightHand"); + break; + case ItemPlace.HELMET: + image = Resources.Load("Equipment/Inv_Helmet"); + break; + case ItemPlace.BOOTS: + image = Resources.Load("Equipment/Inv_Boots"); + break; + case ItemPlace.SHOULDER: + image = Resources.Load("Equipment/Inv_Shoulder"); + break; + case ItemPlace.AMULET: + image = Resources.Load("Equipment/Inv_Amulet"); + break; + case ItemPlace.RING: + image = Resources.Load("Equipment/Inv_Ring"); + break; + case ItemPlace.ARMOR: + image = Resources.Load("Equipment/Inv_Chest"); + break; + } + if (image != null) + { + gameObject.GetComponent().texture = image; + } + } } } \ No newline at end of file diff --git a/Assets/Scripts/Item.cs b/Assets/Scripts/Item.cs index e165af6..b382e16 100644 --- a/Assets/Scripts/Item.cs +++ b/Assets/Scripts/Item.cs @@ -11,6 +11,8 @@ namespace Assets.Scripts ItemPlace place; string itemName; Dictionary attributes; + public Texture image; + public Color32 rarityColor; public Item(int luck) { @@ -41,6 +43,7 @@ namespace Assets.Scripts } itemName = itemName.ToLower(); itemName = char.ToUpper(itemName[0]) + itemName.Substring(1); + loadImage(); } private void calculateRarity(int luck) @@ -49,18 +52,22 @@ namespace Assets.Scripts if (number + luck < 74) { rarity = ItemRarity.COMMON; + rarityColor = new Color32(0,255,20,255); } else if (number + luck >= 75 && number + luck < 104) { rarity = ItemRarity.RARE; + rarityColor = new Color32(0,100,255, 255); } else if (number + luck >= 105 && number + luck < 113) { rarity = ItemRarity.EPIC; + rarityColor = new Color32(255,0,230, 255); } else if (number + luck >= 114) { rarity = ItemRarity.LEGENDARY; + rarityColor = new Color32(255,230,0, 255); } } @@ -199,6 +206,37 @@ namespace Assets.Scripts } return displayText; } + + private void loadImage() + { + switch (place) + { + case ItemPlace.LEFTHAND: + image = Resources.Load("Equipment/" + GameObject.Find("Player").GetComponent().getClass().classname + "/Inv_LeftHand"); + break; + case ItemPlace.RIGHTHAND: + image = Resources.Load("Equipment/" + GameObject.Find("Player").GetComponent().getClass().classname + "/Inv_RightHand"); + break; + case ItemPlace.HELMET: + image = Resources.Load("Equipment/Inv_Helmet"); + break; + case ItemPlace.BOOTS: + image = Resources.Load("Equipment/Inv_Boots"); + break; + case ItemPlace.SHOULDER: + image = Resources.Load("Equipment/Inv_Shoulder"); + break; + case ItemPlace.AMULET: + image = Resources.Load("Equipment/Inv_Amulet"); + break; + case ItemPlace.RING: + image = Resources.Load("Equipment/Inv_Ring"); + break; + case ItemPlace.ARMOR: + image = Resources.Load("Equipment/Inv_Chest"); + break; + } + } } } \ No newline at end of file diff --git a/Assets/Scripts/Items/ItemPlace.cs b/Assets/Scripts/Items/ItemPlace.cs index 8879cd0..d2d7922 100644 --- a/Assets/Scripts/Items/ItemPlace.cs +++ b/Assets/Scripts/Items/ItemPlace.cs @@ -10,8 +10,8 @@ namespace Assets.Scripts { HELMET, SHOULDER, - WEAPON, - SHIELD, + RIGHTHAND, + LEFTHAND, RING, AMULET, ARMOR,