forked from suncat/magictower
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtalkable.py
51 lines (43 loc) · 1.73 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
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.",]
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)