-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput.utf16.map
More file actions
55 lines (43 loc) · 2.21 KB
/
Copy pathinput.utf16.map
File metadata and controls
55 lines (43 loc) · 2.21 KB
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
size (10,10)
start (0,2)
goal (9,3)
item "Wooden Shield" {
at (8,8), (6,9)
message "This is a msg for shield."
}
item "Wooden Sword" {
at (5,5), (6,7)
message "This is a msg for sword."
}
item "Treasure Map" {
at (0,1)
message "Got treasure map!"
}
obstacle {
at (5,6), (6,8)
requires "Wooden Sword", "Wooden Shield"
}
obstacle {
at (8,9), (2,7)
requires "Wooden Sword"
}
plugin "edu.curtin.gameplugins.Teleport"
plugin "edu.curtin.gameplugins.Penalty"
plugin "edu.curtin.gameplugins.Reveal"
script !{
from edu.curtin.saed.assignment2 import PluginInterface
class RewardItemScript(PluginInterface):
def __init__(self):
self.moves = 0
def onAcquire(self):
self.moves += 1
self.checkReward()
def onObstacleTraversal(self):
self.moves += 1
self.checkReward()
def checkReward(self):
if self.moves % 5 == 0:
api.addRewardItemToInventory("item.pickaxe", "This is msg for pickaxe.")
listener = RewardItemScript()
api.registerObstacleTraversalListener(listener)
api.registerAcquireListener(listener)}