Files
HackerSM64/levels/pss/script.c
Denis Kopyrin ccb1419adb Split vanillla object from levels allowing pruning vanilla assets on fast64 imports and managing vanilla objects independently of levels (#796)
* Move level script to bank 0x1A

* Decouple vanilla objects in a separate bank

* Rollback group level scripts move, fixed nits

* Move actors_vanilla to actors/vanilla_actors

* Make EU translation segment last, remove vanilla objects segments copypaste

* Added LOAD_VANILLA_OBJECTS segment id stub
2025-01-29 20:58:46 -05:00

93 lines
7.8 KiB
C

#include <ultra64.h>
#include "sm64.h"
#include "behavior_data.h"
#include "model_ids.h"
#include "seq_ids.h"
#include "dialog_ids.h"
#include "segment_symbols.h"
#include "level_commands.h"
#include "game/level_update.h"
#include "levels/scripts.h"
#include "actors/common1.h"
#include "make_const_nonconst.h"
#include "levels/pss/header.h"
static const LevelScript script_pss_macro_objects[] = {
// Macro objects
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ -3233, 4688, -5600, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ -5636, 4331, -5054, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ -5980, 3453, 945, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ -2870, 2837, 2300, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ 3930, 274, 2425, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ 5174, 61, 3200, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ 5707, -128, 4565, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ 5194, -310, 5845, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ 3640, -543, 6450, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ 2550, -700, 6050, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ 1821, -921, 4616, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ -20, -2542, -6304, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ -1197, -2929, -4692, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ -2565, -3268, -3525, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ -4909, -3633, -4218, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ -6290, -3937, -2545, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_WOODEN_SIGNPOST, /*pos*/ 3580, 6140, -5180, /*angle*/ 0, 90, 0, /*behParam*/ (DIALOG_149 << 16), /*beh*/ bhvMessagePanel),
OBJECT(/*model*/ MODEL_NONE, /*pos*/ 3000, 6180, -5640, /*angle*/ 0, 90, 0, /*behParam*/ ((COIN_FORMATION_FLAG_NONE) << 16), /*beh*/ bhvCoinFormation),
OBJECT(/*model*/ MODEL_BLUE_COIN_SWITCH, /*pos*/ 5423, 6140, -6540, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvBlueCoinSwitch),
OBJECT(/*model*/ MODEL_BLUE_COIN, /*pos*/ 780, 5613, -5600, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvHiddenBlueCoin),
OBJECT(/*model*/ MODEL_BLUE_COIN, /*pos*/ 2360, 5979, -5600, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvHiddenBlueCoin),
OBJECT(/*model*/ MODEL_NONE, /*pos*/ 1880, -1440, 60, /*angle*/ 0, 0, 0, /*behParam*/ ((COIN_FORMATION_FLAG_NONE) << 16), /*beh*/ bhvCoinFormation),
OBJECT(/*model*/ MODEL_NONE, /*pos*/ 1860, -1760, -1720, /*angle*/ 0, 0, 0, /*behParam*/ ((COIN_FORMATION_FLAG_NONE) << 16), /*beh*/ bhvCoinFormation),
OBJECT(/*model*/ MODEL_NONE, /*pos*/ 1860, -1200, 1680, /*angle*/ 0, 0, 0, /*behParam*/ ((COIN_FORMATION_FLAG_NONE) << 16), /*beh*/ bhvCoinFormation),
OBJECT(/*model*/ MODEL_NONE, /*pos*/ 1860, -1220, 1700, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvHidden1upTrigger),
OBJECT(/*model*/ MODEL_NONE, /*pos*/ 1880, -1460, 80, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvHidden1upTrigger),
OBJECT(/*model*/ MODEL_NONE, /*pos*/ 1860, -1820, -1680, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvHidden1upTrigger),
OBJECT(/*model*/ MODEL_NONE, /*pos*/ -6380, -4550, 6320, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvHidden1upTrigger),
OBJECT(/*model*/ MODEL_1UP, /*pos*/ -6380, -4500, 5980, /*angle*/ 0, 0, 0, /*behParam*/ (4 << 16), /*beh*/ bhvHidden1up),
OBJECT(/*model*/ MODEL_1UP, /*pos*/ 1847, -961, 3863, /*angle*/ 0, 180, 0, /*behParam*/ 0x00000000, /*beh*/ bhv1upSliding),
OBJECT(/*model*/ MODEL_NONE, /*pos*/ 260, 2580, 2280, /*angle*/ 0, 90, 0, /*behParam*/ ((COIN_FORMATION_FLAG_NONE) << 16), /*beh*/ bhvCoinFormation),
OBJECT(/*model*/ MODEL_NONE, /*pos*/ -880, 2880, 2280, /*angle*/ 0, 90, 0, /*behParam*/ ((COIN_FORMATION_FLAG_NONE) << 16), /*beh*/ bhvCoinFormation),
OBJECT(/*model*/ MODEL_BLUE_COIN, /*pos*/ -809, 5245, -5600, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvHiddenBlueCoin),
OBJECT(/*model*/ MODEL_BLUE_COIN, /*pos*/ -2409, 4877, -5600, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvHiddenBlueCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ -6400, -4146, -590, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ -6400, -4335, 1409, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ -6400, -4530, 3481, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_BLUE_COIN, /*pos*/ -4445, 4490, -5536, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvHiddenBlueCoin),
OBJECT(/*model*/ MODEL_BLUE_COIN, /*pos*/ -6263, 4150, -4009, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvHiddenBlueCoin),
OBJECT(/*model*/ MODEL_YELLOW_COIN, /*pos*/ 1854, -2132, -4290, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOneCoin),
OBJECT(/*model*/ MODEL_EXCLAMATION_BOX, /*pos*/ -6385, -4200, 5770, /*angle*/ 0, 0, 0, /*behParam*/ (EXCLAMATION_BOX_BP_STAR_1 << 16), /*beh*/ bhvExclamationBox),
RETURN(),
};
const LevelScript level_pss_entry[] = {
INIT_LEVEL(),
#include "levels/pss/areas/script_vanilla_load.inc.c"
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
#include "levels/pss/areas/script_vanilla.inc.c"
AREA(/*index*/ 1, pss_geo_000100),
OBJECT(/*model*/ MODEL_NONE, /*pos*/ 5632, 6751, -5631, /*angle*/ 0, 270, 0, /*behParam*/ 0x000A0000, /*beh*/ bhvAirborneWarp),
WARP_NODE(/*id*/ 0x0A, /*destLevel*/ LEVEL_PSS, /*destArea*/ 0x01, /*destNode*/ 0x0A, /*flags*/ WARP_NO_CHECKPOINT),
WARP_NODE(/*id*/ 0xF3, /*destLevel*/ LEVEL_CASTLE, /*destArea*/ 0x01, /*destNode*/ 0x20, /*flags*/ WARP_NO_CHECKPOINT),
WARP_NODE(/*id*/ 0xF0, /*destLevel*/ LEVEL_CASTLE, /*destArea*/ 0x01, /*destNode*/ 0x26, /*flags*/ WARP_NO_CHECKPOINT),
WARP_NODE(/*id*/ 0xF1, /*destLevel*/ LEVEL_CASTLE, /*destArea*/ 0x01, /*destNode*/ 0x23, /*flags*/ WARP_NO_CHECKPOINT),
TERRAIN(/*terrainData*/ pss_seg7_collision),
JUMP_LINK(script_pss_macro_objects),
TERRAIN_TYPE(/*terrainType*/ TERRAIN_SLIDE),
SET_BACKGROUND_MUSIC(/*settingsPreset*/ 0x0001, /*seq*/ SEQ_LEVEL_SLIDE),
END_AREA(),
FREE_LEVEL_POOL(),
MARIO_POS(/*area*/ 1, /*yaw*/ 270, /*pos*/ 5632, 6451, -5631),
CALL(/*arg*/ 0, /*func*/ lvl_init_or_update),
CALL_LOOP(/*arg*/ 1, /*func*/ lvl_init_or_update),
CLEAR_LEVEL(),
SLEEP_BEFORE_EXIT(/*frames*/ 1),
EXIT(),
};