50 ------- |
50 ------- |
51 |
51 |
52 -- update user feedback |
52 -- update user feedback |
53 -- add more sounds |
53 -- add more sounds |
54 |
54 |
|
55 ------- |
|
56 -- 0.5 |
|
57 ------- |
|
58 |
|
59 -- fix ghost disappearing if hog falls in water or somehow dies |
|
60 -- lengthen ghost tracking interval to improve performance on slower machines |
|
61 -- increase waypoint limit to 8 |
|
62 -- allow for persistent showmission information |
|
63 |
55 ----------------------------- |
64 ----------------------------- |
56 -- SCRIPT BEGINS |
65 -- SCRIPT BEGINS |
57 ----------------------------- |
66 ----------------------------- |
58 |
67 |
59 loadfile(GetDataPath() .. "Scripts/Locale.lua")() |
68 loadfile(GetDataPath() .. "Scripts/Locale.lua")() |
315 end |
328 end |
316 |
329 |
317 |
330 |
318 end |
331 end |
319 |
332 |
|
333 function onNewRound() |
|
334 |
|
335 roundNumber = roundNumber + 1 |
|
336 |
|
337 totalComment = "" |
|
338 for i = 0, (TeamsCount-1) do |
|
339 if teamNameArr[i] ~= " " then -- teamScore[teamClan[i]] |
|
340 teamComment[i] = teamNameArr[i] .. ": " .. (teamScore[i]/1000) .. loc("s|") |
|
341 totalComment = totalComment .. teamComment[i] |
|
342 elseif teamNameArr[i] == " " then |
|
343 teamComment[i] = "|" |
|
344 end |
|
345 end |
|
346 |
|
347 ShowMission( loc("RACER"), |
|
348 loc("STATUS UPDATE"), |
|
349 loc("Rounds Complete: ") .. roundNumber .. "/" .. roundLimit .. "|" .. " " .. "|" .. |
|
350 loc("Best Team Times: ") .. "|" .. totalComment, 0, 4000) |
|
351 |
|
352 -- end game if its at round limit |
|
353 if roundNumber == roundLimit then |
|
354 for i = 0, (numhhs-1) do |
|
355 if GetHogClan(hhs[i]) ~= bestClan then |
|
356 SetEffect(hhs[i], heResurrectable, false) |
|
357 SetHealth(hhs[i],0) |
|
358 end |
|
359 end |
|
360 gameOver = true |
|
361 TurnTimeLeft = 1 |
|
362 end |
|
363 |
|
364 end |
|
365 |
320 function CheckForNewRound() |
366 function CheckForNewRound() |
321 |
367 |
322 if GetHogClan(CurrentHedgehog) == firstClan then |
368 ------------- |
323 |
369 ------ new |
324 roundNumber = roundNumber + 1 |
370 ------------- |
325 |
371 |
326 totalComment = "" |
372 --[[turnN = turnN + 1 |
327 for i = 0, (TeamsCount-1) do |
373 if gameBegun == false then |
328 if teamNameArr[i] ~= " " then -- teamScore[teamClan[i]] |
374 if turnN == 2 then |
329 teamComment[i] = teamNameArr[i] .. ": " .. (teamScore[i]/1000) .. loc("s|") |
|
330 totalComment = totalComment .. teamComment[i] |
|
331 elseif teamNameArr[i] == " " then |
|
332 teamComment[i] = "|" |
|
333 end |
|
334 end |
|
335 |
|
336 ShowMission( loc("RACER"), |
|
337 loc("STATUS UPDATE"), |
|
338 loc("Rounds Complete: ") .. roundNumber .. "/" .. roundLimit .. "|" .. " " .. "|" .. |
|
339 loc("Best Team Times: ") .. "|" .. totalComment, 0, 4000) |
|
340 |
|
341 -- end game if its at round limit |
|
342 if roundNumber == roundLimit then |
|
343 for i = 0, (numhhs-1) do |
375 for i = 0, (numhhs-1) do |
344 if GetHogClan(hhs[i]) ~= bestClan then |
376 if hhs[i] ~= nil then |
345 SetEffect(hhs[i], heResurrectable, false) |
377 SetEffect(hhs[i], heResurrectable, false) |
346 SetHealth(hhs[i],0) |
378 SetHealth(hhs[i],0) |
347 end |
379 end |
348 end |
380 end |
349 gameOver = true |
381 gameOver = true |
350 TurnTimeLeft = 1 |
382 TurnTimeLeft = 1 |
351 end |
383 end |
352 |
384 else |
|
385 |
|
386 |
|
387 end]] |
|
388 |
|
389 --[[if roundBegun == true then |
|
390 |
|
391 if RoundHasChanged == true then |
|
392 roundN = roundN + 1 |
|
393 RoundHasChanged = false |
|
394 onNewRound() |
|
395 end |
|
396 |
|
397 if lastRound ~= TotalRounds then -- new round, but not really |
|
398 |
|
399 if RoundHasChanged == false then |
|
400 RoundHasChanged = true |
|
401 end |
|
402 |
|
403 end |
|
404 |
|
405 AddCaption("RoundN:" .. roundN .. "; " .. "TR: " .. TotalRounds) |
|
406 |
|
407 lastRound = TotalRounds |
|
408 |
|
409 end]] |
|
410 |
|
411 ------------ |
|
412 ----- old |
|
413 ------------ |
|
414 |
|
415 if GetHogClan(CurrentHedgehog) == firstClan then |
|
416 onNewRound() |
353 end |
417 end |
354 |
418 |
355 end |
419 end |
356 |
420 |
357 function DisableTumbler() |
421 function DisableTumbler() |
488 function onGameTick() |
555 function onGameTick() |
489 |
556 |
490 -- airstrike detected, convert this into a potential waypoint spot |
557 -- airstrike detected, convert this into a potential waypoint spot |
491 if cGear ~= nil then |
558 if cGear ~= nil then |
492 x,y = GetGearTarget(cGear) |
559 x,y = GetGearTarget(cGear) |
493 |
560 |
494 DeleteGear(cGear) |
561 DeleteGear(cGear) |
495 |
562 |
496 if TestRectForObstacle(x-20, y-20, x+20, y+20, true) then |
563 if TestRectForObstacle(x-20, y-20, x+20, y+20, true) then |
497 AddCaption(loc("Please place the way-point in the open, within the map boundaries.")) |
564 AddCaption(loc("Please place the way-point in the open, within the map boundaries.")) |
498 PlaySound(sndDenied) |
565 PlaySound(sndDenied) |
523 trackTime = 0 |
590 trackTime = 0 |
524 |
591 |
525 SetGearPosition(CurrentHedgehog, wpX[0], wpY[0]) |
592 SetGearPosition(CurrentHedgehog, wpX[0], wpY[0]) |
526 AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtGrenade, 0, 0, 0, 1) |
593 AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtGrenade, 0, 0, 0, 1) |
527 FollowGear(CurrentHedgehog) |
594 FollowGear(CurrentHedgehog) |
528 ShowMission("...", "...", "...", 2, 1) |
595 |
|
596 HideMission() |
529 |
597 |
530 else |
598 else |
531 -- still in placement mode |
599 -- still in placement mode |
532 end |
600 end |
533 |
601 |
581 end |
649 end |
582 |
650 |
583 function onGearResurrect(gear) |
651 function onGearResurrect(gear) |
584 |
652 |
585 AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false) |
653 AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false) |
|
654 |
|
655 if gear == CurrentHedgehog then |
|
656 DisableTumbler() |
|
657 end |
586 |
658 |
587 -- if the player stops and "dies" or flies into water, stop him racing |
659 -- if the player stops and "dies" or flies into water, stop him racing |
588 --[[if gear == CurrentHedgehog then |
660 --[[if gear == CurrentHedgehog then |
589 DisableTumbler() |
661 DisableTumbler() |
590 ShowMission(loc("RACER"), |
662 ShowMission(loc("RACER"), |