old_dialogue.gd
· 1.6 KiB · GDScript3
Sin formato
Playground
extends Sequence
func setup():
backdrop_image('qs-background', preload('res://imgs/events/QuickShot00_background.png'))
backdrop_image('qs-table', preload('res://imgs/events/QuickShot01_table.png'))
backdrop_image('qs-guy', preload('res://imgs/events/QuickShot02_guy.png'))
func intro():
fade_out()
set_backdrop('qs-background')
add_backdrop('qs-table')
add_backdrop('qs-guy')
fade_in()
say_left("""
Back for another go, huh? Look, since my boss isn't around how about I give you around on the house.
""")
respond("> Play Game")
say_left("""
Same rules as last time:
Get 30 points and ya get the small prize.
Get 50 points and ya can get a big prize.
""")
next()
goto('play_minigame')
func play_minigame() -> void:
await_minigame(Minigames.QUICK_SHOT, 'minigame_ended')
func minigame_ended(userdata):
if userdata.score < 30:
execute('no_prize')
elif userdata.score < 50:
execute('small_prize')
else:
execute('large_prize')
func no_prize() -> void:
say_left('ooo, tough luck. Maybe you want to have another go?')
pick([
'> Leave empty handed', 'end',
'> Play again', 'play_minigame'
])
func small_prize() -> void:
say_left('Alright, you won the small prize. Maybe you could get the big prize next time~')
respond('> Take small prize')
give_prize([
Items.small_prize.PLASTIC_TRUMPET,
Items.small_prize.BAG_O_BUGS,
Items.small_prize.STUFFED_BULL,
])
end()
func large_prize() -> void:
say_left("""
Way to go! The grand prize is all yours!
""")
respond('> Take big prize')
give_prize([
Items.large_prize.BIG_STUFFED_BEAR,
Items.large_prize.WEIRD_BALL,
Items.large_prize.STUFFED_GATOR
])
end()
1 | extends Sequence |
2 | |
3 | func setup(): |
4 | backdrop_image('qs-background', preload('res://imgs/events/QuickShot00_background.png')) |
5 | backdrop_image('qs-table', preload('res://imgs/events/QuickShot01_table.png')) |
6 | backdrop_image('qs-guy', preload('res://imgs/events/QuickShot02_guy.png')) |
7 | |
8 | func intro(): |
9 | fade_out() |
10 | |
11 | set_backdrop('qs-background') |
12 | add_backdrop('qs-table') |
13 | add_backdrop('qs-guy') |
14 | fade_in() |
15 | |
16 | say_left(""" |
17 | Back for another go, huh? Look, since my boss isn't around how about I give you around on the house. |
18 | """) |
19 | respond("> Play Game") |
20 | |
21 | say_left(""" |
22 | Same rules as last time: |
23 | |
24 | Get 30 points and ya get the small prize. |
25 | |
26 | Get 50 points and ya can get a big prize. |
27 | """) |
28 | next() |
29 | |
30 | goto('play_minigame') |
31 | |
32 | func play_minigame() -> void: |
33 | await_minigame(Minigames.QUICK_SHOT, 'minigame_ended') |
34 | |
35 | func minigame_ended(userdata): |
36 | if userdata.score < 30: |
37 | execute('no_prize') |
38 | |
39 | elif userdata.score < 50: |
40 | execute('small_prize') |
41 | |
42 | else: |
43 | execute('large_prize') |
44 | |
45 | func no_prize() -> void: |
46 | say_left('ooo, tough luck. Maybe you want to have another go?') |
47 | pick([ |
48 | '> Leave empty handed', 'end', |
49 | '> Play again', 'play_minigame' |
50 | ]) |
51 | |
52 | func small_prize() -> void: |
53 | say_left('Alright, you won the small prize. Maybe you could get the big prize next time~') |
54 | respond('> Take small prize') |
55 | |
56 | give_prize([ |
57 | Items.small_prize.PLASTIC_TRUMPET, |
58 | Items.small_prize.BAG_O_BUGS, |
59 | Items.small_prize.STUFFED_BULL, |
60 | ]) |
61 | |
62 | |
63 | end() |
64 | |
65 | |
66 | func large_prize() -> void: |
67 | say_left(""" |
68 | Way to go! The grand prize is all yours! |
69 | """) |
70 | respond('> Take big prize') |
71 | |
72 | give_prize([ |
73 | Items.large_prize.BIG_STUFFED_BEAR, |
74 | Items.large_prize.WEIRD_BALL, |
75 | Items.large_prize.STUFFED_GATOR |
76 | ]) |
77 | |
78 | end() |
79 |