# engine lookup table tempSnds = [["05e073v0", "05e079v0", "05e074v0", "05e075v0", "05e076v0", "05e077v0", "05e078v0"], ["05e067v0", "05e073v0", "05e068v0", "05e069v0", "05e070v0", "05e071v0", "05e072v0"], ["05e025v0", "05e031v0", "05e026v0", "05e027v0", "05e028v0", "05e029v0", "05e030v0"], ["05e004v0", "05e010v0", "05e005v0", "05e006v0", "05e007v0", "05e008v0", "05e009v0"], ["05e011v0", "05e017v0", "05e012v0", "05e013v0", "05e014v0", "05e015v0", "05e016v0"], ["05e053v0", "05e059v0", "05e054v0", "05e055v0", "05e056v0", "05e057v0", "05e058v0"], ["05e018v0", "05e024v0", "05e019v0", "05e020v0", "05e021v0", "05e022v0", "05e023v0"], ["05e060v0", "05e066v0", "05e061v0", "05e062v0", "05e063v0", "05e064v0", "05e065v0"], ["05e032v0", "05e038v0", "05e033v0", "05e034v0", "05e035v0", "05e036v0", "05e037v0"]] on beginSprite(me) medalList = ["00n004v0", "00n005v0", "00n006v0", "00n007v0", "00n010v0", "00n009v0"] soundList = ["05d008v0", "05d009v0", "05d007v0", "", "05d006v0", "05d010v0"] counter = 0 exit end on kickPartSound(me,theSP,theid,what) if getPart(gMulleGlobals.parts, theid).partProperties = 0 then idToCheck = getAt(getMorphList(getPart(gMulleGlobals.parts, theid)), 1) else idToCheck = theid end if Weight = getProperty(getPart(gMulleGlobals.parts, idToCheck), #Weight) if what = #InternalGround then -- UNK_64 0 if ERROR = 1 then play(gSound, "00e001v0", #OPEFFECT) else -- UNK_64 0 if ERROR <> 2 then -- UNK_64 0 if ERROR = 3 then play(gSound, "00e002v0", #OPEFFECT) else -- UNK_64 0 if ERROR <> 4 then -- UNK_64 0 if ERROR = 5 then play(gSound, "00e003v0", #OPEFFECT) end if -- UNK_65 1 if what = #ExternalGround then -- UNK_64 0 if ERROR = 1 then play(gSound, "00e004v0", #OPEFFECT) else -- UNK_64 0 if ERROR <> 2 then -- UNK_64 0 if ERROR = 3 then play(gSound, "00e005v0", #OPEFFECT) else -- UNK_64 0 if ERROR <> 4 then -- UNK_64 0 if ERROR = 5 then play(gSound, "00e006v0", #OPEFFECT) end if -- UNK_65 1 if what = #car then -- UNK_64 0 if ERROR = 1 then play(gSound, "03e003v0", #OPEFFECT) else -- UNK_64 0 if ERROR <> 2 then -- UNK_64 0 if ERROR = 3 then play(gSound, "03e003v1", #OPEFFECT) else -- UNK_64 0 if ERROR <> 4 then -- UNK_64 0 if ERROR = 5 then play(gSound, "03e003v2", #OPEFFECT) end if -- UNK_65 1 exit end if end if end if end if end if end if end if end if end if end if end if end if end if end if end if end carProperties = [#Weight:0, #break:0, #Durability:0, #Grip:0, #Steering:0, #acceleration:0, #speed:0, #Strength:0, #FuelConsumption:0, #FuelVolume:0, #ElectricConsumption:0, #ElectricVolume:0, #Comfort:0, #FunnyFactor:0, #Horn:0, #ExhaustPipe:0, #Lamps:0, #LoadCapacity:0, #EngineType:0, #HornType:0, #Pedals:0] on init(me) testing = 0 if objectp(gMulleGlobals.world) then objId = getEnteredObject(gMulleGlobals.world) else objId = 0 end if if objId then tempObj = new(script("Object")) fromList(tempObj, objId) medalId = getAt(getSetWhenDone(tempObj, #medals), 1) cacheProp = getAt(getSetWhenDone(tempObj, #Cache), 1) MissionId = getAt(getSetWhenDone(tempObj, #missions), 1) tempObj = 0 else testing = 1 medalId = 4 cacheProp = #Exhibition MissionId = 2 end if setCacheProp(gMulleGlobals.user.car, cacheProp) addCompletedMission(gMulleGlobals.user, MissionId) funny = getProperty(gMulleGlobals.user.car, #FunnyFactor) if funny < 2 then rating = 1 else if funny < 3 then rating = 2 else if funny < 5 then rating = 3 else if funny < 7 then rating = 4 else rating = 5 end if end if end if end if if funny > 8 and not getMedal(gMulleGlobals.user.car, medalId) then medal = 1 addMedal(gMulleGlobals.user.car, medalId) else medal = 0 end if if testing then rating = 1 medal = 1 end if exit end on new(me) nrOfPiles = 6 maxParts = [#Pile1:50, #Pile2:50, #Pile3:50, #Pile4:50, #Pile5:50, #Pile6:50, #shopFloor:15, #yard:20] rects = [#Pile1:[rect(193, 260, 637, 400), rect(291, 193, 637, 263), rect(361, 153, 636, 194)], #Pile2:[rect(210, 252, 654, 380), rect(256, 174, 651, 262), rect(365, 120, 667, 188)], #Pile3:[rect(150, 281, 639, 380), rect(127, 162, 643, 291), rect(183, 100, 639, 164)], #Pile4:[rect(0, 324, 425, 404), rect(3, 174, 425, 325), rect(3, 90, 425, 182)], #Pile5:[rect(6, 268, 450, 412), rect(5, 180, 411, 275), rect(0, 100, 303, 189)], #Pile6:[rect(0, 275, 400, 390), rect(1, 201, 368, 283), rect(4, 135, 270, 203)], #shopFloor:[rect(20, 400, 600, 460)], #yard:[rect(290, 400, 580, 445)], #PileDoors:[rect(8, 106, 56, 323), rect(44, 84, 115, 224), rect(111, 41, 151, 103), rect(463, 47, 503, 107), rect(512, 69, 592, 208), rect(572, 94, 637, 312)]] shopFloorRect = rect(10, 400, 600, 460) yardRect = rect(290, 400, 580, 445) figgeBeenHere = 0 return(me) exit end // PART on new(me) partId = 0 MorphsTo = [] junkView = "" UseView = "" UseView2 = "" description = "" offset = point(0, 0) partProperties = [] requiredPoints = "" coveredPoints = [] newPoints = [] morphList = [] master = 0 return(me) exit end // CAR on new(me) parts = [] enterParts = [] name = "" medals = [] carSnapOffsets = [] carProperties = [#Weight:0, #break:0, #Durability:0, #Grip:0, #Steering:0, #acceleration:0, #speed:0, #Strength:0, #FuelConsumption:0, #FuelVolume:0, #ElectricConsumption:0, #ElectricVolume:0, #Comfort:0, #FunnyFactor:0, #Horn:0, #ExhaustPipe:0, #Lamps:0, #LoadCapacity:0, #EngineType:0, #HornType:0, #Pedals:0] cacheList = [] carSnapPoints = [] chassisSPOffset = 7 driverLayer = 18 newCarName = member("00t002v0").text return(me) exit end // DRAW CAR driverLayer = 18 on getRequiredPoints(me) return(requiredPoints) exit end on getCoveredPoints(me) return(coveredPoints) exit end on getNewPoints(me) return(newPoints) exit end on drawCar(me,theStartSP,theOffset,theParts,thePercentage) chassisSP = gMulleGlobals.user.car.chassisSPOffset if voidp(theStartSP) then theStartSP = me.spriteNum end if if useChassisLoc then offsetH = sprite(theStartSP + chassisSP).locH offsetV = sprite(theStartSP + chassisSP).locV theOffset = point(offsetH, offsetV) end if if voidp(theOffset) then theOffset = point(offsetH, offsetV) end if if voidp(theParts) then tempCar = gMulleGlobals.user.car parts = getParts(tempCar) else tempCar = new(script("Car")) objectList = [#parts:theParts, #medals:[], #name:"", #cacheList:[]] fromList(tempCar, objectList) parts = theParts end if mulleLayer = gMulleGlobals.user.car.driverLayer x = 1 repeat while x <= count(parts) partToMount = getPart(gMulleGlobals.parts, getAt(parts, x)) tempSnaps = getRequiredPoints(partToMount) if listp(tempSnaps) then firstSnapPoint = getAt(tempSnaps, 1) useLayers = getSnapInfo(tempCar, firstSnapPoint, #layers) snapOffset = duplicate(getSnapInfo(tempCar, firstSnapPoint, #offset)) else useLayers = [chassisSP] snapOffset = point(0, 0) end if tempSP = getAt(useLayers, 1) if tempSP > mulleLayer - 1 then tempSP = tempSP + 2 end if setSpriteThings(me, theStartSP + tempSP, partToMount, theOffset, snapOffset, thePercentage, 1) if count(useLayers) = 2 then tempSP = getAt(useLayers, 2) if tempSP > -1 then if tempSP > mulleLayer - 1 then tempSP = tempSP + 2 end if setSpriteThings(me, theStartSP + getAt(useLayers, 2), partToMount, theOffset, snapOffset, thePercentage, 2) end if end if x = 1 + x end repeat if the movieName.char[1..2] = "03" then freeOrBindParts(gDir.partsCommon) end if exit end on addPart(me,newPartId) add(parts, newPartId) part = getPart(gMulleGlobals.parts, newPartId) if not objectp(part) then stop() end if coversPoints = getCoveredPoints(part) if listp(coversPoints) then -- UNK_64 0 -- UNK_64 0 -- UNK_64 2 repeat while ERROR <= ERROR -- UNK_64 2 -- UNK_64 1 index = getAt() deleteOne(carSnapPoints, index) end repeat -- UNK_65 3 end if newPoints = getNewPoints(part) if listp(newPoints) then -- UNK_64 0 -- UNK_64 0 -- UNK_64 2 repeat while ERROR <= ERROR -- UNK_64 2 -- UNK_64 1 index = getAt() tempSnap = getAt(index, 1) add(carSnapPoints, tempSnap) tempLayers = getAt(index, 2) tempOffset = getAt(index, 3) addProp(carSnapOffsets, tempSnap, [tempLayers, tempOffset]) end repeat -- UNK_65 3 end if exit end on getSnapInfo(me,snapPoint,what) if what = #layers then return(getAt(getaProp(carSnapOffsets, snapPoint), 1)) else if what = #offset then return(getAt(getaProp(carSnapOffsets, snapPoint), 2)) end if end if return(getaProp(carSnapOffsets, snapPoint)) exit end // part falling on exitFrame(me) if isFalling then if sprite(SP).locV = floorLocV then Hmax = getAt(getAt(getaProp(gMulleGlobals.junkPileHandlers.rects, #shopFloor), 1), 3) if sprite(SP).locH > Hmax then sprite(SP).locH = Hmax end if velV = 0 isFalling = 0 if gDir.partsCommon.playedDescription = 0 then kickPartSound(gMulleGlobals.SharedSound, SP, partId, #InternalGround) end if setJunkPartProp(gMulleGlobals.user, #shopFloor, partId, point(getAt(sprite(SP).undefined, 1), floorLocV)) else if velV < 60 then velV = velV + 8 end if if velV + sprite(SP).locV < floorLocV then sprite(SP).locV = velV + sprite(SP).locV else sprite(SP).locV = floorLocV end if end if end if exit end // garage // stage on new(me) put("A new ancestor") ancestor = new(script("GeneralAncestor"), me) spriteList = [#CarStart:10, #drag:100, #JunkStart:46, #DoorStart:3, #garage:4, #DoorToYard:5, #fDialog:114, #cheatStart:102, #fButton:101, #Mulle:6, #Buffa:7, #Figge:8, #TeleSmall:2, #TeleBig:109, #Mikro:13, #HighLight:9, #FiggeInterup:120] carCopy = gMulleGlobals.user.car sprite(getProp(spriteList, #fDialog)).undefined = point(320, 240) sprite(getProp(spriteList, #HighLight)).undefined = point(320, 240) the mouseUpScript = "virtualMouseUp" the mouseDownScript = "virtualMouseDown" the keyDownScript = "systemkeys" mouseOverCar = [] mouseOverMulle = [] EnterShopEvent = 0 mouseButtonActive = 1 StopSpeak = 0 mouseButtonActive = 1 return(me) exit end // mulle on beginSprite(me) type = #Mulle mode = #wait currentAnimChart = #Verkstad currentTalk = #Silence startSounds = ["03d027v0", "03d060v0", "03d062v0"] okSounds = ["03d034v0", "03d035v0", "03d036v0", "03d061v0"] greatSounds = ["03d037v0", "03d038v0"] currentSound = "start" randomSounds = startSounds tempList = sprite(me.spriteNum).undefined -- UNK_64 0 -- UNK_64 0 -- UNK_64 2 repeat while ERROR <= ERROR -- UNK_64 2 -- UNK_64 1 index = getAt() if index.type = #SpriteAnim then animObject = index end if end repeat -- UNK_65 3 activeClick = 1 aboutToOpen = 0 makeHimLeave = 0 FrozenAction = "" exit end on MakeMulleSpeak(me,theAction,extraInfo) currentTalk = theAction if the frame = 1 then FrozenAction = theAction addLoopObject(gDir, me) else if finished(gSound, currentSound) then playAnimSound(animObject, "") if theAction = #noWheels then theSnd = "03d011v0" else if theAction = #noSeat then theSnd = "03d039v0" else if theAction = #yourTurn then theSnd = "03d028v0" else if theAction = #fullPile then theSnd = "03d033v0" else if theAction = #greetFigge then makeHimLeave = 1 theSnd = "03d045v0" else if theAction = #noPoints then -- UNK_64 0 if ERROR = 1 then theSnd = "03d040v0" else -- UNK_64 0 if ERROR = 2 then theSnd = "03d041v0" else -- UNK_64 0 if ERROR = 3 then theSnd = "03d042v0" end if end if end if -- UNK_65 1 else if theAction = #InspireYou then -- UNK_64 0 if ERROR = 1 then theSnd = "03d052v0" else -- UNK_64 0 if ERROR = 2 then theSnd = "03d053v0" else -- UNK_64 0 if ERROR = 3 then theSnd = "03d054v0" else -- UNK_64 0 if ERROR = 4 then theSnd = "03d055v0" else -- UNK_64 0 if ERROR = 5 then theSnd = "03d056v0" end if end if end if end if end if -- UNK_65 1 else if theAction = #Describe then theSnd = extraInfo else if theAction = #afterTrash0 then theSnd = "03d031v0" else if theAction = #AfterTrash1 then theSnd = "03d030v0" else if theAction = #AfterTrash2 then theSnd = "03d029v0" else if theAction = #AfterTrash3 then theSnd = "03d028v0" end if end if end if end if end if end if end if end if end if end if end if end if if mode = #wait or mode = #Talk then makeAnimSpeech(animObject, theSnd) if theAction = #noPoints then tempMode = #Talk currentAnimChart = #TalkToMe sendSprite(the currentSpriteNum, #setAnimChart, "TalkToMe") else if theAction = #greetFigge then tempMode = #Talk else if random(2) = 1 then tempMode = #Talk else tempMode = #Talk currentAnimChart = #TalkToMe sendSprite(the currentSpriteNum, #setAnimChart, "TalkToMe") end if end if end if mode = tempMode sendSprite(me.spriteNum, #setAnimAction, mode) currentSound = 0 else if mode <> #LookUnderCar then deleteLoopObject(gDir, me) updateLoopObjects(gDir) currentSound = play(gSound, theSnd, #EFFECT) addLoopObject(gDir, me) end if end if end if end if exit end on checkEquipment(me,Specific) if Specific <> #none then if Specific = #wheels then if areTheseFree(gDir.carCopy, [#a1]) = 1 or areTheseFree(gDir.carCopy, [#a13]) = 1 then return(1) else return(0) end if else if Specific = #Seat then if getaProp(gDir.carCopy.carProperties, #Comfort) = 0 then return(1) else return(0) end if end if end if else updateProperties(gMulleGlobals.user.car) leadSounds = [] if count(gDir.carCopy.parts) >= 12 then randomSounds = greatSounds else if count(gDir.carCopy.parts) >= 8 then randomSounds = okSounds else randomSounds = startSounds end if end if if areTheseFree(gDir.carCopy, [#a1]) = 0 and areTheseFree(gDir.carCopy, [#a13]) = 0 then add(leadSounds, "03d005v0") add(leadSounds, "03d006v0") add(leadSounds, "03d007v0") else if areTheseFree(gDir.carCopy, [#a1]) = 1 or areTheseFree(gDir.carCopy, [#a13]) = 1 then add(leadSounds, "03d011v0") add(leadSounds, "03d012v0") end if end if if getaProp(gDir.carCopy.carProperties, #break) = 0 then add(leadSounds, "03d018v0") end if if getaProp(gDir.carCopy.carProperties, #FuelConsumption) = 0 then add(leadSounds, "03d013v0") end if if getaProp(gDir.carCopy.carProperties, #ElectricVolume) = 0 then add(leadSounds, "03d014v0") end if if getaProp(gDir.carCopy.carProperties, #FuelVolume) = 0 then add(leadSounds, "03d015v0") end if if getaProp(gDir.carCopy.carProperties, #acceleration) = 0 then add(leadSounds, "03d016v0") end if if getaProp(gDir.carCopy.carProperties, #Steering) = 0 then add(leadSounds, "03d017v0") end if if getaProp(gDir.carCopy.carProperties, #Horn) = 0 then add(leadSounds, "03d019v0") end if if getaProp(gDir.carCopy.carProperties, #ExhaustPipe) = 0 then add(leadSounds, "03d020v0") end if if getaProp(gDir.carCopy.carProperties, #Lamps) = 0 then add(leadSounds, "03d021v0") end if end if exit end // world on fillErUp(me) updateProperties(gMulleGlobals.user.car) quickCarProps = duplicate(gDir.carCopy.carProperties) convertCarProps(me) tempExtra = getCacheProp(gMulleGlobals.user.car, #ExtraTank) if tempExtra = #NoProp then tempExtra = 0 end if sendSprite(getProp(gDir.spriteList, #Petrol), #fillErUp, tempExtra) tempExtra = tempExtra + 100 tempGas = tempExtra * getaProp(quickCarProps, #FuelVolume) / 100 if gotElectricEngine then tempElec = getaProp(quickCarProps, #ElectricVolume) else tempElec = 0 end if fuel = [tempGas, tempElec] exit end