Path: blob/main/Scripts/Mission/Kemusi2.txt
1319 views
//------------------Sonic CD Kemusi 2 Script------------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//3//-------------Used on Mission "M093 - Fast Foes"-------------//45// Aliases67#alias Object.Value0 : Object.Timer89// The head is base XPos and YPos1011#alias Object.Value1 : Object.BodyPosition1X12#alias Object.Value4 : Object.BodyPosition1Y1314#alias Object.Value2 : Object.BodyPosition2X15#alias Object.Value5 : Object.BodyPosition2Y1617#alias Object.Value3 : Object.BodyPosition3X18#alias Object.Value6 : Object.BodyPosition3Y1920// Bitfield for all the directions of the individual pieces21#alias Object.Value7 : Object.Directions2223// The range the Kemusi will go, stored in rather unconventional values...24#alias Object.Scale : Object.BoundsL25#alias Object.Rotation : Object.BoundsR2627#alias Object.PropertyValue : Object.Quality2829// States30#alias 0 : KEMUSI2_INIT31#alias 1 : KEMUSI2_FINDGROUND32#alias 2 : KEMUSI2_SPIKED_ADVANCE33#alias 3 : KEMUSI2_SPIKED_RETRACT34#alias 4 : KEMUSI2_NORMAL_ADVANCE35#alias 5 : KEMUSI2_NORMAL_RETRACT3637// Badnik Quality38#alias 0 : GOOD_QUALITY39#alias 1 : BAD_QUALITY4041// Collision Sides42#alias 0 : CSIDE_FLOOR434445sub ObjectMain46switch Object.State47case KEMUSI2_INIT48// Set initial body part positions4950// Setup the first body fragment to be 12 pixels to the right from the head51Object.BodyPosition1X = Object.XPos52Object.BodyPosition1X += 0xC00005354// Set the second body fragment to be 24 pixels away from the head55Object.BodyPosition2X = Object.XPos56Object.BodyPosition2X += 0x1800005758// And then make the third, and last, body fragment 36 pixels away from the head59Object.BodyPosition3X = Object.XPos60Object.BodyPosition3X += 0x2400006162// All the body fragments start on the same Y Position as the head63Object.BodyPosition1Y = Object.YPos64Object.BodyPosition2Y = Object.YPos65Object.BodyPosition3Y = Object.YPos6667// And setup initial bounds too6869// Left bounds is 64 pixels away70Object.BoundsL = Object.XPos71Object.BoundsL -= 0x4000007273// And right bounds is 64 pixels away too, adding up to a total of 128 pixels range74Object.BoundsR = Object.XPos75Object.BoundsR += 0x4000007677Object.State = KEMUSI2_FINDGROUND78break7980case KEMUSI2_FINDGROUND81// Get the directions of every piece (incl. head)82GetBit(TempValue0, Object.Directions, 0)83GetBit(TempValue1, Object.Directions, 1)84GetBit(TempValue2, Object.Directions, 2)85GetBit(TempValue3, Object.Directions, 3)8687// First, update make the head track the ground if needed88if TempValue0 == false89ObjectTileCollision(CSIDE_FLOOR, 0, 8, 0)90if CheckResult == false91// If there was no collision, move the head down by a pixel92Object.YPos += 0x1000093else94TempValue0 = CheckResult95end if96end if9798// ObjectTileCollision can only pull from Object.XPos and Object.YPos, no custom values, so it's rapidly99// changing throughout this section100// With that, back it up now so it can be properly set again later101TempValue4 = Object.XPos102TempValue5 = Object.YPos103104// Then, update following piece 1105if TempValue1 == false106Object.XPos = Object.BodyPosition1X107Object.YPos = Object.BodyPosition1Y108109ObjectTileCollision(CSIDE_FLOOR, 0, 8, 0)110if CheckResult == false111Object.BodyPosition1Y += 0x10000112else113TempValue1 = CheckResult114Object.BodyPosition1Y = Object.YPos115end if116end if117118// Now, update piece 2's grip to the ground119if TempValue2 == false120Object.XPos = Object.BodyPosition2X121Object.YPos = Object.BodyPosition2Y122123ObjectTileCollision(CSIDE_FLOOR, 0, 8, 0)124if CheckResult == false125Object.BodyPosition2Y += 0x10000126else127TempValue2 = CheckResult128Object.BodyPosition2Y = Object.YPos129end if130end if131132// And finally, piece 3133if TempValue3 == false134Object.XPos = Object.BodyPosition3X135Object.YPos = Object.BodyPosition3Y136137ObjectTileCollision(CSIDE_FLOOR, 0, 8, 0)138if CheckResult == false139Object.BodyPosition3Y += 0x10000140else141TempValue3 = CheckResult142Object.BodyPosition3Y = Object.YPos143end if144end if145146// Restore the Object's position, now that all the Object Tile Collision checks have been done147Object.XPos = TempValue4148Object.YPos = TempValue5149150// Add the collision results of all individual pieces151// (0 if in the air, 1 if on the ground)152TempValue4 = TempValue0153TempValue4 += TempValue1154TempValue4 += TempValue2155TempValue4 += TempValue3156157// 4 means, are all pieces are touching the ground?158if TempValue4 == 4159if Object.Quality == GOOD_QUALITY160Object.State = KEMUSI2_SPIKED_RETRACT161else162Object.State = KEMUSI2_NORMAL_RETRACT163end if164165Object.Directions = 0166else167// Store the current collision states for use next frame168SetBit(Object.Directions, 0, TempValue0)169SetBit(Object.Directions, 1, TempValue1)170SetBit(Object.Directions, 2, TempValue2)171SetBit(Object.Directions, 3, TempValue3)172end if173break174175case KEMUSI2_SPIKED_ADVANCE176if Object.Timer < 9177Object.Timer++178179// See which way the Head's facing180GetBit(TempValue0, Object.Directions, 0)181182if TempValue0 == 0183// The Head's facing left184185// Move it half a pixel to the left186Object.XPos -= 0x20000187188// See if it's still the ground189ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)190191if CheckResult == true192// The Head's still on the ground, that's good193194if Object.XPos < Object.BoundsL195// However, if the Head's now past the Object's Left bounds, then turn around196SetBit(Object.Directions, 0, 1)197end if198else199// The Head's now in the air, turn it around200SetBit(Object.Directions, 0, 1)201end if202else203// The Head's facing right204205// Move it a half pixel to the right206Object.XPos += 0x20000207208// See if the Head's still on the ground209ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)210if CheckResult == true211// Yup the Head's still grounded, that's good212213if Object.XPos > Object.BoundsR214// However, the Head's beyond the Right bounds, so turn around215SetBit(Object.Directions, 0, 0)216end if217else218// Head's now in the air, turn around219SetBit(Object.Directions, 0, 0)220end if221end if222223// Now, onto the Body segments!224225// First, backup the Object's base Position226TempValue1 = Object.XPos227TempValue2 = Object.YPos228229// Get Body Piece 1's Direction230GetBit(TempValue0, Object.Directions, 1)231232if TempValue0 == 0233// Facing left234Object.BodyPosition1X -= 0x15554235236// Move the entire Object to this Body Piece's Position237Object.XPos = Object.BodyPosition1X238Object.YPos = Object.BodyPosition1Y239240// Check to see if it can Grip to a tile241ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)242243if CheckResult == true244// Move this Body Piece to be on the floor245Object.BodyPosition1Y = Object.YPos246247if Object.BodyPosition1X < Object.BoundsL248// Left bounds reached, turn around249SetBit(Object.Directions, 1, 1)250end if251else252// It's in the air, so turn around253SetBit(Object.Directions, 1, 1)254end if255else256Object.BodyPosition1X += 0x15554257258// Move the entire Object to the current Body Piece's Position259Object.XPos = Object.BodyPosition1X260Object.YPos = Object.BodyPosition1Y261262// Check Grip to the Tile, this is why the Object needed to be moved263ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)264265if CheckResult == true266// Move the Body Piece to where the ground grip is267Object.BodyPosition1Y = Object.YPos268269if Object.BodyPosition1X > Object.BoundsR270// The Piece is past its right Bounds, turn it around271SetBit(Object.Directions, 1, 0)272end if273else274// The Object's in the air, turn around275SetBit(Object.Directions, 1, 0)276end if277end if278279// Get the direction of Body Fragment 2280GetBit(TempValue0, Object.Directions, 2)281282if TempValue0 == 0283// Piece is facing left284Object.BodyPosition2X -= 0xAAA8285286// And now move the entire Object to this Piece's Position287Object.XPos = Object.BodyPosition2X288Object.YPos = Object.BodyPosition2Y289290// Grip this Piece to the tile291ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)292293if CheckResult == true294Object.BodyPosition2Y = Object.YPos295if Object.BodyPosition2X < Object.BoundsL296SetBit(Object.Directions, 2, 1)297end if298else299SetBit(Object.Directions, 2, 1)300end if301else302Object.BodyPosition2X += 0xAAA8303304Object.XPos = Object.BodyPosition2X305Object.YPos = Object.BodyPosition2Y306307ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)308if CheckResult == true309Object.BodyPosition2Y = Object.YPos310311if Object.BodyPosition2X > Object.BoundsR312SetBit(Object.Directions, 2, 0)313end if314else315SetBit(Object.Directions, 2, 0)316end if317end if318319Object.XPos = TempValue1320Object.YPos = TempValue2321else322323// Are all Pieces facing left?324if Object.Directions == 0325Object.BodyPosition1X = Object.XPos326Object.BodyPosition1X += 0xC0000327328Object.BodyPosition2X = Object.XPos329Object.BodyPosition2X += 0x180000330331Object.BodyPosition3X = Object.XPos332Object.BodyPosition3X += 0x240000333end if334335// Are all Pieces facing right?336if Object.Directions == 15337Object.BodyPosition1X = Object.XPos338Object.BodyPosition1X -= 0xC0000339340Object.BodyPosition2X = Object.XPos341Object.BodyPosition2X -= 0x180000342343Object.BodyPosition3X = Object.XPos344Object.BodyPosition3X -= 0x240000345end if346347Object.Timer = 0348Object.State = KEMUSI2_SPIKED_RETRACT349end if350break351352case KEMUSI2_SPIKED_RETRACT353if Object.Timer < 9354Object.Timer++355356TempValue1 = Object.XPos357TempValue2 = Object.YPos358359GetBit(TempValue0, Object.Directions, 1)360if TempValue0 == 0361Object.BodyPosition1X -= 0xAAA8362363Object.XPos = Object.BodyPosition1X364Object.YPos = Object.BodyPosition1Y365366ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)367if CheckResult == true368Object.BodyPosition1Y = Object.YPos369370if Object.BodyPosition1X < Object.BoundsL371SetBit(Object.Directions, 1, 1)372end if373else374SetBit(Object.Directions, 1, 1)375end if376else377Object.BodyPosition1X += 0xAAA8378379Object.XPos = Object.BodyPosition1X380Object.YPos = Object.BodyPosition1Y381382ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)383if CheckResult == true384Object.BodyPosition1Y = Object.YPos385386if Object.BodyPosition1X > Object.BoundsR387SetBit(Object.Directions, 1, 0)388end if389else390SetBit(Object.Directions, 1, 0)391end if392end if393394GetBit(TempValue0, Object.Directions, 2)395if TempValue0 == 0396Object.BodyPosition2X -= 0x15554397398Object.XPos = Object.BodyPosition2X399Object.YPos = Object.BodyPosition2Y400401ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)402if CheckResult == true403Object.BodyPosition2Y = Object.YPos404405if Object.BodyPosition2X < Object.BoundsL406SetBit(Object.Directions, 2, 1)407end if408else409SetBit(Object.Directions, 2, 1)410end if411else412Object.BodyPosition2X += 0x15554413414Object.XPos = Object.BodyPosition2X415Object.YPos = Object.BodyPosition2Y416417ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)418if CheckResult == true419Object.BodyPosition2Y = Object.YPos420421if Object.BodyPosition2X > Object.BoundsR422SetBit(Object.Directions, 2, 0)423end if424else425SetBit(Object.Directions, 2, 0)426end if427end if428429GetBit(TempValue0, Object.Directions, 3)430if TempValue0 == 0431Object.BodyPosition3X -= 0x20000432433Object.XPos = Object.BodyPosition3X434Object.YPos = Object.BodyPosition3Y435436ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)437if CheckResult == true438Object.BodyPosition3Y = Object.YPos439440if Object.BodyPosition3X < Object.BoundsL441SetBit(Object.Directions, 3, 1)442end if443else444SetBit(Object.Directions, 3, 1)445end if446else447Object.BodyPosition3X += 0x20000448449Object.XPos = Object.BodyPosition3X450Object.YPos = Object.BodyPosition3Y451452ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)453454if CheckResult == true455Object.BodyPosition3Y = Object.YPos456457if Object.BodyPosition3X > Object.BoundsR458SetBit(Object.Directions, 3, 0)459end if460else461SetBit(Object.Directions, 3, 0)462end if463end if464465Object.XPos = TempValue1466Object.YPos = TempValue2467else468Object.Timer = 0469Object.State = KEMUSI2_SPIKED_ADVANCE470end if471break472473case KEMUSI2_NORMAL_ADVANCE474if Object.Timer < 9475Object.Timer++476477GetBit(TempValue0, Object.Directions, 0)478if TempValue0 == 0479Object.XPos -= 0x10000480481ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)482483if CheckResult == true484if Object.XPos < Object.BoundsL485SetBit(Object.Directions, 0, 1)486end if487else488SetBit(Object.Directions, 0, 1)489end if490else491Object.XPos += 0x10000492493ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)494495if CheckResult == true496if Object.XPos > Object.BoundsR497SetBit(Object.Directions, 0, 0)498end if499else500SetBit(Object.Directions, 0, 0)501end if502end if503504TempValue1 = Object.XPos505TempValue2 = Object.YPos506507GetBit(TempValue0, Object.Directions, 1)508if TempValue0 == 0509Object.BodyPosition1X -= 0xAAAA510511Object.XPos = Object.BodyPosition1X512Object.YPos = Object.BodyPosition1Y513514ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)515516if CheckResult == true517Object.BodyPosition1Y = Object.YPos518519if Object.BodyPosition1X < Object.BoundsL520SetBit(Object.Directions, 1, 1)521end if522else523SetBit(Object.Directions, 1, 1)524end if525else526Object.BodyPosition1X += 0xAAAA527528Object.XPos = Object.BodyPosition1X529Object.YPos = Object.BodyPosition1Y530531ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)532533if CheckResult == true534Object.BodyPosition1Y = Object.YPos535536if Object.BodyPosition1X > Object.BoundsR537SetBit(Object.Directions, 1, 0)538end if539else540SetBit(Object.Directions, 1, 0)541end if542end if543544GetBit(TempValue0, Object.Directions, 2)545if TempValue0 == 0546Object.BodyPosition2X -= 0x5554547548Object.XPos = Object.BodyPosition2X549Object.YPos = Object.BodyPosition2Y550551ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)552553if CheckResult == true554Object.BodyPosition2Y = Object.YPos555556if Object.BodyPosition2X < Object.BoundsL557SetBit(Object.Directions, 2, 1)558end if559else560SetBit(Object.Directions, 2, 1)561end if562else563Object.BodyPosition2X += 0x5554564565Object.XPos = Object.BodyPosition2X566Object.YPos = Object.BodyPosition2Y567568ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)569570if CheckResult == true571Object.BodyPosition2Y = Object.YPos572573if Object.BodyPosition2X > Object.BoundsR574SetBit(Object.Directions, 2, 0)575end if576else577SetBit(Object.Directions, 2, 0)578end if579end if580581Object.XPos=TempValue1582Object.YPos=TempValue2583else584if Object.Directions == 0585Object.BodyPosition1X = Object.XPos586Object.BodyPosition1X += 0xC0000587588Object.BodyPosition2X = Object.XPos589Object.BodyPosition2X += 0x180000590591Object.BodyPosition3X = Object.XPos592Object.BodyPosition3X += 0x240000593end if594595if Object.Directions == 15596Object.BodyPosition1X = Object.XPos597Object.BodyPosition1X -= 0xC0000598599Object.BodyPosition2X = Object.XPos600Object.BodyPosition2X -= 0x180000601602Object.BodyPosition3X = Object.XPos603Object.BodyPosition3X -= 0x240000604end if605606Object.Timer = 0607Object.State = KEMUSI2_NORMAL_RETRACT608end if609break610611case KEMUSI2_NORMAL_RETRACT612if Object.Timer < 36613Object.Timer++614615TempValue1 = Object.XPos616TempValue2 = Object.YPos617618GetBit(TempValue0, Object.Directions, 1)619if TempValue0 == 0620Object.BodyPosition1X -= 0x5554621622Object.XPos = Object.BodyPosition1X623Object.YPos = Object.BodyPosition1Y624625ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)626if CheckResult == true627Object.BodyPosition1Y = Object.YPos628629if Object.BodyPosition1X < Object.BoundsL630SetBit(Object.Directions, 1, 1)631end if632else633SetBit(Object.Directions, 1, 1)634end if635else636Object.BodyPosition1X += 0x5554637638Object.XPos = Object.BodyPosition1X639Object.YPos = Object.BodyPosition1Y640641ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)642643if CheckResult == true644Object.BodyPosition1Y = Object.YPos645646if Object.BodyPosition1X > Object.BoundsR647SetBit(Object.Directions, 1, 0)648end if649else650SetBit(Object.Directions, 1, 0)651end if652end if653654GetBit(TempValue0, Object.Directions, 2)655if TempValue0 == 0656Object.BodyPosition2X -= 0xAAA8657658Object.XPos = Object.BodyPosition2X659Object.YPos = Object.BodyPosition2Y660661ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)662663if CheckResult == true664Object.BodyPosition2Y = Object.YPos665666if Object.BodyPosition2X < Object.BoundsL667SetBit(Object.Directions, 2, 1)668end if669else670SetBit(Object.Directions, 2, 1)671end if672else673Object.BodyPosition2X += 0xAAA8674675Object.XPos = Object.BodyPosition2X676Object.YPos = Object.BodyPosition2Y677678ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)679680if CheckResult == true681Object.BodyPosition2Y = Object.YPos682683if Object.BodyPosition2X > Object.BoundsR684SetBit(Object.Directions, 2, 0)685end if686else687SetBit(Object.Directions, 2, 0)688end if689end if690691GetBit(TempValue0, Object.Directions, 3)692if TempValue0 == 0693Object.BodyPosition3X -= 0x10000694695Object.XPos = Object.BodyPosition3X696Object.YPos = Object.BodyPosition3Y697698ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)699700if CheckResult == true701Object.BodyPosition3Y = Object.YPos702703if Object.BodyPosition3X < Object.BoundsL704SetBit(Object.Directions, 3, 1)705end if706else707SetBit(Object.Directions, 3, 1)708end if709else710Object.BodyPosition3X += 0x10000711712Object.XPos = Object.BodyPosition3X713Object.YPos = Object.BodyPosition3Y714715ObjectTileGrip(CSIDE_FLOOR, 0, 8, 0)716717if CheckResult == true718Object.BodyPosition3Y = Object.YPos719720if Object.BodyPosition3X > Object.BoundsR721SetBit(Object.Directions, 3, 0)722end if723else724SetBit(Object.Directions, 3, 0)725end if726end if727728Object.XPos=TempValue1729Object.YPos=TempValue2730else731Object.Timer = 0732Object.State = KEMUSI2_NORMAL_ADVANCE733end if734break735end switch736CallFunction(StageSetup_CheckGoodFuture)737end sub738739740sub ObjectPlayerInteraction741742// First, check for the head743PlayerObjectCollision(C_ENEMY, -8, -10, 8, 8)744if CheckResult == true745CallFunction(Player_BadnikBreak)746else747// The head wasn't hit, so now check against every body fragment748749// First, backup the Object's base Position750TempValue1 = Object.XPos751TempValue2 = Object.YPos752753if Object.Quality == GOOD_QUALITY754Object.XPos = Object.BodyPosition1X755Object.YPos = Object.BodyPosition1Y756757PlayerObjectCollision(C_ENEMY, -8, -10, 8, 8)758759if CheckResult == true760CallFunction(Player_Hit)761else762Object.XPos = Object.BodyPosition2X763Object.YPos = Object.BodyPosition2Y764765PlayerObjectCollision(C_ENEMY, -8, -10, 8, 8)766767if CheckResult == true768CallFunction(Player_Hit)769else770Object.XPos = Object.BodyPosition3X771Object.YPos = Object.BodyPosition3Y772773PlayerObjectCollision(C_ENEMY, -8, -10, 8, 8)774775if CheckResult == true776CallFunction(Player_Hit)777end if778end if779end if780else781Object.XPos = Object.BodyPosition1X782Object.YPos = Object.BodyPosition1Y783784PlayerObjectCollision(C_ENEMY, -8, -8, 8, 8)785786if CheckResult == true787CallFunction(Player_BadnikBreak)788else789Object.XPos = Object.BodyPosition2X790Object.YPos = Object.BodyPosition2Y791792PlayerObjectCollision(C_ENEMY, -8, -8, 8, 8)793794if CheckResult == true795CallFunction(Player_BadnikBreak)796else797Object.XPos = Object.BodyPosition3X798Object.YPos = Object.BodyPosition3Y799800PlayerObjectCollision(C_ENEMY, -8, -8, 8, 8)801802if CheckResult == true803CallFunction(Player_BadnikBreak)804end if805end if806end if807end if808809// It's safe to restore the Object's base Position now810Object.XPos = TempValue1811Object.YPos = TempValue2812813end if814end sub815816817sub ObjectDraw818if Object.Quality == GOOD_QUALITY819GetBit(Object.Direction, Object.Directions, 3)820DrawSpriteFX(2, FX_FLIP, Object.BodyPosition3X, Object.BodyPosition3Y)821822GetBit(Object.Direction, Object.Directions, 2)823DrawSpriteFX(2, FX_FLIP, Object.BodyPosition2X, Object.BodyPosition2Y)824825GetBit(Object.Direction, Object.Directions, 1)826DrawSpriteFX(2, FX_FLIP, Object.BodyPosition1X, Object.BodyPosition1Y)827else828GetBit(Object.Direction, Object.Directions, 3)829DrawSpriteFX(3, FX_FLIP, Object.BodyPosition3X, Object.BodyPosition3Y)830831GetBit(Object.Direction, Object.Directions, 2)832DrawSpriteFX(3, FX_FLIP, Object.BodyPosition2X, Object.BodyPosition2Y)833834GetBit(Object.Direction, Object.Directions, 1)835DrawSpriteFX(3, FX_FLIP, Object.BodyPosition1X, Object.BodyPosition1Y)836end if837838// Get the direction of the head839GetBit(Object.Direction, Object.Directions, 0)840841switch Object.State842case KEMUSI2_INIT843case KEMUSI2_FINDGROUND844case KEMUSI2_SPIKED_RETRACT845case KEMUSI2_NORMAL_RETRACT846// Closed mouth Frame847DrawSpriteFX(0, FX_FLIP, Object.XPos, Object.YPos)848break849850case KEMUSI2_SPIKED_ADVANCE851case KEMUSI2_NORMAL_ADVANCE852// Mouth Open Frame853DrawSpriteFX(1, FX_FLIP, Object.XPos, Object.YPos)854break855856end switch857end sub858859860sub ObjectStartup861LoadSpriteSheet("R5/Objects.gif")862863// 0 - Kemusi Closed Mouth Frame864SpriteFrame(-8, -16, 16, 24, 125, 75)865866// 1 - Kemusi Smiling Frame867SpriteFrame(-8, -16, 16, 24, 125, 50)868869// 2- Kemusi Spiked Fragment Frame870SpriteFrame(-8, -16, 16, 24, 67, 150)871872// 2- Kemusi Normal Fragment Frame873SpriteFrame(-8, -8, 16, 16, 52, 1)874end sub875876877// ========================878// Editor Subs879// ========================880881sub RSDKEdit882if Editor.ReturnVariable == true883switch Editor.VariableID884case EDIT_VAR_PROPVAL // Property Value885CheckResult = Object.PropertyValue886break887case 0 // Type888CheckResult = Object.PropertyValue889break890end switch891else892switch Editor.VariableID893case EDIT_VAR_PROPVAL // Property Value894Object.PropertyValue = Editor.VariableValue895break896case 0 // Type897Object.PropertyValue = Editor.VariableValue898break899end switch900end if901end sub902903904sub RSDKDraw905TempValue0 = Object.XPos906TempValue0 += 0x240000907908DrawSpriteXY(Object.PropertyValue, TempValue0, Object.YPos)909910TempValue0 -= 0xC0000911DrawSpriteXY(Object.PropertyValue, TempValue0, Object.YPos)912913TempValue0 -= 0xC0000914DrawSpriteXY(Object.PropertyValue, TempValue0, Object.YPos)915916TempValue0 -= 0xC0000917DrawSpriteXY(2, TempValue0, Object.YPos) // smile :)918end sub919920921sub RSDKLoad922LoadSpriteSheet("R5/Objects.gif")923924SpriteFrame(-8, -16, 16, 24, 67, 150)925SpriteFrame(-8, -8, 16, 16, 52, 1)926SpriteFrame(-8, -16, 16, 24, 125, 50)927928AddEditorVariable("Type")929SetActiveVariable("Type")930AddEnumVariable("Spiked", 0)931AddEnumVariable("No Spikes", 1)932end sub933934935936937