/
Breakfast.py
62 lines (62 loc) · 1.91 KB
/
Breakfast.py
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
from Food import Food, CookableFood
import pygame
import Img
from BaseClasses import Item
class Pan(Item):
img=Img.img4("Pan")
burnt=False
bimg=Img.img4("BurntPan")
def combine(self, food):
if food.can_change_state("cooked") and not self.contents and not self.burnt:
self.contents=food
self.re_img()
return True
def re_img(self):
if self.burnt:
self.img=self.bimg
elif self.contents:
self.img=self.__class__.img.copy()
self.img.blit(self.contents.get_img(),(0,0))
else:
self.img=self.__class__.img
def heat(self):
if self.contents:
if self.contents.heat():
if self.contents.burnprog:
self.contents=None
self.burnt=True
self.re_img()
else:
self.re_img()
def maketag(self):
return "Pan:"+self.contents.maketag() if self.contents else "empty"
class Basket(Item):
img=Img.img4("Basket")
o3d=4
name="Basket"
def combine(self, food):
if food.can_change_state("fried") and not self.contents:
self.contents=food
self.re_img()
return True
def re_img(self):
if self.contents:
self.img=self.__class__.img.copy()
self.img.blit(self.contents.get_img(),(0,0))
else:
self.img=self.__class__.img
def heat(self):
if self.contents:
if self.contents.fry():
if self.contents.burnprog:
self.contents=None
self.re_img()
else:
self.re_img()
def maketag(self):
return "Basket:"+self.contents.maketag() if self.contents else "empty"
class Steak(CookableFood):
ordermultiplier = 1.5
hammerable = True
soupcolour = (96, 61, 26)
items=[Pan,Steak]