home *** CD-ROM | disk | FTP | other *** search
- global shipData, miniMapDotsSO
-
- on initializeMinimap
- global scannerRange, scanMod
- scanMod = 50000
- scannerRange = 1
- anchorLoc = the loc of sprite 480 + point(50, 50)
- repeat with wDot = 1 to count(shipData)
- wSprite = miniMapDotsSO + wDot
- puppetSprite(wSprite, 1)
- set the member of sprite wSprite to "Friendly Dot 1"
- set the loc of sprite wSprite to anchorLoc
- sprite(wSprite).locZ = 781
- set the ink of sprite wSprite to 33
- end repeat
- end
-
- on updateMiniMap
- global shipData, scannerRange, scanMod, inputString, displaySpriteDepth, prevmap, mapSkip
- if inputString[8] = 1 then
- if (scanMod = 250) or (scanMod = 1000) then
- if scannerRange = 1 then
- scannerRange = 2
- else
- scannerRange = 1
- end if
- end if
- end if
- anchorLoc = the loc of sprite 780 + point(50, 50)
- scanIdeal = [250, 1000, 2500, 10000, 50000][scannerRange]
- repeat with whichScara = 1 to scanMod / 50
- if scanIdeal < scanMod then
- scanMod = scanMod - 10
- else
- if scanIdeal > scanMod then
- scanMod = scanMod + 10
- end if
- end if
- mapSkip = 20
- end repeat
- mapSkip = 20
- if mapSkip >= 20 then
- mapSkip = 0
- prevmap = []
- if scannerRange < 1 then
- scannerRange = 1
- else
- if scannerRange > 5 then
- scannerRange = 5
- bumpMap = 0
- end if
- end if
- dotsPrinted = []
- repeat with wShip = 1 to count(shipData)
- wSprite = miniMapDotsSO + wShip
- if shipData[wShip][1] = 1 then
- pLoc = shipData[1][4][1]
- aLoc = shipData[wShip][4][1]
- finalPixel = (aLoc - pLoc) / scanMod
- shipGov = shipData[wShip][3]
- dotName = VOID
- makeArrow = 0
- if shipGov = 1 then
- case shipData[wShip][2] of
- 6:
- dotName = "Friendly Dot 2"
- makeArrow = 1
- otherwise:
- dotName = "Friendly Dot 1"
- end case
- else
- case shipData[wShip][2] of
- 7:
- dotName = "Enemy Dot 1"
- otherwise:
- dotName = "Enemy Dot 2"
- end case
- end if
- fineWithMe = 1
- if findDistance(point(0, 0), finalPixel) <= 44 then
- if dotName <> VOID then
- set the member of sprite wSprite to dotName
- set the loc of sprite wSprite to anchorLoc + finalPixel
- else
- set the loc of sprite wSprite to point(-50, -50)
- end if
- else
- if makeArrow = 1 then
- homeAngle = findAngle(point(0, 0), finalPixel)
- locY = integer(cos(homeAngle * PI / 180) * -40)
- locX = integer(sin(homeAngle * PI / 180) * 40)
- set the loc of sprite wSprite to anchorLoc + point(locX, locY)
- set the member of sprite wSprite to "Homebase Arrow"
- sprite(wSprite).rotation = homeAngle
- else
- set the loc of sprite wSprite to point(-50, -50)
- end if
- end if
- next repeat
- end if
- set the loc of sprite wSprite to point(-50, -50)
- end repeat
- member("Active Map").setPixel(25, 25, 225)
- else
- mapSkip = mapSkip + 1
- end if
- end
-