home *** CD-ROM | disk | FTP | other *** search
- property CHECK_BOX_SPRS, CHECK_BOX_NAMES, CHECK_BOX_GRAPHICS, CHECK_BOX_TEXTS, GRAPHICS_ANIMS, TEXT_ANIMS, HILITES, SHARED_SPRS, FRAME_ONLY_SPRS, MASTER_CHECK, CHECK_BOX_NUMS, GRAPHIC_NUMS, TEXT_NUMS
- global gDONT_ANIMATE
-
- on birth me, checkBoxSprs, checkBoxNames, graphicCastNames, textCastNames, graphicAnims, txtAnims, sharedSprs, frameOnlySprs, masterCheck, checkBoxNums, graphicNums, textNums
- set CHECK_BOX_SPRS to checkBoxSprs
- set CHECK_BOX_NAMES to checkBoxNames
- set CHECK_BOX_GRAPHICS to graphicCastNames
- set CHECK_BOX_TEXTS to textCastNames
- set HILITES to []
- repeat with i = 1 to count(checkBoxNames)
- add(HILITES, 0)
- end repeat
- set GRAPHICS_ANIMS to graphicAnims
- set TEXT_ANIMS to txtAnims
- set SHARED_SPRS to sharedSprs
- set FRAME_ONLY_SPRS to frameOnlySprs
- set MASTER_CHECK to masterCheck
- set CHECK_BOX_NUMS to checkBoxNums
- set GRAPHIC_NUMS to graphicNums
- set TEXT_NUMS to textNums
- return me
- end
-
- on checkState me
- set hiliteList to [:]
- repeat with i = 1 to count(CHECK_BOX_SPRS)
- set cNum to the castNum of sprite getAt(CHECK_BOX_SPRS, i)
- addProp(hiliteList, the name of cast cNum, the hilite of cast cNum)
- end repeat
- repeat with i = 1 to count(hiliteList)
- set propName to getPropAt(hiliteList, i)
- set btnPos to getPos(CHECK_BOX_NAMES, propName)
- if getaProp(hiliteList, propName) = 1 then
- if getAt(HILITES, i) = 0 then
- set textAnim to getAt(TEXT_ANIMS, btnPos)
- if textAnim <> [] then
- doAnim(me, textAnim, btnPos, CHECK_BOX_TEXTS, TEXT_NUMS)
- end if
- set graphicsAnim to getAt(GRAPHICS_ANIMS, btnPos)
- if graphicsAnim <> [] then
- doAnim(me, graphicsAnim, btnPos, CHECK_BOX_GRAPHICS, GRAPHIC_NUMS)
- end if
- end if
- next repeat
- end if
- if getAt(HILITES, i) = 1 then
- set textAnim to getAt(TEXT_ANIMS, btnPos)
- if textAnim <> [] then
- set spr to getAt(textAnim, 1)
- if canTurnOffSpr(me, i) then
- puppetSprite(spr, 0)
- updateStage()
- end if
- end if
- set graphicsAnim to getAt(GRAPHICS_ANIMS, btnPos)
- if graphicsAnim <> [] then
- set spr to getAt(graphicsAnim, 1)
- if canTurnOffSpr(me, i) then
- puppetSprite(spr, 0)
- updateStage()
- end if
- end if
- end if
- end repeat
- repeat with i = 1 to count(hiliteList)
- setAt(HILITES, i, getAt(hiliteList, i))
- end repeat
- checkDeadRadio(me)
- end
-
- on checkDeadRadio me
- repeat with i = 1 to count(SHARED_SPRS)
- set nxtLst to getAt(SHARED_SPRS, i)
- set allOff to 0
- repeat with j = getAt(nxtLst, 1) to getLast(nxtLst)
- set allOff to allOff + getAt(HILITES, j)
- end repeat
- if allOff = 0 then
- repeat with j = getAt(nxtLst, 1) to getLast(nxtLst)
- set anim to getAt(GRAPHICS_ANIMS, j)
- if anim <> [] then
- set spr to getAt(anim, 1)
- puppetSprite(spr, 0)
- updateStage()
- end if
- set anim to getAt(TEXT_ANIMS, j)
- if anim <> [] then
- set spr to getAt(anim, 1)
- puppetSprite(spr, 0)
- updateStage()
- end if
- end repeat
- end if
- end repeat
- end
-
- on canTurnOffSpr me, hiliteIndex
- repeat with i = 1 to count(SHARED_SPRS)
- set nxtLst to getAt(SHARED_SPRS, i)
- if getOne(nxtLst, hiliteIndex) <> 0 then
- return 0
- end if
- end repeat
- return 1
- end
-
- on doAnim me, theAnim, btnPos, castList, castNums
- set spr to getAt(theAnim, 1)
- puppetSprite(spr, 1)
- set cstName to getAt(castList, btnPos)
- set the castNum of sprite spr to getAt(castNums, btnPos)
- set endLoc to getAt(theAnim, 3)
- set doesAnim to getAt(theAnim, 4)
- if gDONT_ANIMATE = 1 then
- if getAt(theAnim, 6) = 1 then
- set the castNum of sprite spr to the number of cast getAt(theAnim, 7)
- end if
- set the loc of sprite spr to endLoc
- updateStage()
- else
- set startLoc to getAt(theAnim, 2)
- set the loc of sprite spr to startLoc
- updateStage()
- if doesAnim = 1 then
- set increment to getAt(getAt(theAnim, 5), 1)
- if getAt(theAnim, 6) = 1 then
- set switchMember to getAt(theAnim, 7)
- set cond to getAt(theAnim, 8)
- end if
- moveSpr(spr, startLoc, endLoc, increment, getAt(theAnim, 6), switchMember, cond)
- else
- if doesAnim = 2 then
- alert("unimplimented.")
- else
- set the loc of sprite spr to endLoc
- updateStage()
- end if
- end if
- end if
- end
-
- on moveSpr spr, startLoc, endLoc, increment, switchWhileMoving, switchMember, cond
- if switchWhileMoving = 1 then
- set c1 to getAt(cond, 1)
- set c2 to getAt(cond, 2)
- end if
- if getAt(startLoc, 2) > getAt(endLoc, 2) then
- set v to getAt(startLoc, 2)
- repeat while 1 = 1
- set v to v - increment
- if v < getAt(endLoc, 2) then
- exit repeat
- end if
- if switchWhileMoving = 1 then
- if value(c1 && string(spr) && c2) = 1 then
- set the castNum of sprite spr to the number of cast switchMember
- updateStage()
- end if
- end if
- set the locV of sprite spr to v
- updateStage()
- end repeat
- set the loc of sprite spr to endLoc
- updateStage()
- else
- if getAt(startLoc, 2) < getAt(endLoc, 2) then
- set v to getAt(startLoc, 2)
- repeat while 1 = 1
- set v to v + increment
- if v > getAt(endLoc, 2) then
- exit repeat
- end if
- if switchWhileMoving = 1 then
- if value(c1 && string(spr) && c2) = 1 then
- set the castNum of sprite spr to the number of cast switchMember
- updateStage()
- end if
- end if
- set the locV of sprite spr to v
- updateStage()
- end repeat
- set the loc of sprite spr to endLoc
- updateStage()
- else
- set h to getAt(startLoc, 1)
- set switchcondition to c1 && string(spr) && c2
- repeat while 1 = 1
- set h to h + increment
- if h > getAt(endLoc, 1) then
- exit repeat
- end if
- if switchWhileMoving = 1 then
- if value(switchcondition) = 1 then
- set the castNum of sprite spr to switchMember
- updateStage()
- end if
- end if
- set the locH of sprite spr to h
- updateStage()
- end repeat
- set the loc of sprite spr to endLoc
- updateStage()
- end if
- end if
- end
-
- on killFrameOnlySprs me
- repeat with i = 1 to count(FRAME_ONLY_SPRS)
- puppetSprite(getAt(FRAME_ONLY_SPRS, i), 0)
- end repeat
- updateStage()
- end
-