194 wWidth = {} |
194 wWidth = {} |
195 wHeight = {} |
195 wHeight = {} |
196 wCol = {} |
196 wCol = {} |
197 margin = 20 |
197 margin = 20 |
198 |
198 |
199 vTag = {} |
199 clanPowerTag = nil |
200 lastWep = nil |
200 lastWep = nil |
201 |
201 |
202 checkForSpecialWeaponsIn = -1 |
202 checkForSpecialWeaponsIn = -1 |
203 |
203 |
204 -- Config variables (script parameter) |
204 -- Config variables (script parameter) |
205 conf_initialEnergy = 550 |
205 conf_initialEnergy = 550 |
206 conf_energyPerRound = 50 |
206 conf_energyPerRound = 50 |
207 conf_maxEnergy = 1000 |
207 conf_maxEnergy = 1000 |
208 conf_cratesPerRound = 5 |
208 conf_cratesPerRound = 5 |
209 |
209 |
210 function HideTags() |
210 function DrawClanPowerTag() |
211 |
|
212 for i = 0, 2 do |
|
213 SetVisualGearValues(vTag[i],0,0,0,0,0,1,0, 0, 240000, 0xffffff00) |
|
214 end |
|
215 |
|
216 end |
|
217 |
|
218 function DrawTag(i) |
|
219 |
211 |
220 zoomL = 1.3 |
212 zoomL = 1.3 |
221 |
213 |
222 xOffset = 40 |
214 xOffset = 40 |
223 |
215 |
224 if i == 0 then |
216 zoomL = 1.1 |
225 yOffset = 40 |
217 xOffset = 45 |
226 tCol = 0xffba00ff |
218 yOffset = 70 |
227 tValue = 30 |
219 tCol = 0x00ff00ff |
228 elseif i == 1 then |
220 tValue = clanPower[GetHogClan(CurrentHedgehog)] |
229 zoomL = 1.1 |
221 |
230 xOffset = 45 |
222 DeleteVisualGear(clanPowerTag) |
231 yOffset = 70 |
223 clanPowerTag = AddVisualGear(0, 0, vgtHealthTag, 0, false) |
232 tCol = 0x00ff00ff |
224 g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(clanPowerTag) |
233 tValue = clanPower[GetHogClan(CurrentHedgehog)] |
|
234 elseif i == 2 then |
|
235 zoomL = 1.1 |
|
236 xOffset = 60 + 35 |
|
237 yOffset = 70 |
|
238 tCol = 0xa800ffff |
|
239 tValue = 10 |
|
240 end |
|
241 |
|
242 DeleteVisualGear(vTag[i]) |
|
243 vTag[i] = AddVisualGear(0, 0, vgtHealthTag, 0, false) |
|
244 g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(vTag[i]) |
|
245 SetVisualGearValues ( |
225 SetVisualGearValues ( |
246 vTag[i], --id |
226 clanPowerTag, --id |
247 -div(ScreenWidth,2) + xOffset, --xoffset |
227 -div(ScreenWidth,2) + xOffset, --xoffset |
248 ScreenHeight - yOffset, --yoffset |
228 ScreenHeight - yOffset, --yoffset |
249 0, --dx |
229 0, --dx |
250 0, --dy |
230 0, --dy |
251 zoomL, --zoom |
231 zoomL, --zoom |
260 |
240 |
261 function onScreenResize() |
241 function onScreenResize() |
262 |
242 |
263 -- redraw Tags so that their screen locations are updated |
243 -- redraw Tags so that their screen locations are updated |
264 if (CurrentHedgehog ~= nil) then |
244 if (CurrentHedgehog ~= nil) then |
265 DrawTag(0) |
245 DrawClanPowerTag() |
266 DrawTag(1) |
|
267 DrawTag(2) |
|
268 end |
246 end |
269 |
247 |
270 end |
248 end |
271 |
249 |
272 function XYisInRect(px, py, psx, psy, pex, pey) |
250 function XYisInRect(px, py, psx, psy, pex, pey) |