Path: blob/master/Sonic 2/Scripts/Special/Background.txt
1482 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: Special BG Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.value1 : object.viewRotation1213// Halfpipe Aliases14private alias object.value7 : halfpipe.halfpipeRotation.x15private alias object.value8 : halfpipe.halfpipeRotation.y16private alias object.value9 : halfpipe.halfpipeRotation.z171819// ========================20// Events21// ========================2223event ObjectDraw24temp2 = halfpipe[0].halfpipeRotation.y25temp2 += 0x4026temp2 &= 0x1FF27temp2 >>= 728switch temp229case 030temp0 = halfpipe[0].halfpipeRotation.y31temp1 = halfpipe[0].halfpipeRotation.x32FlipSign(temp1)33object.rotation = halfpipe[0].halfpipeRotation.z34break3536case 137temp0 = halfpipe[0].halfpipeRotation.y38temp1 = halfpipe[0].halfpipeRotation.z39FlipSign(temp1)40object.rotation = halfpipe[0].halfpipeRotation.x41FlipSign(object.rotation)42break4344case 245temp0 = halfpipe[0].halfpipeRotation.y46temp1 = halfpipe[0].halfpipeRotation.x47object.rotation = halfpipe[0].halfpipeRotation.z48FlipSign(object.rotation)49break5051case 352temp0 = halfpipe[0].halfpipeRotation.y53temp1 = halfpipe[0].halfpipeRotation.z54object.rotation = halfpipe[0].halfpipeRotation.x55FlipSign(object.rotation)56break5758end switch5960temp0 <<= 161temp0 &= 0xFF62temp1 <<= 163temp1 &= 0xFF64object.rotation &= 0x1FF6566temp2 = halfpipe[0].halfpipeRotation.x67temp2 += halfpipe[0].halfpipeRotation.y68temp2 += halfpipe[0].halfpipeRotation.z69temp2 &= 0x7F70if temp2 == 071Sin256(object.viewRotation, object.angle)72object.angle += 873object.angle &= 0xFF74else75object.angle = 076object.viewRotation >>= 177end if7879temp2 = object.viewRotation80temp2 *= 381temp2 >>= 982temp1 += temp283if object.rotation == 084temp0 += screen.xcenter85temp1 += screen.ycenter86DrawSpriteScreenXY(0, temp0, temp1)87DrawSpriteScreenXY(1, temp0, temp1)88DrawSpriteScreenXY(2, temp0, temp1)89DrawSpriteScreenXY(3, temp0, temp1)90DrawSpriteScreenXY(4, temp0, temp1)91DrawSpriteScreenXY(5, temp0, temp1)92DrawSpriteScreenXY(6, temp0, temp1)93DrawSpriteScreenXY(7, temp0, temp1)94DrawSpriteScreenXY(8, temp0, temp1)95DrawSpriteScreenXY(9, temp0, temp1)96DrawSpriteScreenXY(10, temp0, temp1)97DrawSpriteScreenXY(11, temp0, temp1)98else99temp0 += screen.xcenter100temp1 += screen.ycenter101DrawSpriteScreenFX(1, FX_ROTATE, temp0, temp1)102DrawSpriteScreenFX(2, FX_ROTATE, temp0, temp1)103DrawSpriteScreenFX(3, FX_ROTATE, temp0, temp1)104DrawSpriteScreenFX(5, FX_ROTATE, temp0, temp1)105DrawSpriteScreenFX(6, FX_ROTATE, temp0, temp1)106DrawSpriteScreenFX(7, FX_ROTATE, temp0, temp1)107DrawSpriteScreenFX(8, FX_ROTATE, temp0, temp1)108DrawSpriteScreenFX(9, FX_ROTATE, temp0, temp1)109DrawSpriteScreenFX(10, FX_ROTATE, temp0, temp1)110end if111end event112113114event ObjectStartup115LoadSpriteSheet("Special/Background.gif")116117SpriteFrame(-640, -128, 256, 256, 0, 0)118SpriteFrame(-128, -128, 256, 256, 0, 0)119SpriteFrame(-384, -128, 256, 256, 0, 0)120SpriteFrame(128, -128, 256, 256, 0, 0)121SpriteFrame(-640, -384, 256, 256, 0, 0)122SpriteFrame(-128, -384, 256, 256, 0, 0)123SpriteFrame(-384, -384, 256, 256, 0, 0)124SpriteFrame(128, -384, 256, 256, 0, 0)125SpriteFrame(-128, -128, 256, 256, 0, 0)126SpriteFrame(-128, 128, 256, 256, 0, 0)127SpriteFrame(-384, 128, 256, 256, 0, 0)128SpriteFrame(128, 128, 256, 256, 0, 0)129130object[1].type = TypeName[Special BG]131object[1].priority = PRIORITY_ACTIVE132object[1].drawOrder = 0133end event134135136// ========================137// Editor Events138// ========================139140event RSDKDraw141DrawSprite(0)142end event143144145event RSDKLoad146LoadSpriteSheet("Special/Background.gif")147SpriteFrame(-128, -128, 256, 256, 0, 0)148149SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")150end event151152153