Added shield items for all classes, finalised item display in inventory, v1.3.0
BIN
Assets/IMG/Aseprite/Inv_Orb.aseprite
Normal file
7
Assets/IMG/Aseprite/Inv_Orb.aseprite.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3f6be14d1694eb4408591d1e68a5cfff
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/IMG/Aseprite/Inv_SmallShield.aseprite
Normal file
7
Assets/IMG/Aseprite/Inv_SmallShield.aseprite.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2bf51c089eab8374081e48c57ff1db8a
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Resources/Equipment.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d4b27d99cb613ad4c88565f07da83e76
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 481 B After Width: | Height: | Size: 481 B |
|
Before Width: | Height: | Size: 567 B After Width: | Height: | Size: 567 B |
|
Before Width: | Height: | Size: 505 B After Width: | Height: | Size: 505 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 384 B After Width: | Height: | Size: 384 B |
8
Assets/Resources/Equipment/Mage.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9e9270ba6468bb041994fbff1ba9e266
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Resources/Equipment/Thief.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bcaeb0ed29c00804a9e7c9a28cf8c0f9
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Resources/Equipment/Warrior.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 26391f484fb6d0848aa88175939e6ad6
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -51,7 +51,8 @@ namespace Assets.Scripts
|
|||||||
{
|
{
|
||||||
slots[j].GetComponent<InventorySlot>().setItem(item);
|
slots[j].GetComponent<InventorySlot>().setItem(item);
|
||||||
itemAdded = true;
|
itemAdded = true;
|
||||||
slots[j].GetComponent<RawImage>().color = Color.red;
|
slots[j].GetComponent<RawImage>().color = item.rarityColor;
|
||||||
|
slots[j].GetComponent<RawImage>().texture = item.image;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,15 +81,19 @@ namespace Assets.Scripts
|
|||||||
|
|
||||||
private void checkInventoryColors()
|
private void checkInventoryColors()
|
||||||
{
|
{
|
||||||
|
Item item;
|
||||||
for (int i = 0; i < slots.Length; i++)
|
for (int i = 0; i < slots.Length; i++)
|
||||||
{
|
{
|
||||||
if (slots[i].GetComponent<InventorySlot>().getItem() != null)
|
item = slots[i].GetComponent<InventorySlot>().getItem();
|
||||||
|
if (item != null)
|
||||||
{
|
{
|
||||||
slots[i].GetComponent<RawImage>().color = Color.red;
|
slots[i].GetComponent<RawImage>().color = item.rarityColor;
|
||||||
|
slots[i].GetComponent<RawImage>().texture = item.image;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
slots[i].GetComponent<RawImage>().color = Color.white;
|
slots[i].GetComponent<RawImage>().color = Color.white;
|
||||||
|
slots[i].GetComponent<RawImage>().texture = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -96,6 +101,7 @@ namespace Assets.Scripts
|
|||||||
private void checkEquipColors()
|
private void checkEquipColors()
|
||||||
{
|
{
|
||||||
GameObject slot = head;
|
GameObject slot = head;
|
||||||
|
Item item;
|
||||||
for (int i = 0; i < 8; i++)
|
for (int i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
switch (i)
|
switch (i)
|
||||||
@ -125,9 +131,11 @@ namespace Assets.Scripts
|
|||||||
slot = ring;
|
slot = ring;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (slot.GetComponent<InventorySlot>().getEquip() != null)
|
item = slot.GetComponent<InventorySlot>().getEquip();
|
||||||
|
if (item != null)
|
||||||
{
|
{
|
||||||
slot.GetComponent<RawImage>().color = Color.red;
|
slot.GetComponent<RawImage>().color = item.rarityColor;
|
||||||
|
slot.GetComponent<RawImage>().texture = item.image;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -150,9 +158,9 @@ namespace Assets.Scripts
|
|||||||
{
|
{
|
||||||
switch (place)
|
switch (place)
|
||||||
{
|
{
|
||||||
case ItemPlace.SHIELD:
|
case ItemPlace.LEFTHAND:
|
||||||
return leftHand.GetComponent<InventorySlot>().getEquip();
|
return leftHand.GetComponent<InventorySlot>().getEquip();
|
||||||
case ItemPlace.WEAPON:
|
case ItemPlace.RIGHTHAND:
|
||||||
return rightHand.GetComponent<InventorySlot>().getEquip();
|
return rightHand.GetComponent<InventorySlot>().getEquip();
|
||||||
case ItemPlace.HELMET:
|
case ItemPlace.HELMET:
|
||||||
return head.GetComponent<InventorySlot>().getEquip();
|
return head.GetComponent<InventorySlot>().getEquip();
|
||||||
|
|||||||
@ -18,6 +18,7 @@ namespace Assets.Scripts
|
|||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
tooltip = GameObject.Find("TooltipHandler").GetComponent<TooltipHandler>();
|
tooltip = GameObject.Find("TooltipHandler").GetComponent<TooltipHandler>();
|
||||||
|
loadImages();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateCurrentBag(int currentBag)
|
public void updateCurrentBag(int currentBag)
|
||||||
@ -154,5 +155,41 @@ namespace Assets.Scripts
|
|||||||
{
|
{
|
||||||
equip = null;
|
equip = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void loadImages()
|
||||||
|
{
|
||||||
|
Texture image = null;
|
||||||
|
switch (place)
|
||||||
|
{
|
||||||
|
case ItemPlace.LEFTHAND:
|
||||||
|
image = Resources.Load<Texture>("Equipment/" + GameObject.Find("Player").GetComponent<Player>().getClass().classname + "/Inv_LeftHand");
|
||||||
|
break;
|
||||||
|
case ItemPlace.RIGHTHAND:
|
||||||
|
image = Resources.Load<Texture>("Equipment/" + GameObject.Find("Player").GetComponent<Player>().getClass().classname + "/Inv_RightHand");
|
||||||
|
break;
|
||||||
|
case ItemPlace.HELMET:
|
||||||
|
image = Resources.Load<Texture>("Equipment/Inv_Helmet");
|
||||||
|
break;
|
||||||
|
case ItemPlace.BOOTS:
|
||||||
|
image = Resources.Load<Texture>("Equipment/Inv_Boots");
|
||||||
|
break;
|
||||||
|
case ItemPlace.SHOULDER:
|
||||||
|
image = Resources.Load<Texture>("Equipment/Inv_Shoulder");
|
||||||
|
break;
|
||||||
|
case ItemPlace.AMULET:
|
||||||
|
image = Resources.Load<Texture>("Equipment/Inv_Amulet");
|
||||||
|
break;
|
||||||
|
case ItemPlace.RING:
|
||||||
|
image = Resources.Load<Texture>("Equipment/Inv_Ring");
|
||||||
|
break;
|
||||||
|
case ItemPlace.ARMOR:
|
||||||
|
image = Resources.Load<Texture>("Equipment/Inv_Chest");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (image != null)
|
||||||
|
{
|
||||||
|
gameObject.GetComponent<RawImage>().texture = image;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -11,6 +11,8 @@ namespace Assets.Scripts
|
|||||||
ItemPlace place;
|
ItemPlace place;
|
||||||
string itemName;
|
string itemName;
|
||||||
Dictionary<string, int> attributes;
|
Dictionary<string, int> attributes;
|
||||||
|
public Texture image;
|
||||||
|
public Color32 rarityColor;
|
||||||
|
|
||||||
public Item(int luck)
|
public Item(int luck)
|
||||||
{
|
{
|
||||||
@ -41,6 +43,7 @@ namespace Assets.Scripts
|
|||||||
}
|
}
|
||||||
itemName = itemName.ToLower();
|
itemName = itemName.ToLower();
|
||||||
itemName = char.ToUpper(itemName[0]) + itemName.Substring(1);
|
itemName = char.ToUpper(itemName[0]) + itemName.Substring(1);
|
||||||
|
loadImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void calculateRarity(int luck)
|
private void calculateRarity(int luck)
|
||||||
@ -49,18 +52,22 @@ namespace Assets.Scripts
|
|||||||
if (number + luck < 74)
|
if (number + luck < 74)
|
||||||
{
|
{
|
||||||
rarity = ItemRarity.COMMON;
|
rarity = ItemRarity.COMMON;
|
||||||
|
rarityColor = new Color32(0,255,20,255);
|
||||||
}
|
}
|
||||||
else if (number + luck >= 75 && number + luck < 104)
|
else if (number + luck >= 75 && number + luck < 104)
|
||||||
{
|
{
|
||||||
rarity = ItemRarity.RARE;
|
rarity = ItemRarity.RARE;
|
||||||
|
rarityColor = new Color32(0,100,255, 255);
|
||||||
}
|
}
|
||||||
else if (number + luck >= 105 && number + luck < 113)
|
else if (number + luck >= 105 && number + luck < 113)
|
||||||
{
|
{
|
||||||
rarity = ItemRarity.EPIC;
|
rarity = ItemRarity.EPIC;
|
||||||
|
rarityColor = new Color32(255,0,230, 255);
|
||||||
}
|
}
|
||||||
else if (number + luck >= 114)
|
else if (number + luck >= 114)
|
||||||
{
|
{
|
||||||
rarity = ItemRarity.LEGENDARY;
|
rarity = ItemRarity.LEGENDARY;
|
||||||
|
rarityColor = new Color32(255,230,0, 255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,6 +206,37 @@ namespace Assets.Scripts
|
|||||||
}
|
}
|
||||||
return displayText;
|
return displayText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void loadImage()
|
||||||
|
{
|
||||||
|
switch (place)
|
||||||
|
{
|
||||||
|
case ItemPlace.LEFTHAND:
|
||||||
|
image = Resources.Load<Texture>("Equipment/" + GameObject.Find("Player").GetComponent<Player>().getClass().classname + "/Inv_LeftHand");
|
||||||
|
break;
|
||||||
|
case ItemPlace.RIGHTHAND:
|
||||||
|
image = Resources.Load<Texture>("Equipment/" + GameObject.Find("Player").GetComponent<Player>().getClass().classname + "/Inv_RightHand");
|
||||||
|
break;
|
||||||
|
case ItemPlace.HELMET:
|
||||||
|
image = Resources.Load<Texture>("Equipment/Inv_Helmet");
|
||||||
|
break;
|
||||||
|
case ItemPlace.BOOTS:
|
||||||
|
image = Resources.Load<Texture>("Equipment/Inv_Boots");
|
||||||
|
break;
|
||||||
|
case ItemPlace.SHOULDER:
|
||||||
|
image = Resources.Load<Texture>("Equipment/Inv_Shoulder");
|
||||||
|
break;
|
||||||
|
case ItemPlace.AMULET:
|
||||||
|
image = Resources.Load<Texture>("Equipment/Inv_Amulet");
|
||||||
|
break;
|
||||||
|
case ItemPlace.RING:
|
||||||
|
image = Resources.Load<Texture>("Equipment/Inv_Ring");
|
||||||
|
break;
|
||||||
|
case ItemPlace.ARMOR:
|
||||||
|
image = Resources.Load<Texture>("Equipment/Inv_Chest");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -10,8 +10,8 @@ namespace Assets.Scripts
|
|||||||
{
|
{
|
||||||
HELMET,
|
HELMET,
|
||||||
SHOULDER,
|
SHOULDER,
|
||||||
WEAPON,
|
RIGHTHAND,
|
||||||
SHIELD,
|
LEFTHAND,
|
||||||
RING,
|
RING,
|
||||||
AMULET,
|
AMULET,
|
||||||
ARMOR,
|
ARMOR,
|
||||||
|
|||||||