-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtalkable.py
69 lines (60 loc) · 2.63 KB
/
talkable.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
60
61
62
63
64
65
66
67
68
69
from __future__ import absolute_import
import pygame
from consts import CELL_SIZE
from npc import Npc
from msgbox import Msgbox
from character import load_images
class Talkable(Npc):
msgs = []
def do_collide(self, player):
for msg in self.msgs:
Msgbox(msg).show()
self.kill()
class Oldman(Talkable):
images = load_images(["oldman.png"])
msgs = ["Do not think about everything is so easy. Mind traps.",]
def do_collide(self, player):
if player.currentfloor.floornum == 5:
super(Oldman, self).do_collide(player)
elif player.currentfloor.floornum == 17:
self.msgs = [
"Oldman: The fairy on the 23rd floor is waiting for you.",
"Worior: What? Waiting for me?",
"Oldman: Right. She is looking for something.",
"Oldman: And she need you to bring it.",
"Worior: And could you tell me the thing?",
"Oldman: Sorry, I don't know. You can go and ask her yourself.",
"Worior: Can you help me to beat the monsters above us?",
"Oldman: No, it is your stuff. Do it yourself.",
"Oldman: But it's really difficult. Really. So good luck, boy.",
"Worior: OK. Thanks...",
]
super(Oldman, self).do_collide(player)
class Franklin(Talkable):
images = load_images(["franklin.png"])
msgs = [
"My name is Franklin.",
"And you'll see you have magic sum now.",
"Some monsters have power to kill the magic.",
"These monsters have their own special power.",
"They have different features.",
"The Leafies have leaf-feature.",
"I just can tell you these informations. Good luck.",
]
def do_collide(self, player):
if player.currentfloor.floornum == 11:
super(Franklin, self).do_collide(player)
elif player.currentfloor.floornum == 14:
self.msgs = [
"Worior: It's you! We're meet again!",
"Franklin: Yep. I just want to tell you about the sword.",
"Worior: The sword on the 13th floor?",
"Franklin: You know it! You will use it to open a strange door.",
"Worior: Which door?",
"Franklin: It is...",
"(Suddenly some smelly grass-smells come.)",
"Franklin: Sorry, I can't bear the grass smell here. I must go.",
"Worior: Oh no, please wait...",
"Worior: Dad gone it! I must look for him later.",
]
super(Franklin, self).do_collide(player)