File: asc001.lua

package info (click to toggle)
asc 2.6.1.0-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 81,740 kB
  • sloc: cpp: 158,704; sh: 11,544; ansic: 6,736; makefile: 604; perl: 138
file content (213 lines) | stat: -rwxr-xr-x 6,658 bytes parent folder | download | duplicates (7)
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
-- get handle to active map 
map = asc.getActiveMap() 

--Move unit SHOCK TROOPER to #coord(5/3)#
r = asc.unitMovement ( map, 414, asc.MapCoordinate( 5, 3), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 1') 
  return
end 

--Move unit SHOCK TROOPER to #coord(4/5)#
r = asc.unitMovement ( map, 414, asc.MapCoordinate( 4, 5), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 2') 
  return
end 

--Move unit SHOCK TROOPER to #coord(2/7)#
r = asc.unitMovement ( map, 379, asc.MapCoordinate( 2, 7), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 3') 
  return
end 

--Move unit SHOCK TROOPER to #coord(3/8)#
r = asc.unitMovement ( map, 379, asc.MapCoordinate( 3, 8), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 4') 
  return
end 

--Move unit SHOCK TROOPER to #coord(2/8)#
r = asc.unitMovement ( map, 411, asc.MapCoordinate( 2, 8), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 5') 
  return
end 

--Move unit SHOCK TROOPER to #coord(1/11)#
r = asc.unitMovement ( map, 415, asc.MapCoordinate( 1, 11), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 6') 
  return
end 
-- Ending turn 1
asc.endTurn()

--Move unit SHOCK TROOPER to #coord(3/12)#
r = asc.unitMovement ( map, 415, asc.MapCoordinate( 3, 12), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 7') 
  return
end 

--Move unit SHOCK TROOPER to #coord(3/10)#
r = asc.unitMovement ( map, 411, asc.MapCoordinate( 3, 10), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 8') 
  return
end 

--Move unit SHOCK TROOPER to #coord(4/9)#
r = asc.unitMovement ( map, 414, asc.MapCoordinate( 4, 9), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 9') 
  return
end 

--Move unit SHOCK TROOPER to #coord(4/10)#
r = asc.unitMovement ( map, 379, asc.MapCoordinate( 4, 10), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 10') 
  return
end 

--Move unit SHOCK TROOPER to #coord(3/11)#
r = asc.unitMovement ( map, 411, asc.MapCoordinate( 3, 11), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 11') 
  return
end 
-- Ending turn 2
asc.endTurn()

--Move unit SHOCK TROOPER to #coord(3/15)#
r = asc.unitMovement ( map, 415, asc.MapCoordinate( 3, 15), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 12') 
  return
end 

--Attacking  #coord(3/13)# with SHOCK TROOPER
r = asc.unitAttack ( map, 415, asc.MapCoordinate(3, 13), 0 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 13') 
  return
end 

--Move unit SHOCK TROOPER to #coord(4/14)#
r = asc.unitMovement ( map, 411, asc.MapCoordinate( 4, 14), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 14') 
  return
end 

--Move unit SHOCK TROOPER to #coord(3/11)#
r = asc.unitMovement ( map, 414, asc.MapCoordinate( 3, 11), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 15') 
  return
end 

--Attacking  #coord(4/12)# with SHOCK TROOPER
r = asc.unitAttack ( map, 414, asc.MapCoordinate(4, 12), 0 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 16') 
  return
end 

--Attacking  #coord(4/12)# with SHOCK TROOPER
r = asc.unitAttack ( map, 411, asc.MapCoordinate(4, 12), 0 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 17') 
  return
end 

--Move unit SHOCK TROOPER to #coord(5/10)#
r = asc.unitMovement ( map, 379, asc.MapCoordinate( 5, 10), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 18') 
  return
end 

--Attacking  #coord(4/11)# with SHOCK TROOPER
r = asc.unitAttack ( map, 379, asc.MapCoordinate(4, 11), 0 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 19') 
  return
end 
-- Ending turn 3
asc.endTurn()

--Move unit SHOCK TROOPER to #coord(5/13)#
r = asc.unitMovement ( map, 379, asc.MapCoordinate( 5, 13), -1 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 20') 
  return
end 

--Move unit SHOCK TROOPER to #coord(4/15)#
r = asc.unitMovement ( map, 415, asc.MapCoordinate( 4, 15), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 21') 
  return
end 

--Attacking  #coord(4/16)# with SHOCK TROOPER
r = asc.unitAttack ( map, 415, asc.MapCoordinate(4, 16), 0 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 22') 
  return
end 

--Move unit SHOCK TROOPER to #coord(5/15)#
r = asc.unitMovement ( map, 411, asc.MapCoordinate( 5, 15), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 23') 
  return
end 

--Move unit SHOCK TROOPER to #coord(5/10)#
r = asc.unitMovement ( map, 414, asc.MapCoordinate( 5, 10), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 24') 
  return
end 

--Attacking  #coord(5/11)# with SHOCK TROOPER
r = asc.unitAttack ( map, 414, asc.MapCoordinate(5, 11), 0 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 25') 
  return
end 
-- Ending turn 4
asc.endTurn()

--Move unit SHOCK TROOPER to #coord(5/13)#
r = asc.unitMovement ( map, 415, asc.MapCoordinate( 5, 13), -1 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 26') 
  return
end 

--Move unit SHOCK TROOPER to #coord(6/17)#
r = asc.unitMovement ( map, 411, asc.MapCoordinate( 6, 17), -1 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 27') 
  return
end 

--Move unit SHOCK TROOPER to #coord(6/12)#
r = asc.unitMovement ( map, 414, asc.MapCoordinate( 6, 12), 3 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 28') 
  return
end 

--Move unit SHOCK TROOPER to #coord(7/12)#
r = asc.unitMovement ( map, 374, asc.MapCoordinate( 7, 12), -1 )
if r:successful()==false then asc.displayActionError(r) 
  asc.errorMessage('Failure at command 29') 
  return
end