├── .editorconfig ├── .gitattributes ├── README.md ├── RetroScript Handbook v4.pdf ├── Sonic 1 └── Scripts │ ├── Animals │ ├── Cucky.txt │ ├── Flicky.txt │ ├── Pecky.txt │ ├── Picky.txt │ ├── Pocky.txt │ ├── Ricky.txt │ └── Rocky.txt │ ├── Continue │ ├── Continue.txt │ ├── ContinueSetup.txt │ └── Spotlight.txt │ ├── Credits │ ├── CreditsControl.txt │ ├── CreditsEggman.txt │ └── UnlockTest.txt │ ├── Ending │ ├── Emeralds.txt │ ├── EndingControl.txt │ ├── EndingPose.txt │ └── EndingSetup.txt │ ├── Enemies │ ├── BallHog.txt │ ├── BallHogBomb.txt │ ├── Batbrain.txt │ ├── Bomb.txt │ ├── BombShrapnel.txt │ ├── Burrobot.txt │ ├── BuzzBomber.txt │ ├── BuzzBomberShot.txt │ ├── Caterkiller.txt │ ├── Chopper.txt │ ├── Crabmeat.txt │ ├── CrabmeatShot.txt │ ├── Jaws.txt │ ├── Motobug.txt │ ├── MotobugExhaust.txt │ ├── NewtronFly.txt │ ├── NewtronShoot.txt │ ├── NewtronShot.txt │ ├── Orbinaut.txt │ ├── Roller.txt │ ├── Splats.txt │ └── Yadrin.txt │ ├── GHZ │ ├── BossChain.txt │ ├── BossLights.txt │ ├── BreakWall.txt │ ├── Bridge.txt │ ├── BridgeEnd.txt │ ├── CLedgeLeft.txt │ ├── CLedgeRight.txt │ ├── CheckeredBall.txt │ ├── Eggman.txt │ ├── FPlatform.txt │ ├── GHZSetup.txt │ ├── HPlatform.txt │ ├── Rock.txt │ ├── SpikeLogs.txt │ ├── SwingPlat.txt │ ├── TubeSwitch.txt │ ├── VPlatform.txt │ ├── VPlatform2.txt │ ├── WaterfallSound.txt │ └── WreckingBall.txt │ ├── Global │ ├── ActFinish.txt │ ├── AnimalPrison.txt │ ├── BlueShield.txt │ ├── BlueShield2.txt │ ├── BonusPoints.txt │ ├── BrokenMonitor.txt │ ├── BubbleShield.txt │ ├── DeathEvent.txt │ ├── DebugMode.txt │ ├── DustPuff.txt │ ├── Explosion.txt │ ├── FireShield.txt │ ├── Goggles.txt │ ├── HUD.txt │ ├── InstaShield.txt │ ├── Invincibility.txt │ ├── Invincibility2.txt │ ├── InvisibleBlock.txt │ ├── LampPost.txt │ ├── LightningShield.txt │ ├── LightningSpark.txt │ ├── LoseRing.txt │ ├── Monitor.txt │ ├── MusicEvent.txt │ ├── ObjectScore.txt │ ├── PSwitch_H.txt │ ├── PSwitch_Loop.txt │ ├── PSwitch_V.txt │ ├── RedSpring.txt │ ├── Ring.txt │ ├── RingSparkle.txt │ ├── SignPost.txt │ ├── SmokePuff.txt │ ├── SpecialRing.txt │ ├── Spikes.txt │ ├── StageSetup.txt │ ├── SuperSpark.txt │ ├── TailsStuck.txt │ ├── TitleCard.txt │ ├── YBoundAdjust.txt │ └── YellowSpring.txt │ ├── LZ │ ├── AirBubble.txt │ ├── AirBubbler.txt │ ├── BeltActivation.txt │ ├── BeltPlatform.txt │ ├── Cork.txt │ ├── CorkActivation.txt │ ├── CountdownBubble.txt │ ├── CurrentTunnel.txt │ ├── Door.txt │ ├── DoorFlapping.txt │ ├── Eggman.txt │ ├── FallingBlock.txt │ ├── Gargoyle.txt │ ├── GargoyleShot.txt │ ├── GrabBar.txt │ ├── HarpoonHoriz.txt │ ├── HarpoonVert.txt │ ├── HorizontalDoor.txt │ ├── LZSetup.txt │ ├── Push Block.txt │ ├── PushButton.txt │ ├── RisingPlatform.txt │ ├── RotatingSpike.txt │ ├── SBZ3Exit.txt │ ├── SBZ3Fall.txt │ ├── SecretPlatform.txt │ ├── SlidingFloor.txt │ ├── SolidBlock.txt │ ├── TouchBlock.txt │ ├── VerticalWrap.txt │ ├── Water.txt │ ├── WaterSplash.txt │ ├── Waterfall.txt │ └── Wheel.txt │ ├── LevelSelect │ ├── BGAnimation.txt │ ├── HexNo.txt │ ├── MenuButton.txt │ ├── MenuControl.txt │ ├── MenuDPad.txt │ ├── StageMenu.txt │ └── ZoneButton.txt │ ├── MZ │ ├── BossFireball.txt │ ├── BreakBlock.txt │ ├── ButtonPillar.txt │ ├── CFloor.txt │ ├── ChainedCrusher.txt │ ├── Eggman.txt │ ├── FallingBlock.txt │ ├── FallingLava.txt │ ├── Fireball.txt │ ├── GlassPillar.txt │ ├── GrassFireball.txt │ ├── HCrusher.txt │ ├── HPlatform.txt │ ├── LargePlatform.txt │ ├── LavaFlow.txt │ ├── LavaGeyser.txt │ ├── LavaSplash.txt │ ├── MZSetup.txt │ ├── PushBlock.txt │ ├── PushButton.txt │ ├── PushOutBlock.txt │ ├── RideBlock.txt │ ├── ShortcutCheck.txt │ ├── SwingPlat.txt │ └── UFO.txt │ ├── Mission │ ├── BallHog2.txt │ ├── BallHogBomb2.txt │ ├── Batbrain2.txt │ ├── Boss3Safty.txt │ ├── Caterkiller2.txt │ ├── EggmanSignPost.txt │ ├── FallSignPost.txt │ ├── Gliding.txt │ ├── ImmediateDeath.txt │ ├── MissionAreaBL.txt │ ├── MissionAreaTR.txt │ ├── MissionBlock.txt │ ├── MissionWater.txt │ ├── Motobug2.txt │ ├── ReviveBatbrain.txt │ ├── ReviveCaterkiller.txt │ ├── ReviveCrabmeat.txt │ ├── ReviveEnemy.txt │ ├── ReviveMotobug2.txt │ ├── RingReset.txt │ ├── SetRingCount.txt │ ├── SignPost2.txt │ └── WatchLoseRing.txt │ ├── Players │ ├── Player2Object.txt │ ├── PlayerObject.txt │ └── TailsObject.txt │ ├── SBZ │ ├── BeltPlatform.txt │ ├── Buzzsaw.txt │ ├── CollapsingFloor.txt │ ├── ConveyorWheel.txt │ ├── CutBridge.txt │ ├── Eggman.txt │ ├── Eggmobile.txt │ ├── ElectricOrb.txt │ ├── FZEggman.txt │ ├── FZIntro.txt │ ├── FZPiston.txt │ ├── FlameThrower.txt │ ├── ForceField.txt │ ├── GirderDoor.txt │ ├── HCrushCover.txt │ ├── HCrushGirder.txt │ ├── JunctionWheel.txt │ ├── ObjectActivator.txt │ ├── OneWayDoor.txt │ ├── Piston.txt │ ├── PlasmaBall.txt │ ├── PlasmaEmitter.txt │ ├── PushButton.txt │ ├── RoofCover.txt │ ├── SBZSetup.txt │ ├── SlidingFloor.txt │ ├── SpinPlatform.txt │ ├── SwingingSpike.txt │ ├── TransSprite.txt │ ├── Transporter.txt │ ├── TrapDoor.txt │ ├── TubeCover.txt │ ├── VPlatform.txt │ ├── VanishPlatform.txt │ └── VerticalWrap.txt │ ├── SLZ │ ├── BreakWall.txt │ ├── Cannon.txt │ ├── CollapsingFloor.txt │ ├── Eggman.txt │ ├── FallingPlatform.txt │ ├── Fan.txt │ ├── Fireball.txt │ ├── RisingPlatform.txt │ ├── RotatePlatform.txt │ ├── RotatingStair.txt │ ├── SLZSetup.txt │ ├── SeeSaw.txt │ ├── Staircase.txt │ └── SwingPlat.txt │ ├── SYZ │ ├── BossBarrier.txt │ ├── BossBlock.txt │ ├── Bumper.txt │ ├── EdgeStabilizer.txt │ ├── Eggman.txt │ ├── HBlock.txt │ ├── HPlatform.txt │ ├── HVSpikeBall.txt │ ├── MovingBlock.txt │ ├── Push Block.txt │ ├── PushButton.txt │ ├── RLight.txt │ ├── RSpikeChain.txt │ ├── RotatingSpike.txt │ ├── SYZSetup.txt │ ├── SolidBlock.txt │ ├── StaticPlatform.txt │ ├── VBlock.txt │ ├── VPlatform.txt │ └── VerticalDoor.txt │ ├── Special │ ├── 1UP.txt │ ├── BlueBlock.txt │ ├── Bumper.txt │ ├── ChaosEmerald.txt │ ├── DebugMode.txt │ ├── FadeIn.txt │ ├── GemBlock.txt │ ├── GoalBlock.txt │ ├── GreenBlock.txt │ ├── HUD.txt │ ├── PinkBlock.txt │ ├── PlayerObject.txt │ ├── RedWhiteBlock.txt │ ├── Ring.txt │ ├── RingSparkle.txt │ ├── RotateBlock.txt │ ├── SpecialFinish.txt │ ├── SpecialSetup.txt │ ├── TailsObject.txt │ ├── UpDownBlock.txt │ ├── WarpBlock.txt │ ├── YellowBlock.txt │ └── ZoneBlock.txt │ └── Title │ ├── Logo.txt │ ├── Sega.txt │ ├── SonicTeam.txt │ └── Start.txt └── Sonic 2 └── Scripts ├── 2PVS ├── 2PVSMenu1.txt ├── 2PVSMenu2.txt ├── 2PVSMenu3.txt ├── 2PVSMenu4.txt ├── 2PVSSetup.txt ├── ActResults.txt ├── GameResults.txt ├── SSResultSingle.txt ├── SSResults.txt ├── VSGame.txt ├── ZoneButton.txt └── ZoneResults.txt ├── ARZ ├── ARZSetup.txt ├── AirBubble.txt ├── AirBubbler.txt ├── Arrow.txt ├── ArrowLauncher.txt ├── BreakablePillar.txt ├── BreakoffPillar.txt ├── Brick.txt ├── CollapsingFloor.txt ├── CountdownBubble.txt ├── Eggman.txt ├── EggmanArrow.txt ├── EggmanHammer.txt ├── EggmanTotemPole.txt ├── FPlatform.txt ├── FallingPillar.txt ├── HPlatform.txt ├── Leaf.txt ├── LeafSpawner.txt ├── OneWayDoor.txt ├── PSwitch_V2.txt ├── Raft.txt ├── RotatePlatform.txt ├── SwingPlat.txt ├── VPlatform.txt ├── VPlatform2.txt ├── Water.txt └── WaterSplash.txt ├── Animals ├── Becky.txt ├── Cucky.txt ├── Flicky.txt ├── Locky.txt ├── Mocky.txt ├── Pecky.txt ├── Picky.txt ├── Pocky.txt ├── Ricky.txt ├── Rocky.txt ├── Tocky.txt └── Wocky.txt ├── CNZ ├── BossWall.txt ├── Bumper.txt ├── CNZSetup.txt ├── ConveyorBelt.txt ├── DPlunger.txt ├── Eggman.txt ├── EggmanBomb.txt ├── EggmanClaw.txt ├── Elevator.txt ├── HBlock.txt ├── HFlipper.txt ├── HexBumper.txt ├── SlotDisplay.txt ├── SlotMachine.txt ├── SlotPrize.txt ├── SnakePlatform.txt ├── Spinner_H.txt ├── Spinner_V.txt ├── TargetBumper.txt ├── TriBumper.txt ├── TubeSwitch.txt ├── VBlock.txt ├── VFlipper.txt └── VPlunger.txt ├── CPZ ├── Accessory.txt ├── AirBubble.txt ├── AirBubbler.txt ├── BreakBlock.txt ├── BumpingPlatform.txt ├── CPZSetup.txt ├── ChemicalBall.txt ├── ChemicalDrop.txt ├── ChemicalSplash.txt ├── CountdownBubble.txt ├── Eggman.txt ├── EggmanChemicalDropper.txt ├── Fireball.txt ├── HPlatform.txt ├── OneWayDoor.txt ├── RotatePlatform.txt ├── RotatingStair.txt ├── SpeedBooster.txt ├── Staircase.txt ├── TippingFloor.txt ├── TransportTube.txt ├── TubeSpring.txt ├── VPlatform.txt ├── VPlatform2.txt ├── Water.txt └── WaterSplash.txt ├── Continue ├── Continue.txt └── ContinueSetup.txt ├── Credits ├── CreditsControl.txt ├── CreditsEggman.txt ├── CreditsLogo.txt ├── DeathEggFall.txt └── DeathEggRobot.txt ├── DEZ ├── DERArm.txt ├── DERBomb.txt ├── DERFoot.txt ├── DERHand.txt ├── DERLeg.txt ├── DERShoulder.txt ├── DERTarget.txt ├── DEZSetup.txt ├── DeathEggRobot.txt ├── Eggman.txt ├── EggmanWindow.txt ├── MechaSonic.txt ├── MechaSonicSpike.txt └── OneWayDoor.txt ├── EHZ ├── Bridge.txt ├── BridgeEnd.txt ├── BurningLog.txt ├── EHZSetup.txt ├── Eggman.txt ├── EggmanCar.txt ├── EggmanDrill.txt ├── EggmanWheel.txt ├── ExhaustPuff.txt ├── FPlatform.txt ├── HPlatform.txt ├── ObjectActivator.txt ├── SpiralPath.txt ├── VPlatform.txt ├── VPlatform2.txt └── Waterfall.txt ├── Ending ├── Bird.txt ├── Cloud.txt ├── EndSetup.txt └── Tornado.txt ├── Enemies ├── Antenna.txt ├── Aquis.txt ├── AquisShot.txt ├── Asteron.txt ├── AsteronSpike.txt ├── Balkiry.txt ├── Ball.txt ├── Batbot.txt ├── Bee.txt ├── BeeShot.txt ├── BigTurtloid.txt ├── Bubbler.txt ├── BubblersMother.txt ├── Buzzer.txt ├── BuzzerShot.txt ├── ChopChop.txt ├── Clucker.txt ├── CluckerBase.txt ├── CluckerShot.txt ├── Coconut.txt ├── Coconuts.txt ├── Crawl.txt ├── Crawlton.txt ├── Flasher.txt ├── Grabber.txt ├── GrabberShot.txt ├── Grounder.txt ├── Grounder2.txt ├── Jellygnite.txt ├── Masher.txt ├── Nebula.txt ├── NebulaBomb.txt ├── Octus.txt ├── OctusShot.txt ├── Redz.txt ├── RedzFire.txt ├── Rexon.txt ├── RexonShot.txt ├── Shellcracker.txt ├── Slicer.txt ├── SlicerArm.txt ├── SmallTurtloid.txt ├── Snail.txt ├── Sol.txt ├── Spiker.txt ├── SpinyFloor.txt ├── SpinyShot.txt ├── SpinyWall.txt ├── Stegway.txt ├── TurtloidShot.txt └── Whisp.txt ├── Global ├── ActFinish.txt ├── AnimalPrison.txt ├── BlueShield.txt ├── BrokenMonitor.txt ├── BubbleShield.txt ├── DeathEvent.txt ├── DebugMode.txt ├── DustPuff.txt ├── Explosion.txt ├── FireShield.txt ├── HUD.txt ├── InstaShield.txt ├── Invincibility.txt ├── InvisibleBlock.txt ├── LightningShield.txt ├── LightningSpark.txt ├── LoseRing.txt ├── Monitor.txt ├── MusicEvent.txt ├── ObjectScore.txt ├── PSwitch_H.txt ├── PSwitch_V.txt ├── RedSpring.txt ├── Ring.txt ├── RingSparkle.txt ├── SignPost.txt ├── SmokePuff.txt ├── Spikes.txt ├── Springboard.txt ├── StageSetup.txt ├── StarPost.txt ├── SuperSpark.txt ├── TitleCard.txt ├── YBoundAdjust.txt └── YellowSpring.txt ├── HPZ ├── AirBubble.txt ├── AirBubbler.txt ├── BreakGem.txt ├── BreakWall.txt ├── Bridge.txt ├── BridgeEnd.txt ├── CollapsingFloor.txt ├── CountdownBubble.txt ├── Eggman.txt ├── EggmanHorn.txt ├── EggmanMine.txt ├── EggmanValve.txt ├── GlowingOrb.txt ├── HPZFall.txt ├── HPZForeground.txt ├── HPZSetup.txt ├── OriginalGem.txt ├── Pendulum.txt ├── PipeValve.txt ├── RailRocket.txt ├── RotatePlatform.txt ├── SinkingPlatform.txt ├── TubePath.txt ├── TubeSwitch.txt ├── VBlock.txt ├── Water.txt ├── WaterGeyser.txt ├── WaterSplash.txt ├── Waterfall.txt └── WaterfallSprite.txt ├── HTZ ├── 2PVsDeleter.txt ├── BreakBlock.txt ├── BreakRock.txt ├── Earthquake.txt ├── Eggman.txt ├── EggmanFireball1.txt ├── EggmanFireball2.txt ├── EgmanSmokePuff.txt ├── FPlatform.txt ├── GroundFlame.txt ├── HPlatform.txt ├── HTZSetup.txt ├── LavaBubble.txt ├── LavaJump.txt ├── Lift.txt ├── LiftEnd.txt ├── OneWayDoor.txt ├── SeeSaw.txt ├── TubeSwitch.txt ├── VPlatform.txt └── VPlatform2.txt ├── LevelSelect ├── BGAnimation.txt ├── ConfigScreen.txt ├── HexNo.txt ├── MenuButton.txt ├── MenuControl.txt ├── MenuDPad.txt └── StageMenu.txt ├── MBZ ├── BGDimmer.txt ├── MBZSetup.txt ├── PushButton.txt ├── SecretDoor.txt └── TubePath.txt ├── MCZ ├── BossRock.txt ├── CollapsingLedge.txt ├── Eggman.txt ├── EggmanDrill.txt ├── HDropBridge.txt ├── HPZTrigger.txt ├── HPlatform.txt ├── MCZSetup.txt ├── MovingCrates.txt ├── PullSwitch.txt ├── PullVine.txt ├── RingPlatform.txt ├── RockCrusher.txt ├── RotatingSpike.txt ├── SpikedLedge.txt ├── StaticBlock.txt ├── SwingPlat.txt ├── SwingSpikes.txt └── VDropBridge.txt ├── MPZ ├── BeltActivation.txt ├── BeltPlatform.txt ├── BoltEnd.txt ├── ButtonBridge.txt ├── CogPlatform.txt ├── ConveyorBelt.txt ├── Cylinder.txt ├── EPlatform.txt ├── Eggman.txt ├── EggmanBalloon.txt ├── EggmanLaser.txt ├── FPlatform.txt ├── Guage.txt ├── HPlatform.txt ├── HPlatform2.txt ├── HorizontalDoor.txt ├── LPlatform.txt ├── LargeGear.txt ├── LargePiston.txt ├── LavaBubble.txt ├── MPZSetup.txt ├── MPlatform.txt ├── Nut.txt ├── OneWayDoor.txt ├── PlatConveyor.txt ├── PushButton.txt ├── SmallCog.txt ├── SmallPiston.txt ├── Spear.txt ├── SpearBlock.txt ├── SteamPiston.txt ├── TransSprite.txt ├── Transporter.txt ├── VPlatform.txt ├── VPlatform2.txt ├── WallBumper.txt └── WheelPlatform.txt ├── Mission ├── BossSafty.txt ├── Buzzer2.txt ├── EggmanSignPost.txt ├── FallSignPost.txt ├── ImmediateDeath.txt ├── M035Block.txt ├── MissionAnimalPrison.txt ├── MissionAreaBL.txt ├── MissionAreaTR.txt ├── MissionBlock.txt ├── MissionBlockCollisionM027.txt ├── MissionBlockCollisionM040.txt ├── MissionEggmanChemicalDropper.txt ├── MissionGrabPanel.txt ├── MissionWindCurrent.txt ├── PullUpWater.txt ├── RotatingSpike.txt ├── SCZMSetup.txt ├── SCZSpeedUp.txt ├── SetRingCount.txt ├── SignPost2.txt ├── SuperSonic.txt └── Water.txt ├── OOZ ├── BallCannon.txt ├── BreakBlock.txt ├── CheckeredBall.txt ├── CollapsingFloor.txt ├── Eggman.txt ├── EggmanCannon.txt ├── EggmanFlame.txt ├── EggmanHarpoon.txt ├── EggmanLaser.txt ├── Elevator.txt ├── GasPlatform.txt ├── HFan.txt ├── HPushSpring.txt ├── MovingSpikes.txt ├── OOZSetup.txt ├── OilFall.txt ├── PushButton.txt ├── SpikesActivator.txt ├── SwingPlat.txt ├── VFan.txt └── VPushSpring.txt ├── Players ├── Player2Object.txt ├── PlayerObject.txt └── TailsObject.txt ├── SCZ ├── Cloud.txt ├── HPropeller.txt ├── ObjectActivator.txt ├── SCZSetup.txt ├── Tornado.txt └── VPropeller.txt ├── Special ├── Background.txt ├── Bomb.txt ├── ChaosEmerald.txt ├── Checkpoint.txt ├── Checkpoint2PVS.txt ├── Explosion.txt ├── HUD.txt ├── Halfpipe.txt ├── LoseRing.txt ├── PlayerObject.txt ├── Ring.txt ├── RingReminder.txt ├── RingSparkle.txt ├── SpecialFinish.txt ├── SpecialSetup.txt ├── StartMessage.txt └── TextMessage.txt ├── Title ├── KLogo.txt ├── STLogo.txt ├── STScreen.txt ├── Sega.txt ├── ShootingStar.txt ├── Start.txt └── TinkleStars.txt └── WFZ ├── BeltPlatform.txt ├── BeltPlatformS.txt ├── Cloud.txt ├── CockpitBackground.txt ├── ConveyorBelt.txt ├── ConveyorWheel.txt ├── Eggman.txt ├── EggmanBarrier.txt ├── EggmanDispenser.txt ├── EggmanLaser.txt ├── EggmanPlatform.txt ├── EggmanShuttle.txt ├── EggmanThruster.txt ├── GrabBar.txt ├── GrabPanel.txt ├── GrabPanelPart.txt ├── HPlatform.txt ├── HPlatform2.txt ├── HPropeller.txt ├── Hatch.txt ├── Hull.txt ├── HullSeal.txt ├── LargeLaser.txt ├── Laser.txt ├── Launcher.txt ├── PullChain.txt ├── RotatePlatform.txt ├── ShipFG.txt ├── TiltPlatformH.txt ├── TiltPlatformL.txt ├── TiltPlatformM.txt ├── TiltPlatformV.txt ├── Tornado.txt ├── TornadoExplosion.txt ├── Turret.txt ├── TurretBullet.txt ├── TurretPlatform.txt ├── VPlatform.txt ├── VPlatform2.txt ├── VPropeller.txt ├── WFZInvBlock.txt ├── WFZSetup.txt └── WindCurrent.txt /.editorconfig: -------------------------------------------------------------------------------- 1 | # top-most EditorConfig file 2 | root = true 3 | 4 | # enforce our RetroScript needs here 5 | [*.txt] 6 | end_of_line = crlf 7 | indent_style = tab 8 | indent_size = 4 9 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # default behaviour 2 | * text=auto 3 | 4 | # S1/2 Script files must ALWAYS use crlf line endings 5 | *.txt text eol=crlf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RSDKv4 Script Decompilation 2 | 3 | A full decompilation for the scripts in Sonic 1 & 2's 2013 mobile remakes. 4 | 5 | These scripts have been manually reverted back to what the original scripts could've looked like. This means that: 6 | * Function IDs have been recoverted back to proper function names 7 | * Functions are in the proper order 8 | * Default aliases have been re-added where possible 9 | * Re-added static variables and tables 10 | * Added editor renders and variables for (almost) every object 11 | * Origins code has been included via the use of `#platform:` markers 12 | 13 | Some portions of the code have been slightly modified for compatibility purposes. 14 | 15 | To use these scripts in mods: 16 | * RSDKv4/RSDKv5U Decompilation: Extract the `Scripts` folder to the exe's root directory: eg `[rootdir]/Scripts/`. 17 | * Sonic Origins (Requires [Hedge Mod Manager](https://github.com/thesupersonic16/HedgeModManager)): 18 | * Navigate to the game's executable directory. The easy way to get to it is by clicking `Open Game Directory` in the Settings tab of Hedge Mod Manager. 19 | * Once you're there, extract the `Scripts` folder into a folder named `Sonic1u` or `Sonic2u` in the exe's root directory: eg `[rootdir]/Sonic1u/Scripts/`. 20 | 21 | Make sure you use the appropriate Scripts folder for the game you're trying to run. 22 | Mods are only required to include the scripts that have been changed. 23 | 24 | For anyone curious about how RSDKv4's scripting language works, check out the handbook (RetroScript Handbook v4.pdf) we made to help get people into using RetroScript v4. We recommend downloading the handbook as it makes it easier to navigate. 25 | -------------------------------------------------------------------------------- /RetroScript Handbook v4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RSDKModding/RSDKv4-Script-Decompilation/3e47808da0d4868b6616f154d87753402bf3a6a9/RetroScript Handbook v4.pdf -------------------------------------------------------------------------------- /Sonic 1/Scripts/Continue/Spotlight.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Spotlight Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectUpdate 13 | // Empty event, it exists but there's nothing in it 14 | end event 15 | 16 | 17 | event ObjectDraw 18 | DrawSprite(0) 19 | end event 20 | 21 | 22 | event ObjectStartup 23 | LoadSpriteSheet("Special/Objects.gif") 24 | 25 | // 0 - Spotlight Frame 26 | SpriteFrame(-24, -6, 48, 13, 350, 376) 27 | 28 | foreach (TypeName[Spotlight], arrayPos0, ALL_ENTITIES) 29 | object[arrayPos0].drawOrder = 3 30 | 31 | // Move the Spotlight to the middle of the screen 32 | object[arrayPos0].xpos = screen.xcenter 33 | object[arrayPos0].xpos <<= 16 34 | 35 | if object[1].type != TypeName[Blank Object] 36 | // If there's a second player, move the spotlights to make room for two 37 | if object[arrayPos0].propertyValue == 0 38 | object[arrayPos0].xpos += 0x200000 39 | else 40 | object[arrayPos0].xpos -= 0x200000 41 | end if 42 | end if 43 | next 44 | end event 45 | 46 | 47 | // ======================== 48 | // Editor Events 49 | // ======================== 50 | 51 | event RSDKDraw 52 | DrawSprite(0) 53 | end event 54 | 55 | 56 | event RSDKLoad 57 | LoadSpriteSheet("Special/Objects.gif") 58 | SpriteFrame(-24, -6, 48, 13, 350, 376) 59 | 60 | SetVariableAlias(ALIAS_VAR_PROPVAL, "playerID") 61 | end event 62 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/Enemies/NewtronShot.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Newtron Shot Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectUpdate 20 | object.xpos += object.xvel 21 | 22 | object.frame = object.timer 23 | object.frame >>= 1 24 | object.timer++ 25 | object.timer &= 3 26 | 27 | if object.outOfBounds == true 28 | object.type = TypeName[Blank Object] 29 | end if 30 | 31 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 32 | BoxCollisionTest(C_TOUCH, object.entityPos, -6, -6, 6, 6, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 33 | if checkResult == true 34 | CallFunction(Player_ProjectileHit) 35 | end if 36 | next 37 | end event 38 | 39 | 40 | event ObjectDraw 41 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 42 | end event 43 | 44 | 45 | event ObjectStartup 46 | CheckCurrentStageFolder("Zone01") 47 | if checkResult == true 48 | LoadSpriteSheet("GHZ/Objects.gif") 49 | SpriteFrame(-6, -6, 12, 12, 160, 111) 50 | SpriteFrame(-6, -6, 12, 12, 173, 111) 51 | end if 52 | 53 | CheckCurrentStageFolder("Zone07") 54 | if checkResult == true 55 | // Check if in MBZ and then... load GHZ sprites? 56 | // Likely an error, the given numbers match up with the MBZ sheet 57 | LoadSpriteSheet("GHZ/Objects.gif") 58 | SpriteFrame(-8, -8, 16, 16, 35, 51) 59 | SpriteFrame(-8, -8, 16, 16, 52, 51) 60 | end if 61 | end event 62 | 63 | 64 | // ======================== 65 | // Editor Events 66 | // ======================== 67 | 68 | event RSDKDraw 69 | DrawSprite(0) 70 | end event 71 | 72 | 73 | event RSDKLoad 74 | CheckCurrentStageFolder("Zone07") 75 | if checkResult == true 76 | // Decomp note - using the proper sheet here instead of the GHZ one 77 | LoadSpriteSheet("MBZ/Objects.gif") 78 | SpriteFrame(-8, -8, 16, 16, 35, 51) 79 | else 80 | LoadSpriteSheet("GHZ/Objects.gif") 81 | SpriteFrame(-6, -6, 12, 12, 160, 111) 82 | end if 83 | 84 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 85 | end event 86 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/GHZ/BossChain.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Boss Chain Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectDraw 13 | // Movement is handled by parent boss object, so all this object needs to do is just draw 14 | DrawSprite(0) 15 | end event 16 | 17 | 18 | event ObjectStartup 19 | LoadSpriteSheet("GHZ/Objects.gif") 20 | 21 | // Chain frames - only a single sprite 22 | SpriteFrame(-8, -8, 16, 16, 101, 1) 23 | end event 24 | 25 | 26 | // ======================== 27 | // Editor Events 28 | // ======================== 29 | 30 | event RSDKDraw 31 | DrawSprite(0) 32 | end event 33 | 34 | 35 | event RSDKLoad 36 | LoadSpriteSheet("GHZ/Objects.gif") 37 | SpriteFrame(-8, -8, 16, 16, 101, 1) 38 | 39 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 40 | end event 41 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/GHZ/BossLights.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Boss Lights Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectDraw 20 | temp0 = object.timer 21 | temp0 >>= 3 22 | 23 | object.timer++ 24 | object.timer &= 15 25 | 26 | DrawSprite(temp0) 27 | end event 28 | 29 | 30 | event ObjectStartup 31 | LoadSpriteSheet("Global/Eggman.gif") 32 | 33 | // Light frames 34 | SpriteFrame(-8, -5, 16, 13, 196, 24) 35 | SpriteFrame(-8, -5, 16, 13, 196, 38) 36 | end event 37 | 38 | 39 | // ======================== 40 | // Editor Events 41 | // ======================== 42 | 43 | event RSDKDraw 44 | DrawSprite(0) 45 | end event 46 | 47 | 48 | event RSDKLoad 49 | LoadSpriteSheet("Global/Eggman.gif") 50 | SpriteFrame(-8, -5, 16, 13, 196, 24) 51 | 52 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 53 | end event 54 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/GHZ/Rock.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Rock Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Function Declarations 10 | // ======================== 11 | 12 | reserve function Rock_DebugDraw 13 | reserve function Rock_DebugSpawn 14 | 15 | 16 | // ======================== 17 | // Function Definitions 18 | // ======================== 19 | 20 | private function Rock_DebugDraw 21 | DrawSprite(0) 22 | end function 23 | 24 | 25 | private function Rock_DebugSpawn 26 | CreateTempObject(TypeName[Rock], 0, object.xpos, object.ypos) 27 | end function 28 | 29 | 30 | // ======================== 31 | // Events 32 | // ======================== 33 | 34 | event ObjectUpdate 35 | // Rocks don't do much, just check interaction with players 36 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 37 | BoxCollisionTest(C_SOLID, object.entityPos, -16, -16, 16, 16, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 38 | next 39 | end event 40 | 41 | 42 | event ObjectDraw 43 | DrawSprite(0) 44 | end event 45 | 46 | 47 | event ObjectStartup 48 | LoadSpriteSheet("GHZ/Objects.gif") 49 | SpriteFrame(-24, -16, 48, 32, 1, 18) 50 | 51 | SetTableValue(TypeName[Rock], DebugMode_ObjCount, DebugMode_TypesTable) 52 | SetTableValue(Rock_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable) 53 | SetTableValue(Rock_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable) 54 | DebugMode_ObjCount++ 55 | end event 56 | 57 | 58 | // ======================== 59 | // Editor Events 60 | // ======================== 61 | 62 | event RSDKDraw 63 | DrawSprite(0) 64 | end event 65 | 66 | 67 | event RSDKLoad 68 | LoadSpriteSheet("GHZ/Objects.gif") 69 | SpriteFrame(-24, -16, 48, 32, 1, 18) 70 | 71 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 72 | end event 73 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/GHZ/WaterfallSound.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Waterfall Sound Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | // A pair of unused values, reset once then never seen again... 13 | // -> Bit of a shot in the dark, but these may have been early versions of the 14 | // GHZSetup static values before the waterfall sound system got reworked 15 | // - This coincides with how the rest of GHZ is formatted like RSDKv3 scripts as well, 16 | // given that static variables didn't exist back then 17 | private alias object.value0 : object.unused1 18 | private alias object.value1 : object.unused2 19 | 20 | // Player Aliases 21 | private alias object.xpos : player.xpos 22 | 23 | 24 | // ======================== 25 | // Events 26 | // ======================== 27 | 28 | event ObjectUpdate 29 | object.priority = PRIORITY_ACTIVE 30 | 31 | GHZSetup_playWaterfallSfx = true 32 | 33 | // Check if the object is out of bounds 34 | temp0 = camera[0].xpos 35 | temp0 -= object.ixpos 36 | Abs(temp0) 37 | temp0 -= 128 38 | if temp0 > screen.xcenter 39 | object.priority = PRIORITY_XBOUNDS 40 | // these aren't used anywhere else... 41 | object.unused1 = 0 42 | object.unused2 = 0 43 | end if 44 | 45 | // Make the SFX pan relative to player 1's position 46 | GHZSetup_waterfallPan = object.xpos 47 | GHZSetup_waterfallPan -= player[0].xpos 48 | GHZSetup_waterfallPan >>= 18 49 | end event 50 | 51 | 52 | event ObjectStartup 53 | foreach (TypeName[Waterfall Sound], arrayPos0, ALL_ENTITIES) 54 | object[arrayPos0].priority = PRIORITY_XBOUNDS 55 | next 56 | end event 57 | 58 | 59 | // ======================== 60 | // Editor Events 61 | // ======================== 62 | 63 | event RSDKDraw 64 | DrawSprite(0) 65 | end event 66 | 67 | 68 | event RSDKLoad 69 | LoadSpriteSheet("Global/Display.gif") 70 | SpriteFrame(-8, -8, 16, 16, 165, 141) // small "W" 71 | 72 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 73 | end event 74 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/Global/BlueShield.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Blue Shield Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | // Player Aliases 15 | private alias object.state : player.state 16 | private alias object.xpos : player.xpos 17 | private alias object.ypos : player.ypos 18 | 19 | private alias -1 : DRAWORDER_PLAYER 20 | 21 | // Super States 22 | private alias 1 : SUPERSTATE_SUPER 23 | 24 | 25 | // ======================== 26 | // Events 27 | // ======================== 28 | 29 | event ObjectUpdate 30 | object.drawOrder = DRAWORDER_PLAYER 31 | 32 | // Dead player shouldn't have any shield 33 | if player[-playerCount].state == Player_State_Death 34 | object.type = TypeName[Blank Object] 35 | end if 36 | 37 | // Drowned player shouldn't have any shield, either 38 | if player[-playerCount].state == Player_State_Drown 39 | object.type = TypeName[Blank Object] 40 | end if 41 | 42 | // Update the object's animation 43 | object.timer++ 44 | if object.timer == 2 45 | object.timer = 0 46 | object.frame++ 47 | if object.frame > 5 48 | object.frame = 0 49 | end if 50 | end if 51 | end event 52 | 53 | 54 | event ObjectDraw 55 | // Super characters shouldn't have shields 56 | // Object isn't just erased in case the player untransforms 57 | if Player_superState != SUPERSTATE_SUPER 58 | DrawSpriteFX(object.frame, FX_INK, player[-playerCount].xpos, player[-playerCount].ypos) 59 | end if 60 | end event 61 | 62 | 63 | event ObjectStartup 64 | LoadSpriteSheet("Global/Items2.gif") 65 | 66 | // Shield frames 67 | SpriteFrame(-24, -24, 48, 48, 109, 196) 68 | SpriteFrame(0, 0, 0, 0, 109, 196) 69 | SpriteFrame(-24, -24, 48, 48, 158, 196) 70 | SpriteFrame(0, 0, 0, 0, 109, 196) 71 | SpriteFrame(-24, -24, 48, 48, 207, 196) 72 | SpriteFrame(0, 0, 0, 0, 109, 196) 73 | end event 74 | 75 | 76 | // ======================== 77 | // Editor Events 78 | // ======================== 79 | 80 | event RSDKDraw 81 | DrawSprite(0) 82 | end event 83 | 84 | 85 | event RSDKLoad 86 | LoadSpriteSheet("Global/Items2.gif") 87 | SpriteFrame(-24, -24, 48, 48, 109, 196) 88 | 89 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 90 | end event 91 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/Global/BlueShield2.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Blue Shield 2 Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | // Player Aliases 15 | private alias object.state : player.state 16 | private alias object.xpos : player.xpos 17 | private alias object.ypos : player.ypos 18 | 19 | private alias -1 : DRAWORDER_PLAYER 20 | 21 | // Super States 22 | private alias 1 : SUPERSTATE_SUPER 23 | 24 | 25 | // ======================== 26 | // Events 27 | // ======================== 28 | 29 | event ObjectUpdate 30 | object.drawOrder = DRAWORDER_PLAYER 31 | 32 | // Dead players shouldn't have any shields 33 | if player[-playerCount].state == Player_State_Death 34 | object.type = TypeName[Blank Object] 35 | end if 36 | 37 | // No shields here, either 38 | if player[-playerCount].state == Player_State_Drown 39 | object.type = TypeName[Blank Object] 40 | end if 41 | 42 | // Update the object's animation 43 | object.frame = object.timer 44 | object.frame >>= 1 45 | 46 | object.timer++ 47 | object.timer %= 10 48 | end event 49 | 50 | 51 | event ObjectDraw 52 | // Super characters shouldn't have shields 53 | if Player_superState != SUPERSTATE_SUPER 54 | DrawSpriteFX(object.frame, FX_INK, player[-playerCount].xpos, player[-playerCount].ypos) 55 | DrawSpriteFX(5, FX_INK, player[-playerCount].xpos, player[-playerCount].ypos) 56 | end if 57 | end event 58 | 59 | 60 | event ObjectStartup 61 | LoadSpriteSheet("Global/Items.gif") 62 | 63 | // Shield frames 64 | SpriteFrame(-16, -16, 32, 32, 18, 34) // 0 65 | SpriteFrame(-16, -16, 32, 32, 18, 67) // 1 66 | SpriteFrame(-16, -16, 32, 32, 85, 27) // 2 67 | SpriteFrame(-16, -16, 32, 32, 85, 60) // 3 68 | SpriteFrame(-16, -16, 32, 32, 85, 93) // 4 69 | SpriteFrame(-24, -24, 48, 48, 35, 117) // Center circle thing that always gets drawn 70 | end event 71 | 72 | 73 | // ======================== 74 | // Editor Events 75 | // ======================== 76 | 77 | event RSDKDraw 78 | DrawSprite(0) 79 | DrawSprite(1) 80 | end event 81 | 82 | 83 | event RSDKLoad 84 | LoadSpriteSheet("Global/Items.gif") 85 | SpriteFrame(-16, -16, 32, 32, 18, 34) 86 | SpriteFrame(-24, -24, 48, 48, 35, 117) 87 | 88 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 89 | end event 90 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/Global/Explosion.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Explosion Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | 15 | event ObjectUpdate 16 | object.timer++ 17 | if object.timer > 7 18 | object.timer = 0 19 | 20 | object.frame++ 21 | if object.frame > 4 22 | object.type = TypeName[Blank Object] 23 | object.frame = 0 24 | end if 25 | end if 26 | end event 27 | 28 | 29 | event ObjectDraw 30 | DrawSprite(object.frame) 31 | end event 32 | 33 | 34 | event ObjectStartup 35 | LoadSpriteSheet("Global/Items2.gif") 36 | 37 | // Explosion frames 38 | SpriteFrame(-16, -8, 32, 16, 1, 1) 39 | SpriteFrame(-16, -16, 32, 32, 1, 84) 40 | SpriteFrame(-16, -16, 32, 32, 1, 117) 41 | SpriteFrame(-20, -20, 40, 40, 34, 1) 42 | SpriteFrame(-20, -20, 40, 40, 34, 42) 43 | end event 44 | 45 | 46 | event RSDKDraw 47 | DrawSprite(0) 48 | end event 49 | 50 | 51 | event RSDKLoad 52 | LoadSpriteSheet("Global/Items2.gif") 53 | SpriteFrame(-16, -16, 32, 32, 1, 84) 54 | 55 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 56 | end event 57 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/Global/LightningSpark.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Lightning Spark Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value18 : player.currentPlane 13 | 14 | event ObjectUpdate 15 | // Match the player's visual plane 16 | object.drawOrder = player[0].currentPlane 17 | 18 | object.xpos += object.xvel 19 | object.ypos += object.yvel 20 | 21 | // Cycle through 3 frames 22 | object.frame++ 23 | if object.frame >= 3 24 | object.frame = 0 25 | end if 26 | 27 | object.animationTimer++ 28 | 29 | // Unload after ~half a second 30 | if object.animationTimer >= 22 31 | object.type = TypeName[Blank Object] 32 | end if 33 | end event 34 | 35 | 36 | event ObjectDraw 37 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 38 | end event 39 | 40 | 41 | event ObjectStartup 42 | LoadSpriteSheet("Global/Items3.gif") 43 | SpriteFrame(0, 0, 1, 1, 1, 1) 44 | SpriteFrame(-3, -3, 6, 6, 150, 84) 45 | SpriteFrame(-8, -8, 16, 16, 157, 84) 46 | end event 47 | 48 | 49 | event RSDKDraw 50 | DrawSprite(0) 51 | end event 52 | 53 | 54 | event RSDKLoad 55 | LoadSpriteSheet("Global/Items3.gif") 56 | SpriteFrame(-8, -8, 16, 16, 157, 84) 57 | 58 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 59 | end event 60 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/Global/ObjectScore.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Object Score Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | event ObjectUpdate 15 | object.ypos -= 0x20000 16 | object.timer++ 17 | if object.timer == 24 18 | object.type = TypeName[Blank Object] 19 | end if 20 | end event 21 | 22 | 23 | event ObjectDraw 24 | #platform: USE_ORIGINS 25 | if game.playMode == BOOT_PLAYMODE_MIRRORING 26 | object.direction = FACING_LEFT 27 | DrawSpriteFX(object.propertyValue, FX_FLIP, object.xpos, object.ypos) 28 | else 29 | DrawSprite(object.propertyValue) 30 | end if 31 | #endplatform 32 | 33 | #platform: USE_STANDALONE 34 | DrawSprite(object.propertyValue) 35 | #endplatform 36 | end event 37 | 38 | 39 | event ObjectStartup 40 | LoadSpriteSheet("Global/Items.gif") 41 | 42 | SpriteFrame(-6, 0, 14, 8, 193, 226) 43 | SpriteFrame(-7, 0, 15, 8, 240, 197) 44 | SpriteFrame(-7, 0, 15, 8, 224, 197) 45 | SpriteFrame(-9, 0, 19, 8, 193, 226) 46 | SpriteFrame(-9, 0, 19, 8, 193, 226) 47 | SpriteFrame(-9, 0, 19, 8, 193, 226) 48 | SpriteFrame(-9, 0, 19, 8, 193, 226) 49 | SpriteFrame(-9, 0, 19, 8, 193, 226) 50 | SpriteFrame(-9, 0, 19, 8, 193, 226) 51 | SpriteFrame(-9, 0, 19, 8, 193, 226) 52 | SpriteFrame(-9, 0, 19, 8, 193, 226) 53 | SpriteFrame(-9, 0, 19, 8, 193, 226) 54 | SpriteFrame(-9, 0, 19, 8, 193, 226) 55 | SpriteFrame(-9, 0, 19, 8, 193, 226) 56 | SpriteFrame(-9, 0, 19, 8, 193, 226) 57 | SpriteFrame(-12, 0, 24, 8, 193, 226) 58 | SpriteFrame(-4, 0, 9, 8, 193, 226) 59 | end event 60 | 61 | 62 | event RSDKDraw 63 | DrawSprite(0) 64 | end event 65 | 66 | 67 | event RSDKLoad 68 | LoadSpriteSheet("Global/Items.gif") 69 | SpriteFrame(-6, 0, 14, 8, 193, 226) 70 | 71 | // used in-game, but shouldn't be placed in editor so 72 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 73 | end event 74 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/Global/RingSparkle.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Ring Sparkle Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | // Ring Reset (Mission Object) Aliases 15 | private alias object.value0 : object.timeCheckpoint 16 | private alias object.value2 : object.missionTypeEX 17 | 18 | private alias 10 : MISSIONNO_RINGCHALLENGE50 19 | 20 | 21 | // ======================== 22 | // Events 23 | // ======================== 24 | 25 | event ObjectUpdate 26 | object.timer++ 27 | if object.timer == 6 28 | object.timer = 0 29 | object.frame++ 30 | 31 | if object.frame == 4 32 | object.type = TypeName[Blank Object] 33 | object.frame = 0 34 | 35 | #platform: USE_ORIGINS 36 | if game.playMode == BOOT_PLAYMODE_MISSION 37 | if game.missionFunctionNo == MISSIONNO_RINGCHALLENGE50 38 | // Turn the Object into a Ring Reset Object 39 | // -> missionTypeEX is set by a foreach in Ring Reset's startup 40 | object.type = object.missionTypeEX 41 | 42 | // Now, set the time the Object was collected + 20 seconds 43 | object.timeCheckpoint = stage.minutes 44 | object.timeCheckpoint *= 60 45 | object.timeCheckpoint += stage.seconds 46 | object.timeCheckpoint += 20 47 | 48 | object.priority = PRIORITY_ACTIVE 49 | end if 50 | end if 51 | #endplatform 52 | end if 53 | end if 54 | end event 55 | 56 | 57 | event ObjectDraw 58 | DrawSprite(object.frame) 59 | end event 60 | 61 | 62 | event ObjectStartup 63 | LoadSpriteSheet("Global/Items.gif") 64 | 65 | // Sparkle frames 66 | SpriteFrame(-8, -8, 16, 16, 1, 202) 67 | SpriteFrame(-8, -8, 16, 16, 18, 202) 68 | SpriteFrame(-8, -8, 16, 16, 1, 219) 69 | SpriteFrame(-8, -8, 16, 16, 18, 219) 70 | end event 71 | 72 | 73 | // ======================== 74 | // Editor Events 75 | // ======================== 76 | 77 | event RSDKDraw 78 | DrawSprite(0) 79 | end event 80 | 81 | 82 | event RSDKLoad 83 | LoadSpriteSheet("Global/Items.gif") 84 | SpriteFrame(-8, -8, 16, 16, 1, 202) // * Sparkle * 85 | 86 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 87 | end event 88 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/Global/SmokePuff.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Smoke Puff Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | event ObjectUpdate 15 | object.timer++ 16 | 17 | if object.timer > 7 18 | object.timer = 0 19 | object.frame++ 20 | 21 | if object.frame > 4 22 | object.type = TypeName[Blank Object] 23 | object.frame = 0 24 | end if 25 | end if 26 | end event 27 | 28 | 29 | event ObjectDraw 30 | DrawSprite(object.frame) 31 | end event 32 | 33 | 34 | event ObjectStartup 35 | LoadSpriteSheet("Global/Items2.gif") 36 | 37 | // Puff frames 38 | SpriteFrame(-16, -8, 32, 16, 1, 1) 39 | SpriteFrame(-16, -16, 32, 32, 1, 18) 40 | SpriteFrame(-16, -16, 32, 32, 1, 51) 41 | SpriteFrame(-20, -20, 40, 40, 34, 1) 42 | SpriteFrame(-20, -20, 40, 40, 34, 42) 43 | 44 | end event 45 | 46 | 47 | event RSDKDraw 48 | DrawSprite(0) 49 | end event 50 | 51 | 52 | event RSDKLoad 53 | LoadSpriteSheet("Global/Items2.gif") 54 | SpriteFrame(-16, -16, 32, 32, 1, 18) 55 | 56 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 57 | end event 58 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/LZ/GargoyleShot.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Gargoyle Shot Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | // Path ID Aliases 15 | private alias 0 : PATH_A 16 | 17 | 18 | // ======================== 19 | // Events 20 | // ======================== 21 | 22 | event ObjectUpdate 23 | object.xpos += object.xvel 24 | 25 | if object.xvel < 0 26 | ObjectTileCollision(CSIDE_RWALL, -8, 4, PATH_A) 27 | else 28 | ObjectTileCollision(CSIDE_LWALL, 8, 4, PATH_A) 29 | end if 30 | 31 | if checkResult == true 32 | object.type = TypeName[Blank Object] 33 | end if 34 | 35 | if object.timer < 16 36 | object.timer++ 37 | else 38 | object.drawOrder = 3 39 | end if 40 | 41 | object.frame = oscillation 42 | object.frame >>= 3 43 | object.frame &= 1 44 | 45 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 46 | BoxCollisionTest(C_TOUCH, object.entityPos, -4, -4, 4, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 47 | if checkResult == true 48 | CallFunction(Player_FireHit) 49 | end if 50 | next 51 | end event 52 | 53 | 54 | event ObjectDraw 55 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 56 | end event 57 | 58 | 59 | event ObjectStartup 60 | LoadSpriteSheet("LZ/Objects.gif") 61 | 62 | SpriteFrame(-8, -3, 15, 6, 127, 124) 63 | SpriteFrame(-8, -3, 15, 6, 127, 131) 64 | end event 65 | 66 | 67 | // ======================== 68 | // Editor Events 69 | // ======================== 70 | 71 | event RSDKDraw 72 | DrawSprite(0) 73 | end event 74 | 75 | 76 | event RSDKLoad 77 | LoadSpriteSheet("LZ/Objects.gif") 78 | SpriteFrame(-8, -3, 15, 6, 127, 124) 79 | end event 80 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/LZ/SolidBlock.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Solid Block Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Function Declarations 10 | // ======================== 11 | 12 | reserve function SolidBlock_DebugDraw 13 | reserve function SolidBlock_DebugSpawn 14 | 15 | 16 | // ======================== 17 | // Function Definitions 18 | // ======================== 19 | 20 | private function SolidBlock_DebugDraw 21 | DrawSprite(0) 22 | end function 23 | 24 | 25 | private function SolidBlock_DebugSpawn 26 | CreateTempObject(TypeName[Solid Block], 0, object.xpos, object.ypos) 27 | end function 28 | 29 | 30 | // ======================== 31 | // Events 32 | // ======================== 33 | 34 | event ObjectUpdate 35 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 36 | BoxCollisionTest(C_SOLID, object.entityPos, -16, -16, 16, 16, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 37 | next 38 | end event 39 | 40 | 41 | event ObjectDraw 42 | DrawSprite(0) 43 | end event 44 | 45 | 46 | event ObjectStartup 47 | LoadSpriteSheet("LZ/Objects.gif") 48 | SpriteFrame(-16, -16, 32, 32, 1, 18) 49 | 50 | SetTableValue(TypeName[Solid Block], DebugMode_ObjCount, DebugMode_TypesTable) 51 | SetTableValue(SolidBlock_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable) 52 | SetTableValue(SolidBlock_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable) 53 | DebugMode_ObjCount++ 54 | end event 55 | 56 | 57 | // ======================== 58 | // Editor Events 59 | // ======================== 60 | 61 | event RSDKDraw 62 | DrawSprite(0) 63 | end event 64 | 65 | 66 | event RSDKLoad 67 | LoadSpriteSheet("LZ/Objects.gif") 68 | SpriteFrame(-16, -16, 32, 32, 1, 18) 69 | 70 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 71 | end event 72 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/LZ/VerticalWrap.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Vertical Wrap Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.yvel : player.yvel 13 | private alias object.ypos : player.ypos 14 | 15 | 16 | // ======================== 17 | // Events 18 | // ======================== 19 | 20 | event ObjectUpdate 21 | // First, check for bottom->top wrap 22 | if player[0].yvel >= 0 23 | if camera[0].ypos >= 2168 24 | temp1 = player[0].ypos 25 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 26 | temp0 = player[currentPlayer].ypos 27 | temp0 -= temp1 28 | Abs(temp0) 29 | if temp0 < 0x8C0000 30 | player[currentPlayer].ypos -= 0x8000000 31 | end if 32 | next 33 | camera[0].ypos -= 0x800 34 | screen.yoffset -= 0x800 35 | end if 36 | end if 37 | 38 | // Then, check for top->bottom wrap 39 | if player[0].yvel <= 0 40 | if camera[0].ypos <= 120 41 | temp1 = player[0].ypos 42 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 43 | temp0 = player[currentPlayer].ypos 44 | temp0 -= temp1 45 | Abs(temp0) 46 | if temp0 < 0x8C0000 47 | player[currentPlayer].ypos += 0x8000000 48 | end if 49 | next 50 | camera[0].ypos += 0x800 51 | screen.yoffset += 0x800 52 | end if 53 | end if 54 | end event 55 | 56 | 57 | // ======================== 58 | // Editor Events 59 | // ======================== 60 | 61 | event RSDKDraw 62 | DrawSprite(0) 63 | end event 64 | 65 | 66 | event RSDKLoad 67 | LoadSpriteSheet("Global/Display.gif") 68 | SpriteFrame(-8, -8, 16, 16, 239, 239) // "Trigger" - #0 69 | 70 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 71 | end event 72 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/LZ/WaterSplash.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Water Splash Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectUpdate 20 | // Hover above the water surface 21 | object.iypos = stage.waterLevel 22 | 23 | object.timer++ 24 | if object.timer > 5 25 | object.timer = 0 26 | object.frame++ 27 | if object.frame > 2 28 | object.type = TypeName[Blank Object] 29 | end if 30 | end if 31 | end event 32 | 33 | 34 | event ObjectDraw 35 | DrawSprite(object.frame) 36 | end event 37 | 38 | 39 | event ObjectStartup 40 | LoadSpriteSheet("LZ/Objects.gif") 41 | 42 | SpriteFrame(-10, -12, 20, 12, 202, 76) 43 | SpriteFrame(-15, -30, 30, 30, 159, 59) 44 | SpriteFrame(-16, -32, 32, 32, 190, 43) 45 | end event 46 | 47 | 48 | // ======================== 49 | // Editor Events 50 | // ======================== 51 | 52 | event RSDKDraw 53 | DrawSprite(0) 54 | end event 55 | 56 | 57 | event RSDKLoad 58 | LoadSpriteSheet("LZ/Objects.gif") 59 | SpriteFrame(-10, -12, 20, 12, 202, 76) 60 | 61 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 62 | end event 63 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/LZ/Wheel.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Wheel Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.beltDir 13 | 14 | 15 | // ======================== 16 | // Function Declarations 17 | // ======================== 18 | 19 | reserve function Wheel_DebugDraw 20 | reserve function Wheel_DebugSpawn 21 | 22 | 23 | // ======================== 24 | // Function Definitions 25 | // ======================== 26 | 27 | private function Wheel_DebugDraw 28 | DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos) 29 | end function 30 | 31 | 32 | private function Wheel_DebugSpawn 33 | CreateTempObject(TypeName[Wheel], 0, object.xpos, object.ypos) 34 | object[tempObjectPos].drawOrder = 4 35 | end function 36 | 37 | 38 | // ======================== 39 | // Events 40 | // ======================== 41 | 42 | event ObjectUpdate 43 | if object.beltDir != LZSetup_beltDirection 44 | object.direction ^= 1 45 | object.beltDir = LZSetup_beltDirection 46 | temp2 = 1 47 | else 48 | object.frame = oscillation 49 | object.frame >>= 2 50 | object.frame &= 3 51 | if object.direction == 1 52 | object.frame ^= 3 53 | end if 54 | end if 55 | end event 56 | 57 | 58 | event ObjectDraw 59 | DrawSprite(object.frame) 60 | end event 61 | 62 | 63 | event ObjectStartup 64 | LoadSpriteSheet("LZ/Objects.gif") 65 | SpriteFrame(-16, -16, 32, 32, 223, 22) 66 | SpriteFrame(-16, -16, 32, 32, 223, 55) 67 | SpriteFrame(-16, -16, 32, 32, 223, 88) 68 | SpriteFrame(-16, -16, 32, 32, 223, 121) 69 | 70 | foreach (TypeName[Wheel], arrayPos0, ALL_ENTITIES) 71 | object[arrayPos0].drawOrder = 4 72 | next 73 | 74 | SetTableValue(TypeName[Wheel], DebugMode_ObjCount, DebugMode_TypesTable) 75 | SetTableValue(Wheel_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable) 76 | SetTableValue(Wheel_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable) 77 | DebugMode_ObjCount++ 78 | end event 79 | 80 | 81 | // ======================== 82 | // Editor Events 83 | // ======================== 84 | 85 | event RSDKDraw 86 | DrawSprite(0) 87 | end event 88 | 89 | 90 | event RSDKLoad 91 | LoadSpriteSheet("LZ/Objects.gif") 92 | SpriteFrame(-16, -16, 32, 32, 223, 22) 93 | 94 | // 127 in the scene, doesn't seem to do anything though 95 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 96 | end event 97 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/MZ/LavaSplash.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Lava Splash Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | private alias 0 : LAVASPLASH_START 15 | private alias 1 : LAVASPLASH_MAIN 16 | 17 | event ObjectUpdate 18 | switch object.state 19 | case LAVASPLASH_START 20 | object.frame = object.animationTimer 21 | object.frame /= 3 22 | object.animationTimer++ 23 | if object.animationTimer == 6 24 | object.animationTimer = 0 25 | object.timer++ 26 | if object.timer == 6 27 | object.timer = 0 28 | object.state++ 29 | end if 30 | end if 31 | break 32 | 33 | case LAVASPLASH_MAIN 34 | object.frame = object.animationTimer 35 | object.frame /= 3 36 | object.frame += 2 37 | object.animationTimer++ 38 | if object.animationTimer == 6 39 | object.animationTimer = 0 40 | object.timer++ 41 | if object.timer == 2 42 | object.type = TypeName[Blank Object] 43 | end if 44 | end if 45 | break 46 | 47 | end switch 48 | end event 49 | 50 | 51 | event ObjectDraw 52 | DrawSprite(object.frame) 53 | end event 54 | 55 | 56 | event ObjectStartup 57 | LoadSpriteSheet("MZ/Objects.gif") 58 | SpriteFrame(-56, -18, 112, 30, 288, 332) 59 | SpriteFrame(-55, -18, 110, 30, 401, 332) 60 | SpriteFrame(-24, -18, 48, 30, 268, 1) 61 | SpriteFrame(-23, -18, 46, 30, 270, 32) 62 | end event 63 | 64 | 65 | event RSDKDraw 66 | DrawSprite(0) 67 | end event 68 | 69 | 70 | event RSDKLoad 71 | LoadSpriteSheet("MZ/Objects.gif") 72 | SpriteFrame(-56, -18, 112, 30, 288, 332) 73 | SpriteFrame(-55, -18, 110, 30, 401, 332) 74 | SpriteFrame(-24, -18, 48, 30, 268, 1) 75 | SpriteFrame(-23, -18, 46, 30, 270, 32) 76 | 77 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 78 | end event 79 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/MZ/ShortcutCheck.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Shortcut Check Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | // Player Aliases 13 | private alias 0 : SLOT_PLAYER1 14 | 15 | // Achievement Aliases 16 | private alias 2 : ACHIEVEMENT_SECRETOFMZ 17 | 18 | 19 | // ======================== 20 | // Events 21 | // ======================== 22 | 23 | event ObjectUpdate 24 | // Check interaction with player 1 25 | BoxCollisionTest(C_TOUCH, object.entityPos, -16, -64, 16, 64, SLOT_PLAYER1, C_BOX, C_BOX, C_BOX, C_BOX) 26 | if checkResult == true 27 | if stage.debugMode == false 28 | // Grant the "Secret of Marble Zone" Achievement 29 | CallNativeFunction2(SetAchievement, ACHIEVEMENT_SECRETOFMZ, 100) 30 | end if 31 | 32 | // This object serves no purpose anymore, so we may as well clear it now 33 | object.type = TypeName[Blank Object] 34 | end if 35 | end event 36 | 37 | 38 | // ======================== 39 | // Editor Events 40 | // ======================== 41 | 42 | event RSDKDraw 43 | DrawSprite(0) 44 | 45 | if editor.showGizmos == true 46 | editor.drawingOverlay = true 47 | 48 | // Draw the sensor hitbox 49 | temp0 = 16; temp1 = 64; temp2 = 16; temp3 = 64; 50 | CallFunction(EditorHelpers_DrawHitbox) 51 | 52 | editor.drawingOverlay = false 53 | end if 54 | end event 55 | 56 | 57 | event RSDKLoad 58 | LoadSpriteSheet("Global/Display.gif") 59 | SpriteFrame(-8, -8, 16, 16, 239, 239) // "Trigger" 60 | 61 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 62 | end event 63 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/Mission/Boss3Safty.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Safty Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // This Object is used in Spring Yard's Boss Rush stage (BR3 - BR3Zone03) 9 | 10 | // ======================== 11 | // Aliases 12 | // ======================== 13 | 14 | // Player Aliases 15 | private alias object.iypos : player.iypos 16 | 17 | 18 | // ======================== 19 | // Events 20 | // ======================== 21 | 22 | event ObjectUpdate 23 | if game.missionCondition == MISSION_CONDITION_CLEAR 24 | // If the Boss is defeated, then make sure the Player doesn't fall through the floor and die 25 | if player[0].iypos >= 0x580 26 | player[0].iypos = 0x580 27 | end if 28 | end if 29 | end event 30 | 31 | 32 | // ======================== 33 | // Editor Events 34 | // ======================== 35 | 36 | event RSDKDraw 37 | DrawSprite(0) 38 | 39 | if editor.drawgizmos == true 40 | temp0 = object.xpos 41 | temp0 -= 0x200000 42 | 43 | editor.drawingOverlay = true 44 | 45 | // todo: idr if w/h is screen-space or not 46 | // this prolly doesn't work at all either 47 | DrawRectWorld(temp0, 0x5800000, 0x400000, 0x20000, 255, 0, 255, 255) 48 | DrawLine(object.xpos, object.ypos, object.xpos, 0x5800000, 255, 0, 255) 49 | 50 | editor.drawingOverlay = true 51 | end if 52 | end event 53 | 54 | 55 | event RSDKLoad 56 | LoadSpriteSheet("Global/Display.gif") 57 | SpriteFrame(-16, -16, 32, 32, 1, 143) 58 | 59 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 60 | end event 61 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/Mission/Gliding.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Gliding Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias 18 : MISSIONNO_AERIALATTACK 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectUpdate 20 | game.missionFunctionNo = MISSIONNO_AERIALATTACK 21 | object.type = TypeName[Blank Object] 22 | 23 | // This certainly could've just been done in just the ObjectStartup, but I suppose that was too much 24 | end event 25 | 26 | 27 | event ObjectStartup 28 | // Find all Gliding Objects in the level and make them always active 29 | foreach (TypeName[Gliding], arrayPos0, ALL_ENTITIES) 30 | object[arrayPos0].priority = PRIORITY_ACTIVE 31 | next 32 | end event 33 | 34 | 35 | // ======================== 36 | // Editor Events 37 | // ======================== 38 | 39 | event RSDKDraw 40 | DrawSprite(0) 41 | end event 42 | 43 | 44 | event RSDKLoad 45 | LoadSpriteSheet("Global/Display.gif") 46 | SpriteFrame(-16, -16, 32, 32, 1, 143) 47 | 48 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 49 | end event 50 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/Mission/ImmediateDeath.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: ImmediateDeath Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias 5 : PRIORITY_INACTIVE 13 | private alias 8 : MISSIONNO_MERCY 14 | 15 | 16 | // ======================== 17 | // Events 18 | // ======================== 19 | 20 | event ObjectStartup 21 | if stage.actNum == 1 22 | game.missionFunctionNo = MISSIONNO_MERCY 23 | game.missionValue = 0 24 | end if 25 | 26 | foreach (TypeName[ImmediateDeath], arrayPos0, ALL_ENTITIES) 27 | object[arrayPos0].priority = PRIORITY_INACTIVE 28 | next 29 | end event 30 | 31 | 32 | // ======================== 33 | // Editor Events 34 | // ======================== 35 | 36 | event RSDKDraw 37 | DrawSprite(0) 38 | end event 39 | 40 | 41 | event RSDKLoad 42 | LoadSpriteSheet("Global/Display.gif") 43 | SpriteFrame(-16, -16, 32, 32, 1, 143) 44 | 45 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 46 | end event 47 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/Mission/ReviveMotobug2.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Revive Motobug Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // This is just a blank script... 9 | 10 | // ======================== 11 | // Editor Events 12 | // ======================== 13 | 14 | event RSDKDraw 15 | DrawSprite(0) 16 | end event 17 | 18 | 19 | event RSDKLoad 20 | LoadSpriteSheet("Global/Display.gif") 21 | SpriteFrame(-16, -16, 32, 32, 1, 143) // Generic script box 22 | 23 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 24 | end event 25 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/Mission/RingReset.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: RingReset Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // This Object is used in Mission "Ring Challenge 50" - M014 - Mission_Zone04 9 | 10 | // ======================== 11 | // Aliases 12 | // ======================== 13 | 14 | private alias object.value0 : object.timeCheckpoint 15 | 16 | // Ring/Ring Sparkle Aliases 17 | private alias object.value2 : object.missionTypeEX 18 | 19 | private alias 10 : MISSIONNO_RINGCHALLENGE50 20 | 21 | 22 | // ======================== 23 | // Events 24 | // ======================== 25 | 26 | event ObjectUpdate 27 | // Make sure the Object is out of the Player's sight before doing anything 28 | if object.outOfBounds == true 29 | // First, get the total time 30 | temp0 = stage.minutes 31 | temp0 *= 60 32 | temp0 += stage.seconds 33 | 34 | // Then compare it to when this Ring was collected 35 | if temp0 >= object.timeCheckpoint 36 | // If enough time has lapsed, then turn this Object back into a Ring 37 | object.type = TypeName[Ring] 38 | 39 | // Reset the Object's values 40 | object.priority = PRIORITY_BOUNDS 41 | object.timeCheckpoint = 0 42 | end if 43 | end if 44 | end event 45 | 46 | 47 | event ObjectStartup 48 | // This Object should only be used in Act 1, Act 2 is "The One Ring" Mission where we, of course, don't want respawning rings 49 | if stage.actNum == 1 50 | game.missionFunctionNo = MISSIONNO_RINGCHALLENGE50 51 | 52 | // Set the RingReset Type ID in all the Ring Objects across the level 53 | temp0 = TypeName[RingReset] 54 | foreach (TypeName[Ring], arrayPos0, ALL_ENTITIES) 55 | object[arrayPos0].missionTypeEX = temp0 56 | next 57 | end if 58 | end event 59 | 60 | 61 | // ======================== 62 | // Editor Events 63 | // ======================== 64 | 65 | event RSDKDraw 66 | DrawSprite(0) 67 | end event 68 | 69 | 70 | event RSDKLoad 71 | LoadSpriteSheet("Global/Items.gif") 72 | SpriteFrame(-8, -8, 16, 16, 1, 1) 73 | 74 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 75 | end event 76 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/Mission/SetRingCount.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: SetRingCount Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.ringCount 13 | 14 | // Player Aliases 15 | private alias object.value0 : player.rings 16 | 17 | 18 | // ======================== 19 | // Events 20 | // ======================== 21 | 22 | event ObjectStartup 23 | temp0 = 0 24 | 25 | // Find all SetRingCount objects in the level, look at their held Ring Count 26 | foreach (TypeName[SetRingCount], arrayPos0, ALL_ENTITIES) 27 | if temp0 == 0 28 | temp0 = object[arrayPos0].ringCount 29 | end if 30 | next 31 | 32 | // And then give the Player as much rings as the Object demands 33 | if temp0 != 0 34 | player[0].rings = temp0 35 | end if 36 | end event 37 | 38 | 39 | // ======================== 40 | // Editor Events 41 | // ======================== 42 | 43 | event RSDKDraw 44 | DrawSprite(0) 45 | end event 46 | 47 | 48 | event RSDKLoad 49 | LoadSpriteSheet("Global/Items.gif") 50 | SpriteFrame(-8, -8, 16, 16, 1, 1) 51 | 52 | SetVariableAlias(ALIAS_VAR_VAL0, "ringCount") 53 | end event 54 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/SBZ/HCrushCover.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: H Crush Cover Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectDraw 13 | DrawSprite(object.propertyValue) 14 | end event 15 | 16 | 17 | event ObjectStartup 18 | LoadSpriteSheet("SBZ/Objects.gif") 19 | SpriteFrame(-8, -48, 16, 96, 107, 62) 20 | SpriteFrame(-16, -16, 32, 32, 50, 261) 21 | 22 | foreach (TypeName[H Crush Cover], arrayPos0, ALL_ENTITIES) 23 | object[arrayPos0].drawOrder = 5 24 | next 25 | end event 26 | 27 | 28 | // ======================== 29 | // Editor Events 30 | // ======================== 31 | 32 | event RSDKDraw 33 | DrawSprite(object.propertyValue) 34 | end event 35 | 36 | 37 | event RSDKLoad 38 | LoadSpriteSheet("SBZ/Objects.gif") 39 | SpriteFrame(-8, -48, 16, 96, 107, 62) 40 | SpriteFrame(-16, -16, 32, 32, 50, 261) 41 | 42 | SetVariableAlias(ALIAS_VAR_PROPVAL, "frameID") 43 | end event 44 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/SBZ/ObjectActivator.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Object Activator Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectUpdate 13 | object[-1].priority = PRIORITY_ACTIVE 14 | end event 15 | 16 | 17 | // ======================== 18 | // Editor Events 19 | // ======================== 20 | 21 | event RSDKDraw 22 | DrawSprite(0) 23 | 24 | if editor.showGizmos == true 25 | editor.drawingOverlay = true 26 | 27 | // Draw a line to the object that'll be activated 28 | 29 | DrawLine(object.xpos, object.ypos, object[-1].xpos, object[-1].ypos, 0xFF, 0xFF, 0x00) 30 | 31 | editor.drawingOverlay = false 32 | end if 33 | end event 34 | 35 | 36 | event RSDKLoad 37 | LoadSpriteSheet("Global/Display.gif") 38 | SpriteFrame(-8, -8, 16, 16, 239, 239) // "Trigger" - #0 39 | 40 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 41 | end event 42 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/SBZ/PlasmaEmitter.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Plasma Emitter Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | private alias object.state : object.emitting 14 | 15 | 16 | // ======================== 17 | // Tables 18 | // ======================== 19 | 20 | event ObjectUpdate 21 | if object.emitting == true 22 | object.animationTimer++ 23 | object.animationTimer &= 7 24 | object.frame = object.animationTimer 25 | object.frame >>= 1 26 | object.frame++ 27 | object.timer-- 28 | if object.timer <= 0 29 | object.emitting = false 30 | object.frame = 0 31 | object.animationTimer = 0 32 | end if 33 | 34 | temp0 = oscillation 35 | temp0 &= 15 36 | if temp0 == 0 37 | PlaySfx(SfxName[Electric Arc], false) 38 | end if 39 | end if 40 | 41 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 42 | BoxCollisionTest(C_SOLID, object.entityPos, -8, -24, 8, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 43 | next 44 | end event 45 | 46 | 47 | event ObjectDraw 48 | DrawSprite(object.frame) 49 | end event 50 | 51 | 52 | event ObjectStartup 53 | LoadSpriteSheet("SBZ/Objects.gif") 54 | SpriteFrame(-8, -8, 16, 16, 162, 397) 55 | SpriteFrame(-8, -8, 16, 16, 179, 397) 56 | SpriteFrame(-8, -8, 16, 16, 196, 397) 57 | SpriteFrame(-8, -8, 16, 16, 179, 397) 58 | SpriteFrame(-8, -8, 16, 16, 213, 397) 59 | foreach (TypeName[Plasma Emitter], arrayPos0, ALL_ENTITIES) 60 | object[arrayPos0].drawOrder = 4 61 | next 62 | end event 63 | 64 | 65 | // ======================== 66 | // Editor Events 67 | // ======================== 68 | 69 | event RSDKDraw 70 | DrawSprite(0) 71 | end event 72 | 73 | 74 | event RSDKLoad 75 | LoadSpriteSheet("SBZ/Objects.gif") 76 | SpriteFrame(-8, -8, 16, 16, 162, 397) 77 | 78 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 79 | end event 80 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/SBZ/RoofCover.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Roof Cover Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectDraw 13 | DrawSprite(object.propertyValue) 14 | end event 15 | 16 | 17 | event ObjectStartup 18 | LoadSpriteSheet("SBZ/Objects.gif") 19 | SpriteFrame(-64, -4, 128, 8, 2, 388) 20 | SpriteFrame(-64, -4, 128, 8, 130, 388) 21 | 22 | foreach (TypeName[Roof Cover], arrayPos0, ALL_ENTITIES) 23 | object[arrayPos0].drawOrder = 5 24 | next 25 | end event 26 | 27 | 28 | // ======================== 29 | // Editor Events 30 | // ======================== 31 | 32 | event RSDKDraw 33 | DrawSprite(object.propertyValue) 34 | end event 35 | 36 | 37 | event RSDKLoad 38 | LoadSpriteSheet("SBZ/Objects.gif") 39 | SpriteFrame(-64, -4, 128, 8, 2, 388) 40 | SpriteFrame(-64, -4, 128, 8, 130, 388) 41 | 42 | SetVariableAlias(ALIAS_VAR_PROPVAL, "frameID") 43 | end event 44 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/SBZ/TransSprite.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Trans Sprite Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectDraw 13 | // Simply draw the current frame, no animation or anything needed 14 | DrawSprite(object.propertyValue) 15 | end event 16 | 17 | 18 | event ObjectStartup 19 | LoadSpriteSheet("SBZ/Objects.gif") 20 | 21 | // Sprite frames 22 | SpriteFrame(-28, -32, 56, 64, 268, 274) 23 | SpriteFrame(-28, -32, 56, 64, 325, 274) 24 | 25 | // Setup for every object in the stage 26 | foreach (TypeName[Trans Sprite], arrayPos0, ALL_ENTITIES) 27 | // Limit the property value to 1 max 28 | object[arrayPos0].propertyValue &= 1 29 | 30 | // Set the draworder to 5 (FG) 31 | object[arrayPos0].drawOrder = 5 32 | next 33 | end event 34 | 35 | 36 | // ======================== 37 | // Editor Events 38 | // ======================== 39 | 40 | event RSDKEdit 41 | if editor.returnVariable == true 42 | switch editor.variableID 43 | case EDIT_VAR_PROPVAL // property value 44 | checkResult = object.propertyValue 45 | checkResult &= 1 46 | break 47 | 48 | case 0 // type 49 | checkResult = object.propertyValue 50 | checkResult &= 1 51 | break 52 | 53 | end switch 54 | else 55 | switch editor.variableID 56 | case EDIT_VAR_PROPVAL // property value 57 | object.propertyValue = editor.variableValue 58 | object.propertyValue &= 1 59 | break 60 | 61 | case 0 // type 62 | object.propertyValue = editor.variableValue 63 | object.propertyValue &= 1 64 | break 65 | 66 | end switch 67 | end if 68 | end event 69 | 70 | 71 | event RSDKDraw 72 | DrawSprite(object.propertyValue) 73 | end event 74 | 75 | 76 | event RSDKLoad 77 | LoadSpriteSheet("SBZ/Objects.gif") 78 | SpriteFrame(-28, -32, 56, 64, 268, 274) 79 | SpriteFrame(-28, -32, 56, 64, 325, 274) 80 | 81 | AddEditorVariable("frameID") 82 | SetActiveVariable("frameID") 83 | AddEnumVariable("Left", 0) 84 | AddEnumVariable("Right", 1) 85 | end event 86 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/SBZ/VerticalWrap.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Vertical Wrap Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | // Player Aliases 13 | private alias object.ypos : player.ypos 14 | private alias object.yvel : player.yvel 15 | 16 | 17 | // ======================== 18 | // Events 19 | // ======================== 20 | 21 | event ObjectUpdate 22 | // Screen Wrap (Bottom) 23 | if player[0].yvel >= 0 24 | if camera[0].ypos >= 2168 25 | temp1 = player[0].ypos 26 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 27 | temp0 = player[currentPlayer].ypos 28 | temp0 -= temp1 29 | Abs(temp0) 30 | if temp0 < 0x8C0000 31 | player[currentPlayer].ypos -= 0x8000000 32 | 33 | // Move the background too so that it doesn't visibly warp 34 | tileLayer[2].scrollPos += 0x1000000 35 | end if 36 | next 37 | 38 | camera[0].ypos -= 0x800 39 | screen.yoffset -= 0x800 40 | end if 41 | end if 42 | 43 | // Screen Wrap (Top) 44 | if player[0].yvel <= 0 45 | if camera[0].ypos <= 120 46 | temp1 = player[0].ypos 47 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 48 | temp0 = player[currentPlayer].ypos 49 | temp0 -= temp1 50 | Abs(temp0) 51 | if temp0 < 0x8C0000 52 | player[currentPlayer].ypos += 0x8000000 53 | 54 | // To make sure it doesn't visibly warp, move the BG around too 55 | tileLayer[2].scrollPos -= 0x1000000 56 | end if 57 | next 58 | 59 | camera[0].ypos += 0x800 60 | screen.yoffset += 0x800 61 | end if 62 | end if 63 | end event 64 | 65 | 66 | // ======================== 67 | // Editor Events 68 | // ======================== 69 | 70 | event RSDKDraw 71 | DrawSprite(0) 72 | end event 73 | 74 | 75 | event RSDKLoad 76 | LoadSpriteSheet("Global/Display.gif") 77 | SpriteFrame(-16, -16, 32, 32, 1, 143) 78 | 79 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 80 | end event 81 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/SLZ/Cannon.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Cannon Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Function Declarations 10 | // ======================== 11 | 12 | reserve function Cannon_DebugDraw 13 | reserve function Cannon_DebugSpawn 14 | 15 | 16 | // ======================== 17 | // Function Definitions 18 | // ======================== 19 | 20 | private function Cannon_DebugDraw 21 | DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos) 22 | end function 23 | 24 | 25 | private function Cannon_DebugSpawn 26 | CreateTempObject(TypeName[Cannon], 0, object.xpos, object.ypos) 27 | 28 | object[tempObjectPos].direction = object.direction 29 | object[tempObjectPos].drawOrder = 4 30 | end function 31 | 32 | 33 | // ======================== 34 | // Events 35 | // ======================== 36 | 37 | event ObjectDraw 38 | DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos) 39 | end event 40 | 41 | 42 | event ObjectStartup 43 | LoadSpriteSheet("SLZ/Objects.gif") 44 | 45 | // Cannon frame 46 | SpriteFrame(-8, -16, 16, 32, 67, 59) 47 | 48 | foreach (TypeName[Cannon], arrayPos0, ALL_ENTITIES) 49 | object[arrayPos0].drawOrder = 4 50 | next 51 | 52 | // Add Cannons to the debug object list 53 | SetTableValue(TypeName[Cannon], DebugMode_ObjCount, DebugMode_TypesTable) 54 | SetTableValue(Cannon_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable) 55 | SetTableValue(Cannon_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable) 56 | DebugMode_ObjCount++ 57 | end event 58 | 59 | 60 | // ======================== 61 | // Editor Events 62 | // ======================== 63 | 64 | event RSDKDraw 65 | // direction is set from editor 66 | DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos) 67 | end event 68 | 69 | 70 | event RSDKLoad 71 | LoadSpriteSheet("SLZ/Objects.gif") 72 | SpriteFrame(-8, -16, 16, 32, 67, 59) 73 | 74 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 75 | end event 76 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/SYZ/BossBlock.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Boss Block Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias 0 : BOSSBLOCK_SOLID 13 | private alias 1 : BOSSBLOCK_NONSOLID 14 | 15 | private alias 0 : BOSSBLOCK_BLOCK 16 | private alias 1 : BOSSBLOCK_DEBRIS 17 | 18 | 19 | // ======================== 20 | // Events 21 | // ======================== 22 | 23 | event ObjectUpdate 24 | if object.propertyValue == BOSSBLOCK_BLOCK 25 | if object.state == BOSSBLOCK_SOLID 26 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 27 | BoxCollisionTest(C_SOLID, object.entityPos, -16, -16, 16, 16, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 28 | next 29 | end if 30 | else 31 | object.yvel += 0x1800 32 | object.xpos += object.xvel 33 | object.ypos += object.yvel 34 | 35 | if object.outOfBounds == true 36 | object.type = TypeName[Blank Object] 37 | end if 38 | end if 39 | end event 40 | 41 | 42 | event ObjectDraw 43 | DrawSprite(object.propertyValue) 44 | end event 45 | 46 | 47 | event ObjectStartup 48 | LoadSpriteSheet("SYZ/Objects.gif") 49 | SpriteFrame(-16, -16, 32, 32, 110, 152) 50 | SpriteFrame(-8, -8, 16, 16, 110, 152) 51 | SpriteFrame(-8, -8, 16, 16, 126, 152) 52 | SpriteFrame(-8, -8, 16, 16, 110, 168) 53 | SpriteFrame(-8, -8, 16, 16, 126, 168) 54 | end event 55 | 56 | 57 | // ======================== 58 | // Editor Events 59 | // ======================== 60 | 61 | event RSDKDraw 62 | DrawSprite(0) 63 | end event 64 | 65 | 66 | event RSDKLoad 67 | LoadSpriteSheet("SYZ/Objects.gif") 68 | SpriteFrame(-16, -16, 32, 32, 110, 152) 69 | 70 | // Although used by the object, it shouldn't be set by the editor 71 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 72 | end event 73 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/SYZ/EdgeStabilizer.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Edge Stabilizer Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // The object name is a bit odd so I'll just clarify here - 9 | // This object's purpose is to make the player not sink at the edge of a triangle chunk 10 | // Well I suppose that's an equally as odd description, but since images are worth a thousand words, it's meant to prevent things like this 11 | // https://randomsonicnet.org/taxman_sage2007/collisionbug.png 12 | 13 | // ======================== 14 | // Aliases 15 | // ======================== 16 | 17 | // Player Aliases 18 | private alias object.ypos : player.ypos 19 | private alias object.gravity : player.gravity 20 | private alias object.collisionBottom : player.collisionBottom 21 | 22 | 23 | // ======================== 24 | // Events 25 | // ======================== 26 | 27 | event ObjectUpdate 28 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 29 | if player[currentPlayer].gravity == GRAVITY_GROUND 30 | BoxCollisionTest(C_TOUCH, object.entityPos, -8, -8, 8, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 31 | if checkResult == true 32 | temp0 = player[currentPlayer].collisionBottom 33 | temp0 *= -0x10000 34 | temp0 -= 0x80000 35 | temp0 += object.ypos 36 | if player[currentPlayer].ypos > temp0 37 | player[currentPlayer].ypos = temp0 38 | end if 39 | end if 40 | end if 41 | next 42 | end event 43 | 44 | 45 | // ======================== 46 | // Editor Events 47 | // ======================== 48 | 49 | event RSDKDraw 50 | DrawSprite(0) 51 | 52 | if editor.showGizmos == true 53 | editor.drawingOverlay = true 54 | 55 | // Draw the sensor hitbox 56 | temp0 = 8; temp1 = 8; temp2 = 8; temp3 = 8; 57 | CallFunction(EditorHelpers_DrawHitbox) 58 | 59 | editor.drawingOverlay = false 60 | end if 61 | end event 62 | 63 | 64 | event RSDKLoad 65 | LoadSpriteSheet("Global/Display.gif") 66 | SpriteFrame(-8, -8, 16, 16, 239, 239) // "Trigger" - #0 67 | 68 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 69 | end event 70 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/SYZ/RLight.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Rotating Light Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Function Declarations 10 | // ======================== 11 | 12 | reserve function RotatingLight_DebugDraw 13 | reserve function RotatingLight_DebugSpawn 14 | 15 | 16 | private function RotatingLight_DebugDraw 17 | DrawSprite(SYZSetup_RLightFrame) 18 | end function 19 | 20 | 21 | private function RotatingLight_DebugSpawn 22 | CreateTempObject(TypeName[Rotating Light], 0, object.xpos, object.ypos) 23 | end function 24 | 25 | 26 | // ======================== 27 | // Events 28 | // ======================== 29 | 30 | event ObjectDraw 31 | DrawSprite(SYZSetup_RLightFrame) 32 | end event 33 | 34 | 35 | event ObjectStartup 36 | LoadSpriteSheet("SYZ/Objects.gif") 37 | SpriteFrame(-16, -8, 32, 16, 143, 152) 38 | SpriteFrame(-16, -8, 32, 16, 143, 169) 39 | SpriteFrame(-16, -8, 32, 16, 143, 186) 40 | SpriteFrame(-16, -8, 32, 16, 143, 203) 41 | SpriteFrame(-16, -8, 32, 16, 143, 220) 42 | SpriteFrame(-16, -8, 32, 16, 143, 237) 43 | 44 | SetTableValue(TypeName[Rotating Light], DebugMode_ObjCount, DebugMode_TypesTable) 45 | SetTableValue(RotatingLight_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable) 46 | SetTableValue(RotatingLight_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable) 47 | DebugMode_ObjCount++ 48 | end event 49 | 50 | 51 | // ======================== 52 | // Editor Events 53 | // ======================== 54 | 55 | event RSDKDraw 56 | DrawSprite(0) 57 | end event 58 | 59 | 60 | event RSDKLoad 61 | LoadSpriteSheet("SYZ/Objects.gif") 62 | SpriteFrame(-16, -8, 32, 16, 143, 152) 63 | 64 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 65 | end event 66 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/SYZ/SolidBlock.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Solid Block Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Function Declarations 10 | // ======================== 11 | 12 | reserve function SolidBlock_DebugDraw 13 | reserve function SolidBlock_DebugSpawn 14 | 15 | 16 | // ======================== 17 | // Function Definitions 18 | // ======================== 19 | 20 | private function SolidBlock_DebugDraw 21 | DrawSprite(0) 22 | end function 23 | 24 | 25 | private function SolidBlock_DebugSpawn 26 | CreateTempObject(TypeName[Solid Block], 0, object.xpos, object.ypos) 27 | end function 28 | 29 | 30 | // ======================== 31 | // Events 32 | // ======================== 33 | 34 | event ObjectUpdate 35 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 36 | BoxCollisionTest(C_SOLID, object.entityPos, -16, -16, 16, 16, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 37 | next 38 | end event 39 | 40 | 41 | event ObjectDraw 42 | DrawSprite(0) 43 | end event 44 | 45 | 46 | event ObjectStartup 47 | LoadSpriteSheet("SYZ/Objects.gif") 48 | SpriteFrame(-16, -16, 32, 32, 119, 34) 49 | 50 | SetTableValue(TypeName[Solid Block], DebugMode_ObjCount, DebugMode_TypesTable) 51 | SetTableValue(SolidBlock_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable) 52 | SetTableValue(SolidBlock_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable) 53 | DebugMode_ObjCount++ 54 | end event 55 | 56 | 57 | // ======================== 58 | // Editor Events 59 | // ======================== 60 | 61 | event RSDKDraw 62 | DrawSprite(0) 63 | end event 64 | 65 | 66 | event RSDKLoad 67 | LoadSpriteSheet("SYZ/Objects.gif") 68 | SpriteFrame(-16, -16, 32, 32, 119, 34) 69 | 70 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 71 | end event 72 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/Special/FadeIn.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Fade In Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.state : object.isSetup 13 | 14 | private alias object.value0 : object.fadeColor.A 15 | private alias object.value1 : object.fadeColor.R 16 | private alias object.value2 : object.fadeColor.G 17 | private alias object.value3 : object.fadeColor.B 18 | 19 | 20 | // ======================== 21 | // Events 22 | // ======================== 23 | 24 | event ObjectUpdate 25 | if object.isSetup == false 26 | object.fadeColor.R = fadeColor 27 | object.fadeColor.R >>= 16 28 | object.fadeColor.G = fadeColor 29 | object.fadeColor.G &= 0x00FF00 30 | object.fadeColor.G >>= 8 31 | object.fadeColor.B = fadeColor 32 | object.fadeColor.B &= 0x0000FF 33 | object.fadeColor.A = 0x100 34 | object.isSetup = true 35 | PlayMusic(0) 36 | else 37 | if object.fadeColor.A > 0 38 | object.fadeColor.A -= 8 39 | else 40 | object.type = TypeName[Blank Object] 41 | object.controlMode = CONTROLMODE_P1 42 | end if 43 | end if 44 | 45 | SetScreenFade(object.fadeColor.R, object.fadeColor.G, object.fadeColor.B, object.fadeColor.A) 46 | end event 47 | 48 | 49 | // ======================== 50 | // Editor Events 51 | // ======================== 52 | 53 | event RSDKDraw 54 | DrawSprite(0) 55 | end event 56 | 57 | 58 | event RSDKLoad 59 | LoadSpriteSheet("Global/Display.gif") 60 | SpriteFrame(-16, -16, 32, 32, 1, 143) 61 | 62 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 63 | end event 64 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/Special/RingSparkle.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Ring Sparkle Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectUpdate 20 | object.timer++ 21 | if object.timer == 6 22 | object.timer = 0 23 | object.frame++ 24 | if object.frame == 4 25 | object.type = TypeName[Blank Object] 26 | object.frame = 0 27 | end if 28 | end if 29 | end event 30 | 31 | 32 | event ObjectDraw 33 | CallFunction(SpecialSetup_GetBlockPos) 34 | DrawSpriteXY(object.frame, temp0, temp1) 35 | end event 36 | 37 | 38 | event ObjectStartup 39 | LoadSpriteSheet("Special/Objects.gif") 40 | SpriteFrame(-8, -8, 16, 16, 1, 455) 41 | SpriteFrame(-8, -8, 16, 16, 18, 455) 42 | SpriteFrame(-8, -8, 16, 16, 1, 472) 43 | SpriteFrame(-8, -8, 16, 16, 18, 472) 44 | end event 45 | 46 | 47 | // ======================== 48 | // Editor Events 49 | // ======================== 50 | 51 | event RSDKDraw 52 | DrawSprite(0) 53 | end event 54 | 55 | 56 | event RSDKLoad 57 | LoadSpriteSheet("Global/Display.gif") 58 | SpriteFrame(-16, -16, 32, 32, 1, 143) 59 | 60 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 61 | end event 62 | -------------------------------------------------------------------------------- /Sonic 1/Scripts/Special/WarpBlock.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 1 3 | // Script Description: Warp Block Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | 15 | // ======================== 16 | // Function Declarations 17 | // ======================== 18 | 19 | reserve function WarpBlock_DebugDraw 20 | reserve function WarpBlock_DebugSpawn 21 | 22 | 23 | // ======================== 24 | // Function Definitions 25 | // ======================== 26 | 27 | private function WarpBlock_DebugDraw 28 | DrawSprite(0) 29 | end function 30 | 31 | 32 | private function WarpBlock_DebugSpawn 33 | temp5 = TypeName[Warp Block] 34 | temp4 = 0 35 | CallFunction(DebugMode_PlaceBlock) 36 | object[arrayPos0].drawOrder = 4 37 | object[arrayPos0].groupID = GROUP_BLOCKS 38 | end function 39 | 40 | 41 | // ======================== 42 | // Events 43 | // ======================== 44 | 45 | event ObjectUpdate 46 | if object.state == 1 47 | object.frame = object.timer 48 | object.frame >>= 3 49 | object.timer++ 50 | if object.timer == 32 51 | object.timer = 0 52 | object.state = 0 53 | object.frame = 0 54 | end if 55 | end if 56 | 57 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 58 | CallFunction(SpecialSetup_PlayerBlockCol) 59 | next 60 | end event 61 | 62 | 63 | event ObjectDraw 64 | CallFunction(SpecialSetup_GetBlockPos) 65 | DrawSpriteXY(object.frame, temp0, temp1) 66 | end event 67 | 68 | 69 | event ObjectStartup 70 | LoadSpriteSheet("Special/Objects.gif") 71 | SpriteFrame(-12, -12, 24, 24, 301, 176) 72 | 73 | foreach (TypeName[Warp Block], arrayPos0, ALL_ENTITIES) 74 | object[arrayPos0].groupID = GROUP_BLOCKS 75 | next 76 | 77 | SetTableValue(TypeName[Warp Block], DebugMode_ObjCount, DebugMode_TypeTable) 78 | SetTableValue(WarpBlock_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable) 79 | SetTableValue(WarpBlock_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable) 80 | DebugMode_ObjCount++ 81 | end event 82 | 83 | 84 | // ======================== 85 | // Editor Events 86 | // ======================== 87 | 88 | event RSDKDraw 89 | DrawSprite(0) 90 | end event 91 | 92 | 93 | event RSDKLoad 94 | LoadSpriteSheet("Special/Objects.gif") 95 | SpriteFrame(-12, -12, 24, 24, 301, 176) 96 | 97 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 98 | end event 99 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/ARZ/Leaf.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Leaf Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value1 : object.originPos.x 13 | private alias object.value2 : object.originPos.y 14 | private alias object.value3 : object.fallAngle 15 | private alias object.value4 : object.angleVel 16 | 17 | 18 | // ======================== 19 | // Events 20 | // ======================== 21 | 22 | event ObjectUpdate 23 | object.fallAngle += object.angleVel 24 | 25 | temp0 = oscillation 26 | temp0 &= 0x1F 27 | if temp0 == 0 28 | Rand(temp0, 2) 29 | if temp0 == 1 30 | FlipSign(object.angleVel) 31 | end if 32 | end if 33 | 34 | object.originPos.x += object.xvel 35 | object.originPos.y += object.yvel 36 | temp0 = object.originPos.y 37 | temp0 &= 0x300 38 | temp0 += 0x400 39 | object.yvel += temp0 40 | 41 | Cos(object.xpos, object.fallAngle) 42 | object.xpos <<= 2 43 | object.xpos += object.originPos.x 44 | 45 | Sin(object.ypos, object.fallAngle) 46 | object.ypos <<= 2 47 | object.ypos += object.originPos.y 48 | 49 | object.animationTimer-- 50 | if object.animationTimer < 0 51 | object.animationTimer = 11 52 | object.frame ^= 2 53 | end if 54 | 55 | if object.outOfBounds == true 56 | object.type = TypeName[Blank Object] 57 | end if 58 | end event 59 | 60 | 61 | event ObjectDraw 62 | DrawSprite(object.frame) 63 | end event 64 | 65 | 66 | event ObjectStartup 67 | LoadSpriteSheet("ARZ/Objects.gif") 68 | SpriteFrame(-4, -3, 8, 7, 155, 207) 69 | SpriteFrame(-7, -4, 14, 8, 164, 207) 70 | SpriteFrame(-8, -3, 10, 6, 181, 207) 71 | SpriteFrame(-8, -3, 14, 6, 155, 216) 72 | end event 73 | 74 | 75 | // ======================== 76 | // Editor Events 77 | // ======================== 78 | 79 | event RSDKDraw 80 | DrawSprite(0) 81 | end event 82 | 83 | 84 | event RSDKLoad 85 | LoadSpriteSheet("ARZ/Objects.gif") 86 | SpriteFrame(-4, -3, 8, 7, 155, 207) 87 | 88 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 89 | end event 90 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/ARZ/WaterSplash.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Water Splash Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectUpdate 20 | object.iypos = stage.waterLevel 21 | 22 | object.timer++ 23 | if object.timer > 3 24 | object.timer = 0 25 | object.frame++ 26 | if object.frame > 8 27 | object.type = TypeName[Blank Object] 28 | end if 29 | end if 30 | end event 31 | 32 | 33 | event ObjectDraw 34 | DrawSprite(object.frame) 35 | end event 36 | 37 | 38 | event ObjectStartup 39 | // Out of all the Water-related objects in ARZ, this and Water are the only ones to correctly load the ARZ version of the Objects3 sheet 40 | // The rest all load "CPZ/Objects3.gif" instead, which obviously doesn't belong in ARZ, but the colors align well enough to where there's 41 | // no visible palette errors, so this oversight went unnoticed by the devs 42 | LoadSpriteSheet("ARZ/Objects3.gif") 43 | 44 | SpriteFrame(-10, -32, 20, 32, 1, 95) 45 | SpriteFrame(-15, -32, 30, 32, 22, 95) 46 | SpriteFrame(-15, -32, 30, 32, 53, 95) 47 | SpriteFrame(-15, -32, 30, 32, 85, 95) 48 | SpriteFrame(-16, -31, 31, 31, 116, 96) 49 | SpriteFrame(-16, -31, 32, 31, 148, 96) 50 | SpriteFrame(-16, -31, 32, 31, 181, 96) 51 | SpriteFrame(-16, -16, 32, 16, 214, 96) 52 | SpriteFrame(-16, -15, 32, 15, 214, 112) 53 | end event 54 | 55 | 56 | // ======================== 57 | // Editor Events 58 | // ======================== 59 | 60 | event RSDKDraw 61 | DrawSprite(0) 62 | end event 63 | 64 | 65 | event RSDKLoad 66 | LoadSpriteSheet("ARZ/Objects3.gif") 67 | SpriteFrame(-16, -31, 31, 31, 116, 96) 68 | 69 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 70 | end event 71 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/CNZ/ConveyorBelt.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Conveyor Belt Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value1 : object.hitboxL 13 | private alias object.value2 : object.hitboxR 14 | 15 | // Player Aliases 16 | private alias object.xpos : player.xpos 17 | private alias object.gravity : player.gravity 18 | 19 | 20 | // ======================== 21 | // Events 22 | // ======================== 23 | 24 | event ObjectUpdate 25 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 26 | if player[currentPlayer].gravity == GRAVITY_GROUND 27 | BoxCollisionTest(C_TOUCH, object.entityPos, object.hitboxL, -20, object.hitboxR, 0, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 28 | if checkResult == true 29 | player[currentPlayer].xpos -= 0x20000 30 | end if 31 | end if 32 | next 33 | end event 34 | 35 | 36 | event ObjectStartup 37 | foreach (TypeName[Conveyor Belt], arrayPos0, ALL_ENTITIES) 38 | object[arrayPos0].hitboxL = object[arrayPos0].propertyValue 39 | object[arrayPos0].hitboxL <<= 3 40 | object[arrayPos0].hitboxR = object[arrayPos0].hitboxL 41 | FlipSign(object[arrayPos0].hitboxL) 42 | next 43 | end event 44 | 45 | 46 | // ======================== 47 | // Editor Events 48 | // ======================== 49 | 50 | event RSDKDraw 51 | DrawSprite(0) 52 | 53 | if editor.showGizmos == true 54 | editor.drawingOverlay = true 55 | 56 | // Draw the Conveyor Belt's hitbox 57 | 58 | // Right hitbox 59 | temp2 = object.propertyValue 60 | temp2 <<= 3 61 | 62 | // Left hitbox (just mirrored) 63 | temp0 = temp2 64 | 65 | temp1 = 20; temp3 = 0; 66 | CallFunction(EditorHelpers_DrawHitbox) 67 | 68 | editor.drawingOverlay = false 69 | end if 70 | end event 71 | 72 | 73 | event RSDKLoad 74 | LoadSpriteSheet("Global/Display.gif") 75 | SpriteFrame(-8, -8, 16, 16, 168, 18) // "trigger" - #0 76 | 77 | SetVariableAlias(ALIAS_VAR_PROPVAL, "size") 78 | end event 79 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/CPZ/ChemicalSplash.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Chemical Splash Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | // Path ID Aliases 13 | private alias 0 : PATH_A 14 | 15 | 16 | // ======================== 17 | // Events 18 | // ======================== 19 | 20 | event ObjectUpdate 21 | object.xpos += object.xvel 22 | object.ypos += object.yvel 23 | object.yvel += 0x3800 24 | 25 | temp0 = object.xpos 26 | temp0 >>= 16 27 | temp0 -= camera[0].xpos 28 | Abs(temp0) 29 | temp0 -= 32 30 | 31 | temp1 = object.ypos 32 | temp1 >>= 16 33 | temp1 -= camera[0].ypos 34 | Abs(temp1) 35 | temp1 -= 32 36 | 37 | if temp0 >= screen.xcenter 38 | object.type = TypeName[Blank Object] 39 | end if 40 | 41 | if temp1 >= screen.ycenter 42 | object.type = TypeName[Blank Object] 43 | end if 44 | 45 | ObjectTileCollision(CSIDE_FLOOR, 0, 4, PATH_A) 46 | if checkResult == true 47 | object.type = TypeName[Blank Object] 48 | end if 49 | end event 50 | 51 | 52 | event ObjectDraw 53 | DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos) 54 | end event 55 | 56 | 57 | event ObjectStartup 58 | // Interestingly, while most objects would just check for their normal zone (Zone02 in this case) and then load MBZ's sheet with an `else`, 59 | // this object instead checks for the two zone's folders individually 60 | // How strange. 61 | 62 | CheckCurrentStageFolder("Zone02") 63 | if checkResult == true 64 | LoadSpriteSheet("CPZ/Objects.gif") 65 | SpriteFrame(-4, -4, 8, 8, 93, 122) 66 | end if 67 | 68 | CheckCurrentStageFolder("ZoneM") 69 | if checkResult == true 70 | LoadSpriteSheet("MBZ/Objects.gif") 71 | SpriteFrame(-4, -4, 8, 8, 104, 155) 72 | end if 73 | end event 74 | 75 | 76 | // ======================== 77 | // Editor Events 78 | // ======================== 79 | 80 | event RSDKDraw 81 | DrawSprite(0) 82 | end event 83 | 84 | 85 | event RSDKLoad 86 | CheckCurrentStageFolder("Zone02") 87 | if checkResult == true 88 | LoadSpriteSheet("CPZ/Objects.gif") 89 | SpriteFrame(-4, -4, 8, 8, 93, 122) 90 | else 91 | // We may as well go with an else here, just in case neither of the two base folders match 92 | LoadSpriteSheet("MBZ/Objects.gif") 93 | SpriteFrame(-4, -4, 8, 8, 104, 155) 94 | end if 95 | 96 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 97 | end event 98 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/CPZ/Fireball.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Fireball Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Function Declarations 10 | // ======================== 11 | 12 | reserve function Fireball_DebugDraw 13 | reserve function Fireball_DebugSpawn 14 | 15 | 16 | // ======================== 17 | // Function Definitions 18 | // ======================== 19 | 20 | private function Fireball_DebugDraw 21 | DrawSprite(0) 22 | end function 23 | 24 | 25 | private function Fireball_DebugSpawn 26 | CreateTempObject(TypeName[Fireball], 0, object.xpos, object.ypos) 27 | end function 28 | 29 | 30 | // ======================== 31 | // Events 32 | // ======================== 33 | 34 | event ObjectUpdate 35 | object.drawOrder = 5 36 | 37 | object.animationTimer++ 38 | if object.animationTimer >= 12 39 | object.animationTimer = 0 40 | end if 41 | object.frame = object.animationTimer 42 | object.frame >>= 2 43 | GetBit(object.direction, object.animationTimer, 1) 44 | 45 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 46 | BoxCollisionTest(C_TOUCH, object.entityPos, -8, -8, 8, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 47 | if checkResult == true 48 | CallFunction(Player_FireHit) 49 | end if 50 | next 51 | end event 52 | 53 | 54 | event ObjectDraw 55 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 56 | end event 57 | 58 | 59 | event ObjectStartup 60 | LoadSpriteSheet("CPZ/Objects.gif") 61 | SpriteFrame(-6, -23, 12, 28, 5, 161) 62 | SpriteFrame(-6, -26, 13, 31, 18, 158) 63 | SpriteFrame(-5, -27, 14, 32, 32, 157) 64 | 65 | SetTableValue(TypeName[Fireball], DebugMode_ObjCount, DebugMode_TypesTable) 66 | SetTableValue(Fireball_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable) 67 | SetTableValue(Fireball_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable) 68 | DebugMode_ObjCount++ 69 | end event 70 | 71 | 72 | // ======================== 73 | // Editor Events 74 | // ======================== 75 | 76 | event RSDKDraw 77 | DrawSprite(0) 78 | end event 79 | 80 | 81 | event RSDKLoad 82 | LoadSpriteSheet("CPZ/Objects.gif") 83 | SpriteFrame(-6, -23, 12, 28, 5, 161) 84 | 85 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 86 | end event 87 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/CPZ/WaterSplash.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Water Splash Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectUpdate 20 | object.iypos = stage.waterLevel 21 | 22 | object.timer++ 23 | if object.timer > 3 24 | object.timer = 0 25 | object.frame++ 26 | if object.frame > 8 27 | object.type = TypeName[Blank Object] 28 | end if 29 | end if 30 | end event 31 | 32 | 33 | event ObjectDraw 34 | DrawSprite(object.frame) 35 | end event 36 | 37 | 38 | event ObjectStartup 39 | LoadSpriteSheet("CPZ/Objects3.gif") 40 | SpriteFrame(-10, -32, 20, 32, 1, 95) 41 | SpriteFrame(-15, -32, 30, 32, 22, 95) 42 | SpriteFrame(-15, -32, 30, 32, 53, 95) 43 | SpriteFrame(-15, -32, 30, 32, 85, 95) 44 | SpriteFrame(-16, -31, 31, 31, 116, 96) 45 | SpriteFrame(-16, -31, 32, 31, 148, 96) 46 | SpriteFrame(-16, -31, 32, 31, 181, 96) 47 | SpriteFrame(-16, -16, 32, 16, 214, 96) 48 | SpriteFrame(-16, -15, 32, 15, 214, 112) 49 | end event 50 | 51 | 52 | // ======================== 53 | // Editor Events 54 | // ======================== 55 | 56 | 57 | event RSDKDraw 58 | DrawSprite(0) 59 | end event 60 | 61 | 62 | event RSDKLoad 63 | LoadSpriteSheet("CPZ/Objects3.gif") 64 | SpriteFrame(-16, -31, 31, 31, 116, 96) 65 | 66 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 67 | end event 68 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Credits/DeathEggRobot.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Death Egg Robot Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectUpdate 13 | object.inkEffect = INK_ALPHA 14 | object.alpha = 0x80 15 | end event 16 | 17 | 18 | event ObjectDraw 19 | DrawSpriteFX(0, FX_INK, object.xpos, object.ypos) 20 | end event 21 | 22 | 23 | event ObjectStartup 24 | LoadSpriteSheet("Ending/Fall.gif") 25 | SpriteFrame(-51, -20, 102, 40, 153, 87) 26 | end event 27 | 28 | 29 | // ======================== 30 | // Editor Events 31 | // ======================== 32 | 33 | event RSDKDraw 34 | DrawSprite(0) 35 | end event 36 | 37 | 38 | event RSDKLoad 39 | LoadSpriteSheet("Ending/Fall.gif") 40 | SpriteFrame(-51, -20, 102, 40, 153, 87) 41 | 42 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 43 | end event 44 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/DEZ/DERArm.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: DER Arm Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias 1 : BODYPART_DESTROYED 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectUpdate 20 | if object.state == BODYPART_DESTROYED 21 | // Update falling movements 22 | 23 | object.xpos += object.xvel 24 | object.ypos += object.yvel 25 | object.yvel += 0x3800 26 | 27 | if object.outOfBounds == true 28 | object.type = TypeName[Blank Object] 29 | end if 30 | end if 31 | end event 32 | 33 | 34 | event ObjectDraw 35 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 36 | end event 37 | 38 | 39 | event ObjectStartup 40 | CheckCurrentStageFolder("Zone12") 41 | if checkResult == true 42 | LoadSpriteSheet("DEZ/Objects.gif") 43 | SpriteFrame(-12, -12, 24, 24, 487, 125) 44 | else 45 | LoadSpriteSheet("MBZ/Objects.gif") 46 | SpriteFrame(-12, -12, 24, 24, 999, 125) 47 | end if 48 | end event 49 | 50 | 51 | // ======================== 52 | // Editor Events 53 | // ======================== 54 | 55 | event RSDKDraw 56 | DrawSprite(0) 57 | end event 58 | 59 | 60 | event RSDKLoad 61 | CheckCurrentStageFolder("Zone12") 62 | if checkResult == true 63 | LoadSpriteSheet("DEZ/Objects.gif") 64 | SpriteFrame(-12, -12, 24, 24, 487, 125) 65 | else 66 | LoadSpriteSheet("MBZ/Objects.gif") 67 | SpriteFrame(-12, -12, 24, 24, 999, 125) 68 | end if 69 | 70 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 71 | end event 72 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/DEZ/DERFoot.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: DER Foot Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias 1 : BODYPART_DESTROYED 13 | private alias 2 : BODYPART_ACTIVE 14 | 15 | 16 | // ======================== 17 | // Events 18 | // ======================== 19 | 20 | event ObjectUpdate 21 | if object.state == BODYPART_DESTROYED 22 | object.xpos += object.xvel 23 | object.ypos += object.yvel 24 | object.yvel += 0x3800 25 | 26 | if object.outOfBounds == true 27 | object.type = TypeName[Blank Object] 28 | end if 29 | end if 30 | 31 | if object.state == BODYPART_ACTIVE 32 | // Check for collision against players 33 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 34 | BoxCollisionTest(C_TOUCH, object.entityPos, -24, -24, 24, 24, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 35 | if checkResult == true 36 | CallFunction(Player_Hit) 37 | end if 38 | next 39 | end if 40 | end event 41 | 42 | 43 | event ObjectDraw 44 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 45 | end event 46 | 47 | 48 | event ObjectStartup 49 | CheckCurrentStageFolder("Zone12") 50 | if checkResult == true 51 | LoadSpriteSheet("DEZ/Objects.gif") 52 | SpriteFrame(-32, -28, 64, 60, 291, 88) 53 | else 54 | LoadSpriteSheet("MBZ/Objects.gif") 55 | SpriteFrame(-32, -28, 64, 60, 803, 88) 56 | end if 57 | end event 58 | 59 | 60 | // ======================== 61 | // Editor Events 62 | // ======================== 63 | 64 | event RSDKDraw 65 | DrawSprite(0) 66 | end event 67 | 68 | 69 | event RSDKLoad 70 | CheckCurrentStageFolder("Zone12") 71 | if checkResult == true 72 | LoadSpriteSheet("DEZ/Objects.gif") 73 | SpriteFrame(-32, -28, 64, 60, 291, 88) 74 | else 75 | LoadSpriteSheet("MBZ/Objects.gif") 76 | SpriteFrame(-32, -28, 64, 60, 803, 88) 77 | end if 78 | 79 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 80 | end event 81 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/DEZ/DERLeg.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: DER Leg Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias 1 : BODYPART_DESTROYED 13 | private alias 2 : BODYPART_ACTIVE 14 | 15 | 16 | // ======================== 17 | // Events 18 | // ======================== 19 | 20 | event ObjectUpdate 21 | if object.state == BODYPART_DESTROYED 22 | object.xpos += object.xvel 23 | object.ypos += object.yvel 24 | object.yvel += 0x3800 25 | 26 | if object.outOfBounds == true 27 | object.type = TypeName[Blank Object] 28 | end if 29 | end if 30 | 31 | if object.state == BODYPART_ACTIVE 32 | // Check for collision against players 33 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 34 | BoxCollisionTest(C_TOUCH, object.entityPos, -16, -16, 16, 16, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 35 | if checkResult == true 36 | CallFunction(Player_Hit) 37 | end if 38 | next 39 | end if 40 | end event 41 | 42 | 43 | event ObjectDraw 44 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 45 | end event 46 | 47 | 48 | event ObjectStartup 49 | CheckCurrentStageFolder("Zone12") 50 | if checkResult == true 51 | LoadSpriteSheet("DEZ/Objects.gif") 52 | SpriteFrame(-16, -16, 32, 32, 356, 154) 53 | else 54 | LoadSpriteSheet("MBZ/Objects.gif") 55 | SpriteFrame(-16, -16, 32, 32, 868, 154) 56 | end if 57 | end event 58 | 59 | 60 | // ======================== 61 | // Editor Events 62 | // ======================== 63 | 64 | event RSDKDraw 65 | DrawSprite(0) 66 | end event 67 | 68 | 69 | event RSDKLoad 70 | CheckCurrentStageFolder("Zone12") 71 | if checkResult == true 72 | LoadSpriteSheet("DEZ/Objects.gif") 73 | SpriteFrame(-16, -16, 32, 32, 356, 154) 74 | else 75 | LoadSpriteSheet("MBZ/Objects.gif") 76 | SpriteFrame(-16, -16, 32, 32, 868, 154) 77 | end if 78 | 79 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 80 | end event 81 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/DEZ/DERShoulder.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: DER Shoulder Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias 1 : BODYPART_DESTROYED 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectUpdate 20 | if object.state == BODYPART_DESTROYED 21 | object.xpos += object.xvel 22 | object.ypos += object.yvel 23 | object.yvel += 0x3800 24 | 25 | if object.outOfBounds == true 26 | object.type = TypeName[Blank Object] 27 | end if 28 | else 29 | // Follow the main Death Egg Robot object 30 | object.xpos = object[-5].xpos 31 | if object.direction == FLIP_NONE 32 | object.xpos += 0xC0000 33 | else 34 | object.xpos -= 0xC0000 35 | end if 36 | 37 | object.ypos = object[-5].ypos 38 | object.ypos -= 0x140000 39 | end if 40 | end event 41 | 42 | 43 | event ObjectDraw 44 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 45 | end event 46 | 47 | 48 | event ObjectStartup 49 | CheckCurrentStageFolder("Zone12") 50 | if checkResult == true 51 | LoadSpriteSheet("DEZ/Objects.gif") 52 | SpriteFrame(-16, -16, 32, 30, 356, 123) 53 | else 54 | LoadSpriteSheet("MBZ/Objects.gif") 55 | SpriteFrame(-16, -16, 32, 30, 868, 123) 56 | end if 57 | end event 58 | 59 | 60 | // ======================== 61 | // Editor Events 62 | // ======================== 63 | 64 | event RSDKDraw 65 | DrawSprite(0) 66 | end event 67 | 68 | 69 | event RSDKLoad 70 | CheckCurrentStageFolder("Zone12") 71 | if checkResult == true 72 | LoadSpriteSheet("DEZ/Objects.gif") 73 | SpriteFrame(-16, -16, 32, 30, 356, 123) 74 | else 75 | LoadSpriteSheet("MBZ/Objects.gif") 76 | SpriteFrame(-16, -16, 32, 30, 868, 123) 77 | end if 78 | 79 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 80 | end event 81 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/DEZ/MechaSonicSpike.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: MechaSonicSpike Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectUpdate 13 | object.xpos += object.xvel 14 | object.ypos += object.yvel 15 | 16 | if object.outOfBounds == true 17 | // Unload if out of bounds 18 | object.type = TypeName[Blank Object] 19 | end if 20 | 21 | // Check collision with players 22 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 23 | BoxCollisionTest(C_TOUCH, object.entityPos, -4, -4, 4, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 24 | if checkResult == true 25 | CallFunction(Player_Hit) 26 | end if 27 | next 28 | end event 29 | 30 | 31 | event ObjectDraw 32 | DrawSprite(object.frame) 33 | end event 34 | 35 | 36 | event ObjectStartup 37 | // Interestingly, even though the correct sprites are present on the sheet, this object forgoes using the MBZ sprites even when in MBZ 38 | LoadSpriteSheet("DEZ/Objects.gif") 39 | 40 | SpriteFrame(-4, -8, 7, 16, 296, 50) // Pointing up 41 | SpriteFrame(-5, -5, 13, 13, 304, 50) // Upwards-left 42 | SpriteFrame(-8, -3, 16, 7, 318, 50) // Left 43 | SpriteFrame(-5, -8, 13, 13, 335, 50) // Down-left 44 | SpriteFrame(-4, -8, 7, 16, 349, 50) // Down 45 | SpriteFrame(-8, -8, 13, 13, 357, 50) // Down-right 46 | SpriteFrame(-8, -3, 16, 7, 371, 50) // Right 47 | SpriteFrame(-8, -5, 13, 13, 388, 50) // Up-right 48 | end event 49 | 50 | 51 | // ======================== 52 | // Editor Events 53 | // ======================== 54 | 55 | event RSDKDraw 56 | DrawSprite(0) 57 | end event 58 | 59 | 60 | event RSDKLoad 61 | CheckCurrentStageFolder("Zone12") 62 | if checkResult == true 63 | LoadSpriteSheet("DEZ/Objects.gif") 64 | SpriteFrame(-4, -8, 7, 16, 296, 50) 65 | else 66 | // Decomp note - may as well, y'know? 67 | // Who knows, it might even help initial editor load times a tad bit 68 | LoadSpriteSheet("MBZ/Objects.gif") 69 | SpriteFrame(-4, -8, 7, 16, 808, 50) 70 | end if 71 | 72 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 73 | end event 74 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/EHZ/ExhaustPuff.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Exhaust Puff Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | 15 | // ======================== 16 | // Tables 17 | // ======================== 18 | 19 | private table ExhaustPuff_frameTable 20 | 1, 1, 2, 2, 2, 3 21 | end table 22 | 23 | 24 | // ======================== 25 | // Events 26 | // ======================== 27 | 28 | event ObjectUpdate 29 | object.ypos += object.yvel 30 | 31 | GetBit(temp0, object.timer, 1) 32 | if temp0 == true 33 | object.frame = 0 34 | else 35 | temp0 = object.timer 36 | temp0 >>= 2 37 | GetTableValue(object.frame, temp0, ExhaustPuff_frameTable) 38 | end if 39 | 40 | object.timer++ 41 | if object.timer >= 23 42 | object.type = TypeName[Blank Object] 43 | end if 44 | end event 45 | 46 | 47 | event ObjectDraw 48 | DrawSprite(object.frame) 49 | end event 50 | 51 | 52 | event ObjectStartup 53 | CheckCurrentStageFolder("Zone01") 54 | if checkResult == true 55 | LoadSpriteSheet("EHZ/Objects.gif") 56 | SpriteFrame(0, 0, 1, 1, 44, 22) 57 | SpriteFrame(-2, -2, 4, 4, 44, 22) 58 | SpriteFrame(-4, -4, 8, 8, 49, 18) 59 | SpriteFrame(-4, -4, 8, 8, 58, 18) 60 | else 61 | LoadSpriteSheet("MBZ/Objects.gif") 62 | SpriteFrame(0, 0, 1, 1, 100, 81) 63 | SpriteFrame(-2, -2, 4, 4, 100, 81) 64 | SpriteFrame(-4, -4, 8, 8, 105, 81) 65 | SpriteFrame(-4, -4, 8, 8, 114, 81) 66 | end if 67 | end event 68 | 69 | 70 | // ======================== 71 | // Editor Events 72 | // ======================== 73 | 74 | event RSDKDraw 75 | DrawSprite(0) 76 | end event 77 | 78 | 79 | event RSDKLoad 80 | CheckCurrentStageFolder("Zone01") 81 | if checkResult == true 82 | LoadSpriteSheet("EHZ/Objects.gif") 83 | SpriteFrame(-4, -4, 8, 8, 49, 18) 84 | else 85 | LoadSpriteSheet("MBZ/Objects.gif") 86 | SpriteFrame(-4, -4, 8, 8, 105, 81) 87 | end if 88 | 89 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 90 | end event 91 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/EHZ/ObjectActivator.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Object Activator Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // This object's name isn't very descriptive, so while it does "activate" objects, 9 | // it's usually used on both sides of a Spiral Path obj to make sure its active 10 | 11 | // ======================== 12 | // Events 13 | // ======================== 14 | 15 | event ObjectUpdate 16 | arrayPos0 = object.propertyValue 17 | object[+arrayPos0].priority = PRIORITY_ACTIVE 18 | end event 19 | 20 | 21 | // ======================== 22 | // Editor Events 23 | // ======================== 24 | 25 | event RSDKDraw 26 | DrawSprite(0) 27 | 28 | if editor.showGizmos == true 29 | editor.drawingOverlay = true 30 | 31 | // Draw a line to the object that'll be activated 32 | 33 | arrayPos0 = object.propertyValue 34 | DrawArrow(object.xpos, object.ypos, object[+arrayPos0].xpos, object[+arrayPos0].ypos, 252, 252, 0) 35 | 36 | editor.drawingOverlay = false 37 | end if 38 | end event 39 | 40 | 41 | event RSDKLoad 42 | LoadSpriteSheet("Global/Display.gif") 43 | SpriteFrame(-8, -8, 16, 16, 168, 18) // "Trigger" - #0 44 | 45 | SetVariableAlias(ALIAS_VAR_PROPVAL, "activateSlot") 46 | end event 47 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Ending/Cloud.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Cloud Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectUpdate 13 | object.xvel = EndingSetup_scrollVelocity.x 14 | object.xvel *= object.drawOrder 15 | object.xpos += object.xvel 16 | 17 | object.yvel = EndingSetup_scrollVelocity.y 18 | object.yvel *= object.drawOrder 19 | object.ypos += object.yvel 20 | end event 21 | 22 | 23 | event ObjectDraw 24 | DrawSprite(object.frame) 25 | end event 26 | 27 | 28 | event ObjectStartup 29 | LoadSpriteSheet("Ending/Objects.gif") 30 | 31 | // Cloud Frames 32 | SpriteFrame(-8, -4, 16, 8, 355, 165) 33 | SpriteFrame(-24, -4, 48, 8, 306, 165) 34 | SpriteFrame(-40, -4, 79, 8, 306, 156) 35 | end event 36 | 37 | 38 | // ======================== 39 | // Editor Events 40 | // ======================== 41 | 42 | event RSDKDraw 43 | DrawSprite(0) 44 | end event 45 | 46 | 47 | event RSDKLoad 48 | LoadSpriteSheet("Ending/Objects.gif") 49 | SpriteFrame(-40, -4, 79, 8, 306, 156) // Using biggest cloud as preview frame 50 | 51 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 52 | end event 53 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Enemies/AquisShot.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Aquis Shot Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | // Player Aliases 13 | private alias object.state : player.state 14 | 15 | 16 | // ======================== 17 | // Events 18 | // ======================== 19 | 20 | event ObjectUpdate 21 | object.xpos += object.xvel 22 | object.ypos += object.yvel 23 | 24 | // Check collision with players 25 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 26 | if player[currentPlayer].state != Player_State_Static 27 | BoxCollisionTest(C_TOUCH, object.entityPos, -4, -4, 4, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 28 | 29 | if checkResult == true 30 | CallFunction(Player_ProjectileHit) 31 | end if 32 | end if 33 | next 34 | 35 | // Animate the object 36 | object.frame = object.animationTimer 37 | object.frame /= 3 38 | object.animationTimer++ 39 | object.animationTimer %= 6 40 | 41 | if object.outOfBounds == true 42 | object.type = TypeName[Blank Object] 43 | end if 44 | end event 45 | 46 | 47 | event ObjectDraw 48 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 49 | end event 50 | 51 | 52 | event ObjectStartup 53 | CheckCurrentStageFolder("Zone07") 54 | if checkResult == true 55 | LoadSpriteSheet("OOZ/Objects.gif") 56 | SpriteFrame(-4, -4, 8, 8, 99, 18) 57 | SpriteFrame(-3, -3, 6, 6, 92, 23) 58 | SpriteFrame(-3, -2, 5, 4, 92, 18) 59 | else 60 | LoadSpriteSheet("MBZ/Objects.gif") 61 | SpriteFrame(-4, -4, 8, 8, 933, 323) 62 | SpriteFrame(-3, -3, 6, 6, 926, 324) 63 | SpriteFrame(-3, -2, 5, 4, 920, 325) 64 | end if 65 | end event 66 | 67 | 68 | // ======================== 69 | // Editor Events 70 | // ======================== 71 | 72 | event RSDKDraw 73 | DrawSprite(0) 74 | end event 75 | 76 | 77 | event RSDKLoad 78 | CheckCurrentStageFolder("Zone07") 79 | if checkResult == true 80 | LoadSpriteSheet("OOZ/Objects.gif") 81 | SpriteFrame(-4, -4, 8, 8, 99, 18) 82 | else 83 | LoadSpriteSheet("MBZ/Objects.gif") 84 | SpriteFrame(-4, -4, 8, 8, 933, 323) 85 | end if 86 | 87 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 88 | end event 89 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Enemies/AsteronSpike.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Asteron Spike Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | 9 | // ======================== 10 | // Events 11 | // ======================== 12 | 13 | event ObjectUpdate 14 | object.xpos += object.xvel 15 | object.ypos += object.yvel 16 | 17 | temp0 = screen.xcenter 18 | temp0 += 32 19 | temp1 = screen.ycenter 20 | temp1 += 32 21 | CheckCameraProximity(object.ixpos, object.iypos, temp0, temp1) 22 | if checkResult == false 23 | object.type = TypeName[Blank Object] 24 | end if 25 | 26 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 27 | BoxCollisionTest(C_TOUCH, object.entityPos, -4, -4, 4, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 28 | if checkResult == true 29 | CallFunction(Player_ProjectileHit) 30 | end if 31 | next 32 | end event 33 | 34 | 35 | event ObjectDraw 36 | DrawSpriteFX(object.propertyValue, FX_FLIP, object.xpos, object.ypos) 37 | end event 38 | 39 | 40 | event ObjectStartup 41 | CheckCurrentStageFolder("Zone09") 42 | if checkResult == true 43 | LoadSpriteSheet("MPZ/Objects.gif") 44 | SpriteFrame(-4, -8, 7, 14, 182, 1) 45 | SpriteFrame(-8, -4, 15, 7, 173, 18) 46 | SpriteFrame(-4, -3, 8, 11, 173, 6) 47 | else 48 | LoadSpriteSheet("MBZ/Objects.gif") 49 | SpriteFrame(-4, -8, 7, 14, 968, 322) 50 | SpriteFrame(-8, -4, 15, 7, 943, 322) 51 | SpriteFrame(-4, -3, 8, 11, 959, 327) 52 | end if 53 | end event 54 | 55 | 56 | // ======================== 57 | // Editor Events 58 | // ======================== 59 | 60 | event RSDKDraw 61 | DrawSprite(0) 62 | end event 63 | 64 | 65 | event RSDKLoad 66 | CheckCurrentStageFolder("Zone09") 67 | if checkResult == true 68 | LoadSpriteSheet("MPZ/Objects.gif") 69 | SpriteFrame(-4, -8, 7, 14, 182, 1) 70 | SpriteFrame(-8, -4, 15, 7, 173, 18) 71 | SpriteFrame(-4, -3, 8, 11, 173, 6) 72 | else 73 | LoadSpriteSheet("MBZ/Objects.gif") 74 | SpriteFrame(-4, -8, 7, 14, 968, 322) 75 | SpriteFrame(-8, -4, 15, 7, 943, 322) 76 | SpriteFrame(-4, -3, 8, 11, 959, 327) 77 | end if 78 | 79 | // Normally spriteID, this object should never be placed in a scene at all though 80 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 81 | end event 82 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Enemies/BuzzerShot.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Buzzer Shot Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectUpdate 13 | object.xpos += object.xvel 14 | object.ypos += object.yvel 15 | 16 | temp0 = screen.xcenter 17 | temp0 += 32 18 | temp1 = screen.ycenter 19 | temp1 += 32 20 | CheckCameraProximity(object.ixpos, object.iypos, temp0, temp1) 21 | if checkResult == false 22 | object.type = TypeName[Blank Object] 23 | end if 24 | 25 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 26 | BoxCollisionTest(C_TOUCH, object.entityPos, -8, -8, 8, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 27 | if checkResult == true 28 | CallFunction(Player_ProjectileHit) 29 | end if 30 | next 31 | end event 32 | 33 | 34 | event ObjectDraw 35 | DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos) 36 | end event 37 | 38 | 39 | event ObjectStartup 40 | CheckCurrentStageFolder("Zone01") 41 | if checkResult == true 42 | LoadSpriteSheet("EHZ/Objects.gif") 43 | SpriteFrame(-12, -3, 8, 10, 1, 50) 44 | SpriteFrame(-12, -3, 8, 10, 10, 50) 45 | else 46 | LoadSpriteSheet("MBZ/Objects.gif") 47 | SpriteFrame(-12, -3, 8, 10, 66, 302) 48 | SpriteFrame(-12, -3, 8, 10, 75, 302) 49 | end if 50 | end event 51 | 52 | 53 | // ======================== 54 | // Editor Events 55 | // ======================== 56 | 57 | event RSDKDraw 58 | DrawSprite(0) 59 | end event 60 | 61 | 62 | event RSDKLoad 63 | CheckCurrentStageFolder("Zone01") 64 | if checkResult == true 65 | LoadSpriteSheet("EHZ/Objects.gif") 66 | SpriteFrame(-12, -3, 8, 10, 1, 50) 67 | else 68 | LoadSpriteSheet("MBZ/Objects.gif") 69 | SpriteFrame(-12, -3, 8, 10, 66, 302) 70 | end if 71 | 72 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 73 | end event 74 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Enemies/CluckerShot.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Clucker Shot Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectUpdate 13 | object.xpos += object.xvel 14 | 15 | object.frame = object.animationTimer 16 | object.frame >>= 2 17 | object.animationTimer++ 18 | if object.animationTimer >= 32 19 | object.animationTimer = 0 20 | end if 21 | 22 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 23 | BoxCollisionTest(C_TOUCH, object.entityPos, -4, -4, 4, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 24 | if checkResult == true 25 | CallFunction(Player_ProjectileHit) 26 | end if 27 | next 28 | 29 | if object.outOfBounds == true 30 | object.type = TypeName[Blank Object] 31 | end if 32 | end event 33 | 34 | 35 | event ObjectDraw 36 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 37 | end event 38 | 39 | 40 | event ObjectStartup 41 | CheckCurrentStageFolder("Zone11") 42 | if checkResult == true 43 | LoadSpriteSheet("SCZ/Objects.gif") 44 | 45 | SpriteFrame(-3, -4, 6, 8, 50, 214) 46 | SpriteFrame(-4, -4, 7, 7, 57, 215) 47 | SpriteFrame(-4, -3, 8, 6, 65, 216) 48 | SpriteFrame(-4, -3, 7, 7, 74, 215) 49 | SpriteFrame(-3, -4, 6, 8, 82, 214) 50 | SpriteFrame(-3, -3, 7, 7, 89, 215) 51 | SpriteFrame(-4, -3, 8, 6, 97, 216) 52 | SpriteFrame(-3, -4, 7, 7, 106, 215) 53 | else 54 | LoadSpriteSheet("MBZ/Objects.gif") 55 | 56 | SpriteFrame(-3, -4, 6, 8, 660, 289) 57 | SpriteFrame(-4, -4, 7, 7, 659, 298) 58 | SpriteFrame(-4, -3, 8, 6, 658, 306) 59 | SpriteFrame(-4, -3, 7, 7, 659, 313) 60 | SpriteFrame(-3, -4, 6, 8, 660, 321) 61 | SpriteFrame(-3, -3, 7, 7, 659, 330) 62 | SpriteFrame(-4, -3, 8, 6, 658, 338) 63 | SpriteFrame(-3, -4, 7, 7, 659, 345) 64 | end if 65 | end event 66 | 67 | 68 | // ======================== 69 | // Editor Events 70 | // ======================== 71 | 72 | event RSDKDraw 73 | DrawSprite(0) 74 | end event 75 | 76 | 77 | event RSDKLoad 78 | CheckCurrentStageFolder("Zone11") 79 | if checkResult == true 80 | LoadSpriteSheet("SCZ/Objects.gif") 81 | SpriteFrame(-3, -4, 6, 8, 50, 214) 82 | else 83 | LoadSpriteSheet("MBZ/Objects.gif") 84 | SpriteFrame(-3, -4, 6, 8, 660, 289) 85 | end if 86 | 87 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 88 | end event 89 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Enemies/Coconut.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Coconut Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectUpdate 13 | object.xpos += object.xvel 14 | object.ypos += object.yvel 15 | object.yvel += 0x2000 16 | 17 | temp0 = screen.xcenter 18 | temp0 += 32 19 | temp1 = screen.ycenter 20 | temp1 += 32 21 | CheckCameraProximity(object.ixpos, object.iypos, temp0, temp1) 22 | if checkResult == false 23 | object.type = TypeName[Blank Object] 24 | end if 25 | 26 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 27 | BoxCollisionTest(C_TOUCH, object.entityPos, -8, -8, 8, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 28 | if checkResult == true 29 | CallFunction(Player_ProjectileHit) 30 | end if 31 | next 32 | end event 33 | 34 | 35 | event ObjectDraw 36 | DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos) 37 | end event 38 | 39 | 40 | event ObjectStartup 41 | CheckCurrentStageFolder("Zone01") 42 | if checkResult == true 43 | LoadSpriteSheet("EHZ/Objects.gif") 44 | SpriteFrame(-6, -7, 12, 13, 82, 95) 45 | else 46 | LoadSpriteSheet("MBZ/Objects.gif") 47 | SpriteFrame(-6, -7, 12, 13, 258, 297) 48 | end if 49 | end event 50 | 51 | 52 | // ======================== 53 | // Editor Events 54 | // ======================== 55 | 56 | event RSDKDraw 57 | DrawSprite(0) 58 | end event 59 | 60 | 61 | event RSDKLoad 62 | CheckCurrentStageFolder("Zone01") 63 | if checkResult == true 64 | LoadSpriteSheet("EHZ/Objects.gif") 65 | SpriteFrame(-6, -7, 12, 13, 82, 95) 66 | else 67 | LoadSpriteSheet("MBZ/Objects.gif") 68 | SpriteFrame(-6, -7, 12, 13, 258, 297) 69 | end if 70 | 71 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 72 | end event 73 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Enemies/GrabberShot.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Grabber Shot Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectUpdate 13 | object.xpos += object.xvel 14 | object.ypos += object.yvel 15 | object.yvel += 0x2000 16 | 17 | temp0 = screen.xcenter 18 | temp0 += 32 19 | temp1 = screen.ycenter 20 | temp1 += 32 21 | CheckCameraProximity(object.ixpos, object.iypos, temp0, temp1) 22 | if checkResult == false 23 | object.type = TypeName[Blank Object] 24 | end if 25 | 26 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 27 | BoxCollisionTest(C_TOUCH, object.entityPos, -4, -4, 4, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 28 | if checkResult == true 29 | CallFunction(Player_ProjectileHit) 30 | end if 31 | next 32 | end event 33 | 34 | 35 | event ObjectDraw 36 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 37 | end event 38 | 39 | 40 | event ObjectStartup 41 | CheckCurrentStageFolder("Zone02") 42 | if checkResult == true 43 | LoadSpriteSheet("CPZ/Objects.gif") 44 | SpriteFrame(-4, -4, 8, 8, 46, 83) 45 | SpriteFrame(-4, -4, 8, 8, 46, 92) 46 | else 47 | LoadSpriteSheet("MBZ/Objects.gif") 48 | SpriteFrame(-4, -4, 8, 8, 84, 302) 49 | SpriteFrame(-4, -4, 8, 8, 93, 302) 50 | end if 51 | end event 52 | 53 | 54 | // ======================== 55 | // Editor Events 56 | // ======================== 57 | 58 | event RSDKDraw 59 | DrawSprite(0) 60 | end event 61 | 62 | 63 | event RSDKLoad 64 | CheckCurrentStageFolder("Zone02") 65 | if checkResult == true 66 | LoadSpriteSheet("CPZ/Objects.gif") 67 | SpriteFrame(-4, -4, 8, 8, 46, 83) 68 | else 69 | LoadSpriteSheet("MBZ/Objects.gif") 70 | SpriteFrame(-4, -4, 8, 8, 84, 302) 71 | end if 72 | 73 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 74 | end event 75 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Enemies/NebulaBomb.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Nebula Bomb Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | 9 | // ======================== 10 | // Events 11 | // ======================== 12 | 13 | event ObjectUpdate 14 | object.yvel += 0x3800 15 | object.xpos += object.xvel 16 | object.ypos += object.yvel 17 | object.ypos += SCZSetup_scrollVelocity.y 18 | 19 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 20 | BoxCollisionTest(C_TOUCH, object.entityPos, -4, -4, 4, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 21 | if checkResult == true 22 | CallFunction(Player_ProjectileHit) 23 | end if 24 | next 25 | 26 | object.frame++ 27 | object.frame &= 1 28 | 29 | if object.outOfBounds == true 30 | object.type = TypeName[Blank Object] 31 | end if 32 | end event 33 | 34 | 35 | event ObjectDraw 36 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 37 | end event 38 | 39 | 40 | event ObjectStartup 41 | CheckCurrentStageFolder("Zone10") 42 | if checkResult == true 43 | LoadSpriteSheet("SCZ/Objects.gif") 44 | SpriteFrame(-7, -7, 14, 13, 220, 1) 45 | SpriteFrame(-7, -7, 14, 13, 220, 15) 46 | else 47 | LoadSpriteSheet("MBZ/Objects.gif") 48 | // Duplicate Sprite Frames as SCZ, these don't actually look too good in MBZ 49 | SpriteFrame(-7, -7, 14, 13, 220, 1) 50 | SpriteFrame(-7, -7, 14, 13, 220, 15) 51 | end if 52 | end event 53 | 54 | 55 | // ======================== 56 | // Editor Events 57 | // ======================== 58 | 59 | event RSDKDraw 60 | DrawSprite(0) 61 | end event 62 | 63 | 64 | event RSDKLoad 65 | CheckCurrentStageFolder("Zone10") 66 | if checkResult == true 67 | LoadSpriteSheet("SCZ/Objects.gif") 68 | SpriteFrame(-7, -7, 14, 13, 220, 1) 69 | SpriteFrame(-7, -7, 14, 13, 220, 15) 70 | else 71 | LoadSpriteSheet("MBZ/Objects.gif") 72 | SpriteFrame(-7, -7, 14, 13, 220, 1) 73 | SpriteFrame(-7, -7, 14, 13, 220, 15) 74 | end if 75 | 76 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 77 | end event 78 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Enemies/OctusShot.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Octus Shot Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | 9 | // ======================== 10 | // Aliases 11 | // ======================== 12 | 13 | // Player Aliases 14 | private alias object.state : player.state 15 | 16 | 17 | // ======================== 18 | // Events 19 | // ======================== 20 | 21 | event ObjectUpdate 22 | object.xpos += object.xvel 23 | object.ypos += object.yvel 24 | 25 | // Check collision with players 26 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 27 | if player[currentPlayer].state != Player_State_Static 28 | BoxCollisionTest(C_TOUCH, object.entityPos, -4, -4, 4, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 29 | 30 | if checkResult == true 31 | CallFunction(Player_ProjectileHit) 32 | end if 33 | end if 34 | next 35 | 36 | // Animate the object 37 | object.frame = object.animationTimer 38 | object.frame /= 3 39 | object.animationTimer++ 40 | if object.animationTimer >= 6 41 | object.animationTimer = 0 42 | end if 43 | 44 | if object.outOfBounds == true 45 | object.type = TypeName[Blank Object] 46 | end if 47 | end event 48 | 49 | 50 | event ObjectDraw 51 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 52 | end event 53 | 54 | 55 | event ObjectStartup 56 | CheckCurrentStageFolder("Zone07") 57 | if checkResult == true 58 | LoadSpriteSheet("OOZ/Objects.gif") 59 | SpriteFrame(-3, -3, 6, 6, 92, 32) 60 | SpriteFrame(-4, -4, 8, 8, 92, 39) 61 | else 62 | LoadSpriteSheet("MBZ/Objects.gif") 63 | SpriteFrame(-3, -3, 6, 6, 910, 332) 64 | SpriteFrame(-4, -4, 8, 8, 910, 323) 65 | end if 66 | end event 67 | 68 | 69 | // ======================== 70 | // Editor Events 71 | // ======================== 72 | 73 | event RSDKDraw 74 | DrawSprite(0) 75 | end event 76 | 77 | 78 | event RSDKLoad 79 | CheckCurrentStageFolder("Zone07") 80 | if checkResult == true 81 | LoadSpriteSheet("OOZ/Objects.gif") 82 | SpriteFrame(-3, -3, 6, 6, 92, 32) 83 | else 84 | LoadSpriteSheet("MBZ/Objects.gif") 85 | SpriteFrame(-3, -3, 6, 6, 910, 332) 86 | end if 87 | 88 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 89 | end event 90 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Enemies/RedzFire.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Redz Fire Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectUpdate 20 | object.xpos += object.xvel 21 | object.ypos += object.yvel 22 | 23 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 24 | BoxCollisionTest(C_TOUCH, object.entityPos, -7, -7, 7, 7, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 25 | if checkResult == true 26 | CallFunction(Player_FireHit) 27 | end if 28 | next 29 | 30 | object.frame = object.timer 31 | object.frame >>= 2 32 | object.frame &= 1 33 | if object.timer > 4 34 | object.frame += 2 35 | end if 36 | 37 | object.timer++ 38 | if object.timer == 20 39 | object.type = TypeName[Blank Object] 40 | end if 41 | end event 42 | 43 | 44 | event ObjectDraw 45 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 46 | end event 47 | 48 | 49 | event ObjectStartup 50 | LoadSpriteSheet("HPZ/Objects.gif") 51 | 52 | SpriteFrame(-4, -4, 7, 8, 176, 131) 53 | SpriteFrame(-4, -4, 7, 8, 184, 131) 54 | SpriteFrame(-7, -8, 14, 16, 151, 112) 55 | SpriteFrame(-7, -8, 14, 16, 166, 112) 56 | end event 57 | 58 | 59 | // ======================== 60 | // Editor Events 61 | // ======================== 62 | 63 | event RSDKDraw 64 | DrawSprite(0) 65 | end event 66 | 67 | 68 | event RSDKLoad 69 | LoadSpriteSheet("HPZ/Objects.gif") 70 | SpriteFrame(-4, -4, 7, 8, 176, 131) 71 | 72 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 73 | end event 74 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Enemies/RexonShot.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Rexon Shot Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectUpdate 13 | object.xpos += object.xvel 14 | object.ypos += object.yvel 15 | 16 | temp0 = screen.xcenter 17 | temp0 += 32 18 | temp1 = screen.ycenter 19 | temp1 += 32 20 | CheckCameraProximity(object.ixpos, object.iypos, temp0, temp1) 21 | if checkResult == false 22 | object.type = TypeName[Blank Object] 23 | end if 24 | 25 | // Check collision with players 26 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 27 | BoxCollisionTest(C_TOUCH, object.entityPos, -4, -4, 4, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 28 | 29 | if checkResult == true 30 | CallFunction(Player_ProjectileHit) 31 | end if 32 | next 33 | end event 34 | 35 | 36 | event ObjectDraw 37 | DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos) 38 | end event 39 | 40 | 41 | event ObjectStartup 42 | CheckCurrentStageFolder("Zone05") 43 | if checkResult == true 44 | LoadSpriteSheet("HTZ/Objects.gif") 45 | SpriteFrame(-4, -4, 8, 8, 36, 54) 46 | else 47 | LoadSpriteSheet("MBZ/Objects.gif") 48 | SpriteFrame(-4, -4, 8, 8, 36, 54) 49 | end if 50 | end event 51 | 52 | 53 | // ======================== 54 | // Editor Events 55 | // ======================== 56 | 57 | event RSDKDraw 58 | DrawSprite(0) 59 | end event 60 | 61 | 62 | event RSDKLoad 63 | CheckCurrentStageFolder("Zone05") 64 | if checkResult == true 65 | LoadSpriteSheet("HTZ/Objects.gif") 66 | SpriteFrame(-4, -4, 8, 8, 36, 54) 67 | else 68 | LoadSpriteSheet("MBZ/Objects.gif") 69 | SpriteFrame(-4, -4, 8, 8, 36, 54) 70 | end if 71 | 72 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 73 | end event 74 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Enemies/SpinyShot.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Spiny Shot Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectUpdate 13 | object.xpos += object.xvel 14 | object.ypos += object.yvel 15 | object.yvel += 0x2000 16 | 17 | temp0 = screen.xcenter 18 | temp0 += 32 19 | temp1 = screen.ycenter 20 | temp1 += 32 21 | CheckCameraProximity(object.ixpos, object.iypos, temp0, temp1) 22 | if checkResult == false 23 | object.type = TypeName[Blank Object] 24 | end if 25 | 26 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 27 | BoxCollisionTest(C_TOUCH, object.entityPos, -4, -4, 4, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 28 | if checkResult == true 29 | CallFunction(Player_ProjectileHit) 30 | end if 31 | next 32 | end event 33 | 34 | 35 | event ObjectDraw 36 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 37 | end event 38 | 39 | 40 | event ObjectStartup 41 | CheckCurrentStageFolder("Zone02") 42 | if checkResult == true 43 | LoadSpriteSheet("CPZ/Objects.gif") 44 | SpriteFrame(-4, -4, 8, 8, 73, 25) 45 | SpriteFrame(-4, -4, 8, 8, 82, 25) 46 | else 47 | LoadSpriteSheet("MBZ/Objects.gif") 48 | SpriteFrame(-4, -4, 8, 8, 84, 302) 49 | SpriteFrame(-4, -4, 8, 8, 93, 302) 50 | end if 51 | end event 52 | 53 | 54 | // ======================== 55 | // Editor Events 56 | // ======================== 57 | 58 | event RSDKDraw 59 | DrawSprite(0) 60 | end event 61 | 62 | 63 | event RSDKLoad 64 | CheckCurrentStageFolder("Zone02") 65 | if checkResult == true 66 | LoadSpriteSheet("CPZ/Objects.gif") 67 | SpriteFrame(-4, -4, 8, 8, 73, 25) 68 | else 69 | LoadSpriteSheet("MBZ/Objects.gif") 70 | SpriteFrame(-4, -4, 8, 8, 84, 302) 71 | end if 72 | 73 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 74 | end event 75 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Enemies/TurtloidShot.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Turtloid Shot Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectUpdate 13 | object.xpos += object.xvel 14 | object.ypos += object.yvel 15 | 16 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 17 | BoxCollisionTest(C_TOUCH, object.entityPos, -4, -4, 4, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 18 | if checkResult == true 19 | CallFunction(Player_ProjectileHit) 20 | end if 21 | next 22 | 23 | object.frame++ 24 | object.frame &= 1 25 | 26 | if object.outOfBounds == true 27 | object.type = TypeName[Blank Object] 28 | end if 29 | end event 30 | 31 | 32 | event ObjectDraw 33 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 34 | end event 35 | 36 | 37 | event ObjectStartup 38 | CheckCurrentStageFolder("Zone10") 39 | if checkResult == true 40 | LoadSpriteSheet("SCZ/Objects.gif") 41 | SpriteFrame(-3, -3, 6, 6, 220, 29) 42 | SpriteFrame(-3, -3, 6, 6, 227, 29) 43 | else 44 | LoadSpriteSheet("MBZ/Objects.gif") 45 | SpriteFrame(-3, -3, 6, 6, 220, 29) 46 | SpriteFrame(-3, -3, 6, 6, 227, 29) 47 | end if 48 | end event 49 | 50 | 51 | event RSDKDraw 52 | DrawSprite(0) 53 | end event 54 | 55 | 56 | event RSDKLoad 57 | CheckCurrentStageFolder("Zone10") 58 | if checkResult == true 59 | LoadSpriteSheet("SCZ/Objects.gif") 60 | SpriteFrame(-3, -3, 6, 6, 220, 29) 61 | SpriteFrame(-3, -3, 6, 6, 227, 29) 62 | else 63 | LoadSpriteSheet("MBZ/Objects.gif") 64 | SpriteFrame(-3, -3, 6, 6, 220, 29) 65 | SpriteFrame(-3, -3, 6, 6, 227, 29) 66 | end if 67 | 68 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 69 | end event 70 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Global/BlueShield.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Blue Shield Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | private alias -1 : DRAWORDER_PLAYER 15 | 16 | // Player aliases 17 | private alias object.state : player.state 18 | private alias object.xpos : player.xpos 19 | private alias object.ypos : player.ypos 20 | 21 | // Super States 22 | private alias 1 : SUPERSTATE_SUPER 23 | 24 | 25 | // ======================== 26 | // Events 27 | // ======================== 28 | 29 | event ObjectUpdate 30 | object.drawOrder = DRAWORDER_PLAYER 31 | 32 | // Dead player shouldn't have any shields 33 | if player[-playerCount].state == Player_State_Death 34 | object.type = TypeName[Blank Object] 35 | end if 36 | 37 | // No shields here, either 38 | if player[-playerCount].state == Player_State_Drown 39 | object.type = TypeName[Blank Object] 40 | end if 41 | 42 | // Update the object's animation 43 | object.frame = object.timer 44 | object.frame >>= 1 45 | object.timer++ 46 | object.timer %= 10 47 | end event 48 | 49 | 50 | event ObjectDraw 51 | // Super characters shouldn't have shields 52 | if Player_superState != SUPERSTATE_SUPER 53 | DrawSpriteFX(object.frame, FX_INK, player[-playerCount].xpos, player[-playerCount].ypos) 54 | DrawSpriteFX(5, FX_INK, player[-playerCount].xpos, player[-playerCount].ypos) 55 | end if 56 | end event 57 | 58 | 59 | event ObjectStartup 60 | LoadSpriteSheet("Global/Items.gif") 61 | 62 | // Shield frames 63 | SpriteFrame(-16, -16, 32, 32, 190, 50) // 0 64 | SpriteFrame(-16, -16, 32, 32, 223, 50) // 1 65 | SpriteFrame(-16, -16, 32, 32, 190, 83) // 2 66 | SpriteFrame(-16, -16, 32, 32, 223, 83) // 3 67 | SpriteFrame(-16, -16, 32, 32, 190, 116) // 4 68 | SpriteFrame(-24, -24, 48, 48, 151, 1) // Center circle 69 | end event 70 | 71 | 72 | // ======================== 73 | // Editor Events 74 | // ======================== 75 | 76 | event RSDKDraw 77 | DrawSprite(0) 78 | end event 79 | 80 | 81 | event RSDKLoad 82 | LoadSpriteSheet("Global/Display.gif") 83 | SpriteFrame(-16, -16, 32, 32, 1, 143) 84 | 85 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 86 | end event 87 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Global/Explosion.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Explosion Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectUpdate 20 | object.timer++ 21 | if object.timer > 7 22 | object.timer = 0 23 | 24 | object.frame++ 25 | if object.frame > 5 26 | object.type = TypeName[Blank Object] 27 | object.frame = 0 28 | end if 29 | end if 30 | end event 31 | 32 | 33 | event ObjectDraw 34 | DrawSprite(object.frame) 35 | end event 36 | 37 | 38 | event ObjectStartup 39 | LoadSpriteSheet("Global/Items2.gif") 40 | 41 | // Explosion frames 42 | SpriteFrame(-8, -8, 16, 16, 230, 18) 43 | SpriteFrame(-16, -16, 32, 32, 83, 66) 44 | SpriteFrame(-16, -16, 32, 32, 116, 66) 45 | SpriteFrame(-16, -16, 32, 32, 149, 66) 46 | SpriteFrame(-16, -16, 32, 32, 182, 66) 47 | SpriteFrame(-16, -16, 32, 32, 215, 66) 48 | end event 49 | 50 | 51 | // ======================== 52 | // Editor Events 53 | // ======================== 54 | 55 | event RSDKDraw 56 | DrawSprite(0) 57 | end event 58 | 59 | 60 | event RSDKLoad 61 | LoadSpriteSheet("Global/Items2.gif") 62 | SpriteFrame(-16, -16, 32, 32, 149, 66) 63 | 64 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 65 | end event 66 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Global/LightningSpark.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Lightning Spark Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value18 : player.sortedDrawOrder 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectUpdate 20 | object.drawOrder = player[0].sortedDrawOrder 21 | 22 | object.xpos += object.xvel 23 | object.ypos += object.yvel 24 | 25 | object.frame++ 26 | if object.frame >= 3 27 | object.frame = 0 28 | end if 29 | 30 | object.animationTimer++ 31 | if object.animationTimer >= 22 32 | object.type = TypeName[Blank Object] 33 | end if 34 | end event 35 | 36 | 37 | event ObjectDraw 38 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 39 | end event 40 | 41 | 42 | event ObjectStartup 43 | LoadSpriteSheet("Global/Items3.gif") 44 | SpriteFrame(0, 0, 1, 1, 1, 1) 45 | SpriteFrame(-3, -3, 6, 6, 150, 84) 46 | SpriteFrame(-8, -8, 16, 16, 157, 84) 47 | end event 48 | 49 | 50 | // ======================== 51 | // Editor Events 52 | // ======================== 53 | 54 | event RSDKDraw 55 | DrawSprite(0) 56 | end event 57 | 58 | 59 | event RSDKLoad 60 | LoadSpriteSheet("Global/Items3.gif") 61 | SpriteFrame(-8, -8, 16, 16, 157, 84) 62 | 63 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 64 | end event 65 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Global/ObjectScore.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Object Score Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectUpdate 20 | // Move the object up by 2 pixels 21 | object.ypos -= 0x20000 22 | 23 | // Unload when needed 24 | object.timer++ 25 | if object.timer == 24 26 | object.type = TypeName[Blank Object] 27 | end if 28 | end event 29 | 30 | 31 | event ObjectDraw 32 | #platform: USE_ORIGINS 33 | if game.playMode == BOOT_PLAYMODE_MIRRORING 34 | object.direction = FLIP_X 35 | DrawSpriteFX(object.propertyValue, FX_FLIP, object.xpos, object.ypos) 36 | else 37 | DrawSprite(object.propertyValue) 38 | end if 39 | #endplatform 40 | #platform: USE_STANDALONE 41 | DrawSprite(object.propertyValue) 42 | #endplatform 43 | end event 44 | 45 | 46 | event ObjectStartup 47 | LoadSpriteSheet("Global/Display.gif") 48 | 49 | // Score frames 50 | SpriteFrame(-8, 0, 16, 10, 66, 53) 51 | SpriteFrame(-8, 0, 16, 10, 123, 35) 52 | SpriteFrame(-8, 0, 16, 10, 140, 35) 53 | SpriteFrame(-10, 0, 21, 10, 66, 53) 54 | SpriteFrame(-10, 0, 21, 10, 66, 53) 55 | SpriteFrame(-10, 0, 21, 10, 66, 53) 56 | SpriteFrame(-10, 0, 21, 10, 66, 53) 57 | SpriteFrame(-10, 0, 21, 10, 66, 53) 58 | SpriteFrame(-10, 0, 21, 10, 66, 53) 59 | SpriteFrame(-10, 0, 21, 10, 66, 53) 60 | SpriteFrame(-10, 0, 21, 10, 66, 53) 61 | SpriteFrame(-10, 0, 21, 10, 66, 53) 62 | SpriteFrame(-10, 0, 21, 10, 66, 53) 63 | SpriteFrame(-10, 0, 21, 10, 66, 53) 64 | SpriteFrame(-10, 0, 21, 10, 66, 53) 65 | SpriteFrame(-13, 0, 26, 10, 66, 53) 66 | SpriteFrame(-6, 0, 11, 10, 66, 53) 67 | end event 68 | 69 | 70 | // ======================== 71 | // Editor Events 72 | // ======================== 73 | 74 | event RSDKDraw 75 | DrawSprite(0) 76 | end event 77 | 78 | 79 | event RSDKLoad 80 | LoadSpriteSheet("Global/Display.gif") 81 | SpriteFrame(-8, 0, 16, 10, 66, 53) 82 | 83 | // used in-game, but this shouldn't be placed down in the scene so it doesn't matter 84 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 85 | end event 86 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Global/RingSparkle.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Ring Sparkle Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | event ObjectUpdate 15 | 16 | object.timer++ 17 | if object.timer == 6 18 | object.timer = 0 19 | object.frame++ 20 | 21 | if object.frame == 4 22 | object.type = TypeName[Blank Object] 23 | object.frame = 0 24 | end if 25 | end if 26 | 27 | end event 28 | 29 | 30 | event ObjectDraw 31 | DrawSprite(object.frame) 32 | end event 33 | 34 | 35 | event ObjectStartup 36 | LoadSpriteSheet("Global/Items.gif") 37 | 38 | // Sparkle frames 39 | SpriteFrame(-8, -8, 16, 16, 1, 219) 40 | SpriteFrame(-8, -8, 16, 16, 1, 236) 41 | SpriteFrame(-8, -8, 16, 16, 18, 236) 42 | SpriteFrame(-8, -8, 16, 16, 35, 236) 43 | 44 | end event 45 | 46 | 47 | event RSDKDraw 48 | DrawSprite(0) 49 | end event 50 | 51 | 52 | event RSDKLoad 53 | LoadSpriteSheet("Global/Items.gif") 54 | SpriteFrame(-8, -8, 16, 16, 1, 219) 55 | 56 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 57 | end event 58 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Global/SmokePuff.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Smoke Puff Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | // ======================== 15 | // Tables 16 | // ======================== 17 | 18 | private table SmokePuff_delayTable 19 | 4, 8, 8, 8, 8 20 | end table 21 | 22 | 23 | event ObjectUpdate 24 | object.timer++ 25 | GetTableValue(temp0, object.frame, SmokePuff_delayTable) 26 | 27 | if object.timer > temp0 28 | object.timer = 0 29 | object.frame++ 30 | if object.frame > 4 31 | object.type = TypeName[Blank Object] 32 | object.frame = 0 33 | end if 34 | end if 35 | end event 36 | 37 | 38 | event ObjectDraw 39 | DrawSprite(object.frame) 40 | end event 41 | 42 | 43 | event ObjectStartup 44 | LoadSpriteSheet("Global/Items2.gif") 45 | SpriteFrame(-8, -8, 16, 16, 230, 18) 46 | SpriteFrame(-16, -16, 32, 32, 1, 1) 47 | SpriteFrame(-16, -16, 32, 32, 1, 34) 48 | SpriteFrame(-16, -16, 32, 32, 1, 67) 49 | SpriteFrame(-16, -16, 32, 32, 1, 100) 50 | end event 51 | 52 | 53 | event RSDKDraw 54 | DrawSprite(0) 55 | end event 56 | 57 | 58 | event RSDKLoad 59 | LoadSpriteSheet("Global/Items2.gif") 60 | SpriteFrame(-8, -8, 16, 16, 230, 18) 61 | 62 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 63 | end event 64 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/HPZ/GlowingOrb.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Glowing Orb Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | event ObjectDraw 13 | DrawSprite(HPZSetup_glowingOrbFrame) 14 | end event 15 | 16 | 17 | event ObjectStartup 18 | LoadSpriteSheet("HPZ/Objects.gif") 19 | 20 | // Orb franes 21 | SpriteFrame(-12, -12, 24, 24, 198, 74) 22 | SpriteFrame(-12, -12, 24, 24, 198, 99) 23 | SpriteFrame(-15, -15, 30, 30, 192, 124) 24 | SpriteFrame(-15, -16, 30, 32, 192, 155) 25 | 26 | foreach (TypeName[Glowing Orb], arrayPos0, ALL_ENTITIES) 27 | object[arrayPos0].drawOrder = 5 28 | next 29 | end event 30 | 31 | 32 | // ======================== 33 | // Editor Events 34 | // ======================== 35 | 36 | event RSDKDraw 37 | DrawSprite(0) 38 | end event 39 | 40 | 41 | event RSDKLoad 42 | LoadSpriteSheet("HPZ/Objects.gif") 43 | SpriteFrame(-12, -12, 24, 24, 198, 74) 44 | 45 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 46 | end event 47 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/HPZ/HPZForeground.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: HPZ Foreground Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | event ObjectDraw 9 | DrawSprite(0) 10 | end event 11 | 12 | 13 | event ObjectStartup 14 | LoadSpriteSheet("HPZ/Objects.gif") 15 | 16 | // FG Frame 17 | SpriteFrame(-48, -56, 96, 112, 256, 1) 18 | 19 | // Set it to draw order 5 in order to be drawn above everything 20 | foreach (TypeName[HPZ Foreground], arrayPos0, ALL_ENTITIES) 21 | object[arrayPos0].drawOrder = 5 22 | next 23 | end event 24 | 25 | 26 | event RSDKDraw 27 | DrawSprite(0) 28 | end event 29 | 30 | 31 | event RSDKLoad 32 | LoadSpriteSheet("HPZ/Objects.gif") 33 | 34 | // FG Frame 35 | SpriteFrame(-48, -56, 96, 112, 256, 1) 36 | 37 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 38 | end event 39 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/HPZ/OriginalGem.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Original Gem Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | // States 15 | private alias 0 : ORIGINALGEM_IDLE 16 | private alias 1 : ORIGINALGEM_FADEOUT 17 | 18 | 19 | // ======================== 20 | // Events 21 | // ======================== 22 | 23 | event ObjectUpdate 24 | // Check interaction with players 25 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 26 | BoxCollisionTest(C_SOLID, object.entityPos, -24, -16, 24, 16, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 27 | if checkResult == COL_TOP 28 | if object.state == ORIGINALGEM_IDLE 29 | // Start fading out to the level select 30 | PlaySfx(SfxName[Exit SS], false) 31 | object.timer = -384 32 | object.priority = PRIORITY_ACTIVE 33 | object.state++ 34 | end if 35 | end if 36 | next 37 | 38 | switch object.state 39 | case ORIGINALGEM_FADEOUT 40 | music.volume -= 2 41 | 42 | if object.timer < 384 43 | object.timer += 8 44 | else 45 | starPostID = 0 46 | stage.activeList = PRESENTATION_STAGE 47 | stage.listPos = 5 48 | LoadStage() 49 | end if 50 | 51 | if object.timer > 0 52 | SetScreenFade(0, 0, 0, object.timer) 53 | end if 54 | break 55 | 56 | end switch 57 | end event 58 | 59 | 60 | event ObjectDraw 61 | DrawSprite(0) 62 | end event 63 | 64 | 65 | event ObjectStartup 66 | LoadSpriteSheet("HPZ/Objects.gif") 67 | SpriteFrame(-32, -16, 64, 32, 1, 223) 68 | end event 69 | 70 | 71 | // ======================== 72 | // Editor Events 73 | // ======================== 74 | 75 | event RSDKDraw 76 | DrawSprite(0) 77 | end event 78 | 79 | 80 | event RSDKLoad 81 | LoadSpriteSheet("HPZ/Objects.gif") 82 | SpriteFrame(-32, -16, 64, 32, 1, 223) 83 | 84 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 85 | end event 86 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/HPZ/WaterSplash.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Water Splash Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | event ObjectUpdate 15 | object.iypos = stage.waterLevel 16 | 17 | object.timer++ 18 | if object.timer > 3 19 | object.timer = 0 20 | object.frame++ 21 | if object.frame > 8 22 | object.type = TypeName[Blank Object] 23 | end if 24 | end if 25 | end event 26 | 27 | 28 | event ObjectDraw 29 | DrawSprite(object.frame) 30 | end event 31 | 32 | 33 | event ObjectStartup 34 | LoadSpriteSheet("HPZ/Objects3.gif") 35 | SpriteFrame(-10, -32, 20, 32, 1, 95) 36 | SpriteFrame(-15, -32, 30, 32, 22, 95) 37 | SpriteFrame(-15, -32, 30, 32, 53, 95) 38 | SpriteFrame(-15, -32, 30, 32, 85, 95) 39 | SpriteFrame(-16, -31, 31, 31, 116, 96) 40 | SpriteFrame(-16, -31, 32, 31, 148, 96) 41 | SpriteFrame(-16, -31, 32, 31, 181, 96) 42 | SpriteFrame(-16, -16, 32, 16, 214, 96) 43 | SpriteFrame(-16, -15, 32, 15, 214, 112) 44 | end event 45 | 46 | 47 | // ======================== 48 | // Editor Events 49 | // ======================== 50 | 51 | event RSDKDraw 52 | DrawSprite(0) 53 | end event 54 | 55 | 56 | event RSDKLoad 57 | LoadSpriteSheet("HPZ/Objects3.gif") 58 | SpriteFrame(-16, -31, 31, 31, 116, 96) 59 | 60 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 61 | end event 62 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/HTZ/2PVsDeleter.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: 2P Vs Deleter Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.propertyValue : object.deleteCount 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectUpdate 20 | // There's nothing here 21 | end event 22 | 23 | 24 | event ObjectDraw 25 | // The sequel to nothing here: nothing there 26 | end event 27 | 28 | 29 | event ObjectStartup 30 | foreach (TypeName[2P Vs Deleter], arrayPos0, ALL_ENTITIES) 31 | if options.vsMode == false 32 | // If not in 2P, then delete these multiplayer helper objects 33 | // (These objects are normally just platforms or etc, in place of lifts and other un-reusable objects) 34 | temp0 = 0 35 | arrayPos1 = arrayPos0 36 | while temp0 < object[arrayPos0].deleteCount 37 | arrayPos1++ 38 | object[arrayPos1].type = TypeName[Blank Object] 39 | temp0++ 40 | loop 41 | end if 42 | next 43 | end event 44 | 45 | 46 | // ======================== 47 | // Editor Events 48 | // ======================== 49 | 50 | event RSDKDraw 51 | DrawSprite(0) 52 | 53 | if editor.showGizmos == true 54 | editor.drawingOverlay = true 55 | 56 | temp0 = 0 57 | arrayPos1 = object.entityPos 58 | while temp0 < object.deleteCount 59 | arrayPos1++ 60 | DrawLine(object.xpos, object.ypos, object[arrayPos1].xpos, object[arrayPos1].ypos, 0xFF, 0xFF, 0x00) 61 | temp0++ 62 | loop 63 | 64 | editor.drawingOverlay = false 65 | end if 66 | end event 67 | 68 | 69 | event RSDKLoad 70 | LoadSpriteSheet("Global/Display.gif") 71 | SpriteFrame(-8, -8, 16, 16, 168, 18) // "trigger" - #0 72 | 73 | SetVariableAlias(ALIAS_VAR_PROPVAL, "deleteCount") 74 | end event 75 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/HTZ/EggmanFireball1.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Eggman Fireball1 Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | 9 | event ObjectUpdate 10 | object.xpos += object.xvel 11 | 12 | // Animate the object 13 | object.frame = object.animationTimer 14 | object.frame >>= 2 15 | object.animationTimer++ 16 | object.animationTimer &= 7 17 | 18 | if object.outOfBounds == true 19 | object.type = TypeName[Blank Object] 20 | end if 21 | 22 | // Check interaction with players 23 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 24 | BoxCollisionTest(C_TOUCH, object.entityPos, -4, -4, 4, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 25 | if checkResult == true 26 | CallFunction(Player_FireHit) 27 | end if 28 | next 29 | end event 30 | 31 | 32 | event ObjectDraw 33 | DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos) 34 | end event 35 | 36 | 37 | event ObjectStartup 38 | CheckCurrentStageFolder("Zone05") 39 | if checkResult == true 40 | LoadSpriteSheet("HTZ/Objects.gif") 41 | SpriteFrame(-4, -4, 8, 8, 158, 95) 42 | SpriteFrame(-4, -4, 8, 8, 166, 95) 43 | else 44 | LoadSpriteSheet("MBZ/Objects.gif") 45 | SpriteFrame(-4, -4, 8, 8, 480, 179) 46 | SpriteFrame(-4, -4, 8, 8, 488, 179) 47 | end if 48 | end event 49 | 50 | 51 | event RSDKDraw 52 | DrawSprite(0) 53 | end event 54 | 55 | 56 | event RSDKLoad 57 | CheckCurrentStageFolder("Zone05") 58 | if checkResult == true 59 | LoadSpriteSheet("HTZ/Objects.gif") 60 | SpriteFrame(-4, -4, 8, 8, 158, 95) 61 | else 62 | LoadSpriteSheet("MBZ/Objects.gif") 63 | SpriteFrame(-4, -4, 8, 8, 480, 179) 64 | end if 65 | 66 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 67 | end event 68 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/HTZ/EgmanSmokePuff.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Eggman SmokePuff Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectUpdate 13 | object.xpos += object.xvel 14 | object.ypos += object.yvel 15 | 16 | if object.outOfBounds == true 17 | // Erase the object as soon as it's OOB, it's not too important anyway 18 | object.type = TypeName[Blank Object] 19 | end if 20 | 21 | // Animate the object 22 | object.frame = object.animationTimer 23 | object.frame /= 14 24 | object.animationTimer++ 25 | if object.frame == 4 26 | object.type = TypeName[Blank Object] 27 | end if 28 | end event 29 | 30 | 31 | event ObjectDraw 32 | DrawSprite(object.frame) 33 | end event 34 | 35 | 36 | event ObjectStartup 37 | CheckCurrentStageFolder("Zone05") 38 | if checkResult == true 39 | LoadSpriteSheet("HTZ/Objects.gif") 40 | SpriteFrame(-8, -6, 16, 13, 52, 1) 41 | SpriteFrame(-8, -7, 15, 14, 52, 15) 42 | SpriteFrame(-8, -7, 15, 14, 37, 117) 43 | SpriteFrame(-7, -6, 12, 12, 53, 119) 44 | else 45 | LoadSpriteSheet("MBZ/Objects.gif") 46 | SpriteFrame(-8, -6, 16, 13, 903, 71) 47 | SpriteFrame(-8, -7, 15, 14, 903, 85) 48 | SpriteFrame(-8, -7, 15, 14, 913, 109) 49 | SpriteFrame(-7, -6, 12, 12, 929, 111) 50 | end if 51 | end event 52 | 53 | 54 | // ======================== 55 | // Editor Events 56 | // ======================== 57 | 58 | event RSDKDraw 59 | DrawSprite(0) 60 | end event 61 | 62 | 63 | event RSDKLoad 64 | CheckCurrentStageFolder("Zone05") 65 | if checkResult == true 66 | LoadSpriteSheet("HTZ/Objects.gif") 67 | SpriteFrame(-8, -6, 16, 13, 52, 1) 68 | else 69 | LoadSpriteSheet("MBZ/Objects.gif") 70 | SpriteFrame(-8, -6, 16, 13, 903, 71) 71 | end if 72 | 73 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 74 | end event 75 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/MBZ/BGDimmer.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: BG Dimmer Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value10 : MBZSetup.isDimming 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectUpdate 20 | // Start the fade-in 21 | MBZSetup[10].isDimming = true 22 | end event 23 | 24 | 25 | // ======================== 26 | // Editor Events 27 | // ======================== 28 | 29 | event RSDKDraw 30 | DrawSprite(0) 31 | end event 32 | 33 | 34 | event RSDKLoad 35 | LoadSpriteSheet("Global/Display.gif") 36 | SpriteFrame(-8, -8, 16, 16, 168, 18) 37 | 38 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 39 | end event 40 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/MBZ/SecretDoor.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Secret Door Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.offset.y 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectUpdate 20 | if object.state == 0 21 | if object.offset.y > 0 22 | object.offset.y -= 0x80000 23 | end if 24 | else 25 | if object.offset.y < 0x400000 26 | object.offset.y += 0x80000 27 | else 28 | object.priority = PRIORITY_BOUNDS 29 | end if 30 | end if 31 | 32 | object.ypos -= object.offset.y 33 | if object.offset.y == 0 34 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 35 | BoxCollisionTest(C_SOLID, object.entityPos, -8, -32, 8, 32, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 36 | next 37 | else 38 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 39 | BoxCollisionTest(C_SOLID, object.entityPos, -8, -32, 8, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 40 | next 41 | end if 42 | object.ypos += object.offset.y 43 | end event 44 | 45 | 46 | event ObjectDraw 47 | temp0 = object.offset.y 48 | FlipSign(temp0) 49 | temp0 += object.ypos 50 | DrawSpriteFX(0, FX_FLIP, object.xpos, temp0) 51 | end event 52 | 53 | 54 | event ObjectStartup 55 | LoadSpriteSheet("MBZ/Objects.gif") 56 | SpriteFrame(-8, -32, 16, 64, 93, 312) 57 | 58 | foreach (TypeName[Secret Door], arrayPos0, ALL_ENTITIES) 59 | object[arrayPos0].drawOrder = 4 60 | next 61 | end event 62 | 63 | 64 | // ======================== 65 | // Editor Events 66 | // ======================== 67 | 68 | event RSDKDraw 69 | DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos) 70 | end event 71 | 72 | 73 | event RSDKLoad 74 | LoadSpriteSheet("MBZ/Objects.gif") 75 | SpriteFrame(-8, -32, 16, 64, 93, 312) 76 | 77 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 78 | end event 79 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/MCZ/StaticBlock.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Static Block Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Function Declarations 10 | // ======================== 11 | 12 | reserve function StaticBlock_DebugDraw 13 | reserve function StaticBlock_DebugSpawn 14 | 15 | 16 | // ======================== 17 | // Function Definitions 18 | // ======================== 19 | 20 | private function StaticBlock_DebugDraw 21 | DrawSprite(0) 22 | end function 23 | 24 | 25 | private function StaticBlock_DebugSpawn 26 | CreateTempObject(TypeName[Static Block], 0, object.xpos, object.ypos) 27 | end function 28 | 29 | 30 | // ======================== 31 | // Events 32 | // ======================== 33 | 34 | event ObjectUpdate 35 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 36 | // Just act as a small box for the player 37 | BoxCollisionTest(C_SOLID, object.entityPos, -16, -16, 16, 16, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 38 | next 39 | end event 40 | 41 | 42 | event ObjectDraw 43 | // Interesting note - this object has its Y direction flipped one time in the Act 1 scene file, 44 | // but the drawing here just uses the standard sprite drawing function rather than FX_FLIP. 45 | // I wonder what's up with that... 46 | 47 | DrawSprite(0) 48 | end event 49 | 50 | 51 | event ObjectStartup 52 | LoadSpriteSheet("MCZ/Objects.gif") 53 | 54 | // 0 - Wood post frame 55 | SpriteFrame(-16, -16, 32, 32, 70, 0) 56 | 57 | // Add this object to the debug item list 58 | SetTableValue(TypeName[Static Block], DebugMode_ObjCount, DebugMode_TypesTable) 59 | SetTableValue(StaticBlock_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable) 60 | SetTableValue(StaticBlock_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable) 61 | DebugMode_ObjCount++ 62 | end event 63 | 64 | 65 | // ======================== 66 | // Editor Events 67 | // ======================== 68 | 69 | event RSDKDraw 70 | DrawSprite(0) 71 | end event 72 | 73 | 74 | event RSDKLoad 75 | LoadSpriteSheet("MCZ/Objects.gif") 76 | SpriteFrame(-16, -16, 32, 32, 70, 0) 77 | 78 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 79 | end event 80 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/MPZ/BoltEnd.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Bolt End Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Function Declarations 10 | // ======================== 11 | 12 | reserve function BoltEnd_DebugDraw 13 | reserve function BoltEnd_DebugSpawn 14 | 15 | 16 | // ======================== 17 | // Function Definitions 18 | // ======================== 19 | 20 | private function BoltEnd_DebugDraw 21 | DrawSprite(0) 22 | end function 23 | 24 | 25 | private function BoltEnd_DebugSpawn 26 | CreateTempObject(TypeName[Bolt End], 0, object.xpos, object.ypos) 27 | end function 28 | 29 | 30 | // ======================== 31 | // Events 32 | // ======================== 33 | 34 | event ObjectDraw 35 | DrawSprite(0) 36 | end event 37 | 38 | 39 | event ObjectStartup 40 | LoadSpriteSheet("MPZ/Objects.gif") 41 | 42 | // End frame 43 | SpriteFrame(-14, -4, 28, 8, 144, 83) 44 | 45 | // Add this object to the debug mode object list 46 | SetTableValue(TypeName[Bolt End], DebugMode_ObjCount, DebugMode_TypesTable) 47 | SetTableValue(BoltEnd_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable) 48 | SetTableValue(BoltEnd_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable) 49 | DebugMode_ObjCount++ 50 | end event 51 | 52 | 53 | // ======================== 54 | // Editor Events 55 | // ======================== 56 | 57 | event RSDKDraw 58 | DrawSprite(0) 59 | end event 60 | 61 | 62 | event RSDKLoad 63 | LoadSpriteSheet("MPZ/Objects.gif") 64 | SpriteFrame(-14, -4, 28, 8, 144, 83) 65 | 66 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 67 | end event 68 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/MPZ/ConveyorBelt.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Conveyor Belt Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value1 : object.hitbox.left 13 | private alias object.value2 : object.hitbox.right 14 | 15 | // Player Aliases 16 | private alias object.xpos : player.xpos 17 | private alias object.gravity : player.gravity 18 | 19 | 20 | // ======================== 21 | // Events 22 | // ======================== 23 | 24 | event ObjectUpdate 25 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 26 | if player[currentPlayer].gravity == GRAVITY_GROUND 27 | BoxCollisionTest(C_TOUCH, object.entityPos, object.hitbox.left, -20, object.hitbox.right, 0, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 28 | if checkResult == true 29 | player[currentPlayer].xpos += object.xvel 30 | end if 31 | end if 32 | next 33 | end event 34 | 35 | 36 | event ObjectStartup 37 | foreach (TypeName[Conveyor Belt], arrayPos0, ALL_ENTITIES) 38 | object[arrayPos0].hitbox.left = object[arrayPos0].propertyValue 39 | object[arrayPos0].hitbox.left <<= 4 40 | object[arrayPos0].hitbox.right = object[arrayPos0].hitbox.left 41 | FlipSign(object[arrayPos0].hitbox.left) 42 | 43 | // Direction is set from the editor 44 | if object[arrayPos0].direction == FLIP_NONE 45 | object[arrayPos0].xvel = 0x20000 46 | else 47 | object[arrayPos0].xvel = -0x20000 48 | end if 49 | next 50 | end event 51 | 52 | 53 | // ======================== 54 | // Editor Events 55 | // ======================== 56 | 57 | event RSDKDraw 58 | DrawSprite(0) 59 | 60 | if editor.showGizmos == true 61 | editor.drawingOverlay = true 62 | 63 | // Draw the Conveyor Belt's hitbox 64 | 65 | // Right hitbox 66 | temp2 = object.propertyValue 67 | temp2 <<= 4 68 | 69 | // Left hitbox (just mirrored) 70 | temp0 = temp2 71 | 72 | temp1 = 20; temp3 = 0; 73 | CallFunction(EditorHelpers_DrawHitbox) 74 | 75 | editor.drawingOverlay = false 76 | end if 77 | end event 78 | 79 | 80 | event RSDKLoad 81 | LoadSpriteSheet("Global/Display.gif") 82 | SpriteFrame(-8, -8, 16, 16, 168, 18) // "trigger" - #0 83 | 84 | SetVariableAlias(ALIAS_VAR_PROPVAL, "size") 85 | end event 86 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/MPZ/EggmanLaser.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Eggman Laser Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.offset.x 13 | 14 | 15 | // ======================== 16 | // Static Values 17 | // ======================== 18 | 19 | private value EggmanLaser_sheetX = 0 20 | private value EggmanLaser_sheetY = 0 21 | 22 | 23 | // ======================== 24 | // Events 25 | // ======================== 26 | 27 | event ObjectUpdate 28 | object.xpos += object.xvel 29 | 30 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 31 | BoxCollisionTest(C_TOUCH, object.entityPos, -32, -8, 32, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 32 | if checkResult == true 33 | CallFunction(Player_Hit) 34 | end if 35 | next 36 | 37 | if object.outOfBounds == true 38 | object.type = TypeName[Blank Object] 39 | end if 40 | end event 41 | 42 | 43 | event ObjectDraw 44 | temp0 = object.xpos 45 | temp0 &= 0xFFFF0000 46 | temp0 -= object.offset.x 47 | Abs(temp0) 48 | temp0 >>= 16 49 | temp0 += 4 50 | if temp0 > 64 51 | temp0 = 64 52 | end if 53 | 54 | EditFrame(0, -32, -6, temp0, 12, EggmanLaser_sheetX, EggmanLaser_sheetY) 55 | DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos) 56 | end event 57 | 58 | 59 | event ObjectStartup 60 | CheckCurrentStageFolder("Zone09") 61 | if checkResult == true 62 | LoadSpriteSheet("MPZ/Objects.gif") 63 | SpriteFrame(-32, -6, 64, 12, 220, 193) 64 | EggmanLaser_sheetX = 220 65 | EggmanLaser_sheetY = 193 66 | else 67 | LoadSpriteSheet("MBZ/Objects.gif") 68 | SpriteFrame(-32, -6, 64, 12, 247, 185) 69 | EggmanLaser_sheetX = 247 70 | EggmanLaser_sheetY = 185 71 | end if 72 | end event 73 | 74 | 75 | // ======================== 76 | // Editor Events 77 | // ======================== 78 | 79 | event RSDKDraw 80 | DrawSprite(0) 81 | end event 82 | 83 | 84 | event RSDKLoad 85 | CheckCurrentStageFolder("Zone09") 86 | if checkResult == true 87 | LoadSpriteSheet("MPZ/Objects.gif") 88 | SpriteFrame(-32, -6, 64, 12, 220, 193) 89 | else 90 | LoadSpriteSheet("MBZ/Objects.gif") 91 | SpriteFrame(-32, -6, 64, 12, 247, 185) 92 | end if 93 | 94 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 95 | end event 96 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/MPZ/Guage.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Guage Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // Note - May Guage be a typo? 9 | // Normally the word Gauge is used... 10 | // But then again, this game's half Australian as well 11 | 12 | // ======================== 13 | // Function Declarations 14 | // ======================== 15 | 16 | reserve function Guage_DebugDraw 17 | reserve function Guage_DebugSpawn 18 | 19 | 20 | // ======================== 21 | // Function Declarations 22 | // ======================== 23 | 24 | private function Guage_DebugDraw 25 | DrawSprite(0) 26 | end function 27 | 28 | 29 | private function Guage_DebugSpawn 30 | CreateTempObject(TypeName[Guage], 0, object.xpos, object.ypos) 31 | end function 32 | 33 | 34 | // ======================== 35 | // Events 36 | // ======================== 37 | 38 | event ObjectDraw 39 | // Just a simple decoration object - no further code needed 40 | DrawSprite(0) 41 | end event 42 | 43 | 44 | event ObjectStartup 45 | LoadSpriteSheet("MPZ/Objects.gif") 46 | 47 | // Guage frame 48 | SpriteFrame(-8, -8, 16, 16, 330, 157) 49 | 50 | // Add the Guage to the debug mode item list 51 | SetTableValue(TypeName[Guage], DebugMode_ObjCount, DebugMode_TypesTable) 52 | SetTableValue(Guage_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable) 53 | SetTableValue(Guage_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable) 54 | DebugMode_ObjCount++ 55 | end event 56 | 57 | 58 | // ======================== 59 | // Editor Events 60 | // ======================== 61 | 62 | event RSDKDraw 63 | DrawSprite(0) 64 | end event 65 | 66 | 67 | event RSDKLoad 68 | LoadSpriteSheet("MPZ/Objects.gif") 69 | SpriteFrame(-8, -8, 16, 16, 330, 157) 70 | 71 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 72 | end event 73 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/MPZ/PlatConveyor.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Plat Conveyor Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Function Declarations 10 | // ======================== 11 | 12 | reserve function PlatConveyor_DebugDraw 13 | reserve function PlatConveyor_DebugSpawn 14 | 15 | private function PlatConveyor_DebugDraw 16 | DrawSprite(0) 17 | end function 18 | 19 | 20 | private function PlatConveyor_DebugSpawn 21 | CreateTempObject(TypeName[Plat Conveyor], 0, object.xpos, object.ypos) 22 | end function 23 | 24 | 25 | // ======================== 26 | // Events 27 | // ======================== 28 | 29 | event ObjectDraw 30 | DrawSprite(object.propertyValue) 31 | end event 32 | 33 | 34 | event ObjectStartup 35 | LoadSpriteSheet("MPZ/Objects.gif") 36 | SpriteFrame(-2, -8, 4, 16, 173, 53) 37 | SpriteFrame(-2, -8, 4, 16, 178, 53) 38 | 39 | SetTableValue(TypeName[Plat Conveyor], DebugMode_ObjCount, DebugMode_TypesTable) 40 | SetTableValue(PlatConveyor_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable) 41 | SetTableValue(PlatConveyor_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable) 42 | DebugMode_ObjCount++ 43 | end event 44 | 45 | 46 | // ======================== 47 | // Editor Events 48 | // ======================== 49 | 50 | event RSDKDraw 51 | DrawSprite(object.propertyValue) 52 | end event 53 | 54 | 55 | event RSDKLoad 56 | LoadSpriteSheet("MPZ/Objects.gif") 57 | SpriteFrame(-2, -8, 4, 16, 173, 53) 58 | SpriteFrame(-2, -8, 4, 16, 178, 53) 59 | 60 | SetVariableAlias(ALIAS_VAR_PROPVAL, "frameID") 61 | end event 62 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/MPZ/SmallCog.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Small Cog Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Function Declarations 10 | // ======================== 11 | 12 | reserve function SmallCog_DebugDraw 13 | reserve function SmallCog_DebugSpawn 14 | 15 | 16 | // ======================== 17 | // Function Definitions 18 | // ======================== 19 | 20 | private function SmallCog_DebugDraw 21 | DrawSprite(0) 22 | end function 23 | 24 | 25 | private function SmallCog_DebugSpawn 26 | CreateTempObject(TypeName[Small Cog], 0, object.xpos, object.ypos) 27 | end function 28 | 29 | 30 | // ======================== 31 | // Events 32 | // ======================== 33 | 34 | event ObjectUpdate 35 | // Empty :( 36 | end event 37 | 38 | 39 | event ObjectDraw 40 | DrawSprite(MPZSetup_cogFrame) 41 | end event 42 | 43 | 44 | event ObjectStartup 45 | LoadSpriteSheet("MPZ/Objects.gif") 46 | SpriteFrame(-12, -12, 24, 24, 133, 126) 47 | SpriteFrame(-12, -12, 24, 24, 158, 126) 48 | SpriteFrame(-12, -12, 24, 24, 158, 126) 49 | SpriteFrame(-12, -12, 24, 24, 183, 126) 50 | 51 | SetTableValue(TypeName[Small Cog], DebugMode_ObjCount, DebugMode_TypesTable) 52 | SetTableValue(SmallCog_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable) 53 | SetTableValue(SmallCog_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable) 54 | DebugMode_ObjCount++ 55 | end event 56 | 57 | 58 | // ======================== 59 | // Editor Events 60 | // ======================== 61 | 62 | event RSDKDraw 63 | DrawSprite(0) 64 | end event 65 | 66 | 67 | event RSDKLoad 68 | LoadSpriteSheet("MPZ/Objects.gif") 69 | SpriteFrame(-12, -12, 24, 24, 133, 126) 70 | 71 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 72 | end event 73 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/MPZ/TransSprite.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Trans Sprite Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | 9 | // ======================== 10 | // Events 11 | // ======================== 12 | 13 | event ObjectDraw 14 | DrawSprite(object.propertyValue) 15 | end event 16 | 17 | 18 | event ObjectStartup 19 | LoadSpriteSheet("MPZ/Objects.gif") 20 | SpriteFrame(-8, -32, 32, 8, 111, 83) 21 | SpriteFrame(-8, -32, 32, 8, 100, 126) 22 | 23 | foreach (TypeName[Trans Sprite], arrayPos0, ALL_ENTITIES) 24 | object[arrayPos0].propertyValue &= 1 25 | object[arrayPos0].drawOrder = 5 26 | next 27 | end event 28 | 29 | 30 | // ======================== 31 | // Editor Events 32 | // ======================== 33 | 34 | event RSDKEdit 35 | if editor.returnVariable == true 36 | switch editor.variableID 37 | case EDIT_VAR_PROPVAL // property value 38 | checkResult = object.propertyValue 39 | checkResult &= 1 40 | break 41 | 42 | case 0 // type 43 | checkResult = object.propertyValue 44 | checkResult &= 1 45 | break 46 | 47 | end switch 48 | else 49 | switch editor.variableID 50 | case EDIT_VAR_PROPVAL // property value 51 | object.propertyValue = editor.variableValue 52 | object.propertyValue &= 1 53 | break 54 | 55 | case 0 // type 56 | object.propertyValue = editor.variableValue 57 | object.propertyValue &= 1 58 | break 59 | 60 | end switch 61 | end if 62 | end event 63 | 64 | 65 | event RSDKDraw 66 | object.frame = object.propertyValue 67 | object.frame &= 1 68 | 69 | DrawSprite(object.frame) 70 | end event 71 | 72 | 73 | event RSDKLoad 74 | LoadSpriteSheet("MPZ/Objects.gif") 75 | SpriteFrame(-8, -32, 32, 8, 111, 83) 76 | SpriteFrame(-8, -32, 32, 8, 100, 126) 77 | 78 | AddEditorVariable("frameID") 79 | SetActiveVariable("frameID") 80 | AddEnumVariable("Left", 0) 81 | AddEnumVariable("Right", 1) 82 | end event 83 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Mission/BossSafty.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Safty Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // This Object is normally used in the Boss Rush for CPZ and OOZ - BR2/BR2Zone02 and BR7/BR2Zone07, respectively 9 | 10 | // ======================== 11 | // Aliases 12 | // ======================== 13 | 14 | private alias object.ypos : player.ypos 15 | 16 | 17 | // ======================== 18 | // Events 19 | // ======================== 20 | 21 | event ObjectUpdate 22 | if game.missionCondition == MISSION_CONDITION_CLEAR 23 | // If the Boss is defeated, then make sure the Player doesn't fall below where this Object is and die 24 | if player[0].ypos >= object.ypos 25 | player[0].ypos = object.ypos 26 | end if 27 | end if 28 | end event 29 | 30 | 31 | // ======================== 32 | // Editor Events 33 | // ======================== 34 | 35 | event RSDKDraw 36 | DrawSprite(0) 37 | 38 | // Ignoring editor.showGizmos on purpose 39 | 40 | editor.drawingOverlay = true 41 | 42 | temp0 = object.xpos 43 | temp0 -= 0x200000 44 | temp1 = temp0 45 | temp1 += 0x400000 46 | DrawLine(temp0, object.ypos, temp1, object.ypos, 255, 255, 255) 47 | 48 | editor.drawingOverlay = false 49 | end event 50 | 51 | 52 | event RSDKLoad 53 | LoadSpriteSheet("Global/Display.gif") 54 | SpriteFrame(-8, -8, 16, 16, 127, 113) 55 | 56 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 57 | end event 58 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Mission/ImmediateDeath.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: ImmediateDeath Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // This Object is used in Mission "Mercy" - M027 - Mission_Zone07 9 | 10 | // ======================== 11 | // Aliases 12 | // ======================== 13 | 14 | // Mission Function No. Aliases 15 | private alias 8 : MISSIONNO_MERCY 16 | 17 | 18 | // ======================== 19 | // Events 20 | // ======================== 21 | 22 | event ObjectStartup 23 | if stage.actNum == 1 24 | game.missionFunctionNo = MISSIONNO_MERCY 25 | game.missionValue = 0 26 | end if 27 | 28 | foreach (TypeName[ImmediateDeath], arrayPos0, ALL_ENTITIES) 29 | object[arrayPos0].priority = PRIORITY_INACTIVE 30 | next 31 | end event 32 | 33 | 34 | // ======================== 35 | // Editor Events 36 | // ======================== 37 | 38 | event RSDKDraw 39 | DrawSprite(0) 40 | end event 41 | 42 | 43 | event RSDKLoad 44 | LoadSpriteSheet("Global/Display.gif") 45 | SpriteFrame(-16, -16, 32, 32, 1, 143) 46 | 47 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 48 | end event 49 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Mission/MissionBlock.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: MissionBlock Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | // Player Aliases 13 | private alias object.type : player.type 14 | private alias object.state : player.state 15 | 16 | // Reserved Object Slot Aliases 17 | private alias 0 : SLOT_PLAYER1 18 | private alias 1 : SLOT_PLAYER2 19 | 20 | 21 | // ======================== 22 | // Events 23 | // ======================== 24 | 25 | event ObjectUpdate 26 | if player[SLOT_PLAYER1].state != Player_State_Drown 27 | BoxCollisionTest(C_SOLID, object.entityPos, -16, -16, 16, 16, SLOT_PLAYER1, C_BOX, C_BOX, C_BOX, C_BOX) 28 | 29 | if player[SLOT_PLAYER2].type != TypeName[Blank Object] // Shields are legally players, I guess 30 | // If Tails is with Sonic (the only mission this would apply to is Bodyguard), check against them too 31 | // No check if they're drowning or anything, just assume they're alive 32 | BoxCollisionTest(C_SOLID, object.entityPos, -16, -16, 16, 16, SLOT_PLAYER2, C_BOX, C_BOX, C_BOX, C_BOX) 33 | end if 34 | end if 35 | end event 36 | 37 | 38 | event ObjectDraw 39 | DrawSprite(0) 40 | end event 41 | 42 | 43 | event ObjectStartup 44 | LoadSpriteSheet("Mission/Objects.gif") 45 | SpriteFrame(-16, -16, 32, 32, 1, 18) // Mission Block Frame 46 | end event 47 | 48 | 49 | // ======================== 50 | // Editor Events 51 | // ======================== 52 | 53 | event RSDKDraw 54 | DrawSprite(0) 55 | end event 56 | 57 | 58 | event RSDKLoad 59 | LoadSpriteSheet("Mission/Objects.gif") 60 | SpriteFrame(-16, -16, 32, 32, 1, 18) 61 | 62 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 63 | end event 64 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Mission/PullUpWater.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: PullUpWater Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectUpdate 13 | foreach (TypeName[Water], arrayPos0, ALL_ENTITIES) 14 | object[arrayPos0].state = 1 15 | object[arrayPos0].ypos = stage.newWaterLevel 16 | next 17 | 18 | object.type = TypeName[Blank Object] 19 | end event 20 | 21 | 22 | event ObjectStartup 23 | foreach (TypeName[PullUpWater], arrayPos0, ALL_ENTITIES) 24 | object[arrayPos0].priority = PRIORITY_ACTIVE 25 | next 26 | end event 27 | 28 | 29 | // ======================== 30 | // Editor Events 31 | // ======================== 32 | 33 | event RSDKDraw 34 | object.inkEffect = INK_BLEND 35 | 36 | //GetObjectType(temp2, "Water") 37 | // wanna draw a line from the water y pos, but there's no good way to find where that is :( 38 | // TODO: do 39 | 40 | temp0 = object.xpos 41 | temp1 = 700 42 | temp1 += object.ypos 43 | while temp0 < temp1 44 | DrawSpriteFX(0, FX_INK, temp0, object.ypos) 45 | temp0 += 0x1000000 46 | loop 47 | end event 48 | 49 | 50 | event RSDKLoad 51 | LoadSpriteSheet("CPZ/Objects2.gif") 52 | SpriteFrame(0, -8, 256, 16, 0, 0) 53 | 54 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 55 | end event 56 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Mission/SetRingCount.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: SetRingCount Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // This Object is used in Mission "Super Sonic Finish" - M036 - Mission_Zone09 9 | // This Object is also used in its follow-up DLC Mission, "Extreme! Super Sonic Finish" - M104 - DLC_Zone06 10 | 11 | // This is normally paired with the SuperSonic Object to make the Player start Super with a certain amount of rings, 12 | // though it can work alone if needed (As S1 does in its LZ Mission) 13 | 14 | // ======================== 15 | // Aliases 16 | // ======================== 17 | 18 | // To be set from the Editor 19 | private alias object.value0 : object.ringCount 20 | 21 | // Player Aliases 22 | private alias object.value0 : player.rings 23 | 24 | 25 | // ======================== 26 | // Events 27 | // ======================== 28 | 29 | event ObjectStartup 30 | temp0 = 0 31 | foreach (TypeName[SetRingCount], arrayPos0, ALL_ENTITIES) 32 | if temp0 == 0 33 | temp0 = object[arrayPos0].ringCount 34 | end if 35 | next 36 | 37 | if temp0 != 0 38 | player[0].rings = temp0 39 | end if 40 | end event 41 | 42 | 43 | // ======================== 44 | // Editor Events 45 | // ======================== 46 | 47 | event RSDKDraw 48 | DrawSprite(0) 49 | end event 50 | 51 | 52 | event RSDKLoad 53 | LoadSpriteSheet("Global/Items.gif") 54 | SpriteFrame(-8, -8, 16, 16, 1, 1) 55 | 56 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 57 | SetVariableAlias(ALIAS_VAR_VAL0, "ringCount") 58 | end event 59 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/SCZ/HPropeller.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: H Propeller Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectUpdate 13 | 14 | end event 15 | 16 | 17 | event ObjectDraw 18 | DrawSprite(SCZSetup_hPropellerFrame) 19 | 20 | temp0 = object.ypos 21 | temp0 += 0x100000 22 | 23 | DrawSpriteXY(SCZSetup_hPropellerFrame, object.xpos, temp0) 24 | end event 25 | 26 | 27 | event ObjectStartup 28 | LoadSpriteSheet("SCZ/Objects.gif") 29 | 30 | // Propeller frames 31 | SpriteFrame(-62, -2, 124, 5, 1, 171) 32 | SpriteFrame(-40, -2, 78, 5, 1, 177) 33 | SpriteFrame(-24, -2, 46, 5, 1, 183) 34 | SpriteFrame(-11, -1, 22, 4, 1, 189) 35 | SpriteFrame(-22, -2, 46, 5, 1, 194) 36 | SpriteFrame(-39, -2, 79, 5, 1, 200) 37 | end event 38 | 39 | 40 | event RSDKDraw 41 | DrawSprite(0) 42 | end event 43 | 44 | 45 | event RSDKLoad 46 | LoadSpriteSheet("SCZ/Objects.gif") 47 | 48 | // Propeller frames 49 | SpriteFrame(-62, -2, 124, 5, 1, 171) 50 | 51 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 52 | end event 53 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/SCZ/ObjectActivator.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Object Activator Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // Object Name is a bit general, while yes this does indeed activate objects, 9 | // it's used pretty much only for triplets of Nebulas since they should all by synced together 10 | 11 | // ======================== 12 | // Aliases 13 | // ======================== 14 | 15 | private alias object.propertyValue : object.activateCount 16 | 17 | 18 | // ======================== 19 | // Events 20 | // ======================== 21 | 22 | event ObjectUpdate 23 | // Activate some following objects 24 | 25 | arrayPos0 = object.entityPos 26 | arrayPos0++ 27 | 28 | temp0 = 0 29 | 30 | while temp0 < object.activateCount 31 | object[arrayPos0].priority = PRIORITY_ACTIVE 32 | arrayPos0++ 33 | temp0++ 34 | loop 35 | 36 | // Clear this object, it's no longer needed 37 | object.type = TypeName[Blank Object] 38 | end event 39 | 40 | 41 | // ======================== 42 | // Editor Events 43 | // ======================== 44 | 45 | event RSDKDraw 46 | DrawSprite(0) 47 | 48 | if editor.showGizmos == true 49 | // draw a line to the objects that'll be activated 50 | 51 | temp0 = 0 52 | arrayPos1 = object.entityPos 53 | while temp0 < object.activateCount 54 | arrayPos1++ 55 | DrawLine(object.xpos, object.ypos, object[arrayPos1].xpos, object[arrayPos1].ypos, 0xFF, 0xFF, 0x00) 56 | temp0++ 57 | loop 58 | end if 59 | end event 60 | 61 | 62 | event RSDKLoad 63 | LoadSpriteSheet("Global/Display.gif") 64 | SpriteFrame(-8, -8, 16, 16, 168, 18) // "Trigger" - #0 65 | 66 | SetVariableAlias(ALIAS_VAR_PROPVAL, "activateCount") 67 | end event 68 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/SCZ/VPropeller.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: V Propeller Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Events 10 | // ======================== 11 | 12 | event ObjectUpdate 13 | temp0 = object.xpos 14 | temp0 >>= 16 15 | temp0 -= camera[0].xpos 16 | Abs(temp0) 17 | temp0 -= 96 18 | if temp0 < screen.xcenter 19 | temp0 = object.ypos 20 | temp0 >>= 16 21 | temp0 -= camera[0].ypos 22 | Abs(temp0) 23 | if temp0 < 160 24 | temp0 = oscillation 25 | temp0 &= 0x1F 26 | if temp0 == 0 27 | PlaySfx(SfxName[Helicopter], false) 28 | end if 29 | end if 30 | end if 31 | end event 32 | 33 | 34 | event ObjectDraw 35 | DrawSprite(SCZSetup_vPropellerFrame) 36 | end event 37 | 38 | 39 | event ObjectStartup 40 | LoadSpriteSheet("SCZ/Objects.gif") 41 | SpriteFrame(-4, -64, 8, 64, 121, 106) 42 | SpriteFrame(-4, -32, 8, 64, 121, 106) 43 | SpriteFrame(-4, 0, 8, 64, 121, 106) 44 | end event 45 | 46 | 47 | // ======================== 48 | // Editor Events 49 | // ======================== 50 | 51 | event RSDKDraw 52 | DrawSprite(0) 53 | end event 54 | 55 | 56 | event RSDKLoad 57 | LoadSpriteSheet("SCZ/Objects.gif") 58 | SpriteFrame(-4, -64, 8, 64, 121, 106) 59 | 60 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 61 | end event 62 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Special/LoseRing.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Lose Ring Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | private alias object.value1 : object.gravityStrength 14 | 15 | 16 | 17 | // ======================== 18 | // Events 19 | // ======================== 20 | 21 | event ObjectUpdate 22 | object.yvel += object.gravityStrength 23 | 24 | object.xpos += object.xvel 25 | object.ypos += object.yvel 26 | 27 | if object.scale < 0x200 28 | object.scale += 0x10 29 | end if 30 | 31 | object.animationTimer += object.animationSpeed 32 | if object.animationTimer >= 0x100 33 | object.animationTimer -= 0x100 34 | object.frame++ 35 | if object.frame == 8 36 | object.frame = 0 37 | end if 38 | end if 39 | 40 | if object.timer < 90 41 | object.timer++ 42 | else 43 | object.type = TypeName[Blank Object] 44 | end if 45 | end event 46 | 47 | 48 | event ObjectDraw 49 | temp0 = object.xpos 50 | temp0 >>= 16 51 | temp0 += screen.xcenter 52 | 53 | temp1 = object.ypos 54 | temp1 >>= 16 55 | 56 | DrawSpriteScreenFX(object.frame, FX_SCALE, temp0, temp1) 57 | end event 58 | 59 | 60 | event ObjectStartup 61 | LoadSpriteSheet("Special/Objects.gif") 62 | SpriteFrame(-16, -16, 32, 32, 34, 1) // Ring Frame 1 - #0 63 | SpriteFrame(-16, -16, 32, 32, 67, 1) // Ring Frame 2 - #1 64 | SpriteFrame(-16, -16, 32, 32, 100, 1) // Ring Frame 3 - #2 65 | SpriteFrame(-16, -16, 32, 32, 133, 1) // Ring Frame 4 - #3 66 | SpriteFrame(-16, -16, 32, 32, 166, 1) // Ring Frame 5 - #4 67 | SpriteFrame(-16, -16, 32, 32, 199, 1) // Ring Frame 6 - #5 68 | SpriteFrame(-16, -16, 32, 32, 1, 34) // Ring Frame 7 - #6 69 | SpriteFrame(-16, -16, 32, 32, 34, 34) // Ring Frame 8 - #7 70 | end event 71 | 72 | 73 | // ======================== 74 | // Editor Events 75 | // ======================== 76 | 77 | event RSDKDraw 78 | DrawSprite(0) 79 | end event 80 | 81 | 82 | event RSDKLoad 83 | LoadSpriteSheet("Special/Objects.gif") 84 | SpriteFrame(-8, -8, 16, 16, 233, 0) 85 | 86 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 87 | end event 88 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Special/RingReminder.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Rings Reminder Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value1 : object.localPos.x // unused, required for halfpipe stuff though 13 | private alias object.value2 : object.localPos.y // unused, required for halfpipe stuff though 14 | private alias object.value3 : object.localPos.z 15 | private alias object.value4 : object.worldPos.x // unused, required for halfpipe stuff though 16 | private alias object.value5 : object.worldPos.y // unused, required for halfpipe stuff though 17 | private alias object.value6 : object.worldPos.z // unused, required for halfpipe stuff though 18 | 19 | // Text Message Property Values 20 | private alias 3 : TEXTMESSAGE_RINGREMINDER 21 | 22 | // Player Aliases 23 | private alias object.value14 : player.localPos.z 24 | 25 | 26 | // ======================== 27 | // Events 28 | // ======================== 29 | 30 | event ObjectUpdate 31 | foreach (TypeName[Player Object], currentPlayer, ACTIVE_ENTITIES) 32 | temp1 = object.localPos.z 33 | temp1 -= 0x20000 34 | temp2 = object.localPos.z 35 | temp2 += 0x20000 36 | if player[currentPlayer].localPos.z > temp1 37 | if player[currentPlayer].localPos.z < temp2 38 | ResetObjectEntity(object.entityPos, TypeName[Blank Object], 0, 0, 0) 39 | ResetObjectEntity(11, TypeName[Text Message], TEXTMESSAGE_RINGREMINDER, 0, 0) 40 | object[11].priority = PRIORITY_ACTIVE 41 | #platform: USE_STANDALONE 42 | object[11].drawOrder = 5 43 | #endplatform 44 | #platform: USE_ORIGINS 45 | object[11].drawOrder = 6 46 | #endplatform 47 | end if 48 | end if 49 | next 50 | end event 51 | 52 | 53 | // ======================== 54 | // Editor Events 55 | // ======================== 56 | 57 | event RSDKDraw 58 | DrawSprite(0) 59 | end event 60 | 61 | 62 | event RSDKLoad 63 | LoadSpriteSheet("Special/Objects.gif") 64 | SpriteFrame(-8, -8, 16, 16, 348, 83) 65 | 66 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 67 | end event 68 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Title/STScreen.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: ST Screen Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | // States 15 | private alias 0 : STSCREEN_SETUP 16 | private alias 1 : STSCREEN_FADEIN 17 | private alias 2 : STSCREEN_SHOWSCREEN 18 | private alias 3 : STSCREEN_FADEOUT 19 | 20 | 21 | // ======================== 22 | // Events 23 | // ======================== 24 | 25 | event ObjectUpdate 26 | switch object.state 27 | case STSCREEN_SETUP 28 | stage.activeLayer[0] = 1 // Show the "Sonic And Tails In" Screen layer 29 | object.timer = 320 30 | object.state++ 31 | SetScreenFade(0x00, 0x00, 0x00, 0xFF) 32 | break 33 | 34 | case STSCREEN_FADEIN 35 | if object.timer > 0 36 | object.timer -= 16 37 | else 38 | object.state++ 39 | end if 40 | SetScreenFade(0x00, 0x00, 0x00, object.timer) 41 | break 42 | 43 | case STSCREEN_SHOWSCREEN 44 | object.timer++ 45 | if object.timer == 90 46 | object.timer = 0 47 | object.state++ 48 | end if 49 | break 50 | 51 | case STSCREEN_FADEOUT 52 | if object.timer < 320 53 | object.timer += 12 54 | else 55 | ResetObjectEntity(object.entityPos, TypeName[ST Logo], 0, object.xpos, object.ypos) 56 | end if 57 | SetScreenFade(0x00, 0x00, 0x00, object.timer) 58 | break 59 | 60 | end switch 61 | 62 | temp0 = screen.xcenter 63 | FlipSign(temp0) 64 | temp0 += 256 65 | screen.xoffset = temp0 66 | end event 67 | 68 | 69 | // ======================== 70 | // Editor Events 71 | // ======================== 72 | 73 | event RSDKDraw 74 | DrawSprite(0) 75 | end event 76 | 77 | 78 | event RSDKLoad 79 | LoadSpriteSheet("Global/Display.gif") 80 | SpriteFrame(-16, -16, 32, 32, 1, 143) 81 | 82 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 83 | end event 84 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/Title/ShootingStar.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Shooting Star Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.delay 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectUpdate 20 | if object.delay > 0 21 | object.delay-- 22 | else 23 | object.xpos -= 0x20000 24 | object.ypos += 0x10000 25 | if object.ypos > 0x1000000 26 | object.type = TypeName[Blank Object] 27 | end if 28 | 29 | object.frame = object.animationTimer 30 | object.frame >>= 2 31 | object.animationTimer++ 32 | object.animationTimer &= 7 33 | end if 34 | end event 35 | 36 | 37 | event ObjectDraw 38 | DrawSprite(object.frame) 39 | end event 40 | 41 | 42 | event ObjectStartup 43 | LoadSpriteSheet("Title/Title.gif") 44 | SpriteFrame(-4, -4, 7, 7, 417, 59) 45 | SpriteFrame(-3, -3, 5, 5, 465, 61) 46 | end event 47 | 48 | 49 | // ======================== 50 | // Editor Events 51 | // ======================== 52 | 53 | event RSDKDraw 54 | DrawSprite(0) 55 | end event 56 | 57 | 58 | event RSDKLoad 59 | LoadSpriteSheet("Title/Title.gif") 60 | SpriteFrame(-4, -4, 7, 7, 417, 59) 61 | 62 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 63 | end event 64 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/WFZ/CockpitBackground.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Cockpit Background Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | 9 | // ======================== 10 | // Events 11 | // ======================== 12 | 13 | event ObjectUpdate 14 | // empty :( 15 | end event 16 | 17 | 18 | event ObjectDraw 19 | DrawSprite(0) 20 | end event 21 | 22 | 23 | event ObjectStartup 24 | LoadSpriteSheet("SCZ/Objects.gif") 25 | SpriteFrame(-4, -16, 8, 32, 194, 99) 26 | end event 27 | 28 | 29 | // ======================== 30 | // Editor Events 31 | // ======================== 32 | 33 | event RSDKDraw 34 | DrawSprite(0) 35 | end event 36 | 37 | 38 | event RSDKLoad 39 | LoadSpriteSheet("SCZ/Objects.gif") 40 | SpriteFrame(-4, -16, 8, 32, 194, 99) 41 | 42 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 43 | end event 44 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/WFZ/ConveyorBelt.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Conveyor Belt Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value1 : object.hitbox.left 13 | private alias object.value2 : object.hitbox.right 14 | 15 | // Player Aliases 16 | private alias object.xpos : player.xpos 17 | private alias object.gravity : player.gravity 18 | 19 | 20 | // ======================== 21 | // Events 22 | // ======================== 23 | 24 | event ObjectUpdate 25 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 26 | if player[currentPlayer].gravity == GRAVITY_GROUND 27 | BoxCollisionTest(C_TOUCH, object.entityPos, object.hitbox.left, -24, object.hitbox.right, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 28 | if checkResult == true 29 | player[currentPlayer].xpos -= 0x20000 30 | end if 31 | end if 32 | next 33 | end event 34 | 35 | 36 | event ObjectStartup 37 | foreach (TypeName[Conveyor Belt], arrayPos0, ALL_ENTITIES) 38 | object[arrayPos0].hitbox.left = object[arrayPos0].propertyValue 39 | object[arrayPos0].hitbox.left <<= 3 40 | object[arrayPos0].hitbox.right = object[arrayPos0].hitbox.left 41 | FlipSign(object[arrayPos0].hitbox.left) 42 | next 43 | end event 44 | 45 | 46 | // ======================== 47 | // Editor Events 48 | // ======================== 49 | 50 | event RSDKDraw 51 | DrawSprite(0) 52 | end event 53 | 54 | 55 | event RSDKLoad 56 | LoadSpriteSheet("Global/Display.gif") 57 | SpriteFrame(-16, -16, 32, 32, 1, 143) 58 | 59 | SetVariableAlias(ALIAS_VAR_PROPVAL, "size") 60 | end event 61 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/WFZ/ConveyorWheel.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Conveyor Wheel Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | 9 | // ======================== 10 | // Events 11 | // ======================== 12 | 13 | event ObjectUpdate 14 | // empty :( 15 | end event 16 | 17 | 18 | event ObjectDraw 19 | DrawSprite(0) 20 | end event 21 | 22 | 23 | event ObjectStartup 24 | LoadSpriteSheet("SCZ/Objects.gif") 25 | SpriteFrame(-16, -16, 32, 32, 203, 119) 26 | 27 | foreach (TypeName[Conveyor Wheel], arrayPos0, ALL_ENTITIES) 28 | object[arrayPos0].drawOrder = 5 29 | next 30 | end event 31 | 32 | 33 | // ======================== 34 | // Editor Events 35 | // ======================== 36 | 37 | event RSDKDraw 38 | DrawSprite(0) 39 | end event 40 | 41 | 42 | event RSDKLoad 43 | LoadSpriteSheet("SCZ/Objects.gif") 44 | SpriteFrame(-16, -16, 32, 32, 203, 119) 45 | 46 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 47 | end event 48 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/WFZ/EggmanThruster.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Eggman Thruster Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.interval 13 | 14 | 15 | // ======================== 16 | // Events 17 | // ======================== 18 | 19 | event ObjectUpdate 20 | // empty :( 21 | end event 22 | 23 | 24 | event ObjectDraw 25 | temp0 = oscillation 26 | temp0 += object.propertyValue 27 | temp0 &= 1 28 | temp0 &= object.interval 29 | if temp0 == 1 30 | DrawSprite(0) 31 | end if 32 | end event 33 | 34 | 35 | event ObjectStartup 36 | LoadSpriteSheet("SCZ/Objects.gif") 37 | SpriteFrame(-16, -14, 32, 28, 203, 90) 38 | 39 | foreach (TypeName[Eggman Thruster], arrayPos0, ALL_ENTITIES) 40 | if object[arrayPos0].propertyValue == 0 41 | object[arrayPos0].interval = 1 42 | end if 43 | next 44 | end event 45 | 46 | 47 | // ======================== 48 | // Editor Events 49 | // ======================== 50 | 51 | event RSDKEdit 52 | if editor.returnVariable == true 53 | switch editor.variableID 54 | case EDIT_VAR_PROPVAL // property value 55 | checkResult = object.propertyValue 56 | break 57 | 58 | case 0 // type 59 | checkResult = object.propertyValue 60 | break 61 | 62 | end switch 63 | else 64 | switch editor.variableID 65 | case EDIT_VAR_PROPVAL // property value 66 | object.propertyValue = editor.variableValue 67 | break 68 | 69 | case 0 // type 70 | object.propertyValue = editor.variableValue 71 | break 72 | 73 | end switch 74 | end if 75 | end event 76 | 77 | 78 | event RSDKDraw 79 | DrawSprite(0) 80 | end event 81 | 82 | 83 | event RSDKLoad 84 | LoadSpriteSheet("SCZ/Objects.gif") 85 | SpriteFrame(-16, -14, 32, 28, 203, 90) 86 | 87 | AddEditorVariable("type") 88 | SetActiveVariable("type") 89 | AddEnumVariable("Start Active", 0) 90 | AddEnumVariable("Start Inactive", 1) 91 | end event 92 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/WFZ/Hull.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Hull Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | // States 13 | private alias 0 : HULL_CLOSED 14 | private alias 1 : HULL_OPEN 15 | 16 | 17 | // ======================== 18 | // Events 19 | // ======================== 20 | 21 | event ObjectUpdate 22 | if object.state == HULL_OPEN 23 | object.alpha -= 8 24 | if object.alpha <= 0 25 | object.type = TypeName[Blank Object] 26 | end if 27 | end if 28 | end event 29 | 30 | 31 | event ObjectDraw 32 | if object.state == HULL_CLOSED 33 | DrawSprite(0) 34 | else 35 | DrawSpriteFX(0, FX_INK, object.xpos, object.ypos) 36 | end if 37 | end event 38 | 39 | 40 | event ObjectStartup 41 | LoadSpriteSheet("SCZ/Objects2.gif") 42 | SpriteFrame(-256, -96, 512, 192, 0, 0) 43 | 44 | foreach (TypeName[Hull], arrayPos0, ALL_ENTITIES) 45 | object[arrayPos0].drawOrder = 5 46 | object[arrayPos0].priority = PRIORITY_ACTIVE 47 | next 48 | end event 49 | 50 | 51 | // ======================== 52 | // Editor Events 53 | // ======================== 54 | 55 | event RSDKDraw 56 | DrawSprite(0) 57 | end event 58 | 59 | 60 | event RSDKLoad 61 | LoadSpriteSheet("SCZ/Objects2.gif") 62 | SpriteFrame(-256, -96, 512, 192, 0, 0) 63 | 64 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 65 | end event 66 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/WFZ/LargeLaser.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Large Laser Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Function Declarations 10 | // ======================== 11 | 12 | reserve function LargeLaser_DebugDraw 13 | reserve function LargeLaser_DebugSpawn 14 | 15 | 16 | // ======================== 17 | // Function Definitions 18 | // ======================== 19 | 20 | private function LargeLaser_DebugDraw 21 | DrawSprite(0) 22 | end function 23 | 24 | 25 | private function LargeLaser_DebugSpawn 26 | CreateTempObject(TypeName[Large Laser], 0, object.xpos, object.ypos) 27 | object[tempObjectPos].inkEffect = INK_ALPHA 28 | object[tempObjectPos].alpha = 0xC0 29 | end function 30 | 31 | 32 | // ======================== 33 | // Events 34 | // ======================== 35 | 36 | event ObjectUpdate 37 | object.animationTimer++ 38 | if object.animationTimer == 1 39 | PlaySfx(SfxName[Thruster], false) 40 | end if 41 | 42 | if object.animationTimer >= 64 43 | object.type = TypeName[Blank Object] 44 | end if 45 | 46 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 47 | BoxCollisionTest(C_TOUCH, object.entityPos, -24, -112, 24, 112, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 48 | if checkResult == true 49 | CallFunction(Player_Hit) 50 | end if 51 | next 52 | end event 53 | 54 | 55 | event ObjectDraw 56 | DrawSpriteFX(0, FX_INK, object.xpos, object.ypos) 57 | end event 58 | 59 | 60 | event ObjectStartup 61 | LoadSpriteSheet("SCZ/Objects.gif") 62 | SpriteFrame(-24, -112, 48, 256, 464, 0) 63 | 64 | foreach (TypeName[Large Laser], arrayPos0, ALL_ENTITIES) 65 | object[arrayPos0].inkEffect = INK_ALPHA 66 | object[arrayPos0].alpha = 0xC0 67 | next 68 | 69 | SetTableValue(TypeName[Large Laser], DebugMode_ObjCount, DebugMode_TypesTable) 70 | SetTableValue(LargeLaser_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable) 71 | SetTableValue(LargeLaser_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable) 72 | DebugMode_ObjCount++ 73 | end event 74 | 75 | 76 | // ======================== 77 | // Editor Events 78 | // ======================== 79 | 80 | event RSDKDraw 81 | DrawSprite(0) 82 | end event 83 | 84 | 85 | event RSDKLoad 86 | LoadSpriteSheet("SCZ/Objects.gif") 87 | SpriteFrame(-24, -112, 48, 256, 464, 0) 88 | 89 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 90 | end event 91 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/WFZ/Laser.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Laser Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | // States 13 | private alias 0 : LASER_WAITING 14 | private alias 1 : LASER_FIRED 15 | 16 | // Player Aliases 17 | private alias object.xpos : player.xpos 18 | 19 | 20 | // ======================== 21 | // Events 22 | // ======================== 23 | 24 | event ObjectUpdate 25 | if object.state == LASER_WAITING 26 | temp0 = object.xpos 27 | temp0 -= 0xE80000 28 | if player[0].xpos >= temp0 29 | if player[0].xpos < object.xpos 30 | PlaySfx(SfxName[Medium Laser], false) 31 | end if 32 | 33 | object.state++ 34 | end if 35 | else 36 | if object.alpha < 0x100 37 | object.alpha += 0x10 38 | end if 39 | 40 | object.xpos -= 0x100000 41 | if object.outOfBounds == true 42 | object.type = TypeName[Blank Object] 43 | end if 44 | end if 45 | end event 46 | 47 | 48 | event ObjectDraw 49 | if object.state == LASER_FIRED 50 | DrawSpriteFX(0, FX_INK, object.xpos, object.ypos) 51 | end if 52 | end event 53 | 54 | 55 | event ObjectStartup 56 | LoadSpriteSheet("SCZ/Objects.gif") 57 | SpriteFrame(-72, -8, 144, 16, 81, 198) 58 | 59 | foreach (TypeName[Laser], arrayPos0, ALL_ENTITIES) 60 | object[arrayPos0].drawOrder = 5 61 | object[arrayPos0].inkEffect = INK_ALPHA 62 | object[arrayPos0].priority = PRIORITY_ACTIVE 63 | next 64 | end event 65 | 66 | 67 | // ======================== 68 | // Editor Events 69 | // ======================== 70 | 71 | event RSDKDraw 72 | DrawSprite(0) 73 | end event 74 | 75 | 76 | event RSDKLoad 77 | LoadSpriteSheet("SCZ/Objects.gif") 78 | SpriteFrame(-72, -8, 144, 16, 81, 198) 79 | 80 | // Normally set to 118 in the scene for some reason, that value's unused though 81 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 82 | end event 83 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/WFZ/ShipFG.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Ship FG Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | 9 | // ======================== 10 | // Events 11 | // ======================== 12 | 13 | event ObjectDraw 14 | DrawSprite(object.propertyValue) 15 | end event 16 | 17 | 18 | event ObjectStartup 19 | LoadSpriteSheet("SCZ/Objects.gif") 20 | SpriteFrame(-32, -16, 64, 32, 153, 223) 21 | SpriteFrame(-40, -8, 80, 16, 344, 157) 22 | SpriteFrame(-8, -8, 16, 16, 344, 157) 23 | SpriteFrame(-40, -8, 64, 16, 344, 141) 24 | SpriteFrame(-16, -8, 32, 16, 392, 141) 25 | SpriteFrame(-16, -8, 32, 16, 392, 157) 26 | SpriteFrame(-32, -4, 64, 8, 153, 215) 27 | SpriteFrame(-8, -4, 16, 8, 344, 141) 28 | SpriteFrame(-40, -4, 80, 8, 72, 247) 29 | 30 | foreach (TypeName[Ship FG], arrayPos0, ALL_ENTITIES) 31 | object[arrayPos0].drawOrder = 5 32 | next 33 | end event 34 | 35 | 36 | // ======================== 37 | // Editor Events 38 | // ======================== 39 | 40 | event RSDKDraw 41 | DrawSprite(object.propertyValue) 42 | end event 43 | 44 | 45 | event RSDKLoad 46 | LoadSpriteSheet("SCZ/Objects.gif") 47 | SpriteFrame(-32, -16, 64, 32, 153, 223) 48 | SpriteFrame(-40, -8, 80, 16, 344, 157) 49 | SpriteFrame(-8, -8, 16, 16, 344, 157) 50 | SpriteFrame(-40, -8, 64, 16, 344, 141) 51 | SpriteFrame(-16, -8, 32, 16, 392, 141) 52 | SpriteFrame(-16, -8, 32, 16, 392, 157) 53 | SpriteFrame(-32, -4, 64, 8, 153, 215) 54 | SpriteFrame(-8, -4, 16, 8, 344, 141) 55 | SpriteFrame(-40, -4, 80, 8, 72, 247) 56 | 57 | SetVariableAlias(ALIAS_VAR_PROPVAL, "frameID") 58 | end event 59 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/WFZ/TornadoExplosion.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: T Explosion Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | private alias object.value0 : object.timer 13 | 14 | 15 | // ======================== 16 | // Tables 17 | // ======================== 18 | 19 | private table TExplosion_explosionDurations 20 | 4, 8, 8, 8, 8 21 | end table 22 | 23 | 24 | // ======================== 25 | // Events 26 | // ======================== 27 | 28 | event ObjectUpdate 29 | object.xpos -= 0x10000 30 | object.ypos -= 0x10000 31 | 32 | object.timer++ 33 | GetTableValue(temp0, object.frame, TExplosion_explosionDurations) 34 | 35 | if object.timer > temp0 36 | object.timer = 0 37 | object.frame++ 38 | if object.frame > 4 39 | object.type = TypeName[Blank Object] 40 | object.frame = 0 41 | end if 42 | end if 43 | end event 44 | 45 | 46 | event ObjectDraw 47 | DrawSprite(object.frame) 48 | end event 49 | 50 | 51 | event ObjectStartup 52 | LoadSpriteSheet("Global/Items2.gif") 53 | SpriteFrame(-8, -8, 16, 16, 230, 18) 54 | SpriteFrame(-16, -16, 32, 32, 1, 1) 55 | SpriteFrame(-16, -16, 32, 32, 1, 34) 56 | SpriteFrame(-16, -16, 32, 32, 1, 67) 57 | SpriteFrame(-16, -16, 32, 32, 1, 100) 58 | end event 59 | 60 | 61 | // ======================== 62 | // Editor Events 63 | // ======================== 64 | 65 | event RSDKDraw 66 | DrawSprite(0) 67 | end event 68 | 69 | 70 | event RSDKLoad 71 | LoadSpriteSheet("Global/Items2.gif") 72 | SpriteFrame(-8, -8, 16, 16, 230, 18) 73 | 74 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 75 | end event 76 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/WFZ/TurretBullet.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: Turret Bullet Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Aliases 10 | // ======================== 11 | 12 | event ObjectUpdate 13 | object.xpos += object.xvel 14 | object.ypos += object.yvel 15 | 16 | object.animationTimer++ 17 | if object.animationTimer >= 3 18 | object.animationTimer = 0 19 | object.frame ^= 1 20 | end if 21 | 22 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 23 | BoxCollisionTest(C_TOUCH, object.entityPos, -4, -4, 4, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 24 | if checkResult == true 25 | CallFunction(Player_ProjectileHit) 26 | end if 27 | next 28 | 29 | temp0 = object.xpos 30 | temp0 >>= 16 31 | temp0 -= camera[0].xpos 32 | Abs(temp0) 33 | temp0 -= 32 34 | 35 | temp1 = object.ypos 36 | temp1 >>= 16 37 | temp1 -= camera[0].ypos 38 | Abs(temp1) 39 | temp1 -= 32 40 | 41 | if temp0 >= screen.xcenter 42 | object.type = TypeName[Blank Object] 43 | end if 44 | 45 | if temp1 >= screen.ycenter 46 | object.type = TypeName[Blank Object] 47 | end if 48 | end event 49 | 50 | 51 | event ObjectDraw 52 | DrawSprite(object.frame) 53 | end event 54 | 55 | 56 | event ObjectStartup 57 | CheckCurrentStageFolder("Zone11") 58 | if checkResult == true 59 | LoadSpriteSheet("SCZ/Objects.gif") 60 | SpriteFrame(-4, -4, 8, 8, 442, 79) 61 | SpriteFrame(-4, -4, 8, 8, 451, 79) 62 | else 63 | LoadSpriteSheet("MBZ/Objects.gif") 64 | SpriteFrame(-4, -4, 8, 8, 973, 677) 65 | SpriteFrame(-4, -4, 8, 8, 982, 677) 66 | end if 67 | end event 68 | 69 | 70 | // ======================== 71 | // Function Definitions 72 | // ======================== 73 | 74 | event RSDKDraw 75 | DrawSprite(0) 76 | end event 77 | 78 | 79 | event RSDKLoad 80 | CheckCurrentStageFolder("Zone11") 81 | if checkResult == true 82 | LoadSpriteSheet("SCZ/Objects.gif") 83 | SpriteFrame(-4, -4, 8, 8, 442, 79) 84 | else 85 | LoadSpriteSheet("MBZ/Objects.gif") 86 | SpriteFrame(-4, -4, 8, 8, 973, 677) 87 | end if 88 | 89 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 90 | end event 91 | -------------------------------------------------------------------------------- /Sonic 2/Scripts/WFZ/VPropeller.txt: -------------------------------------------------------------------------------- 1 | // ---------------------------------- 2 | // RSDK Project: Sonic 2 3 | // Script Description: V Propeller Object 4 | // Script Author: Christian Whitehead/Simon Thomley 5 | // Unpacked by Rubberduckycooly's script unpacker 6 | // ---------------------------------- 7 | 8 | // ======================== 9 | // Function Declarations 10 | // ======================== 11 | 12 | reserve function VPropeller_DebugDraw 13 | reserve function VPropeller_DebugSpawn 14 | 15 | 16 | // ======================== 17 | // Function Definitions 18 | // ======================== 19 | 20 | private function VPropeller_DebugDraw 21 | DrawSprite(0) 22 | end function 23 | 24 | 25 | private function VPropeller_DebugSpawn 26 | CreateTempObject(TypeName[V Propeller], 0, object.xpos, object.ypos) 27 | end function 28 | 29 | 30 | // ======================== 31 | // Events 32 | // ======================== 33 | 34 | event ObjectUpdate 35 | temp0 = object.xpos 36 | temp0 >>= 16 37 | temp0 -= camera[0].xpos 38 | Abs(temp0) 39 | temp0 -= 96 40 | if temp0 < screen.xcenter 41 | temp0 = object.ypos 42 | temp0 >>= 16 43 | temp0 -= camera[0].ypos 44 | Abs(temp0) 45 | if temp0 < 160 46 | temp0 = oscillation 47 | temp0 &= 0x1F 48 | if temp0 == 0 49 | PlaySfx(SfxName[Helicopter], false) 50 | end if 51 | end if 52 | end if 53 | 54 | foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES) 55 | BoxCollisionTest(C_TOUCH, object.entityPos, -4, -64, 4, 64, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX) 56 | if checkResult == true 57 | CallFunction(Player_Hit) 58 | end if 59 | next 60 | end event 61 | 62 | 63 | event ObjectDraw 64 | DrawSprite(WFZSetup_vPropellerFrame) 65 | end event 66 | 67 | 68 | event ObjectStartup 69 | LoadSpriteSheet("SCZ/Objects.gif") 70 | SpriteFrame(-4, -64, 8, 64, 121, 106) 71 | SpriteFrame(-4, -32, 8, 64, 121, 106) 72 | SpriteFrame(-4, 0, 8, 64, 121, 106) 73 | 74 | SetTableValue(TypeName[V Propeller], DebugMode_ObjCount, DebugMode_TypesTable) 75 | SetTableValue(VPropeller_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable) 76 | SetTableValue(VPropeller_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable) 77 | DebugMode_ObjCount++ 78 | end event 79 | 80 | 81 | // ======================== 82 | // Editor Events 83 | // ======================== 84 | 85 | event RSDKDraw 86 | DrawSprite(0) 87 | end event 88 | 89 | 90 | event RSDKLoad 91 | LoadSpriteSheet("SCZ/Objects.gif") 92 | SpriteFrame(-4, -64, 8, 64, 121, 106) 93 | 94 | SetVariableAlias(ALIAS_VAR_PROPVAL, "unused") 95 | end event 96 | --------------------------------------------------------------------------------