home *** CD-ROM | disk | FTP | other *** search
- property pPositionX, pPositionY, pDestPositionX, pDestPositionY, pDestDistance, pDistance, pSpeed, pBType, pChannel, pState, pAngle, pStupidIncrement, pTheStupidKid
- global gPlayer1, gPlayer2, gPlayer3, gEnemy1, gEnemy2, gEnemy3, gTotalScore, gTotalHealth
-
- on new me, posX, posY, aDistance, speed, bType, channel, theStupidKid, destPositionX, destPositionY
- pPositionX = posX
- pPositionY = posY
- pDestDistance = aDistance
- pTheStupidKid = theStupidKid
- if bType = 1 then
- pSpeed = 10
- else
- pSpeed = 5
- end if
- pBType = bType
- pChannel = channel
- if voidp(destPositionX) then
- pDestPositionX = mouseH()
- else
- pDestPositionX = destPositionX
- end if
- if voidp(destPositionY) then
- pDestPositionY = mouseV()
- else
- pDestPositionY = destPositionY
- end if
- pState = 1
- pDistance = 0
- pStupidIncrement = 0
- pAngle = comeGetSome(pPositionX, pPositionY, pDestPositionX, pDestPositionY)
- sprite(channel).puppet = 1
- sprite(channel).member = "snowBall1"
- sprite(channel).ink = 36
- sprite(channel).loc = point(pPositionX, pPositionY)
- return me
- end
-
- on getAngle me
- return pAngle
- end
-
- on updateBomb me
- case pState of
- 1:
- moveBomb()
- 2:
- fadeBomb()
- 3:
- end case
- end
-
- on getChannel me
- return pChannel
- end
-
- on moveBomb me
- if ((sprite(pChannel).width < 13) or (pBType = 1)) and (pDistance > 10) then
- fBool = 0
- if sprite(pChannel).intersects(7) then
- sprite(pChannel + 30).puppet = 0
- pState = 2
- sprite(pChannel).member = "snowBall2"
- else
- if sprite(pChannel).intersects(8) then
- sprite(pChannel + 30).puppet = 0
- pState = 2
- sprite(pChannel).member = "snowBall2"
- end if
- end if
- if sprite(pChannel).intersects(50) and not (pTheStupidKid = 50) then
- puppetSound(3, "hit by snowball")
- if not (gPlayer1.pState = 3) then
- fBool = 1
- end if
- sprite(pChannel + 30).puppet = 0
- pState = 2
- sprite(pChannel).member = "snowBall2"
- gPlayer1.setHealth(gPlayer1.getHealth() - 10)
- end if
- if sprite(pChannel).intersects(51) and not (pTheStupidKid = 51) then
- puppetSound(3, "hit by snowball")
- if not (gPlayer2.pState = 3) then
- fBool = 1
- end if
- sprite(pChannel + 30).puppet = 0
- pState = 2
- sprite(pChannel).member = "snowBall2"
- gPlayer2.setHealth(gPlayer2.getHealth() - 10)
- end if
- if sprite(pChannel).intersects(52) and not (pTheStupidKid = 52) then
- puppetSound(3, "hit by snowball")
- if not (gPlayer3.pState = 3) then
- fBool = 1
- end if
- sprite(pChannel + 30).puppet = 0
- pState = 2
- sprite(pChannel).member = "snowBall2"
- gPlayer3.setHealth(gPlayer3.getHealth() - 10)
- end if
- if sprite(pChannel).intersects(54) and not ((pTheStupidKid = 54) or (pTheStupidKid = 55) or (pTheStupidKid = 56)) then
- puppetSound(3, "hit by snowball")
- if not (gEnemy1.pState = 3) then
- fBool = 1
- end if
- gTotalScore = gTotalScore + 10
- sprite(pChannel + 30).puppet = 0
- pState = 2
- sprite(pChannel).member = "snowBall2"
- gEnemy1.setHealth(gEnemy1.getHealth() - 10)
- end if
- if sprite(pChannel).intersects(55) and not ((pTheStupidKid = 54) or (pTheStupidKid = 55) or (pTheStupidKid = 56)) then
- puppetSound(3, "hit by snowball")
- gTotalScore = gTotalScore + 10
- if not (gEnemy2.pState = 3) then
- fBool = 1
- end if
- sprite(pChannel + 30).puppet = 0
- pState = 2
- sprite(pChannel).member = "snowBall2"
- gEnemy2.setHealth(gEnemy2.getHealth() - 10)
- end if
- if sprite(pChannel).intersects(56) and not ((pTheStupidKid = 54) or (pTheStupidKid = 55) or (pTheStupidKid = 56)) then
- puppetSound(3, "hit by snowball")
- gTotalScore = gTotalScore + 10
- if not (gEnemy3.pState = 3) then
- fBool = 1
- end if
- sprite(pChannel + 30).puppet = 0
- pState = 2
- sprite(pChannel).member = "snowBall2"
- gEnemy3.setHealth(gEnemy3.getHealth() - 10)
- end if
- if fBool = 1 then
- gTotalHealth = gPlayer1.pHealth + gPlayer2.pHealth + gPlayer3.pHealth
- member("HealthDisplay").text = string(gTotalHealth)
- member("ScoreDisplay").text = string(gTotalScore)
- end if
- else
- if sprite(pChannel).intersects(14) then
- sprite(pChannel + 30).puppet = 0
- pState = 2
- sprite(pChannel).member = "snowBall2"
- end if
- end if
- pPositionX = pPositionX - (float(sin(pAngle * 3.14000000000000012 / 180)) * pSpeed)
- pPositionY = pPositionY - (float(cos(pAngle * 3.14000000000000012 / 180)) * pSpeed)
- sprite(pChannel).loc = point(pPositionX, pPositionY)
- sprite(pChannel + 30).loc = sprite(pChannel).loc + 1
- pDistance = pDistance + pSpeed
- if pDistance > pDestDistance then
- pState = 2
- sprite(pChannel + 30).puppet = 0
- sprite(pChannel).member = "snowBall2"
- end if
- if pBType = 2 then
- if pDistance > (pDestDistance / 2) then
- pStupidIncrement = pStupidIncrement - 1
- sprite(pChannel).width = 12 + pStupidIncrement
- sprite(pChannel).height = 12 + pStupidIncrement
- else
- pStupidIncrement = pStupidIncrement + 1
- sprite(pChannel).width = 12 + pStupidIncrement
- sprite(pChannel).height = 12 + pStupidIncrement
- end if
- end if
- end
-
- on fadeBomb me
- sprite(pChannel).blend = sprite(pChannel).blend - 5
- if sprite(pChannel).blend < 6 then
- sprite(pChannel).blend = 6
- pState = 3
- sprite(pChannel).puppet = 0
- end if
- end
-
- on comeGetSome x1, y1, x2, y2
- loc1 = [x1, y1]
- loc2 = [x2, y2]
- deltaX = loc2[1] - loc1[1]
- deltaY = -1 * (loc2[2] - loc1[2])
- if deltaY = 0 then
- if deltaX > 0 then
- return 0
- end if
- if deltaX < 0 then
- return 180
- end if
- end if
- if deltaX = 0 then
- deltaX = 0.01
- end if
- theAngle = atan(float(deltaY) / float(deltaX))
- theAngle = theAngle * 180 / PI
- if (deltaX < 0) and (deltaY > 0) then
- theAngle = 180 + theAngle
- else
- if (deltaX < 0) and (deltaY < 0) then
- theAngle = 180 + theAngle
- else
- if (deltaX > 0) and (deltaY < 0) then
- theAngle = 360 + theAngle
- end if
- end if
- end if
- theAngle = theAngle - 90
- if theAngle < 0 then
- theAngle = 360 + theAngle
- end if
- return theAngle
- end
-