-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathgroup_project_library.aslx
120 lines (100 loc) · 3.23 KB
/
group_project_library.aslx
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<library>
<command name="TravelToHub">
<pattern>travel</pattern>
<script>
if (GetBoolean(player.parent, "gateway") or player.cantravelfromanywhere) {
msg (this.travelmsg)
player.parent = hub
}
else {
msg ("You can't travel from here.")
}
</script>
<travelmsg>You travel in some unspecified manner...</travelmsg>
</command>
<function name="AddToHubGateway" parameters="room">
name = room.name + "_destination"
if (not GetObject(name) = null) error ("Something has gone wrong, and a destination is being added to the hub a second time.")
create (name)
obj = GetObject (name)
obj.parent = destinations
obj.look = room.dimensionderscription
obj.alias = room.dimensionname
obj.to = room
obj.linkcolour = room.dimensioncolour
</function>
<function name="DescribePlayer">
msg ("Looking good...")
msg ("As a {either player.isfemale:female|male} {player.race}.")
</function>
<function name="DescribeHub">
msg ("This is the hub, the starting point of your adventure!")
</function>
<function name="StartScript">
msg ("Welcome to...")
msg ("Group project!")
</function>
<function name="HubEnterScript">
msg ("So this is the hub...")
player.cantravelfromanywhere = false
</function>
<function name="StartMeElsewhere" parameters="obj, roomname">
room = GetObject(roomname)
if (room = null) {
obj.parent = hub
}
else {
obj.parent = room
}
</function>
<function name="IsDimensionCompleted" parameters="gateway" type="boolean">
return (gateway.completed)
</function>
<function name="AreAllDimensionsCompleted" type="boolean">
flag = true
foreach (obj, GetDirectChildren(destinations)) {
if (not obj.to.completed) {
flag = false
}
}
return (flag)
</function>
<function name="DimensionComplete" parameters="gateway">
gateway.completed = true
</function>
<type name="gateway_type">
<completed type="boolean">false</completed>
</type>
<!-- Interface -->
<tab>
<parent>_ObjectEditor</parent>
<caption>Gateway</caption>
<mustinherit>gateway_type</mustinherit>
<control>
<caption>Dimension name</caption>
<controltype>textbox</controltype>
<attribute>dimensionname</attribute>
</control>
<control>
<caption>Dimension description</caption>
<controltype>richtext</controltype>
<attribute>dimensionderscription</attribute>
</control>
<control>
<caption>Start script</caption>
<controltype>script</controltype>
<attribute>_initialise_</attribute>
</control>
<control>
<controltype>label</controltype>
<caption>This will run when the game starts. The first line must be "AddToHubGateway (this)"</caption>
</control>
<control>
<controltype>dropdown</controltype>
<caption>Link colour (when travelling from hub)</caption>
<attribute>dimensioncolour</attribute>
<validvalues type="simplestringlist">[HTMLColorNames]</validvalues>
<freetext/>
</control>
</tab>
</library>