forked from Maecena/Py.FarmGame
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathitems.py
More file actions
70 lines (56 loc) · 2.16 KB
/
items.py
File metadata and controls
70 lines (56 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import random
##when new items are added need to update:
##items.all_items,
##allGoods(object),
##search.item_gather_lists,
x = 0
class allGoods(object):
#Star value will alter buy and sell price later
#edible will affect eating food and cooking later
def __init__(self, name, sellable, edible, star, buy, sell):
self.name = name
self.sellable = sellable
self.edible = edible
self.star = star
self.buy = buy
self.sell = sell
#is this used anywhere?
def item_name(self):
print self.name
#required for new buysell page
def get_price(self):
return (self.price)
#should work
def item_buy_query(self):
print ("Do you want to buy a " + str(self.name) \
+ " for " + str(self.buy) + " silver?")
price = self.buy
return (price)
#prints list of sellable items and sell price,
#called by items.sell_query
#fix this
def item_sell_query(self, sellables):
if self.sellable == True:
print("You can sell these items:")
print (str(self.name) + " - " + \
str(player.pc.inv_quantity(self.name)))
sellables.append(1)
return sellables
##(self, name, sellable, edible, star, buy, sell)
#raw food = allGoods("", True, True, x, 4.0, 2.0)
blue_berry = allGoods("blueberry", True, True, x, 2.0, 1.0)
shijemi = allGoods("shijemi", True, True, x, 3.0, 2.0)
apple = allGoods("apple", True, True, x, 4.0, 2.0)
#crafted food = allGoods("", True, True, x, 4.0, 2.0)
fruit_dish = allGoods("fruit_dish", True, True, x, 16.0, 12.0)
#base = allGoods("", False, False, x, 1.0, 0)
twig = allGoods("twig", False, False, x, 1.0, 0)
branch = allGoods("branch", False, False, x, 3.0, 0)
bark = allGoods("bark", False, False, x, 1.0, 0)
stone = allGoods("stone", False, False, x, 2.0, 0)
pebbles = allGoods("pebbles", False, False, x, 1.0, 0)
dirt = allGoods("dirt", False, False, x, 1.0, 0)
#craft = allGoods("", False, False, x, 5.0, 0)
string = allGoods("string", False, False, x, 5.0, 0)
cloth = allGoods("cloth", True, False, x, 15.0, 11.0)
brick = allGoods("brick", True, False, x, 4.0, 2.0)