Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
push_blocks.c
Go to the documentation of this file.
1#include "common.h"
2#include "entity.h"
3
5
6// outVars for values returned by FetchPushedBlockProperties
7// TODO fix ordering (swap XYZ, IJK)
8enum {
19};
20
21// values for BLOCK_PROP_RESULT
22enum {
26};
27
29 0.04, 0.04, 0.08, 0.16, 0.21, 0.4, 0.6, 0.72, 0.84, 0.92, 0.96, 0.96, 1.0,
30};
31
32API_CALLABLE(MovePlayerTowardBlock) {
33 PlayerStatus* playerStatus = &gPlayerStatus;
34
35 playerStatus->pos.x += (script->varTable[0] - playerStatus->pos.x) / 2;
36 playerStatus->pos.z += (script->varTable[2] - playerStatus->pos.z) / 2;
37
38 return ApiStatus_DONE2;
39}
40
41API_CALLABLE(UpdatePushBlockMotion) {
42 PlayerStatus* playerStatus = &gPlayerStatus;
43 Entity* entity = get_entity_by_index(script->varTable[11]);
44 f32 moveRatio;
45
46 if (isInitialCall) {
47 script->functionTemp[0] = 0;
48 script->varTable[0] = playerStatus->pos.x;
49 script->varTable[1] = playerStatus->pos.y;
50 script->varTable[2] = playerStatus->pos.z;
51 script->varTable[3] = entity->pos.x;
52 script->varTable[4] = entity->pos.y;
53 script->varTable[5] = entity->pos.z;
54 script->varTable[9] = entity->rot.x;
55 script->varTable[12] = entity->rot.z;
56 }
57
58 moveRatio = PushBlockMovePositions[script->functionTemp[0]];
59 playerStatus->pos.x = script->varTable[0] + (script->varTable[6] * moveRatio * BLOCK_GRID_SIZE);
60 playerStatus->pos.y = script->varTable[1] + (script->varTable[7] * moveRatio * BLOCK_GRID_SIZE);
61 playerStatus->pos.z = script->varTable[2] + (script->varTable[8] * moveRatio * BLOCK_GRID_SIZE);
62 entity->pos.x = script->varTable[3] + (script->varTable[6] * moveRatio * BLOCK_GRID_SIZE);
63 entity->pos.y = script->varTable[4] + (script->varTable[7] * moveRatio * BLOCK_GRID_SIZE);
64 entity->pos.z = script->varTable[5] + (script->varTable[8] * moveRatio * BLOCK_GRID_SIZE);
65
66 if (script->functionTemp[0] < 12) {
67 entity->rot.z = script->varTable[12] + (script->varTable[6] * moveRatio * -90.0f);
68 entity->rot.x = script->varTable[9] + (script->varTable[8] * moveRatio * 90.0f);
69 entity->pos.y = entity->pos.y + (sin_deg(moveRatio * 90.0f) * BLOCK_GRID_SIZE * 0.5);
70 entity->pos.x = entity->pos.x - (script->varTable[6] * sin_deg(moveRatio * 90.0f) * BLOCK_GRID_SIZE * 0.5);
71 entity->pos.z = entity->pos.z - (script->varTable[8] * sin_deg(moveRatio * 90.0f) * BLOCK_GRID_SIZE * 0.5);
72 } else {
73 entity->rot.z = entity->rot.x = 0.0f;
74 }
75
76 gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x;
77 gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y;
78 gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z;
79
80 script->functionTemp[0]++;
81 if (script->functionTemp[0] == ARRAY_COUNT(PushBlockMovePositions)) {
82 return ApiStatus_DONE1;
83 }
84 return ApiStatus_BLOCK;
85}
86
87API_CALLABLE(FinishPushBlockMotion) {
88 PushBlockGrid* grid = script->varTablePtr[10];
89 Entity* block = get_entity_by_index(script->varTable[11]);
90 f32 hitX, hitY, hitZ, hitDepth;
91 b32 hasCollision;
92 s32 i, j;
93
94 if (isInitialCall) {
95 script->functionTemp[0] = 0;
96 script->varTable[0] = block->pos.y;
97
98 hitX = block->pos.x;
99 hitZ = block->pos.z;
100 hitY = block->pos.y + 5.0f;
101
102 hitDepth = 35.0f;
103 hasCollision = npc_raycast_down_sides(0, &hitX, &hitY, &hitZ, &hitDepth);
104 script->functionTemp[1] = hitDepth;
105
106 if (hasCollision && hitDepth <= 6.0f) {
107 return ApiStatus_DONE2;
108 }
109 }
110
111 if (grid->dropCallback != NULL) {
112 if (grid->dropCallback(block, script)) {
113 i = (block->pos.x - grid->centerPos.x) / BLOCK_GRID_SIZE;
114 j = (block->pos.z - grid->centerPos.z) / BLOCK_GRID_SIZE;
115 grid->cells[i + (j * grid->numCellsX)] = 0;
116 return ApiStatus_DONE1;
117 } else {
118 return ApiStatus_BLOCK;
119 }
120 } else {
121 block->pos.y = script->varTable[0] - (PushBlockMovePositions[script->functionTemp[0]] * BLOCK_GRID_SIZE);
122 script->functionTemp[0]++;
123 if (script->functionTemp[0] != ARRAY_COUNT(PushBlockMovePositions)) {
124 return ApiStatus_BLOCK;
125 }
126 i = (block->pos.x - grid->centerPos.x) / BLOCK_GRID_SIZE;
127 j = (block->pos.z - grid->centerPos.z) / BLOCK_GRID_SIZE;
128 grid->cells[i + (j * grid->numCellsX)] = PUSH_GRID_EMPTY;
129 }
130 return ApiStatus_DONE1;
131}
132
133API_CALLABLE(FetchPushedBlockProperties) {
134 PushBlockGrid* grid = (PushBlockGrid*) script->varTable[10];
135 Entity* entity = get_entity_by_index(script->varTable[11]);
136 s32 gridCenterX, gridCenterY, gridCenterZ;
137 s32 xThing, yThing, zThing;
138 s32 entityX, entityY, entityZ;
139 s32 varX, varZ;
140 s32 deltaX, deltaZ;
141 s32 cellX, cellZ;
142 s32 x2, z2;
143
144 gridCenterX = grid->centerPos.x;
145 gridCenterY = grid->centerPos.y;
146 gridCenterZ = grid->centerPos.z;
147
148 xThing = gPlayerStatus.pos.x;
149 yThing = gPlayerStatus.pos.y;
150 zThing = gPlayerStatus.pos.z;
151
152 xThing -= gridCenterX;
153 yThing -= gridCenterY;
154 zThing -= gridCenterZ;
155
156 if (xThing < 0) {
157 xThing -= BLOCK_GRID_SIZE;
158 }
159 if (zThing < 0) {
160 zThing -= BLOCK_GRID_SIZE;
161 }
162
163 xThing /= BLOCK_GRID_SIZE;
164 yThing /= BLOCK_GRID_SIZE;
165 zThing /= BLOCK_GRID_SIZE;
166
167 varX = xThing;
168 varZ = zThing;
169
170 xThing *= BLOCK_GRID_SIZE;
171 yThing *= BLOCK_GRID_SIZE;
172 zThing *= BLOCK_GRID_SIZE;
173
174 xThing += (BLOCK_GRID_SIZE / 2) + gridCenterX;
175 yThing += gridCenterY;
176 zThing += (BLOCK_GRID_SIZE / 2) + gridCenterZ;
177
178 script->varTable[0] = xThing;
179 script->varTable[1] = yThing;
180 script->varTable[2] = zThing;
181
182 script->varTable[3] = entityX = entity->pos.x;
183 script->varTable[4] = entityY = entity->pos.y;
184 script->varTable[5] = entityZ = entity->pos.z;
185
186 xThing = entityX - grid->centerPos.x;
187 zThing = entityZ - grid->centerPos.z;
188 x2 = xThing / BLOCK_GRID_SIZE;
189 z2 = zThing / BLOCK_GRID_SIZE;
190
191 deltaX = x2 - varX;
192 deltaZ = z2 - varZ;
193
194 if (deltaX != 0 && deltaZ != 0) {
195 deltaX = deltaZ = 0;
196 }
197
198 script->varTable[6] = deltaX;
199 script->varTable[7] = 0;
200 script->varTable[8] = deltaZ;
201
202 cellX = x2 + deltaX;
203 cellZ = z2 + deltaZ;
204
205 if (deltaX == 0 && deltaZ == 0) {
206 script->varTable[9] = 2;
207 return ApiStatus_DONE2;
208 }
209
210 if (cellX < grid->numCellsX && cellX >= 0
211 && cellZ < grid->numCellsZ && cellZ >= 0
212 && grid->cells[cellX + (cellZ * grid->numCellsX)] == PUSH_GRID_EMPTY
214 {
215 script->varTable[9] = 0;
216 } else {
217 script->varTable[9] = 1;
218 }
219 return ApiStatus_DONE2;
220}
221
222API_CALLABLE(ClearPushedBlockFromGrid) {
223 PushBlockGrid* grid = script->varTablePtr[10];
224 Entity* block = get_entity_by_index(script->varTable[11]);
225 s32 ip, jp; // prev grid pos (i,j)
226 s32 in, jn; // next grid pos (i,j)
227
228 ip = ((s32)block->pos.x - grid->centerPos.x) / BLOCK_GRID_SIZE;
229 jp = ((s32)block->pos.z - grid->centerPos.z) / BLOCK_GRID_SIZE;
230 in = ip + script->varTable[6];
231 jn = jp + script->varTable[8];
232
233 grid->cells[in + (jn * grid->numCellsX)] = grid->cells[ip + (jp * grid->numCellsX)];
234 grid->cells[ip + (jp * grid->numCellsX)] = PUSH_GRID_EMPTY;
235
236 return ApiStatus_DONE2;
237}
238
239API_CALLABLE(CanPlayerPushBlock) {
240 PlayerStatus* playerStatus = &gPlayerStatus;
241 s32 blockCollider = script->varTable[11] + COLLISION_WITH_ENTITY_BIT;
242
243 if ((gCollisionStatus.pushingAgainstWall == blockCollider)
244 && (playerStatus->actionState == ACTION_STATE_PUSHING_BLOCK
245 || playerStatus->actionState == ACTION_STATE_WALK
246 || playerStatus->actionState == ACTION_STATE_RUN)
247 && !(playerStatus->animFlags & PA_FLAG_USING_WATT))
248 {
249 script->varTable[13] = TRUE;
250 } else {
251 script->varTable[13] = FALSE;
252 }
253
254 return ApiStatus_DONE2;
255}
256
257API_CALLABLE(CheckPlayerActionState) {
258 Bytecode* args = script->ptrReadPos;
259 Bytecode outVar = *args++;
260 s32 checkState = evt_get_float_variable(script, *args++);
261
262 evt_set_variable(script, outVar, gPlayerStatus.actionState == checkState);
263 return ApiStatus_DONE2;
264}
265
266API_CALLABLE(IsEventForSourceRunning) {
267 Bytecode* args = script->ptrReadPos;
268 Bytecode outVar = *args++;
269 Bytecode* sourceToFind = (Bytecode*)evt_get_variable(script, *args++);
270
271 s32 foundScript = FALSE;
272 s32 i;
273
274 for (i = 0; i < MAX_SCRIPTS; i++) {
275 Evt* iterScript = get_script_by_index(i);
276
277 if (iterScript != NULL) {
278 if (iterScript->ptrFirstLine == sourceToFind) {
279 foundScript = TRUE;
280 break;
281 }
282 }
283 }
284 evt_set_variable(script, outVar, foundScript);
285 return ApiStatus_DONE2;
286}
287
289 Set(LVarA, LVar0) // grid system
290 Set(LVarB, LVar1) // block entity ID
291 // check cell where the block will move to
292 Call(FetchPushedBlockProperties)
295 Call(MovePlayerTowardBlock)
296 EndIf
297 // try setting the player action state
298 Set(LVarC, 0)
299 Call(CheckPlayerActionState, LVarD, ACTION_STATE_RUN)
300 IfEq(LVarD, FALSE)
301 Call(CheckPlayerActionState, LVarD, ACTION_STATE_PUSHING_BLOCK)
302 IfEq(LVarD, FALSE)
303 Return
304 EndIf
305 EndIf
306 // cancel state change if the block can't be pushed
309 Return
310 EndIf
311 // wait for 8 frames of pushing
312 Set(LVarC, 0)
313 Label(0)
314 Add(LVarC, 1)
315 Call(CanPlayerPushBlock)
316 IfEq(LVarD, TRUE)
317 Goto(1)
318 EndIf
321 Return
322 EndIf
324 Return
325 Label(1)
327 Call(MovePlayerTowardBlock)
328 IfLt(LVarC, 8)
329 Wait(1)
330 Goto(0)
331 EndIf
332 // perform the push
333 Call(ClearPushedBlockFromGrid)
336 Call(UpdatePushBlockMotion)
337 Call(FinishPushBlockMotion)
338 Thread
339 Wait(2)
340 Call(CheckPlayerActionState, LVarD, ACTION_STATE_PUSHING_BLOCK)
341 IfNe(LVarD, FALSE)
342 Call(IsEventForSourceRunning, LVarD, Ref(EVS_PushWall_PushBlock))
343 IfEq(LVarD, FALSE)
345 EndIf
346 EndIf
349 Return
350 End
351};
352
353API_CALLABLE(CreatePushBlockGrid) {
354 Bytecode* arg = script->ptrReadPos;
355 s32 blockSystemID = evt_get_variable(script, *arg++);
356 s32 sizeNx = evt_get_variable(script, *arg++);
357 s32 sizeNz = evt_get_variable(script, *arg++);
358 s32 centerX = evt_get_variable(script, *arg++);
359 s32 centerY = evt_get_variable(script, *arg++);
360 s32 centerZ = evt_get_variable(script, *arg++);
361 u8* inputGridData = (u8*) evt_get_variable(script, *arg++);
362
363 PushBlockGrid* blockGrid;
364 u8* dataToCopy;
365 s32 i;
366
367 wPushBlockGrids[blockSystemID] = blockGrid = general_heap_malloc(sizeof(*blockGrid));
368
369 blockGrid->cells = general_heap_malloc(sizeNx*sizeNz);
370
371 if (inputGridData == NULL) {
372 for (i = 0; i < sizeNx*sizeNz; i++) {
373 blockGrid->cells[i] = 0;
374 }
375 } else {
376 dataToCopy = inputGridData;
377 for (i = 0; i < sizeNx*sizeNz; i++) {
378 blockGrid->cells[i] = dataToCopy[i];
379 }
380 }
381
382 blockGrid->numCellsX = sizeNx;
383 blockGrid->numCellsZ = sizeNz;
384 blockGrid->centerPos.x = centerX;
385 blockGrid->centerPos.y = centerY;
386 blockGrid->centerPos.z = centerZ;
387 blockGrid->dropCallback = NULL;
388
389 return ApiStatus_DONE2;
390}
391
392API_CALLABLE(SetPushBlock) {
393 Bytecode* args = script->ptrReadPos;
394 s32 blockSystemID = evt_get_variable(script, *args++);
395 s32 gridX = evt_get_variable(script, *args++);
396 s32 gridZ = evt_get_variable(script, *args++);
397 s32 occupant = evt_get_variable(script, *args++);
398
399 PushBlockGrid* blockGrid = wPushBlockGrids[blockSystemID];
400 s32 blockEntityID;
401 s32 cellIndex;
402
403 cellIndex = gridX + (gridZ * blockGrid->numCellsX);
404 ASSERT(cellIndex < blockGrid->numCellsX * blockGrid->numCellsZ);
405 blockGrid->cells[cellIndex] = occupant;
406
407 if (occupant == PUSH_GRID_BLOCK) {
408 s32 posX = blockGrid->centerPos.x + (gridX * BLOCK_GRID_SIZE) + (BLOCK_GRID_SIZE / 2);
409 s32 posY = blockGrid->centerPos.y;
410 s32 posZ = blockGrid->centerPos.z + (gridZ * BLOCK_GRID_SIZE) + (BLOCK_GRID_SIZE / 2);
411 blockEntityID = create_entity(&Entity_PushBlock, posX, posY, posZ, 0, 0, 0, 0, MAKE_ENTITY_END);
412 bind_trigger_1(&EVS_PushWall_PushBlock, TRIGGER_WALL_PUSH, blockEntityID + EVT_ENTITY_ID_BIT, (s32)blockGrid, blockEntityID, 3);
413 script->varTable[0] = blockEntityID;
414 }
415
416 return ApiStatus_DONE2;
417}
418
419API_CALLABLE(FillPushBlockX) {
420 Bytecode* args = script->ptrReadPos;
421 s32 blockSystemID = evt_get_variable(script, *args++);
422 s32 gridX = evt_get_variable(script, *args++);
423 s32 startZ = evt_get_variable(script, *args++);
424 s32 endZ = evt_get_variable(script, *args++);
425 s32 occupant = evt_get_variable(script, *args++);
426
427 PushBlockGrid* blockGrid = wPushBlockGrids[blockSystemID];
428 s32 blockEntityID;
429 s32 cellIndex;
430 s32 gridZ;
431
432 for (gridZ = startZ; gridZ <= endZ; gridZ++) {
433 cellIndex = gridX + (gridZ * blockGrid->numCellsX);
434 ASSERT(cellIndex < blockGrid->numCellsX * blockGrid->numCellsZ);
435 blockGrid->cells[cellIndex] = occupant;
436
437 if (occupant == PUSH_GRID_BLOCK) {
438 s32 posX = blockGrid->centerPos.x + (gridX * BLOCK_GRID_SIZE) + (BLOCK_GRID_SIZE / 2);
439 s32 posY = blockGrid->centerPos.y;
440 s32 posZ = blockGrid->centerPos.z + (gridZ * BLOCK_GRID_SIZE) + (BLOCK_GRID_SIZE / 2);
441 blockEntityID = create_entity(&Entity_PushBlock, posX, posY, posZ, 0, 0, 0, 0, MAKE_ENTITY_END);
442 bind_trigger_1(&EVS_PushWall_PushBlock, TRIGGER_WALL_PUSH, blockEntityID + EVT_ENTITY_ID_BIT, (s32)blockGrid, blockEntityID, 3);
443 script->varTable[0] = blockEntityID;
444 }
445 }
446
447 return ApiStatus_DONE2;
448}
449
450API_CALLABLE(FillPushBlockZ) {
451 Bytecode* args = script->ptrReadPos;
452 s32 blockSystemID = evt_get_variable(script, *args++);
453 s32 gridZ = evt_get_variable(script, *args++);
454 s32 startX = evt_get_variable(script, *args++);
455 s32 endX = evt_get_variable(script, *args++);
456 s32 occupant = evt_get_variable(script, *args++);
457
458 PushBlockGrid* blockGrid = wPushBlockGrids[blockSystemID];
459 s32 blockEntityID;
460 s32 cellIndex;
461 s32 gridX;
462
463 for (gridX = startX; gridX <= endX; gridX++) {
464 cellIndex = gridX + (gridZ * blockGrid->numCellsX);
465 ASSERT(cellIndex < blockGrid->numCellsX * blockGrid->numCellsZ);
466
467 blockGrid->cells[cellIndex] = occupant;
468
469 if (occupant == PUSH_GRID_BLOCK) {
470 s32 posX = blockGrid->centerPos.x + (gridX * BLOCK_GRID_SIZE) + (BLOCK_GRID_SIZE / 2);
471 s32 posY = blockGrid->centerPos.y;
472 s32 posZ = blockGrid->centerPos.z + (gridZ * BLOCK_GRID_SIZE) + (BLOCK_GRID_SIZE / 2);
473 blockEntityID = create_entity(&Entity_PushBlock, posX, posY, posZ, 0, 0, 0, 0, MAKE_ENTITY_END);
474 bind_trigger_1(&EVS_PushWall_PushBlock, TRIGGER_WALL_PUSH, blockEntityID + EVT_ENTITY_ID_BIT, (s32)blockGrid, blockEntityID, 3);
475 script->varTable[0] = blockEntityID;
476 }
477 }
478
479 return ApiStatus_DONE2;
480}
481
482API_CALLABLE(GetPushBlock) {
483 Bytecode* args = script->ptrReadPos;
484 s32 blockSystemID = evt_get_variable(script, *args++);
485 s32 gridX = evt_get_variable(script, *args++);
486 s32 gridZ = evt_get_variable(script, *args++);
487 s32 outVar = *args++;
488
489 PushBlockGrid* blockGrid = wPushBlockGrids[blockSystemID];
490 s32 cellIndex;
491
492 if (gridX >= blockGrid->numCellsX || gridX < 0 || gridZ >= blockGrid->numCellsZ || gridZ < 0) {
494 return;
495 }
496 cellIndex = gridX + (gridZ * blockGrid->numCellsX);
497 evt_set_variable(script, outVar, blockGrid->cells[cellIndex]);
498
499 return ApiStatus_DONE2;
500}
501
502API_CALLABLE(GetGridIndexFromPos) {
503 Bytecode* args = script->ptrReadPos;
504 s32 blockSystemID = evt_get_variable(script, *args++);
505 s32 posX = evt_get_variable(script, *args++);
506 s32 posY = evt_get_variable(script, *args++);
507 s32 posZ = evt_get_variable(script, *args++);
508 Bytecode outVarX = *args++;
509 Bytecode outVarZ = *args++;
510
511 PushBlockGrid* blockGrid = wPushBlockGrids[blockSystemID];
512 s32 gridX;
513 s32 gridZ;
514
515 posX -= blockGrid->centerPos.x;
516 gridX = posX / BLOCK_GRID_SIZE;
517 posZ -= blockGrid->centerPos.z;
518 gridZ = posZ / BLOCK_GRID_SIZE;
519
520 evt_set_variable(script, outVarX, gridX);
521 evt_set_variable(script, outVarZ, gridZ);
522
523 return ApiStatus_DONE2;
524}
525
526API_CALLABLE(SetPushBlockFallEffect) {
527 Bytecode* args = script->ptrReadPos;
528 s32 blockSystemID = evt_get_variable(script, *args++);
529 PushBlockFallCallback fallCallback = (PushBlockFallCallback)evt_get_variable(script, *args++);
530
531 wPushBlockGrids[blockSystemID]->dropCallback = fallCallback;
532
533 return ApiStatus_DONE2;
534}
s32(* PushBlockFallCallback)(Entity *block, Evt *script)
s32 b32
Bytecode EvtScript[]
Bytecode * ptrFirstLine
#define general_heap_malloc
#define npc_raycast_down_sides
#define sin_deg
#define ASSERT(condition)
EntityBlueprint Entity_PushBlock
Definition Block.c:786
#define BLOCK_GRID_SIZE
Definition entity.h:67
@ PUSH_GRID_BLOCK
Definition enums.h:2667
@ PUSH_GRID_EMPTY
Definition enums.h:2666
@ PUSH_GRID_OUT_OF_BOUNDS
Definition enums.h:2669
@ PA_FLAG_USING_WATT
Definition enums.h:3090
@ SOUND_PUSH_BLOCK
Definition enums.h:1429
@ ACTION_STATE_PUSHING_BLOCK
Definition enums.h:2448
@ ACTION_STATE_JUMP
Definition enums.h:2430
@ ACTION_STATE_IDLE
Definition enums.h:2426
@ ACTION_STATE_WALK
Definition enums.h:2427
@ ACTION_STATE_RUN
Definition enums.h:2428
@ TRIGGER_WALL_PUSH
Definition enums.h:2676
@ CAM_DEFAULT
Definition enums.h:1800
#define ApiStatus_DONE2
Definition evt.h:118
#define MAKE_ENTITY_END
Definition evt.h:107
s32 Bytecode
Definition evt.h:7
#define ApiStatus_DONE1
Definition evt.h:117
#define ApiStatus_BLOCK
Definition evt.h:116
Entity * get_entity_by_index(s32 index)
Definition entity.c:530
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
Evt * get_script_by_index(s32 index)
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
Definition evt.c:1847
f32 evt_get_float_variable(Evt *script, Bytecode var)
Definition evt.c:1930
s32 create_entity(EntityBlueprint *bp,...)
Definition entity.c:1195
Trigger * bind_trigger_1(EvtScript *script, s32 flags, s32 triggerFlagIndex, s32 triggerVar0, s32 triggerVar1, s32 priority)
f32 PushBlockMovePositions[]
Definition push_blocks.c:28
@ PUSH_BLOCK_INVALID
Definition push_blocks.c:25
@ PUSH_BLOCK_READY
Definition push_blocks.c:23
@ PUSH_BLOCK_OBSTRUCTED
Definition push_blocks.c:24
PushBlockGrid * wPushBlockGrids[8]
Definition script_list.c:64
EvtScript EVS_PushWall_PushBlock
@ BLOCK_PROP_I
Definition push_blocks.c:12
@ BLOCK_PROP_K
Definition push_blocks.c:14
@ BLOCK_PROP_DJ
Definition push_blocks.c:16
@ BLOCK_PROP_DK
Definition push_blocks.c:17
@ BLOCK_PROP_J
Definition push_blocks.c:13
@ BLOCK_PROP_Z
Definition push_blocks.c:11
@ BLOCK_PROP_DI
Definition push_blocks.c:15
@ BLOCK_PROP_RESULT
Definition push_blocks.c:18
@ BLOCK_PROP_X
Definition push_blocks.c:9
@ BLOCK_PROP_Y
Definition push_blocks.c:10
ApiStatus PlaySound(Evt *script, b32 isInitialCall)
ApiStatus GetPlayerActionState(Evt *script, b32 isInitialCall)
ApiStatus FacePlayerTowardPoint(Evt *script, b32 isInitialCall)
ApiStatus SetPlayerActionState(Evt *script, b32 isInitialCall)
ApiStatus DisablePlayerPhysics(Evt *script, b32 isInitialCall)
Disables player physics if disable is TRUE, enables it if FALSE.
#define LVar6
Definition macros.h:154
#define Ref(sym)
Address/pointer constant.
Definition macros.h:60
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#define IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
Definition macros.h:272
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Add(VAR, INT_VALUE)
Definition macros.h:376
#define COLLISION_WITH_ENTITY_BIT
Definition macros.h:152
#define MAX_SCRIPTS
Definition macros.h:90
#define Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define LVarC
Definition macros.h:160
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define IfLt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR < RVAR.
Definition macros.h:275
#define EVT_ENTITY_ID_BIT
An entity index.
Definition macros.h:132
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define LVar5
Definition macros.h:153
#define LVarB
Definition macros.h:159
#define LVar7
Definition macros.h:155
#define Thread
Marks the start of a thread block.
Definition macros.h:544
#define EndThread
Marks the end of a thread block.
Definition macros.h:547
#define LVar8
Definition macros.h:156
#define LVar2
Definition macros.h:150
#define LVar1
Definition macros.h:149
#define LVarA
Definition macros.h:158
#define LVarD
Definition macros.h:161
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define LVar9
Definition macros.h:157
#define NO_COLLIDER
Definition macros.h:156
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define LVar4
Definition macros.h:152
#define LVar3
Definition macros.h:151
#define LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217
Vec3f targetPos
CollisionStatus gCollisionStatus
Definition 7BB60.c:6
Camera gCameras[4]
Definition cam_main.c:17
PlayerStatus gPlayerStatus
Definition 77480.c:39