Add items.py
parent
42a91a1bc8
commit
ee37f5688a
|
|
@ -0,0 +1,68 @@
|
||||||
|
from settings import *
|
||||||
|
|
||||||
|
|
||||||
|
class Item:
|
||||||
|
def __init__(self, item_id, name, color, stack_limit=999, placeable=False, place_tile=None):
|
||||||
|
self.id = item_id
|
||||||
|
self.name = name
|
||||||
|
self.color = color
|
||||||
|
self.stack_limit = stack_limit
|
||||||
|
self.placeable = placeable
|
||||||
|
self.place_tile = place_tile
|
||||||
|
|
||||||
|
|
||||||
|
ITEMS = {
|
||||||
|
ITEM_WOOD: Item(
|
||||||
|
ITEM_WOOD,
|
||||||
|
"Wood",
|
||||||
|
(160, 82, 45),
|
||||||
|
stack_limit=999,
|
||||||
|
placeable=True,
|
||||||
|
place_tile=WOOD
|
||||||
|
),
|
||||||
|
|
||||||
|
ITEM_STONE: Item(
|
||||||
|
ITEM_STONE,
|
||||||
|
"Stone",
|
||||||
|
(100, 100, 100),
|
||||||
|
stack_limit=999,
|
||||||
|
placeable=True,
|
||||||
|
place_tile=STONE
|
||||||
|
),
|
||||||
|
|
||||||
|
ITEM_COAL: Item(
|
||||||
|
ITEM_COAL,
|
||||||
|
"Coal",
|
||||||
|
(40, 40, 40),
|
||||||
|
stack_limit=999,
|
||||||
|
placeable=False
|
||||||
|
),
|
||||||
|
|
||||||
|
ITEM_COPPER: Item(
|
||||||
|
ITEM_COPPER,
|
||||||
|
"Copper Ore",
|
||||||
|
(210, 120, 60),
|
||||||
|
stack_limit=999,
|
||||||
|
placeable=False
|
||||||
|
),
|
||||||
|
|
||||||
|
ITEM_IRON: Item(
|
||||||
|
ITEM_IRON,
|
||||||
|
"Iron Ore",
|
||||||
|
(180, 180, 180),
|
||||||
|
stack_limit=999,
|
||||||
|
placeable=False
|
||||||
|
),
|
||||||
|
|
||||||
|
ITEM_GOLD: Item(
|
||||||
|
ITEM_GOLD,
|
||||||
|
"Gold Ore",
|
||||||
|
(255, 215, 0),
|
||||||
|
stack_limit=999,
|
||||||
|
placeable=False
|
||||||
|
),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def get_item(item_id):
|
||||||
|
return ITEMS.get(item_id, None)
|
||||||
Loading…
Reference in New Issue