708 |
708 |
709 |
709 |
710 |
710 |
711 function HandleFreshMapCreation() |
711 function HandleFreshMapCreation() |
712 |
712 |
|
713 if activationStage ~= 1 then |
|
714 return |
|
715 end |
|
716 |
713 -- the boom stage, boom girders, reset ammo, and delete other map objects |
717 -- the boom stage, boom girders, reset ammo, and delete other map objects |
714 if activationStage == 1 then |
718 ClearMap() |
715 |
|
716 ClearMap() |
|
717 activationStage = activationStage + 1 |
|
718 |
719 |
719 -- the creation stage, place girders and needed gears, grant ammo |
720 -- the creation stage, place girders and needed gears, grant ammo |
720 elseif activationStage == 2 then |
721 InterpretPoints() |
721 |
722 |
722 InterpretPoints() |
723 -- these are from onParameters() |
723 |
724 if (mapID == nil) or (mapID == 0) then |
724 -- these are from onParameters() |
725 LoadMap(2000) |
725 if (mapID == nil) or (mapID == 0) then |
726 else |
726 LoadMap(2000) |
727 LoadMap(mapID) |
727 else |
728 end |
728 LoadMap(mapID) |
729 |
|
730 if gameOver then |
|
731 for i = 0,(wpCount-1) do |
|
732 SetVisualGearValues(wpCirc[wpCount], wpX[wpCount], wpY[wpCount], 164, 224, 1, 10, 0, wpRad, 5, wpCol[wpCount]) |
729 end |
733 end |
730 |
734 |
731 if gameOver then |
735 else |
732 for i = 0,(wpCount-1) do |
736 for i = 0,(wpCount-1) do |
733 SetVisualGearValues(wpCirc[wpCount], wpX[wpCount], wpY[wpCount], 164, 224, 1, 10, 0, wpRad, 5, wpCol[wpCount]) |
737 DeleteVisualGear(wpCirc[i]) |
734 end |
|
735 |
|
736 else |
|
737 for i = 0,(wpCount-1) do |
|
738 DeleteVisualGear(wpCirc[i]) |
|
739 end |
|
740 wpCount = 0 |
|
741 |
|
742 for i = 1, techCount-1 do |
|
743 CallBob(techX[i],techY[i]) |
|
744 end |
|
745 end |
|
746 |
|
747 activationStage = 200 |
|
748 --runOnHogs(RestoreHog) |
|
749 |
|
750 if ufoFuel == 2000 then |
|
751 SetAmmoDescriptionAppendix(amJetpack, loc("On this map you get infinite fuel.")) |
|
752 elseif ufoFuel ~= nil and ufoFuel ~= 0 then |
|
753 SetAmmoDescriptionAppendix(amJetpack, string.format(loc("On this map you get %d%% fuel."), div(ufoFuel, 20))) |
|
754 end |
738 end |
755 |
739 wpCount = 0 |
756 end |
740 |
|
741 for i = 1, techCount-1 do |
|
742 CallBob(techX[i],techY[i]) |
|
743 end |
|
744 end |
|
745 |
|
746 if ufoFuel == 2000 then |
|
747 SetAmmoDescriptionAppendix(amJetpack, loc("On this map you get infinite fuel.")) |
|
748 elseif ufoFuel ~= nil and ufoFuel ~= 0 then |
|
749 SetAmmoDescriptionAppendix(amJetpack, string.format(loc("On this map you get %d%% fuel."), div(ufoFuel, 20))) |
|
750 end |
|
751 |
|
752 activationStage = 200 |
757 |
753 |
758 end |
754 end |
759 |
755 |
760 function TryRepositionHogs() |
756 function TryRepositionHogs() |
761 |
757 |