Path: blob/master/Sonic 2/Scripts/CNZ/SlotMachine.txt
1479 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: Slot Machine Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.value0 : object.timer12private alias object.value1 : object.spinSpeedL13private alias object.value2 : object.spinSpeedM14private alias object.value3 : object.spinSpeedR15private alias object.value4 : object.prizeTablePosL16private alias object.value5 : object.prizeTablePosM17private alias object.value6 : object.prizeTablePosR18private alias object.value7 : object.targetSpinSpeedL19private alias object.value8 : object.targetSpinSpeedM20private alias object.value9 : object.targetSpinSpeedR21private alias object.value10 : object.activeSlot22private alias object.value11 : object.slotSpinTimer23private alias object.value12 : object.rewardRingCount2425// States26private alias 0 : SLOTMACHINE_IDLE27private alias 1 : SLOTMACHINE_READY28private alias 2 : SLOTMACHINE_HOLD29private alias 3 : SLOTMACHINE_UNUSED30private alias 4 : SLOTMACHINE_REWARD31private alias 5 : SLOTMACHINE_WAIT3233// Active Slots34private alias 0 : SLOTMACHINE_SLOT_L35private alias 1 : SLOTMACHINE_SLOT_M36private alias 2 : SLOTMACHINE_SLOT_R3738// Slot Spin Timer Aliases39private alias 0 : SLOTMACHINE_SLOTTIMER_SPIN // Spinning, attempting to stop40private alias 3 : SLOTMACHINE_SLOTTIMER_SLOW // Stopping in progress, Bounce it back for a few frames41private alias 6 : SLOTMACHINE_SLOTTIMER_STOP // Stop Slot Movement all together42private alias 7 : SLOTMACHINE_SLOTTIMER_CALC // Calculating Rewards (Only happens on slot R)4344// SlotDisplay FrameIDs45private alias 0 : SLOTPRIZE_SONIC46private alias 1 : SLOTPRIZE_TAILS47private alias 2 : SLOTPRIZE_RING48private alias 3 : SLOTPRIZE_BAR49private alias 4 : SLOTPRIZE_JACKPOT50private alias 5 : SLOTPRIZE_EGGMAN51private alias 6 : SLOTPRIZE_KNUX // Only Sonic OR Knux can appear at any one time52private alias 7 : SLOTPRIZE_SUPER // (Unused)5354// SlotPrize Aliases55private alias object.value0 : slotPrize.originPos.x56private alias object.value1 : slotPrize.originPos.y57private alias object.value2 : slotPrize.timer5859// SlotPrize States60private alias 0 : SLOTPRIZE_WINNER61private alias 1 : SLOTPRIZE_LOSER6263// Player Aliases64private alias object.state : player.state65private alias object.xpos : player.xpos66private alias object.ypos : player.ypos67private alias object.xvel : player.xvel68private alias object.yvel : player.yvel69private alias object.speed : player.speed70private alias object.gravity : player.gravity71private alias object.animationSpeed : player.animationSpeed72private alias object.animation : player.animation73private alias object.value16 : player.isSidekick74private alias object.value17 : debugMode.currentSelection7576// Global Variable ID Aliases77private alias 22 : GLOBAL_PLAYERSCORE7879// Achievement Aliases80private alias 4 : ACHIEVEMENT_HITITBIG818283// ========================84// Function Declarations85// ========================8687reserve function SlotMachine_PlayRingSfx88reserve function SlotMachine_DebugDraw89reserve function SlotMachine_DebugSpawn909192// ========================93// Static Values94// ========================9596public value SlotMachine_slotPrizeL = 097public value SlotMachine_slotPrizeM = 098public value SlotMachine_slotPrizeR = 099private value SlotMachine_startDebugID = 0100101102// ========================103// Tables104// ========================105106public table SlotMachine_prizeLTable1073 // SLOTPRIZE_BAR1085 // SLOTPRIZE_EGGMAN1092 // SLOTPRIZE_RING1101 // SLOTPRIZE_TAILS1110 // SLOTPRIZE_SONIC1124 // SLOTPRIZE_JACKPOT1131 // SLOTPRIZE_TAILS1142 // SLOTPRIZE_RING115end table116117public table SlotMachine_prizeMTable1183 // SLOTPRIZE_BAR1195 // SLOTPRIZE_EGGMAN1202 // SLOTPRIZE_RING1211 // SLOTPRIZE_TAILS1220 // SLOTPRIZE_SONIC1234 // SLOTPRIZE_JACKPOT1245 // SLOTPRIZE_EGGMAN1250 // SLOTPRIZE_SONIC126end table127128public table SlotMachine_prizeRTable1293 // SLOTPRIZE_BAR1305 // SLOTPRIZE_EGGMAN1312 // SLOTPRIZE_RING1321 // SLOTPRIZE_TAILS1330 // SLOTPRIZE_SONIC1344 // SLOTPRIZE_JACKPOT1351 // SLOTPRIZE_TAILS1362 // SLOTPRIZE_RING137end table138139public table SlotMachine_slotRewardTable14030 // SLOTPRIZE_SONIC14125 // SLOTPRIZE_TAILS14210 // SLOTPRIZE_RING14320 // SLOTPRIZE_BAR144150 // SLOTPRIZE_JACKPOT145-1 // SLOTPRIZE_EGGMAN146end table147148// (note for the above table - Knuckles is Sonic, and Amy is ring)149150private table SlotMachine_randomizeTable1518, 0, 0, 0, 18, 4, 4, 4, 18, 3, 3, 3, 36, 2, 2, 215230, 5, 5, 5, 30, 1, 1, 1, 0xFF, 15, 15, 15153end table154155156// ========================157// Function Definitions158// ========================159160private function SlotMachine_PlayRingSfx161if ringPan == 0162PlaySfx(SfxName[Ring L], false)163SetSfxAttributes(SfxName[Ring L], -1, -100)164ringPan = 1165else166PlaySfx(SfxName[Ring R], false)167SetSfxAttributes(SfxName[Ring R], -1, 100)168ringPan = 0169end if170end function171172173private function SlotMachine_DebugDraw174DrawSprite(0)175end function176177178private function SlotMachine_DebugSpawn179temp0 = debugMode[0].currentSelection180temp0 -= SlotMachine_startDebugID181CreateTempObject(TypeName[Slot Machine], temp0, object.xpos, object.ypos)182object[tempObjectPos].drawOrder = 5183end function184185186// ========================187// Events188// ========================189190event ObjectUpdate191switch object.state192case SLOTMACHINE_IDLE193object.frame = 0194break195196case SLOTMACHINE_READY197object.frame = object.animationTimer198object.frame >>= 1199object.animationTimer++200object.animationTimer &= 3201202temp0 = object.timer203temp0 &= 0xF204if temp0 == 0xF205CreateTempObject(TypeName[Object Score], 0, object.xpos, object.ypos)206object[tempObjectPos].drawOrder = 4207PlaySfx(SfxName[Slot Machine], false)208foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)209if player[currentPlayer].state == Player_State_Static210BoxCollisionTest(C_TOUCH, object.entityPos, -24, -20, 24, 20, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)211if checkResult == true212// global variable "array" (yes, this is actually how its done)213arrayPos0 = GLOBAL_PLAYERSCORE214#platform: USE_DECOMP215arrayPos0 = VarName[player.score]216#endplatform217if player[currentPlayer].isSidekick == false218arrayPos0 += currentPlayer219end if220global[arrayPos0] += 100221end if222end if223next224end if225226object.timer++227if object.timer == 128228object.timer = 0229object.state = SLOTMACHINE_WAIT230object.priority = PRIORITY_BOUNDS231foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)232if player[currentPlayer].state == Player_State_Static233BoxCollisionTest(C_TOUCH, object.entityPos, -24, -20, 24, 20, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)234if checkResult == true235#platform: USE_STANDALONE236player[currentPlayer].state = Player_State_Air237#endplatform238#platform: USE_ORIGINS239player[currentPlayer].state = Player_State_Air_NoDropDash240#endplatform241player[currentPlayer].gravity = GRAVITY_AIR242end if243end if244next245end if246break247248case SLOTMACHINE_HOLD249object.frame = object.animationTimer250object.frame >>= 1251object.animationTimer++252object.animationTimer &= 3253254temp0 = oscillation255temp0 &= 0xF256if temp0 == 0xF257PlaySfx(SfxName[Slot Machine], false)258end if259260temp0 &= 7261if temp0 == 0262if object.spinSpeedL < object.targetSpinSpeedL263object.spinSpeedL++264end if265266if object.spinSpeedM < object.targetSpinSpeedM267object.spinSpeedM++268end if269270if object.spinSpeedR < object.targetSpinSpeedR271object.spinSpeedR++272end if273end if274275SlotMachine_slotPrizeL += object.spinSpeedL276SlotMachine_slotPrizeL &= 0xFF277SlotMachine_slotPrizeM += object.spinSpeedM278SlotMachine_slotPrizeM &= 0xFF279SlotMachine_slotPrizeR += object.spinSpeedR280SlotMachine_slotPrizeR &= 0xFF281282if object.timer != 0283object.timer--284else285if object.slotSpinTimer != 0286object.slotSpinTimer++287end if288289switch object.activeSlot290case SLOTMACHINE_SLOT_L291switch object.slotSpinTimer292case SLOTMACHINE_SLOTTIMER_SPIN293temp0 = SlotMachine_slotPrizeL294temp0 >>= 5295if temp0 == object.prizeTablePosL296temp0 = SlotMachine_slotPrizeL297temp0 &= 0x1F298if temp0 < object.spinSpeedL299object.spinSpeedL = 2300object.targetSpinSpeedL = 2301PlaySfx(SfxName[Catch], false)302object.slotSpinTimer++303end if304end if305break306307case SLOTMACHINE_SLOTTIMER_SLOW308object.spinSpeedL = -2309object.targetSpinSpeedL = -2310break311312case SLOTMACHINE_SLOTTIMER_STOP313object.spinSpeedL = 0314object.targetSpinSpeedL = 0315object.slotSpinTimer = 0316object.activeSlot++317break318end switch319break320321case SLOTMACHINE_SLOT_M322switch object.slotSpinTimer323case SLOTMACHINE_SLOTTIMER_SPIN324GetBit(temp0, SlotMachine_slotPrizeL, 4)325if temp0 == true326SlotMachine_slotPrizeL += 0x20327SlotMachine_slotPrizeL &= 0xFF328end if329SlotMachine_slotPrizeL &= 0xE0330331temp0 = SlotMachine_slotPrizeM332temp0 >>= 5333if temp0 == object.prizeTablePosM334temp0 = SlotMachine_slotPrizeM335temp0 &= 0x1F336if temp0 < object.spinSpeedM337object.spinSpeedM = 2338object.targetSpinSpeedM = 2339PlaySfx(SfxName[Catch], false)340object.slotSpinTimer++341end if342end if343break344345case SLOTMACHINE_SLOTTIMER_SLOW346object.spinSpeedM = -2347object.targetSpinSpeedM = -2348break349350case SLOTMACHINE_SLOTTIMER_STOP351object.spinSpeedM = 0352object.targetSpinSpeedM = 0353object.slotSpinTimer = 0354object.activeSlot++355break356end switch357break358359case SLOTMACHINE_SLOT_R360switch object.slotSpinTimer361case SLOTMACHINE_SLOTTIMER_SPIN362GetBit(temp0, SlotMachine_slotPrizeM, 4)363if temp0 == true364SlotMachine_slotPrizeM += 0x20365SlotMachine_slotPrizeM &= 0xFF366end if367SlotMachine_slotPrizeM &= 0xE0368369temp0 = SlotMachine_slotPrizeR370temp0 >>= 5371if temp0 == object.prizeTablePosR372temp0 = SlotMachine_slotPrizeR373temp0 &= 0x1F374if temp0 < object.spinSpeedR375object.spinSpeedR = 2376object.targetSpinSpeedR = 2377PlaySfx(SfxName[Catch], false)378object.slotSpinTimer++379end if380end if381break382383case SLOTMACHINE_SLOTTIMER_SLOW384object.spinSpeedR = -2385object.targetSpinSpeedR = -2386break387388case SLOTMACHINE_SLOTTIMER_STOP389object.spinSpeedR = 0390object.targetSpinSpeedR = 0391break392393case SLOTMACHINE_SLOTTIMER_CALC394GetBit(temp0, SlotMachine_slotPrizeR, 4)395if temp0 == true396SlotMachine_slotPrizeR += 0x20397SlotMachine_slotPrizeR &= 0xFF398end if399SlotMachine_slotPrizeR &= 0xE0400401// All Slots Stopped, its prize time!402object.slotSpinTimer = 0403object.activeSlot = SLOTMACHINE_SLOT_L404object.state = SLOTMACHINE_REWARD405406GetTableValue(temp1, object.prizeTablePosL, SlotMachine_prizeLTable) // temp1 == prizeL407GetTableValue(temp2, object.prizeTablePosM, SlotMachine_prizeMTable) // temp2 == prizeM408GetTableValue(temp3, object.prizeTablePosR, SlotMachine_prizeRTable) // temp3 == prizeR409410// 3 Jackpots, You've hit it big!411#platform: USE_STANDALONE412if stage.debugMode == false413if temp1 == temp2414if temp2 == temp3415if temp1 == SLOTPRIZE_JACKPOT416// Grant the "Hit it Big" Achievement417CallNativeFunction2(SetAchievement, ACHIEVEMENT_HITITBIG, 100)418end if419end if420end if421end if422#endplatform423#platform: USE_ORIGINS424// origins removed the debug mode check LOL425if temp1 == temp2426if temp2 == temp3427if temp1 == SLOTPRIZE_JACKPOT428CallNativeFunction4(NotifyCallback, NOTIFY_STATS_PARAM_1, 1, 0, 0)429end if430end if431end if432#endplatform433434object.rewardRingCount = 0435if temp1 == temp2 // PrizeL == PrizeM436if temp2 == temp3 // PrizeM == PrizeR437GetTableValue(object.rewardRingCount, temp1, SlotMachine_slotRewardTable)438else439if temp1 == SLOTPRIZE_JACKPOT // PrizeM != PrizeR && PrizeL == Jackpot440GetTableValue(object.rewardRingCount, temp3, SlotMachine_slotRewardTable)441object.rewardRingCount <<= 2442else443if temp3 == SLOTPRIZE_JACKPOT // PrizeM != PrizeR && PrizeR == Jackpot444GetTableValue(object.rewardRingCount, temp1, SlotMachine_slotRewardTable)445object.rewardRingCount <<= 1446end if447end if448end if449else450if temp1 == temp3 // PrizeL == PrizeR451if temp1 == SLOTPRIZE_JACKPOT // PrizeL == PrizeR && PrizeL != PrizeM && PrizeL == Jackpot452GetTableValue(object.rewardRingCount, temp2, SlotMachine_slotRewardTable)453object.rewardRingCount <<= 2454else455if temp2 == SLOTPRIZE_JACKPOT // PrizeL == PrizeR && PrizeL != PrizeM && PrizeR == Jackpot456GetTableValue(object.rewardRingCount, temp1, SlotMachine_slotRewardTable)457object.rewardRingCount <<= 1458end if459end if460else461if temp2 == temp3 // PrizeM == PrizeR462if temp2 == SLOTPRIZE_JACKPOT // PrizeM == PrizeR && PrizeL != PrizeM && PrizeL != PrizeR && PrizeM == Jackpot463GetTableValue(object.rewardRingCount, temp1, SlotMachine_slotRewardTable)464object.rewardRingCount <<= 2465else466if temp1 == SLOTPRIZE_JACKPOT // PrizeM == PrizeR && PrizeL != PrizeM && PrizeL != PrizeR && PrizeL == Jackpot467GetTableValue(object.rewardRingCount, temp2, SlotMachine_slotRewardTable)468object.rewardRingCount <<= 1469end if470end if471end if472end if473end if474475// if no jackpot at all, but we have a BAR...476if object.rewardRingCount == 0477if temp1 == SLOTPRIZE_BAR478object.rewardRingCount += 2479end if480481if temp2 == SLOTPRIZE_BAR482object.rewardRingCount += 2483end if484485if temp3 == SLOTPRIZE_BAR486object.rewardRingCount += 2487end if488end if489490// Eggman...491if object.rewardRingCount < 0492object.rewardRingCount = -100493end if494495496// No Rings...?497if object.rewardRingCount == 0498object.timer = 1499else500if object.rewardRingCount > 0 // Winner!!!501object.timer = 26502else // Loser...503object.timer = 30504end if505end if506break507end switch508break509end switch510end if511break512513case SLOTMACHINE_REWARD514object.frame = object.animationTimer515object.frame >>= 1516object.animationTimer++517object.animationTimer &= 3518if object.rewardRingCount == 0519object.timer--520if object.timer <= 0521object.angle = 0522object.priority = PRIORITY_BOUNDS523object.state = SLOTMACHINE_WAIT524foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)525if player[currentPlayer].state == Player_State_Static526BoxCollisionTest(C_TOUCH, object.entityPos, -24, -20, 24, 20, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)527if checkResult == true528#platform: USE_STANDALONE529player[currentPlayer].state = Player_State_Air530#endplatform531#platform: USE_ORIGINS532player[currentPlayer].state = Player_State_Air_NoDropDash533#endplatform534player[currentPlayer].gravity = GRAVITY_AIR535end if536end if537next538end if539else540GetBit(temp0, oscillation, 0)541if temp0 == false542Cos256(temp0, object.angle)543temp0 <<= 15544temp0 += object.xpos545546Sin256(temp1, object.angle)547temp1 <<= 15548temp1 += object.ypos549550CreateTempObject(TypeName[Slot Prize], 0, temp0, temp1)551slotPrize[tempObjectPos].originPos.x = object.xpos552slotPrize[tempObjectPos].originPos.y = object.ypos553object[tempObjectPos].inkEffect = INK_ALPHA554if object.rewardRingCount > 0555slotPrize[tempObjectPos].timer = 26556object.angle += 0x89557object.rewardRingCount--558else559slotPrize[tempObjectPos].timer = 30560object[tempObjectPos].state = SLOTPRIZE_LOSER561object[tempObjectPos].frame = 8562object.angle += 0x90563object.rewardRingCount++564end if565object.angle &= 0xFF566end if567end if568break569570case SLOTMACHINE_WAIT571object.frame = 0572object.timer++573if object.timer == 30574object.timer = 0575object.state = SLOTMACHINE_IDLE576end if577break578579end switch580581if object.state == SLOTMACHINE_WAIT582foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)583BoxCollisionTest(C_SOLID, object.entityPos, -24, -20, -17, 20, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)584BoxCollisionTest(C_SOLID, object.entityPos, 17, -20, 24, 20, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)585next586else587foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)588BoxCollisionTest(C_SOLID, object.entityPos, -24, -20, 24, 20, currentPlayer, C_BOX, -12, C_BOX, 12)589switch checkResult590case COL_TOP591case COL_BOTTOM592if object.state == SLOTMACHINE_IDLE593object.priority = PRIORITY_ACTIVE594if object.propertyValue == 0595object.state = SLOTMACHINE_READY596else597object.state = SLOTMACHINE_HOLD598if options.vsMode == false599Rand(object.targetSpinSpeedL, 4)600object.targetSpinSpeedL += 2601Rand(object.targetSpinSpeedM, 4)602object.targetSpinSpeedM += 2603Rand(object.targetSpinSpeedR, 4)604object.targetSpinSpeedR += 2605Rand(object.timer, 16)606else607vs.randomValue *= 1103515245608vs.randomValue += 12345609vs.randomValue &= 0x7FFFFFFF610object.targetSpinSpeedL = vs.randomValue611object.targetSpinSpeedL >>= 16612object.targetSpinSpeedL &= 3613object.targetSpinSpeedL += 2614615vs.randomValue *= 1103515245616vs.randomValue += 12345617vs.randomValue &= 0x7FFFFFFF618object.targetSpinSpeedM = vs.randomValue619object.targetSpinSpeedM >>= 16620object.targetSpinSpeedM &= 3621object.targetSpinSpeedM += 2622623vs.randomValue *= 1103515245624vs.randomValue += 12345625vs.randomValue &= 0x7FFFFFFF626object.targetSpinSpeedR = vs.randomValue627object.targetSpinSpeedR >>= 16628object.targetSpinSpeedR &= 3629object.targetSpinSpeedR += 2630631vs.randomValue *= 1103515245632vs.randomValue += 12345633vs.randomValue &= 0x7FFFFFFF634object.timer = vs.randomValue635object.timer >>= 16636object.timer &= 15637end if638object.timer += 14639object.timer *= 3640641temp0 = 0642temp1 = 0643temp2 = oscillation644temp2 &= 0xFF645while temp1 != 0xFF646GetTableValue(temp1, temp0, SlotMachine_randomizeTable)647temp2 -= temp1648if temp2 >= 0649temp0 += 4650else651temp1 = 0xFF652end if653loop654655GetTableValue(temp1, temp0, SlotMachine_randomizeTable)656if temp1 != 0xFF657temp0++658GetTableValue(object.prizeTablePosL, temp0, SlotMachine_randomizeTable)659660temp0++661GetTableValue(object.prizeTablePosM, temp0, SlotMachine_randomizeTable)662663temp0++664GetTableValue(object.prizeTablePosR, temp0, SlotMachine_randomizeTable)665else666if options.vsMode == false667Rand(object.prizeTablePosL, 8)668Rand(object.prizeTablePosM, 8)669Rand(object.prizeTablePosR, 8)670else671vs.randomValue *= 1103515245672vs.randomValue += 2758389673vs.randomValue &= 0x7FFFFFFF674object.prizeTablePosL = vs.randomValue675object.prizeTablePosL >>= 16676object.prizeTablePosL &= 7677678vs.randomValue *= 1103515245679vs.randomValue += 12568680vs.randomValue &= 0x7FFFFFFF681object.prizeTablePosM = vs.randomValue682object.prizeTablePosM >>= 16683object.prizeTablePosM &= 7684685vs.randomValue *= 1103515245686vs.randomValue += 1284239687vs.randomValue &= 0x7FFFFFFF688object.prizeTablePosR = vs.randomValue689object.prizeTablePosR >>= 16690object.prizeTablePosR &= 7691end if692end if693end if694end if695696player[currentPlayer].state = Player_State_Static697player[currentPlayer].animation = ANI_JUMPING698player[currentPlayer].gravity = 1699player[currentPlayer].animationSpeed = 40700player[currentPlayer].speed = 0701player[currentPlayer].xvel = 0702player[currentPlayer].yvel = 1 // just 1? that's a really small yvel..703player[currentPlayer].xpos = object.xpos704player[currentPlayer].ypos = object.ypos705break706end switch707next708end if709end event710711712event ObjectDraw713DrawSprite(object.frame)714end event715716717event ObjectStartup718LoadSpriteSheet("CNZ/Objects.gif")719SpriteFrame(-24, -20, 48, 40, 1, 99)720SpriteFrame(-24, -20, 48, 40, 50, 99)721722foreach (TypeName[Slot Machine], arrayPos0, ALL_ENTITIES)723object[arrayPos0].drawOrder = 5724next725726// Randomize the initial slot prize displays727if options.vsMode == false728Rand(SlotMachine_slotPrizeL, 8)729SlotMachine_slotPrizeL <<= 5730Rand(SlotMachine_slotPrizeM, 8)731SlotMachine_slotPrizeM <<= 5732Rand(SlotMachine_slotPrizeR, 8)733SlotMachine_slotPrizeR <<= 5734else735vs.randomValue *= 1103515245736vs.randomValue += 12345737vs.randomValue &= 0x7FFFFFFF738SlotMachine_slotPrizeL = vs.randomValue739SlotMachine_slotPrizeL >>= 16740SlotMachine_slotPrizeL &= 7741SlotMachine_slotPrizeL <<= 5742743vs.randomValue *= 1103515245744vs.randomValue += 12345745vs.randomValue &= 0x7FFFFFFF746SlotMachine_slotPrizeM = vs.randomValue747SlotMachine_slotPrizeM >>= 16748SlotMachine_slotPrizeM &= 7749SlotMachine_slotPrizeM <<= 5750751vs.randomValue *= 1103515245752vs.randomValue += 12345753vs.randomValue &= 0x7FFFFFFF754SlotMachine_slotPrizeR = vs.randomValue755SlotMachine_slotPrizeR >>= 16756SlotMachine_slotPrizeR &= 7757SlotMachine_slotPrizeR <<= 5758end if759760temp0 = 0761SlotMachine_startDebugID = DebugMode_ObjCount762while temp0 < 2763SetTableValue(TypeName[Slot Machine], DebugMode_ObjCount, DebugMode_TypesTable)764SetTableValue(SlotMachine_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)765SetTableValue(SlotMachine_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)766DebugMode_ObjCount++767temp0++768loop769end event770771772// ========================773// Editor Events774// ========================775776event RSDKEdit777if editor.returnVariable == true778switch editor.variableID779case EDIT_VAR_PROPVAL // property value780checkResult = object.propertyValue781break782783case 0 // type784checkResult = object.propertyValue785break786787end switch788else789switch editor.variableID790case EDIT_VAR_PROPVAL // property value791object.propertyValue = editor.variableValue792break793794case 0 // type795object.propertyValue = editor.variableValue796break797798end switch799end if800end event801802803event RSDKDraw804DrawSprite(0)805end event806807808event RSDKLoad809LoadSpriteSheet("CNZ/Objects.gif")810SpriteFrame(-24, -20, 48, 40, 1, 99)811812AddEditorVariable("type")813SetActiveVariable("type")814AddEnumVariable("Slot Combo Machine", 0)815AddEnumVariable("Slot Prize Machine", 1)816end event817818819