-
Notifications
You must be signed in to change notification settings - Fork 60
/
boatem.xml
97 lines (89 loc) · 4.55 KB
/
boatem.xml
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
<?xml version='1.0' encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="escript.xslt" ?>
<!DOCTYPE ESCRIPT SYSTEM "escript.dtd">
<ESCRIPT>
<fileheader fname="Boat.em">
<filedesc>Functions for manipulating Multi Boat objects.</filedesc>
<datemodified>08/31/2015</datemodified>
<constant>const BOAT_SPEED_ONE_TILE := 1;</constant>
<constant>const BOAT_SPEED_SLOW := 2;</constant>
<constant>const BOAT_SPEED_MEDIUM := 3;</constant>
<constant>const BOAT_SPEED_FAST := 4;</constant>
</fileheader>
<function name="MoveBoat">
<prototype>MoveBoat( boat, facing, speed := BOAT_SPEED_ONE_TILE )</prototype>
<parameter name="boat" value="Boat Reference" />
<parameter name="facing" value="Integer (0..7)" />
<parameter name="speed" value="Integer (0..4)" />
<explain>Moves a boat in the direction of an absolute facing</explain>
<explain>0=N, 1=NE, 2=E, 3=SE, 4=S, 5=SW, 6=W, 7=NW</explain>
<explain>speed to determine how fast the boat movement should be animated for smooth move</explain>
<return>1 on success, 0 on failure</return>
<error>none (returns 0 on invalid param)</error>
<related>Boat</related>
</function>
<function name="MoveBoatXY">
<prototype>MoveBoatXY( boat, x, y )</prototype>
<parameter name="boat" value="Boat Reference" />
<parameter name="x" value="Integer world coordinate" />
<parameter name="y" value="Integer world coordinate" />
<explain>Moves a boat to the specified world coordinates.</explain>
<explain>Careful moving close to the world edge where a part of the boat might be out of bounds.</explain>
<return>1 on success, 0 on failure</return>
<error>Invalid Parameter</error>
<related>Boat</related>
</function>
<function name="MoveBoatRelative">
<prototype>MoveBoatRelative( boat, direction, speed := BOAT_SPEED_ONE_TILE )</prototype>
<parameter name="boat" value="Boat Reference" />
<parameter name="direction" value="Integer (0..7)" />
<parameter name="speed" value="Integer (0..4)" />
<explain>Move a boat in the direction of a relative facing. Same as MoveBoat, but adjusted for boat's facing.</explain>
<explain>If boat faces East, 0 will move E, 1 will move SE, etc.</explain>
<explain>speed to determine how fast the boat movement should be animated for smooth move</explain>
<return>1 on success, 0 on failure</return>
<error>none (returns 0 on invalid param)</error>
<related>Boat</related>
</function>
<function name="RegisterItemWithBoat">
<prototype>RegisterItemWithBoat( boat, item )</prototype>
<parameter name="boat" value="Boat Reference" />
<parameter name="item" value="Item Reference)" />
<explain>'registering' an item with a boat causes the boat to move the item when it moves, if and only if the item is still on the boat.</explain>
<return>1 always</return>
<error>none (returns 0 on invalid param)</error>
<related>Boat</related>
<related>Item</related>
</function>
<function name="BoatFromItem">
<prototype>BoatFromItem( item )</prototype>
<parameter name="item" value="Item Ref" />
<explain>if you have an itemref referring to a boat (typically in a doubleclick script) this will convert it into a boatref.</explain>
<explain>Note that this should not be necessary anymore.</explain>
<return>Boat Reference</return>
<error>"Item wasn't a multi"</error>
<error>"Multi wasn't a boat"</error>
<error>"Invalid parameter type."</error>
<related>Boat</related>
<related>Item</related>
</function>
<function name="TurnBoat">
<prototype>TurnBoat( boat, direction )</prototype>
<parameter name="boat" value="Boat Reference" />
<parameter name="direction" value="Integer (0..3)" />
<explain>Turn a boat in a direction, relative to its current directon.</explain>
<explain>direction is 0=none, 1=right, 2=flip, 3=left</explain>
<return>true/false if the boat could be turned (i.e. wouldn't be in an invalid location after the turn)</return>
<error>"Invalid Parameter type"</error>
<related>Boat</related>
</function>
<function name="SystemFindBoatBySerial">
<prototype>SystemFindBoatBySerial( serial )</prototype>
<parameter name="serial" value="Integer" />
<explain>given the serial number of a boat, return a boatref that can be used with MoveBoat, TurnBoat, etc.</explain>
<explain>SystemFindObjectBySerial can find boats as well, should use that.</explain>
<return>Boat Reference on success</return>
<error>"Boat not found."</error>
<related>Boat</related>
</function>
</ESCRIPT>