-
Notifications
You must be signed in to change notification settings - Fork 0
/
overworld_temp.py
59 lines (46 loc) · 1.75 KB
/
overworld_temp.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
from underpython.overworld import *
import underpython as up
import pygame as pg
res = './resources'
ply = Player(res, 'Frisk', up.Player('Frisk', 20, 5, 20, 1),
up.Inventory(), 'the SAVIOUR.')
ply.inv.set_item('last dream', False)
ply.inv.set_inventory(['last dream' for i in range(5)])
ply.set_pos((240, 680))
mp = Map()
rm = Room(res, 'corridor', [pg.Rect(160, 440, 160, 360), pg.Rect(0, 560, 4800, 240)], [])
mp.add_room(rm)
def run(res):
gm.run_game('main')
gm.ui.close()
@rm.rect_handler
def set_pos_of_160_440_160_40():
gm.ui.exp_rect = pg.Rect(40, 650, 1200, 300)
gm.ui.dialog(['Hey, [endl]How are you, Frisk!', 'You are just so annoying.', 'Why will you come, trying to [nxtl]SAVE a little flower?', 'Heh heh..', 'Then, I\' satisfy you.'], end_func=run)
ply.set_pos((240, 481))
@ply.on_item_checked
def check(no):
gm.ui.exp_rect = pg.Rect(40, 650, 1200, 300)
name = ply.inv.inventory[no]
if name == 'last dream':
gm.ui.dialog(['last dream.', 'recover 10 hp and extra 30 hp[nxtl]when used.', 'The power of determination.'], end_func=gm.ui.close)
elif name == 'determin.':
gm.ui.dialog(['Determination', 'I have it.'], end_func=gm.ui.close, tpc=5)
else:
gm.ui.close()
@ply.on_item_used
def check(no):
gm.ui.exp_rect = pg.Rect(40, 650, 1200, 300)
name = ply.inv.inventory[no]
if name == 'last dream':
ply.data.heal(10, game.GAME)
ply.data.hp += 30
gm.ui.dialog(['Your last dream..', 'You recovered 10 hp and[nxtl]30 extra!'], end_func=gm.ui.close)
elif name == 'determin.':
ply.data.heal(100, game.GAME)
gm.ui.dialog(['Determination.'], end_func=gm.ui.close)
else:
gm.ui.close()
gm = Game(res, ply, mp)
set_game(gm)
gm.go()