-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIngredient.gd
118 lines (104 loc) · 3.04 KB
/
Ingredient.gd
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
extends Item
class_name Ingredient
var wokResult: String = "coal"
var boilResult: String = "coal"
var chopResult: String = "coal"
var itemType: String = "coal"
var originBox: Box = null
var regenerated: bool = false
func setup(type: String, init_position: Vector2, box: Box):
position = init_position
originBox = box
dish = false
itemType = type
wokResult = "coal"
boilResult = "coal"
chopResult = "coal"
# Ingredients
if itemType == "Zucchini":
$Sprite.play("Zucchini")
$Sprite.scale = Vector2(1.3, 1.3)
chopResult = "choppedZucchini"
elif itemType == "Tomato":
$Sprite.play("Tomato")
chopResult = "choppedTomato"
elif itemType == "Noodles":
$Sprite.play("Noodles")
$Sprite.scale = Vector2(1.2, 1.2)
boilResult = "boiledNoodles"
elif itemType == "boiledNoodles":
$Sprite.play("boiledNoodles")
$Sprite.scale = Vector2(1.3, 1.3)
elif itemType == "coal":
$Sprite.play("coal")
$Sprite.scale = Vector2(1.3, 1.3)
elif itemType == "Eggplant":
$Sprite.play("Eggplant")
$Sprite.scale = Vector2(0.7, 0.7)
chopResult = "choppedEggplant"
elif itemType == "Carrot":
$Sprite.play("Carrot")
$Sprite.scale = Vector2(2.7, 2.7)
chopResult = "choppedCarrot"
elif itemType == "choppedTomato":
$Sprite.play("choppedTomato")
$Sprite.scale = Vector2(1.3, 1.3)
chopResult = "choppedTomato"
wokResult = "cookedTomato"
elif itemType == "choppedCarrot":
$Sprite.play("choppedCarrot")
$Sprite.scale = Vector2(1.3, 1.3)
chopResult = "choppedCarrot"
wokResult = "cookedCarrot"
elif itemType == "choppedEggplant":
$Sprite.play("choppedEggplant")
$Sprite.scale = Vector2(1.3, 1.3)
chopResult = "choppedEggplant"
wokResult = "cookedEggplant"
elif itemType == "choppedZucchini":
$Sprite.play("choppedZucchini")
$Sprite.scale = Vector2(1.3, 1.3)
chopResult = "choppedZucchini"
wokResult = "cookedZucchini"
elif itemType == "cookedZucchini":
$Sprite.play("cookedZucchini")
elif itemType == "cookedCarrot":
$Sprite.play("cookedCarrot")
elif itemType == "cookedTomato":
$Sprite.play("cookedTomato")
elif itemType == "cookedEggplant":
$Sprite.play("cookedEggplant")
elif itemType == "Moussaka":
$Sprite.play("Moussaka")
dish = true
boilResult = "MousseMacabre"
wokResult = "MousseMacabre"
elif itemType == "MousseMacabre":
dish = true
$Sprite.play("MousseMacabre")
elif itemType == "Tomato-Carrot Noodles":
dish = true
$Sprite.play("noodles1")
elif itemType == "Eggplant-Zucchini Noodles":
dish = true
$Sprite.play("noodles2")
elif itemType == "Tomato-Zucchini Noodles":
dish = true
$Sprite.play("noodles3")
elif itemType == "Carrot-Tomato-Zucchini Salad":
dish = true
$Sprite.play("salad")
# Dishes
elif itemType == "plate":
dish = true
$Sprite.play("apple")
else:
printerr("Error : the type provided is not supported.")
func _process(_delta):
if originBox != null and just_picked and not regenerated:
originBox.cool_down()
regenerated = true
super._process(_delta)
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.