RingOfRaces/MiscCodes/Item.gd

32 lines
1.0 KiB
GDScript3
Raw Normal View History

extends Node2D
2020-10-08 19:56:03 +00:00
var id = 0
# Many thanks to Arkeve! https://github.com/arkeve
2020-10-06 13:19:38 +00:00
func _ready():
2020-10-08 19:56:03 +00:00
match Global.player_inventory_items[self.id].item_id:
0:
pass
# Id 0-40 - Map foraging - 'Random' spawning
2020-10-08 19:56:03 +00:00
1:
2021-04-08 19:18:46 +00:00
$TextureRect.texture = load("res://pictures/inventory_iconpictures/food_items/surroundings/berries.png")
2020-10-08 19:56:03 +00:00
2:
2021-04-08 19:18:46 +00:00
$TextureRect.texture = load("res://pictures/inventory_iconpictures/plants/wood_log.png.png")
3:
$TextureRect.texture = load("res://pictures/inventory_iconpictures/food_items/herbs/saffron.png")
# Id 41-80 - Tools - Every tool map interaction NOT weapons
41:
$TextureRect.texture = load("res://pictures/inventory_iconpictures/tools_and_weapons/tools/ploeg.png")
# Id 81-160 - Armour/Clothing
# Id 161-240 - Farming and planting
if Global.player_inventory_items[self.id].amount > 0:
var amountlbl = Label.new()
amountlbl.set_position(Vector2(self.position.x+105, self.position.y+105))
amountlbl.text = str(Global.player_inventory_items[self.id].amount)
add_child(amountlbl)