diff --git a/data/dynos.cpp.h b/data/dynos.cpp.h index 49b49a98..b18ee9f5 100644 --- a/data/dynos.cpp.h +++ b/data/dynos.cpp.h @@ -4,8 +4,6 @@ #include "dynos.h" -#include - extern "C" { #include "engine/behavior_script.h" #include "engine/math_util.h" @@ -958,5 +956,8 @@ void DynOS_Bhv_GeneratePack(const SysPath &aPackFolder); s64 DynOS_Bhv_ParseBehaviorScriptConstants(const String &_Arg, bool *found); s64 DynOS_Bhv_ParseBehaviorIntegerScriptConstants(const String &_Arg, bool *found); +s64 DynOS_Common_ParseBhvConstants(const String &_Arg, bool *found); +s64 DynOS_Common_ParseModelConstants(const String &_Arg, bool *found); + #endif #endif diff --git a/data/dynos_bin_behavior.cpp b/data/dynos_bin_behavior.cpp index b10e0fe1..33dcef3b 100644 --- a/data/dynos_bin_behavior.cpp +++ b/data/dynos_bin_behavior.cpp @@ -73,10 +73,15 @@ void ClearBhvDataNodes(DataNodes &aDataNodes) { s64 DynOS_Bhv_ParseBehaviorIntegerScriptConstants(const String &_Arg, bool *found) { *found = true; - + + // Behavior names + s64 cBhvConstant = DynOS_Common_ParseBhvConstants(_Arg, found); + if (*found) { return cBhvConstant; } + *found = true; // reset found value + // All of these eveluate down into a integer which can be worked with. // Be it for flags or otherwise. - + // Active Flags bhv_constant(ACTIVE_FLAG_DEACTIVATED); bhv_constant(ACTIVE_FLAG_ACTIVE); @@ -126,9 +131,9 @@ s64 DynOS_Bhv_ParseBehaviorIntegerScriptConstants(const String &_Arg, bool *foun bhv_constant(INTERACT_IGLOO_BARRIER); bhv_constant(INTERACT_PLAYER); - + // Interact Subtype Flags - + // INTERACT_WARP bhv_constant(INT_SUBTYPE_FADING_WARP); @@ -218,561 +223,17 @@ s64 DynOS_Bhv_ParseBehaviorIntegerScriptConstants(const String &_Arg, bool *foun bhv_constant(ACTIVE_PARTICLE_BREATH); bhv_constant(ACTIVE_PARTICLE_V_STAR); bhv_constant(ACTIVE_PARTICLE_TRIANGLE); - + // Other constants bhv_constant(NULL); bhv_constant(FALSE); - + *found = false; return 0; } s64 DynOS_Bhv_ParseBehaviorScriptConstants(const String &_Arg, bool *found) { *found = true; - - // Behavior names - bhv_constant(bhvStarDoor); - bhv_constant(bhvMrI); - bhv_constant(bhvMrIBody); - bhv_constant(bhvMrIParticle); - bhv_constant(bhvPurpleParticle); - bhv_constant(bhvGiantPole); - bhv_constant(bhvPoleGrabbing); - bhv_constant(bhvThiHugeIslandTop); - bhv_constant(bhvThiTinyIslandTop); - bhv_constant(bhvCapSwitchBase); - bhv_constant(bhvCapSwitch); - bhv_constant(bhvKingBobomb); - bhv_constant(bhvBobombAnchorMario); - bhv_constant(bhvBetaChestBottom); - bhv_constant(bhvBetaChestLid); - bhv_constant(bhvBubbleParticleSpawner); - bhv_constant(bhvBubbleMaybe); - bhv_constant(bhvBubblePlayer); - bhv_constant(bhvSmallWaterWave); - bhv_constant(bhvSmallWaterWave398); - bhv_constant(bhvWaterAirBubble); - bhv_constant(bhvSmallParticle); - bhv_constant(bhvPlungeBubble); - bhv_constant(bhvSmallParticleSnow); - bhv_constant(bhvSmallParticleBubbles); - bhv_constant(bhvFishGroup); - bhv_constant(bhvCannon); - bhv_constant(bhvCannonBarrel); - bhv_constant(bhvCannonBaseUnused); - bhv_constant(bhvChuckya); - bhv_constant(bhvChuckyaAnchorMario); - bhv_constant(bhvUnused05A8); - bhv_constant(bhvRotatingPlatform); - bhv_constant(bhvTower); - bhv_constant(bhvBulletBillCannon); - bhv_constant(bhvWfBreakableWallRight); - bhv_constant(bhvWfBreakableWallLeft); - bhv_constant(bhvKickableBoard); - bhv_constant(bhvTowerDoor); - bhv_constant(bhvRotatingCounterClockwise); - bhv_constant(bhvWfRotatingWoodenPlatform); - bhv_constant(bhvKoopaShellUnderwater); - bhv_constant(bhvExitPodiumWarp); - bhv_constant(bhvFadingWarp); - bhv_constant(bhvWarp); - bhv_constant(bhvWarpPipe); - bhv_constant(bhvWhitePuffExplosion); - bhv_constant(bhvSpawnedStar); - bhv_constant(bhvSpawnedStarNoLevelExit); - bhv_constant(bhvMrIBlueCoin); - bhv_constant(bhvCoinInsideBoo); - bhv_constant(bhvCoinFormationSpawn); - bhv_constant(bhvCoinFormation); - bhv_constant(bhvOneCoin); - bhv_constant(bhvYellowCoin); - bhv_constant(bhvTemporaryYellowCoin); - bhv_constant(bhvThreeCoinsSpawn); - bhv_constant(bhvTenCoinsSpawn); - bhv_constant(bhvSingleCoinGetsSpawned); - bhv_constant(bhvCoinSparkles); - bhv_constant(bhvGoldenCoinSparkles); - bhv_constant(bhvWallTinyStarParticle); - bhv_constant(bhvVertStarParticleSpawner); - bhv_constant(bhvPoundTinyStarParticle); - bhv_constant(bhvHorStarParticleSpawner); - bhv_constant(bhvPunchTinyTriangle); - bhv_constant(bhvTriangleParticleSpawner); - bhv_constant(bhvDoorWarp); - bhv_constant(bhvDoor); - bhv_constant(bhvGrindel); - bhv_constant(bhvThwomp2); - bhv_constant(bhvThwomp); - bhv_constant(bhvTumblingBridgePlatform); - bhv_constant(bhvWfTumblingBridge); - bhv_constant(bhvBbhTumblingBridge); - bhv_constant(bhvLllTumblingBridge); - bhv_constant(bhvFlame); - bhv_constant(bhvAnotherElavator); - bhv_constant(bhvRrElevatorPlatform); - bhv_constant(bhvHmcElevatorPlatform); - bhv_constant(bhvWaterMist); - bhv_constant(bhvBreathParticleSpawner); - bhv_constant(bhvBreakBoxTriangle); - bhv_constant(bhvWaterMist2); - bhv_constant(bhvUnused0DFC); - bhv_constant(bhvMistCircParticleSpawner); - bhv_constant(bhvDirtParticleSpawner); - bhv_constant(bhvSnowParticleSpawner); - bhv_constant(bhvWind); - bhv_constant(bhvEndToad); - bhv_constant(bhvEndPeach); - bhv_constant(bhvUnusedParticleSpawn); - bhv_constant(bhvUkiki); - bhv_constant(bhvUkikiCageChild); - bhv_constant(bhvUkikiCageStar); - bhv_constant(bhvUkikiCage); - bhv_constant(bhvBitfsSinkingPlatforms); - bhv_constant(bhvBitfsSinkingCagePlatform); - bhv_constant(bhvDddMovingPole); - bhv_constant(bhvBitfsTiltingInvertedPyramid); - bhv_constant(bhvSquishablePlatform); - bhv_constant(bhvCutOutObject); - bhv_constant(bhvBetaMovingFlamesSpawn); - bhv_constant(bhvBetaMovingFlames); - bhv_constant(bhvRrRotatingBridgePlatform); - bhv_constant(bhvFlamethrower); - bhv_constant(bhvFlamethrowerFlame); - bhv_constant(bhvBouncingFireball); - bhv_constant(bhvBouncingFireballFlame); - bhv_constant(bhvBowserShockWave); - bhv_constant(bhvFireParticleSpawner); - bhv_constant(bhvBlackSmokeMario); - bhv_constant(bhvBlackSmokeBowser); - bhv_constant(bhvBlackSmokeUpward); - bhv_constant(bhvBetaFishSplashSpawner); - bhv_constant(bhvSpindrift); - bhv_constant(bhvTowerPlatformGroup); - bhv_constant(bhvWfSlidingTowerPlatform); - bhv_constant(bhvWfElevatorTowerPlatform); - bhv_constant(bhvWfSolidTowerPlatform); - bhv_constant(bhvLeafParticleSpawner); - bhv_constant(bhvTreeSnow); - bhv_constant(bhvTreeLeaf); - bhv_constant(bhvAnotherTiltingPlatform); - bhv_constant(bhvSquarishPathMoving); - bhv_constant(bhvSquarishPathParent); - bhv_constant(bhvPiranhaPlantBubble); - bhv_constant(bhvPiranhaPlantWakingBubbles); - bhv_constant(bhvFloorSwitchAnimatesObject); - bhv_constant(bhvFloorSwitchGrills); - bhv_constant(bhvFloorSwitchHardcodedModel); - bhv_constant(bhvFloorSwitchHiddenObjects); - bhv_constant(bhvHiddenObject); - bhv_constant(bhvBreakableBox); - bhv_constant(bhvPushableMetalBox); - bhv_constant(bhvHeaveHo); - bhv_constant(bhvHeaveHoThrowMario); - bhv_constant(bhvCcmTouchedStarSpawn); - bhv_constant(bhvUnusedPoundablePlatform); - bhv_constant(bhvBetaTrampolineTop); - bhv_constant(bhvBetaTrampolineSpring); - bhv_constant(bhvJumpingBox); - bhv_constant(bhvBooCage); - bhv_constant(bhvStub); - bhv_constant(bhvIgloo); - bhv_constant(bhvBowserKey); - bhv_constant(bhvGrandStar); - bhv_constant(bhvBetaBooKey); - bhv_constant(bhvAlphaBooKey); - bhv_constant(bhvBulletBill); - bhv_constant(bhvWhitePuffSmoke); - bhv_constant(bhvUnused1820); - bhv_constant(bhvBowserTailAnchor); - bhv_constant(bhvBowser); - bhv_constant(bhvBowserBodyAnchor); - bhv_constant(bhvBowserFlameSpawn); - bhv_constant(bhvTiltingBowserLavaPlatform); - bhv_constant(bhvFallingBowserPlatform); - bhv_constant(bhvBlueBowserFlame); - bhv_constant(bhvFlameFloatingLanding); - bhv_constant(bhvBlueFlamesGroup); - bhv_constant(bhvFlameBouncing); - bhv_constant(bhvFlameMovingForwardGrowing); - bhv_constant(bhvFlameBowser); - bhv_constant(bhvFlameLargeBurningOut); - bhv_constant(bhvBlueFish); - bhv_constant(bhvTankFishGroup); - bhv_constant(bhvCheckerboardElevatorGroup); - bhv_constant(bhvCheckerboardPlatformSub); - bhv_constant(bhvBowserKeyUnlockDoor); - bhv_constant(bhvBowserKeyCourseExit); - bhv_constant(bhvInvisibleObjectsUnderBridge); - bhv_constant(bhvWaterLevelPillar); - bhv_constant(bhvDddWarp); - bhv_constant(bhvMoatGrills); - bhv_constant(bhvClockMinuteHand); - bhv_constant(bhvClockHourHand); - bhv_constant(bhvMacroUkiki); - bhv_constant(bhvStub1D0C); - bhv_constant(bhvLllRotatingHexagonalPlatform); - bhv_constant(bhvLllSinkingRockBlock); - bhv_constant(bhvStub1D70); - bhv_constant(bhvLllMovingOctagonalMeshPlatform); - bhv_constant(bhvSnowBall); - bhv_constant(bhvLllRotatingBlockWithFireBars); - bhv_constant(bhvLllRotatingHexFlame); - bhv_constant(bhvLllWoodPiece); - bhv_constant(bhvLllFloatingWoodBridge); - bhv_constant(bhvVolcanoFlames); - bhv_constant(bhvLllRotatingHexagonalRing); - bhv_constant(bhvLllSinkingRectangularPlatform); - bhv_constant(bhvLllSinkingSquarePlatforms); - bhv_constant(bhvLllTiltingInvertedPyramid); - bhv_constant(bhvUnused1F30); - bhv_constant(bhvKoopaShell); - bhv_constant(bhvKoopaShellFlame); - bhv_constant(bhvToxBox); - bhv_constant(bhvPiranhaPlant); - bhv_constant(bhvLllHexagonalMesh); - bhv_constant(bhvLllBowserPuzzlePiece); - bhv_constant(bhvLllBowserPuzzle); - bhv_constant(bhvTuxiesMother); - bhv_constant(bhvPenguinBaby); - bhv_constant(bhvUnused20E0); - bhv_constant(bhvSmallPenguin); - bhv_constant(bhvManyBlueFishSpawner); - bhv_constant(bhvFewBlueFishSpawner); - bhv_constant(bhvFishSpawner); - bhv_constant(bhvFish); - bhv_constant(bhvWdwExpressElevator); - bhv_constant(bhvWdwExpressElevatorPlatform); - bhv_constant(bhvChirpChirp); - bhv_constant(bhvChirpChirpUnused); - bhv_constant(bhvBub); - bhv_constant(bhvExclamationBox); - bhv_constant(bhvRotatingExclamationMark); - bhv_constant(bhvSoundSpawner); - bhv_constant(bhvRockSolid); - bhv_constant(bhvBowserSubDoor); - bhv_constant(bhvBowsersSub); - bhv_constant(bhvSushiShark); - bhv_constant(bhvSushiSharkCollisionChild); - bhv_constant(bhvJrbSlidingBox); - bhv_constant(bhvShipPart3); - bhv_constant(bhvInSunkenShip3); - bhv_constant(bhvSunkenShipPart); - bhv_constant(bhvSunkenShipSetRotation); - bhv_constant(bhvSunkenShipPart2); - bhv_constant(bhvInSunkenShip); - bhv_constant(bhvInSunkenShip2); - bhv_constant(bhvMistParticleSpawner); - bhv_constant(bhvWhitePuff1); - bhv_constant(bhvWhitePuff2); - bhv_constant(bhvWhitePuffSmoke2); - bhv_constant(bhvPurpleSwitchHiddenBoxes); - bhv_constant(bhvBlueCoinSwitch); - bhv_constant(bhvHiddenBlueCoin); - bhv_constant(bhvOpenableCageDoor); - bhv_constant(bhvOpenableGrill); - bhv_constant(bhvWaterLevelDiamond); - bhv_constant(bhvInitializeChangingWaterLevel); - bhv_constant(bhvTweesterSandParticle); - bhv_constant(bhvTweester); - bhv_constant(bhvMerryGoRoundBooManager); - bhv_constant(bhvPlaysMusicTrackWhenTouched); - bhv_constant(bhvAnimatedTexture); - bhv_constant(bhvBooInCastle); - bhv_constant(bhvBooWithCage); - bhv_constant(bhvBalconyBigBoo); - bhv_constant(bhvMerryGoRoundBigBoo); - bhv_constant(bhvGhostHuntBigBoo); - bhv_constant(bhvCourtyardBooTriplet); - bhv_constant(bhvBoo); - bhv_constant(bhvMerryGoRoundBoo); - bhv_constant(bhvGhostHuntBoo); - bhv_constant(bhvHiddenStaircaseStep); - bhv_constant(bhvBooBossSpawnedBridge); - bhv_constant(bhvBbhTiltingTrapPlatform); - bhv_constant(bhvHauntedBookshelf); - bhv_constant(bhvMeshElevator); - bhv_constant(bhvMerryGoRound); - bhv_constant(bhvInsideCannon); - bhv_constant(bhvBetaBowserAnchor); - bhv_constant(bhvStaticCheckeredPlatform); - bhv_constant(bhvUnused2A10); - bhv_constant(bhvStar); - bhv_constant(bhvStaticObject); - bhv_constant(bhvUnused2A54); - bhv_constant(bhvCastleFloorTrap); - bhv_constant(bhvFloorTrapInCastle); - bhv_constant(bhvTree); - bhv_constant(bhvSparkle); - bhv_constant(bhvSparkleSpawn); - bhv_constant(bhvSparkleParticleSpawner); - bhv_constant(bhvScuttlebug); - bhv_constant(bhvScuttlebugSpawn); - bhv_constant(bhvWhompKingBoss); - bhv_constant(bhvSmallWhomp); - bhv_constant(bhvWaterSplash); - bhv_constant(bhvWaterDroplet); - bhv_constant(bhvWaterDropletSplash); - bhv_constant(bhvBubbleSplash); - bhv_constant(bhvIdleWaterWave); - bhv_constant(bhvObjectWaterSplash); - bhv_constant(bhvShallowWaterWave); - bhv_constant(bhvShallowWaterSplash); - bhv_constant(bhvObjectWaveTrail); - bhv_constant(bhvWaveTrail); - bhv_constant(bhvTinyStrongWindParticle); - bhv_constant(bhvStrongWindParticle); - bhv_constant(bhvSLSnowmanWind); - bhv_constant(bhvSLWalkingPenguin); - bhv_constant(bhvYellowBall); - bhv_constant(bhvMario); - bhv_constant(bhvToadMessage); - bhv_constant(bhvUnlockDoorStar); - bhv_constant(bhvInstantActiveWarp); - bhv_constant(bhvAirborneWarp); - bhv_constant(bhvHardAirKnockBackWarp); - bhv_constant(bhvSpinAirborneCircleWarp); - bhv_constant(bhvDeathWarp); - bhv_constant(bhvSpinAirborneWarp); - bhv_constant(bhvFlyingWarp); - bhv_constant(bhvPaintingStarCollectWarp); - bhv_constant(bhvPaintingDeathWarp); - bhv_constant(bhvAirborneDeathWarp); - bhv_constant(bhvAirborneStarCollectWarp); - bhv_constant(bhvLaunchStarCollectWarp); - bhv_constant(bhvLaunchDeathWarp); - bhv_constant(bhvSwimmingWarp); - bhv_constant(bhvRandomAnimatedTexture); - bhv_constant(bhvYellowBackgroundInMenu); - bhv_constant(bhvMenuButton); - bhv_constant(bhvMenuButtonManager); - bhv_constant(bhvActSelectorStarType); - bhv_constant(bhvActSelector); - bhv_constant(bhvMovingYellowCoin); - bhv_constant(bhvMovingBlueCoin); - bhv_constant(bhvBlueCoinSliding); - bhv_constant(bhvBlueCoinJumping); - bhv_constant(bhvSeaweed); - bhv_constant(bhvSeaweedBundle); - bhv_constant(bhvBobomb); - bhv_constant(bhvBobombFuseSmoke); - bhv_constant(bhvBobombBuddy); - bhv_constant(bhvBobombBuddyOpensCannon); - bhv_constant(bhvCannonClosed); - bhv_constant(bhvWhirlpool); - bhv_constant(bhvJetStream); - bhv_constant(bhvMessagePanel); - bhv_constant(bhvSignOnWall); - bhv_constant(bhvHomingAmp); - bhv_constant(bhvCirclingAmp); - bhv_constant(bhvButterfly); - bhv_constant(bhvHoot); - bhv_constant(bhvBetaHoldableObject); - bhv_constant(bhvCarrySomething1); - bhv_constant(bhvCarrySomething2); - bhv_constant(bhvCarrySomething3); - bhv_constant(bhvCarrySomething4); - bhv_constant(bhvCarrySomething5); - bhv_constant(bhvCarrySomething6); - bhv_constant(bhvObjectBubble); - bhv_constant(bhvObjectWaterWave); - bhv_constant(bhvExplosion); - bhv_constant(bhvBobombBullyDeathSmoke); - bhv_constant(bhvSmoke); - bhv_constant(bhvBobombExplosionBubble); - bhv_constant(bhvBobombExplosionBubble3600); - bhv_constant(bhvRespawner); - bhv_constant(bhvSmallBully); - bhv_constant(bhvBigBully); - bhv_constant(bhvBigBullyWithMinions); - bhv_constant(bhvSmallChillBully); - bhv_constant(bhvBigChillBully); - bhv_constant(bhvJetStreamRingSpawner); - bhv_constant(bhvJetStreamWaterRing); - bhv_constant(bhvMantaRayWaterRing); - bhv_constant(bhvMantaRayRingManager); - bhv_constant(bhvBowserBomb); - bhv_constant(bhvBowserBombExplosion); - bhv_constant(bhvBowserBombSmoke); - bhv_constant(bhvCelebrationStar); - bhv_constant(bhvCelebrationStarSparkle); - bhv_constant(bhvStarKeyCollectionPuffSpawner); - bhv_constant(bhvLllDrawbridgeSpawner); - bhv_constant(bhvLllDrawbridge); - bhv_constant(bhvSmallBomp); - bhv_constant(bhvLargeBomp); - bhv_constant(bhvWfSlidingPlatform); - bhv_constant(bhvMoneybag); - bhv_constant(bhvMoneybagHidden); - bhv_constant(bhvPitBowlingBall); - bhv_constant(bhvFreeBowlingBall); - bhv_constant(bhvBowlingBall); - bhv_constant(bhvTtmBowlingBallSpawner); - bhv_constant(bhvBobBowlingBallSpawner); - bhv_constant(bhvThiBowlingBallSpawner); - bhv_constant(bhvRrCruiserWing); - bhv_constant(bhvSpindel); - bhv_constant(bhvSslMovingPyramidWall); - bhv_constant(bhvPyramidElevator); - bhv_constant(bhvPyramidElevatorTrajectoryMarkerBall); - bhv_constant(bhvPyramidTop); - bhv_constant(bhvPyramidTopFragment); - bhv_constant(bhvPyramidPillarTouchDetector); - bhv_constant(bhvWaterfallSoundLoop); - bhv_constant(bhvVolcanoSoundLoop); - bhv_constant(bhvCastleFlagWaving); - bhv_constant(bhvBirdsSoundLoop); - bhv_constant(bhvAmbientSounds); - bhv_constant(bhvSandSoundLoop); - bhv_constant(bhvHiddenAt120Stars); - bhv_constant(bhvSnowmansBottom); - bhv_constant(bhvSnowmansHead); - bhv_constant(bhvSnowmansBodyCheckpoint); - bhv_constant(bhvBigSnowmanWhole); - bhv_constant(bhvBigBoulder); - bhv_constant(bhvBigBoulderGenerator); - bhv_constant(bhvWingCap); - bhv_constant(bhvMetalCap); - bhv_constant(bhvNormalCap); - bhv_constant(bhvVanishCap); - bhv_constant(bhvStar); - bhv_constant(bhvStarSpawnCoordinates); - bhv_constant(bhvHiddenRedCoinStar); - bhv_constant(bhvRedCoin); - bhv_constant(bhvBowserCourseRedCoinStar); - bhv_constant(bhvHiddenStar); - bhv_constant(bhvHiddenStarTrigger); - bhv_constant(bhvTtmRollingLog); - bhv_constant(bhvLllVolcanoFallingTrap); - bhv_constant(bhvLllRollingLog); - bhv_constant(bhv1upWalking); - bhv_constant(bhv1upRunningAway); - bhv_constant(bhv1upSliding); - bhv_constant(bhv1Up); - bhv_constant(bhv1upJumpOnApproach); - bhv_constant(bhvHidden1up); - bhv_constant(bhvHidden1upTrigger); - bhv_constant(bhvHidden1upInPole); - bhv_constant(bhvHidden1upInPoleTrigger); - bhv_constant(bhvHidden1upInPoleSpawner); - bhv_constant(bhvControllablePlatform); - bhv_constant(bhvControllablePlatformSub); - bhv_constant(bhvBreakableBoxSmall); - bhv_constant(bhvSlidingSnowMound); - bhv_constant(bhvSnowMoundSpawn); - bhv_constant(bhvWdwSquareFloatingPlatform); - bhv_constant(bhvWdwRectangularFloatingPlatform); - bhv_constant(bhvJrbFloatingPlatform); - bhv_constant(bhvArrowLift); - bhv_constant(bhvOrangeNumber); - bhv_constant(bhvMantaRay); - bhv_constant(bhvFallingPillar); - bhv_constant(bhvFallingPillarHitbox); - bhv_constant(bhvPillarBase); - bhv_constant(bhvJrbFloatingBox); - bhv_constant(bhvDecorativePendulum); - bhv_constant(bhvTreasureChestsShip); - bhv_constant(bhvTreasureChestsJrb); - bhv_constant(bhvTreasureChests); - bhv_constant(bhvTreasureChestBottom); - bhv_constant(bhvTreasureChestTop); - bhv_constant(bhvMips); - bhv_constant(bhvYoshi); - bhv_constant(bhvKoopa); - bhv_constant(bhvKoopaRaceEndpoint); - bhv_constant(bhvKoopaFlag); - bhv_constant(bhvPokey); - bhv_constant(bhvPokeyBodyPart); - bhv_constant(bhvSwoop); - bhv_constant(bhvFlyGuy); - bhv_constant(bhvGoomba); - bhv_constant(bhvGoombaTripletSpawner); - bhv_constant(bhvChainChomp); - bhv_constant(bhvChainChompChainPart); - bhv_constant(bhvWoodenPost); - bhv_constant(bhvChainChompGate); - bhv_constant(bhvWigglerHead); - bhv_constant(bhvWigglerBody); - bhv_constant(bhvEnemyLakitu); - bhv_constant(bhvCameraLakitu); - bhv_constant(bhvCloud); - bhv_constant(bhvCloudPart); - bhv_constant(bhvSpiny); - bhv_constant(bhvMontyMole); - bhv_constant(bhvMontyMoleHole); - bhv_constant(bhvMontyMoleRock); - bhv_constant(bhvPlatformOnTrack); - bhv_constant(bhvTrackBall); - bhv_constant(bhvSeesawPlatform); - bhv_constant(bhvFerrisWheelAxle); - bhv_constant(bhvFerrisWheelPlatform); - bhv_constant(bhvWaterBombSpawner); - bhv_constant(bhvWaterBomb); - bhv_constant(bhvWaterBombShadow); - bhv_constant(bhvTTCRotatingSolid); - bhv_constant(bhvTTCPendulum); - bhv_constant(bhvTTCTreadmill); - bhv_constant(bhvTTCMovingBar); - bhv_constant(bhvTTCCog); - bhv_constant(bhvTTCPitBlock); - bhv_constant(bhvTTCElevator); - bhv_constant(bhvTTC2DRotator); - bhv_constant(bhvTTCSpinner); - bhv_constant(bhvMrBlizzard); - bhv_constant(bhvMrBlizzardSnowball); - bhv_constant(bhvSlidingPlatform2); - bhv_constant(bhvOctagonalPlatformRotating); - bhv_constant(bhvAnimatesOnFloorSwitchPress); - bhv_constant(bhvActivatedBackAndForthPlatform); - bhv_constant(bhvRecoveryHeart); - bhv_constant(bhvWaterBombCannon); - bhv_constant(bhvCannonBarrelBubbles); - bhv_constant(bhvUnagi); - bhv_constant(bhvUnagiSubobject); - bhv_constant(bhvDorrie); - bhv_constant(bhvHauntedChair); - bhv_constant(bhvMadPiano); - bhv_constant(bhvFlyingBookend); - bhv_constant(bhvBookendSpawn); - bhv_constant(bhvHauntedBookshelfManager); - bhv_constant(bhvBookSwitch); - bhv_constant(bhvFirePiranhaPlant); - bhv_constant(bhvSmallPiranhaFlame); - bhv_constant(bhvFireSpitter); - bhv_constant(bhvFlyguyFlame); - bhv_constant(bhvSnufit); - bhv_constant(bhvSnufitBalls); - bhv_constant(bhvHorizontalGrindel); - bhv_constant(bhvEyerokBoss); - bhv_constant(bhvEyerokHand); - bhv_constant(bhvKlepto); - bhv_constant(bhvBird); - bhv_constant(bhvRacingPenguin); - bhv_constant(bhvPenguinRaceFinishLine); - bhv_constant(bhvPenguinRaceShortcutCheck); - bhv_constant(bhvCoffinSpawner); - bhv_constant(bhvCoffin); - bhv_constant(bhvClamShell); - bhv_constant(bhvSkeeter); - bhv_constant(bhvSkeeterWave); - bhv_constant(bhvSwingPlatform); - bhv_constant(bhvDonutPlatformSpawner); - bhv_constant(bhvDonutPlatform); - bhv_constant(bhvDDDPole); - bhv_constant(bhvRedCoinStarMarker); - bhv_constant(bhvTripletButterfly); - bhv_constant(bhvBubba); - bhv_constant(bhvBeginningLakitu); - bhv_constant(bhvBeginningPeach); - bhv_constant(bhvEndBirds1); - bhv_constant(bhvEndBirds2); - bhv_constant(bhvIntroScene); - bhv_constant(bhvUnusedFakeStar); - - // Legacy behavior names - bhv_legacy_constant(bhvFish2, bhvManyBlueFishSpawner); - bhv_legacy_constant(bhvFish3, bhvFewBlueFishSpawner); - bhv_legacy_constant(bhvLargeFishGroup, bhvFishSpawner); - // Behavior ids bhv_constant(id_bhv1Up); @@ -1310,478 +771,19 @@ s64 DynOS_Bhv_ParseBehaviorScriptConstants(const String &_Arg, bool *found) { bhv_constant(id_bhvYellowBall); bhv_constant(id_bhvYellowCoin); bhv_constant(id_bhvYoshi); - + // Define a special type for new ids that don't override. if (_Arg == "id_bhvNewId") { return (BehaviorScript) (0xFFFF); } - + // Legacy behavior ids bhv_legacy_constant(id_bhvFish2, id_bhvManyBlueFishSpawner); bhv_legacy_constant(id_bhvFish3, id_bhvFewBlueFishSpawner); bhv_legacy_constant(id_bhvLargeFishGroup, id_bhvFishSpawner); - // Model constants - bhv_constant(ACT_1); - bhv_constant(ACT_2); - bhv_constant(ACT_3); - bhv_constant(ACT_4); - bhv_constant(ACT_5); - bhv_constant(ACT_6); - bhv_constant(ALL_ACTS_MACRO); - bhv_constant(ALL_ACTS); - bhv_constant(COIN_FORMATION_FLAG_VERTICAL); - bhv_constant(COIN_FORMATION_FLAG_RING); - bhv_constant(COIN_FORMATION_FLAG_ARROW); - bhv_constant(COIN_FORMATION_FLAG_FLYING); - bhv_constant(MODEL_NONE); - bhv_constant(MODEL_MARIO); - bhv_constant(MODEL_LEVEL_GEOMETRY_03); - bhv_constant(MODEL_LEVEL_GEOMETRY_04); - bhv_constant(MODEL_LEVEL_GEOMETRY_05); - bhv_constant(MODEL_LEVEL_GEOMETRY_06); - bhv_constant(MODEL_LEVEL_GEOMETRY_07); - bhv_constant(MODEL_LEVEL_GEOMETRY_08); - bhv_constant(MODEL_LEVEL_GEOMETRY_09); - bhv_constant(MODEL_LEVEL_GEOMETRY_0A); - bhv_constant(MODEL_LEVEL_GEOMETRY_0B); - bhv_constant(MODEL_LEVEL_GEOMETRY_0C); - bhv_constant(MODEL_LEVEL_GEOMETRY_0D); - bhv_constant(MODEL_LEVEL_GEOMETRY_0E); - bhv_constant(MODEL_LEVEL_GEOMETRY_0F); - bhv_constant(MODEL_LEVEL_GEOMETRY_10); - bhv_constant(MODEL_LEVEL_GEOMETRY_11); - bhv_constant(MODEL_LEVEL_GEOMETRY_12); - bhv_constant(MODEL_LEVEL_GEOMETRY_13); - bhv_constant(MODEL_LEVEL_GEOMETRY_14); - bhv_constant(MODEL_LEVEL_GEOMETRY_15); - bhv_constant(MODEL_LEVEL_GEOMETRY_16); - bhv_constant(MODEL_BOB_BUBBLY_TREE); - bhv_constant(MODEL_WDW_BUBBLY_TREE); - bhv_constant(MODEL_CASTLE_GROUNDS_BUBBLY_TREE); - bhv_constant(MODEL_WF_BUBBLY_TREE); - bhv_constant(MODEL_THI_BUBBLY_TREE); - bhv_constant(MODEL_COURTYARD_SPIKY_TREE); - bhv_constant(MODEL_CCM_SNOW_TREE); - bhv_constant(MODEL_SL_SNOW_TREE); - bhv_constant(MODEL_UNKNOWN_TREE_1A); - bhv_constant(MODEL_SSL_PALM_TREE); - bhv_constant(MODEL_CASTLE_CASTLE_DOOR_UNUSED); - bhv_constant(MODEL_CASTLE_WOODEN_DOOR_UNUSED); - bhv_constant(MODEL_BBH_HAUNTED_DOOR); - bhv_constant(MODEL_HMC_WOODEN_DOOR); - bhv_constant(MODEL_UNKNOWN_DOOR_1E); - bhv_constant(MODEL_HMC_METAL_DOOR); - bhv_constant(MODEL_HMC_HAZY_MAZE_DOOR); - bhv_constant(MODEL_UNKNOWN_DOOR_21); - bhv_constant(MODEL_CASTLE_DOOR_0_STARS); - bhv_constant(MODEL_CASTLE_DOOR_1_STAR); - bhv_constant(MODEL_CASTLE_DOOR_3_STARS); - bhv_constant(MODEL_CASTLE_KEY_DOOR); - bhv_constant(MODEL_CASTLE_CASTLE_DOOR); - bhv_constant(MODEL_CASTLE_GROUNDS_CASTLE_DOOR); - bhv_constant(MODEL_CASTLE_WOODEN_DOOR); - bhv_constant(MODEL_COURTYARD_WOODEN_DOOR); - bhv_constant(MODEL_CCM_CABIN_DOOR); - bhv_constant(MODEL_UNKNOWN_DOOR_28); - bhv_constant(MODEL_CASTLE_METAL_DOOR); - bhv_constant(MODEL_CASTLE_GROUNDS_METAL_DOOR); - bhv_constant(MODEL_UNKNOWN_DOOR_2A); - bhv_constant(MODEL_UNKNOWN_DOOR_2B); - bhv_constant(MODEL_WF_TOWER_TRAPEZOID_PLATORM); - bhv_constant(MODEL_WF_TOWER_SQUARE_PLATORM); - bhv_constant(MODEL_WF_TOWER_SQUARE_PLATORM_UNUSED); - bhv_constant(MODEL_WF_TOWER_SQUARE_PLATORM_ELEVATOR); - bhv_constant(MODEL_BBH_STAIRCASE_STEP); - bhv_constant(MODEL_BBH_TILTING_FLOOR_PLATFORM); - bhv_constant(MODEL_BBH_TUMBLING_PLATFORM); - bhv_constant(MODEL_BBH_TUMBLING_PLATFORM_PART); - bhv_constant(MODEL_BBH_MOVING_BOOKSHELF); - bhv_constant(MODEL_BBH_MESH_ELEVATOR); - bhv_constant(MODEL_BBH_MERRY_GO_ROUND); - bhv_constant(MODEL_BBH_WOODEN_TOMB); - bhv_constant(MODEL_CCM_ROPEWAY_LIFT); - bhv_constant(MODEL_CCM_SNOWMAN_HEAD); - bhv_constant(MODEL_CASTLE_BOWSER_TRAP); - bhv_constant(MODEL_CASTLE_WATER_LEVEL_PILLAR); - bhv_constant(MODEL_CASTLE_CLOCK_MINUTE_HAND); - bhv_constant(MODEL_CASTLE_CLOCK_HOUR_HAND); - bhv_constant(MODEL_CASTLE_CLOCK_PENDULUM); - bhv_constant(MODEL_HMC_METAL_PLATFORM); - bhv_constant(MODEL_HMC_METAL_ARROW_PLATFORM); - bhv_constant(MODEL_HMC_ELEVATOR_PLATFORM); - bhv_constant(MODEL_HMC_ROLLING_ROCK); - bhv_constant(MODEL_HMC_ROCK_PIECE); - bhv_constant(MODEL_HMC_ROCK_SMALL_PIECE); - bhv_constant(MODEL_HMC_RED_GRILLS); - bhv_constant(MODEL_SSL_PYRAMID_TOP); - bhv_constant(MODEL_SSL_GRINDEL); - bhv_constant(MODEL_SSL_SPINDEL); - bhv_constant(MODEL_SSL_MOVING_PYRAMID_WALL); - bhv_constant(MODEL_SSL_PYRAMID_ELEVATOR); - bhv_constant(MODEL_BOB_CHAIN_CHOMP_GATE); - bhv_constant(MODEL_BOB_SEESAW_PLATFORM); - bhv_constant(MODEL_BOB_BARS_GRILLS); - bhv_constant(MODEL_SL_SNOW_TRIANGLE); - bhv_constant(MODEL_SL_CRACKED_ICE); - bhv_constant(MODEL_SL_CRACKED_ICE_CHUNK); - bhv_constant(MODEL_WDW_SQUARE_FLOATING_PLATFORM); - bhv_constant(MODEL_WDW_ARROW_LIFT); - bhv_constant(MODEL_WDW_WATER_LEVEL_DIAMOND); - bhv_constant(MODEL_WDW_HIDDEN_PLATFORM); - bhv_constant(MODEL_WDW_EXPRESS_ELEVATOR); - bhv_constant(MODEL_WDW_RECTANGULAR_FLOATING_PLATFORM); - bhv_constant(MODEL_WDW_ROTATING_PLATFORM); - bhv_constant(MODEL_JRB_SHIP_LEFT_HALF_PART); - bhv_constant(MODEL_JRB_SHIP_BACK_LEFT_PART); - bhv_constant(MODEL_JRB_SHIP_RIGHT_HALF_PART); - bhv_constant(MODEL_JRB_SHIP_BACK_RIGHT_PART); - bhv_constant(MODEL_JRB_SUNKEN_SHIP); - bhv_constant(MODEL_JRB_SUNKEN_SHIP_BACK); - bhv_constant(MODEL_JRB_ROCK); - bhv_constant(MODEL_JRB_SLIDING_BOX); - bhv_constant(MODEL_JRB_FALLING_PILLAR); - bhv_constant(MODEL_JRB_FALLING_PILLAR_BASE); - bhv_constant(MODEL_JRB_FLOATING_PLATFORM); - bhv_constant(MODEL_THI_HUGE_ISLAND_TOP); - bhv_constant(MODEL_THI_TINY_ISLAND_TOP); - bhv_constant(MODEL_TTC_ROTATING_CUBE); - bhv_constant(MODEL_TTC_ROTATING_PRISM); - bhv_constant(MODEL_TTC_PENDULUM); - bhv_constant(MODEL_TTC_LARGE_TREADMILL); - bhv_constant(MODEL_TTC_SMALL_TREADMILL); - bhv_constant(MODEL_TTC_PUSH_BLOCK); - bhv_constant(MODEL_TTC_ROTATING_HEXAGON); - bhv_constant(MODEL_TTC_ROTATING_TRIANGLE); - bhv_constant(MODEL_TTC_PIT_BLOCK); - bhv_constant(MODEL_TTC_PIT_BLOCK_UNUSED); - bhv_constant(MODEL_TTC_ELEVATOR_PLATFORM); - bhv_constant(MODEL_TTC_CLOCK_HAND); - bhv_constant(MODEL_TTC_SPINNER); - bhv_constant(MODEL_TTC_SMALL_GEAR); - bhv_constant(MODEL_TTC_LARGE_GEAR); - bhv_constant(MODEL_RR_SLIDING_PLATFORM); - bhv_constant(MODEL_RR_FLYING_CARPET); - bhv_constant(MODEL_RR_OCTAGONAL_PLATFORM); - bhv_constant(MODEL_RR_ROTATING_BRIDGE_PLATFORM); - bhv_constant(MODEL_RR_TRIANGLE_PLATFORM); - bhv_constant(MODEL_RR_CRUISER_WING); - bhv_constant(MODEL_RR_SEESAW_PLATFORM); - bhv_constant(MODEL_RR_L_SHAPED_PLATFORM); - bhv_constant(MODEL_RR_SWINGING_PLATFORM); - bhv_constant(MODEL_RR_DONUT_PLATFORM); - bhv_constant(MODEL_RR_ELEVATOR_PLATFORM); - bhv_constant(MODEL_RR_TRICKY_TRIANGLES); - bhv_constant(MODEL_RR_TRICKY_TRIANGLES_FRAME1); - bhv_constant(MODEL_RR_TRICKY_TRIANGLES_FRAME2); - bhv_constant(MODEL_RR_TRICKY_TRIANGLES_FRAME3); - bhv_constant(MODEL_RR_TRICKY_TRIANGLES_FRAME4); - bhv_constant(MODEL_BITDW_SQUARE_PLATFORM); - bhv_constant(MODEL_BITDW_SEESAW_PLATFORM); - bhv_constant(MODEL_BITDW_SLIDING_PLATFORM); - bhv_constant(MODEL_BITDW_FERRIS_WHEEL_AXLE); - bhv_constant(MODEL_BITDW_BLUE_PLATFORM); - bhv_constant(MODEL_BITDW_STAIRCASE_FRAME4); - bhv_constant(MODEL_BITDW_STAIRCASE_FRAME3); - bhv_constant(MODEL_BITDW_STAIRCASE_FRAME2); - bhv_constant(MODEL_BITDW_STAIRCASE_FRAME1); - bhv_constant(MODEL_BITDW_STAIRCASE); - bhv_constant(MODEL_VCUTM_SEESAW_PLATFORM); - bhv_constant(MODEL_VCUTM_CHECKERBOARD_PLATFORM_SPAWNER); - bhv_constant(MODEL_BITFS_PLATFORM_ON_TRACK); - bhv_constant(MODEL_BITFS_TILTING_SQUARE_PLATFORM); - bhv_constant(MODEL_BITFS_SINKING_PLATFORMS); - bhv_constant(MODEL_BITFS_BLUE_POLE); - bhv_constant(MODEL_BITFS_SINKING_CAGE_PLATFORM); - bhv_constant(MODEL_BITFS_ELEVATOR); - bhv_constant(MODEL_BITFS_STRETCHING_PLATFORMS); - bhv_constant(MODEL_BITFS_SEESAW_PLATFORM); - bhv_constant(MODEL_BITFS_MOVING_SQUARE_PLATFORM); - bhv_constant(MODEL_BITFS_SLIDING_PLATFORM); - bhv_constant(MODEL_BITFS_TUMBLING_PLATFORM_PART); - bhv_constant(MODEL_BITFS_TUMBLING_PLATFORM); - bhv_constant(MODEL_BITS_SLIDING_PLATFORM); - bhv_constant(MODEL_BITS_TWIN_SLIDING_PLATFORMS); - bhv_constant(MODEL_BITS_OCTAGONAL_PLATFORM); - bhv_constant(MODEL_BITS_BLUE_PLATFORM); - bhv_constant(MODEL_BITS_FERRIS_WHEEL_AXLE); - bhv_constant(MODEL_BITS_ARROW_PLATFORM); - bhv_constant(MODEL_BITS_SEESAW_PLATFORM); - bhv_constant(MODEL_BITS_TILTING_W_PLATFORM); - bhv_constant(MODEL_BITS_STAIRCASE); - bhv_constant(MODEL_BITS_STAIRCASE_FRAME1); - bhv_constant(MODEL_BITS_STAIRCASE_FRAME2); - bhv_constant(MODEL_BITS_STAIRCASE_FRAME3); - bhv_constant(MODEL_BITS_STAIRCASE_FRAME4); - bhv_constant(MODEL_BITS_WARP_PIPE); - bhv_constant(MODEL_LLL_DRAWBRIDGE_PART); - bhv_constant(MODEL_LLL_ROTATING_BLOCK_FIRE_BARS); - bhv_constant(MODEL_LLL_ROTATING_HEXAGONAL_RING); - bhv_constant(MODEL_LLL_SINKING_RECTANGULAR_PLATFORM); - bhv_constant(MODEL_LLL_SINKING_SQUARE_PLATFORMS); - bhv_constant(MODEL_LLL_TILTING_SQUARE_PLATFORM); - bhv_constant(MODEL_LLL_BOWSER_PIECE_1); - bhv_constant(MODEL_LLL_BOWSER_PIECE_2); - bhv_constant(MODEL_LLL_BOWSER_PIECE_3); - bhv_constant(MODEL_LLL_BOWSER_PIECE_4); - bhv_constant(MODEL_LLL_BOWSER_PIECE_5); - bhv_constant(MODEL_LLL_BOWSER_PIECE_6); - bhv_constant(MODEL_LLL_BOWSER_PIECE_7); - bhv_constant(MODEL_LLL_BOWSER_PIECE_8); - bhv_constant(MODEL_LLL_BOWSER_PIECE_9); - bhv_constant(MODEL_LLL_BOWSER_PIECE_10); - bhv_constant(MODEL_LLL_BOWSER_PIECE_11); - bhv_constant(MODEL_LLL_BOWSER_PIECE_12); - bhv_constant(MODEL_LLL_BOWSER_PIECE_13); - bhv_constant(MODEL_LLL_BOWSER_PIECE_14); - bhv_constant(MODEL_LLL_MOVING_OCTAGONAL_MESH_PLATFORM); - bhv_constant(MODEL_LLL_SINKING_ROCK_BLOCK); - bhv_constant(MODEL_LLL_ROLLING_LOG); - bhv_constant(MODEL_LLL_WOOD_BRIDGE); - bhv_constant(MODEL_LLL_LARGE_WOOD_BRIDGE); - bhv_constant(MODEL_LLL_FALLING_PLATFORM); - bhv_constant(MODEL_LLL_LARGE_FALLING_PLATFORM); - bhv_constant(MODEL_LLL_VOLCANO_FALLING_TRAP); - bhv_constant(MODEL_DDD_BOWSER_SUB_DOOR); - bhv_constant(MODEL_DDD_BOWSER_SUB); - bhv_constant(MODEL_DDD_POLE); - bhv_constant(MODEL_WF_BREAKABLE_WALL_RIGHT); - bhv_constant(MODEL_WF_BREAKABLE_WALL_LEFT); - bhv_constant(MODEL_WF_KICKABLE_BOARD); - bhv_constant(MODEL_WF_TOWER_DOOR); - bhv_constant(MODEL_WF_KICKABLE_BOARD_FELLED); - bhv_constant(MODEL_CASTLE_GROUNDS_VCUTM_GRILL); - bhv_constant(MODEL_CASTLE_GROUNDS_FLAG); - bhv_constant(MODEL_CASTLE_GROUNDS_CANNON_GRILL); - bhv_constant(MODEL_BOWSER_2_TILTING_ARENA); - bhv_constant(MODEL_BOWSER_3_FALLING_PLATFORM_1); - bhv_constant(MODEL_BOWSER_3_FALLING_PLATFORM_2); - bhv_constant(MODEL_BOWSER_3_FALLING_PLATFORM_3); - bhv_constant(MODEL_BOWSER_3_FALLING_PLATFORM_4); - bhv_constant(MODEL_BOWSER_3_FALLING_PLATFORM_5); - bhv_constant(MODEL_BOWSER_3_FALLING_PLATFORM_6); - bhv_constant(MODEL_BOWSER_3_FALLING_PLATFORM_7); - bhv_constant(MODEL_BOWSER_3_FALLING_PLATFORM_8); - bhv_constant(MODEL_BOWSER_3_FALLING_PLATFORM_9); - bhv_constant(MODEL_BOWSER_3_FALLING_PLATFORM_10); - bhv_constant(MODEL_TTM_ROLLING_LOG); - bhv_constant(MODEL_TTM_STAR_CAGE); - bhv_constant(MODEL_TTM_BLUE_SMILEY); - bhv_constant(MODEL_TTM_YELLOW_SMILEY); - bhv_constant(MODEL_TTM_STAR_SMILEY); - bhv_constant(MODEL_TTM_MOON_SMILEY); - bhv_constant(MODEL_BULLET_BILL); - bhv_constant(MODEL_YELLOW_SPHERE); - bhv_constant(MODEL_HOOT); - bhv_constant(MODEL_YOSHI_EGG); - bhv_constant(MODEL_THWOMP); - bhv_constant(MODEL_HEAVE_HO); - bhv_constant(MODEL_BLARGG); - bhv_constant(MODEL_BULLY); - bhv_constant(MODEL_BULLY_BOSS); - bhv_constant(MODEL_WATER_BOMB); - bhv_constant(MODEL_WATER_BOMB_SHADOW); - bhv_constant(MODEL_KING_BOBOMB); - bhv_constant(MODEL_MANTA_RAY); - bhv_constant(MODEL_UNAGI); - bhv_constant(MODEL_SUSHI); - bhv_constant(MODEL_DL_WHIRLPOOL); - bhv_constant(MODEL_CLAM_SHELL); - bhv_constant(MODEL_POKEY_HEAD); - bhv_constant(MODEL_POKEY_BODY_PART); - bhv_constant(MODEL_TWEESTER); - bhv_constant(MODEL_KLEPTO); - bhv_constant(MODEL_EYEROK_LEFT_HAND); - bhv_constant(MODEL_EYEROK_RIGHT_HAND); - bhv_constant(MODEL_DL_MONTY_MOLE_HOLE); - bhv_constant(MODEL_MONTY_MOLE); - bhv_constant(MODEL_UKIKI); - bhv_constant(MODEL_FWOOSH); - bhv_constant(MODEL_SPINDRIFT); - bhv_constant(MODEL_MR_BLIZZARD_HIDDEN); - bhv_constant(MODEL_MR_BLIZZARD); - bhv_constant(MODEL_PENGUIN); - bhv_constant(MODEL_CAP_SWITCH_EXCLAMATION); - bhv_constant(MODEL_CAP_SWITCH); - bhv_constant(MODEL_CAP_SWITCH_BASE); - bhv_constant(MODEL_BOO); - bhv_constant(MODEL_BETA_BOO_KEY); - bhv_constant(MODEL_HAUNTED_CHAIR); - bhv_constant(MODEL_MAD_PIANO); - bhv_constant(MODEL_BOOKEND_PART); - bhv_constant(MODEL_BOOKEND); - bhv_constant(MODEL_HAUNTED_CAGE); - bhv_constant(MODEL_BIRDS); - bhv_constant(MODEL_YOSHI); - bhv_constant(MODEL_ENEMY_LAKITU); - bhv_constant(MODEL_SPINY_BALL); - bhv_constant(MODEL_SPINY); - bhv_constant(MODEL_WIGGLER_HEAD); - bhv_constant(MODEL_WIGGLER_BODY); - bhv_constant(MODEL_BUBBA); - bhv_constant(MODEL_UNKNOWN_54); - bhv_constant(MODEL_UNKNOWN_58); - bhv_constant(MODEL_BOWSER); - bhv_constant(MODEL_BOWSER_BOMB_CHILD_OBJ); - bhv_constant(MODEL_BOWSER_SMOKE); - bhv_constant(MODEL_BOWSER_FLAMES); - bhv_constant(MODEL_BOWSER_WAVE); - bhv_constant(MODEL_BOWSER2); - bhv_constant(MODEL_BUB); - bhv_constant(MODEL_TREASURE_CHEST_BASE); - bhv_constant(MODEL_TREASURE_CHEST_LID); - bhv_constant(MODEL_CYAN_FISH); - bhv_constant(MODEL_WATER_RING); - bhv_constant(MODEL_SKEETER); - bhv_constant(MODEL_PIRANHA_PLANT); - bhv_constant(MODEL_WHOMP); - bhv_constant(MODEL_KOOPA_WITH_SHELL); - bhv_constant(MODEL_METALLIC_BALL); - bhv_constant(MODEL_CHAIN_CHOMP); - bhv_constant(MODEL_KOOPA_FLAG); - bhv_constant(MODEL_WOODEN_POST); - bhv_constant(MODEL_MIPS); - bhv_constant(MODEL_BOO_CASTLE); - bhv_constant(MODEL_LAKITU); - bhv_constant(MODEL_CHILL_BULLY); - bhv_constant(MODEL_BIG_CHILL_BULLY); - bhv_constant(MODEL_MONEYBAG); - bhv_constant(MODEL_SWOOP); - bhv_constant(MODEL_SCUTTLEBUG); - bhv_constant(MODEL_MR_I_IRIS); - bhv_constant(MODEL_MR_I); - bhv_constant(MODEL_DORRIE); - bhv_constant(MODEL_YELLOW_COIN); - bhv_constant(MODEL_YELLOW_COIN_NO_SHADOW); - bhv_constant(MODEL_BLUE_COIN); - bhv_constant(MODEL_BLUE_COIN_NO_SHADOW); - bhv_constant(MODEL_HEART); - bhv_constant(MODEL_TRANSPARENT_STAR); - bhv_constant(MODEL_STAR); - bhv_constant(MODEL_TTM_SLIDE_EXIT_PODIUM); - bhv_constant(MODEL_WOODEN_SIGNPOST); - bhv_constant(MODEL_UNKNOWN_7D); - bhv_constant(MODEL_CANNON_BARREL); - bhv_constant(MODEL_CANNON_BASE); - bhv_constant(MODEL_BREAKABLE_BOX); - bhv_constant(MODEL_BREAKABLE_BOX_SMALL); - bhv_constant(MODEL_EXCLAMATION_BOX_OUTLINE); - bhv_constant(MODEL_EXCLAMATION_POINT); - bhv_constant(MODEL_MARIOS_WINGED_METAL_CAP); - bhv_constant(MODEL_MARIOS_METAL_CAP); - bhv_constant(MODEL_MARIOS_WING_CAP); - bhv_constant(MODEL_MARIOS_CAP); - bhv_constant(MODEL_EXCLAMATION_BOX); - bhv_constant(MODEL_DIRT_ANIMATION); - bhv_constant(MODEL_CARTOON_STAR); - bhv_constant(MODEL_BLUE_COIN_SWITCH); - bhv_constant(MODEL_MIST); - bhv_constant(MODEL_SPARKLES_ANIMATION); - bhv_constant(MODEL_RED_FLAME); - bhv_constant(MODEL_BLUE_FLAME); - bhv_constant(MODEL_BURN_SMOKE); - bhv_constant(MODEL_SPARKLES); - bhv_constant(MODEL_SMOKE); - bhv_constant(MODEL_BURN_SMOKE_UNUSED); - bhv_constant(MODEL_WHITE_PARTICLE_DL); - bhv_constant(MODEL_SAND_DUST); - bhv_constant(MODEL_WHITE_PARTICLE); - bhv_constant(MODEL_PEBBLE); - bhv_constant(MODEL_LEAVES); - bhv_constant(MODEL_WAVE_TRAIL); - bhv_constant(MODEL_WHITE_PARTICLE_SMALL); - bhv_constant(MODEL_SMALL_WATER_SPLASH); - bhv_constant(MODEL_IDLE_WATER_WAVE); - bhv_constant(MODEL_WATER_SPLASH); - bhv_constant(MODEL_BUBBLE); - bhv_constant(MODEL_PURPLE_MARBLE); - bhv_constant(MODEL_UNKNOWN_AC); - bhv_constant(MODEL_WF_SLIDING_PLATFORM); - bhv_constant(MODEL_WF_SMALL_BOMP); - bhv_constant(MODEL_WF_ROTATING_WOODEN_PLATFORM); - bhv_constant(MODEL_WF_TUMBLING_BRIDGE_PART); - bhv_constant(MODEL_WF_LARGE_BOMP); - bhv_constant(MODEL_WF_TUMBLING_BRIDGE); - bhv_constant(MODEL_BOWSER_BOMB); - bhv_constant(MODEL_WATER_MINE); - bhv_constant(MODEL_BOWLING_BALL); - bhv_constant(MODEL_TRAMPOLINE); - bhv_constant(MODEL_TRAMPOLINE_CENTER); - bhv_constant(MODEL_TRAMPOLINE_BASE); - bhv_constant(MODEL_UNKNOWN_B8); - bhv_constant(MODEL_FISH); - bhv_constant(MODEL_FISH_SHADOW); - bhv_constant(MODEL_BUTTERFLY); - bhv_constant(MODEL_BLACK_BOBOMB); - bhv_constant(MODEL_KOOPA_SHELL); - bhv_constant(MODEL_KOOPA_WITHOUT_SHELL); - bhv_constant(MODEL_GOOMBA); - bhv_constant(MODEL_SEAWEED); - bhv_constant(MODEL_AMP); - bhv_constant(MODEL_BOBOMB_BUDDY); - bhv_constant(MODEL_SSL_TOX_BOX); - bhv_constant(MODEL_BOWSER_KEY_CUTSCENE); - bhv_constant(MODEL_DL_CANNON_LID); - bhv_constant(MODEL_CHECKERBOARD_PLATFORM); - bhv_constant(MODEL_RED_FLAME_SHADOW); - bhv_constant(MODEL_BOWSER_KEY); - bhv_constant(MODEL_EXPLOSION); - bhv_constant(MODEL_SNUFIT); - bhv_constant(MODEL_PURPLE_SWITCH); - bhv_constant(MODEL_CASTLE_STAR_DOOR_30_STARS); - bhv_constant(MODEL_CASTLE_STAR_DOOR_50_STARS); - bhv_constant(MODEL_CCM_SNOWMAN_BASE); - bhv_constant(MODEL_1UP); - bhv_constant(MODEL_CASTLE_STAR_DOOR_8_STARS); - bhv_constant(MODEL_CASTLE_STAR_DOOR_70_STARS); - bhv_constant(MODEL_RED_COIN); - bhv_constant(MODEL_RED_COIN_NO_SHADOW); - bhv_constant(MODEL_METAL_BOX); - bhv_constant(MODEL_METAL_BOX_DL); - bhv_constant(MODEL_NUMBER); - bhv_constant(MODEL_FLYGUY); - bhv_constant(MODEL_TOAD); - bhv_constant(MODEL_PEACH); - bhv_constant(MODEL_CHUCKYA); - bhv_constant(MODEL_WHITE_PUFF); - bhv_constant(MODEL_TRAJECTORY_MARKER_BALL); - bhv_constant(MODEL_MAIN_MENU_MARIO_SAVE_BUTTON); - bhv_constant(MODEL_MAIN_MENU_RED_ERASE_BUTTON); - bhv_constant(MODEL_MAIN_MENU_BLUE_COPY_BUTTON); - bhv_constant(MODEL_MAIN_MENU_YELLOW_FILE_BUTTON); - bhv_constant(MODEL_MAIN_MENU_GREEN_SCORE_BUTTON); - bhv_constant(MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE); - bhv_constant(MODEL_MAIN_MENU_MARIO_NEW_BUTTON); - bhv_constant(MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE); - bhv_constant(MODEL_MAIN_MENU_PURPLE_SOUND_BUTTON); - bhv_constant(MODEL_MAIN_MENU_GENERIC_BUTTON); - bhv_constant(MODEL_LLL_ROTATING_HEXAGONAL_PLATFORM); - bhv_constant(MODEL_WF_GIANT_POLE); - bhv_constant(MODEL_WF_ROTATING_PLATFORM); - bhv_constant(MODEL_BITDW_WARP_PIPE); - bhv_constant(MODEL_THI_WARP_PIPE); - bhv_constant(MODEL_VCUTM_WARP_PIPE); - bhv_constant(MODEL_CASTLE_GROUNDS_WARP_PIPE); - bhv_constant(MODEL_BUBBLE_PLAYER); - bhv_constant(MODEL_LUIGI); - bhv_constant(MODEL_LUIGIS_CAP); - bhv_constant(MODEL_LUIGIS_METAL_CAP); - bhv_constant(MODEL_LUIGIS_WING_CAP); - bhv_constant(MODEL_LUIGIS_WINGED_METAL_CAP); - bhv_constant(MODEL_TOAD_PLAYER); - bhv_constant(MODEL_TOADS_CAP); - bhv_constant(MODEL_TOADS_METAL_CAP); - bhv_constant(MODEL_TOADS_WING_CAP); - bhv_constant(MODEL_WALUIGI); - bhv_constant(MODEL_WALUIGIS_CAP); - bhv_constant(MODEL_WALUIGIS_METAL_CAP); - bhv_constant(MODEL_WALUIGIS_WING_CAP); - bhv_constant(MODEL_WALUIGIS_WINGED_METAL_CAP); - bhv_constant(MODEL_WARIO); - bhv_constant(MODEL_WARIOS_CAP); - bhv_constant(MODEL_WARIOS_METAL_CAP); - bhv_constant(MODEL_WARIOS_WING_CAP); - bhv_constant(MODEL_WARIOS_WINGED_METAL_CAP); - bhv_constant(MODEL_ERROR_MODEL); + s64 cModelConstant = DynOS_Common_ParseModelConstants(_Arg, found); + if (*found) { return cModelConstant; } + *found = true; // reset found value // Object Fields @@ -1923,7 +925,7 @@ s64 DynOS_Bhv_ParseBehaviorScriptConstants(const String &_Arg, bool *found) { bhv_constant(oBobombBuddyPosXCopy); bhv_constant(oBobombBuddyPosYCopy); bhv_constant(oBobombBuddyPosZCopy); - + /* Bob-ombExplosionBubble */ bhv_constant(oBobombExpBubGfxScaleFacX); bhv_constant(oBobombExpBubGfxScaleFacY); @@ -2049,7 +1051,7 @@ s64 DynOS_Bhv_ParseBehaviorScriptConstants(const String &_Arg, bool *found) { bhv_constant(oTripletButterflyModel); bhv_constant(oTripletButterflySelectedButterfly); bhv_constant(oTripletButterflyScalePhase); - + /* Cannon */ bhv_constant(oCannonUnkF4); bhv_constant(oCannonUnkF8); @@ -2208,7 +1210,7 @@ s64 DynOS_Bhv_ParseBehaviorScriptConstants(const String &_Arg, bool *found) { /* BlueFlame */ bhv_constant(oBlueFlameNextScale); - + /* SmallPiranhaFlame */ bhv_constant(oSmallPiranhaFlameStartSpeed); bhv_constant(oSmallPiranhaFlameEndSpeed); @@ -2356,7 +1358,7 @@ s64 DynOS_Bhv_ParseBehaviorScriptConstants(const String &_Arg, bool *found) { bhv_constant(oEnemyLakituBlinkTimer); bhv_constant(oEnemyLakituSpinyCooldown); bhv_constant(oEnemyLakituFaceForwardCountdown); - + /* IntroCutsceneLakitu */ bhv_constant(oIntroLakituSplineSegmentProgress); bhv_constant(oIntroLakituSplineSegment); @@ -2631,7 +1633,7 @@ s64 DynOS_Bhv_ParseBehaviorScriptConstants(const String &_Arg, bool *found) { //Secrets/RedCoins bhv_constant(oHiddenStarTriggerCounter); bhv_constant(oHiddenStarLastInteractedObject); - + //Overallverydifficulttodetermineusage,mostlystubbedcode. /* SparkleSpawnStar */ bhv_constant(oSparkleSpawnUnk1B0); @@ -2899,7 +1901,7 @@ static BehaviorScript ParseBehaviorScriptSymbolArgInternal(GfxData *aGfxData, Da String _Arg = aNode->mTokens[aTokenIndex++]; u64 _ModelIdentifier = aNode->mModelIdentifier; *found = true; - + // Built-in functions const void *_FunctionPtr = DynOS_Builtin_Func_GetFromName(_Arg.begin()); if (_FunctionPtr != NULL) { @@ -2923,105 +1925,40 @@ static BehaviorScript ParseBehaviorScriptSymbolArgInternal(GfxData *aGfxData, Da if (builtinCol != NULL) { return (BehaviorScript)builtinCol; } - + // Built-in Animations auto builtinAnim = DynOS_Builtin_Anim_GetFromName(_Arg.begin()); if (builtinAnim != NULL) { return (BehaviorScript)builtinAnim; } - - // Brackets - // Make sure we parse out the brackets if they are present. - if (_Arg[0] == '(') { - // Remove first bracket. - _Arg = _Arg.SubString(1); - - s32 _Brk = _Arg.FindLast(')'); - - // Remove last bracket. - if (_Brk != -1) { _Arg = _Arg.SubString(0, _Brk); } - } - - /* - // Offset - s32 _Offset = 0; - s32 _Plus = -1; - // Make sure we parse out all additions or offsets. - do { - _Plus = _Arg.FindLast('+'); - - // If we didn't find anything. Break early. - if (_Plus == -1) { break; } - - _Offset += _Arg.SubString(_Plus + 1).ParseInt(); - _Arg = _Arg.SubString(0, _Plus); - } - while(_Plus != -1); - */ - // OR Operations - s32 _OrValue = 0; - s32 _Or = -1; - // Make sure we parse out all or operations. - do { - _Or = _Arg.FindLast('|'); - - // If we didn't find anything. Break early. - if (_Or == -1) { break; } - - bool constantFound = false; - s64 constantValue = DynOS_Bhv_ParseBehaviorIntegerScriptConstants(_Arg.SubString(_Or + 1), &constantFound); - - if (constantFound) { - _OrValue |= constantValue; - } else { - _OrValue |= _Arg.SubString(_Or + 1).ParseInt(); - } - - _Arg = _Arg.SubString(0, _Or); - } - while(_Or != -1); - // Integers bool integerFound = false; s64 integerValue = DynOS_Misc_ParseInteger(_Arg, &integerFound); if (integerFound) { - // Support OR operations on integers. - if (_OrValue != 0) { integerValue |= _OrValue; } return integerValue; } - + // Parse integer constants bool intConstantFound = false; s64 constantIntValue = DynOS_Bhv_ParseBehaviorIntegerScriptConstants(_Arg, &intConstantFound); if (intConstantFound) { - // Support OR operations on integer constants. - if (_OrValue != 0) { constantIntValue |= _OrValue; } return (BehaviorScript) constantIntValue; } - + // Recursive descent parsing bool rdIntSuccess = false; s64 rdIntValue = DynOS_RecursiveDescent_Parse(_Arg.begin(), &rdIntSuccess, DynOS_Bhv_ParseBehaviorIntegerScriptConstants); if (rdIntSuccess) { - // Support OR operations on integer constants. - if (_OrValue != 0) { rdIntValue |= _OrValue; } return (BehaviorScript)rdIntValue; } - + // Parse all other constants last so everything else is found for certain. bool constantFound = false; s64 constantValue = DynOS_Bhv_ParseBehaviorScriptConstants(_Arg, &constantFound); if (constantFound) { return (BehaviorScript) constantValue; } - - // Recursive descent parsing - bool rdSuccess = false; - s64 rdValue = DynOS_RecursiveDescent_Parse(_Arg.begin(), &rdSuccess, DynOS_Bhv_ParseBehaviorScriptConstants); - if (rdSuccess) { - return (BehaviorScript)rdValue; - } *found = false; return 0; @@ -3048,7 +1985,7 @@ static BehaviorScript ParseBehaviorScriptSymbolArg(GfxData *aGfxData, DataNodemPointerList.Add(aHead + 1); BehaviorScript _Bs[] = { CALL(behavior) }; @@ -3187,15 +2124,15 @@ static void ParseBehaviorScriptSymbol(GfxData *aGfxData, DataNodemPointerList.Add(aHead + 1); BehaviorScript _Bs[] = { CALL_NATIVE(function) }; @@ -3209,15 +2146,15 @@ static void ParseBehaviorScriptSymbol(GfxData *aGfxData, DataNodemPointerList.Add(aHead + 1); BehaviorScript _Bs[] = { GOTO(behavior) }; @@ -3231,17 +2168,17 @@ static void ParseBehaviorScriptSymbol(GfxData *aGfxData, DataNodemPointerList.Add(aHead + 2); BehaviorScript _Bs[] = { SPAWN_CHILD(modelID, behavior) }; @@ -3255,17 +2192,17 @@ static void ParseBehaviorScriptSymbol(GfxData *aGfxData, DataNodemPointerList.Add(aHead + 2); BehaviorScript _Bs[] = { SPAWN_CHILD_WITH_PARAM(bhvParam, modelID, behavior) }; @@ -3279,16 +2216,16 @@ static void ParseBehaviorScriptSymbol(GfxData *aGfxData, DataNodemPointerList.Add(aHead + 2); BehaviorScript _Bs[] = { SPAWN_OBJ(modelID, behavior) }; @@ -3305,12 +2242,12 @@ static void ParseBehaviorScriptSymbol(GfxData *aGfxData, DataNodemPointerList.Add(aHead + 1); BehaviorScript _Bs[] = { LOAD_ANIMATIONS(field, animations) }; @@ -3325,15 +2262,15 @@ static void ParseBehaviorScriptSymbol(GfxData *aGfxData, DataNodemPointerList.Add(aHead + 1); BehaviorScript _Bs[] = { LOAD_COLLISION_DATA(collisionData) }; @@ -3347,7 +2284,7 @@ static void ParseBehaviorScriptSymbol(GfxData *aGfxData, DataNodemTokens[topTokenIndex + 0]); BehaviorScript _Bs[] = { CALL_EXT(behIndex) }; memcpy(aHead, _Bs, sizeof(_Bs)); @@ -3365,10 +2302,10 @@ static void ParseBehaviorScriptSymbol(GfxData *aGfxData, DataNodemTokens[topTokenIndex + 0]); BehaviorScript _Bs[] = { CALL_NATIVE_EXT(funcIndex) }; memcpy(aHead, _Bs, sizeof(_Bs)); @@ -3378,10 +2315,10 @@ static void ParseBehaviorScriptSymbol(GfxData *aGfxData, DataNodemTokens[topTokenIndex + 0]); BehaviorScript _Bs[] = { GOTO_EXT(behIndex) }; memcpy(aHead, _Bs, sizeof(_Bs)); @@ -3391,11 +2328,11 @@ static void ParseBehaviorScriptSymbol(GfxData *aGfxData, DataNodemTokens[topTokenIndex + 1]); BehaviorScript _Bs[] = { SPAWN_CHILD_EXT(modelID, behIndex) }; memcpy(aHead, _Bs, sizeof(_Bs)); @@ -3405,12 +2342,12 @@ static void ParseBehaviorScriptSymbol(GfxData *aGfxData, DataNodemTokens[topTokenIndex + 2]); BehaviorScript _Bs[] = { SPAWN_CHILD_WITH_PARAM_EXT(bhvParam, modelID, behIndex) }; memcpy(aHead, _Bs, sizeof(_Bs)); @@ -3420,11 +2357,11 @@ static void ParseBehaviorScriptSymbol(GfxData *aGfxData, DataNodemTokens[topTokenIndex + 1]); BehaviorScript _Bs[] = { SPAWN_OBJ_EXT(modelID, behIndex) }; memcpy(aHead, _Bs, sizeof(_Bs)); @@ -3435,11 +2372,11 @@ static void ParseBehaviorScriptSymbol(GfxData *aGfxData, DataNodemTokens[topTokenIndex + 0]); BehaviorScript _Bs[] = { LOAD_ANIMATIONS_EXT(field, animIndex) }; memcpy(aHead, _Bs, sizeof(_Bs)); @@ -3450,10 +2387,10 @@ static void ParseBehaviorScriptSymbol(GfxData *aGfxData, DataNodemTokens[topTokenIndex + 0]); BehaviorScript _Bs[] = { LOAD_COLLISION_DATA_EXT(colDataIndex) }; memcpy(aHead, _Bs, sizeof(_Bs)); @@ -3501,7 +2438,7 @@ static void DynOS_Bhv_Write(FILE* aFile, GfxData* aGfxData, DataNode(aFile, DATA_TYPE_BEHAVIOR_SCRIPT); aNode->mName.Write(aFile); - + // Version WriteBytes(aFile, BEHAVIOR_MAJOR_VER); WriteBytes(aFile, BEHAVIOR_MINOR_VER); @@ -3550,12 +2487,12 @@ static DataNode *DynOS_Bhv_Load(FILE *aFile, GfxData *aGfxData) // Name _Node->mName.Read(aFile); - + // Version u8 majorVersion = ReadBytes(aFile); u8 minorVersion = ReadBytes(aFile); u8 patchVersion = ReadBytes(aFile); - + // Version Sanity Check // // If the major version doesn't match, then a drasitc change has happened and @@ -3564,7 +2501,7 @@ static DataNode *DynOS_Bhv_Load(FILE *aFile, GfxData *aGfxData) u32 dataSize = ReadBytes(aFile); if (majorVersion != BEHAVIOR_MIN_MAJOR_VER || (minorVersion < BEHAVIOR_MIN_MINOR_VER || patchVersion < BEHAVIOR_MIN_PATCH_VER)) { PrintError(" ERROR: Behavior version is %u.%u.%u, but reading behaviors under %u.%u.%u is not supported!", majorVersion, minorVersion, patchVersion, BEHAVIOR_MIN_MAJOR_VER, BEHAVIOR_MIN_MINOR_VER, BEHAVIOR_MIN_PATCH_VER); - + // Skip the rest of the bytes saved for this behavior. SkipBytes(aFile, dataSize); // We don't return this since we failed to read the behavior. @@ -3677,10 +2614,10 @@ static void DynOS_Bhv_Generate(const SysPath &aPackFolder, ArraymErrorCount); } - + // Clear data pointers ClearBhvDataNodes(_GfxData->mBehaviorScripts); - + _GfxData->mPointerList.Clear(); _GfxData->mPointerOffsetList.Clear(); _GfxData->mLuaPointerList.Clear(); @@ -3694,7 +2631,7 @@ void DynOS_Bhv_GeneratePack(const SysPath &aPackFolder) { GfxData *_GfxData = New(); // Read the behavior_data.c files from the pack folder and any subfolders. - + // Read the main folder. if (fs_sys_dir_exists(aPackFolder.c_str())) { _GfxData->mModelIdentifier = 0; @@ -3705,7 +2642,7 @@ void DynOS_Bhv_GeneratePack(const SysPath &aPackFolder) { _BehaviorsFolders.Add({ _GfxData->mModelIdentifier, String(aPackFolder.c_str()) }); } } - + // Read the subfolders. DIR *aPackDir = opendir(aPackFolder.c_str()); if (aPackDir) { diff --git a/data/dynos_bin_common.cpp b/data/dynos_bin_common.cpp new file mode 100644 index 00000000..8de35f71 --- /dev/null +++ b/data/dynos_bin_common.cpp @@ -0,0 +1,1027 @@ +#include "dynos.cpp.h" +extern "C" { +#include "include/behavior_table.h" +#include "include/model_ids.h" +} + +#define common_constant(x) if (_Arg == #x) { return (s64) (x); } +#define common_legacy_constant(x, y) if (_Arg == #x) { return (BehaviorScript) (y); } + +s64 DynOS_Common_ParseBhvConstants(const String &_Arg, bool *found) { + *found = true; + + // Behavior names + common_constant(bhvStarDoor); + common_constant(bhvMrI); + common_constant(bhvMrIBody); + common_constant(bhvMrIParticle); + common_constant(bhvPurpleParticle); + common_constant(bhvGiantPole); + common_constant(bhvPoleGrabbing); + common_constant(bhvThiHugeIslandTop); + common_constant(bhvThiTinyIslandTop); + common_constant(bhvCapSwitchBase); + common_constant(bhvCapSwitch); + common_constant(bhvKingBobomb); + common_constant(bhvBobombAnchorMario); + common_constant(bhvBetaChestBottom); + common_constant(bhvBetaChestLid); + common_constant(bhvBubbleParticleSpawner); + common_constant(bhvBubbleMaybe); + common_constant(bhvBubblePlayer); + common_constant(bhvSmallWaterWave); + common_constant(bhvSmallWaterWave398); + common_constant(bhvWaterAirBubble); + common_constant(bhvSmallParticle); + common_constant(bhvPlungeBubble); + common_constant(bhvSmallParticleSnow); + common_constant(bhvSmallParticleBubbles); + common_constant(bhvFishGroup); + common_constant(bhvCannon); + common_constant(bhvCannonBarrel); + common_constant(bhvCannonBaseUnused); + common_constant(bhvChuckya); + common_constant(bhvChuckyaAnchorMario); + common_constant(bhvUnused05A8); + common_constant(bhvRotatingPlatform); + common_constant(bhvTower); + common_constant(bhvBulletBillCannon); + common_constant(bhvWfBreakableWallRight); + common_constant(bhvWfBreakableWallLeft); + common_constant(bhvKickableBoard); + common_constant(bhvTowerDoor); + common_constant(bhvRotatingCounterClockwise); + common_constant(bhvWfRotatingWoodenPlatform); + common_constant(bhvKoopaShellUnderwater); + common_constant(bhvExitPodiumWarp); + common_constant(bhvFadingWarp); + common_constant(bhvWarp); + common_constant(bhvWarpPipe); + common_constant(bhvWhitePuffExplosion); + common_constant(bhvSpawnedStar); + common_constant(bhvSpawnedStarNoLevelExit); + common_constant(bhvMrIBlueCoin); + common_constant(bhvCoinInsideBoo); + common_constant(bhvCoinFormationSpawn); + common_constant(bhvCoinFormation); + common_constant(bhvOneCoin); + common_constant(bhvYellowCoin); + common_constant(bhvTemporaryYellowCoin); + common_constant(bhvThreeCoinsSpawn); + common_constant(bhvTenCoinsSpawn); + common_constant(bhvSingleCoinGetsSpawned); + common_constant(bhvCoinSparkles); + common_constant(bhvGoldenCoinSparkles); + common_constant(bhvWallTinyStarParticle); + common_constant(bhvVertStarParticleSpawner); + common_constant(bhvPoundTinyStarParticle); + common_constant(bhvHorStarParticleSpawner); + common_constant(bhvPunchTinyTriangle); + common_constant(bhvTriangleParticleSpawner); + common_constant(bhvDoorWarp); + common_constant(bhvDoor); + common_constant(bhvGrindel); + common_constant(bhvThwomp2); + common_constant(bhvThwomp); + common_constant(bhvTumblingBridgePlatform); + common_constant(bhvWfTumblingBridge); + common_constant(bhvBbhTumblingBridge); + common_constant(bhvLllTumblingBridge); + common_constant(bhvFlame); + common_constant(bhvAnotherElavator); + common_constant(bhvRrElevatorPlatform); + common_constant(bhvHmcElevatorPlatform); + common_constant(bhvWaterMist); + common_constant(bhvBreathParticleSpawner); + common_constant(bhvBreakBoxTriangle); + common_constant(bhvWaterMist2); + common_constant(bhvUnused0DFC); + common_constant(bhvMistCircParticleSpawner); + common_constant(bhvDirtParticleSpawner); + common_constant(bhvSnowParticleSpawner); + common_constant(bhvWind); + common_constant(bhvEndToad); + common_constant(bhvEndPeach); + common_constant(bhvUnusedParticleSpawn); + common_constant(bhvUkiki); + common_constant(bhvUkikiCageChild); + common_constant(bhvUkikiCageStar); + common_constant(bhvUkikiCage); + common_constant(bhvBitfsSinkingPlatforms); + common_constant(bhvBitfsSinkingCagePlatform); + common_constant(bhvDddMovingPole); + common_constant(bhvBitfsTiltingInvertedPyramid); + common_constant(bhvSquishablePlatform); + common_constant(bhvCutOutObject); + common_constant(bhvBetaMovingFlamesSpawn); + common_constant(bhvBetaMovingFlames); + common_constant(bhvRrRotatingBridgePlatform); + common_constant(bhvFlamethrower); + common_constant(bhvFlamethrowerFlame); + common_constant(bhvBouncingFireball); + common_constant(bhvBouncingFireballFlame); + common_constant(bhvBowserShockWave); + common_constant(bhvFireParticleSpawner); + common_constant(bhvBlackSmokeMario); + common_constant(bhvBlackSmokeBowser); + common_constant(bhvBlackSmokeUpward); + common_constant(bhvBetaFishSplashSpawner); + common_constant(bhvSpindrift); + common_constant(bhvTowerPlatformGroup); + common_constant(bhvWfSlidingTowerPlatform); + common_constant(bhvWfElevatorTowerPlatform); + common_constant(bhvWfSolidTowerPlatform); + common_constant(bhvLeafParticleSpawner); + common_constant(bhvTreeSnow); + common_constant(bhvTreeLeaf); + common_constant(bhvAnotherTiltingPlatform); + common_constant(bhvSquarishPathMoving); + common_constant(bhvSquarishPathParent); + common_constant(bhvPiranhaPlantBubble); + common_constant(bhvPiranhaPlantWakingBubbles); + common_constant(bhvFloorSwitchAnimatesObject); + common_constant(bhvFloorSwitchGrills); + common_constant(bhvFloorSwitchHardcodedModel); + common_constant(bhvFloorSwitchHiddenObjects); + common_constant(bhvHiddenObject); + common_constant(bhvBreakableBox); + common_constant(bhvPushableMetalBox); + common_constant(bhvHeaveHo); + common_constant(bhvHeaveHoThrowMario); + common_constant(bhvCcmTouchedStarSpawn); + common_constant(bhvUnusedPoundablePlatform); + common_constant(bhvBetaTrampolineTop); + common_constant(bhvBetaTrampolineSpring); + common_constant(bhvJumpingBox); + common_constant(bhvBooCage); + common_constant(bhvStub); + common_constant(bhvIgloo); + common_constant(bhvBowserKey); + common_constant(bhvGrandStar); + common_constant(bhvBetaBooKey); + common_constant(bhvAlphaBooKey); + common_constant(bhvBulletBill); + common_constant(bhvWhitePuffSmoke); + common_constant(bhvUnused1820); + common_constant(bhvBowserTailAnchor); + common_constant(bhvBowser); + common_constant(bhvBowserBodyAnchor); + common_constant(bhvBowserFlameSpawn); + common_constant(bhvTiltingBowserLavaPlatform); + common_constant(bhvFallingBowserPlatform); + common_constant(bhvBlueBowserFlame); + common_constant(bhvFlameFloatingLanding); + common_constant(bhvBlueFlamesGroup); + common_constant(bhvFlameBouncing); + common_constant(bhvFlameMovingForwardGrowing); + common_constant(bhvFlameBowser); + common_constant(bhvFlameLargeBurningOut); + common_constant(bhvBlueFish); + common_constant(bhvTankFishGroup); + common_constant(bhvCheckerboardElevatorGroup); + common_constant(bhvCheckerboardPlatformSub); + common_constant(bhvBowserKeyUnlockDoor); + common_constant(bhvBowserKeyCourseExit); + common_constant(bhvInvisibleObjectsUnderBridge); + common_constant(bhvWaterLevelPillar); + common_constant(bhvDddWarp); + common_constant(bhvMoatGrills); + common_constant(bhvClockMinuteHand); + common_constant(bhvClockHourHand); + common_constant(bhvMacroUkiki); + common_constant(bhvStub1D0C); + common_constant(bhvLllRotatingHexagonalPlatform); + common_constant(bhvLllSinkingRockBlock); + common_constant(bhvStub1D70); + common_constant(bhvLllMovingOctagonalMeshPlatform); + common_constant(bhvSnowBall); + common_constant(bhvLllRotatingBlockWithFireBars); + common_constant(bhvLllRotatingHexFlame); + common_constant(bhvLllWoodPiece); + common_constant(bhvLllFloatingWoodBridge); + common_constant(bhvVolcanoFlames); + common_constant(bhvLllRotatingHexagonalRing); + common_constant(bhvLllSinkingRectangularPlatform); + common_constant(bhvLllSinkingSquarePlatforms); + common_constant(bhvLllTiltingInvertedPyramid); + common_constant(bhvUnused1F30); + common_constant(bhvKoopaShell); + common_constant(bhvKoopaShellFlame); + common_constant(bhvToxBox); + common_constant(bhvPiranhaPlant); + common_constant(bhvLllHexagonalMesh); + common_constant(bhvLllBowserPuzzlePiece); + common_constant(bhvLllBowserPuzzle); + common_constant(bhvTuxiesMother); + common_constant(bhvPenguinBaby); + common_constant(bhvUnused20E0); + common_constant(bhvSmallPenguin); + common_constant(bhvManyBlueFishSpawner); + common_constant(bhvFewBlueFishSpawner); + common_constant(bhvFishSpawner); + common_constant(bhvFish); + common_constant(bhvWdwExpressElevator); + common_constant(bhvWdwExpressElevatorPlatform); + common_constant(bhvChirpChirp); + common_constant(bhvChirpChirpUnused); + common_constant(bhvBub); + common_constant(bhvExclamationBox); + common_constant(bhvRotatingExclamationMark); + common_constant(bhvSoundSpawner); + common_constant(bhvRockSolid); + common_constant(bhvBowserSubDoor); + common_constant(bhvBowsersSub); + common_constant(bhvSushiShark); + common_constant(bhvSushiSharkCollisionChild); + common_constant(bhvJrbSlidingBox); + common_constant(bhvShipPart3); + common_constant(bhvInSunkenShip3); + common_constant(bhvSunkenShipPart); + common_constant(bhvSunkenShipSetRotation); + common_constant(bhvSunkenShipPart2); + common_constant(bhvInSunkenShip); + common_constant(bhvInSunkenShip2); + common_constant(bhvMistParticleSpawner); + common_constant(bhvWhitePuff1); + common_constant(bhvWhitePuff2); + common_constant(bhvWhitePuffSmoke2); + common_constant(bhvPurpleSwitchHiddenBoxes); + common_constant(bhvBlueCoinSwitch); + common_constant(bhvHiddenBlueCoin); + common_constant(bhvOpenableCageDoor); + common_constant(bhvOpenableGrill); + common_constant(bhvWaterLevelDiamond); + common_constant(bhvInitializeChangingWaterLevel); + common_constant(bhvTweesterSandParticle); + common_constant(bhvTweester); + common_constant(bhvMerryGoRoundBooManager); + common_constant(bhvPlaysMusicTrackWhenTouched); + common_constant(bhvAnimatedTexture); + common_constant(bhvBooInCastle); + common_constant(bhvBooWithCage); + common_constant(bhvBalconyBigBoo); + common_constant(bhvMerryGoRoundBigBoo); + common_constant(bhvGhostHuntBigBoo); + common_constant(bhvCourtyardBooTriplet); + common_constant(bhvBoo); + common_constant(bhvMerryGoRoundBoo); + common_constant(bhvGhostHuntBoo); + common_constant(bhvHiddenStaircaseStep); + common_constant(bhvBooBossSpawnedBridge); + common_constant(bhvBbhTiltingTrapPlatform); + common_constant(bhvHauntedBookshelf); + common_constant(bhvMeshElevator); + common_constant(bhvMerryGoRound); + common_constant(bhvInsideCannon); + common_constant(bhvBetaBowserAnchor); + common_constant(bhvStaticCheckeredPlatform); + common_constant(bhvUnused2A10); + common_constant(bhvStar); + common_constant(bhvStaticObject); + common_constant(bhvUnused2A54); + common_constant(bhvCastleFloorTrap); + common_constant(bhvFloorTrapInCastle); + common_constant(bhvTree); + common_constant(bhvSparkle); + common_constant(bhvSparkleSpawn); + common_constant(bhvSparkleParticleSpawner); + common_constant(bhvScuttlebug); + common_constant(bhvScuttlebugSpawn); + common_constant(bhvWhompKingBoss); + common_constant(bhvSmallWhomp); + common_constant(bhvWaterSplash); + common_constant(bhvWaterDroplet); + common_constant(bhvWaterDropletSplash); + common_constant(bhvBubbleSplash); + common_constant(bhvIdleWaterWave); + common_constant(bhvObjectWaterSplash); + common_constant(bhvShallowWaterWave); + common_constant(bhvShallowWaterSplash); + common_constant(bhvObjectWaveTrail); + common_constant(bhvWaveTrail); + common_constant(bhvTinyStrongWindParticle); + common_constant(bhvStrongWindParticle); + common_constant(bhvSLSnowmanWind); + common_constant(bhvSLWalkingPenguin); + common_constant(bhvYellowBall); + common_constant(bhvMario); + common_constant(bhvToadMessage); + common_constant(bhvUnlockDoorStar); + common_constant(bhvInstantActiveWarp); + common_constant(bhvAirborneWarp); + common_constant(bhvHardAirKnockBackWarp); + common_constant(bhvSpinAirborneCircleWarp); + common_constant(bhvDeathWarp); + common_constant(bhvSpinAirborneWarp); + common_constant(bhvFlyingWarp); + common_constant(bhvPaintingStarCollectWarp); + common_constant(bhvPaintingDeathWarp); + common_constant(bhvAirborneDeathWarp); + common_constant(bhvAirborneStarCollectWarp); + common_constant(bhvLaunchStarCollectWarp); + common_constant(bhvLaunchDeathWarp); + common_constant(bhvSwimmingWarp); + common_constant(bhvRandomAnimatedTexture); + common_constant(bhvYellowBackgroundInMenu); + common_constant(bhvMenuButton); + common_constant(bhvMenuButtonManager); + common_constant(bhvActSelectorStarType); + common_constant(bhvActSelector); + common_constant(bhvMovingYellowCoin); + common_constant(bhvMovingBlueCoin); + common_constant(bhvBlueCoinSliding); + common_constant(bhvBlueCoinJumping); + common_constant(bhvSeaweed); + common_constant(bhvSeaweedBundle); + common_constant(bhvBobomb); + common_constant(bhvBobombFuseSmoke); + common_constant(bhvBobombBuddy); + common_constant(bhvBobombBuddyOpensCannon); + common_constant(bhvCannonClosed); + common_constant(bhvWhirlpool); + common_constant(bhvJetStream); + common_constant(bhvMessagePanel); + common_constant(bhvSignOnWall); + common_constant(bhvHomingAmp); + common_constant(bhvCirclingAmp); + common_constant(bhvButterfly); + common_constant(bhvHoot); + common_constant(bhvBetaHoldableObject); + common_constant(bhvCarrySomething1); + common_constant(bhvCarrySomething2); + common_constant(bhvCarrySomething3); + common_constant(bhvCarrySomething4); + common_constant(bhvCarrySomething5); + common_constant(bhvCarrySomething6); + common_constant(bhvObjectBubble); + common_constant(bhvObjectWaterWave); + common_constant(bhvExplosion); + common_constant(bhvBobombBullyDeathSmoke); + common_constant(bhvSmoke); + common_constant(bhvBobombExplosionBubble); + common_constant(bhvBobombExplosionBubble3600); + common_constant(bhvRespawner); + common_constant(bhvSmallBully); + common_constant(bhvBigBully); + common_constant(bhvBigBullyWithMinions); + common_constant(bhvSmallChillBully); + common_constant(bhvBigChillBully); + common_constant(bhvJetStreamRingSpawner); + common_constant(bhvJetStreamWaterRing); + common_constant(bhvMantaRayWaterRing); + common_constant(bhvMantaRayRingManager); + common_constant(bhvBowserBomb); + common_constant(bhvBowserBombExplosion); + common_constant(bhvBowserBombSmoke); + common_constant(bhvCelebrationStar); + common_constant(bhvCelebrationStarSparkle); + common_constant(bhvStarKeyCollectionPuffSpawner); + common_constant(bhvLllDrawbridgeSpawner); + common_constant(bhvLllDrawbridge); + common_constant(bhvSmallBomp); + common_constant(bhvLargeBomp); + common_constant(bhvWfSlidingPlatform); + common_constant(bhvMoneybag); + common_constant(bhvMoneybagHidden); + common_constant(bhvPitBowlingBall); + common_constant(bhvFreeBowlingBall); + common_constant(bhvBowlingBall); + common_constant(bhvTtmBowlingBallSpawner); + common_constant(bhvBobBowlingBallSpawner); + common_constant(bhvThiBowlingBallSpawner); + common_constant(bhvRrCruiserWing); + common_constant(bhvSpindel); + common_constant(bhvSslMovingPyramidWall); + common_constant(bhvPyramidElevator); + common_constant(bhvPyramidElevatorTrajectoryMarkerBall); + common_constant(bhvPyramidTop); + common_constant(bhvPyramidTopFragment); + common_constant(bhvPyramidPillarTouchDetector); + common_constant(bhvWaterfallSoundLoop); + common_constant(bhvVolcanoSoundLoop); + common_constant(bhvCastleFlagWaving); + common_constant(bhvBirdsSoundLoop); + common_constant(bhvAmbientSounds); + common_constant(bhvSandSoundLoop); + common_constant(bhvHiddenAt120Stars); + common_constant(bhvSnowmansBottom); + common_constant(bhvSnowmansHead); + common_constant(bhvSnowmansBodyCheckpoint); + common_constant(bhvBigSnowmanWhole); + common_constant(bhvBigBoulder); + common_constant(bhvBigBoulderGenerator); + common_constant(bhvWingCap); + common_constant(bhvMetalCap); + common_constant(bhvNormalCap); + common_constant(bhvVanishCap); + common_constant(bhvStar); + common_constant(bhvStarSpawnCoordinates); + common_constant(bhvHiddenRedCoinStar); + common_constant(bhvRedCoin); + common_constant(bhvBowserCourseRedCoinStar); + common_constant(bhvHiddenStar); + common_constant(bhvHiddenStarTrigger); + common_constant(bhvTtmRollingLog); + common_constant(bhvLllVolcanoFallingTrap); + common_constant(bhvLllRollingLog); + common_constant(bhv1upWalking); + common_constant(bhv1upRunningAway); + common_constant(bhv1upSliding); + common_constant(bhv1Up); + common_constant(bhv1upJumpOnApproach); + common_constant(bhvHidden1up); + common_constant(bhvHidden1upTrigger); + common_constant(bhvHidden1upInPole); + common_constant(bhvHidden1upInPoleTrigger); + common_constant(bhvHidden1upInPoleSpawner); + common_constant(bhvControllablePlatform); + common_constant(bhvControllablePlatformSub); + common_constant(bhvBreakableBoxSmall); + common_constant(bhvSlidingSnowMound); + common_constant(bhvSnowMoundSpawn); + common_constant(bhvWdwSquareFloatingPlatform); + common_constant(bhvWdwRectangularFloatingPlatform); + common_constant(bhvJrbFloatingPlatform); + common_constant(bhvArrowLift); + common_constant(bhvOrangeNumber); + common_constant(bhvMantaRay); + common_constant(bhvFallingPillar); + common_constant(bhvFallingPillarHitbox); + common_constant(bhvPillarBase); + common_constant(bhvJrbFloatingBox); + common_constant(bhvDecorativePendulum); + common_constant(bhvTreasureChestsShip); + common_constant(bhvTreasureChestsJrb); + common_constant(bhvTreasureChests); + common_constant(bhvTreasureChestBottom); + common_constant(bhvTreasureChestTop); + common_constant(bhvMips); + common_constant(bhvYoshi); + common_constant(bhvKoopa); + common_constant(bhvKoopaRaceEndpoint); + common_constant(bhvKoopaFlag); + common_constant(bhvPokey); + common_constant(bhvPokeyBodyPart); + common_constant(bhvSwoop); + common_constant(bhvFlyGuy); + common_constant(bhvGoomba); + common_constant(bhvGoombaTripletSpawner); + common_constant(bhvChainChomp); + common_constant(bhvChainChompChainPart); + common_constant(bhvWoodenPost); + common_constant(bhvChainChompGate); + common_constant(bhvWigglerHead); + common_constant(bhvWigglerBody); + common_constant(bhvEnemyLakitu); + common_constant(bhvCameraLakitu); + common_constant(bhvCloud); + common_constant(bhvCloudPart); + common_constant(bhvSpiny); + common_constant(bhvMontyMole); + common_constant(bhvMontyMoleHole); + common_constant(bhvMontyMoleRock); + common_constant(bhvPlatformOnTrack); + common_constant(bhvTrackBall); + common_constant(bhvSeesawPlatform); + common_constant(bhvFerrisWheelAxle); + common_constant(bhvFerrisWheelPlatform); + common_constant(bhvWaterBombSpawner); + common_constant(bhvWaterBomb); + common_constant(bhvWaterBombShadow); + common_constant(bhvTTCRotatingSolid); + common_constant(bhvTTCPendulum); + common_constant(bhvTTCTreadmill); + common_constant(bhvTTCMovingBar); + common_constant(bhvTTCCog); + common_constant(bhvTTCPitBlock); + common_constant(bhvTTCElevator); + common_constant(bhvTTC2DRotator); + common_constant(bhvTTCSpinner); + common_constant(bhvMrBlizzard); + common_constant(bhvMrBlizzardSnowball); + common_constant(bhvSlidingPlatform2); + common_constant(bhvOctagonalPlatformRotating); + common_constant(bhvAnimatesOnFloorSwitchPress); + common_constant(bhvActivatedBackAndForthPlatform); + common_constant(bhvRecoveryHeart); + common_constant(bhvWaterBombCannon); + common_constant(bhvCannonBarrelBubbles); + common_constant(bhvUnagi); + common_constant(bhvUnagiSubobject); + common_constant(bhvDorrie); + common_constant(bhvHauntedChair); + common_constant(bhvMadPiano); + common_constant(bhvFlyingBookend); + common_constant(bhvBookendSpawn); + common_constant(bhvHauntedBookshelfManager); + common_constant(bhvBookSwitch); + common_constant(bhvFirePiranhaPlant); + common_constant(bhvSmallPiranhaFlame); + common_constant(bhvFireSpitter); + common_constant(bhvFlyguyFlame); + common_constant(bhvSnufit); + common_constant(bhvSnufitBalls); + common_constant(bhvHorizontalGrindel); + common_constant(bhvEyerokBoss); + common_constant(bhvEyerokHand); + common_constant(bhvKlepto); + common_constant(bhvBird); + common_constant(bhvRacingPenguin); + common_constant(bhvPenguinRaceFinishLine); + common_constant(bhvPenguinRaceShortcutCheck); + common_constant(bhvCoffinSpawner); + common_constant(bhvCoffin); + common_constant(bhvClamShell); + common_constant(bhvSkeeter); + common_constant(bhvSkeeterWave); + common_constant(bhvSwingPlatform); + common_constant(bhvDonutPlatformSpawner); + common_constant(bhvDonutPlatform); + common_constant(bhvDDDPole); + common_constant(bhvRedCoinStarMarker); + common_constant(bhvTripletButterfly); + common_constant(bhvBubba); + common_constant(bhvBeginningLakitu); + common_constant(bhvBeginningPeach); + common_constant(bhvEndBirds1); + common_constant(bhvEndBirds2); + common_constant(bhvIntroScene); + common_constant(bhvUnusedFakeStar); + + // Legacy behavior names + common_legacy_constant(bhvFish2, bhvManyBlueFishSpawner); + common_legacy_constant(bhvFish3, bhvFewBlueFishSpawner); + common_legacy_constant(bhvLargeFishGroup, bhvFishSpawner); + + *found = false; + return 0; +} + +s64 DynOS_Common_ParseModelConstants(const String &_Arg, bool *found) { + *found = true; + + common_constant(ACT_1); + common_constant(ACT_2); + common_constant(ACT_3); + common_constant(ACT_4); + common_constant(ACT_5); + common_constant(ACT_6); + common_constant(ALL_ACTS_MACRO); + common_constant(ALL_ACTS); + common_constant(COIN_FORMATION_FLAG_VERTICAL); + common_constant(COIN_FORMATION_FLAG_RING); + common_constant(COIN_FORMATION_FLAG_ARROW); + common_constant(COIN_FORMATION_FLAG_FLYING); + common_constant(MODEL_NONE); + common_constant(MODEL_MARIO); + common_constant(MODEL_LEVEL_GEOMETRY_03); + common_constant(MODEL_LEVEL_GEOMETRY_04); + common_constant(MODEL_LEVEL_GEOMETRY_05); + common_constant(MODEL_LEVEL_GEOMETRY_06); + common_constant(MODEL_LEVEL_GEOMETRY_07); + common_constant(MODEL_LEVEL_GEOMETRY_08); + common_constant(MODEL_LEVEL_GEOMETRY_09); + common_constant(MODEL_LEVEL_GEOMETRY_0A); + common_constant(MODEL_LEVEL_GEOMETRY_0B); + common_constant(MODEL_LEVEL_GEOMETRY_0C); + common_constant(MODEL_LEVEL_GEOMETRY_0D); + common_constant(MODEL_LEVEL_GEOMETRY_0E); + common_constant(MODEL_LEVEL_GEOMETRY_0F); + common_constant(MODEL_LEVEL_GEOMETRY_10); + common_constant(MODEL_LEVEL_GEOMETRY_11); + common_constant(MODEL_LEVEL_GEOMETRY_12); + common_constant(MODEL_LEVEL_GEOMETRY_13); + common_constant(MODEL_LEVEL_GEOMETRY_14); + common_constant(MODEL_LEVEL_GEOMETRY_15); + common_constant(MODEL_LEVEL_GEOMETRY_16); + common_constant(MODEL_BOB_BUBBLY_TREE); + common_constant(MODEL_WDW_BUBBLY_TREE); + common_constant(MODEL_CASTLE_GROUNDS_BUBBLY_TREE); + common_constant(MODEL_WF_BUBBLY_TREE); + common_constant(MODEL_THI_BUBBLY_TREE); + common_constant(MODEL_COURTYARD_SPIKY_TREE); + common_constant(MODEL_CCM_SNOW_TREE); + common_constant(MODEL_SL_SNOW_TREE); + common_constant(MODEL_UNKNOWN_TREE_1A); + common_constant(MODEL_SSL_PALM_TREE); + common_constant(MODEL_CASTLE_CASTLE_DOOR_UNUSED); + common_constant(MODEL_CASTLE_WOODEN_DOOR_UNUSED); + common_constant(MODEL_BBH_HAUNTED_DOOR); + common_constant(MODEL_HMC_WOODEN_DOOR); + common_constant(MODEL_UNKNOWN_DOOR_1E); + common_constant(MODEL_HMC_METAL_DOOR); + common_constant(MODEL_HMC_HAZY_MAZE_DOOR); + common_constant(MODEL_UNKNOWN_DOOR_21); + common_constant(MODEL_CASTLE_DOOR_0_STARS); + common_constant(MODEL_CASTLE_DOOR_1_STAR); + common_constant(MODEL_CASTLE_DOOR_3_STARS); + common_constant(MODEL_CASTLE_KEY_DOOR); + common_constant(MODEL_CASTLE_CASTLE_DOOR); + common_constant(MODEL_CASTLE_GROUNDS_CASTLE_DOOR); + common_constant(MODEL_CASTLE_WOODEN_DOOR); + common_constant(MODEL_COURTYARD_WOODEN_DOOR); + common_constant(MODEL_CCM_CABIN_DOOR); + common_constant(MODEL_UNKNOWN_DOOR_28); + common_constant(MODEL_CASTLE_METAL_DOOR); + common_constant(MODEL_CASTLE_GROUNDS_METAL_DOOR); + common_constant(MODEL_UNKNOWN_DOOR_2A); + common_constant(MODEL_UNKNOWN_DOOR_2B); + common_constant(MODEL_WF_TOWER_TRAPEZOID_PLATORM); + common_constant(MODEL_WF_TOWER_SQUARE_PLATORM); + common_constant(MODEL_WF_TOWER_SQUARE_PLATORM_UNUSED); + common_constant(MODEL_WF_TOWER_SQUARE_PLATORM_ELEVATOR); + common_constant(MODEL_BBH_STAIRCASE_STEP); + common_constant(MODEL_BBH_TILTING_FLOOR_PLATFORM); + common_constant(MODEL_BBH_TUMBLING_PLATFORM); + common_constant(MODEL_BBH_TUMBLING_PLATFORM_PART); + common_constant(MODEL_BBH_MOVING_BOOKSHELF); + common_constant(MODEL_BBH_MESH_ELEVATOR); + common_constant(MODEL_BBH_MERRY_GO_ROUND); + common_constant(MODEL_BBH_WOODEN_TOMB); + common_constant(MODEL_CCM_ROPEWAY_LIFT); + common_constant(MODEL_CCM_SNOWMAN_HEAD); + common_constant(MODEL_CASTLE_BOWSER_TRAP); + common_constant(MODEL_CASTLE_WATER_LEVEL_PILLAR); + common_constant(MODEL_CASTLE_CLOCK_MINUTE_HAND); + common_constant(MODEL_CASTLE_CLOCK_HOUR_HAND); + common_constant(MODEL_CASTLE_CLOCK_PENDULUM); + common_constant(MODEL_HMC_METAL_PLATFORM); + common_constant(MODEL_HMC_METAL_ARROW_PLATFORM); + common_constant(MODEL_HMC_ELEVATOR_PLATFORM); + common_constant(MODEL_HMC_ROLLING_ROCK); + common_constant(MODEL_HMC_ROCK_PIECE); + common_constant(MODEL_HMC_ROCK_SMALL_PIECE); + common_constant(MODEL_HMC_RED_GRILLS); + common_constant(MODEL_SSL_PYRAMID_TOP); + common_constant(MODEL_SSL_GRINDEL); + common_constant(MODEL_SSL_SPINDEL); + common_constant(MODEL_SSL_MOVING_PYRAMID_WALL); + common_constant(MODEL_SSL_PYRAMID_ELEVATOR); + common_constant(MODEL_BOB_CHAIN_CHOMP_GATE); + common_constant(MODEL_BOB_SEESAW_PLATFORM); + common_constant(MODEL_BOB_BARS_GRILLS); + common_constant(MODEL_SL_SNOW_TRIANGLE); + common_constant(MODEL_SL_CRACKED_ICE); + common_constant(MODEL_SL_CRACKED_ICE_CHUNK); + common_constant(MODEL_WDW_SQUARE_FLOATING_PLATFORM); + common_constant(MODEL_WDW_ARROW_LIFT); + common_constant(MODEL_WDW_WATER_LEVEL_DIAMOND); + common_constant(MODEL_WDW_HIDDEN_PLATFORM); + common_constant(MODEL_WDW_EXPRESS_ELEVATOR); + common_constant(MODEL_WDW_RECTANGULAR_FLOATING_PLATFORM); + common_constant(MODEL_WDW_ROTATING_PLATFORM); + common_constant(MODEL_JRB_SHIP_LEFT_HALF_PART); + common_constant(MODEL_JRB_SHIP_BACK_LEFT_PART); + common_constant(MODEL_JRB_SHIP_RIGHT_HALF_PART); + common_constant(MODEL_JRB_SHIP_BACK_RIGHT_PART); + common_constant(MODEL_JRB_SUNKEN_SHIP); + common_constant(MODEL_JRB_SUNKEN_SHIP_BACK); + common_constant(MODEL_JRB_ROCK); + common_constant(MODEL_JRB_SLIDING_BOX); + common_constant(MODEL_JRB_FALLING_PILLAR); + common_constant(MODEL_JRB_FALLING_PILLAR_BASE); + common_constant(MODEL_JRB_FLOATING_PLATFORM); + common_constant(MODEL_THI_HUGE_ISLAND_TOP); + common_constant(MODEL_THI_TINY_ISLAND_TOP); + common_constant(MODEL_TTC_ROTATING_CUBE); + common_constant(MODEL_TTC_ROTATING_PRISM); + common_constant(MODEL_TTC_PENDULUM); + common_constant(MODEL_TTC_LARGE_TREADMILL); + common_constant(MODEL_TTC_SMALL_TREADMILL); + common_constant(MODEL_TTC_PUSH_BLOCK); + common_constant(MODEL_TTC_ROTATING_HEXAGON); + common_constant(MODEL_TTC_ROTATING_TRIANGLE); + common_constant(MODEL_TTC_PIT_BLOCK); + common_constant(MODEL_TTC_PIT_BLOCK_UNUSED); + common_constant(MODEL_TTC_ELEVATOR_PLATFORM); + common_constant(MODEL_TTC_CLOCK_HAND); + common_constant(MODEL_TTC_SPINNER); + common_constant(MODEL_TTC_SMALL_GEAR); + common_constant(MODEL_TTC_LARGE_GEAR); + common_constant(MODEL_RR_SLIDING_PLATFORM); + common_constant(MODEL_RR_FLYING_CARPET); + common_constant(MODEL_RR_OCTAGONAL_PLATFORM); + common_constant(MODEL_RR_ROTATING_BRIDGE_PLATFORM); + common_constant(MODEL_RR_TRIANGLE_PLATFORM); + common_constant(MODEL_RR_CRUISER_WING); + common_constant(MODEL_RR_SEESAW_PLATFORM); + common_constant(MODEL_RR_L_SHAPED_PLATFORM); + common_constant(MODEL_RR_SWINGING_PLATFORM); + common_constant(MODEL_RR_DONUT_PLATFORM); + common_constant(MODEL_RR_ELEVATOR_PLATFORM); + common_constant(MODEL_RR_TRICKY_TRIANGLES); + common_constant(MODEL_RR_TRICKY_TRIANGLES_FRAME1); + common_constant(MODEL_RR_TRICKY_TRIANGLES_FRAME2); + common_constant(MODEL_RR_TRICKY_TRIANGLES_FRAME3); + common_constant(MODEL_RR_TRICKY_TRIANGLES_FRAME4); + common_constant(MODEL_BITDW_SQUARE_PLATFORM); + common_constant(MODEL_BITDW_SEESAW_PLATFORM); + common_constant(MODEL_BITDW_SLIDING_PLATFORM); + common_constant(MODEL_BITDW_FERRIS_WHEEL_AXLE); + common_constant(MODEL_BITDW_BLUE_PLATFORM); + common_constant(MODEL_BITDW_STAIRCASE_FRAME4); + common_constant(MODEL_BITDW_STAIRCASE_FRAME3); + common_constant(MODEL_BITDW_STAIRCASE_FRAME2); + common_constant(MODEL_BITDW_STAIRCASE_FRAME1); + common_constant(MODEL_BITDW_STAIRCASE); + common_constant(MODEL_VCUTM_SEESAW_PLATFORM); + common_constant(MODEL_VCUTM_CHECKERBOARD_PLATFORM_SPAWNER); + common_constant(MODEL_BITFS_PLATFORM_ON_TRACK); + common_constant(MODEL_BITFS_TILTING_SQUARE_PLATFORM); + common_constant(MODEL_BITFS_SINKING_PLATFORMS); + common_constant(MODEL_BITFS_BLUE_POLE); + common_constant(MODEL_BITFS_SINKING_CAGE_PLATFORM); + common_constant(MODEL_BITFS_ELEVATOR); + common_constant(MODEL_BITFS_STRETCHING_PLATFORMS); + common_constant(MODEL_BITFS_SEESAW_PLATFORM); + common_constant(MODEL_BITFS_MOVING_SQUARE_PLATFORM); + common_constant(MODEL_BITFS_SLIDING_PLATFORM); + common_constant(MODEL_BITFS_TUMBLING_PLATFORM_PART); + common_constant(MODEL_BITFS_TUMBLING_PLATFORM); + common_constant(MODEL_BITS_SLIDING_PLATFORM); + common_constant(MODEL_BITS_TWIN_SLIDING_PLATFORMS); + common_constant(MODEL_BITS_OCTAGONAL_PLATFORM); + common_constant(MODEL_BITS_BLUE_PLATFORM); + common_constant(MODEL_BITS_FERRIS_WHEEL_AXLE); + common_constant(MODEL_BITS_ARROW_PLATFORM); + common_constant(MODEL_BITS_SEESAW_PLATFORM); + common_constant(MODEL_BITS_TILTING_W_PLATFORM); + common_constant(MODEL_BITS_STAIRCASE); + common_constant(MODEL_BITS_STAIRCASE_FRAME1); + common_constant(MODEL_BITS_STAIRCASE_FRAME2); + common_constant(MODEL_BITS_STAIRCASE_FRAME3); + common_constant(MODEL_BITS_STAIRCASE_FRAME4); + common_constant(MODEL_BITS_WARP_PIPE); + common_constant(MODEL_LLL_DRAWBRIDGE_PART); + common_constant(MODEL_LLL_ROTATING_BLOCK_FIRE_BARS); + common_constant(MODEL_LLL_ROTATING_HEXAGONAL_RING); + common_constant(MODEL_LLL_SINKING_RECTANGULAR_PLATFORM); + common_constant(MODEL_LLL_SINKING_SQUARE_PLATFORMS); + common_constant(MODEL_LLL_TILTING_SQUARE_PLATFORM); + common_constant(MODEL_LLL_BOWSER_PIECE_1); + common_constant(MODEL_LLL_BOWSER_PIECE_2); + common_constant(MODEL_LLL_BOWSER_PIECE_3); + common_constant(MODEL_LLL_BOWSER_PIECE_4); + common_constant(MODEL_LLL_BOWSER_PIECE_5); + common_constant(MODEL_LLL_BOWSER_PIECE_6); + common_constant(MODEL_LLL_BOWSER_PIECE_7); + common_constant(MODEL_LLL_BOWSER_PIECE_8); + common_constant(MODEL_LLL_BOWSER_PIECE_9); + common_constant(MODEL_LLL_BOWSER_PIECE_10); + common_constant(MODEL_LLL_BOWSER_PIECE_11); + common_constant(MODEL_LLL_BOWSER_PIECE_12); + common_constant(MODEL_LLL_BOWSER_PIECE_13); + common_constant(MODEL_LLL_BOWSER_PIECE_14); + common_constant(MODEL_LLL_MOVING_OCTAGONAL_MESH_PLATFORM); + common_constant(MODEL_LLL_SINKING_ROCK_BLOCK); + common_constant(MODEL_LLL_ROLLING_LOG); + common_constant(MODEL_LLL_WOOD_BRIDGE); + common_constant(MODEL_LLL_LARGE_WOOD_BRIDGE); + common_constant(MODEL_LLL_FALLING_PLATFORM); + common_constant(MODEL_LLL_LARGE_FALLING_PLATFORM); + common_constant(MODEL_LLL_VOLCANO_FALLING_TRAP); + common_constant(MODEL_DDD_BOWSER_SUB_DOOR); + common_constant(MODEL_DDD_BOWSER_SUB); + common_constant(MODEL_DDD_POLE); + common_constant(MODEL_WF_BREAKABLE_WALL_RIGHT); + common_constant(MODEL_WF_BREAKABLE_WALL_LEFT); + common_constant(MODEL_WF_KICKABLE_BOARD); + common_constant(MODEL_WF_TOWER_DOOR); + common_constant(MODEL_WF_KICKABLE_BOARD_FELLED); + common_constant(MODEL_CASTLE_GROUNDS_VCUTM_GRILL); + common_constant(MODEL_CASTLE_GROUNDS_FLAG); + common_constant(MODEL_CASTLE_GROUNDS_CANNON_GRILL); + common_constant(MODEL_BOWSER_2_TILTING_ARENA); + common_constant(MODEL_BOWSER_3_FALLING_PLATFORM_1); + common_constant(MODEL_BOWSER_3_FALLING_PLATFORM_2); + common_constant(MODEL_BOWSER_3_FALLING_PLATFORM_3); + common_constant(MODEL_BOWSER_3_FALLING_PLATFORM_4); + common_constant(MODEL_BOWSER_3_FALLING_PLATFORM_5); + common_constant(MODEL_BOWSER_3_FALLING_PLATFORM_6); + common_constant(MODEL_BOWSER_3_FALLING_PLATFORM_7); + common_constant(MODEL_BOWSER_3_FALLING_PLATFORM_8); + common_constant(MODEL_BOWSER_3_FALLING_PLATFORM_9); + common_constant(MODEL_BOWSER_3_FALLING_PLATFORM_10); + common_constant(MODEL_TTM_ROLLING_LOG); + common_constant(MODEL_TTM_STAR_CAGE); + common_constant(MODEL_TTM_BLUE_SMILEY); + common_constant(MODEL_TTM_YELLOW_SMILEY); + common_constant(MODEL_TTM_STAR_SMILEY); + common_constant(MODEL_TTM_MOON_SMILEY); + common_constant(MODEL_BULLET_BILL); + common_constant(MODEL_YELLOW_SPHERE); + common_constant(MODEL_HOOT); + common_constant(MODEL_YOSHI_EGG); + common_constant(MODEL_THWOMP); + common_constant(MODEL_HEAVE_HO); + common_constant(MODEL_BLARGG); + common_constant(MODEL_BULLY); + common_constant(MODEL_BULLY_BOSS); + common_constant(MODEL_WATER_BOMB); + common_constant(MODEL_WATER_BOMB_SHADOW); + common_constant(MODEL_KING_BOBOMB); + common_constant(MODEL_MANTA_RAY); + common_constant(MODEL_UNAGI); + common_constant(MODEL_SUSHI); + common_constant(MODEL_DL_WHIRLPOOL); + common_constant(MODEL_CLAM_SHELL); + common_constant(MODEL_POKEY_HEAD); + common_constant(MODEL_POKEY_BODY_PART); + common_constant(MODEL_TWEESTER); + common_constant(MODEL_KLEPTO); + common_constant(MODEL_EYEROK_LEFT_HAND); + common_constant(MODEL_EYEROK_RIGHT_HAND); + common_constant(MODEL_DL_MONTY_MOLE_HOLE); + common_constant(MODEL_MONTY_MOLE); + common_constant(MODEL_UKIKI); + common_constant(MODEL_FWOOSH); + common_constant(MODEL_SPINDRIFT); + common_constant(MODEL_MR_BLIZZARD_HIDDEN); + common_constant(MODEL_MR_BLIZZARD); + common_constant(MODEL_PENGUIN); + common_constant(MODEL_CAP_SWITCH_EXCLAMATION); + common_constant(MODEL_CAP_SWITCH); + common_constant(MODEL_CAP_SWITCH_BASE); + common_constant(MODEL_BOO); + common_constant(MODEL_BETA_BOO_KEY); + common_constant(MODEL_HAUNTED_CHAIR); + common_constant(MODEL_MAD_PIANO); + common_constant(MODEL_BOOKEND_PART); + common_constant(MODEL_BOOKEND); + common_constant(MODEL_HAUNTED_CAGE); + common_constant(MODEL_BIRDS); + common_constant(MODEL_YOSHI); + common_constant(MODEL_ENEMY_LAKITU); + common_constant(MODEL_SPINY_BALL); + common_constant(MODEL_SPINY); + common_constant(MODEL_WIGGLER_HEAD); + common_constant(MODEL_WIGGLER_BODY); + common_constant(MODEL_BUBBA); + common_constant(MODEL_UNKNOWN_54); + common_constant(MODEL_UNKNOWN_58); + common_constant(MODEL_BOWSER); + common_constant(MODEL_BOWSER_BOMB_CHILD_OBJ); + common_constant(MODEL_BOWSER_SMOKE); + common_constant(MODEL_BOWSER_FLAMES); + common_constant(MODEL_BOWSER_WAVE); + common_constant(MODEL_BOWSER2); + common_constant(MODEL_BUB); + common_constant(MODEL_TREASURE_CHEST_BASE); + common_constant(MODEL_TREASURE_CHEST_LID); + common_constant(MODEL_CYAN_FISH); + common_constant(MODEL_WATER_RING); + common_constant(MODEL_SKEETER); + common_constant(MODEL_PIRANHA_PLANT); + common_constant(MODEL_WHOMP); + common_constant(MODEL_KOOPA_WITH_SHELL); + common_constant(MODEL_METALLIC_BALL); + common_constant(MODEL_CHAIN_CHOMP); + common_constant(MODEL_KOOPA_FLAG); + common_constant(MODEL_WOODEN_POST); + common_constant(MODEL_MIPS); + common_constant(MODEL_BOO_CASTLE); + common_constant(MODEL_LAKITU); + common_constant(MODEL_CHILL_BULLY); + common_constant(MODEL_BIG_CHILL_BULLY); + common_constant(MODEL_MONEYBAG); + common_constant(MODEL_SWOOP); + common_constant(MODEL_SCUTTLEBUG); + common_constant(MODEL_MR_I_IRIS); + common_constant(MODEL_MR_I); + common_constant(MODEL_DORRIE); + common_constant(MODEL_YELLOW_COIN); + common_constant(MODEL_YELLOW_COIN_NO_SHADOW); + common_constant(MODEL_BLUE_COIN); + common_constant(MODEL_BLUE_COIN_NO_SHADOW); + common_constant(MODEL_HEART); + common_constant(MODEL_TRANSPARENT_STAR); + common_constant(MODEL_STAR); + common_constant(MODEL_TTM_SLIDE_EXIT_PODIUM); + common_constant(MODEL_WOODEN_SIGNPOST); + common_constant(MODEL_UNKNOWN_7D); + common_constant(MODEL_CANNON_BARREL); + common_constant(MODEL_CANNON_BASE); + common_constant(MODEL_BREAKABLE_BOX); + common_constant(MODEL_BREAKABLE_BOX_SMALL); + common_constant(MODEL_EXCLAMATION_BOX_OUTLINE); + common_constant(MODEL_EXCLAMATION_POINT); + common_constant(MODEL_MARIOS_WINGED_METAL_CAP); + common_constant(MODEL_MARIOS_METAL_CAP); + common_constant(MODEL_MARIOS_WING_CAP); + common_constant(MODEL_MARIOS_CAP); + common_constant(MODEL_EXCLAMATION_BOX); + common_constant(MODEL_DIRT_ANIMATION); + common_constant(MODEL_CARTOON_STAR); + common_constant(MODEL_BLUE_COIN_SWITCH); + common_constant(MODEL_MIST); + common_constant(MODEL_SPARKLES_ANIMATION); + common_constant(MODEL_RED_FLAME); + common_constant(MODEL_BLUE_FLAME); + common_constant(MODEL_BURN_SMOKE); + common_constant(MODEL_SPARKLES); + common_constant(MODEL_SMOKE); + common_constant(MODEL_BURN_SMOKE_UNUSED); + common_constant(MODEL_WHITE_PARTICLE_DL); + common_constant(MODEL_SAND_DUST); + common_constant(MODEL_WHITE_PARTICLE); + common_constant(MODEL_PEBBLE); + common_constant(MODEL_LEAVES); + common_constant(MODEL_WAVE_TRAIL); + common_constant(MODEL_WHITE_PARTICLE_SMALL); + common_constant(MODEL_SMALL_WATER_SPLASH); + common_constant(MODEL_IDLE_WATER_WAVE); + common_constant(MODEL_WATER_SPLASH); + common_constant(MODEL_BUBBLE); + common_constant(MODEL_PURPLE_MARBLE); + common_constant(MODEL_UNKNOWN_AC); + common_constant(MODEL_WF_SLIDING_PLATFORM); + common_constant(MODEL_WF_SMALL_BOMP); + common_constant(MODEL_WF_ROTATING_WOODEN_PLATFORM); + common_constant(MODEL_WF_TUMBLING_BRIDGE_PART); + common_constant(MODEL_WF_LARGE_BOMP); + common_constant(MODEL_WF_TUMBLING_BRIDGE); + common_constant(MODEL_BOWSER_BOMB); + common_constant(MODEL_WATER_MINE); + common_constant(MODEL_BOWLING_BALL); + common_constant(MODEL_TRAMPOLINE); + common_constant(MODEL_TRAMPOLINE_CENTER); + common_constant(MODEL_TRAMPOLINE_BASE); + common_constant(MODEL_UNKNOWN_B8); + common_constant(MODEL_FISH); + common_constant(MODEL_FISH_SHADOW); + common_constant(MODEL_BUTTERFLY); + common_constant(MODEL_BLACK_BOBOMB); + common_constant(MODEL_KOOPA_SHELL); + common_constant(MODEL_KOOPA_WITHOUT_SHELL); + common_constant(MODEL_GOOMBA); + common_constant(MODEL_SEAWEED); + common_constant(MODEL_AMP); + common_constant(MODEL_BOBOMB_BUDDY); + common_constant(MODEL_SSL_TOX_BOX); + common_constant(MODEL_BOWSER_KEY_CUTSCENE); + common_constant(MODEL_DL_CANNON_LID); + common_constant(MODEL_CHECKERBOARD_PLATFORM); + common_constant(MODEL_RED_FLAME_SHADOW); + common_constant(MODEL_BOWSER_KEY); + common_constant(MODEL_EXPLOSION); + common_constant(MODEL_SNUFIT); + common_constant(MODEL_PURPLE_SWITCH); + common_constant(MODEL_CASTLE_STAR_DOOR_30_STARS); + common_constant(MODEL_CASTLE_STAR_DOOR_50_STARS); + common_constant(MODEL_CCM_SNOWMAN_BASE); + common_constant(MODEL_1UP); + common_constant(MODEL_CASTLE_STAR_DOOR_8_STARS); + common_constant(MODEL_CASTLE_STAR_DOOR_70_STARS); + common_constant(MODEL_RED_COIN); + common_constant(MODEL_RED_COIN_NO_SHADOW); + common_constant(MODEL_METAL_BOX); + common_constant(MODEL_METAL_BOX_DL); + common_constant(MODEL_NUMBER); + common_constant(MODEL_FLYGUY); + common_constant(MODEL_TOAD); + common_constant(MODEL_PEACH); + common_constant(MODEL_CHUCKYA); + common_constant(MODEL_WHITE_PUFF); + common_constant(MODEL_TRAJECTORY_MARKER_BALL); + common_constant(MODEL_MAIN_MENU_MARIO_SAVE_BUTTON); + common_constant(MODEL_MAIN_MENU_RED_ERASE_BUTTON); + common_constant(MODEL_MAIN_MENU_BLUE_COPY_BUTTON); + common_constant(MODEL_MAIN_MENU_YELLOW_FILE_BUTTON); + common_constant(MODEL_MAIN_MENU_GREEN_SCORE_BUTTON); + common_constant(MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE); + common_constant(MODEL_MAIN_MENU_MARIO_NEW_BUTTON); + common_constant(MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE); + common_constant(MODEL_MAIN_MENU_PURPLE_SOUND_BUTTON); + common_constant(MODEL_MAIN_MENU_GENERIC_BUTTON); + common_constant(MODEL_LLL_ROTATING_HEXAGONAL_PLATFORM); + common_constant(MODEL_WF_GIANT_POLE); + common_constant(MODEL_WF_ROTATING_PLATFORM); + common_constant(MODEL_BITDW_WARP_PIPE); + common_constant(MODEL_THI_WARP_PIPE); + common_constant(MODEL_VCUTM_WARP_PIPE); + common_constant(MODEL_CASTLE_GROUNDS_WARP_PIPE); + common_constant(MODEL_BUBBLE_PLAYER); + common_constant(MODEL_LUIGI); + common_constant(MODEL_LUIGIS_CAP); + common_constant(MODEL_LUIGIS_METAL_CAP); + common_constant(MODEL_LUIGIS_WING_CAP); + common_constant(MODEL_LUIGIS_WINGED_METAL_CAP); + common_constant(MODEL_TOAD_PLAYER); + common_constant(MODEL_TOADS_CAP); + common_constant(MODEL_TOADS_METAL_CAP); + common_constant(MODEL_TOADS_WING_CAP); + common_constant(MODEL_WALUIGI); + common_constant(MODEL_WALUIGIS_CAP); + common_constant(MODEL_WALUIGIS_METAL_CAP); + common_constant(MODEL_WALUIGIS_WING_CAP); + common_constant(MODEL_WALUIGIS_WINGED_METAL_CAP); + common_constant(MODEL_WARIO); + common_constant(MODEL_WARIOS_CAP); + common_constant(MODEL_WARIOS_METAL_CAP); + common_constant(MODEL_WARIOS_WING_CAP); + common_constant(MODEL_WARIOS_WINGED_METAL_CAP); + common_constant(MODEL_ERROR_MODEL); + + *found = false; + return 0; +} diff --git a/data/dynos_bin_lvl.cpp b/data/dynos_bin_lvl.cpp index ab9bc83f..19a9b237 100644 --- a/data/dynos_bin_lvl.cpp +++ b/data/dynos_bin_lvl.cpp @@ -34,547 +34,9 @@ s64 DynOS_Lvl_ParseLevelScriptConstants(const String& _Arg, bool* found) { *found = true; // Behavior constants - lvl_constant(bhvStarDoor); - lvl_constant(bhvMrI); - lvl_constant(bhvMrIBody); - lvl_constant(bhvMrIParticle); - lvl_constant(bhvPurpleParticle); - lvl_constant(bhvGiantPole); - lvl_constant(bhvPoleGrabbing); - lvl_constant(bhvThiHugeIslandTop); - lvl_constant(bhvThiTinyIslandTop); - lvl_constant(bhvCapSwitchBase); - lvl_constant(bhvCapSwitch); - lvl_constant(bhvKingBobomb); - lvl_constant(bhvBobombAnchorMario); - lvl_constant(bhvBetaChestBottom); - lvl_constant(bhvBetaChestLid); - lvl_constant(bhvBubbleParticleSpawner); - lvl_constant(bhvBubbleMaybe); - lvl_constant(bhvBubblePlayer); - lvl_constant(bhvSmallWaterWave); - lvl_constant(bhvSmallWaterWave398); - lvl_constant(bhvWaterAirBubble); - lvl_constant(bhvSmallParticle); - lvl_constant(bhvPlungeBubble); - lvl_constant(bhvSmallParticleSnow); - lvl_constant(bhvSmallParticleBubbles); - lvl_constant(bhvFishGroup); - lvl_constant(bhvCannon); - lvl_constant(bhvCannonBarrel); - lvl_constant(bhvCannonBaseUnused); - lvl_constant(bhvChuckya); - lvl_constant(bhvChuckyaAnchorMario); - lvl_constant(bhvUnused05A8); - lvl_constant(bhvRotatingPlatform); - lvl_constant(bhvTower); - lvl_constant(bhvBulletBillCannon); - lvl_constant(bhvWfBreakableWallRight); - lvl_constant(bhvWfBreakableWallLeft); - lvl_constant(bhvKickableBoard); - lvl_constant(bhvTowerDoor); - lvl_constant(bhvRotatingCounterClockwise); - lvl_constant(bhvWfRotatingWoodenPlatform); - lvl_constant(bhvKoopaShellUnderwater); - lvl_constant(bhvExitPodiumWarp); - lvl_constant(bhvFadingWarp); - lvl_constant(bhvWarp); - lvl_constant(bhvWarpPipe); - lvl_constant(bhvWhitePuffExplosion); - lvl_constant(bhvSpawnedStar); - lvl_constant(bhvSpawnedStarNoLevelExit); - lvl_constant(bhvMrIBlueCoin); - lvl_constant(bhvCoinInsideBoo); - lvl_constant(bhvCoinFormationSpawn); - lvl_constant(bhvCoinFormation); - lvl_constant(bhvOneCoin); - lvl_constant(bhvYellowCoin); - lvl_constant(bhvTemporaryYellowCoin); - lvl_constant(bhvThreeCoinsSpawn); - lvl_constant(bhvTenCoinsSpawn); - lvl_constant(bhvSingleCoinGetsSpawned); - lvl_constant(bhvCoinSparkles); - lvl_constant(bhvGoldenCoinSparkles); - lvl_constant(bhvWallTinyStarParticle); - lvl_constant(bhvVertStarParticleSpawner); - lvl_constant(bhvPoundTinyStarParticle); - lvl_constant(bhvHorStarParticleSpawner); - lvl_constant(bhvPunchTinyTriangle); - lvl_constant(bhvTriangleParticleSpawner); - lvl_constant(bhvDoorWarp); - lvl_constant(bhvDoor); - lvl_constant(bhvGrindel); - lvl_constant(bhvThwomp2); - lvl_constant(bhvThwomp); - lvl_constant(bhvTumblingBridgePlatform); - lvl_constant(bhvWfTumblingBridge); - lvl_constant(bhvBbhTumblingBridge); - lvl_constant(bhvLllTumblingBridge); - lvl_constant(bhvFlame); - lvl_constant(bhvAnotherElavator); - lvl_constant(bhvRrElevatorPlatform); - lvl_constant(bhvHmcElevatorPlatform); - lvl_constant(bhvWaterMist); - lvl_constant(bhvBreathParticleSpawner); - lvl_constant(bhvBreakBoxTriangle); - lvl_constant(bhvWaterMist2); - lvl_constant(bhvUnused0DFC); - lvl_constant(bhvMistCircParticleSpawner); - lvl_constant(bhvDirtParticleSpawner); - lvl_constant(bhvSnowParticleSpawner); - lvl_constant(bhvWind); - lvl_constant(bhvEndToad); - lvl_constant(bhvEndPeach); - lvl_constant(bhvUnusedParticleSpawn); - lvl_constant(bhvUkiki); - lvl_constant(bhvUkikiCageChild); - lvl_constant(bhvUkikiCageStar); - lvl_constant(bhvUkikiCage); - lvl_constant(bhvBitfsSinkingPlatforms); - lvl_constant(bhvBitfsSinkingCagePlatform); - lvl_constant(bhvDddMovingPole); - lvl_constant(bhvBitfsTiltingInvertedPyramid); - lvl_constant(bhvSquishablePlatform); - lvl_constant(bhvCutOutObject); - lvl_constant(bhvBetaMovingFlamesSpawn); - lvl_constant(bhvBetaMovingFlames); - lvl_constant(bhvRrRotatingBridgePlatform); - lvl_constant(bhvFlamethrower); - lvl_constant(bhvFlamethrowerFlame); - lvl_constant(bhvBouncingFireball); - lvl_constant(bhvBouncingFireballFlame); - lvl_constant(bhvBowserShockWave); - lvl_constant(bhvFireParticleSpawner); - lvl_constant(bhvBlackSmokeMario); - lvl_constant(bhvBlackSmokeBowser); - lvl_constant(bhvBlackSmokeUpward); - lvl_constant(bhvBetaFishSplashSpawner); - lvl_constant(bhvSpindrift); - lvl_constant(bhvTowerPlatformGroup); - lvl_constant(bhvWfSlidingTowerPlatform); - lvl_constant(bhvWfElevatorTowerPlatform); - lvl_constant(bhvWfSolidTowerPlatform); - lvl_constant(bhvLeafParticleSpawner); - lvl_constant(bhvTreeSnow); - lvl_constant(bhvTreeLeaf); - lvl_constant(bhvAnotherTiltingPlatform); - lvl_constant(bhvSquarishPathMoving); - lvl_constant(bhvSquarishPathParent); - lvl_constant(bhvPiranhaPlantBubble); - lvl_constant(bhvPiranhaPlantWakingBubbles); - lvl_constant(bhvFloorSwitchAnimatesObject); - lvl_constant(bhvFloorSwitchGrills); - lvl_constant(bhvFloorSwitchHardcodedModel); - lvl_constant(bhvFloorSwitchHiddenObjects); - lvl_constant(bhvHiddenObject); - lvl_constant(bhvBreakableBox); - lvl_constant(bhvPushableMetalBox); - lvl_constant(bhvHeaveHo); - lvl_constant(bhvHeaveHoThrowMario); - lvl_constant(bhvCcmTouchedStarSpawn); - lvl_constant(bhvUnusedPoundablePlatform); - lvl_constant(bhvBetaTrampolineTop); - lvl_constant(bhvBetaTrampolineSpring); - lvl_constant(bhvJumpingBox); - lvl_constant(bhvBooCage); - lvl_constant(bhvStub); - lvl_constant(bhvIgloo); - lvl_constant(bhvBowserKey); - lvl_constant(bhvGrandStar); - lvl_constant(bhvBetaBooKey); - lvl_constant(bhvAlphaBooKey); - lvl_constant(bhvBulletBill); - lvl_constant(bhvWhitePuffSmoke); - lvl_constant(bhvUnused1820); - lvl_constant(bhvBowserTailAnchor); - lvl_constant(bhvBowser); - lvl_constant(bhvBowserBodyAnchor); - lvl_constant(bhvBowserFlameSpawn); - lvl_constant(bhvTiltingBowserLavaPlatform); - lvl_constant(bhvFallingBowserPlatform); - lvl_constant(bhvBlueBowserFlame); - lvl_constant(bhvFlameFloatingLanding); - lvl_constant(bhvBlueFlamesGroup); - lvl_constant(bhvFlameBouncing); - lvl_constant(bhvFlameMovingForwardGrowing); - lvl_constant(bhvFlameBowser); - lvl_constant(bhvFlameLargeBurningOut); - lvl_constant(bhvBlueFish); - lvl_constant(bhvTankFishGroup); - lvl_constant(bhvCheckerboardElevatorGroup); - lvl_constant(bhvCheckerboardPlatformSub); - lvl_constant(bhvBowserKeyUnlockDoor); - lvl_constant(bhvBowserKeyCourseExit); - lvl_constant(bhvInvisibleObjectsUnderBridge); - lvl_constant(bhvWaterLevelPillar); - lvl_constant(bhvDddWarp); - lvl_constant(bhvMoatGrills); - lvl_constant(bhvClockMinuteHand); - lvl_constant(bhvClockHourHand); - lvl_constant(bhvMacroUkiki); - lvl_constant(bhvStub1D0C); - lvl_constant(bhvLllRotatingHexagonalPlatform); - lvl_constant(bhvLllSinkingRockBlock); - lvl_constant(bhvStub1D70); - lvl_constant(bhvLllMovingOctagonalMeshPlatform); - lvl_constant(bhvSnowBall); - lvl_constant(bhvLllRotatingBlockWithFireBars); - lvl_constant(bhvLllRotatingHexFlame); - lvl_constant(bhvLllWoodPiece); - lvl_constant(bhvLllFloatingWoodBridge); - lvl_constant(bhvVolcanoFlames); - lvl_constant(bhvLllRotatingHexagonalRing); - lvl_constant(bhvLllSinkingRectangularPlatform); - lvl_constant(bhvLllSinkingSquarePlatforms); - lvl_constant(bhvLllTiltingInvertedPyramid); - lvl_constant(bhvUnused1F30); - lvl_constant(bhvKoopaShell); - lvl_constant(bhvKoopaShellFlame); - lvl_constant(bhvToxBox); - lvl_constant(bhvPiranhaPlant); - lvl_constant(bhvLllHexagonalMesh); - lvl_constant(bhvLllBowserPuzzlePiece); - lvl_constant(bhvLllBowserPuzzle); - lvl_constant(bhvTuxiesMother); - lvl_constant(bhvPenguinBaby); - lvl_constant(bhvUnused20E0); - lvl_constant(bhvSmallPenguin); - lvl_constant(bhvManyBlueFishSpawner); - lvl_constant(bhvFewBlueFishSpawner); - lvl_constant(bhvFishSpawner); - lvl_constant(bhvFish); - lvl_constant(bhvWdwExpressElevator); - lvl_constant(bhvWdwExpressElevatorPlatform); - lvl_constant(bhvChirpChirp); - lvl_constant(bhvChirpChirpUnused); - lvl_constant(bhvBub); - lvl_constant(bhvExclamationBox); - lvl_constant(bhvRotatingExclamationMark); - lvl_constant(bhvSoundSpawner); - lvl_constant(bhvRockSolid); - lvl_constant(bhvBowserSubDoor); - lvl_constant(bhvBowsersSub); - lvl_constant(bhvSushiShark); - lvl_constant(bhvSushiSharkCollisionChild); - lvl_constant(bhvJrbSlidingBox); - lvl_constant(bhvShipPart3); - lvl_constant(bhvInSunkenShip3); - lvl_constant(bhvSunkenShipPart); - lvl_constant(bhvSunkenShipSetRotation); - lvl_constant(bhvSunkenShipPart2); - lvl_constant(bhvInSunkenShip); - lvl_constant(bhvInSunkenShip2); - lvl_constant(bhvMistParticleSpawner); - lvl_constant(bhvWhitePuff1); - lvl_constant(bhvWhitePuff2); - lvl_constant(bhvWhitePuffSmoke2); - lvl_constant(bhvPurpleSwitchHiddenBoxes); - lvl_constant(bhvBlueCoinSwitch); - lvl_constant(bhvHiddenBlueCoin); - lvl_constant(bhvOpenableCageDoor); - lvl_constant(bhvOpenableGrill); - lvl_constant(bhvWaterLevelDiamond); - lvl_constant(bhvInitializeChangingWaterLevel); - lvl_constant(bhvTweesterSandParticle); - lvl_constant(bhvTweester); - lvl_constant(bhvMerryGoRoundBooManager); - lvl_constant(bhvPlaysMusicTrackWhenTouched); - lvl_constant(bhvAnimatedTexture); - lvl_constant(bhvBooInCastle); - lvl_constant(bhvBooWithCage); - lvl_constant(bhvBalconyBigBoo); - lvl_constant(bhvMerryGoRoundBigBoo); - lvl_constant(bhvGhostHuntBigBoo); - lvl_constant(bhvCourtyardBooTriplet); - lvl_constant(bhvBoo); - lvl_constant(bhvMerryGoRoundBoo); - lvl_constant(bhvGhostHuntBoo); - lvl_constant(bhvHiddenStaircaseStep); - lvl_constant(bhvBooBossSpawnedBridge); - lvl_constant(bhvBbhTiltingTrapPlatform); - lvl_constant(bhvHauntedBookshelf); - lvl_constant(bhvMeshElevator); - lvl_constant(bhvMerryGoRound); - lvl_constant(bhvInsideCannon); - lvl_constant(bhvBetaBowserAnchor); - lvl_constant(bhvStaticCheckeredPlatform); - lvl_constant(bhvUnused2A10); - lvl_constant(bhvStar); - lvl_constant(bhvStaticObject); - lvl_constant(bhvUnused2A54); - lvl_constant(bhvCastleFloorTrap); - lvl_constant(bhvFloorTrapInCastle); - lvl_constant(bhvTree); - lvl_constant(bhvSparkle); - lvl_constant(bhvSparkleSpawn); - lvl_constant(bhvSparkleParticleSpawner); - lvl_constant(bhvScuttlebug); - lvl_constant(bhvScuttlebugSpawn); - lvl_constant(bhvWhompKingBoss); - lvl_constant(bhvSmallWhomp); - lvl_constant(bhvWaterSplash); - lvl_constant(bhvWaterDroplet); - lvl_constant(bhvWaterDropletSplash); - lvl_constant(bhvBubbleSplash); - lvl_constant(bhvIdleWaterWave); - lvl_constant(bhvObjectWaterSplash); - lvl_constant(bhvShallowWaterWave); - lvl_constant(bhvShallowWaterSplash); - lvl_constant(bhvObjectWaveTrail); - lvl_constant(bhvWaveTrail); - lvl_constant(bhvTinyStrongWindParticle); - lvl_constant(bhvStrongWindParticle); - lvl_constant(bhvSLSnowmanWind); - lvl_constant(bhvSLWalkingPenguin); - lvl_constant(bhvYellowBall); - lvl_constant(bhvMario); - lvl_constant(bhvToadMessage); - lvl_constant(bhvUnlockDoorStar); - lvl_constant(bhvInstantActiveWarp); - lvl_constant(bhvAirborneWarp); - lvl_constant(bhvHardAirKnockBackWarp); - lvl_constant(bhvSpinAirborneCircleWarp); - lvl_constant(bhvDeathWarp); - lvl_constant(bhvSpinAirborneWarp); - lvl_constant(bhvFlyingWarp); - lvl_constant(bhvPaintingStarCollectWarp); - lvl_constant(bhvPaintingDeathWarp); - lvl_constant(bhvAirborneDeathWarp); - lvl_constant(bhvAirborneStarCollectWarp); - lvl_constant(bhvLaunchStarCollectWarp); - lvl_constant(bhvLaunchDeathWarp); - lvl_constant(bhvSwimmingWarp); - lvl_constant(bhvRandomAnimatedTexture); - lvl_constant(bhvYellowBackgroundInMenu); - lvl_constant(bhvMenuButton); - lvl_constant(bhvMenuButtonManager); - lvl_constant(bhvActSelectorStarType); - lvl_constant(bhvActSelector); - lvl_constant(bhvMovingYellowCoin); - lvl_constant(bhvMovingBlueCoin); - lvl_constant(bhvBlueCoinSliding); - lvl_constant(bhvBlueCoinJumping); - lvl_constant(bhvSeaweed); - lvl_constant(bhvSeaweedBundle); - lvl_constant(bhvBobomb); - lvl_constant(bhvBobombFuseSmoke); - lvl_constant(bhvBobombBuddy); - lvl_constant(bhvBobombBuddyOpensCannon); - lvl_constant(bhvCannonClosed); - lvl_constant(bhvWhirlpool); - lvl_constant(bhvJetStream); - lvl_constant(bhvMessagePanel); - lvl_constant(bhvSignOnWall); - lvl_constant(bhvHomingAmp); - lvl_constant(bhvCirclingAmp); - lvl_constant(bhvButterfly); - lvl_constant(bhvHoot); - lvl_constant(bhvBetaHoldableObject); - lvl_constant(bhvCarrySomething1); - lvl_constant(bhvCarrySomething2); - lvl_constant(bhvCarrySomething3); - lvl_constant(bhvCarrySomething4); - lvl_constant(bhvCarrySomething5); - lvl_constant(bhvCarrySomething6); - lvl_constant(bhvObjectBubble); - lvl_constant(bhvObjectWaterWave); - lvl_constant(bhvExplosion); - lvl_constant(bhvBobombBullyDeathSmoke); - lvl_constant(bhvSmoke); - lvl_constant(bhvBobombExplosionBubble); - lvl_constant(bhvBobombExplosionBubble3600); - lvl_constant(bhvRespawner); - lvl_constant(bhvSmallBully); - lvl_constant(bhvBigBully); - lvl_constant(bhvBigBullyWithMinions); - lvl_constant(bhvSmallChillBully); - lvl_constant(bhvBigChillBully); - lvl_constant(bhvJetStreamRingSpawner); - lvl_constant(bhvJetStreamWaterRing); - lvl_constant(bhvMantaRayWaterRing); - lvl_constant(bhvMantaRayRingManager); - lvl_constant(bhvBowserBomb); - lvl_constant(bhvBowserBombExplosion); - lvl_constant(bhvBowserBombSmoke); - lvl_constant(bhvCelebrationStar); - lvl_constant(bhvCelebrationStarSparkle); - lvl_constant(bhvStarKeyCollectionPuffSpawner); - lvl_constant(bhvLllDrawbridgeSpawner); - lvl_constant(bhvLllDrawbridge); - lvl_constant(bhvSmallBomp); - lvl_constant(bhvLargeBomp); - lvl_constant(bhvWfSlidingPlatform); - lvl_constant(bhvMoneybag); - lvl_constant(bhvMoneybagHidden); - lvl_constant(bhvPitBowlingBall); - lvl_constant(bhvFreeBowlingBall); - lvl_constant(bhvBowlingBall); - lvl_constant(bhvTtmBowlingBallSpawner); - lvl_constant(bhvBobBowlingBallSpawner); - lvl_constant(bhvThiBowlingBallSpawner); - lvl_constant(bhvRrCruiserWing); - lvl_constant(bhvSpindel); - lvl_constant(bhvSslMovingPyramidWall); - lvl_constant(bhvPyramidElevator); - lvl_constant(bhvPyramidElevatorTrajectoryMarkerBall); - lvl_constant(bhvPyramidTop); - lvl_constant(bhvPyramidTopFragment); - lvl_constant(bhvPyramidPillarTouchDetector); - lvl_constant(bhvWaterfallSoundLoop); - lvl_constant(bhvVolcanoSoundLoop); - lvl_constant(bhvCastleFlagWaving); - lvl_constant(bhvBirdsSoundLoop); - lvl_constant(bhvAmbientSounds); - lvl_constant(bhvSandSoundLoop); - lvl_constant(bhvHiddenAt120Stars); - lvl_constant(bhvSnowmansBottom); - lvl_constant(bhvSnowmansHead); - lvl_constant(bhvSnowmansBodyCheckpoint); - lvl_constant(bhvBigSnowmanWhole); - lvl_constant(bhvBigBoulder); - lvl_constant(bhvBigBoulderGenerator); - lvl_constant(bhvWingCap); - lvl_constant(bhvMetalCap); - lvl_constant(bhvNormalCap); - lvl_constant(bhvVanishCap); - lvl_constant(bhvStar); - lvl_constant(bhvStarSpawnCoordinates); - lvl_constant(bhvHiddenRedCoinStar); - lvl_constant(bhvRedCoin); - lvl_constant(bhvBowserCourseRedCoinStar); - lvl_constant(bhvHiddenStar); - lvl_constant(bhvHiddenStarTrigger); - lvl_constant(bhvTtmRollingLog); - lvl_constant(bhvLllVolcanoFallingTrap); - lvl_constant(bhvLllRollingLog); - lvl_constant(bhv1upWalking); - lvl_constant(bhv1upRunningAway); - lvl_constant(bhv1upSliding); - lvl_constant(bhv1Up); - lvl_constant(bhv1upJumpOnApproach); - lvl_constant(bhvHidden1up); - lvl_constant(bhvHidden1upTrigger); - lvl_constant(bhvHidden1upInPole); - lvl_constant(bhvHidden1upInPoleTrigger); - lvl_constant(bhvHidden1upInPoleSpawner); - lvl_constant(bhvControllablePlatform); - lvl_constant(bhvControllablePlatformSub); - lvl_constant(bhvBreakableBoxSmall); - lvl_constant(bhvSlidingSnowMound); - lvl_constant(bhvSnowMoundSpawn); - lvl_constant(bhvWdwSquareFloatingPlatform); - lvl_constant(bhvWdwRectangularFloatingPlatform); - lvl_constant(bhvJrbFloatingPlatform); - lvl_constant(bhvArrowLift); - lvl_constant(bhvOrangeNumber); - lvl_constant(bhvMantaRay); - lvl_constant(bhvFallingPillar); - lvl_constant(bhvFallingPillarHitbox); - lvl_constant(bhvPillarBase); - lvl_constant(bhvJrbFloatingBox); - lvl_constant(bhvDecorativePendulum); - lvl_constant(bhvTreasureChestsShip); - lvl_constant(bhvTreasureChestsJrb); - lvl_constant(bhvTreasureChests); - lvl_constant(bhvTreasureChestBottom); - lvl_constant(bhvTreasureChestTop); - lvl_constant(bhvMips); - lvl_constant(bhvYoshi); - lvl_constant(bhvKoopa); - lvl_constant(bhvKoopaRaceEndpoint); - lvl_constant(bhvKoopaFlag); - lvl_constant(bhvPokey); - lvl_constant(bhvPokeyBodyPart); - lvl_constant(bhvSwoop); - lvl_constant(bhvFlyGuy); - lvl_constant(bhvGoomba); - lvl_constant(bhvGoombaTripletSpawner); - lvl_constant(bhvChainChomp); - lvl_constant(bhvChainChompChainPart); - lvl_constant(bhvWoodenPost); - lvl_constant(bhvChainChompGate); - lvl_constant(bhvWigglerHead); - lvl_constant(bhvWigglerBody); - lvl_constant(bhvEnemyLakitu); - lvl_constant(bhvCameraLakitu); - lvl_constant(bhvCloud); - lvl_constant(bhvCloudPart); - lvl_constant(bhvSpiny); - lvl_constant(bhvMontyMole); - lvl_constant(bhvMontyMoleHole); - lvl_constant(bhvMontyMoleRock); - lvl_constant(bhvPlatformOnTrack); - lvl_constant(bhvTrackBall); - lvl_constant(bhvSeesawPlatform); - lvl_constant(bhvFerrisWheelAxle); - lvl_constant(bhvFerrisWheelPlatform); - lvl_constant(bhvWaterBombSpawner); - lvl_constant(bhvWaterBomb); - lvl_constant(bhvWaterBombShadow); - lvl_constant(bhvTTCRotatingSolid); - lvl_constant(bhvTTCPendulum); - lvl_constant(bhvTTCTreadmill); - lvl_constant(bhvTTCMovingBar); - lvl_constant(bhvTTCCog); - lvl_constant(bhvTTCPitBlock); - lvl_constant(bhvTTCElevator); - lvl_constant(bhvTTC2DRotator); - lvl_constant(bhvTTCSpinner); - lvl_constant(bhvMrBlizzard); - lvl_constant(bhvMrBlizzardSnowball); - lvl_constant(bhvSlidingPlatform2); - lvl_constant(bhvOctagonalPlatformRotating); - lvl_constant(bhvAnimatesOnFloorSwitchPress); - lvl_constant(bhvActivatedBackAndForthPlatform); - lvl_constant(bhvRecoveryHeart); - lvl_constant(bhvWaterBombCannon); - lvl_constant(bhvCannonBarrelBubbles); - lvl_constant(bhvUnagi); - lvl_constant(bhvUnagiSubobject); - lvl_constant(bhvDorrie); - lvl_constant(bhvHauntedChair); - lvl_constant(bhvMadPiano); - lvl_constant(bhvFlyingBookend); - lvl_constant(bhvBookendSpawn); - lvl_constant(bhvHauntedBookshelfManager); - lvl_constant(bhvBookSwitch); - lvl_constant(bhvFirePiranhaPlant); - lvl_constant(bhvSmallPiranhaFlame); - lvl_constant(bhvFireSpitter); - lvl_constant(bhvFlyguyFlame); - lvl_constant(bhvSnufit); - lvl_constant(bhvSnufitBalls); - lvl_constant(bhvHorizontalGrindel); - lvl_constant(bhvEyerokBoss); - lvl_constant(bhvEyerokHand); - lvl_constant(bhvKlepto); - lvl_constant(bhvBird); - lvl_constant(bhvRacingPenguin); - lvl_constant(bhvPenguinRaceFinishLine); - lvl_constant(bhvPenguinRaceShortcutCheck); - lvl_constant(bhvCoffinSpawner); - lvl_constant(bhvCoffin); - lvl_constant(bhvClamShell); - lvl_constant(bhvSkeeter); - lvl_constant(bhvSkeeterWave); - lvl_constant(bhvSwingPlatform); - lvl_constant(bhvDonutPlatformSpawner); - lvl_constant(bhvDonutPlatform); - lvl_constant(bhvDDDPole); - lvl_constant(bhvRedCoinStarMarker); - lvl_constant(bhvTripletButterfly); - lvl_constant(bhvBubba); - lvl_constant(bhvBeginningLakitu); - lvl_constant(bhvBeginningPeach); - lvl_constant(bhvEndBirds1); - lvl_constant(bhvEndBirds2); - lvl_constant(bhvIntroScene); - lvl_constant(bhvUnusedFakeStar); - - // Legacy behavior names - lvl_legacy_constant(bhvFish2, bhvManyBlueFishSpawner); - lvl_legacy_constant(bhvFish3, bhvFewBlueFishSpawner); - lvl_legacy_constant(bhvLargeFishGroup, bhvFishSpawner); + s64 cBhvConstant = DynOS_Common_ParseBhvConstants(_Arg, found); + if (*found) { return cBhvConstant; } + *found = true; // reset found value // Level constants lvl_constant(LEVEL_UNKNOWN_1); @@ -667,467 +129,9 @@ s64 DynOS_Lvl_ParseLevelScriptConstants(const String& _Arg, bool* found) { lvl_constant(SEQ_COUNT); // Model constants - lvl_constant(ACT_1); - lvl_constant(ACT_2); - lvl_constant(ACT_3); - lvl_constant(ACT_4); - lvl_constant(ACT_5); - lvl_constant(ACT_6); - lvl_constant(ALL_ACTS_MACRO); - lvl_constant(ALL_ACTS); - lvl_constant(COIN_FORMATION_FLAG_VERTICAL); - lvl_constant(COIN_FORMATION_FLAG_RING); - lvl_constant(COIN_FORMATION_FLAG_ARROW); - lvl_constant(COIN_FORMATION_FLAG_FLYING); - lvl_constant(MODEL_NONE); - lvl_constant(MODEL_MARIO); - lvl_constant(MODEL_LEVEL_GEOMETRY_03); - lvl_constant(MODEL_LEVEL_GEOMETRY_04); - lvl_constant(MODEL_LEVEL_GEOMETRY_05); - lvl_constant(MODEL_LEVEL_GEOMETRY_06); - lvl_constant(MODEL_LEVEL_GEOMETRY_07); - lvl_constant(MODEL_LEVEL_GEOMETRY_08); - lvl_constant(MODEL_LEVEL_GEOMETRY_09); - lvl_constant(MODEL_LEVEL_GEOMETRY_0A); - lvl_constant(MODEL_LEVEL_GEOMETRY_0B); - lvl_constant(MODEL_LEVEL_GEOMETRY_0C); - lvl_constant(MODEL_LEVEL_GEOMETRY_0D); - lvl_constant(MODEL_LEVEL_GEOMETRY_0E); - lvl_constant(MODEL_LEVEL_GEOMETRY_0F); - lvl_constant(MODEL_LEVEL_GEOMETRY_10); - lvl_constant(MODEL_LEVEL_GEOMETRY_11); - lvl_constant(MODEL_LEVEL_GEOMETRY_12); - lvl_constant(MODEL_LEVEL_GEOMETRY_13); - lvl_constant(MODEL_LEVEL_GEOMETRY_14); - lvl_constant(MODEL_LEVEL_GEOMETRY_15); - lvl_constant(MODEL_LEVEL_GEOMETRY_16); - lvl_constant(MODEL_BOB_BUBBLY_TREE); - lvl_constant(MODEL_WDW_BUBBLY_TREE); - lvl_constant(MODEL_CASTLE_GROUNDS_BUBBLY_TREE); - lvl_constant(MODEL_WF_BUBBLY_TREE); - lvl_constant(MODEL_THI_BUBBLY_TREE); - lvl_constant(MODEL_COURTYARD_SPIKY_TREE); - lvl_constant(MODEL_CCM_SNOW_TREE); - lvl_constant(MODEL_SL_SNOW_TREE); - lvl_constant(MODEL_UNKNOWN_TREE_1A); - lvl_constant(MODEL_SSL_PALM_TREE); - lvl_constant(MODEL_CASTLE_CASTLE_DOOR_UNUSED); - lvl_constant(MODEL_CASTLE_WOODEN_DOOR_UNUSED); - lvl_constant(MODEL_BBH_HAUNTED_DOOR); - lvl_constant(MODEL_HMC_WOODEN_DOOR); - lvl_constant(MODEL_UNKNOWN_DOOR_1E); - lvl_constant(MODEL_HMC_METAL_DOOR); - lvl_constant(MODEL_HMC_HAZY_MAZE_DOOR); - lvl_constant(MODEL_UNKNOWN_DOOR_21); - lvl_constant(MODEL_CASTLE_DOOR_0_STARS); - lvl_constant(MODEL_CASTLE_DOOR_1_STAR); - lvl_constant(MODEL_CASTLE_DOOR_3_STARS); - lvl_constant(MODEL_CASTLE_KEY_DOOR); - lvl_constant(MODEL_CASTLE_CASTLE_DOOR); - lvl_constant(MODEL_CASTLE_GROUNDS_CASTLE_DOOR); - lvl_constant(MODEL_CASTLE_WOODEN_DOOR); - lvl_constant(MODEL_COURTYARD_WOODEN_DOOR); - lvl_constant(MODEL_CCM_CABIN_DOOR); - lvl_constant(MODEL_UNKNOWN_DOOR_28); - lvl_constant(MODEL_CASTLE_METAL_DOOR); - lvl_constant(MODEL_CASTLE_GROUNDS_METAL_DOOR); - lvl_constant(MODEL_UNKNOWN_DOOR_2A); - lvl_constant(MODEL_UNKNOWN_DOOR_2B); - lvl_constant(MODEL_WF_TOWER_TRAPEZOID_PLATORM); - lvl_constant(MODEL_WF_TOWER_SQUARE_PLATORM); - lvl_constant(MODEL_WF_TOWER_SQUARE_PLATORM_UNUSED); - lvl_constant(MODEL_WF_TOWER_SQUARE_PLATORM_ELEVATOR); - lvl_constant(MODEL_BBH_STAIRCASE_STEP); - lvl_constant(MODEL_BBH_TILTING_FLOOR_PLATFORM); - lvl_constant(MODEL_BBH_TUMBLING_PLATFORM); - lvl_constant(MODEL_BBH_TUMBLING_PLATFORM_PART); - lvl_constant(MODEL_BBH_MOVING_BOOKSHELF); - lvl_constant(MODEL_BBH_MESH_ELEVATOR); - lvl_constant(MODEL_BBH_MERRY_GO_ROUND); - lvl_constant(MODEL_BBH_WOODEN_TOMB); - lvl_constant(MODEL_CCM_ROPEWAY_LIFT); - lvl_constant(MODEL_CCM_SNOWMAN_HEAD); - lvl_constant(MODEL_CASTLE_BOWSER_TRAP); - lvl_constant(MODEL_CASTLE_WATER_LEVEL_PILLAR); - lvl_constant(MODEL_CASTLE_CLOCK_MINUTE_HAND); - lvl_constant(MODEL_CASTLE_CLOCK_HOUR_HAND); - lvl_constant(MODEL_CASTLE_CLOCK_PENDULUM); - lvl_constant(MODEL_HMC_METAL_PLATFORM); - lvl_constant(MODEL_HMC_METAL_ARROW_PLATFORM); - lvl_constant(MODEL_HMC_ELEVATOR_PLATFORM); - lvl_constant(MODEL_HMC_ROLLING_ROCK); - lvl_constant(MODEL_HMC_ROCK_PIECE); - lvl_constant(MODEL_HMC_ROCK_SMALL_PIECE); - lvl_constant(MODEL_HMC_RED_GRILLS); - lvl_constant(MODEL_SSL_PYRAMID_TOP); - lvl_constant(MODEL_SSL_GRINDEL); - lvl_constant(MODEL_SSL_SPINDEL); - lvl_constant(MODEL_SSL_MOVING_PYRAMID_WALL); - lvl_constant(MODEL_SSL_PYRAMID_ELEVATOR); - lvl_constant(MODEL_BOB_CHAIN_CHOMP_GATE); - lvl_constant(MODEL_BOB_SEESAW_PLATFORM); - lvl_constant(MODEL_BOB_BARS_GRILLS); - lvl_constant(MODEL_SL_SNOW_TRIANGLE); - lvl_constant(MODEL_SL_CRACKED_ICE); - lvl_constant(MODEL_SL_CRACKED_ICE_CHUNK); - lvl_constant(MODEL_WDW_SQUARE_FLOATING_PLATFORM); - lvl_constant(MODEL_WDW_ARROW_LIFT); - lvl_constant(MODEL_WDW_WATER_LEVEL_DIAMOND); - lvl_constant(MODEL_WDW_HIDDEN_PLATFORM); - lvl_constant(MODEL_WDW_EXPRESS_ELEVATOR); - lvl_constant(MODEL_WDW_RECTANGULAR_FLOATING_PLATFORM); - lvl_constant(MODEL_WDW_ROTATING_PLATFORM); - lvl_constant(MODEL_JRB_SHIP_LEFT_HALF_PART); - lvl_constant(MODEL_JRB_SHIP_BACK_LEFT_PART); - lvl_constant(MODEL_JRB_SHIP_RIGHT_HALF_PART); - lvl_constant(MODEL_JRB_SHIP_BACK_RIGHT_PART); - lvl_constant(MODEL_JRB_SUNKEN_SHIP); - lvl_constant(MODEL_JRB_SUNKEN_SHIP_BACK); - lvl_constant(MODEL_JRB_ROCK); - lvl_constant(MODEL_JRB_SLIDING_BOX); - lvl_constant(MODEL_JRB_FALLING_PILLAR); - lvl_constant(MODEL_JRB_FALLING_PILLAR_BASE); - lvl_constant(MODEL_JRB_FLOATING_PLATFORM); - lvl_constant(MODEL_THI_HUGE_ISLAND_TOP); - lvl_constant(MODEL_THI_TINY_ISLAND_TOP); - lvl_constant(MODEL_TTC_ROTATING_CUBE); - lvl_constant(MODEL_TTC_ROTATING_PRISM); - lvl_constant(MODEL_TTC_PENDULUM); - lvl_constant(MODEL_TTC_LARGE_TREADMILL); - lvl_constant(MODEL_TTC_SMALL_TREADMILL); - lvl_constant(MODEL_TTC_PUSH_BLOCK); - lvl_constant(MODEL_TTC_ROTATING_HEXAGON); - lvl_constant(MODEL_TTC_ROTATING_TRIANGLE); - lvl_constant(MODEL_TTC_PIT_BLOCK); - lvl_constant(MODEL_TTC_PIT_BLOCK_UNUSED); - lvl_constant(MODEL_TTC_ELEVATOR_PLATFORM); - lvl_constant(MODEL_TTC_CLOCK_HAND); - lvl_constant(MODEL_TTC_SPINNER); - lvl_constant(MODEL_TTC_SMALL_GEAR); - lvl_constant(MODEL_TTC_LARGE_GEAR); - lvl_constant(MODEL_RR_SLIDING_PLATFORM); - lvl_constant(MODEL_RR_FLYING_CARPET); - lvl_constant(MODEL_RR_OCTAGONAL_PLATFORM); - lvl_constant(MODEL_RR_ROTATING_BRIDGE_PLATFORM); - lvl_constant(MODEL_RR_TRIANGLE_PLATFORM); - lvl_constant(MODEL_RR_CRUISER_WING); - lvl_constant(MODEL_RR_SEESAW_PLATFORM); - lvl_constant(MODEL_RR_L_SHAPED_PLATFORM); - lvl_constant(MODEL_RR_SWINGING_PLATFORM); - lvl_constant(MODEL_RR_DONUT_PLATFORM); - lvl_constant(MODEL_RR_ELEVATOR_PLATFORM); - lvl_constant(MODEL_RR_TRICKY_TRIANGLES); - lvl_constant(MODEL_RR_TRICKY_TRIANGLES_FRAME1); - lvl_constant(MODEL_RR_TRICKY_TRIANGLES_FRAME2); - lvl_constant(MODEL_RR_TRICKY_TRIANGLES_FRAME3); - lvl_constant(MODEL_RR_TRICKY_TRIANGLES_FRAME4); - lvl_constant(MODEL_BITDW_SQUARE_PLATFORM); - lvl_constant(MODEL_BITDW_SEESAW_PLATFORM); - lvl_constant(MODEL_BITDW_SLIDING_PLATFORM); - lvl_constant(MODEL_BITDW_FERRIS_WHEEL_AXLE); - lvl_constant(MODEL_BITDW_BLUE_PLATFORM); - lvl_constant(MODEL_BITDW_STAIRCASE_FRAME4); - lvl_constant(MODEL_BITDW_STAIRCASE_FRAME3); - lvl_constant(MODEL_BITDW_STAIRCASE_FRAME2); - lvl_constant(MODEL_BITDW_STAIRCASE_FRAME1); - lvl_constant(MODEL_BITDW_STAIRCASE); - lvl_constant(MODEL_VCUTM_SEESAW_PLATFORM); - lvl_constant(MODEL_VCUTM_CHECKERBOARD_PLATFORM_SPAWNER); - lvl_constant(MODEL_BITFS_PLATFORM_ON_TRACK); - lvl_constant(MODEL_BITFS_TILTING_SQUARE_PLATFORM); - lvl_constant(MODEL_BITFS_SINKING_PLATFORMS); - lvl_constant(MODEL_BITFS_BLUE_POLE); - lvl_constant(MODEL_BITFS_SINKING_CAGE_PLATFORM); - lvl_constant(MODEL_BITFS_ELEVATOR); - lvl_constant(MODEL_BITFS_STRETCHING_PLATFORMS); - lvl_constant(MODEL_BITFS_SEESAW_PLATFORM); - lvl_constant(MODEL_BITFS_MOVING_SQUARE_PLATFORM); - lvl_constant(MODEL_BITFS_SLIDING_PLATFORM); - lvl_constant(MODEL_BITFS_TUMBLING_PLATFORM_PART); - lvl_constant(MODEL_BITFS_TUMBLING_PLATFORM); - lvl_constant(MODEL_BITS_SLIDING_PLATFORM); - lvl_constant(MODEL_BITS_TWIN_SLIDING_PLATFORMS); - lvl_constant(MODEL_BITS_OCTAGONAL_PLATFORM); - lvl_constant(MODEL_BITS_BLUE_PLATFORM); - lvl_constant(MODEL_BITS_FERRIS_WHEEL_AXLE); - lvl_constant(MODEL_BITS_ARROW_PLATFORM); - lvl_constant(MODEL_BITS_SEESAW_PLATFORM); - lvl_constant(MODEL_BITS_TILTING_W_PLATFORM); - lvl_constant(MODEL_BITS_STAIRCASE); - lvl_constant(MODEL_BITS_STAIRCASE_FRAME1); - lvl_constant(MODEL_BITS_STAIRCASE_FRAME2); - lvl_constant(MODEL_BITS_STAIRCASE_FRAME3); - lvl_constant(MODEL_BITS_STAIRCASE_FRAME4); - lvl_constant(MODEL_BITS_WARP_PIPE); - lvl_constant(MODEL_LLL_DRAWBRIDGE_PART); - lvl_constant(MODEL_LLL_ROTATING_BLOCK_FIRE_BARS); - lvl_constant(MODEL_LLL_ROTATING_HEXAGONAL_RING); - lvl_constant(MODEL_LLL_SINKING_RECTANGULAR_PLATFORM); - lvl_constant(MODEL_LLL_SINKING_SQUARE_PLATFORMS); - lvl_constant(MODEL_LLL_TILTING_SQUARE_PLATFORM); - lvl_constant(MODEL_LLL_BOWSER_PIECE_1); - lvl_constant(MODEL_LLL_BOWSER_PIECE_2); - lvl_constant(MODEL_LLL_BOWSER_PIECE_3); - lvl_constant(MODEL_LLL_BOWSER_PIECE_4); - lvl_constant(MODEL_LLL_BOWSER_PIECE_5); - lvl_constant(MODEL_LLL_BOWSER_PIECE_6); - lvl_constant(MODEL_LLL_BOWSER_PIECE_7); - lvl_constant(MODEL_LLL_BOWSER_PIECE_8); - lvl_constant(MODEL_LLL_BOWSER_PIECE_9); - lvl_constant(MODEL_LLL_BOWSER_PIECE_10); - lvl_constant(MODEL_LLL_BOWSER_PIECE_11); - lvl_constant(MODEL_LLL_BOWSER_PIECE_12); - lvl_constant(MODEL_LLL_BOWSER_PIECE_13); - lvl_constant(MODEL_LLL_BOWSER_PIECE_14); - lvl_constant(MODEL_LLL_MOVING_OCTAGONAL_MESH_PLATFORM); - lvl_constant(MODEL_LLL_SINKING_ROCK_BLOCK); - lvl_constant(MODEL_LLL_ROLLING_LOG); - lvl_constant(MODEL_LLL_WOOD_BRIDGE); - lvl_constant(MODEL_LLL_LARGE_WOOD_BRIDGE); - lvl_constant(MODEL_LLL_FALLING_PLATFORM); - lvl_constant(MODEL_LLL_LARGE_FALLING_PLATFORM); - lvl_constant(MODEL_LLL_VOLCANO_FALLING_TRAP); - lvl_constant(MODEL_DDD_BOWSER_SUB_DOOR); - lvl_constant(MODEL_DDD_BOWSER_SUB); - lvl_constant(MODEL_DDD_POLE); - lvl_constant(MODEL_WF_BREAKABLE_WALL_RIGHT); - lvl_constant(MODEL_WF_BREAKABLE_WALL_LEFT); - lvl_constant(MODEL_WF_KICKABLE_BOARD); - lvl_constant(MODEL_WF_TOWER_DOOR); - lvl_constant(MODEL_WF_KICKABLE_BOARD_FELLED); - lvl_constant(MODEL_CASTLE_GROUNDS_VCUTM_GRILL); - lvl_constant(MODEL_CASTLE_GROUNDS_FLAG); - lvl_constant(MODEL_CASTLE_GROUNDS_CANNON_GRILL); - lvl_constant(MODEL_BOWSER_2_TILTING_ARENA); - lvl_constant(MODEL_BOWSER_3_FALLING_PLATFORM_1); - lvl_constant(MODEL_BOWSER_3_FALLING_PLATFORM_2); - lvl_constant(MODEL_BOWSER_3_FALLING_PLATFORM_3); - lvl_constant(MODEL_BOWSER_3_FALLING_PLATFORM_4); - lvl_constant(MODEL_BOWSER_3_FALLING_PLATFORM_5); - lvl_constant(MODEL_BOWSER_3_FALLING_PLATFORM_6); - lvl_constant(MODEL_BOWSER_3_FALLING_PLATFORM_7); - lvl_constant(MODEL_BOWSER_3_FALLING_PLATFORM_8); - lvl_constant(MODEL_BOWSER_3_FALLING_PLATFORM_9); - lvl_constant(MODEL_BOWSER_3_FALLING_PLATFORM_10); - lvl_constant(MODEL_TTM_ROLLING_LOG); - lvl_constant(MODEL_TTM_STAR_CAGE); - lvl_constant(MODEL_TTM_BLUE_SMILEY); - lvl_constant(MODEL_TTM_YELLOW_SMILEY); - lvl_constant(MODEL_TTM_STAR_SMILEY); - lvl_constant(MODEL_TTM_MOON_SMILEY); - lvl_constant(MODEL_BULLET_BILL); - lvl_constant(MODEL_YELLOW_SPHERE); - lvl_constant(MODEL_HOOT); - lvl_constant(MODEL_YOSHI_EGG); - lvl_constant(MODEL_THWOMP); - lvl_constant(MODEL_HEAVE_HO); - lvl_constant(MODEL_BLARGG); - lvl_constant(MODEL_BULLY); - lvl_constant(MODEL_BULLY_BOSS); - lvl_constant(MODEL_WATER_BOMB); - lvl_constant(MODEL_WATER_BOMB_SHADOW); - lvl_constant(MODEL_KING_BOBOMB); - lvl_constant(MODEL_MANTA_RAY); - lvl_constant(MODEL_UNAGI); - lvl_constant(MODEL_SUSHI); - lvl_constant(MODEL_DL_WHIRLPOOL); - lvl_constant(MODEL_CLAM_SHELL); - lvl_constant(MODEL_POKEY_HEAD); - lvl_constant(MODEL_POKEY_BODY_PART); - lvl_constant(MODEL_TWEESTER); - lvl_constant(MODEL_KLEPTO); - lvl_constant(MODEL_EYEROK_LEFT_HAND); - lvl_constant(MODEL_EYEROK_RIGHT_HAND); - lvl_constant(MODEL_DL_MONTY_MOLE_HOLE); - lvl_constant(MODEL_MONTY_MOLE); - lvl_constant(MODEL_UKIKI); - lvl_constant(MODEL_FWOOSH); - lvl_constant(MODEL_SPINDRIFT); - lvl_constant(MODEL_MR_BLIZZARD_HIDDEN); - lvl_constant(MODEL_MR_BLIZZARD); - lvl_constant(MODEL_PENGUIN); - lvl_constant(MODEL_CAP_SWITCH_EXCLAMATION); - lvl_constant(MODEL_CAP_SWITCH); - lvl_constant(MODEL_CAP_SWITCH_BASE); - lvl_constant(MODEL_BOO); - lvl_constant(MODEL_BETA_BOO_KEY); - lvl_constant(MODEL_HAUNTED_CHAIR); - lvl_constant(MODEL_MAD_PIANO); - lvl_constant(MODEL_BOOKEND_PART); - lvl_constant(MODEL_BOOKEND); - lvl_constant(MODEL_HAUNTED_CAGE); - lvl_constant(MODEL_BIRDS); - lvl_constant(MODEL_YOSHI); - lvl_constant(MODEL_ENEMY_LAKITU); - lvl_constant(MODEL_SPINY_BALL); - lvl_constant(MODEL_SPINY); - lvl_constant(MODEL_WIGGLER_HEAD); - lvl_constant(MODEL_WIGGLER_BODY); - lvl_constant(MODEL_BUBBA); - lvl_constant(MODEL_UNKNOWN_54); - lvl_constant(MODEL_UNKNOWN_58); - lvl_constant(MODEL_BOWSER); - lvl_constant(MODEL_BOWSER_BOMB_CHILD_OBJ); - lvl_constant(MODEL_BOWSER_SMOKE); - lvl_constant(MODEL_BOWSER_FLAMES); - lvl_constant(MODEL_BOWSER_WAVE); - lvl_constant(MODEL_BOWSER2); - lvl_constant(MODEL_BUB); - lvl_constant(MODEL_TREASURE_CHEST_BASE); - lvl_constant(MODEL_TREASURE_CHEST_LID); - lvl_constant(MODEL_CYAN_FISH); - lvl_constant(MODEL_WATER_RING); - lvl_constant(MODEL_SKEETER); - lvl_constant(MODEL_PIRANHA_PLANT); - lvl_constant(MODEL_WHOMP); - lvl_constant(MODEL_KOOPA_WITH_SHELL); - lvl_constant(MODEL_METALLIC_BALL); - lvl_constant(MODEL_CHAIN_CHOMP); - lvl_constant(MODEL_KOOPA_FLAG); - lvl_constant(MODEL_WOODEN_POST); - lvl_constant(MODEL_MIPS); - lvl_constant(MODEL_BOO_CASTLE); - lvl_constant(MODEL_LAKITU); - lvl_constant(MODEL_CHILL_BULLY); - lvl_constant(MODEL_BIG_CHILL_BULLY); - lvl_constant(MODEL_MONEYBAG); - lvl_constant(MODEL_SWOOP); - lvl_constant(MODEL_SCUTTLEBUG); - lvl_constant(MODEL_MR_I_IRIS); - lvl_constant(MODEL_MR_I); - lvl_constant(MODEL_DORRIE); - lvl_constant(MODEL_YELLOW_COIN); - lvl_constant(MODEL_YELLOW_COIN_NO_SHADOW); - lvl_constant(MODEL_BLUE_COIN); - lvl_constant(MODEL_BLUE_COIN_NO_SHADOW); - lvl_constant(MODEL_HEART); - lvl_constant(MODEL_TRANSPARENT_STAR); - lvl_constant(MODEL_STAR); - lvl_constant(MODEL_TTM_SLIDE_EXIT_PODIUM); - lvl_constant(MODEL_WOODEN_SIGNPOST); - lvl_constant(MODEL_UNKNOWN_7D); - lvl_constant(MODEL_CANNON_BARREL); - lvl_constant(MODEL_CANNON_BASE); - lvl_constant(MODEL_BREAKABLE_BOX); - lvl_constant(MODEL_BREAKABLE_BOX_SMALL); - lvl_constant(MODEL_EXCLAMATION_BOX_OUTLINE); - lvl_constant(MODEL_EXCLAMATION_POINT); - lvl_constant(MODEL_MARIOS_WINGED_METAL_CAP); - lvl_constant(MODEL_MARIOS_METAL_CAP); - lvl_constant(MODEL_MARIOS_WING_CAP); - lvl_constant(MODEL_MARIOS_CAP); - lvl_constant(MODEL_EXCLAMATION_BOX); - lvl_constant(MODEL_DIRT_ANIMATION); - lvl_constant(MODEL_CARTOON_STAR); - lvl_constant(MODEL_BLUE_COIN_SWITCH); - lvl_constant(MODEL_MIST); - lvl_constant(MODEL_SPARKLES_ANIMATION); - lvl_constant(MODEL_RED_FLAME); - lvl_constant(MODEL_BLUE_FLAME); - lvl_constant(MODEL_BURN_SMOKE); - lvl_constant(MODEL_SPARKLES); - lvl_constant(MODEL_SMOKE); - lvl_constant(MODEL_BURN_SMOKE_UNUSED); - lvl_constant(MODEL_WHITE_PARTICLE_DL); - lvl_constant(MODEL_SAND_DUST); - lvl_constant(MODEL_WHITE_PARTICLE); - lvl_constant(MODEL_PEBBLE); - lvl_constant(MODEL_LEAVES); - lvl_constant(MODEL_WAVE_TRAIL); - lvl_constant(MODEL_WHITE_PARTICLE_SMALL); - lvl_constant(MODEL_SMALL_WATER_SPLASH); - lvl_constant(MODEL_IDLE_WATER_WAVE); - lvl_constant(MODEL_WATER_SPLASH); - lvl_constant(MODEL_BUBBLE); - lvl_constant(MODEL_PURPLE_MARBLE); - lvl_constant(MODEL_UNKNOWN_AC); - lvl_constant(MODEL_WF_SLIDING_PLATFORM); - lvl_constant(MODEL_WF_SMALL_BOMP); - lvl_constant(MODEL_WF_ROTATING_WOODEN_PLATFORM); - lvl_constant(MODEL_WF_TUMBLING_BRIDGE_PART); - lvl_constant(MODEL_WF_LARGE_BOMP); - lvl_constant(MODEL_WF_TUMBLING_BRIDGE); - lvl_constant(MODEL_BOWSER_BOMB); - lvl_constant(MODEL_WATER_MINE); - lvl_constant(MODEL_BOWLING_BALL); - lvl_constant(MODEL_TRAMPOLINE); - lvl_constant(MODEL_TRAMPOLINE_CENTER); - lvl_constant(MODEL_TRAMPOLINE_BASE); - lvl_constant(MODEL_UNKNOWN_B8); - lvl_constant(MODEL_FISH); - lvl_constant(MODEL_FISH_SHADOW); - lvl_constant(MODEL_BUTTERFLY); - lvl_constant(MODEL_BLACK_BOBOMB); - lvl_constant(MODEL_KOOPA_SHELL); - lvl_constant(MODEL_KOOPA_WITHOUT_SHELL); - lvl_constant(MODEL_GOOMBA); - lvl_constant(MODEL_SEAWEED); - lvl_constant(MODEL_AMP); - lvl_constant(MODEL_BOBOMB_BUDDY); - lvl_constant(MODEL_SSL_TOX_BOX); - lvl_constant(MODEL_BOWSER_KEY_CUTSCENE); - lvl_constant(MODEL_DL_CANNON_LID); - lvl_constant(MODEL_CHECKERBOARD_PLATFORM); - lvl_constant(MODEL_RED_FLAME_SHADOW); - lvl_constant(MODEL_BOWSER_KEY); - lvl_constant(MODEL_EXPLOSION); - lvl_constant(MODEL_SNUFIT); - lvl_constant(MODEL_PURPLE_SWITCH); - lvl_constant(MODEL_CASTLE_STAR_DOOR_30_STARS); - lvl_constant(MODEL_CASTLE_STAR_DOOR_50_STARS); - lvl_constant(MODEL_CCM_SNOWMAN_BASE); - lvl_constant(MODEL_1UP); - lvl_constant(MODEL_CASTLE_STAR_DOOR_8_STARS); - lvl_constant(MODEL_CASTLE_STAR_DOOR_70_STARS); - lvl_constant(MODEL_RED_COIN); - lvl_constant(MODEL_RED_COIN_NO_SHADOW); - lvl_constant(MODEL_METAL_BOX); - lvl_constant(MODEL_METAL_BOX_DL); - lvl_constant(MODEL_NUMBER); - lvl_constant(MODEL_FLYGUY); - lvl_constant(MODEL_TOAD); - lvl_constant(MODEL_PEACH); - lvl_constant(MODEL_CHUCKYA); - lvl_constant(MODEL_WHITE_PUFF); - lvl_constant(MODEL_TRAJECTORY_MARKER_BALL); - lvl_constant(MODEL_MAIN_MENU_MARIO_SAVE_BUTTON); - lvl_constant(MODEL_MAIN_MENU_RED_ERASE_BUTTON); - lvl_constant(MODEL_MAIN_MENU_BLUE_COPY_BUTTON); - lvl_constant(MODEL_MAIN_MENU_YELLOW_FILE_BUTTON); - lvl_constant(MODEL_MAIN_MENU_GREEN_SCORE_BUTTON); - lvl_constant(MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE); - lvl_constant(MODEL_MAIN_MENU_MARIO_NEW_BUTTON); - lvl_constant(MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE); - lvl_constant(MODEL_MAIN_MENU_PURPLE_SOUND_BUTTON); - lvl_constant(MODEL_MAIN_MENU_GENERIC_BUTTON); - lvl_constant(MODEL_LLL_ROTATING_HEXAGONAL_PLATFORM); - lvl_constant(MODEL_WF_GIANT_POLE); - lvl_constant(MODEL_WF_ROTATING_PLATFORM); - lvl_constant(MODEL_BITDW_WARP_PIPE); - lvl_constant(MODEL_THI_WARP_PIPE); - lvl_constant(MODEL_VCUTM_WARP_PIPE); - lvl_constant(MODEL_CASTLE_GROUNDS_WARP_PIPE); - lvl_constant(MODEL_BUBBLE_PLAYER); - lvl_constant(MODEL_LUIGI); - lvl_constant(MODEL_LUIGIS_CAP); - lvl_constant(MODEL_LUIGIS_METAL_CAP); - lvl_constant(MODEL_LUIGIS_WING_CAP); - lvl_constant(MODEL_LUIGIS_WINGED_METAL_CAP); - lvl_constant(MODEL_TOAD_PLAYER); - lvl_constant(MODEL_TOADS_CAP); - lvl_constant(MODEL_TOADS_METAL_CAP); - lvl_constant(MODEL_TOADS_WING_CAP); - lvl_constant(MODEL_WALUIGI); - lvl_constant(MODEL_WALUIGIS_CAP); - lvl_constant(MODEL_WALUIGIS_METAL_CAP); - lvl_constant(MODEL_WALUIGIS_WING_CAP); - lvl_constant(MODEL_WALUIGIS_WINGED_METAL_CAP); - lvl_constant(MODEL_WARIO); - lvl_constant(MODEL_WARIOS_CAP); - lvl_constant(MODEL_WARIOS_METAL_CAP); - lvl_constant(MODEL_WARIOS_WING_CAP); - lvl_constant(MODEL_WARIOS_WINGED_METAL_CAP); - lvl_constant(MODEL_ERROR_MODEL); + s64 cModelConstant = DynOS_Common_ParseModelConstants(_Arg, found); + if (*found) { return cModelConstant; } + *found = true; // reset found value // dialog constants lvl_constant(DIALOG_000); diff --git a/data/dynos_bin_utils.cpp b/data/dynos_bin_utils.cpp index af13e436..e46fc49f 100644 --- a/data/dynos_bin_utils.cpp +++ b/data/dynos_bin_utils.cpp @@ -179,6 +179,11 @@ static bool ParseOperator(const char* op) { return false; } +static bool PeekOperator(const char* op) { + size_t opLen = strlen(op); + return (!strncmp(sRdString, op, opLen)); +} + static s64 ParseNumeric() { String numeric = ""; char* c = sRdString; @@ -275,12 +280,14 @@ static s64 ParseFactor() { static s64 ParseTerm() { s64 f1 = ParseFactor(); - if (ParseOperator("*")) { - return f1 * ParseFactor(); - } else if (ParseOperator("/")) { - return f1 / ParseFactor(); - } else if (ParseOperator("%")) { - return f1 % ParseFactor(); + while (PeekOperator("*") || PeekOperator("/") || PeekOperator("%")) { + if (ParseOperator("*")) { + f1 *= ParseFactor(); + } else if (ParseOperator("/")) { + f1 /= ParseFactor(); + } else if (ParseOperator("%")) { + f1 %= ParseFactor(); + } } return f1; @@ -289,10 +296,12 @@ static s64 ParseTerm() { static s64 ParseAddSubExpression() { s64 t1 = ParseTerm(); - if (ParseOperator("+")) { - return t1 + ParseTerm(); - } else if (ParseOperator("-")) { - return t1 - ParseTerm(); + while (PeekOperator("+") || PeekOperator("-")) { + if (ParseOperator("+")) { + t1 += ParseTerm(); + } else if (ParseOperator("-")) { + t1 -= ParseTerm(); + } } return t1; @@ -301,10 +310,12 @@ static s64 ParseAddSubExpression() { static s64 ParseShiftExpression() { s64 e1 = ParseAddSubExpression(); - if (ParseOperator("<<")) { - return e1 << ParseAddSubExpression(); - } else if (ParseOperator(">>")) { - return e1 >> ParseAddSubExpression(); + while (PeekOperator("<<") || PeekOperator(">>")) { + if (ParseOperator("<<")) { + e1 = e1 << ParseAddSubExpression(); + } else if (ParseOperator(">>")) { + e1 = e1 >> ParseAddSubExpression(); + } } return e1; @@ -313,8 +324,10 @@ static s64 ParseShiftExpression() { static s64 ParseBitAndExpression() { s64 e1 = ParseShiftExpression(); - if (ParseOperator("&")) { - return e1 & ParseShiftExpression(); + while (PeekOperator("&")) { + if (ParseOperator("&")) { + e1 &= ParseShiftExpression(); + } } return e1; @@ -323,8 +336,10 @@ static s64 ParseBitAndExpression() { static s64 ParseBitXorExpression() { s64 e1 = ParseBitAndExpression(); - if (ParseOperator("^")) { - return e1 ^ ParseBitAndExpression(); + while (PeekOperator("^")) { + if (ParseOperator("^")) { + e1 ^= ParseBitAndExpression(); + } } return e1; @@ -333,8 +348,10 @@ static s64 ParseBitXorExpression() { static s64 ParseBitOrExpression() { s64 e1 = ParseBitXorExpression(); - if (ParseOperator("|")) { - return e1 | ParseBitXorExpression(); + while (PeekOperator("|")) { + if (ParseOperator("|")) { + e1 |= ParseBitXorExpression(); + } } return e1; @@ -349,6 +366,9 @@ s64 DynOS_RecursiveDescent_Parse(const char* expr, bool* success, RDConstantFunc sRdError = false; sRdConstantFunc = func; s64 value = ParseExpression(); + if (strlen(sRdString) > 0) { + sRdError = true; + } sRdString = NULL; *success = !sRdError; return value; diff --git a/developer/debug.sh b/developer/debug.sh index 7a017b58..08ce6356 100755 --- a/developer/debug.sh +++ b/developer/debug.sh @@ -15,4 +15,4 @@ if [ ! -f "$FILE" ]; then WINPTY= fi -$WINPTY cgdb $FILE -ex 'r' +$WINPTY cgdb $FILE diff --git a/src/engine/behavior_script.c b/src/engine/behavior_script.c index 50d26e50..0f3136d0 100644 --- a/src/engine/behavior_script.c +++ b/src/engine/behavior_script.c @@ -1151,7 +1151,7 @@ static s32 bhv_cmd_spawn_obj_ext(void) { // Command 0x40: Loads the animations for the object. is always set to oAnimations. // Usage: LOAD_ANIMATIONS_EXT(field, anims) static s32 bhv_cmd_load_animations_ext(void) { - u8 field = BHV_CMD_GET_2ND_U8(0); + //u8 field = BHV_CMD_GET_2ND_U8(0); printf("LOAD_ANIMATIONS_EXT is not yet supported! Skipping behavior command.\n"); diff --git a/src/engine/surface_load.c b/src/engine/surface_load.c index 55c3ded9..aba1fd9e 100644 --- a/src/engine/surface_load.c +++ b/src/engine/surface_load.c @@ -18,6 +18,7 @@ #include "engine/math_util.h" #include "game/level_update.h" #include "pc/network/network.h" +#include "pc/lua/smlua_hooks.h" s32 unused8038BE90; @@ -744,7 +745,7 @@ void load_object_surfaces(s16** data, s16* vertexData) { // The DDD warp is initially loaded at the origin and moved to the proper // position in paintings.c and doesn't update its room, so set it here. - if (gCurrentObject->behavior == segmented_to_virtual(bhvDddWarp)) { + if (gCurrentObject->behavior == segmented_to_virtual(smlua_override_behavior(bhvDddWarp))) { room = 5; } else { room = 0; diff --git a/src/game/behavior_actions.c b/src/game/behavior_actions.c index 1c1cb5d4..4e3596cd 100644 --- a/src/game/behavior_actions.c +++ b/src/game/behavior_actions.c @@ -47,6 +47,7 @@ #include "rumble_init.h" #include "hardcoded.h" #include "pc/lua/utils/smlua_model_utils.h" +#include "pc/lua/smlua_hooks.h" #define o gCurrentObject @@ -174,7 +175,7 @@ Gfx *geo_move_mario_part_from_parent(s32 run, UNUSED struct GraphNode *node, Mat if (run == TRUE) { sp1C = (struct Object *) gCurGraphNodeObject; - if (sp1C->behavior == bhvMario && sp1C->prevObj != NULL) { + if (sp1C->behavior == smlua_override_behavior(bhvMario) && sp1C->prevObj != NULL) { create_transformation_from_matrices(sp20, mtx, *gCurGraphNodeCamera->matrixPtr); obj_update_pos_from_parent_transformation(sp20, sp1C->prevObj); obj_set_gfx_pos_from_pos(sp1C->prevObj); diff --git a/src/game/behaviors/boo.inc.c b/src/game/behaviors/boo.inc.c index f1c6b8fb..1181547c 100644 --- a/src/game/behaviors/boo.inc.c +++ b/src/game/behaviors/boo.inc.c @@ -751,7 +751,7 @@ u8 big_boo_ignore_update(void) { void big_boo_on_forget(void) { if (o == NULL) { return; } - if (o->behavior != bhvGhostHuntBigBoo) { return; } + if (o->behavior != smlua_override_behavior(bhvGhostHuntBigBoo)) { return; } struct Object* spawnedBridge = cur_obj_nearest_object_with_behavior(bhvBooBossSpawnedBridge); if (spawnedBridge == NULL && o->oBehParams2ndByte == 0) { obj_set_pos(o, 973, 0, 717); diff --git a/src/game/behaviors/boo_cage.inc.c b/src/game/behaviors/boo_cage.inc.c index b6ab14e7..5251987f 100644 --- a/src/game/behaviors/boo_cage.inc.c +++ b/src/game/behaviors/boo_cage.inc.c @@ -61,10 +61,10 @@ void bhv_boo_cage_loop(void) { // If the cage's parent boo is killed, set the action to BOO_CAGE_ACT_FALLING, // give the cage an initial Y velocity of 60 units/frame, and play the puzzle jingle. // Otherwise, stay inside the boo. - if (o->parentObj == NULL || o->parentObj->behavior != bhvBooWithCage || o->parentObj->oBooDeathStatus != BOO_DEATH_STATUS_ALIVE) { + if (o->parentObj == NULL || o->parentObj->behavior != smlua_override_behavior(bhvBooWithCage) || o->parentObj->oBooDeathStatus != BOO_DEATH_STATUS_ALIVE) { o->oAction++; o->oVelY = 60.0f; - if (o->parentObj != NULL && o->parentObj->behavior == bhvBooWithCage) { + if (o->parentObj != NULL && o->parentObj->behavior == smlua_override_behavior(bhvBooWithCage)) { play_puzzle_jingle(); } struct MarioState* marioState = nearest_mario_state_to_object(o); diff --git a/src/game/behaviors/chain_chomp.inc.c b/src/game/behaviors/chain_chomp.inc.c index f41f212a..4b63666c 100644 --- a/src/game/behaviors/chain_chomp.inc.c +++ b/src/game/behaviors/chain_chomp.inc.c @@ -32,7 +32,7 @@ void bhv_chain_chomp_chain_part_update(void) { network_init_object(o, SYNC_DISTANCE_ONLY_DEATH); } - if (o->parentObj->behavior != (BehaviorScript *)&bhvChainChomp || o->parentObj->oAction == CHAIN_CHOMP_ACT_UNLOAD_CHAIN) { + if (o->parentObj->activeFlags == ACTIVE_FLAG_DEACTIVATED || o->parentObj->oAction == CHAIN_CHOMP_ACT_UNLOAD_CHAIN) { obj_mark_for_deletion(o); network_send_object(o); } else if (o->oBehParams2ndByte != CHAIN_CHOMP_CHAIN_PART_BP_PIVOT) { diff --git a/src/game/behaviors/coin.inc.c b/src/game/behaviors/coin.inc.c index a25349c3..f9d740b9 100644 --- a/src/game/behaviors/coin.inc.c +++ b/src/game/behaviors/coin.inc.c @@ -224,7 +224,7 @@ void coin_inside_boo_act_0(void) { cur_obj_become_intangible(); - if (parent == NULL || (parent->behavior != bhvMerryGoRoundBoo && parent->behavior != bhvGhostHuntBoo && parent->behavior != bhvBoo)) { + if (parent == NULL || (parent->behavior != smlua_override_behavior(bhvMerryGoRoundBoo) && parent->behavior != smlua_override_behavior(bhvGhostHuntBoo) && parent->behavior != smlua_override_behavior(bhvBoo))) { o->parentObj = NULL; obj_mark_for_deletion(o); return; diff --git a/src/game/behaviors/enemy_lakitu.inc.c b/src/game/behaviors/enemy_lakitu.inc.c index eb010a52..17e30c20 100644 --- a/src/game/behaviors/enemy_lakitu.inc.c +++ b/src/game/behaviors/enemy_lakitu.inc.c @@ -199,7 +199,7 @@ static void enemy_lakitu_act_main(void) { obj_update_blinking(&o->oEnemyLakituBlinkTimer, 20, 40, 4); if (o->prevObj != NULL) { - if (o->prevObj->behavior != bhvSpiny || o->prevObj->activeFlags == ACTIVE_FLAG_DEACTIVATED) { + if (o->prevObj->behavior != smlua_override_behavior(bhvSpiny) || o->prevObj->activeFlags == ACTIVE_FLAG_DEACTIVATED) { o->prevObj = NULL; } } diff --git a/src/game/behaviors/exclamation_box.inc.c b/src/game/behaviors/exclamation_box.inc.c index 30e46db6..9deb159f 100644 --- a/src/game/behaviors/exclamation_box.inc.c +++ b/src/game/behaviors/exclamation_box.inc.c @@ -147,9 +147,9 @@ void exclamation_box_spawn_contents(struct Struct802C0DF0 *a0, u8 a1) { // send non-star spawn events // stars cant be sent here to due jankiness in oBehParams - if (a0->behavior != bhvSpawnedStar && sp1C != NULL) { + if (a0->behavior != smlua_override_behavior(bhvSpawnedStar) && sp1C != NULL) { // hack: if any other sync objects get spawned here we have to check for them - if (a0->behavior == bhvKoopaShell) { + if (a0->behavior == smlua_override_behavior(bhvKoopaShell)) { network_set_sync_id(sp1C); } struct Object* spawn_objects[] = { sp1C }; diff --git a/src/game/behaviors/flame_mario.inc.c b/src/game/behaviors/flame_mario.inc.c index 63f82c01..cbfa5c21 100644 --- a/src/game/behaviors/flame_mario.inc.c +++ b/src/game/behaviors/flame_mario.inc.c @@ -32,7 +32,7 @@ void bhv_black_smoke_mario_loop(void) { } void bhv_flame_mario_loop(void) { - if (o->parentObj == NULL || o->parentObj->behavior != bhvMario) { + if (o->parentObj == NULL || o->parentObj->behavior != smlua_override_behavior(bhvMario)) { obj_mark_for_deletion(o); return; } diff --git a/src/game/behaviors/flying_bookend_switch.inc.c b/src/game/behaviors/flying_bookend_switch.inc.c index 73af23eb..b8d41dd1 100644 --- a/src/game/behaviors/flying_bookend_switch.inc.c +++ b/src/game/behaviors/flying_bookend_switch.inc.c @@ -229,7 +229,7 @@ void bookshelf_manager_act_2(void) { void bookshelf_manager_act_3(void) { // opening bookshelf - if (o->parentObj == NULL || o->parentObj->behavior != bhvHauntedBookshelf) { + if (o->parentObj == NULL || o->parentObj->behavior != smlua_override_behavior(bhvHauntedBookshelf)) { o->parentObj = cur_obj_nearest_object_with_behavior(bhvHauntedBookshelf); } diff --git a/src/game/behaviors/monty_mole.inc.c b/src/game/behaviors/monty_mole.inc.c index 7ef4cea2..6aa02f4c 100644 --- a/src/game/behaviors/monty_mole.inc.c +++ b/src/game/behaviors/monty_mole.inc.c @@ -30,6 +30,7 @@ f32 sMontyMoleLastKilledPosZ; * start of this list. */ static struct Object *link_objects_with_behavior(const BehaviorScript *behavior) { + behavior = smlua_override_behavior(behavior); const BehaviorScript *behaviorAddr; struct Object *obj; struct Object *lastObject; diff --git a/src/game/behaviors/pokey.inc.c b/src/game/behaviors/pokey.inc.c index 059babdd..e38549cc 100644 --- a/src/game/behaviors/pokey.inc.c +++ b/src/game/behaviors/pokey.inc.c @@ -45,7 +45,7 @@ void bhv_pokey_body_part_update(void) { s16 offsetAngle; f32 baseHeight; - if (o->parentObj == NULL || o->parentObj->behavior != bhvPokey || o->parentObj->activeFlags == ACTIVE_FLAG_DEACTIVATED) { + if (o->parentObj == NULL || o->parentObj->behavior != smlua_override_behavior(bhvPokey) || o->parentObj->activeFlags == ACTIVE_FLAG_DEACTIVATED) { obj_mark_for_deletion(o); return; } diff --git a/src/game/behaviors/sparkle_spawn_star.inc.c b/src/game/behaviors/sparkle_spawn_star.inc.c index cd23a647..488cbccd 100644 --- a/src/game/behaviors/sparkle_spawn_star.inc.c +++ b/src/game/behaviors/sparkle_spawn_star.inc.c @@ -22,7 +22,7 @@ void bhv_spawned_star_init(void) { // exclamation box stars are not sent through the normal exclamation box // path due to jankiness in oBehParams. Send the spawn event here instead. - u8 spawnedFromExclamationBox = (o->parentObj != NULL && o->parentObj->behavior == bhvExclamationBox); + u8 spawnedFromExclamationBox = (o->parentObj != NULL && o->parentObj->behavior == smlua_override_behavior(bhvExclamationBox)); if (gNetworkAreaLoaded && spawnedFromExclamationBox) { o->oStarSpawnExtCutsceneFlags = 1; o->parentObj = o; diff --git a/src/game/behaviors/spiny.inc.c b/src/game/behaviors/spiny.inc.c index 9f0685fd..716ec911 100644 --- a/src/game/behaviors/spiny.inc.c +++ b/src/game/behaviors/spiny.inc.c @@ -76,7 +76,7 @@ static s32 spiny_check_active(void) { struct Object* player = nearest_player_to_object(o); s32 distanceToPlayer = dist_between_objects(o, player); - if (o->parentObj == NULL || o->parentObj->behavior != bhvEnemyLakitu) { + if (o->parentObj == NULL || o->parentObj->behavior != smlua_override_behavior(bhvEnemyLakitu)) { obj_mark_for_deletion(o); return FALSE; } @@ -224,7 +224,7 @@ static void spiny_act_thrown_by_lakitu(void) { void bhv_spiny_override_ownership(u8* shouldOverride, u8* shouldOwn) { if (o->parentObj == NULL || o->parentObj->activeFlags == ACTIVE_FLAG_DEACTIVATED) { return; } - *shouldOverride = (o->parentObj->behavior == bhvEnemyLakitu); + *shouldOverride = (o->parentObj->behavior == smlua_override_behavior(bhvEnemyLakitu)); *shouldOwn = network_owns_object(o->parentObj); } diff --git a/src/game/behaviors/water_mist_particle.inc.c b/src/game/behaviors/water_mist_particle.inc.c index 9780ade7..f47a22bf 100644 --- a/src/game/behaviors/water_mist_particle.inc.c +++ b/src/game/behaviors/water_mist_particle.inc.c @@ -3,7 +3,7 @@ void bhv_water_mist_spawn_loop(void) { clear_particle_flags(0x20000); - if (o->parentObj == NULL || o->parentObj->behavior != bhvMario) { + if (o->parentObj == NULL || o->parentObj->behavior != smlua_override_behavior(bhvMario)) { obj_mark_for_deletion(o); return; } @@ -11,7 +11,7 @@ void bhv_water_mist_spawn_loop(void) { } void bhv_water_mist_loop(void) { - if (o->parentObj == NULL || o->parentObj->behavior != bhvMario) { + if (o->parentObj == NULL || o->parentObj->behavior != smlua_override_behavior(bhvMario)) { obj_mark_for_deletion(o); return; } diff --git a/src/game/behaviors/water_splashes_and_waves.inc.c b/src/game/behaviors/water_splashes_and_waves.inc.c index 8ea14a4b..58c2d729 100644 --- a/src/game/behaviors/water_splashes_and_waves.inc.c +++ b/src/game/behaviors/water_splashes_and_waves.inc.c @@ -93,7 +93,7 @@ void bhv_water_droplet_loop(void) { } void bhv_idle_water_wave_loop(void) { - if (o->parentObj == NULL || o->parentObj->behavior != bhvMario) { + if (o->parentObj == NULL || o->parentObj->behavior != smlua_override_behavior(bhvMario)) { obj_mark_for_deletion(o); return; } diff --git a/src/game/behaviors/wdw_water_level.inc.c b/src/game/behaviors/wdw_water_level.inc.c index 05b9bc1a..0764affd 100644 --- a/src/game/behaviors/wdw_water_level.inc.c +++ b/src/game/behaviors/wdw_water_level.inc.c @@ -3,9 +3,9 @@ static u32 sWaterDiamondPicked = 0; static void bhv_init_changing_water_level_on_received_post(UNUSED u8 fromLocalIndex) { struct SyncObject* diamondSo = &gSyncObjects[sWaterDiamondPicked]; - if (diamondSo == NULL || diamondSo->behavior != bhvWaterLevelDiamond) { return; } + if (diamondSo == NULL || diamondSo->behavior != smlua_override_behavior(bhvWaterLevelDiamond)) { return; } struct Object* diamond = get_sync_objects_object(sWaterDiamondPicked); - if (diamond == NULL || diamond->behavior != bhvWaterLevelDiamond) { return; } + if (diamond == NULL || diamond->behavior != smlua_override_behavior(bhvWaterLevelDiamond)) { return; } diamond->oAction = WATER_LEVEL_DIAMOND_ACT_CHANGE_WATER_LEVEL; gWDWWaterLevelChanging = 1; diff --git a/src/game/interaction.c b/src/game/interaction.c index e9cd6b3c..0504c321 100644 --- a/src/game/interaction.c +++ b/src/game/interaction.c @@ -326,7 +326,7 @@ void mario_drop_held_object(struct MarioState *m) { if (m->playerIndex != 0) { return; } if (m->heldObj != NULL) { - if (m->heldObj->behavior == segmented_to_virtual(bhvKoopaShellUnderwater)) { + if (m->heldObj->behavior == segmented_to_virtual(smlua_override_behavior(bhvKoopaShellUnderwater))) { stop_shell_music(); } @@ -353,7 +353,7 @@ void mario_throw_held_object(struct MarioState *m) { if (m->playerIndex != 0) { return; } if (m->heldObj != NULL) { - if (m->heldObj->behavior == segmented_to_virtual(bhvKoopaShellUnderwater)) { + if (m->heldObj->behavior == segmented_to_virtual(smlua_override_behavior(bhvKoopaShellUnderwater))) { if (m->playerIndex == 0) { stop_shell_music(); } } diff --git a/src/game/mario.c b/src/game/mario.c index d76492fb..175082d4 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -1854,7 +1854,7 @@ void func_sh_8025574C(void) { } else if (gMarioState->particleFlags & PARTICLE_TRIANGLE) { queue_rumble_data_mario(gMarioState, 5, 80); } - if(gMarioState->heldObj && gMarioState->heldObj->behavior == segmented_to_virtual(bhvBobomb)) { + if(gMarioState->heldObj && gMarioState->heldObj->behavior == segmented_to_virtual(smlua_override_behavior(bhvBobomb))) { reset_rumble_timers(gMarioState); } } diff --git a/src/game/mario_actions_airborne.c b/src/game/mario_actions_airborne.c index 63a4fd56..6990d10d 100644 --- a/src/game/mario_actions_airborne.c +++ b/src/game/mario_actions_airborne.c @@ -1955,7 +1955,7 @@ s32 act_flying(struct MarioState *m) { } s32 act_riding_hoot(struct MarioState *m) { - if (m->usedObj == NULL || m->usedObj->behavior != bhvHoot) { + if (m->usedObj == NULL || m->usedObj->behavior != smlua_override_behavior(bhvHoot)) { m->usedObj = cur_obj_nearest_object_with_behavior(bhvHoot); if (m->usedObj == NULL) { return FALSE; } m->usedObj->heldByPlayerIndex = m->playerIndex; diff --git a/src/game/mario_actions_automatic.c b/src/game/mario_actions_automatic.c index b23b7071..058274c1 100644 --- a/src/game/mario_actions_automatic.c +++ b/src/game/mario_actions_automatic.c @@ -36,7 +36,7 @@ void add_tree_leaf_particles(struct MarioState *m) { f32 leafHeight; - if (m->usedObj != NULL && m->usedObj->behavior == segmented_to_virtual(bhvTree)) { + if (m->usedObj != NULL && m->usedObj->behavior == segmented_to_virtual(smlua_override_behavior(bhvTree))) { // make leaf effect spawn higher on the Shifting Sand Land palm tree if (gCurrLevelNum == LEVEL_SSL) { leafHeight = 250.0f; @@ -50,7 +50,7 @@ void add_tree_leaf_particles(struct MarioState *m) { } void play_climbing_sounds(struct MarioState *m, s32 b) { - s32 isOnTree = (m->usedObj != NULL && m->usedObj->behavior == segmented_to_virtual(bhvTree)); + s32 isOnTree = (m->usedObj != NULL && m->usedObj->behavior == segmented_to_virtual(smlua_override_behavior(bhvTree))); if (b == 1) { if (is_anim_past_frame(m, 1)) { @@ -169,7 +169,7 @@ s32 act_holding_pole(struct MarioState *m) { return set_mario_action(m, ACT_CLIMBING_POLE, 0); } - if (poleBehavior != bhvGiantPole && m->controller->stickY > 50.0f) { + if (poleBehavior != smlua_override_behavior(bhvGiantPole) && m->controller->stickY > 50.0f) { return set_mario_action(m, ACT_TOP_OF_POLE_TRANSITION, 0); } } @@ -183,7 +183,7 @@ s32 act_holding_pole(struct MarioState *m) { m->faceAngle[1] += marioObj->oMarioPoleYawVel; marioObj->oMarioPolePos -= marioObj->oMarioPoleYawVel / 0x100; - if (m->usedObj->behavior == segmented_to_virtual(bhvTree)) { + if (m->usedObj->behavior == segmented_to_virtual(smlua_override_behavior(bhvTree))) { //! The Shifting Sand Land palm tree check is done climbing up in // add_tree_leaf_particles, but not here, when climbing down. if (m->pos[1] - m->floorHeight > 100.0f) { diff --git a/src/game/mario_actions_cutscene.c b/src/game/mario_actions_cutscene.c index a19aa1d7..5a0f2f02 100644 --- a/src/game/mario_actions_cutscene.c +++ b/src/game/mario_actions_cutscene.c @@ -432,7 +432,7 @@ s32 act_reading_npc_dialog(struct MarioState *m) { continueDialogCallback = gContinueDialogFunction(); gCurrentObject = tmp; } - if (!continueDialogCallback || m->usedObj == NULL || m->usedObj->activeFlags == ACTIVE_FLAG_DEACTIVATED || m->usedObj->behavior != localDialogNPCBehavior) { + if (!continueDialogCallback || m->usedObj == NULL || m->usedObj->activeFlags == ACTIVE_FLAG_DEACTIVATED || m->usedObj->behavior != smlua_override_behavior(localDialogNPCBehavior)) { set_mario_npc_dialog(m, 0, NULL); } } diff --git a/src/game/mario_actions_moving.c b/src/game/mario_actions_moving.c index 487d6a62..1c13b218 100644 --- a/src/game/mario_actions_moving.c +++ b/src/game/mario_actions_moving.c @@ -887,7 +887,7 @@ s32 act_move_punching(struct MarioState *m) { } s32 act_hold_walking(struct MarioState *m) { - if (m->heldObj != NULL && m->heldObj->behavior == segmented_to_virtual(bhvJumpingBox)) { + if (m->heldObj != NULL && m->heldObj->behavior == segmented_to_virtual(smlua_override_behavior(bhvJumpingBox))) { return set_mario_action(m, ACT_CRAZY_BOX_BOUNCE, 0); } diff --git a/src/game/mario_actions_submerged.c b/src/game/mario_actions_submerged.c index 3953c0e1..4a2a66b0 100644 --- a/src/game/mario_actions_submerged.c +++ b/src/game/mario_actions_submerged.c @@ -869,7 +869,7 @@ static s32 act_water_punch(struct MarioState *m) { case 2: set_mario_animation(m, MARIO_ANIM_WATER_PICK_UP_OBJ); if (is_anim_at_end(m)) { - if (m->heldObj != NULL && m->heldObj->behavior == segmented_to_virtual(bhvKoopaShellUnderwater)) { + if (m->heldObj != NULL && m->heldObj->behavior == segmented_to_virtual(smlua_override_behavior(bhvKoopaShellUnderwater))) { if (m->playerIndex == 0) { play_shell_music(); } set_mario_action(m, ACT_WATER_SHELL_SWIMMING, 0); } else { diff --git a/src/game/obj_behaviors_2.c b/src/game/obj_behaviors_2.c index 5194f5a5..ba4f0c60 100644 --- a/src/game/obj_behaviors_2.c +++ b/src/game/obj_behaviors_2.c @@ -49,6 +49,7 @@ #include "pc/network/network.h" #include "pc/network/reservation_area.h" #include "pc/lua/utils/smlua_model_utils.h" +#include "pc/lua/smlua_hooks.h" #define POS_OP_SAVE_POSITION 0 #define POS_OP_COMPUTE_VELOCITY 1 diff --git a/src/game/object_helpers.c b/src/game/object_helpers.c index 93b57439..30f55a71 100644 --- a/src/game/object_helpers.c +++ b/src/game/object_helpers.c @@ -313,21 +313,21 @@ void obj_set_held_state(struct Object *obj, const BehaviorScript *heldBehavior) obj->parentObj = o; if (obj->oFlags & OBJ_FLAG_HOLDABLE) { - if (heldBehavior == bhvCarrySomething3) { + if (heldBehavior == smlua_override_behavior(bhvCarrySomething3)) { obj->oHeldState = HELD_HELD; } - if (heldBehavior == bhvCarrySomething5) { + if (heldBehavior == smlua_override_behavior(bhvCarrySomething5)) { obj->oHeldState = HELD_THROWN; obj->heldByPlayerIndex = 0; } - if (heldBehavior == bhvCarrySomething4) { + if (heldBehavior == smlua_override_behavior(bhvCarrySomething4)) { obj->oHeldState = HELD_DROPPED; obj->heldByPlayerIndex = 0; } } else { - obj->curBhvCommand = segmented_to_virtual(heldBehavior); + obj->curBhvCommand = segmented_to_virtual(smlua_override_behavior(heldBehavior)); obj->bhvStackIndex = 0; } } @@ -1011,6 +1011,7 @@ struct Object *cur_obj_find_nearest_object_with_behavior(const BehaviorScript *b } u16 cur_obj_count_objects_with_behavior(const BehaviorScript* behavior, f32 dist) { + behavior = smlua_override_behavior(behavior); u16 numObjs = 0; uintptr_t* behaviorAddr = segmented_to_virtual(behavior); struct Object* obj; @@ -1093,6 +1094,7 @@ struct Object *find_object_with_behavior(const BehaviorScript *behavior) { } struct Object *cur_obj_find_nearby_held_actor(const BehaviorScript *behavior, f32 maxDist) { + behavior = smlua_override_behavior(behavior); const BehaviorScript *behaviorAddr = segmented_to_virtual(behavior); struct ObjectNode *listHead; struct Object *obj; @@ -1658,6 +1660,7 @@ void obj_set_behavior(struct Object *obj, const BehaviorScript *behavior) { } s32 cur_obj_has_behavior(const BehaviorScript *behavior) { + behavior = smlua_override_behavior(behavior); if (o->behavior == segmented_to_virtual(behavior)) { return TRUE; } else { @@ -1666,6 +1669,7 @@ s32 cur_obj_has_behavior(const BehaviorScript *behavior) { } s32 obj_has_behavior(struct Object *obj, const BehaviorScript *behavior) { + behavior = smlua_override_behavior(behavior); if (obj->behavior == segmented_to_virtual(behavior)) { return TRUE; } else { diff --git a/src/game/object_list_processor.c b/src/game/object_list_processor.c index 95cc2e05..4f48c7e3 100644 --- a/src/game/object_list_processor.c +++ b/src/game/object_list_processor.c @@ -540,7 +540,7 @@ void spawn_objects_from_info(UNUSED s32 unused, struct SpawnInfo *spawnInfo) { object->respawnInfo = &spawnInfo->behaviorArg; // found a player - if (spawnInfo->behaviorArg & ((u32)1 << 31) && object->behavior == bhvMario) { + if (spawnInfo->behaviorArg & ((u32)1 << 31) && object->behavior == smlua_override_behavior(bhvMario)) { u16 playerIndex = (spawnInfo->behaviorArg & ~(1 << 31)); object->oBehParams = playerIndex + 1; gMarioObjects[playerIndex] = object; diff --git a/src/pc/lua/utils/smlua_obj_utils.c b/src/pc/lua/utils/smlua_obj_utils.c index 5c2840de..c2889711 100644 --- a/src/pc/lua/utils/smlua_obj_utils.c +++ b/src/pc/lua/utils/smlua_obj_utils.c @@ -86,7 +86,7 @@ struct Object* spawn_non_sync_object(enum BehaviorId behaviorId, enum ModelExten s32 obj_has_behavior_id(struct Object *o, enum BehaviorId behaviorId) { const BehaviorScript *behavior = get_behavior_from_id(behaviorId); - return o->behavior == behavior; + return o->behavior == smlua_override_behavior(behavior); } s32 obj_has_model_extended(struct Object *o, enum ModelExtendedId modelId) { @@ -119,6 +119,7 @@ struct Object *obj_get_first(enum ObjectList objList) { struct Object *obj_get_first_with_behavior_id(enum BehaviorId behaviorId) { const BehaviorScript* behavior = get_behavior_from_id(behaviorId); + behavior = smlua_override_behavior(behavior); if (behavior) { enum ObjectList objList = get_object_list_from_behavior(behavior); for (struct Object *obj = obj_get_first(objList); obj != NULL; obj = obj_get_next(obj)) { @@ -132,6 +133,7 @@ struct Object *obj_get_first_with_behavior_id(enum BehaviorId behaviorId) { struct Object *obj_get_first_with_behavior_id_and_field_s32(enum BehaviorId behaviorId, s32 fieldIndex, s32 value) { const BehaviorScript* behavior = get_behavior_from_id(behaviorId); + behavior = smlua_override_behavior(behavior); if (behavior) { enum ObjectList objList = get_object_list_from_behavior(behavior); for (struct Object *obj = obj_get_first(objList); obj != NULL; obj = obj_get_next(obj)) { @@ -145,6 +147,7 @@ struct Object *obj_get_first_with_behavior_id_and_field_s32(enum BehaviorId beha struct Object *obj_get_first_with_behavior_id_and_field_f32(enum BehaviorId behaviorId, s32 fieldIndex, f32 value) { const BehaviorScript* behavior = get_behavior_from_id(behaviorId); + behavior = smlua_override_behavior(behavior); if (behavior) { enum ObjectList objList = get_object_list_from_behavior(behavior); for (struct Object *obj = obj_get_first(objList); obj != NULL; obj = obj_get_next(obj)) { @@ -159,6 +162,7 @@ struct Object *obj_get_first_with_behavior_id_and_field_f32(enum BehaviorId beha struct Object *obj_get_nearest_object_with_behavior_id(struct Object *o, enum BehaviorId behaviorId) { f32 minDist = 0x20000; const BehaviorScript *behavior = get_behavior_from_id(behaviorId); + behavior = smlua_override_behavior(behavior); struct Object *closestObj = NULL; if (behavior) { @@ -178,6 +182,7 @@ struct Object *obj_get_nearest_object_with_behavior_id(struct Object *o, enum Be s32 obj_count_objects_with_behavior_id(enum BehaviorId behaviorId) { const BehaviorScript *behavior = get_behavior_from_id(behaviorId); + behavior = smlua_override_behavior(behavior); s32 count = 0; if (behavior) { diff --git a/src/pc/network/packets/packet_area.c b/src/pc/network/packets/packet_area.c index 94bd2df2..827e7f71 100644 --- a/src/pc/network/packets/packet_area.c +++ b/src/pc/network/packets/packet_area.c @@ -11,6 +11,7 @@ #include "object_fields.h" #include "model_ids.h" #include "pc/utils/misc.h" +#include "pc/lua/smlua_hooks.h" //#define DISABLE_MODULE_LOG 1 #include "pc/debuglog.h" @@ -68,7 +69,7 @@ void network_send_area(struct NetworkPlayer* toNp) { u8 respawnerCount = 0; for (s32 i = 0; i < MAX_SYNC_OBJECTS; i++) { struct SyncObject* so = &gSyncObjects[i]; - if (so == NULL || so->o == NULL || so->o->behavior != bhvRespawner) { continue; } + if (so == NULL || so->o == NULL || so->o->behavior != smlua_override_behavior(bhvRespawner)) { continue; } respawnerCount++; } packet_write(&p, &respawnerCount, sizeof(u8)); @@ -76,7 +77,7 @@ void network_send_area(struct NetworkPlayer* toNp) { // write respawners for (s32 i = 0; i < MAX_SYNC_OBJECTS; i++) { struct SyncObject* so = &gSyncObjects[i]; - if (so == NULL || so->o == NULL || so->o->behavior != bhvRespawner) { continue; } + if (so == NULL || so->o == NULL || so->o->behavior != smlua_override_behavior(bhvRespawner)) { continue; } u32 behaviorToRespawn = get_id_from_behavior(so->o->oRespawnerBehaviorToRespawn); packet_write(&p, &so->o->oPosX, sizeof(f32)); packet_write(&p, &so->o->oPosY, sizeof(f32)); @@ -96,7 +97,7 @@ void network_send_area(struct NetworkPlayer* toNp) { for (s32 i = RESERVED_IDS_SYNC_OBJECT_OFFSET; i < MAX_SYNC_OBJECTS; i++) { struct SyncObject* so = &gSyncObjects[i]; if (so == NULL || so->o == NULL || so->o->oSyncID != (u32)i) { continue; } - if (so->o->behavior == bhvRespawner) { continue; } + if (so->o->behavior == smlua_override_behavior(bhvRespawner)) { continue; } struct Object* spawn_objects[] = { so->o }; // TODO: move find model to a utility file/function diff --git a/src/pc/network/packets/packet_collect_coin.c b/src/pc/network/packets/packet_collect_coin.c index 5dbdbaab..add47f58 100644 --- a/src/pc/network/packets/packet_collect_coin.c +++ b/src/pc/network/packets/packet_collect_coin.c @@ -9,6 +9,7 @@ #include "src/engine/math_util.h" #include "src/game/memory.h" #include "src/game/object_helpers.h" +#include "pc/lua/smlua_hooks.h" #include "pc/debuglog.h" extern s16 gCurrCourseNum, gCurrAreaIndex; @@ -24,6 +25,7 @@ static f32 dist_to_pos(struct Object* o, f32* pos) { } static struct Object* find_nearest_coin(const BehaviorScript *behavior, f32* pos, s32 coinValue, float minDist) { + behavior = smlua_override_behavior(behavior); uintptr_t *behaviorAddr = segmented_to_virtual(behavior); struct Object *closestObj = NULL; struct Object *obj; @@ -84,7 +86,7 @@ void network_receive_collect_coin(struct Packet* p) { if (behavior == NULL) { goto SANITY_CHECK_COINS; } // find the coin - float minDist = (behavior == bhvRedCoin) ? 200 : 1000; + float minDist = (behavior == smlua_override_behavior(bhvRedCoin)) ? 200 : 1000; struct Object* coin = find_nearest_coin(behavior, pos, coinValue, minDist); if (coin == NULL) { goto SANITY_CHECK_COINS; } diff --git a/src/pc/network/packets/packet_collect_item.c b/src/pc/network/packets/packet_collect_item.c index d68b7a15..57b0b355 100644 --- a/src/pc/network/packets/packet_collect_item.c +++ b/src/pc/network/packets/packet_collect_item.c @@ -8,6 +8,7 @@ #include "src/engine/math_util.h" #include "src/game/memory.h" #include "src/game/object_helpers.h" +#include "pc/lua/smlua_hooks.h" static f32 dist_to_pos(struct Object* o, f32* pos) { f32 x = o->oPosX - pos[0]; x *= x; @@ -17,6 +18,7 @@ static f32 dist_to_pos(struct Object* o, f32* pos) { } static struct Object* find_nearest_item(const BehaviorScript *behavior, f32* pos, float minDist) { + behavior = smlua_override_behavior(behavior); uintptr_t *behaviorAddr = segmented_to_virtual(behavior); struct Object *closestObj = NULL; struct Object *obj; diff --git a/src/pc/network/packets/packet_collect_star.c b/src/pc/network/packets/packet_collect_star.c index a0fc2c45..ad77fd2f 100644 --- a/src/pc/network/packets/packet_collect_star.c +++ b/src/pc/network/packets/packet_collect_star.c @@ -8,6 +8,7 @@ #include "src/game/memory.h" #include "src/game/object_helpers.h" #include "src/game/save_file.h" +#include "pc/lua/smlua_hooks.h" #include "pc/debuglog.h" extern s16 gCurrSaveFileNum; @@ -22,6 +23,7 @@ static f32 dist_to_pos(struct Object* o, f32* pos) { } static struct Object* find_nearest_star(const BehaviorScript* behavior, f32* pos, f32 minDist) { + behavior = smlua_override_behavior(behavior); uintptr_t* behaviorAddr = segmented_to_virtual(behavior); struct Object* closestObj = NULL; struct Object* obj; diff --git a/src/pc/network/packets/packet_level_macro.c b/src/pc/network/packets/packet_level_macro.c index dade490e..31e1999c 100644 --- a/src/pc/network/packets/packet_level_macro.c +++ b/src/pc/network/packets/packet_level_macro.c @@ -11,6 +11,7 @@ #include "object_fields.h" #include "behavior_table.h" #include "model_ids.h" +#include "pc/lua/smlua_hooks.h" //#define DISABLE_MODULE_LOG 1 #include "pc/debuglog.h" @@ -190,7 +191,7 @@ void network_receive_level_macro(struct Packet* p) { if (o != NULL) { LOG_INFO("rx macro special: object"); // coin formation - if (behavior == bhvCoinFormation) { + if (behavior == smlua_override_behavior(bhvCoinFormation)) { o->oBehParams = *respawnInfo; o->oCoinUnkF4 = (o->oBehParams >> 8) & 0xFF; @@ -199,7 +200,7 @@ void network_receive_level_macro(struct Packet* p) { struct Object* o2 = &gObjectPool[i]; if (o2->parentObj != o) { continue; } if (o2 == o) { continue; } - if (o2->behavior != bhvCoinFormationSpawn && o2->behavior != bhvYellowCoin) { continue; } + if (o2->behavior != smlua_override_behavior(bhvCoinFormationSpawn) && o2->behavior != smlua_override_behavior(bhvYellowCoin)) { continue; } if (o->oCoinUnkF4 & (1 << childIndex++)) { obj_mark_for_deletion(o2); } @@ -210,7 +211,7 @@ void network_receive_level_macro(struct Packet* p) { struct Object* o2 = &gObjectPool[i]; if (o2->parentObj != o) { continue; } if (o2 == o) { continue; } - if (o2->behavior != bhvGoomba) { continue; } + if (o2->behavior != smlua_override_behavior(bhvGoomba)) { continue; } u16 info = (*respawnInfo >> 8); u8 mask = ((o2->oBehParams2ndByte & GOOMBA_BP_TRIPLET_FLAG_MASK) >> 2); if (info & mask) { diff --git a/src/pc/network/packets/packet_object.c b/src/pc/network/packets/packet_object.c index af383da2..bc0b701f 100644 --- a/src/pc/network/packets/packet_object.c +++ b/src/pc/network/packets/packet_object.c @@ -11,6 +11,7 @@ #include "src/game/obj_behaviors.h" #include "src/game/object_list_processor.h" #include "src/game/area.h" +#include "pc/lua/smlua_hooks.h" #include "pc/debuglog.h" #include "pc/utils/misc.h" @@ -302,8 +303,8 @@ static bool allowable_behavior_change(struct SyncObject* so, BehaviorScript* beh struct Object* o = so->o; // bhvPenguinBaby can be set to bhvSmallPenguin - bool oBehaviorPenguin = (o->behavior == segmented_to_virtual(bhvPenguinBaby) || o->behavior == segmented_to_virtual(bhvSmallPenguin)); - bool inBehaviorPenguin = (behavior == segmented_to_virtual(bhvPenguinBaby) || behavior == segmented_to_virtual(bhvSmallPenguin)); + bool oBehaviorPenguin = (o->behavior == segmented_to_virtual(smlua_override_behavior(bhvPenguinBaby)) || o->behavior == segmented_to_virtual(smlua_override_behavior(bhvSmallPenguin))); + bool inBehaviorPenguin = (behavior == segmented_to_virtual(smlua_override_behavior(bhvPenguinBaby)) || behavior == segmented_to_virtual(smlua_override_behavior(bhvSmallPenguin))); bool allow = (oBehaviorPenguin && inBehaviorPenguin); if (!allow) { return false; } @@ -503,7 +504,7 @@ void network_send_object(struct Object* o) { LOG_ERROR("tried to send uninitialized sync obj"); return; } - if (o->behavior == bhvRespawner) { + if (o->behavior == smlua_override_behavior(bhvRespawner)) { LOG_INFO("tried to send respawner sync obj"); return; } diff --git a/src/pc/network/packets/packet_spawn_star.c b/src/pc/network/packets/packet_spawn_star.c index 1c25fdc2..56ca7308 100644 --- a/src/pc/network/packets/packet_spawn_star.c +++ b/src/pc/network/packets/packet_spawn_star.c @@ -3,6 +3,7 @@ #include "object_fields.h" #include "behavior_data.h" #include "src/game/behavior_actions.h" +#include "pc/lua/smlua_hooks.h" #include "pc/debuglog.h" extern struct Object* gCurrentObject; @@ -68,7 +69,7 @@ void network_receive_spawn_star(struct Packet* p) { void network_send_spawn_star_nle(struct Object* o, u32 params) { u8 globalIndex = UNKNOWN_GLOBAL_INDEX; - if (o->behavior == bhvMario) { + if (o->behavior == smlua_override_behavior(bhvMario)) { u8 localIndex = o->oBehParams - 1; globalIndex = gNetworkPlayers[localIndex].globalIndex; }