share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
changeset 11563 7e5d6ce6fe14
parent 11545 86528b0cd491
child 11569 294ce0fa65d0
equal deleted inserted replaced
11562:32bbf1f6bb2b 11563:7e5d6ce6fe14
    92 
    92 
    93 local fastX = {}
    93 local fastX = {}
    94 local fastY = {}
    94 local fastY = {}
    95 local fastCount = 0
    95 local fastCount = 0
    96 local fastIndex = 0
    96 local fastIndex = 0
    97 local fastColour
    97 local fastColour = 0x0a0a0a
    98 
    98 
    99 local currX = {}
    99 local currX = {}
   100 local currY = {}
   100 local currY = {}
   101 local currCount = 0
   101 local currCount = 0
   102 
   102 
   538 
   538 
   539             wpX[wpCount] = x
   539             wpX[wpCount] = x
   540             wpY[wpCount] = y
   540             wpY[wpCount] = y
   541             wpCol[wpCount] = 0xffffffff
   541             wpCol[wpCount] = 0xffffffff
   542             wpCirc[wpCount] = AddVisualGear(wpX[wpCount],wpY[wpCount],vgtCircle,0,true)
   542             wpCirc[wpCount] = AddVisualGear(wpX[wpCount],wpY[wpCount],vgtCircle,0,true)
   543                                                                                                                                             
   543 
   544             SetVisualGearValues(wpCirc[wpCount], wpX[wpCount], wpY[wpCount], 20, 100, 1, 10, 0, wpRad, 5, wpCol[wpCount])
   544             SetVisualGearValues(wpCirc[wpCount], wpX[wpCount], wpY[wpCount], 20, 100, 1, 10, 0, wpRad, 5, wpCol[wpCount])
   545 
   545 
   546             wpCount = wpCount + 1
   546             wpCount = wpCount + 1
   547 
   547 
   548             AddCaption(loc("Waypoint placed.") .. " " .. loc("Available points remaining: ") .. (wpLimit-wpCount))
   548             AddCaption(loc("Waypoint placed.") .. " " .. loc("Available points remaining: ") .. (wpLimit-wpCount))
   549         end
   549         end
   550     end
   550     end
   551 end
   551 end
   552 
   552 
   553 function onSpecialPoint(x,y,flag)
   553 function onSpecialPoint(x,y,flag)
   554     addHashData(x)
   554     if flag == 99 then
   555     addHashData(y)
   555         fastX[fastCount] = x
   556     addHashData(flag)
   556         fastY[fastCount] = y
   557     specialPointsX[specialPointsCount] = x
   557         fastCount = fastCount + 1
   558     specialPointsY[specialPointsCount] = y
   558     else
   559     specialPointsCount = specialPointsCount + 1
   559         addHashData(x)
       
   560         addHashData(y)
       
   561         addHashData(flag)
       
   562         specialPointsX[specialPointsCount] = x
       
   563         specialPointsY[specialPointsCount] = y
       
   564         specialPointsCount = specialPointsCount + 1
       
   565     end
   560 end
   566 end
   561 
   567 
   562 function onNewTurn()
   568 function onNewTurn()
   563 
   569 
   564         CheckForNewRound()
   570         CheckForNewRound()
   744 
   750 
   745 end
   751 end
   746 
   752 
   747 function onAttack()
   753 function onAttack()
   748     at = GetCurAmmoType()
   754     at = GetCurAmmoType()
   749     
   755 
   750     usedWeapons[at] = 0
   756     usedWeapons[at] = 0
   751 end
   757 end
   752 
   758 
   753 function onAchievementsDeclaration()
   759 function onAchievementsDeclaration()
   754     usedWeapons[amSkip] = nil
   760     usedWeapons[amSkip] = nil
   755     
   761     usedWeapons[amExtraTime] = nil
       
   762 
   756     usedRope = usedWeapons[amRope] ~= nil
   763     usedRope = usedWeapons[amRope] ~= nil
   757     usedPortal = usedWeapons[amPortalGun] ~= nil
   764     usedPortal = usedWeapons[amPortalGun] ~= nil
   758     usedSaucer = usedWeapons[amJetpack] ~= nil
   765     usedSaucer = usedWeapons[amJetpack] ~= nil
   759     
   766 
   760     usedWeapons[amNothing] = nil
   767     usedWeapons[amNothing] = nil
   761     usedWeapons[amRope] = nil
   768     usedWeapons[amRope] = nil
   762     usedWeapons[amPortalGun] = nil
   769     usedWeapons[amPortalGun] = nil
   763     usedWeapons[amJetpack] = nil
   770     usedWeapons[amJetpack] = nil
   764 
   771 
   777     else -- at least two of rope, portal and saucer used
   784     else -- at least two of rope, portal and saucer used
   778         raceType = "mixed race"
   785         raceType = "mixed race"
   779     end
   786     end
   780 
   787 
   781     map = detectMapWithDigest()
   788     map = detectMapWithDigest()
   782     
   789 
   783     for i = 0, (numTeams-1) do
   790     for i = 0, (numTeams-1) do
   784         if teamScore[i] < 100000 then
   791         if teamScore[i] < 100000 then
   785             DeclareAchievement(raceType, teamNameArr[i], map, teamScore[i])
   792             DeclareAchievement(raceType, teamNameArr[i], map, teamScore[i])
   786         end
   793         end
   787     end
   794     end