-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPizzaStone.js
45 lines (43 loc) · 1.46 KB
/
PizzaStone.js
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
class PizzaStone extends GameObject {
constructor (config) {
super(config);
this.sprite = new Sprite({
gameObject: this,
src: "./images/characters/pizza-stone.png",
animations: {
"used-down" : [ [0,0] ],
"unused-down" : [ [1,0] ],
},
currentAnimation: "used-down"
});
this.storyFlag = config.storyFlag;
this.pizzas = config.pizzas;
this.talking = [
{
required: [this.storyFlag],
events: [
{ type: "textMessage", text: "Ya usaste esta piedra."},
]
},
{
required: ["TALKED_TO_ERIO"],
events: [
{ type: "textMessage", text: 'Encontraste la legendaria "Piedra para pizzas"'},
{ type: "craftingMenu", pizzas: this.pizzas },
{ type: "addStoryFlag", flag: this.storyFlag },
]
},
{
events: [
{ type: "textMessage", text: "Como Chef reconoces que esto es una Piedra para pizzas."},
{ type: "textMessage", text: "Esto se ve util, mejor le pregunto a Tony antes de tocar."},
]
}
]
}
update() {
this.sprite.currentAnimation = playerState.storyFlags[this.storyFlag]
? "used-down"
: "unused-down"
}
}