Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MorsGames
GitHub Repository: MorsGames/sm64plus
Path: blob/master/levels/bob/script.c
7858 views
1
#include <ultra64.h>
2
#include "sm64.h"
3
#include "behavior_data.h"
4
#include "model_ids.h"
5
#include "seq_ids.h"
6
#include "dialog_ids.h"
7
#include "segment_symbols.h"
8
#include "level_commands.h"
9
10
#include "game/level_update.h"
11
12
#include "levels/scripts.h"
13
14
#include "actors/common1.h"
15
16
#include "make_const_nonconst.h"
17
#include "levels/bob/header.h"
18
19
static const LevelScript script_func_local_1[] = {
20
OBJECT(/*model*/ MODEL_BOB_CHAIN_CHOMP_GATE, /*pos*/ 1456, 768, 446, /*angle*/ 0, 326, 0, /*behParam*/ 0x00000000, /*beh*/ bhvChainChompGate),
21
OBJECT(/*model*/ MODEL_BOB_SEESAW_PLATFORM, /*pos*/ -2303, 717, 1024, /*angle*/ 0, 45, 0, /*behParam*/ 0x00030000, /*beh*/ bhvSeesawPlatform),
22
OBJECT(/*model*/ MODEL_NONE, /*pos*/ -2050, 0, -3069, /*angle*/ 0, 25, 0, /*behParam*/ 0x00000000, /*beh*/ bhvOpenableGrill),
23
OBJECT(/*model*/ MODEL_PURPLE_SWITCH, /*pos*/ -2283, 0, -3682, /*angle*/ 0, 27, 0, /*behParam*/ 0x00000000, /*beh*/ bhvFloorSwitchGrills),
24
OBJECT(/*model*/ MODEL_CHECKERBOARD_PLATFORM, /*pos*/ 1612, 300, 4611, /*angle*/ 0, 0, 0, /*behParam*/ 0x00280000, /*beh*/ bhvCheckerboardElevatorGroup),
25
RETURN(),
26
};
27
28
static const LevelScript script_func_local_2[] = {
29
OBJECT_WITH_ACTS(/*model*/ MODEL_NONE, /*pos*/ 1535, 3840, -5561, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvBobBowlingBallSpawner, /*acts*/ ACT_1 | ACT_2),
30
OBJECT_WITH_ACTS(/*model*/ MODEL_NONE, /*pos*/ 1535, 3840, -5561, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvTtmBowlingBallSpawner, /*acts*/ ACT_3 | ACT_4 | ACT_5 | ACT_6),
31
OBJECT_WITH_ACTS(/*model*/ MODEL_NONE, /*pos*/ 524, 2825, -5400, /*angle*/ 0, 0, 0, /*behParam*/ 0x00020000, /*beh*/ bhvBobBowlingBallSpawner, /*acts*/ ACT_1 | ACT_2),
32
OBJECT_WITH_ACTS(/*model*/ MODEL_NONE, /*pos*/ 524, 2825, -5400, /*angle*/ 0, 0, 0, /*behParam*/ 0x00020000, /*beh*/ bhvTtmBowlingBallSpawner, /*acts*/ ACT_3 | ACT_4 | ACT_5 | ACT_6),
33
OBJECT (/*model*/ MODEL_BOWLING_BALL, /*pos*/ -993, 886, -3565, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvPitBowlingBall),
34
OBJECT (/*model*/ MODEL_BOWLING_BALL, /*pos*/ -785, 886, -4301, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvPitBowlingBall),
35
OBJECT_WITH_ACTS(/*model*/ MODEL_BOWLING_BALL, /*pos*/ -93, 886, -3414, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvPitBowlingBall, /*acts*/ ACT_2 | ACT_3 | ACT_4 | ACT_5 | ACT_6),
36
OBJECT_WITH_ACTS(/*model*/ MODEL_BOBOMB_BUDDY, /*pos*/ -5723, 140, 6017, /*angle*/ 0, 0, 0, /*behParam*/ DIALOG_002 << 16, /*beh*/ bhvBobombBuddy, /*acts*/ ACT_1),
37
OBJECT_WITH_ACTS(/*model*/ MODEL_BOBOMB_BUDDY, /*pos*/ -6250, 0, 6680, /*angle*/ 0, 0, 0, /*behParam*/ DIALOG_001 << 16, /*beh*/ bhvBobombBuddy, /*acts*/ ACT_1),
38
OBJECT_WITH_ACTS(/*model*/ MODEL_BOBOMB_BUDDY, /*pos*/ -5723, 140, 6017, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvBobombBuddyOpensCannon, /*acts*/ ACT_2 | ACT_3 | ACT_4 | ACT_5 | ACT_6),
39
OBJECT_WITH_ACTS(/*model*/ MODEL_BOBOMB_BUDDY, /*pos*/ -6250, 0, 6680, /*angle*/ 0, 0, 0, /*behParam*/ DIALOG_003 << 16, /*beh*/ bhvBobombBuddy, /*acts*/ ACT_2 | ACT_3 | ACT_4 | ACT_5 | ACT_6),
40
OBJECT_WITH_ACTS(/*model*/ MODEL_CANNON_BASE, /*pos*/ -5694, 128, 5600, /*angle*/ 0, 135, 0, /*behParam*/ 0x00010000, /*beh*/ bhvWaterBombCannon, /*acts*/ ACT_1),
41
OBJECT_WITH_ACTS(/*model*/ MODEL_DL_CANNON_LID, /*pos*/ -5694, 128, 5600, /*angle*/ 0, 180, 0, /*behParam*/ 0x00000000, /*beh*/ bhvCannonClosed, /*acts*/ ACT_2 | ACT_3 | ACT_4 | ACT_5 | ACT_6),
42
OBJECT_WITH_ACTS(/*model*/ MODEL_NONE, /*pos*/ 3304, 4242, -4603, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvKoopaRaceEndpoint, /*acts*/ ACT_2),
43
OBJECT_WITH_ACTS(/*model*/ MODEL_KOOPA_WITH_SHELL, /*pos*/ 3400, 770, 6500, /*angle*/ 0, 0, 0, /*behParam*/ 0x00010000, /*beh*/ bhvKoopa, /*acts*/ ACT_3 | ACT_4 | ACT_5 | ACT_6),
44
RETURN(),
45
};
46
47
static const LevelScript script_func_local_3[] = {
48
OBJECT_WITH_ACTS(/*model*/ MODEL_KING_BOBOMB, /*pos*/ 1636, 4242, -5567, /*angle*/ 0, -147, 0, /*behParam*/ 0x00000000, /*beh*/ bhvKingBobomb, /*acts*/ ACT_1),
49
OBJECT_WITH_ACTS(/*model*/ MODEL_KOOPA_WITH_SHELL, /*pos*/ -4004, 0, 5221, /*angle*/ 0, 0, 0, /*behParam*/ 0x01020000, /*beh*/ bhvKoopa, /*acts*/ ACT_2),
50
OBJECT_WITH_ACTS(/*model*/ MODEL_NONE, /*pos*/ -6000, 1000, 2400, /*angle*/ 0, 0, 0, /*behParam*/ 0x03000000, /*beh*/ bhvHiddenRedCoinStar, /*acts*/ ALL_ACTS),
51
OBJECT_WITH_ACTS(/*model*/ MODEL_NONE, /*pos*/ -6600, 1000, 1250, /*angle*/ 0, 0, 0, /*behParam*/ 0x04040000, /*beh*/ bhvHiddenStar, /*acts*/ ALL_ACTS),
52
OBJECT_WITH_ACTS(/*model*/ MODEL_STAR, /*pos*/ 1550, 1200, 300, /*angle*/ 0, 0, 0, /*behParam*/ 0x05000000, /*beh*/ bhvStar, /*acts*/ ALL_ACTS),
53
RETURN(),
54
};
55
56
const LevelScript level_bob_entry[] = {
57
INIT_LEVEL(),
58
LOAD_MIO0( /*seg*/ 0x07, _bob_segment_7SegmentRomStart, _bob_segment_7SegmentRomEnd),
59
LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _generic_mio0SegmentRomStart, _generic_mio0SegmentRomEnd),
60
LOAD_MIO0( /*seg*/ 0x0A, _water_skybox_mio0SegmentRomStart, _water_skybox_mio0SegmentRomEnd),
61
LOAD_MIO0( /*seg*/ 0x05, _group3_mio0SegmentRomStart, _group3_mio0SegmentRomEnd),
62
LOAD_RAW( /*seg*/ 0x0C, _group3_geoSegmentRomStart, _group3_geoSegmentRomEnd),
63
LOAD_MIO0( /*seg*/ 0x06, _group14_mio0SegmentRomStart, _group14_mio0SegmentRomEnd),
64
LOAD_RAW( /*seg*/ 0x0D, _group14_geoSegmentRomStart, _group14_geoSegmentRomEnd),
65
LOAD_MIO0( /*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd),
66
LOAD_RAW( /*seg*/ 0x0F, _common0_geoSegmentRomStart, _common0_geoSegmentRomEnd),
67
ALLOC_LEVEL_POOL(),
68
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
69
JUMP_LINK(script_func_global_1),
70
JUMP_LINK(script_func_global_4),
71
JUMP_LINK(script_func_global_15),
72
LOAD_MODEL_FROM_GEO(MODEL_BOB_BUBBLY_TREE, bubbly_tree_geo),
73
LOAD_MODEL_FROM_GEO(MODEL_BOB_CHAIN_CHOMP_GATE, bob_geo_000440),
74
LOAD_MODEL_FROM_GEO(MODEL_BOB_SEESAW_PLATFORM, bob_geo_000458),
75
LOAD_MODEL_FROM_GEO(MODEL_BOB_BARS_GRILLS, bob_geo_000470),
76
77
AREA(/*index*/ 1, bob_geo_000488),
78
JUMP_LINK(script_func_local_1),
79
JUMP_LINK(script_func_local_2),
80
JUMP_LINK(script_func_local_3),
81
OBJECT(/*model*/ MODEL_NONE, /*pos*/ -6558, 1000, 6464, /*angle*/ 0, 135, 0, /*behParam*/ 0x000A0000, /*beh*/ bhvSpinAirborneWarp),
82
OBJECT(/*model*/ MODEL_NONE, /*pos*/ 583, 2683, -5387, /*angle*/ 0, -154, 0, /*behParam*/ 0x000B0000, /*beh*/ bhvFadingWarp),
83
OBJECT(/*model*/ MODEL_NONE, /*pos*/ 1680, 3835, -5523, /*angle*/ 0, -153, 0, /*behParam*/ 0x000C0000, /*beh*/ bhvFadingWarp),
84
OBJECT(/*model*/ MODEL_NONE, /*pos*/ -6612, 1024, -3351, /*angle*/ 0, 107, 0, /*behParam*/ 0x000D0000, /*beh*/ bhvFadingWarp),
85
OBJECT(/*model*/ MODEL_NONE, /*pos*/ 1980, 768, 6618, /*angle*/ 0, -151, 0, /*behParam*/ 0x000E0000, /*beh*/ bhvFadingWarp),
86
WARP_NODE(/*id*/ 0x0A, /*destLevel*/ LEVEL_BOB, /*destArea*/ 0x01, /*destNode*/ 0x0A, /*flags*/ WARP_NO_CHECKPOINT),
87
WARP_NODE(/*id*/ 0x0B, /*destLevel*/ LEVEL_BOB, /*destArea*/ 0x01, /*destNode*/ 0x0C, /*flags*/ WARP_NO_CHECKPOINT),
88
WARP_NODE(/*id*/ 0x0C, /*destLevel*/ LEVEL_BOB, /*destArea*/ 0x01, /*destNode*/ 0x0B, /*flags*/ WARP_NO_CHECKPOINT),
89
WARP_NODE(/*id*/ 0x0D, /*destLevel*/ LEVEL_BOB, /*destArea*/ 0x01, /*destNode*/ 0x0E, /*flags*/ WARP_NO_CHECKPOINT),
90
WARP_NODE(/*id*/ 0x0E, /*destLevel*/ LEVEL_BOB, /*destArea*/ 0x01, /*destNode*/ 0x0D, /*flags*/ WARP_NO_CHECKPOINT),
91
WARP_NODE(/*id*/ 0xF0, /*destLevel*/ LEVEL_CASTLE, /*destArea*/ 0x01, /*destNode*/ 0x32, /*flags*/ WARP_NO_CHECKPOINT),
92
WARP_NODE(/*id*/ 0xF1, /*destLevel*/ LEVEL_CASTLE, /*destArea*/ 0x01, /*destNode*/ 0x64, /*flags*/ WARP_NO_CHECKPOINT),
93
TERRAIN(/*terrainData*/ bob_seg7_collision_level),
94
MACRO_OBJECTS(/*objList*/ bob_seg7_macro_objs),
95
SHOW_DIALOG(/*index*/ 0x00, DIALOG_000),
96
SET_BACKGROUND_MUSIC(/*settingsPreset*/ 0x0000, /*seq*/ SEQ_LEVEL_GRASS),
97
TERRAIN_TYPE(/*terrainType*/ TERRAIN_GRASS),
98
END_AREA(),
99
100
FREE_LEVEL_POOL(),
101
MARIO_POS(/*area*/ 1, /*yaw*/ 135, /*pos*/ -6558, 0, 6464),
102
CALL(/*arg*/ 0, /*func*/ lvl_init_or_update),
103
CALL_LOOP(/*arg*/ 1, /*func*/ lvl_init_or_update),
104
CLEAR_LEVEL(),
105
SLEEP_BEFORE_EXIT(/*frames*/ 1),
106
EXIT(),
107
};
108
109