@@ -58,7 +58,7 @@ on initCloud me
tTempImg = member(getmemnum(pMemName & "_" & tdir)).image
pCloudMember.image = image(tTempImg.width, 80, 8)
tdestrect = image.rect - tTempImg.rect
tdestrect = rect(tdestrect.width / 2, tdestrect.height / 2, tTempImg.width + tdestrect.width / 2, tdestrect.height / 2 + tTempImg.height)
tdestrect = rect((tdestrect.width / 2), (tdestrect.height / 2), tTempImg.width + (tdestrect.width / 2), (tdestrect.height / 2) + tTempImg.height)
image.copyPixels(tTempImg, tdestrect, tTempImg.rect, [#ink:8])
pLoc = pSprite.loc
pSprite.width = tTempImg.width
@@ -78,11 +78,11 @@ on update me
pVertDir = 0
end if
if pSprite.left = pTurnPoint then
pVertDir = pCloudDir * -1
pVertDir = (pCloudDir * -1)
getNextTurnPoint(me)
end if
pLoc.locH = pLoc.locH + 1
if pLoc.locH mod 2 = 0 then
if (pLoc.locH mod 2) = 0 then
pLoc.locV = pLoc.locV + pVertDir
end if
pSprite.loc = pLoc
@@ -108,29 +108,29 @@ on turn me
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = -tWidth / 2 - 1
tHeigth = (-tWidth / 2) - 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = tImg.width - tWidth
tHeigth = -tWidth / 2
tHeigth = (-tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
else
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = tWidth / 2 + 1
tHeigth = (tWidth / 2) + 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = tImg.width - tWidth
tHeigth = tWidth / 2
tHeigth = (tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
end if
end
@@ -86,13 +86,13 @@ on update me
pStepForward = 0
end if
if pShowStep = "show" then
tTemp = pStepVariable - 1 * 104
tTemp = (pStepVariable - 1 * 104)
image.copyPixels(pScrollFrmsMem.image, rect(0, 0, 104, 23), rect(tTemp, 0, tTemp + 104, 23), [#ink:0])
pStepForward = 1
else
if pShowStep = "scroll" then
image.copyPixels(pMember2D.image, rect(0, 0, 102, 23), rect(2, 0, 104, 23), [#ink:0])
tTemp = pStepVariable - 1 * 104 + pScrollPhase
tTemp = (pStepVariable - 1 * 104) + pScrollPhase
image.copyPixels(pScrollFrmsMem.image, rect(102, 0, 104, 23), rect(tTemp, 0, tTemp + 2, 23), [#ink:0])
pScrollPhase = pScrollPhase + 2
if pScrollPhase > 103 then
@@ -101,15 +101,15 @@ on update me
end if
else
if pShowStep = "pause" then
if the milliSeconds > pLastPauseStart + pStepVariable * 1000 then
if the milliSeconds > pLastPauseStart + (pStepVariable * 1000) then
pStepForward = 1
end if
else
if pShowStep = "wipe" then
tTempImage = image(104, 23, 8)
tTempImage.copyPixels(pMember2D.image, rect(0, 0, 104, 23), rect(0, 0, 104, 23), [#ink:0])
image.copyPixels(tTempImage, rect(0, 1, 104, 23), rect(0, 0, 104, 22), [#ink:0])
tTemp = pStepVariable - 1 * 104
tTemp = (pStepVariable - 1 * 104)
image.copyPixels(pScrollFrmsMem.image, rect(0, 0, 104, 1), rect(tTemp, 22 - pScrollPhase, tTemp + 104, 23 - pScrollPhase), [#ink:0])
pScrollPhase = pScrollPhase + 1
if pScrollPhase > 22 then
@@ -6,21 +6,21 @@ on define me, tsprite
pTrainImg = image.duplicate()
pAnimStep = 4
pAnimPhase = 0
pLastUpdate = the milliSeconds + 10 * 1000 + random(10000)
pLastUpdate = the milliSeconds + (10 * 1000) + random(10000)
return(1)
end

on update me
if the milliSeconds - pLastUpdate > 66 then
tOffset = pAnimStep * pAnimPhase
tCopyRect = rect(-314, -166, 0, 0) + rect(2 * tOffset, tOffset, 2 * tOffset, tOffset)
tOffset = (pAnimStep * pAnimPhase)
tCopyRect = rect(-314, -166, 0, 0) + rect((2 * tOffset), tOffset, (2 * tOffset), tOffset)
pMember.fill(image.rect, rgb(255, 255, 255))
pTrainImg.copyPixels(pMember, image.rect, tCopyRect, [#ink:0])
pAnimPhase = pAnimPhase + 1
pLastUpdate = the milliSeconds
if pAnimPhase > 82 then
pAnimPhase = 0
pLastUpdate = the milliSeconds + 4 * 1000 + random(15000)
pLastUpdate = the milliSeconds + (4 * 1000) + random(15000)
end if
end if
end
@@ -2,7 +2,7 @@ property pDirection, pSprite, pInitDelay, pOffset, pTurnPnt

on define me, tsprite, tCount
tDirection = #right
if tCount mod 2 = 1 then
if (tCount mod 2) = 1 then
tDirection = #left
end if
pSprite = tsprite
@@ -58,7 +58,7 @@ on initCloud me
tTempImg = image.duplicate()
pCloudMember.image = image(tTempImg.width, 60, 8)
tdestrect = image.rect - tTempImg.rect
tdestrect = rect(tdestrect.width / 2, tdestrect.height / 2, tTempImg.width + tdestrect.width / 2, tdestrect.height / 2 + tTempImg.height)
tdestrect = rect((tdestrect.width / 2), (tdestrect.height / 2), tTempImg.width + (tdestrect.width / 2), (tdestrect.height / 2) + tTempImg.height)
image.copyPixels(tTempImg, tdestrect, tTempImg.rect, [#ink:8])
pLoc = pSprite.loc
pSprite.width = tTempImg.width
@@ -78,11 +78,11 @@ on update me
pVertDir = 0
end if
if pSprite.left = pTurnPoint then
pVertDir = pCloudDir * -1
pVertDir = (pCloudDir * -1)
getNextTurnPoint(me)
end if
pLoc.locH = pLoc.locH + 1
if pLoc.locH mod 2 = 0 then
if (pLoc.locH mod 2) = 0 then
pLoc.locV = pLoc.locV + pVertDir
end if
pSprite.loc = pLoc
@@ -108,29 +108,29 @@ on turn me
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = -tWidth / 2 - 1
tHeigth = (-tWidth / 2) - 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = tImg.width - tWidth
tHeigth = -tWidth / 2
tHeigth = (-tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
else
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = tWidth / 2 + 1
tHeigth = (tWidth / 2) + 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = tImg.width - tWidth
tHeigth = tWidth / 2
tHeigth = (tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
end if
end
@@ -8,7 +8,7 @@ end
on reset me
tTrainSpeed = random(30) + 15
pSprite.loc = point(613, 378)
pOffset = [-2, -1] * random(2)
pOffset = ([-2, -1] * random(2))
pWaitTrainTimer = random(250)
end

@@ -2,7 +2,7 @@ property pDirection, pSprite, pOffset, pTurnPnt

on define me, tsprite, tCount
tDirection = #left
if tCount mod 2 = 1 then
if (tCount mod 2) = 1 then
tDirection = #right
end if
pSprite = tsprite
@@ -58,7 +58,7 @@ on initCloud me
tTempImg = image.duplicate()
pCloudMember.image = image(tTempImg.width, 60, 8)
tdestrect = image.rect - tTempImg.rect
tdestrect = rect(tdestrect.width / 2, tdestrect.height / 2, tTempImg.width + tdestrect.width / 2, tdestrect.height / 2 + tTempImg.height)
tdestrect = rect((tdestrect.width / 2), (tdestrect.height / 2), tTempImg.width + (tdestrect.width / 2), (tdestrect.height / 2) + tTempImg.height)
image.copyPixels(tTempImg, tdestrect, tTempImg.rect, [#ink:8])
pLoc = pSprite.loc
pSprite.width = tTempImg.width
@@ -78,11 +78,11 @@ on update me
pVertDir = 0
end if
if pSprite.left = pTurnPoint then
pVertDir = pCloudDir * -1
pVertDir = (pCloudDir * -1)
getNextTurnPoint(me)
end if
pLoc.locH = pLoc.locH + 1
if pLoc.locH mod 2 = 0 then
if (pLoc.locH mod 2) = 0 then
pLoc.locV = pLoc.locV + pVertDir
end if
pSprite.loc = pLoc
@@ -108,29 +108,29 @@ on turn me
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = -tWidth / 2 - 1
tHeigth = (-tWidth / 2) - 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = tImg.width - tWidth
tHeigth = -tWidth / 2
tHeigth = (-tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
else
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = tWidth / 2 + 1
tHeigth = (tWidth / 2) + 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = tImg.width - tWidth
tHeigth = tWidth / 2
tHeigth = (tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
end if
end
@@ -22,7 +22,7 @@ on update me
sprite(pSprite).blend = pCount
else
if 1 = pCount > 100 then
pAdd = pAdd * -1
pAdd = (pAdd * -1)
else
if 1 = pCount < 0 then
me.reset()
@@ -2,7 +2,7 @@ property pDirection, pSprite, pWaitTime, pOffset, pTurnPnt, pType, pAnimFrame

on define me, tsprite, tCount
tDirection = #left
if tCount mod 2 = 1 then
if (tCount mod 2) = 1 then
tDirection = #right
end if
pSprite = tsprite
@@ -65,7 +65,7 @@ on update me
if pAnimFrame > 9 then
pAnimFrame = 2
end if
tFrameNum = pAnimFrame / 2
tFrameNum = (pAnimFrame / 2)
pSprite.castNum = getmemnum("crt" & tFrameNum)
pSprite.width = member.width
pSprite.height = member.height
@@ -58,7 +58,7 @@ on initCloud me
tTempImg = member(getmemnum(pMemName & "_" & tdir)).image
pCloudMember.image = image(tTempImg.width, 60, 8)
tdestrect = image.rect - tTempImg.rect
tdestrect = rect(tdestrect.width / 2, tdestrect.height / 2, tTempImg.width + tdestrect.width / 2, tdestrect.height / 2 + tTempImg.height)
tdestrect = rect((tdestrect.width / 2), (tdestrect.height / 2), tTempImg.width + (tdestrect.width / 2), (tdestrect.height / 2) + tTempImg.height)
image.copyPixels(tTempImg, tdestrect, tTempImg.rect, [#ink:8])
pLoc = pSprite.loc
pSprite.width = tTempImg.width
@@ -78,11 +78,11 @@ on update me
pVertDir = 0
end if
if pSprite.left = pTurnPoint then
pVertDir = pCloudDir * -1
pVertDir = (pCloudDir * -1)
getNextTurnPoint(me)
end if
pLoc.locH = pLoc.locH + 1
if pLoc.locH mod 2 = 0 then
if (pLoc.locH mod 2) = 0 then
pLoc.locV = pLoc.locV + pVertDir
end if
pSprite.loc = pLoc
@@ -108,29 +108,29 @@ on turn me
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = -tWidth / 2 - 1
tHeigth = (-tWidth / 2) - 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = tImg.width - tWidth
tHeigth = -tWidth / 2
tHeigth = (-tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
else
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = tWidth / 2 + 1
tHeigth = (tWidth / 2) + 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = tImg.width - tWidth
tHeigth = tWidth / 2
tHeigth = (tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
end if
end
@@ -2,7 +2,7 @@ property pDirection, pSprite, pWaitTime, pOffset, pTurnPnt, pType, pAnimFrame

on define me, tsprite, tCount
tDirection = #left
if tCount mod 2 = 1 then
if (tCount mod 2) = 1 then
tDirection = #right
end if
pSprite = tsprite
@@ -65,7 +65,7 @@ on update me
if pAnimFrame > 9 then
pAnimFrame = 2
end if
tFrameNum = pAnimFrame / 2
tFrameNum = (pAnimFrame / 2)
pSprite.castNum = getmemnum("crt" & tFrameNum)
pSprite.width = member.width
pSprite.height = member.height
@@ -58,7 +58,7 @@ on initCloud me
tTempImg = member(getmemnum(pMemName & "_" & tdir)).image
pCloudMember.image = image(tTempImg.width, 60, 8)
tdestrect = image.rect - tTempImg.rect
tdestrect = rect(tdestrect.width / 2, tdestrect.height / 2, tTempImg.width + tdestrect.width / 2, tdestrect.height / 2 + tTempImg.height)
tdestrect = rect((tdestrect.width / 2), (tdestrect.height / 2), tTempImg.width + (tdestrect.width / 2), (tdestrect.height / 2) + tTempImg.height)
image.copyPixels(tTempImg, tdestrect, tTempImg.rect, [#ink:8])
pLoc = pSprite.loc
pSprite.width = tTempImg.width
@@ -78,11 +78,11 @@ on update me
pVertDir = 0
end if
if pSprite.left = pTurnPoint then
pVertDir = pCloudDir * -1
pVertDir = (pCloudDir * -1)
getNextTurnPoint(me)
end if
pLoc.locH = pLoc.locH + 1
if pLoc.locH mod 2 = 0 then
if (pLoc.locH mod 2) = 0 then
pLoc.locV = pLoc.locV + pVertDir
end if
pSprite.loc = pLoc
@@ -108,29 +108,29 @@ on turn me
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = -tWidth / 2 - 1
tHeigth = (-tWidth / 2) - 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = tImg.width - tWidth
tHeigth = -tWidth / 2
tHeigth = (-tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
else
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = tWidth / 2 + 1
tHeigth = (tWidth / 2) + 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = tImg.width - tWidth
tHeigth = tWidth / 2
tHeigth = (tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
end if
end
@@ -2,7 +2,7 @@ property pDirection, pSprite, pWaitTime, pOffset, pTurnPnt

on define me, tsprite, tCount
tDirection = #left
if tCount mod 2 = 1 then
if (tCount mod 2) = 1 then
tDirection = #right
end if
pSprite = tsprite
@@ -58,7 +58,7 @@ on initCloud me
tTempImg = image.duplicate()
pCloudMember.image = image(tTempImg.width, 60, 8)
tdestrect = image.rect - tTempImg.rect
tdestrect = rect(tdestrect.width / 2, tdestrect.height / 2, tTempImg.width + tdestrect.width / 2, tdestrect.height / 2 + tTempImg.height)
tdestrect = rect((tdestrect.width / 2), (tdestrect.height / 2), tTempImg.width + (tdestrect.width / 2), (tdestrect.height / 2) + tTempImg.height)
image.copyPixels(tTempImg, tdestrect, tTempImg.rect, [#ink:8])
pLoc = pSprite.loc
pSprite.width = tTempImg.width
@@ -78,11 +78,11 @@ on update me
pVertDir = 0
end if
if pSprite.left = pTurnPoint then
pVertDir = pCloudDir * -1
pVertDir = (pCloudDir * -1)
getNextTurnPoint(me)
end if
pLoc.locH = pLoc.locH + 1
if pLoc.locH mod 2 = 0 then
if (pLoc.locH mod 2) = 0 then
pLoc.locV = pLoc.locV + pVertDir
end if
pSprite.loc = pLoc
@@ -108,29 +108,29 @@ on turn me
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = -tWidth / 2 - 1
tHeigth = (-tWidth / 2) - 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = tImg.width - tWidth
tHeigth = -tWidth / 2
tHeigth = (-tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
else
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = tWidth / 2 + 1
tHeigth = (tWidth / 2) + 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = tImg.width - tWidth
tHeigth = tWidth / 2
tHeigth = (tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
end if
end
@@ -27,7 +27,7 @@ end

on reset me
if pDelayCounter <= 0 then
pDelayCounter = random(8) * 10
pDelayCounter = (random(8) * 10)
end if
pDirection = [#left, #right].getAt(random(2))
if pmodel = "boat_1" then
@@ -58,7 +58,7 @@ on initCloud me
tTempImg = member(getmemnum(pMemName & "_" & tdir)).image
pCloudMember.image = image(tTempImg.width, 60, 8)
tdestrect = image.rect - tTempImg.rect
tdestrect = rect(tdestrect.width / 2, tdestrect.height / 2, tTempImg.width + tdestrect.width / 2, tdestrect.height / 2 + tTempImg.height)
tdestrect = rect((tdestrect.width / 2), (tdestrect.height / 2), tTempImg.width + (tdestrect.width / 2), (tdestrect.height / 2) + tTempImg.height)
image.copyPixels(tTempImg, tdestrect, tTempImg.rect, [#ink:8])
pLoc = pSprite.loc
pSprite.width = tTempImg.width
@@ -78,11 +78,11 @@ on update me
pVertDir = 0
end if
if pSprite.left = pTurnPoint then
pVertDir = pCloudDir * -1
pVertDir = (pCloudDir * -1)
getNextTurnPoint(me)
end if
pLoc.locH = pLoc.locH + 1
if pLoc.locH mod 2 = 0 then
if (pLoc.locH mod 2) = 0 then
pLoc.locV = pLoc.locV + pVertDir
end if
pSprite.loc = pLoc
@@ -108,29 +108,29 @@ on turn me
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = -tWidth / 2 - 1
tHeigth = (-tWidth / 2) - 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = tImg.width - tWidth
tHeigth = -tWidth / 2
tHeigth = (-tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
else
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = tWidth / 2 + 1
tHeigth = (tWidth / 2) + 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = tImg.width - tWidth
tHeigth = tWidth / 2
tHeigth = (tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
end if
end
@@ -236,12 +236,12 @@ on openView me
end if
tTopSpr = tVisObj.getSprById("box_top")
tBotSpr = tVisObj.getSprById("box_bottom")
tTimeLeft = pViewMaxTime - the milliSeconds - pViewOpenTime / 1000
tTimeLeft = (pViewMaxTime - the milliSeconds - pViewOpenTime / 1000)
tmoveLeft = tTopSpr.height - abs(tTopSpr.locV)
if tTimeLeft <= 0 then
tOffset = abs(tmoveLeft)
else
tOffset = abs(tmoveLeft / tTimeLeft) / the frameTempo
tOffset = (abs((tmoveLeft / tTimeLeft)) / the frameTempo)
end if
tTopSpr.locV = tTopSpr.locV - tOffset
tBotSpr.locV = tBotSpr.locV + tOffset
@@ -258,12 +258,12 @@ on closeView me
end if
tTopSpr = tVisObj.getSprById("box_top")
tBotSpr = tVisObj.getSprById("box_bottom")
tTimeLeft = pViewMaxTime - the milliSeconds - pViewCloseTime / 1000
tTimeLeft = (pViewMaxTime - the milliSeconds - pViewCloseTime / 1000)
tmoveLeft = 0 - abs(tTopSpr.locV)
if tTimeLeft <= 0 then
tOffset = abs(tmoveLeft)
else
tOffset = abs(tmoveLeft / tTimeLeft) / the frameTempo
tOffset = (abs((tmoveLeft / tTimeLeft)) / the frameTempo)
end if
tTopSpr.locV = tTopSpr.locV + tOffset
tBotSpr.locV = tBotSpr.locV - tOffset
@@ -313,7 +313,7 @@ on updateClubStatus me, tStatus
if not tWndObj.elementExists("club_bottombar_text2") then
return(0)
end if
tDays = tStatus.getAt(#daysLeft) + tStatus.getAt(#PrepaidPeriods) * 31
tDays = tStatus.getAt(#daysLeft) + (tStatus.getAt(#PrepaidPeriods) * 31)
if tStatus.getAt(#PrepaidPeriods) < 0 then
tWndObj.getElement("club_bottombar_text1").setText(getText("club_habbo.bottombar.text.member"))
tWndObj.getElement("club_bottombar_text2").setText(getText("club_member"))
@@ -1,7 +1,7 @@
property pDirection, pSprite, pOffset, pTurnPnt

on define me, tsprite, tCount
if tCount mod 2 then
if (tCount mod 2) then
tdir = #right
else
tdir = #left
@@ -58,7 +58,7 @@ on initCloud me
tTempImg = member(getmemnum(pMemName & "_" & tdir)).image
pCloudMember.image = image(tTempImg.width, 60, 8)
tdestrect = image.rect - tTempImg.rect
tdestrect = rect(tdestrect.width / 2, tdestrect.height / 2, tTempImg.width + tdestrect.width / 2, tdestrect.height / 2 + tTempImg.height)
tdestrect = rect((tdestrect.width / 2), (tdestrect.height / 2), tTempImg.width + (tdestrect.width / 2), (tdestrect.height / 2) + tTempImg.height)
image.copyPixels(tTempImg, tdestrect, tTempImg.rect, [#ink:8])
pLoc = pSprite.loc
pSprite.width = tTempImg.width
@@ -78,11 +78,11 @@ on update me
pVertDir = 0
end if
if pSprite.left = pTurnPoint then
pVertDir = pCloudDir * -1
pVertDir = (pCloudDir * -1)
getNextTurnPoint(me)
end if
pLoc.locH = pLoc.locH + 1
if pLoc.locH mod 2 = 0 then
if (pLoc.locH mod 2) = 0 then
pLoc.locV = pLoc.locV + pVertDir
end if
pSprite.loc = pLoc
@@ -108,29 +108,29 @@ on turn me
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = -tWidth / 2 - 1
tHeigth = (-tWidth / 2) - 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = tImg.width - tWidth
tHeigth = -tWidth / 2
tHeigth = (-tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
else
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = tWidth / 2 + 1
tHeigth = (tWidth / 2) + 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = tImg.width - tWidth
tHeigth = tWidth / 2
tHeigth = (tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
end if
end
@@ -2,7 +2,7 @@ property pSprite, pDirection, pWaitTime, pOffset, pTurnPnt

on define me, tsprite, tCount
tDirection = #left
if tCount mod 2 = 1 then
if (tCount mod 2) = 1 then
tDirection = #right
end if
pSprite = tsprite
@@ -58,7 +58,7 @@ on initCloud me
tTempImg = image.duplicate()
pCloudMember.image = image(tTempImg.width, 60, 8)
tdestrect = image.rect - tTempImg.rect
tdestrect = rect(tdestrect.width / 2, tdestrect.height / 2, tTempImg.width + tdestrect.width / 2, tdestrect.height / 2 + tTempImg.height)
tdestrect = rect((tdestrect.width / 2), (tdestrect.height / 2), tTempImg.width + (tdestrect.width / 2), (tdestrect.height / 2) + tTempImg.height)
image.copyPixels(tTempImg, tdestrect, tTempImg.rect, [#ink:8])
pLoc = pSprite.loc
pSprite.width = tTempImg.width
@@ -78,11 +78,11 @@ on update me
pVertDir = 0
end if
if pSprite.left = pTurnPoint then
pVertDir = pCloudDir * -1
pVertDir = (pCloudDir * -1)
getNextTurnPoint(me)
end if
pLoc.locH = pLoc.locH + 1
if pLoc.locH mod 2 = 0 then
if (pLoc.locH mod 2) = 0 then
pLoc.locV = pLoc.locV + pVertDir
end if
pSprite.loc = pLoc
@@ -108,29 +108,29 @@ on turn me
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = -tWidth / 2 - 1
tHeigth = (-tWidth / 2) - 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = tImg.width - tWidth
tHeigth = -tWidth / 2
tHeigth = (-tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
else
pImg.fill(pImg.rect, rgb(255, 255, 255))
tImg = member(getmemnum(pMemName & "_right")).image
tWidth = pSprite.right - pTurnPoint
tHeigth = tWidth / 2 + 1
tHeigth = (tWidth / 2) + 1
tSource = tImg.rect - rect(0, 0, tWidth, 0)
tdestrect = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tdestrect = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tdestrect, tSource, [#ink:8])
tImg = member(getmemnum(pMemName & "_left")).image
tWidth = tImg.width - tWidth
tHeigth = tWidth / 2
tHeigth = (tWidth / 2)
tSource = rect(tWidth, 0, tImg.width, tImg.height)
tDest = tSource + rect(0, pImg.height / 2 - tSource.height / 2 + tHeigth, 0, pImg.height / 2 - tSource.height / 2 + tHeigth)
tDest = tSource + rect(0, (pImg.height / 2) - (tSource.height / 2) + tHeigth, 0, (pImg.height / 2) - (tSource.height / 2) + tHeigth)
pImg.copyPixels(tImg, tDest, tSource, [#ink:8])
end if
end
@@ -109,7 +109,7 @@ on rotate me, tChange
end if
j = 0
repeat while j <= 3
tDirection = tDirection + tChange + j mod 8
tDirection = (tDirection + tChange + j mod 8)
if tDirection.getAt(1) < 0 then
tDirection = 8 + tDirection
end if
@@ -156,7 +156,7 @@ on setSlideTo me, tFromLoc, tToLoc, tTimeNow, tHasCharacter
tDistances.setAt(1, abs(tFromLoc.getAt(1) - tToLoc.getAt(1)))
tDistances.setAt(2, abs(tFromLoc.getAt(2) - tToLoc.getAt(2)))
tDistances.setAt(3, abs(tFromLoc.getAt(3) - tToLoc.getAt(3)))
tMoveTime = max(tDistances) * pSlideTimePerTile
tMoveTime = (max(tDistances) * pSlideTimePerTile)
pSlideEndTime = pSlideStartTime + tMoveTime
pStartloc = [pLocX, pLocY, pLocH]
pDestLoc = tToLoc
@@ -176,10 +176,10 @@ on animateSlide me, tTimeNow
return(1)
end if
tTimeUsed = float(tTimeNow - pSlideStartTime)
tPercentSlided = tTimeUsed / float(pSlideEndTime - pSlideStartTime)
pLocX = float(pDestLoc.getAt(1) - pStartloc.getAt(1)) * tPercentSlided + pStartloc.getAt(1)
pLocY = float(pDestLoc.getAt(2) - pStartloc.getAt(2)) * tPercentSlided + pStartloc.getAt(2)
pLocH = float(pDestLoc.getAt(3) - pStartloc.getAt(3)) * tPercentSlided + pStartloc.getAt(3)
tPercentSlided = (tTimeUsed / float(pSlideEndTime - pSlideStartTime))
pLocX = (float(pDestLoc.getAt(1) - pStartloc.getAt(1)) * tPercentSlided) + pStartloc.getAt(1)
pLocY = (float(pDestLoc.getAt(2) - pStartloc.getAt(2)) * tPercentSlided) + pStartloc.getAt(2)
pLocH = (float(pDestLoc.getAt(3) - pStartloc.getAt(3)) * tPercentSlided) + pStartloc.getAt(3)
me.updateLocation()
return(1)
end
@@ -548,7 +548,7 @@ on updateLocation me
tSpr.loc = tSpr.loc + tLocShift
tZ = pLoczList.getAt(i).getAt(pDirection.getAt(1) + 1)
if pCorrectLocZ then
tSpr.locZ = tScreenLocs.getAt(3) + pLocH * 1000 + tZ - 1
tSpr.locZ = tScreenLocs.getAt(3) + (pLocH * 1000) + tZ - 1
else
tSpr.locZ = tScreenLocs.getAt(3) + tZ - 1
end if
@@ -117,15 +117,15 @@ on update me
end if
end if
if pFrameNumberList.getAt(tLayer) < tFrameCount or tLoop then
pFrameNumberList.setAt(tLayer, pFrameNumberList.getAt(tLayer) mod tFrameCount + 1)
pFrameNumberList.setAt(tLayer, (pFrameNumberList.getAt(tLayer) mod tFrameCount) + 1)
tRandom = 0
if not voidp(tFrameList.getAt(#random)) then
tRandom = 1
end if
if tRandom and tFrameCount > 1 then
tValue = random(tFrameCount)
if tValue = pFrameNumberList2.getAt(tLayer) then
tValue = pFrameNumberList2.getAt(tLayer) mod tFrameCount + 1
tValue = (pFrameNumberList2.getAt(tLayer) mod tFrameCount) + 1
end if
pFrameNumberList2.setAt(tLayer, tValue)
else
@@ -359,7 +359,7 @@ on getNextState me
if pStateSequenceList.count < 1 then
return(0)
end if
tStateIndex = pStateIndex mod pStateSequenceList.count + 1
tStateIndex = (pStateIndex mod pStateSequenceList.count) + 1
tstate = pStateSequenceList.getAt(tStateIndex)
if ilk(tstate) = #list then
if tstate.count < 1 then
@@ -49,10 +49,10 @@ end
on roll me
if pRolling and the milliSeconds - pRollingStartTime < 3300 or voidp(pRollDir) then
tTime = the milliSeconds - pRollingStartTime
f = tTime * 1 / 3200 * 3.14159 * 0.5
pRollAnimDir = pRollAnimDir + cos(f) * float(pRollingDirection)
me.setProp(#pDirection, 1, abs(integer(pRollAnimDir) mod 8))
me.setProp(#pDirection, 2, abs(integer(pRollAnimDir) mod 8))
f = ((((tTime * 1) / 3200) * 3.14159) * 0.5)
pRollAnimDir = pRollAnimDir + (cos(f) * float(pRollingDirection))
me.setProp(#pDirection, 1, abs((integer(pRollAnimDir) mod 8)))
me.setProp(#pDirection, 2, abs((integer(pRollAnimDir) mod 8)))
else
pRolling = 0
pChanges = 1
@@ -96,7 +96,7 @@ on runEffect me
end if
else
if pActiveEffect = #lines1 then
if pEffectCounter mod 2 = 1 then
if (pEffectCounter mod 2) = 1 then
return(1)
end if
pLineSprite1.visible = 1
@@ -28,7 +28,7 @@ on update me
return()
end if
if pDelay = 0 then
pAnimFrm = pAnimFrm + 1 mod 8
pAnimFrm = (pAnimFrm + 1 mod 8)
tNameB = member.name
tNameC = member.name
tNewNameB = tNameB.getProp(#char, 1, length(tNameB) - 3) & pAnimFrm & "_1"
@@ -49,7 +49,7 @@ on update me
me.getPropRef(#pSprList, 3).blend = 100
end if
end if
pDelay = pDelay + 1 mod 4
pDelay = (pDelay + 1 mod 4)
end

on setHoloLight me
@@ -3,7 +3,7 @@ property pChanges, pLastActive, pActive, pScifiDoorSpeed, pSizeMultiplier, pScif
on construct me
pLastActive = -1
pScifiDoorSpeed = 7
pScifiDoorTimeOut = 0.4 * 60
pScifiDoorTimeOut = (0.4 * 60)
pScifiDoorLocs = [0, 0, 0]
pScifiDoorTimer = 0
pDoubleClick = 0
@@ -76,7 +76,7 @@ on updateScifiDoor me
tTopSp.locV = tTopSp.locV + pScifiDoorSpeed
me.moveTopLine(tMidSp1, -pScifiDoorSpeed)
me.moveTopLine(tMidSp2, -pScifiDoorSpeed)
if tMidSp1.height <= 11 * pSizeMultiplier or tDoorTimer > pScifiDoorTimeOut then
if tMidSp1.height <= (11 * pSizeMultiplier) or tDoorTimer > pScifiDoorTimeOut then
me.SetScifiDoor("down")
end if
else
@@ -90,7 +90,7 @@ on updateScifiDoor me
end if
me.moveTopLine(tMidSp1, pScifiDoorSpeed)
me.moveTopLine(tMidSp2, pScifiDoorSpeed)
if tMidSp1.height > 65 * pSizeMultiplier then
if tMidSp1.height > (65 * pSizeMultiplier) then
me.SetScifiDoor("up")
end if
end if
@@ -106,8 +106,8 @@ on SetScifiDoor me, tdir
tMidSp2 = me.getProp(#pSprList, 3)
if tdir = "up" then
tTopSp.locV = pScifiDoorLocs.getAt(1)
tMidSp1.height = 65 * pSizeMultiplier
tMidSp2.height = 64 * pSizeMultiplier
tMidSp1.height = (65 * pSizeMultiplier)
tMidSp2.height = (64 * pSizeMultiplier)
tMidSp1.locV = pScifiDoorLocs.getAt(2)
tMidSp2.locV = pScifiDoorLocs.getAt(3)
else
@@ -120,10 +120,10 @@ on SetScifiDoor me, tdir
tMidSp1.height = 2
tMidSp2.height = 2
end if
tMidSp1.height = 8 * pSizeMultiplier
tMidSp2.height = 7 * pSizeMultiplier
tMidSp1.locV = pScifiDoorLocs.getAt(2) - 2 * pSizeMultiplier
tMidSp2.locV = pScifiDoorLocs.getAt(3) + 5 * pSizeMultiplier
tMidSp1.height = (8 * pSizeMultiplier)
tMidSp2.height = (7 * pSizeMultiplier)
tMidSp1.locV = pScifiDoorLocs.getAt(2) - (2 * pSizeMultiplier)
tMidSp2.locV = pScifiDoorLocs.getAt(3) + (5 * pSizeMultiplier)
end if
pChanges = 0
pLastActive = pActive
@@ -81,7 +81,7 @@ on initializeSmokeSprites me
i = 2
repeat while i <= pSmokelist.count
tSp = pSmokelist.getAt(i)
tSp.loc = tStartLoc + point(-3, -21) + point(random(6), random(4)) * pSizeMultiplier
tSp.loc = tStartLoc + (point(-3, -21) + point(random(6), random(4)) * pSizeMultiplier)
tSp.ink = 8
tSp.locZ = me.getPropRef(#pSprList, 4).locZ + 1
tSp.blend = 100
@@ -104,28 +104,28 @@ on animateSmallSmokes me, tVal
repeat while i <= pSmokelist.count
if tVal = 2 then
if random(2) = 2 then
pSmokeLocs.getAt(i).setAt(2, pSmokeLocs.getAt(i).getAt(2) - 0.6 * pSizeMultiplier)
pSmokeLocs.getAt(i).setAt(2, pSmokeLocs.getAt(i).getAt(2) - (0.6 * pSizeMultiplier))
end if
else
if tVal = 3 then
pSmokeLocs.getAt(i).setAt(1, pSmokeLocs.getAt(i).getAt(1) + 0.6 - random(6) / 12 * pSizeMultiplier)
pSmokeLocs.getAt(i).setAt(1, pSmokeLocs.getAt(i).getAt(1) + (0.6 - (random(6) / 12) * pSizeMultiplier))
else
if tVal = 4 then
pSmokeLocs.getAt(i).setAt(1, pSmokeLocs.getAt(i).getAt(1) - random(6) / 12 * pSizeMultiplier)
pSmokeLocs.getAt(i).setAt(1, pSmokeLocs.getAt(i).getAt(1) - ((random(6) / 12) * pSizeMultiplier))
else
if tVal = 5 then
pSmokeLocs.getAt(i).setAt(1, pSmokeLocs.getAt(i).getAt(1) + 1 - random(6) / 12 * pSizeMultiplier)
pSmokeLocs.getAt(i).setAt(2, pSmokeLocs.getAt(i).getAt(2) + random(10) / 12 * pSizeMultiplier)
pSmokeLocs.getAt(i).setAt(1, pSmokeLocs.getAt(i).getAt(1) + (1 - (random(6) / 12) * pSizeMultiplier))
pSmokeLocs.getAt(i).setAt(2, pSmokeLocs.getAt(i).getAt(2) + ((random(10) / 12) * pSizeMultiplier))
else
if tVal = 6 then
pSmokeLocs.getAt(i).setAt(1, pSmokeLocs.getAt(i).getAt(1) - 0.5 + random(6) / 12 * pSizeMultiplier)
pSmokeLocs.getAt(i).setAt(2, pSmokeLocs.getAt(i).getAt(2) + random(10) / 12 * pSizeMultiplier)
pSmokeLocs.getAt(i).setAt(1, pSmokeLocs.getAt(i).getAt(1) - (0.5 + (random(6) / 12) * pSizeMultiplier))
pSmokeLocs.getAt(i).setAt(2, pSmokeLocs.getAt(i).getAt(2) + ((random(10) / 12) * pSizeMultiplier))
end if
end if
end if
end if
end if
pSmokeLocs.getAt(i).setAt(2, pSmokeLocs.getAt(i).getAt(2) - 0.7 - random(6) / 12 * pSizeMultiplier)
pSmokeLocs.getAt(i).setAt(2, pSmokeLocs.getAt(i).getAt(2) - (0.7 - (random(6) / 12) * pSizeMultiplier))
pSmokeLocs.getAt(i).setAt(1, pSmokeLocs.getAt(i).getAt(1) + sin(the timer))
pSmokelist.getAt(i).visible = 1
pSmokelist.getAt(i).loc = pSmokeLocs.getAt(i)
@@ -203,7 +203,7 @@ on update me
if pAnimFrame = 14 then
me.changeMember(tSmokeBig, "scifirocket_sm_big")
end if
pSmokeLocs.getAt(1).setAt(2, pSmokeLocs.getAt(1).getAt(2) - 0.9 * pSizeMultiplier)
pSmokeLocs.getAt(1).setAt(2, pSmokeLocs.getAt(1).getAt(2) - (0.9 * pSizeMultiplier))
tSmokeBig.visible = 1
tSmokeBig.loc = pSmokeLocs.getAt(1)
else
@@ -168,8 +168,8 @@ on update me
if tName.getProp(#char, length(tName)) = "1" then
me.getPropRef(#pSprList, 3).visible = 0
else
pAnimActive = pAnimActive + 1 mod pAnimTime
tVisible = pAnimActive mod 2
pAnimActive = (pAnimActive + 1 mod pAnimTime)
tVisible = (pAnimActive mod 2)
if tVisible and random(4) > 1 then
me.getPropRef(#pSprList, 3).visible = 1
else
@@ -315,7 +315,7 @@ end
on updateLocation me
if pFormatVer = #old then
tGeometry = getThread(#room).getInterface().getGeometry()
tScreenLocs = tGeometry.getScreenCoordinate(pLocX, pLocY, pLocH * 18 / 32)
tScreenLocs = tGeometry.getScreenCoordinate(pLocX, pLocY, ((pLocH * 18) / 32))
repeat while pFormatVer <= undefined
tSpr = getAt(undefined, undefined)
tSpr.locH = tScreenLocs.getAt(1)
@@ -102,15 +102,15 @@ on update me
end if
end if
if pFrameNumberList.getAt(tLayer) < tFrameCount or tLoop then
pFrameNumberList.setAt(tLayer, pFrameNumberList.getAt(tLayer) mod tFrameCount + 1)
pFrameNumberList.setAt(tLayer, (pFrameNumberList.getAt(tLayer) mod tFrameCount) + 1)
tRandom = 0
if not voidp(tFrameList.getAt(#random)) then
tRandom = 1
end if
if tRandom and tFrameCount > 1 then
tValue = random(tFrameCount)
if tValue = pFrameNumberList2.getAt(tLayer) then
tValue = pFrameNumberList2.getAt(tLayer) mod tFrameCount + 1
tValue = (pFrameNumberList2.getAt(tLayer) mod tFrameCount) + 1
end if
pFrameNumberList2.setAt(tLayer, tValue)
else
@@ -354,7 +354,7 @@ on getNextState me
if pStateSequenceList.count < 1 then
return(0)
end if
tStateIndex = pStateIndex mod pStateSequenceList.count + 1
tStateIndex = (pStateIndex mod pStateSequenceList.count) + 1
tstate = pStateSequenceList.getAt(tStateIndex)
if ilk(tstate) = #list then
if tstate.count < 1 then
@@ -147,8 +147,8 @@ on feedIconToCard me, tImg
tHei = tElem.getProperty(#height)
tCenteredImage = image(tWid, tHei, 32)
tMatte = tImg.createMatte()
tXchange = tCenteredImage.width - tImg.width / 2
tYchange = tCenteredImage.height - tImg.height / 2
tXchange = (tCenteredImage.width - tImg.width / 2)
tYchange = (tCenteredImage.height - tImg.height / 2)
tRect1 = tImg.rect + rect(tXchange, tYchange, tXchange, tYchange)
tCenteredImage.copyPixels(tImg, tRect1, tImg.rect, [#maskImage:tMatte, #ink:41])
tElem.feedImage(tCenteredImage)
@@ -311,7 +311,7 @@ on updateLocation me
tZ = 0
end if
if pCorrectLocZ then
tSpr.locZ = tScreenLocs.getAt(3) + pLocH * 1000 + tZ
tSpr.locZ = tScreenLocs.getAt(3) + (pLocH * 1000) + tZ
else
tSpr.locZ = tScreenLocs.getAt(3) + tZ
end if
@@ -41,7 +41,7 @@ on update me
if pActive then
pUpdateFrame = not pUpdateFrame
if pUpdateFrame then
pLastFrm = pLastFrm + 1 mod 6
pLastFrm = (pLastFrm + 1 mod 6)
i = 1
repeat while i <= 4
tMemName = member.name
@@ -89,7 +89,7 @@ on renderPreviewImage me, tMemStr, tColorList, tColorListToSolve, tClass
tMem = member(getmemnum(tMemStr))
tOffset = point(50, 50)
tRect = rect(tMem, rect.width + tOffset.locH, tMem, rect.height + tOffset.locV)
tRendered = image(tMem, rect.height + tOffset.locV * 2, 32)
tRendered = image(tMem, rect.height + (tOffset.locV * 2), 32)
tRendered.copyPixels(tMem.image, tRect, tMem.rect)
i = 1
repeat while i <= pPossibleParts.count
@@ -19,7 +19,7 @@ on display me, tName, tScore, tTeamId, tloc, tOwnPlayer
tsprite.member = tmember
end if
tsprite.locZ = 1000000
tsprite.loc = point(tloc.getAt(1) - tmember.width / 2, tloc.getAt(2) + 10)
tsprite.loc = point(tloc.getAt(1) - (tmember.width / 2), tloc.getAt(2) + 10)
tsprite.ink = 36
if not tOwnPlayer then
tmember = member(getmemnum("sw_avatar_hilite_team_" & tTeamId))
@@ -38,7 +38,7 @@ on update me
tAnimCntr = me.pAnimCounter
else
if tAction = "wav" then
tAnimCntr = me.pAnimCounter mod 2
tAnimCntr = (me.pAnimCounter mod 2)
else
if ["crr", "drk", "ohd"].getPos(tAction) <> 0 then
if me.pDirection >= 4 then
@@ -65,7 +65,7 @@ on update me
tAnimCntr = me.pAnimCounter
else
if tAction = "wav" then
tAnimCntr = me.pAnimCounter mod 2
tAnimCntr = (me.pAnimCounter mod 2)
tPart = "l" & me.getProp(#char, 2)
tdir = me.pDirection
else
@@ -86,16 +86,16 @@ on update me
else
tAction = "spk"
end if
tAnimCntr = me.pAnimCounter mod 2
tAnimCntr = (me.pAnimCounter mod 2)
end if
else
if me.pPart = "ey" then
if me.pTalking and me.pAction <> "lay" and me.pAnimCounter mod 2 = 0 then
if me.pTalking and me.pAction <> "lay" and (me.pAnimCounter mod 2) = 0 then
me.pYFix = -1
end if
else
if me.pPart = "hr" then
if me.pTalking and me.pAnimCounter mod 2 = 0 then
if me.pTalking and (me.pAnimCounter mod 2) = 0 then
if me.pAction <> "lay" then
tAction = "spk"
end if
@@ -176,7 +176,7 @@ on gameObjectAction me, tAction, tdata
else
if tAction = "start_create" then
pAvatarAction.setAt(#tag, "")
tDirection = me.pDirection - me.pDirection mod 2
tDirection = me.pDirection - (me.pDirection mod 2)
call(#defineDir, me.pPartList, tDirection)
me.pMainAction = "pck"
call(#defineActMultiple, me.pPartList, "pck", ["bd", "sh"])
@@ -186,9 +186,9 @@ on gameObjectAction me, tAction, tdata
else
if tAction = "start_stunned" then
me.gameObjectMoveDone(me.pLocX, me.pLocY, me.pLocH, me.pDirection, me.pDirection)
tBallDirection = tdata.getAt(#hit_direction) - tdata.getAt(#hit_direction) mod 2
tMyDirection = me.pDirection - me.pDirection mod 2
if tBallDirection <> tMyDirection and tBallDirection mod 4 = tMyDirection mod 4 then
tBallDirection = tdata.getAt(#hit_direction) - (tdata.getAt(#hit_direction) mod 2)
tMyDirection = me.pDirection - (me.pDirection mod 2)
if tBallDirection <> tMyDirection and (tBallDirection mod 4) = (tMyDirection mod 4) then
tDeathDirection = tMyDirection
tFaceUp = 1
else
@@ -253,13 +253,13 @@ on prepare me
me.pInvincibleCounter = 0
end if
end if
me.pAnimCounter = me.pAnimCounter + 1 mod 4
me.pAnimCounter = (me.pAnimCounter + 1 mod 4)
if me.pMoving then
tFactor = float(the milliSeconds - me.pMoveStart) / me.pMoveTime
tFactor = (float(the milliSeconds - me.pMoveStart) / me.pMoveTime)
if tFactor > 1 then
tFactor = 1
end if
me.pScreenLoc = me.pDestLScreen - me.pStartLScreen * tFactor + me.pStartLScreen
me.pScreenLoc = (me.pDestLScreen - me.pStartLScreen * tFactor) + me.pStartLScreen
me.pChanges = 1
end if
end
@@ -408,7 +408,7 @@ on render me
me.regPoint = me.regPoint + tpoint
end if
if me.pCorrectLocZ then
tOffZ = me.pLocH + me.pRestingHeight * 1000 + 2
tOffZ = (me.pLocH + me.pRestingHeight * 1000) + 2
else
tOffZ = 2
end if
@@ -651,7 +651,7 @@ on setPartLists me, tmodels
else
tColor = tmodels.getAt(tPartSymbol).getAt("color")
end if
if tColor.red + tColor.green + tColor.blue > 238 * 3 then
if tColor.red + tColor.green + tColor.blue > (238 * 3) then
tColor = rgb("EEEEEE")
end if
tPartObj.define(tPartSymbol, tmodels.getAt(tPartSymbol).getAt("model"), tColor, me.pDirection, tAction, me)
@@ -698,7 +698,7 @@ on setOwnHiliter me, tstate
tsprite.visible = tstate
end if
tsprite.locZ = me.getProp(#pScreenLoc, 3) + 1
me.getProp(#pScreenLoc, 1).loc = point(tsprite + member.width / 2, me.getProp(#pScreenLoc, 2))
me.getProp(#pScreenLoc, 1).loc = point(tsprite + (member.width / 2), me.getProp(#pScreenLoc, 2))
end

on getPicture me, tImg
@@ -30,8 +30,8 @@ on Refresh me, tTopic, tdata
end

on startGameCountdown me, tSecondsLeft, tSecondsNowElapsed
tMSecLeft = tSecondsLeft * 1000
tDuration = tSecondsLeft + tSecondsNowElapsed * 1000
tMSecLeft = (tSecondsLeft * 1000)
tDuration = (tSecondsLeft + tSecondsNowElapsed * 1000)
if tMSecLeft <= 0 then
return(0)
end if
@@ -89,8 +89,8 @@ on setBar me
if the milliSeconds >= pEndTime then
return(me.removeGameCountdown())
end if
tProc = pEndTime - the milliSeconds / float(pDuration)
tNextWidth = 159 * tProc
tProc = (pEndTime - the milliSeconds / float(pDuration))
tNextWidth = (159 * tProc)
tCurrWidth = tElem.getProperty(#width)
if tNextWidth < 80 then
if tNextWidth < 39 then
@@ -99,7 +99,7 @@ on eventProcRoom me, tEvent, tSprID, tParam
return(1)
end if
if tEvent = #mouseUp then
tMouseDownTime = the milliSeconds - pMouseClickTime / 1000
tMouseDownTime = (the milliSeconds - pMouseClickTime / 1000)
if the optionDown then
pMouseClickTime = -1
return(me.sendThrowBall(tloc, 2))
@@ -25,7 +25,7 @@ on handle_msgstruct_objects me, tdata
tObj.setAt(#y, integer(tLine.getProp(#word, 4)))
tObj.setAt(#h, integer(tLine.getProp(#word, 5)))
if tLine.count(#word) = 6 then
tdir = integer(tLine.getProp(#word, 6)) mod 8
tdir = (integer(tLine.getProp(#word, 6)) mod 8)
tObj.setAt(#direction, [tdir, tdir, tdir])
tObj.setAt(#dimensions, 0)
else
@@ -266,7 +266,7 @@ end
on renderFinalScoreItem me, tTeam
tNameTxt = ""
tScoreTxt = ""
tImage = image(165, tTeam.getAt(#players).count * 16, 32)
tImage = image(165, (tTeam.getAt(#players).count * 16), 32)
tPlayerNum = 1
repeat while tPlayerNum <= tTeam.getAt(#players).count
tScoreTxt = tScoreTxt & tTeam.getAt(#players).getAt(tPlayerNum).getAt(#score) & "\r"
@@ -335,7 +335,7 @@ on showPlayerIcon me, tIcon, tdata
else
tStarImg = image(11, 9, 8)
end if
tImage.copyPixels(tStarImg, tStarImg.rect + rect(109, 1 + 16 * tMyPlayerNum - 1, 109, 1 + 16 * tMyPlayerNum - 1), tStarImg.rect)
tImage.copyPixels(tStarImg, tStarImg.rect + rect(109, 1 + (16 * tMyPlayerNum - 1), 109, 1 + (16 * tMyPlayerNum - 1)), tStarImg.rect)
tElem.feedImage(tImage)
return(1)
end
@@ -368,7 +368,7 @@ on startResetCountdown me, tSecondsLeft
if tSecondsLeft <= 0 then
return(0)
end if
pCountdownEndTime = the milliSeconds + tSecondsLeft * 1000
pCountdownEndTime = the milliSeconds + (tSecondsLeft * 1000)
if timeoutExists(pTimeOutID) then
removeTimeout(pTimeOutID)
end if
@@ -378,8 +378,8 @@ on startResetCountdown me, tSecondsLeft
end

on convertToMinSec me, tTime
tMin = tTime / 60000
tSec = tTime mod 60000 / 1000
tMin = (tTime / 60000)
tSec = ((tTime mod 60000) / 1000)
if tSec < 10 then
tSec = "0" & tSec
end if
@@ -74,7 +74,7 @@ on startGameTimer me, tTimeUntilNextState, tStateDuration, tTimeUntilGameEnd
if tTimeUntilNextState <= 0 then
return(0)
end if
pTimerEndTime = the milliSeconds + tTimeUntilNextState * 1000
pTimerEndTime = the milliSeconds + (tTimeUntilNextState * 1000)
pTimerDurationSec = tStateDuration
if timeoutExists(pTimeOutID) then
removeTimeout(pTimeOutID)
@@ -84,8 +84,8 @@ on startGameTimer me, tTimeUntilNextState, tStateDuration, tTimeUntilGameEnd
end

on convertToMinSec me, tTime
tMin = tTime / 60000
tSec = tTime mod 60000 / 1000
tMin = (tTime / 60000)
tSec = ((tTime mod 60000) / 1000)
if tSec < 10 then
tSec = "0" & tSec
end if
@@ -26,28 +26,28 @@ on calculateFlightPath me, tdata, tTargetX, tTargetY
tX = tdata.x
tY = tdata.y
me.setProp(#pGameObjectSyncValues, #trajectory, tdata.getAt(#trajectory))
tDeltaX = tTargetX - tX / 200
tDeltaY = tTargetY - tY / 200
tDeltaX = (tTargetX - tX / 200)
tDeltaY = (tTargetY - tY / 200)
me.setProp(#pGameObjectSyncValues, #movement_direction, tGameSystem.get360AngleFromComponents(tDeltaX, tDeltaY))
if tdata.getAt(#trajectory) = pConstants.TRAJECTORY_QUICK_THROW then
tZ = pConstants.QUICK_THROW_HEIGHT_LEVEL
me.setProp(#pGameObjectSyncValues, #time_to_live, pConstants.QUICK_THROW_TIME_TO_LIVE)
else
if tdata.getAt(#trajectory) = pConstants.TRAJECTORY_SHORT_LOB then
tDistanceToTarget = tGameSystem.sqrt(tDeltaX * tDeltaX + tDeltaY * tDeltaY) * 200
tDistanceToTarget = (tGameSystem.sqrt((tDeltaX * tDeltaX) + (tDeltaY * tDeltaY)) * 200)
tZ = pConstants.SHORT_LOB_HEIGHT_LEVEL
me.setProp(#pGameObjectSyncValues, #time_to_live, tDistanceToTarget / pConstants.SHORT_LOB_VELOCITY)
me.setProp(#pGameObjectSyncValues, #time_to_live, (tDistanceToTarget / pConstants.SHORT_LOB_VELOCITY))
else
if tdata.getAt(#trajectory) = pConstants.TRAJECTORY_LONG_LOB then
tDistanceToTarget = tGameSystem.sqrt(tDeltaX * tDeltaX + tDeltaY * tDeltaY) * 200
tDistanceToTarget = (tGameSystem.sqrt((tDeltaX * tDeltaX) + (tDeltaY * tDeltaY)) * 200)
tZ = pConstants.LONG_LOB_HEIGHT_LEVEL
me.setProp(#pGameObjectSyncValues, #time_to_live, tDistanceToTarget / pConstants.LONG_LOB_VELOCITY)
me.setProp(#pGameObjectSyncValues, #time_to_live, (tDistanceToTarget / pConstants.LONG_LOB_VELOCITY))
else
return(0)
end if
end if
end if
me.setProp(#pGameObjectSyncValues, #parabola_offset, me.getProp(#pGameObjectSyncValues, #time_to_live) / 2)
me.setProp(#pGameObjectSyncValues, #parabola_offset, (me.getProp(#pGameObjectSyncValues, #time_to_live) / 2))
me.createSprites(tX, tY, tZ)
return(1)
end
@@ -59,25 +59,25 @@ on calculateFrameMovement me
tLocation3D = me.getLocation()
me.setProp(#pGameObjectSyncValues, #time_to_live, me.getProp(#pGameObjectSyncValues, #time_to_live) - 1)
if me.getProp(#pGameObjectSyncValues, #trajectory) = pConstants.TRAJECTORY_QUICK_THROW then
tNewX = tLocation3D.x + pVelocityTable.GetBaseVelX(me.getProp(#pGameObjectSyncValues, #movement_direction)) * pConstants.QUICK_THROW_VELOCITY / 255
tNewY = tLocation3D.y + pVelocityTable.GetBaseVelY(me.getProp(#pGameObjectSyncValues, #movement_direction)) * pConstants.QUICK_THROW_VELOCITY / 255
tNewX = tLocation3D.x + ((pVelocityTable.GetBaseVelX(me.getProp(#pGameObjectSyncValues, #movement_direction)) * pConstants.QUICK_THROW_VELOCITY) / 255)
tNewY = tLocation3D.y + ((pVelocityTable.GetBaseVelY(me.getProp(#pGameObjectSyncValues, #movement_direction)) * pConstants.QUICK_THROW_VELOCITY) / 255)
if me.getProp(#pGameObjectSyncValues, #time_to_live) > pConstants.QUICK_THROW_DESCENT_POINT then
tTemp = pConstants.QUICK_THROW_DESCENT_POINT - me.getProp(#pGameObjectSyncValues, #parabola_offset)
else
tTemp = me.getProp(#pGameObjectSyncValues, #time_to_live) - me.getProp(#pGameObjectSyncValues, #parabola_offset)
end if
tNewZ = me.getProp(#pGameObjectSyncValues, #parabola_offset) * me.getProp(#pGameObjectSyncValues, #parabola_offset) - tTemp * tTemp * 4 + pConstants.QUICK_THROW_HEIGHT_LEVEL
tNewZ = ((me.getProp(#pGameObjectSyncValues, #parabola_offset) * me.getProp(#pGameObjectSyncValues, #parabola_offset)) - (tTemp * tTemp) * 4) + pConstants.QUICK_THROW_HEIGHT_LEVEL
else
if me.getProp(#pGameObjectSyncValues, #trajectory) = pConstants.TRAJECTORY_SHORT_LOB then
tNewX = tLocation3D.x + pVelocityTable.GetBaseVelX(me.getProp(#pGameObjectSyncValues, #movement_direction)) * pConstants.SHORT_LOB_VELOCITY / 255
tNewY = tLocation3D.y + pVelocityTable.GetBaseVelY(me.getProp(#pGameObjectSyncValues, #movement_direction)) * pConstants.SHORT_LOB_VELOCITY / 255
tNewX = tLocation3D.x + ((pVelocityTable.GetBaseVelX(me.getProp(#pGameObjectSyncValues, #movement_direction)) * pConstants.SHORT_LOB_VELOCITY) / 255)
tNewY = tLocation3D.y + ((pVelocityTable.GetBaseVelY(me.getProp(#pGameObjectSyncValues, #movement_direction)) * pConstants.SHORT_LOB_VELOCITY) / 255)
tTemp = me.getProp(#pGameObjectSyncValues, #time_to_live) - me.getProp(#pGameObjectSyncValues, #parabola_offset)
tNewZ = me.getProp(#pGameObjectSyncValues, #parabola_offset) * me.getProp(#pGameObjectSyncValues, #parabola_offset) - tTemp * tTemp * 10 + pConstants.SHORT_LOB_HEIGHT_LEVEL
tNewZ = ((me.getProp(#pGameObjectSyncValues, #parabola_offset) * me.getProp(#pGameObjectSyncValues, #parabola_offset)) - (tTemp * tTemp) * 10) + pConstants.SHORT_LOB_HEIGHT_LEVEL
else
tNewX = tLocation3D.x + pVelocityTable.GetBaseVelX(me.getProp(#pGameObjectSyncValues, #movement_direction)) * pConstants.LONG_LOB_VELOCITY / 255
tNewY = tLocation3D.y + pVelocityTable.GetBaseVelY(me.getProp(#pGameObjectSyncValues, #movement_direction)) * pConstants.LONG_LOB_VELOCITY / 255
tNewX = tLocation3D.x + ((pVelocityTable.GetBaseVelX(me.getProp(#pGameObjectSyncValues, #movement_direction)) * pConstants.LONG_LOB_VELOCITY) / 255)
tNewY = tLocation3D.y + ((pVelocityTable.GetBaseVelY(me.getProp(#pGameObjectSyncValues, #movement_direction)) * pConstants.LONG_LOB_VELOCITY) / 255)
tTemp = me.getProp(#pGameObjectSyncValues, #time_to_live) - me.getProp(#pGameObjectSyncValues, #parabola_offset)
tNewZ = me.getProp(#pGameObjectSyncValues, #parabola_offset) * me.getProp(#pGameObjectSyncValues, #parabola_offset) - tTemp * tTemp * 100 + pConstants.LONG_LOB_HEIGHT_LEVEL
tNewZ = ((me.getProp(#pGameObjectSyncValues, #parabola_offset) * me.getProp(#pGameObjectSyncValues, #parabola_offset)) - (tTemp * tTemp) * 100) + pConstants.LONG_LOB_HEIGHT_LEVEL
end if
end if
me.setLocation(tNewX, tNewY, tNewZ)
@@ -93,7 +93,7 @@ on updateHealth me, tValue
if pOrigHealthBarLoc = void() then
pOrigHealthBarLoc = point(tElem.getProperty(#locH), tElem.getProperty(#locV))
end if
tPercent = tValue * 1 / pMaxHealth
tPercent = ((tValue * 1) / pMaxHealth)
if tPercent > 0.7 then
tmember = "ui_healthbar_green"
else
@@ -111,7 +111,7 @@ on updateHealth me, tValue
if tValue = pMaxHealth then
pMaxHealthBarHeight = tElemHeight
end if
tHeightAdjust = integer(tPercent * pMaxHealthBarHeight - tElemHeight)
tHeightAdjust = integer((tPercent * pMaxHealthBarHeight) - tElemHeight)
tTotalAdjust = pMaxHealthBarHeight - tElemHeight + tHeightAdjust
tElem.resizeBy(0, tHeightAdjust)
tElem.moveTo(pOrigHealthBarLoc.locH, pOrigHealthBarLoc.locV + tTotalAdjust)
@@ -165,7 +165,7 @@ on animateBallCountFlashing me
if tWndObj = 0 then
return(0)
end if
tMemNum = 1 + pBallCountAnimTimer / 4 mod 2
tMemNum = 1 + ((pBallCountAnimTimer / 4) mod 2)
tMemName = ["ui_snowball_slots", "ui_snowball_slots_hilite"].getAt(tMemNum)
tElem = tWndObj.getElement("int_alapalkki_balls_bg")
if tElem = 0 then
@@ -97,9 +97,9 @@ on showInstanceList me
if not listp(tList) then
tList = [:]
end if
tStartIndex = pGameListPage - 1 * pGamesPerPage + 1
tStartIndex = (pGameListPage - 1 * pGamesPerPage) + 1
pRenderObj.renderInstanceList(tList, tStartIndex, pGamesPerPage)
tNumPages = integer(tList.count - 1 / pGamesPerPage) + 1
tNumPages = integer((tList.count - 1 / pGamesPerPage)) + 1
if pGameListPage > tNumPages then
pGameListPage = 1
end if
@@ -233,27 +233,27 @@ on eventProcMainWindow me, tEvent, tSprID, tParam
return(error(me, "Gamesystem not found.", #eventProcMainWindow))
end if
if tSprID = "gs_area_gameList1" then
tIndexOnPage = 1 + pGameListPage - 1 * pGamesPerPage
tIndexOnPage = 1 + (pGameListPage - 1 * pGamesPerPage)
return(me.getComponent().observeInstance(tIndexOnPage))
else
if tSprID = "gs_area_gameList2" then
tIndexOnPage = 2 + pGameListPage - 1 * pGamesPerPage
tIndexOnPage = 2 + (pGameListPage - 1 * pGamesPerPage)
return(me.getComponent().observeInstance(tIndexOnPage))
else
if tSprID = "gs_area_gameList3" then
tIndexOnPage = 3 + pGameListPage - 1 * pGamesPerPage
tIndexOnPage = 3 + (pGameListPage - 1 * pGamesPerPage)
return(me.getComponent().observeInstance(tIndexOnPage))
else
if tSprID = "gs_area_gameList4" then
tIndexOnPage = 4 + pGameListPage - 1 * pGamesPerPage
tIndexOnPage = 4 + (pGameListPage - 1 * pGamesPerPage)
return(me.getComponent().observeInstance(tIndexOnPage))
else
if tSprID = "gs_area_gameList5" then
tIndexOnPage = 5 + pGameListPage - 1 * pGamesPerPage
tIndexOnPage = 5 + (pGameListPage - 1 * pGamesPerPage)
return(me.getComponent().observeInstance(tIndexOnPage))
else
if tSprID = "gs_area_gameList6" then
tIndexOnPage = 6 + pGameListPage - 1 * pGamesPerPage
tIndexOnPage = 6 + (pGameListPage - 1 * pGamesPerPage)
return(me.getComponent().observeInstance(tIndexOnPage))
else
if tSprID = "gs_arrow_pageFwd" then
@@ -456,7 +456,7 @@ on changeInstanceListPage me, tOffset
if not listp(tList) then
return(0)
end if
tNumPages = integer(tList.count - 1 / pGamesPerPage) + 1
tNumPages = integer((tList.count - 1 / pGamesPerPage)) + 1
if tOffset = 1 then
if pGameListPage >= tNumPages then
return(0)
@@ -244,7 +244,7 @@ on renderInstanceDetailButton me, tButtonState, tGameState
else
if tText <> #empty then
tImage = pWriterPlainBoldLeft.render(tText)
tLocH = tWidth / 2 - tImage.width / 2
tLocH = (tWidth / 2) - (tImage.width / 2)
tResult.copyPixels(tImage, tImage.rect + rect(tLocH, 3, tLocH, 3), tImage.rect)
end if
end if
@@ -380,8 +380,8 @@ on updateRadioButton me, tElement, tListOfOthersElements
end

on convertSecToMinSec me, tTime
tMin = tTime / 60
tSec = tTime mod 60
tMin = (tTime / 60)
tSec = (tTime mod 60)
if tSec < 10 then
tSec = "0" & tSec
end if
@@ -80,7 +80,7 @@ on setShipMember me
end

on getBoardSector me, tpoint
return(string(tpoint.getAt(1) / pSquareSize && tpoint.getAt(2) / pSquareSize))
return(string((tpoint.getAt(1) / pSquareSize) && (tpoint.getAt(2) / pSquareSize)))
end

on ShipPlace me, tPoint1, tPoint2
@@ -157,7 +157,7 @@ on update me
if the mouseDown then
tloc = point(pSpr.left - pGameBoardSpr.left, pSpr.top - pGameBoardSpr.top)
tTempLoc = me.getBoardSector(tloc)
tNewLoc = point(value(tTempLoc.getProp(#word, 1)) * pSquareSize, value(tTempLoc.getProp(#word, 2)) * pSquareSize)
tNewLoc = point((value(tTempLoc.getProp(#word, 1)) * pSquareSize), (value(tTempLoc.getProp(#word, 2)) * pSquareSize))
tloc = tNewLoc
tLoc2 = tNewLoc + point(pSpr.width, pSpr.height)
me.ShipPlace(tloc, tLoc2)
@@ -246,8 +246,8 @@ on processItemMessage me, tMsg
end if
i = 1
repeat while i <= s.length
ay = i - 1 / 13
ax = i - 1 mod 13
ay = (i - 1 / 13)
ax = (i - 1 mod 13)
if j <> value(pOpenGameProps.getAt(#myTurnNum)) + 1 then
if pOpenGameProps.getAt(#name) = "O" then
add(pOpenGameProps.getAt(#player1Data), [ax, ay, #miss])
@@ -133,7 +133,7 @@ on drawGameBoardTicTacToe me, tGameProps
repeat while i <= tGameProps.getAt(#gameboard).length
tC = tGameProps.getAt(#gameboard).getProp(#char, i)
if charToNum(tC) <> 32 then
me.drawTicTacToe(i mod tW - 1, i / tW, tC, tBuffer)
me.drawTicTacToe((i mod tW) - 1, (i / tW), tC, tBuffer)
end if
i = 1 + i
end repeat
@@ -147,7 +147,7 @@ on drawTicTacToe me, tX, tY, tC, tBuffer
end if
tSquareSize = 10
tMemImg = member(getmemnum("game_TicTacToe." & tC)).image
tdestrect = rect(tX * tSquareSize + 1, tY * tSquareSize + 1, tX + 1 * tSquareSize, tY + 1 * tSquareSize)
tdestrect = rect((tX * tSquareSize) + 1, (tY * tSquareSize) + 1, (tX + 1 * tSquareSize), (tY + 1 * tSquareSize))
tBuffer.copyPixels(tMemImg, tdestrect, tMemImg.rect, [#ink:36])
end

@@ -171,7 +171,7 @@ on selectedTypeTicTacToe me, tPlayerProps, tGameProps
end

on getTicTacToeSector me, tpoint
return([tpoint.getAt(1) / 10, tpoint.getAt(2) / 10])
return([(tpoint.getAt(1) / 10), (tpoint.getAt(2) / 10)])
end

on eventProcTicTacToe me, tEvent, tElemID, tParam
@@ -254,15 +254,15 @@ on drawChessPieces me, tX, tY, tC, tBuffer
tmember = member(getmemnum(tC))
tMemImg = tmember.image
tMemRect = tmember.rect
tcenter = rect(tX * tSize + tSize / 2, tY * tSize + tSize / 2, tX * tSize + tSize / 2, tY * tSize + tSize / 2)
tcenter = rect((tX * tSize) + (tSize / 2), (tY * tSize) + (tSize / 2), (tX * tSize) + (tSize / 2), (tY * tSize) + (tSize / 2))
tDstRect = tMemRect + tcenter
tDstRect = tDstRect - rect(tMemRect.width / 2, tMemRect.height / 2, tMemRect.width / 2, tMemRect.height / 2)
tDstRect = tDstRect - rect((tMemRect.width / 2), (tMemRect.height / 2), (tMemRect.width / 2), (tMemRect.height / 2))
tBuffer.copyPixels(tMemImg, tDstRect, tMemRect, [#ink:36])
end

on getChessSector me, tpoint
tSquareSize = 27
return(string(tpoint.getAt(1) / tSquareSize & tpoint.getAt(2) / tSquareSize))
return(string((tpoint.getAt(1) / tSquareSize) & (tpoint.getAt(2) / tSquareSize)))
end

on makeChessSectorEmpty me, tX, tY
@@ -275,7 +275,7 @@ on makeChessSectorEmpty me, tX, tY
return(0)
end if
tSquareSize = 27
tdestrect = rect(tX * tSquareSize, tY * tSquareSize, tX * tSquareSize + tSquareSize, tY * tSquareSize + tSquareSize)
tdestrect = rect((tX * tSquareSize), (tY * tSquareSize), (tX * tSquareSize) + tSquareSize, (tY * tSquareSize) + tSquareSize)
tElem.getProperty(#image).fill(tdestrect, rgb(255, 255, 255))
tElem.render()
end
@@ -408,15 +408,15 @@ on drawShip me, tX, tY, tmember, tImage
tSquareSize = 19
tMemberImg = tmember.image
tMemRect = tmember.rect
tcenter = rect(tX * tSquareSize + tSquareSize / 2, tY * tSquareSize + tSquareSize / 2, tX * tSquareSize + tSquareSize / 2, tY * tSquareSize + tSquareSize / 2)
tcenter = rect((tX * tSquareSize) + (tSquareSize / 2), (tY * tSquareSize) + (tSquareSize / 2), (tX * tSquareSize) + (tSquareSize / 2), (tY * tSquareSize) + (tSquareSize / 2))
tdestrect = tMemRect + tcenter
tdestrect = tdestrect - rect(tMemRect.width / 2, tMemRect.height / 2, tMemRect.width / 2, tMemRect.height / 2)
tdestrect = tdestrect - rect((tMemRect.width / 2), (tMemRect.height / 2), (tMemRect.width / 2), (tMemRect.height / 2))
tImage.copyPixels(tMemberImg, tdestrect, tMemRect, [#ink:36])
end

on getBattleShipSector me, tpoint
tSquareSize = 19
return(string(tpoint.getAt(1) / tSquareSize && tpoint.getAt(2) / tSquareSize))
return(string((tpoint.getAt(1) / tSquareSize) && (tpoint.getAt(2) / tSquareSize)))
end

on battleShipWaitOtherPlayer me
@@ -522,9 +522,9 @@ on updateBattleShipBoard me, tBoardData
ttype = tShoot.getAt(3)
tHitImage = member(getmemnum("game_bs_" & string(ttype))).image
if ttype = #miss then
tdestrect = rect(tX * tSquareSize, tY * tSquareSize, tX * tSquareSize + tHitImage.width - 1, tY * tSquareSize + tHitImage.height - 1)
tdestrect = rect((tX * tSquareSize), (tY * tSquareSize), (tX * tSquareSize) + tHitImage.width - 1, (tY * tSquareSize) + tHitImage.height - 1)
else
tdestrect = rect(tX * tSquareSize + 1, tY * tSquareSize + 1, tX * tSquareSize + tHitImage.width, tY * tSquareSize + tHitImage.height)
tdestrect = rect((tX * tSquareSize) + 1, (tY * tSquareSize) + 1, (tX * tSquareSize) + tHitImage.width, (tY * tSquareSize) + tHitImage.height)
end if
tBuffer.copyPixels(tHitImage, tdestrect, tHitImage.rect, [#ink:36])
end repeat
@@ -9,8 +9,8 @@ on getAngleFromComponents me, xComponent, yComponent
if yComponent = 0 then
yComponent = 1
end if
xComponent = xComponent * 256
temp = integer(xComponent) / integer(yComponent)
xComponent = (xComponent * 256)
temp = (integer(xComponent) / integer(yComponent))
if temp < 0 then
temp = -temp
end if
@@ -34,8 +34,8 @@ on getAngleFromComponents me, xComponent, yComponent
if xComponent = 0 then
xComponent = 1
end if
yComponent = yComponent * 256
temp = integer(yComponent) / integer(xComponent)
yComponent = (yComponent * 256)
temp = (integer(yComponent) / integer(xComponent))
if temp < 0 then
temp = -temp
end if
@@ -204,15 +204,15 @@ end

on update me
tTime = the milliSeconds
dT = tTime - m_iLastMS / 1000
dT = (tTime - m_iLastMS / 1000)
m_iLastMS = tTime
if not voidp(m_rCurrentTurn) then
if not m_rCurrentTurn.GetTested() then
me._MinigameTestChecksum(m_rCurrentTurn.GetCheckSum())
end if
m_syncLostTime = 0
if me._TurnBufferState() = #overfill then
m_iSpeedUp = m_ar_turnBuffer.count / 1.5
m_iSpeedUp = (m_ar_turnBuffer.count / 1.5)
if m_bDump then
put("MGEngine: speedup on")
end if
@@ -221,10 +221,10 @@ on update me
if m_rCurrentTurn = void() then
return(1)
end if
tSubturnSpacing = m_fTurnPulse / m_rCurrentTurn.GetNSubTurns()
m_iSubTurnSpacing = tSubturnSpacing * 1 / m_iSpeedUp
tSubturnSpacing = (m_fTurnPulse / m_rCurrentTurn.GetNSubTurns())
m_iSubTurnSpacing = (tSubturnSpacing * (1 / m_iSpeedUp))
tSubturnSpacing = m_iSubTurnSpacing
tSubturn = integer(floor(m_fTurnT / tSubturnSpacing)) + 1
tSubturn = integer(floor((m_fTurnT / tSubturnSpacing))) + 1
if tSubturn > m_rCurrentTurn.GetNSubTurns() then
tSubturn = m_rCurrentTurn.GetNSubTurns()
end if
@@ -284,7 +284,7 @@ on update me
end

on turnDone me
tPulse = m_fTurnPulse * 1 / m_iSpeedUp
tPulse = (m_fTurnPulse * (1 / m_iSpeedUp))
return(m_fTurnT >= tPulse or voidp(m_rCurrentTurn))
end

@@ -12,7 +12,7 @@ on ilk me
end

on length me
return(abs(x) + abs(y) + abs(z) / 3)
return((abs(x) + abs(y) + abs(z) / 3))
end

on add me, a_rVec
@@ -24,19 +24,19 @@ on substract me, a_rVec
end

on multiply me, a_rScalar
return(intvector(x * a_rScalar, y * a_rScalar, z * a_rScalar))
return(intvector((x * a_rScalar), (y * a_rScalar), (z * a_rScalar)))
end

on divide me, a_rScalar
return(intvector(x / a_rScalar, y / a_rScalar, z / a_rScalar))
return(intvector((x / a_rScalar), (y / a_rScalar), (z / a_rScalar)))
end

on dot me, a_rVec
return(x * a_rVec.x + y * a_rVec.y + z * a_rVec.z)
return((x * a_rVec.x) + (y * a_rVec.y) + (z * a_rVec.z))
end

on cross me, a_rVec
return(intvector(y * a_rVec.z - z * a_rVec.y, z * a_rVec.x - x * a_rVec.z, x * a_rVec.y - y * a_rVec.x))
return(intvector((y * a_rVec.z) - (z * a_rVec.y), (z * a_rVec.x) - (x * a_rVec.z), (x * a_rVec.y) - (y * a_rVec.x)))
end

on dump me
@@ -23,22 +23,22 @@ end

on getRandomNumber this, iteratedSeed, maxValue
if iteratedSeed < 0 then
return(abs(iteratedSeed) mod maxValue)
return((abs(iteratedSeed) mod maxValue))
else
return(iteratedSeed mod maxValue)
return((iteratedSeed mod maxValue))
end if
end

on BitLeft this, n, s
return(integer(n * power(2, s mod 32)))
return(integer((n * power(2, (s mod 32)))))
end

on BitRight this, n, s
s = s mod 32
s = (s mod 32)
if n > 0 then
return(bitOr(n / power(2, s), 0))
return(bitOr((n / power(2, s)), 0))
else
f = n / power(2, s)
f = (n / power(2, s))
i = integer(f)
if i > f then
return(i - 1)
@@ -49,23 +49,23 @@ on BitRight this, n, s
end

on BitRightZF this, n, s
s = s mod 32
s = (s mod 32)
if n < 0 then
if s = 0 then
return(float(the maxinteger) * 2 + 2 + n)
return((float(the maxinteger) * 2) + 2 + n)
else
return(bitOr(n + the maxinteger + 1 / power(2, s), power(2, 31 - s)))
return(bitOr((n + the maxinteger + 1 / power(2, s)), power(2, 31 - s)))
end if
else
return(bitOr(n / power(2, s), 0))
return(bitOr((n / power(2, s)), 0))
end if
end

on IntToBits this, a_iInput
tDigits = "01"
repeat while a_iInput > 0
tD = a_iInput mod 2
a_iInput = a_iInput / 2
tD = (a_iInput mod 2)
a_iInput = (a_iInput / 2)
tHexstr = tDigits.getProp(#char, tD + 1) & tHexstr
end repeat
repeat while 1
@@ -9,10 +9,10 @@ end

on ValidateDirValue this, a_iDirValue
if a_iDirValue > 359 then
return(a_iDirValue mod 360)
return((a_iDirValue mod 360))
else
if a_iDirValue < 0 then
return(360 + a_iDirValue mod 360)
return(360 + (a_iDirValue mod 360))
end if
end if
return(a_iDirValue)
@@ -97,7 +97,7 @@ on TestPointToCircleCollision me, tThisObject, tOtherObject
if distanceY < 0 then
distanceY = -distanceY
end if
if sqrt(distanceX * distanceX + distanceY * distanceY) < tOtherObject.getGameObjectProperty(#gameobject_collisionshape_radius) then
if sqrt((distanceX * distanceX) + (distanceY * distanceY)) < tOtherObject.getGameObjectProperty(#gameobject_collisionshape_radius) then
return(1)
else
return(0)
@@ -115,7 +115,7 @@ on TestCircleToCircleCollision me, tThisObject, tOtherObject, tDump
end if
collisionDistance = tOtherObject.getGameObjectProperty(#gameobject_collisionshape_radius) + tThisObject.getGameObjectProperty(#gameobject_collisionshape_radius)
if distanceY < collisionDistance and distanceX < collisionDistance then
if distanceX * distanceX + distanceY * distanceY < collisionDistance * collisionDistance then
if (distanceX * distanceX) + (distanceY * distanceY) < (collisionDistance * collisionDistance) then
return(1)
end if
end if
@@ -128,7 +128,7 @@ on testDistance me, i_pos1X, i_pos1Y, i_pos2X, i_pos2Y, i_distance
if distX > i_distance or distY > i_distance then
return(0)
else
if distX * distX + distY * distY < i_distance * i_distance then
if (distX * distX) + (distY * distY) < (i_distance * i_distance) then
return(1)
end if
end if
@@ -81,7 +81,7 @@ on addChecksum me
i = 1
repeat while i <= pGameObjectSyncValues.count
if ilk(pGameObjectSyncValues.getAt(i)) = #integer then
tCheckSum = tCheckSum + pGameObjectSyncValues.getAt(i) * tCounter
tCheckSum = tCheckSum + (pGameObjectSyncValues.getAt(i) * tCounter)
tCounter = tCounter + 1
end if
i = 1 + i
@@ -1,26 +1,26 @@
property pComponentToAngle, pVelocityTable

on direction360to8 me, tValue
return(me.validateDirection8Value(me.validateDirection360Value(tValue - 22) / 45 + 1))
return(me.validateDirection8Value((me.validateDirection360Value(tValue - 22) / 45) + 1))
end

on validateDirection360Value me, tValue
if tValue > 359 then
tValue = tValue mod 360
tValue = (tValue mod 360)
else
if tValue < 0 then
tValue = 360 + tValue mod 360
tValue = 360 + (tValue mod 360)
end if
end if
return(integer(tValue))
end

on validateDirection8Value me, tValue
if tValue > 7 then
tValue = tValue mod 8
tValue = (tValue mod 8)
else
if tValue < 0 then
tValue = 8 + tValue mod 8 mod 8
tValue = (8 + (tValue mod 8) mod 8)
end if
end if
return(integer(tValue))
@@ -6,7 +6,7 @@ on define me, tX, tY, tZ, tTileWidth, tAccuracyFactor
z = tZ
pTileWidth = tTileWidth
pAccuracyFactor = tAccuracyFactor
pTileFactor = pTileWidth * pAccuracyFactor
pTileFactor = (pTileWidth * pAccuracyFactor)
return(1)
end

@@ -29,25 +29,25 @@ on getLocation me
end

on setTileLoc me, tX, tY, tZ
x = tX * pTileFactor
y = tY * pTileFactor
z = tZ * pTileFactor
x = (tX * pTileFactor)
y = (tY * pTileFactor)
z = (tZ * pTileFactor)
end

on getTileLoc me
return([#x:x + pTileFactor / 2 / pTileFactor, #y:y + pTileFactor / 2 / pTileFactor])
return([#x:(x + (pTileFactor / 2) / pTileFactor), #y:(y + (pTileFactor / 2) / pTileFactor)])
end

on getTileX me
return(x + pTileFactor / 2 / pTileFactor)
return((x + (pTileFactor / 2) / pTileFactor))
end

on getTileY me
return(y + pTileFactor / 2 / pTileFactor)
return((y + (pTileFactor / 2) / pTileFactor))
end

on getTileZ me
return(z + pTileFactor / 2 / pTileFactor)
return((z + (pTileFactor / 2) / pTileFactor))
end

on dump me
@@ -14,50 +14,50 @@ on fast_sqrt me, x
if x >= 16777216 then
if x >= 268435456 then
if x >= 1073741824 then
return(table.getAt(x / 16777216 + 1) * 256)
return((table.getAt((x / 16777216) + 1) * 256))
else
return(table.getAt(x / 4194304 + 1) * 128)
return((table.getAt((x / 4194304) + 1) * 128))
end if
else
if x >= 67108864 then
return(table.getAt(x / 1048576 + 1) * 64)
return((table.getAt((x / 1048576) + 1) * 64))
else
return(table.getAt(x / 262144 + 1) * 32)
return((table.getAt((x / 262144) + 1) * 32))
end if
end if
else
if x >= 1048576 then
if x >= 4194304 then
return(table.getAt(x / 65536 + 1) * 16)
return((table.getAt((x / 65536) + 1) * 16))
else
return(table.getAt(x / 16384 + 1) * 8)
return((table.getAt((x / 16384) + 1) * 8))
end if
else
if x >= 262144 then
return(table.getAt(x / 4096 + 1) * 4)
return((table.getAt((x / 4096) + 1) * 4))
else
return(table.getAt(x / 1024 + 1) * 2)
return((table.getAt((x / 1024) + 1) * 2))
end if
end if
end if
else
if x >= 256 then
if x >= 4096 then
if x >= 16384 then
return(table.getAt(x / 256 + 1))
return(table.getAt((x / 256) + 1))
else
return(table.getAt(x / 64 + 1) / 2)
return((table.getAt((x / 64) + 1) / 2))
end if
else
if x >= 1024 then
return(table.getAt(x / 16 + 1) / 4)
return((table.getAt((x / 16) + 1) / 4))
else
return(table.getAt(x / 4 + 1) / 8)
return((table.getAt((x / 4) + 1) / 8))
end if
end if
else
if x >= 0 then
return(table.getAt(x + 1) / 16)
return((table.getAt(x + 1) / 16))
end if
end if
end if
@@ -211,7 +211,7 @@ on handle_msgstruct_objects me, tdata
tObj.setAt(#y, integer(tLine.getProp(#word, 4)))
tObj.setAt(#h, integer(tLine.getProp(#word, 5)))
if tLine.count(#word) = 6 then
tdir = integer(tLine.getProp(#word, 6)) mod 8
tdir = (integer(tLine.getProp(#word, 6)) mod 8)
tObj.setAt(#direction, [tdir, tdir, tdir])
tObj.setAt(#dimensions, 0)
else
@@ -38,8 +38,8 @@ on storeHeightmap me, tdata
pTileGrid.getAt(tLocY).setAt(tLocX, tTile)
tTileLocX = tLocX - 1
tTileLocY = tLocY - 1
tCenterLocX = tTileLocX * pTileWidth * pAccuracyFactor
tCenterLocY = tTileLocY * pTileWidth * pAccuracyFactor
tCenterLocX = (tTileLocX * (pTileWidth * pAccuracyFactor))
tCenterLocY = (tTileLocY * (pTileWidth * pAccuracyFactor))
tTile.define(tTileLocX, tTileLocY, tCenterLocX, tCenterLocY, tdata.getPropRef(#line, tLocY).getProp(#char, tLocX))
tLocX = 1 + tLocX
end repeat
@@ -169,32 +169,32 @@ on clearObjectFromTileSpace me, tObjectID
end

on gettileatworldcoordinate me, tLocX, tLocY
tMultiplier = pTileWidth * pAccuracyFactor
if tLocX < -tMultiplier / 2 or tLocY < -tMultiplier / 2 then
tMultiplier = (pTileWidth * pAccuracyFactor)
if tLocX < -(tMultiplier / 2) or tLocY < -(tMultiplier / 2) then
return(0)
end if
return(me.getTile(tLocX + tMultiplier / 2 / tMultiplier, tLocY + tMultiplier / 2 / tMultiplier))
return(me.getTile((tLocX + (tMultiplier / 2) / tMultiplier), (tLocY + (tMultiplier / 2) / tMultiplier)))
end

on convertTileToWorldCoordinate me, tLocX, tLocY, tlocz
tMultiplier = pTileWidth * pAccuracyFactor
return([#x:tLocX * tMultiplier, #y:tLocY * tMultiplier, #h:tlocz * tMultiplier])
tMultiplier = (pTileWidth * pAccuracyFactor)
return([#x:(tLocX * tMultiplier), #y:(tLocY * tMultiplier), #h:(tlocz * tMultiplier)])
end

on convertworldtotilecoordinate me, tLocX, tLocY, tlocz
tMultiplier = pTileWidth * pAccuracyFactor
return([#x:tLocX + tMultiplier / 2 / tMultiplier, #y:tLocY + tMultiplier / 2 / tMultiplier])
return([#x:tLocX * tMultiplier, #y:tLocY * tMultiplier, #h:tlocz * tMultiplier])
tMultiplier = (pTileWidth * pAccuracyFactor)
return([#x:(tLocX + (tMultiplier / 2) / tMultiplier), #y:(tLocY + (tMultiplier / 2) / tMultiplier)])
return([#x:(tLocX * tMultiplier), #y:(tLocY * tMultiplier), #h:(tlocz * tMultiplier)])
end

on convertWorldToScreenCoordinate me, tX, tY, tZ
if pRoomGeometry = 0 then
return(0)
end if
tMultiplier = float(pTileWidth * pAccuracyFactor)
tX = 0.5 + tX / tMultiplier
tY = -0.5 + tY / tMultiplier
tZ = tZ / tMultiplier
tMultiplier = float((pTileWidth * pAccuracyFactor))
tX = 0.5 + (tX / tMultiplier)
tY = -0.5 + (tY / tMultiplier)
tZ = (tZ / tMultiplier)
tloc = pRoomGeometry.getScreenCoordinate(tX, tY, tZ)
return(tloc)
end
@@ -40,28 +40,28 @@ on update me, tForcedUpdate
if me.pAnimating and me.checkPartNotCarrying() then
tMemString = me.animate()
if me.pDirection = 0 then
pYFix = pYFix + pXFix / 2
pXFix = pXFix / 2
pYFix = pYFix + (pXFix / 2)
pXFix = (pXFix / 2)
else
if me.pDirection = 1 then
pYFix = pYFix + pXFix
pXFix = 0
else
if me.pDirection = 2 then
pYFix = pYFix - pXFix / 2
pXFix = pXFix / 2
pYFix = pYFix - (pXFix / 2)
pXFix = (pXFix / 2)
else
if me.pDirection = 4 then
pYFix = pYFix + pXFix / 2
pXFix = -pXFix / 2
pYFix = pYFix + (pXFix / 2)
pXFix = (-pXFix / 2)
else
if me.pDirection = 5 then
pYFix = pYFix - pXFix
pXFix = 0
else
if me.pDirection = 6 then
pYFix = pYFix - pXFix / 2
pXFix = -pXFix / 2
pYFix = pYFix - (pXFix / 2)
pXFix = (-pXFix / 2)
else
if me.pDirection = 7 then
pXFix = -pXFix
@@ -77,8 +77,8 @@ on update me, tForcedUpdate
else
tSizeMultiplier = 1
end if
pXFix = pXFix * tSizeMultiplier
pYFix = pYFix * tSizeMultiplier
pXFix = (pXFix * tSizeMultiplier)
pYFix = (pYFix * tSizeMultiplier)
else
if me.pDirection <> "bd" then
if me.pDirection <> "lg" then
@@ -102,7 +102,7 @@ on update me, tForcedUpdate
tAnimCntr = me.pAnimCounter
else
if tAction = "wav" then
tAnimCntr = me.pAnimCounter mod 2
tAnimCntr = (me.pAnimCounter mod 2)
else
if ["crr", "drk", "ohd"].getPos(tAction) <> 0 then
if pDirection >= 4 then
@@ -129,7 +129,7 @@ on update me, tForcedUpdate
tAnimCntr = me.pAnimCounter
else
if tAction = "wav" then
tAnimCntr = me.pAnimCounter mod 2
tAnimCntr = (me.pAnimCounter mod 2)
tPart = "l" & pPart.getProp(#char, 2)
tdir = pDirection
else
@@ -150,16 +150,16 @@ on update me, tForcedUpdate
else
tAction = "spk"
end if
tAnimCntr = me.pAnimCounter mod 2
tAnimCntr = (me.pAnimCounter mod 2)
end if
else
if me.pDirection = "ey" then
if me.pTalking and pAction <> "lay" and me.pAnimCounter mod 2 = 0 then
if me.pTalking and pAction <> "lay" and (me.pAnimCounter mod 2) = 0 then
pYFix = -1
end if
else
if me.pDirection = "hr" then
if me.pTalking and me.pAnimCounter mod 2 = 0 then
if me.pTalking and (me.pAnimCounter mod 2) = 0 then
if pAction <> "lay" then
tAction = "spk"
end if
@@ -374,7 +374,7 @@ on getLocation me
end if
tmember = member(getmemnum(pMemString))
tImgRect = tmember.rect
tCntrPoint = point(tImgRect.width / 2, tImgRect.height / 2)
tCntrPoint = point((tImgRect.width / 2), (tImgRect.height / 2))
tRegPoint = tmember.regPoint
return(-tRegPoint + tCntrPoint)
end
@@ -6,7 +6,7 @@ on construct me
pFrameAmount = 2
pCurrentPhase = 1
pCurrentFrame = random(pFrameAmount)
pTimePerPhase = pTotalAnimTime / pPhaseAmount
pTimePerPhase = (pTotalAnimTime / pPhaseAmount)
pMemberPrefix = "effect_cloud_"
pSpriteData = []
pRunAnimation = 0
@@ -32,7 +32,7 @@ on defineWithSprite me, tsprite, tSize
end if
tWidth = tsprite.width
tHeight = tsprite.height
tloc = point(tsprite.locH + tWidth / 2, tsprite.locV - tHeight / 2)
tloc = point(tsprite.locH + (tWidth / 2), tsprite.locV - (tHeight / 2))
tlocz = tsprite.locZ
tRect = tsprite.rect
pHostSpriteData.setAt(#sprite, tsprite)
@@ -58,21 +58,21 @@ on define me, tloc, tlocz, tSize
end if
pScreenStartLoc = tloc
tSpriteCount = 3
tAngleSectorSize = 2 * pi() / tSpriteCount
tAngleSectorSize = ((2 * pi()) / tSpriteCount)
tMaxItemTravelDist = 25
tLocZVariance = 200
if tSize = #small then
tMaxItemTravelDist = tMaxItemTravelDist / 2
tMaxItemTravelDist = (tMaxItemTravelDist / 2)
pMemberPrefix = pMemberPrefix & "small_"
end if
i = 1
repeat while i <= tSpriteCount
tsprite = sprite(reserveSprite(me.getID()))
tDirAngle = i - 1 * tAngleSectorSize + random(tAngleSectorSize)
tMaxTravelX = cos(tDirAngle) * tMaxItemTravelDist
tMaxTravelY = sin(tDirAngle) * tMaxItemTravelDist
tPixelsPerMillisecX = float(tMaxTravelX) / pTotalAnimTime
tPixelsPerMillisecY = float(tMaxTravelY) / pTotalAnimTime
tDirAngle = (i - 1 * tAngleSectorSize) + random(tAngleSectorSize)
tMaxTravelX = (cos(tDirAngle) * tMaxItemTravelDist)
tMaxTravelY = (sin(tDirAngle) * tMaxItemTravelDist)
tPixelsPerMillisecX = (float(tMaxTravelX) / pTotalAnimTime)
tPixelsPerMillisecY = (float(tMaxTravelY) / pTotalAnimTime)
tsprite.flipH = random(1)
tsprite.flipV = random(1)
tdata = [:]
@@ -81,7 +81,7 @@ on define me, tloc, tlocz, tSize
tdata.setAt(#sprite, tsprite)
pSpriteData.add(tdata)
tsprite.member = member(getmemnum(pMemberPrefix & pCurrentPhase & "_" & pCurrentFrame))
tsprite.locZ = tlocz + random(tLocZVariance) - tLocZVariance / 2
tsprite.locZ = tlocz + random(tLocZVariance) - (tLocZVariance / 2)
tsprite.ink = 8
i = 1 + i
end repeat
@@ -101,7 +101,7 @@ on update me
return(0)
end if
tUpdatePhase = 0
tCurrentPhase = integer(tMoveTime / pTimePerPhase) + 1
tCurrentPhase = integer((tMoveTime / pTimePerPhase)) + 1
if tCurrentPhase <> pCurrentPhase then
tUpdatePhase = 1
pCurrentPhase = tCurrentPhase
@@ -114,21 +114,21 @@ on update me
tSpriteData.getAt(#sprite).flipH = random(1)
tSpriteData.getAt(#sprite).flipV = random(1)
tSpriteData.getAt(#sprite).member = member(getmemnum(pMemberPrefix & pCurrentPhase & "_" & tNewFrame))
tSpriteData.setAt(#IncrementX, tSpriteData.getAt(#IncrementX) * 1.05)
tSpriteData.setAt(#IncrementY, tSpriteData.getAt(#IncrementY) * 1.05)
tSpriteData.setAt(#IncrementX, (tSpriteData.getAt(#IncrementX) * 1.05))
tSpriteData.setAt(#IncrementY, (tSpriteData.getAt(#IncrementY) * 1.05))
end if
tLocX = integer(tMoveTime * tSpriteData.getAt(#IncrementX) + pScreenStartLoc.locH)
tLocY = integer(tMoveTime * tSpriteData.getAt(#IncrementY) + pScreenStartLoc.locV)
tLocX = integer((tMoveTime * tSpriteData.getAt(#IncrementX)) + pScreenStartLoc.locH)
tLocY = integer((tMoveTime * tSpriteData.getAt(#IncrementY)) + pScreenStartLoc.locV)
tSpriteData.getAt(#sprite).loc = point(tLocX, tLocY)
end repeat
if tMoveTime > 3 / 4 * pTotalAnimTime and pHostSpriteData.getAt(#sprite) <> void() then
if tMoveTime > ((3 / 4) * pTotalAnimTime) and pHostSpriteData.getAt(#sprite) <> void() then
pHostSpriteData.getAt(#sprite).color = pHostSpriteData.getAt(#previousfcolor)
pHostSpriteData.getAt(#sprite).ink = pHostSpriteData.getAt(#previousink)
else
if tMoveTime > 2 / 4 * pTotalAnimTime and pHostSpriteData.getAt(#sprite) <> void() then
if tMoveTime > ((2 / 4) * pTotalAnimTime) and pHostSpriteData.getAt(#sprite) <> void() then
pHostSpriteData.getAt(#sprite).color = color(#rgb, 50, 50, 50)
else
if tMoveTime > 1 / 4 * pTotalAnimTime and pHostSpriteData.getAt(#sprite) <> void() then
if tMoveTime > ((1 / 4) * pTotalAnimTime) and pHostSpriteData.getAt(#sprite) <> void() then
pHostSpriteData.getAt(#sprite).color = color(#rgb, 150, 150, 150)
else
pHostSpriteData.getAt(#sprite).color = color(#rgb, 255, 255, 255)
@@ -127,7 +127,7 @@ on changeFigureAndData me, tdata
if ilk(tNewModelItem) = #propList then
tmodel = tNewModelItem.getAt("model")
tColor = tNewModelItem.getAt("color")
if tColor.red + tColor.green + tColor.blue > 238 * 3 then
if tColor.red + tColor.green + tColor.blue > (238 * 3) then
tColor = rgb("EEEEEE")
end if
tPart.changePartData(tmodel, tColor)
@@ -295,7 +295,7 @@ on getScrLocation me
end

on getTileCenter me
return(point(pScreenLoc.getAt(1) + pXFactor / 2, pScreenLoc.getAt(2)))
return(point(pScreenLoc.getAt(1) + (pXFactor / 2), pScreenLoc.getAt(2)))
end

on getPartLocation me, tPart
@@ -306,7 +306,7 @@ on getPartLocation me, tPart
if pMainAction <> "lay" then
tloc = pSprite.loc + tPartLoc
else
tloc = point(pSprite.getProp(#rect, 1) + pSprite.width / 2, pSprite.getProp(#rect, 2) + pSprite.height / 2)
tloc = point(pSprite.getProp(#rect, 1) + (pSprite.width / 2), pSprite.getProp(#rect, 2) + (pSprite.height / 2))
end if
return(tloc)
end
@@ -506,7 +506,7 @@ on draw me, tRGB
end

on prepare me
pAnimCounter = pAnimCounter + 1 mod 4
pAnimCounter = (pAnimCounter + 1 mod 4)
if pEyesClosed and not pSleeping then
me.openEyes()
else
@@ -523,11 +523,11 @@ on prepare me
pChanges = 1
end if
if pMoving then
tFactor = float(the milliSeconds - pMoveStart) / pMoveTime
tFactor = (float(the milliSeconds - pMoveStart) / pMoveTime)
if tFactor > 1 then
tFactor = 1
end if
pScreenLoc = pDestLScreen - pStartLScreen * tFactor + pStartLScreen
pScreenLoc = (pDestLScreen - pStartLScreen * tFactor) + pStartLScreen
pChanges = 1
end if
if pWaving and pMainAction <> "lay" then
@@ -596,7 +596,7 @@ on render me
end if
end if
if pCorrectLocZ then
tOffZ = pLocH + pRestingHeight * 1000 + 2
tOffZ = (pLocH + pRestingHeight * 1000) + 2
else
tOffZ = 2
end if
@@ -651,7 +651,7 @@ on setPartLists me, tmodels
else
tColor = tmodels.getAt(tPartSymbol).getAt("color")
end if
if tColor.red + tColor.green + tColor.blue > 238 * 3 then
if tColor.red + tColor.green + tColor.blue > (238 * 3) then
tColor = rgb("EEEEEE")
end if
tPartObj.define(tPartSymbol, tmodels.getAt(tPartSymbol).getAt("model"), tColor, pDirection, tAction, me)
@@ -175,7 +175,7 @@ on setPartLists me, tmodels
else
tColor = tmodels.getAt(tPartSymbol).getAt("color")
end if
if tColor.red + tColor.green + tColor.blue > 238 * 3 then
if tColor.red + tColor.green + tColor.blue > (238 * 3) then
tColor = rgb("EEEEEE")
end if
tPartObj.define(tPartSymbol, tmodels.getAt(tPartSymbol).getAt("model"), tColor, me.pDirection, tAction, me)
@@ -267,7 +267,7 @@ on prepare me
if me.pMoving then
call(#defineActMultiple, me.pPartList, "wlk", ["bd", "lh", "rh"])
end if
me.pAnimCounter = me.pAnimCounter + 1 mod 4
me.pAnimCounter = (me.pAnimCounter + 1 mod 4)
end if
if me.pEyesClosed and not me.pSleeping then
me.openEyes()
@@ -297,11 +297,11 @@ on prepare me
end if
end if
if me.pMoving then
tFactor = float(the milliSeconds - me.pMoveStart) / me.pMoveTime * 1
tFactor = (float(the milliSeconds - me.pMoveStart) / (me.pMoveTime * 1))
if tFactor > 1 then
tFactor = 1
end if
me.pScreenLoc = me.pDestLScreen - me.pStartLScreen * 1 * tFactor + me.pStartLScreen
me.pScreenLoc = ((me.pDestLScreen - me.pStartLScreen * 1) * tFactor) + me.pStartLScreen
me.pChanges = 1
end if
if me.pWaving then