-
Notifications
You must be signed in to change notification settings - Fork 0
/
choose3.gd
31 lines (26 loc) · 837 Bytes
/
choose3.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
class_name Choose3
extends DialogTree
@export var first: DialogTree
@export var first_text: String
@export var second: DialogTree
@export var second_text: String
@export var third: DialogTree
@export var third_text: String
func _init(text: String, first: DialogTree, first_text: String, second: DialogTree, second_text: String, third: DialogTree, third_text: String, sprite: Texture = null, mutate_player = null) -> void:
self.text = text
self.first = first
self.first_text = first_text
self.second = second
self.second_text = second_text
self.third = third
self.third_text = third_text
self.mutate_player = mutate_player
self.sprite = sprite
func _next(data: int) -> DialogTree:
assert(data == 1 or data == 2 or data == 3)
if data == 1:
return first
elif data == 2:
return second
else:
return third