Document field_tasks

This commit is contained in:
GriffinR
2021-11-16 21:34:47 -05:00
parent 61aa9c3ba9
commit eb95ac0b9c
7 changed files with 716 additions and 526 deletions
+1 -1
View File
@@ -1298,7 +1298,7 @@
.byte 0xa5 .byte 0xa5
.endm .endm
@ Enables a function that gets called every step by Task_RunPerStepCallback. @
.macro setstepcallback subroutine:req .macro setstepcallback subroutine:req
.byte 0xa6 .byte 0xa6
.byte \subroutine .byte \subroutine
+4 -4
View File
@@ -117,10 +117,10 @@
#define MB_BRIDGE_OVER_POND_LOW 0x71 #define MB_BRIDGE_OVER_POND_LOW 0x71
#define MB_BRIDGE_OVER_POND_MED 0x72 #define MB_BRIDGE_OVER_POND_MED 0x72
#define MB_BRIDGE_OVER_POND_HIGH 0x73 #define MB_BRIDGE_OVER_POND_HIGH 0x73
#define MB_PACIFIDLOG_VERTICAL_LOG_1 0x74 #define MB_PACIFIDLOG_VERTICAL_LOG_TOP 0x74
#define MB_PACIFIDLOG_VERTICAL_LOG_2 0x75 #define MB_PACIFIDLOG_VERTICAL_LOG_BOTTOM 0x75
#define MB_PACIFIDLOG_HORIZONTAL_LOG_1 0x76 #define MB_PACIFIDLOG_HORIZONTAL_LOG_LEFT 0x76
#define MB_PACIFIDLOG_HORIZONTAL_LOG_2 0x77 #define MB_PACIFIDLOG_HORIZONTAL_LOG_RIGHT 0x77
#define MB_FORTREE_BRIDGE 0x78 #define MB_FORTREE_BRIDGE 0x78
#define MB_UNUSED_79 0x79 #define MB_UNUSED_79 0x79
#define MB_BRIDGE_OVER_POND_MED_EDGE_1 0x7A #define MB_BRIDGE_OVER_POND_MED_EDGE_1 0x7A
+12 -12
View File
@@ -183,18 +183,18 @@
// gTileset_Pacifidlog // gTileset_Pacifidlog
#define METATILE_Pacifidlog_Door 0x21A #define METATILE_Pacifidlog_Door 0x21A
#define METATILE_Pacifidlog_FloatingLogs_Horizontal0 0x250 #define METATILE_Pacifidlog_FloatingLogs_HorizontalLeft 0x250
#define METATILE_Pacifidlog_FloatingLogs_Horizontal1 0x251 #define METATILE_Pacifidlog_FloatingLogs_HorizontalRight 0x251
#define METATILE_Pacifidlog_HalfSubmergedLogs_Horizontal0 0x252 #define METATILE_Pacifidlog_HalfSubmergedLogs_HorizontalLeft 0x252
#define METATILE_Pacifidlog_HalfSubmergedLogs_Horizontal1 0x253 #define METATILE_Pacifidlog_HalfSubmergedLogs_HorizontalRight 0x253
#define METATILE_Pacifidlog_SubmergedLogs_Horizontal0 0x254 #define METATILE_Pacifidlog_SubmergedLogs_HorizontalLeft 0x254
#define METATILE_Pacifidlog_SubmergedLogs_Horizontal1 0x255 #define METATILE_Pacifidlog_SubmergedLogs_HorizontalRight 0x255
#define METATILE_Pacifidlog_FloatingLogs_Vertical0 0x258 #define METATILE_Pacifidlog_FloatingLogs_VerticalTop 0x258
#define METATILE_Pacifidlog_FloatingLogs_Vertical1 0x260 #define METATILE_Pacifidlog_FloatingLogs_VerticalBottom 0x260
#define METATILE_Pacifidlog_HalfSubmergedLogs_Vertical0 0x259 #define METATILE_Pacifidlog_HalfSubmergedLogs_VerticalTop 0x259
#define METATILE_Pacifidlog_HalfSubmergedLogs_Vertical1 0x261 #define METATILE_Pacifidlog_HalfSubmergedLogs_VerticalBottom 0x261
#define METATILE_Pacifidlog_SubmergedLogs_Vertical0 0x25A #define METATILE_Pacifidlog_SubmergedLogs_VerticalTop 0x25A
#define METATILE_Pacifidlog_SubmergedLogs_Vertical1 0x262 #define METATILE_Pacifidlog_SubmergedLogs_VerticalBottom 0x262
#define METATILE_Pacifidlog_SkyPillar_CrackedFloor_Hole 0x237 #define METATILE_Pacifidlog_SkyPillar_CrackedFloor_Hole 0x237
#define METATILE_Pacifidlog_SkyPillar_DoorOpen_Top 0x2AA #define METATILE_Pacifidlog_SkyPillar_DoorOpen_Top 0x2AA
#define METATILE_Pacifidlog_SkyPillar_DoorOpen_Bottom 0x2B2 #define METATILE_Pacifidlog_SkyPillar_DoorOpen_Bottom 0x2B2
+4 -4
View File
@@ -102,10 +102,10 @@ bool8 MetatileBehavior_IsShortGrass(u8);
bool8 MetatileBehavior_IsHotSprings(u8); bool8 MetatileBehavior_IsHotSprings(u8);
bool8 MetatileBehavior_IsWaterfall(u8); bool8 MetatileBehavior_IsWaterfall(u8);
bool8 MetatileBehavior_IsFortreeBridge(u8); bool8 MetatileBehavior_IsFortreeBridge(u8);
bool8 MetatileBehavior_IsPacifidlogVerticalLog1(u8); bool8 MetatileBehavior_IsPacifidlogVerticalLogTop(u8);
bool8 MetatileBehavior_IsPacifidlogVerticalLog2(u8); bool8 MetatileBehavior_IsPacifidlogVerticalLogBottom(u8);
bool8 MetatileBehavior_IsPacifidlogHorizontalLog1(u8); bool8 MetatileBehavior_IsPacifidlogHorizontalLogLeft(u8);
bool8 MetatileBehavior_IsPacifidlogHorizontalLog2(u8); bool8 MetatileBehavior_IsPacifidlogHorizontalLogRight(u8);
bool8 MetatileBehavior_IsPacifidlogLog(u8); bool8 MetatileBehavior_IsPacifidlogLog(u8);
bool8 MetatileBehavior_IsTrickHousePuzzleDoor(u8); bool8 MetatileBehavior_IsTrickHousePuzzleDoor(u8);
bool8 MetatileBehavior_IsRegionMap(u8); bool8 MetatileBehavior_IsRegionMap(u8);
+448 -257
View File
File diff suppressed because it is too large Load Diff
+16 -16
View File
@@ -126,10 +126,10 @@ static const u8 sTileBitAttributes[] =
[MB_BRIDGE_OVER_POND_LOW] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_BRIDGE_OVER_POND_LOW] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_BRIDGE_OVER_POND_MED] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_BRIDGE_OVER_POND_MED] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_BRIDGE_OVER_POND_HIGH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_BRIDGE_OVER_POND_HIGH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_PACIFIDLOG_VERTICAL_LOG_1] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_PACIFIDLOG_VERTICAL_LOG_TOP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_PACIFIDLOG_VERTICAL_LOG_2] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_PACIFIDLOG_VERTICAL_LOG_BOTTOM] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_PACIFIDLOG_HORIZONTAL_LOG_1] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_PACIFIDLOG_HORIZONTAL_LOG_LEFT] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_PACIFIDLOG_HORIZONTAL_LOG_2] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_PACIFIDLOG_HORIZONTAL_LOG_RIGHT] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_FORTREE_BRIDGE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_FORTREE_BRIDGE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_79] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), [MB_UNUSED_79] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_BRIDGE_OVER_POND_MED_EDGE_1] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_BRIDGE_OVER_POND_MED_EDGE_1] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
@@ -1131,33 +1131,33 @@ bool8 MetatileBehavior_IsFortreeBridge(u8 metatileBehavior)
return FALSE; return FALSE;
} }
bool8 MetatileBehavior_IsPacifidlogVerticalLog1(u8 metatileBehavior) bool8 MetatileBehavior_IsPacifidlogVerticalLogTop(u8 metatileBehavior)
{ {
if (metatileBehavior == MB_PACIFIDLOG_VERTICAL_LOG_1) if (metatileBehavior == MB_PACIFIDLOG_VERTICAL_LOG_TOP)
return TRUE; return TRUE;
else else
return FALSE; return FALSE;
} }
bool8 MetatileBehavior_IsPacifidlogVerticalLog2(u8 metatileBehavior) bool8 MetatileBehavior_IsPacifidlogVerticalLogBottom(u8 metatileBehavior)
{ {
if (metatileBehavior == MB_PACIFIDLOG_VERTICAL_LOG_2) if (metatileBehavior == MB_PACIFIDLOG_VERTICAL_LOG_BOTTOM)
return TRUE; return TRUE;
else else
return FALSE; return FALSE;
} }
bool8 MetatileBehavior_IsPacifidlogHorizontalLog1(u8 metatileBehavior) bool8 MetatileBehavior_IsPacifidlogHorizontalLogLeft(u8 metatileBehavior)
{ {
if (metatileBehavior == MB_PACIFIDLOG_HORIZONTAL_LOG_1) if (metatileBehavior == MB_PACIFIDLOG_HORIZONTAL_LOG_LEFT)
return TRUE; return TRUE;
else else
return FALSE; return FALSE;
} }
bool8 MetatileBehavior_IsPacifidlogHorizontalLog2(u8 metatileBehavior) bool8 MetatileBehavior_IsPacifidlogHorizontalLogRight(u8 metatileBehavior)
{ {
if (metatileBehavior == MB_PACIFIDLOG_HORIZONTAL_LOG_2) if (metatileBehavior == MB_PACIFIDLOG_HORIZONTAL_LOG_RIGHT)
return TRUE; return TRUE;
else else
return FALSE; return FALSE;
@@ -1165,10 +1165,10 @@ bool8 MetatileBehavior_IsPacifidlogHorizontalLog2(u8 metatileBehavior)
bool8 MetatileBehavior_IsPacifidlogLog(u8 metatileBehavior) bool8 MetatileBehavior_IsPacifidlogLog(u8 metatileBehavior)
{ {
if (metatileBehavior == MB_PACIFIDLOG_VERTICAL_LOG_1 if (metatileBehavior == MB_PACIFIDLOG_VERTICAL_LOG_TOP
|| metatileBehavior == MB_PACIFIDLOG_VERTICAL_LOG_2 || metatileBehavior == MB_PACIFIDLOG_VERTICAL_LOG_BOTTOM
|| metatileBehavior == MB_PACIFIDLOG_HORIZONTAL_LOG_1 || metatileBehavior == MB_PACIFIDLOG_HORIZONTAL_LOG_LEFT
|| metatileBehavior == MB_PACIFIDLOG_HORIZONTAL_LOG_2) || metatileBehavior == MB_PACIFIDLOG_HORIZONTAL_LOG_RIGHT)
return TRUE; return TRUE;
else else
return FALSE; return FALSE;
+4 -5
View File
@@ -1214,9 +1214,11 @@ void SecretBasePerStepCallback(u8 taskId)
tState = 1; tState = 1;
break; break;
case 1: case 1:
// End if player hasn't moved
PlayerGetDestCoords(&x, &y); PlayerGetDestCoords(&x, &y);
if (x != tPlayerX || y != tPlayerY) if (x == tPlayerX && y == tPlayerY)
{ return;
tPlayerX = x; tPlayerX = x;
tPlayerY = y; tPlayerY = y;
VarSet(VAR_SECRET_BASE_STEP_COUNTER, VarGet(VAR_SECRET_BASE_STEP_COUNTER) + 1); VarSet(VAR_SECRET_BASE_STEP_COUNTER, VarGet(VAR_SECRET_BASE_STEP_COUNTER) + 1);
@@ -1225,10 +1227,8 @@ void SecretBasePerStepCallback(u8 taskId)
if (tileId == METATILE_SecretBase_SolidBoard_Top || tileId == METATILE_SecretBase_SolidBoard_Bottom) if (tileId == METATILE_SecretBase_SolidBoard_Top || tileId == METATILE_SecretBase_SolidBoard_Bottom)
{ {
if (sInFriendSecretBase == TRUE) if (sInFriendSecretBase == TRUE)
{
VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_SOLID_BOARD); VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_SOLID_BOARD);
} }
}
else if (tileId == METATILE_SecretBase_SmallChair else if (tileId == METATILE_SecretBase_SmallChair
|| tileId == METATILE_SecretBase_PokemonChair || tileId == METATILE_SecretBase_PokemonChair
|| tileId == METATILE_SecretBase_HeavyChair || tileId == METATILE_SecretBase_HeavyChair
@@ -1316,7 +1316,6 @@ void SecretBasePerStepCallback(u8 taskId)
if (sInFriendSecretBase == TRUE) if (sInFriendSecretBase == TRUE)
VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_SPIN_MAT); VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | SECRET_BASE_USED_SPIN_MAT);
} }
}
break; break;
case 2: case 2:
// This state is never reached, and tFldEff is never set // This state is never reached, and tFldEff is never set