Some cleanup, start sprite documentation

This commit is contained in:
YohannDR 2024-08-19 21:29:36 +02:00
parent af9ad10699
commit df69e5af72
121 changed files with 3864 additions and 3656 deletions

View File

@ -9,7 +9,7 @@ The following table describes the convertion between them :
| 4 | 1 | 0.0625 |
| 64 | 16 | 1 |
Conversions can be made between each unit with simple multiplciation and division, however there are macros defined in [macros.h](../../include/macros.h) that can be used to do the conversions.
Conversions can be made between each unit with simple multiplication and division, however there are macros defined in [macros.h](../../include/macros.h#L165) that can be used to do the conversions.
Most of the coordinates used in the game are in sub-pixel units (position, hitboxes).
There are a few coordinates that are in block units (doors, hatches).

112
docs/engine/sprites.md Normal file
View File

@ -0,0 +1,112 @@
# Sprites
A sprite refers broadly to entities during gameplay that aren't one of the following :
- Samus
- Samus projectiles
- Sprite debris
- Particles
They mostly consist of enemies, gimmicks or triggers placed in a room.\
Their AI can be found in the `sprites_AI` folders, both in `include` and `src`, with their data being in `include/data/sprites` and `src/data/sprites`.
## Sprite data
`SpriteData` is a struct that contains everything needed for a sprite to work, it is located in [include/structs/sprite.h](../../include/structs/sprite.h#L42).
Here's a detailed explanation of each field :\
Note :
- A **bolded** field name indicates that it's used internally by the engine.
- An *italic* field name indicates that its usage may vary between sprite AI.
| Name | Full name | Type | Explanation |
|---------|-------------|------|-------------|
| **status** | Status | `u16` | A collection of bit flags that affect the behavior of sprite, or provide information on its current state. For more detail on each flag, view the [sprite status](#status) section.
| **yPosition** | Y Position | `u16` | Current Y position of the sprite.
| **xPosition** | X Position | `u16` | Current X position of the sprite.
| *yPositionSpawn* | Y Position Spawn | `u16` | The Y position of the sprite when it spawned.
| *xPositionSpawn* | X Position Spawn | `u16` | The X position of the sprite when it spawned.
| **hitboxTop** | Hitbox top offset | `s16` | How far from the Y position the hitbox extends upwards.
| **hitboxBottom** | Hitbox bottom offset | `s16` | How far from the Y position the hitbox extends downwards.
| **hitboxLeft** | Hitbox left offset | `s16` | How far from the X position the hitbox extends left.
| **hitboxRight** | Hitbox right offset | `s16` | How far from the X position the hitbox extends right.
| **scaling** | Oam scaling | `u16` | Oam scaling, uses Q8.8 fixed point format. Only used by the engine if scaling is enabled in any way, otherwise unused.
| **health** | Health | `u16` | Current health of the sprite.
| **currentAnimationFrame** | Current animation frame | `u16` | Current animation frame.
| **pOam** | Frame data pointer | `const struct FrameData*` | Pointer to the current animation.
| **animationDurationCounter** | Animation duration counter | `u8` | How long the current animation frame has been on.
| **spriteId** | Sprite ID | `u8` | Identifies which sprite this sprite data is, primary and secondary sprites use different enums.
| **roomSlot** | Room slot/part number | `u8` | If the sprite is one that spawns with the room, then this field contains the slot in which the sprite was (depends on the placement order). Otherwise it contains the part number, which is used to have the same sprite behave differently (boss parts, different movement patterns...).
| **spritesetGfxSlot** | Spriteset graphics slot | `u8` | On which graphics row the sprite graphics and palette begin.
| **paletteRow** | Palette row | `u8` | Which palette row should be used to draw the sprite.
| **bgPriority** | Background priority | `u8` | Determines the [hardware background priority](https://problemkaputt.de/gbatek.htm#lcdobjoamattributes).
| **drawOrder** | Draw order | `u8` | Determines the draw order between sprites, the minimum value is 1 and the maximum is 16. There also seems to be 2 groups (1 to 8 and 9 to 16), however it's unknown how that affects draw order.
| **primarySpriteRamSlot** | Primary sprite ram/array slot | `u8` | If the sprite is a primary sprite, then this field contains it's index in the global sprite table. If it's a secondary sprite, then it should contains the index in the global sprite table of the parent primary sprite.
| **pose** | Pose/behavior | `u8` | What behavior the sprite is currently on, some values have [special meaning](#poses), otherwise most are free.
| **samusCollision** | Samus collision type | `u8` | Determines how the collision between the sprite and Samus should behave.
| **ignoreSamusCollisionTimer** | Ignore samus collision timer | `u8` | Decrementing timer that makes the sprite ignore collision with Samus.
| **drawDistanceTop** | Draw distance top offset | `u8` | In pixels, how far the sprite extends visually upwards, used to determine whether it's on screen or not.
| **drawDistanceBottom** | Draw distance bottom offset | `u8` | In pixels, how far the sprite extends visually downwards, used to determine whether it's on screen or not.
| **drawDistanceHorizontal** | Draw distance horizontal offset | `u8` | In pixels, how far the sprite extends visually sidewards, used to determine whether it's on screen or not.
| **rotation** | Oam rotation | `u8` | Oam rotation, uses Q8.8 fixed point format (only the decimal part matters). Only used by the engine if rotation is enabled in any way, otherwise unused.
| **invincibilityStunFlashTimer** | Invincibility/stun/flash timer | `u8` | Invincibility/stun/flash timer for the sprite, special values can also be used to determine if the sprite was hit and was immune.
| ***work0*** | Work variable 0 | `u8` | Free slot variable, used by some generic sprite util functions (the movement ones), otherwise free to use.
| ***work1*** | Work variable 1 | `u8` | Free slot variable, used by some generic sprite util functions (the movement ones), otherwise free to use.
| ***work2*** | Work variable 2 | `u8` | Free slot variable, used by some generic sprite util functions (the movement ones), otherwise free to use.
| ***work3*** | Work variable 3 | `u8` | Free slot variable, used by some generic sprite util functions (the movement ones), otherwise free to use.
| **freezeTimer** | Freeze timer | `u8` | Timer for how long the sprite is freezed, it isn't automatically updated by the engine, sprite util functions need to be called by the AI.
| **standingOnSprite** | Samus standing on sprite status | `u8` | Whether samus is standing on the sprite or not.
| **properties** | Property flags | `u8` | A collection of bit flags that affect the behavior of sprite, or provide information on its current state. For more detail on each flag, view the [sprite properties](#properties) section.
| **frozenPaletteRowOffset** | Frozen/stunned palette row offset | `u8` | How much palette row to offset to determine the new row to use when the sprite is frozen/stunned.
| **absolutePaletteRow** | Absolute palette row | `u8` | Backup palette row to use when flickering during stun or freeze.
## Status
| Name | Value | Explanation |
|---------|-------|-------------|
| SPRITE_STATUS_EXISTS | 1 << 0 | Whether the sprite exists or not.
| SPRITE_STATUS_ONSCREEN | 1 << 1 | Whether the sprite is currently visible on screen.
| SPRITE_STATUS_NOT_DRAWN | 1 << 2 | Whether the sprite should be drawn.
| SPRITE_STATUS_ROTATION_SCALING | 1 << 3 | Enables affine transformation when drawing the sprite.
| SPRITE_STATUS_UNKNOWN_10 | 1 << 4 | Unknown purpose, related to draw order.
| SPRITE_STATUS_MOSAIC | 1 << 5 | Whether mosaic is enabled, left over from fusion, doesn't seem to work properly.
| SPRITE_STATUS_XFLIP | 1 << 6 | Whether the sprite is X-flipped when drawn.
| SPRITE_STATUS_UNKNOWN_80 | 1 << 7 | Unknown purpose, related to obj affine.
| SPRITE_STATUS_YFLIP | 1 << 8 | Whether the sprite is Y-flipped when drawn.
| SPRITE_STATUS_FACING_RIGHT | 1 << 9 | Whether the sprite is facing right, purely informative and only used in the engine in the movement functions.
| SPRITE_STATUS_FACING_DOWN | 1 << 10 | Whether the sprite is facing down, purely informative and only used in the engine in the movement functions.
| SPRITE_STATUS_SAMUS_COLLIDING | 1 << 11 | Whether the sprite is colliding with Samus, only used on some [sprite/samus collision](#samus-collision).
| SPRITE_STATUS_SAMUS_ON_TOP | 1 << 12 | Whether Samus is on top of the sprite.
| SPRITE_STATUS_ALPHA_BLENDING | 1 << 13 | Whether the sprite is flagged [semi transparent](https://problemkaputt.de/gbatek.htm#lcdobjoverview).
| SPRITE_STATUS_DOUBLE_SIZE | 1 << 14 | Whether the sprite is flagged [double size](https://problemkaputt.de/gbatek.htm#lcdobjoverview) is affine mode is enabled.
| SPRITE_STATUS_IGNORE_PROJECTILES | 1 << 15 | Whether the sprite ignores projectile collision.
## Properties
| Name | Value | Explanation |
|---------|-------|-------------|
| SP_ALWAYS_ACTIVE | 1 << 0 | Whether the sprite is active even during periods when sprites aren't updated.
| SP_DAMAGED | 1 << 1 | Whether the sprite was damaged.
| SP_KILL_OFF_SCREEN | 1 << 2 | Whether the sprite should be destroyed if it reaches far enough off-screen.
| SP_SOLID_FOR_PROJECTILES | 1 << 3 | Whether the sprite is solid for projectiles.
| SP_DESTROYED | 1 << 4 | Whether the sprite is destroyed.
| SP_ABSOLUTE_POSITION | 1 << 5 | Whether the position of the sprite should ignore scrolling and be considered direct screen space coordinates.
| SP_IMMUNE_TO_PROJECTILES | 1 << 6 | Whether the sprite is immune to projectiles.
| SP_SECONDARY_SPRITE | 1 << 7 | Whether the sprite is a secondary sprite.
## Poses
Most of the pose values are free to use, however there are a few that have a particular meaning :
| Name | Value | Explanation |
|---------|-------|-------------|
| SPRITE_POSE_UNINITIALIZED | 0 | The sprite was just created and hasn't been initialized yet.
| SPRITE_POSE_STOPPED | 0x42 | The sprite has come into contact with Samus and has a "XXX when hit" samus/sprite collision type.
| SPRITE_POSE_DESTROYED | 0x62 | The sprite has reached 0 health.
| SPRITE_POSE_SHINESPARK_DESTROYED | 0x63 | The sprite was killed with a shinespark.
| SPRITE_POSE_SPEEDBOOSTER_DESTROYED | 0x64 | The sprite was killed with speedbooster.
| SPRITE_POSE_SCREW_ATTACK_DESTROYED | 0x65 | The sprite was killed with screw attack.
| SPRITE_POSE_SUDO_SCREW_DESTROYED | 0x66 | The sprite was killed with sudo screw.
## Samus collision
**TODO**

View File

@ -126,10 +126,14 @@
#define SOUND_ELEVATOR 0x10E
#define SOUND_CHOZO_STATUE_REFILL 0x10F
#define SOUND_CHOZO_STATUE_HINT 0x11B
#define SOUND_CHOZO_BALL_REVEALING 0x11D
#define SOUND_RIPPER_DAMAGED 0x149
#define SOUND_DRAGON_DAMAGED 0x14D
#define SOUND_BARISTUTE_JUMP_WARNING 0x18C
#define SOUND_BARISTUTE_JUMPING 0x18D
#define SOUND_BARISTUTE_LANDING 0x18E

View File

@ -1,6 +1,10 @@
#define SAMUS_CURSOR_ACTION_LOADING 0
#define SAMUS_CURSOR_ACTION_MOVING 1
#define SAMUS_CURSOR_ACTION_SELECTING 2
enum GameOverCursorAction {
SAMUS_CURSOR_ACTION_LOADING,
SAMUS_CURSOR_ACTION_MOVING,
SAMUS_CURSOR_ACTION_SELECTING,
SAMUS_CURSOR_ACTION_END
};
#define GAME_OVER_OAM_ID_SUIT_MOVING 1
#define GAME_OVER_OAM_ID_SUIT_LOADING 2

View File

@ -6,7 +6,11 @@
#define IGC_STARTED_FLAG 0x80
#define IGC_NO_STARTED_FLAG 0x7F
#define BG_FLASH_SLIGHT_YELLOW 0
#define BG_FLASH_CHOZO_LONG_TRANSPARENCY 1
#define BG_FLASH_HEAVY_YELLOW 2
#define BG_FLASH_QUICK_YELLOW 3
enum BackgroundFlash {
BG_FLASH_SLIGHT_YELLOW,
BG_FLASH_CHOZO_LONG_TRANSPARENCY,
BG_FLASH_HEAVY_YELLOW,
BG_FLASH_QUICK_YELLOW,
BG_FLASH_END
};

View File

@ -21,9 +21,13 @@
#define SMF_ALL_SUITS (SMF_VARIA_SUIT | SMF_GRAVITY_SUIT)
#define SUIT_NORMAL 0x0
#define SUIT_FULLY_POWERED 0x1
#define SUIT_SUITLESS 0x2
enum SamusSuit {
SUIT_NORMAL,
SUIT_FULLY_POWERED,
SUIT_SUITLESS,
SUIT_END,
};
#define DIAG_AIM_NONE 0x0
#define DIAG_AIM_UP 0x1
@ -116,7 +120,7 @@ enum SamusPose {
SPOSE_NONE = UCHAR_MAX
};
enum StandingStatus {
enum SamusStandingStatus {
STANDING_GROUND,
STANDING_ENEMY,
STANDING_MIDAIR,

View File

@ -11,7 +11,7 @@
#define SPRITE_STATUS_UNKNOWN_80 (1 << 7)
#define SPRITE_STATUS_YFLIP (1 << 8)
#define SPRITE_STATUS_FACING_RIGHT (1 << 9)
#define SPRITE_STATUS_UNKNOWN_400 (1 << 10)
#define SPRITE_STATUS_FACING_DOWN (1 << 10)
#define SPRITE_STATUS_SAMUS_COLLIDING (1 << 11)
#define SPRITE_STATUS_SAMUS_ON_TOP (1 << 12)
#define SPRITE_STATUS_ALPHA_BLENDING (1 << 13)
@ -362,6 +362,14 @@ enum SamusSpriteCollision {
SSC_END
};
enum SamusStandingOnSpriteStatus {
SAMUS_STANDING_ON_SPRITE_OFF,
SAMUS_STANDING_ON_SPRITE_RELEASING,
SAMUS_STANDING_ON_SPRITE_ON,
SAMUS_STANDING_ON_SPRITE_END
};
#define WEAKNESS_NONE 0
#define WEAKNESS_CHARGE_BEAM_PISTOL (1 << 0)

View File

@ -36,7 +36,7 @@ extern const struct MultiSpriteData sChozoStatueMultiSpriteData_Seated[2];
extern const u8 sChozoStatueFlashingPaletteRows[4];
extern const u32 sChozoStatueLongBeamGfx[1335];
extern const u16 sChozoStatueLongBeamPal[80];
extern const u16 sChozoStatueLongBeamPal[80];
extern const struct FrameData sChozoStatuePartOam_LegStanding[2];

View File

@ -9,52 +9,20 @@ extern const s16 sDragonFireballYMovement[40];
extern const s16 sDragonFireballOamRotation[40];
extern const u32 sDragonGfx[512];
extern const u16 sDragonPal[32];
extern const u16 sDragonPal[16 * 2];
extern const u16 sDragonOAM_Spitting_Frame0[7];
extern const struct FrameData sDragonOam_Idle[4];
extern const u16 sDragonOAM_Spitting_Frame1[7];
extern const struct FrameData sDragonOam_Warning[3];
extern const u16 sDragonOAM_Idle_Frame0[7];
extern const struct FrameData sDragonOam_Spitting[3];
extern const u16 sDragonOAM_Idle_Frame1[7];
extern const struct FrameData sDragonOam_TurningAround[3];
extern const u16 sDragonOAM_Idle_Frame2[13];
extern const struct FrameData sDragonOam_TurningAroundPart2[3];
extern const u16 sDragonOAM_TurningAround_Frame0[7];
extern const struct FrameData sDragonFireballOam_Moving[4];
extern const u16 sDragonOAM_TurningAround_Frame1[7];
extern const struct FrameData sDragonFireballOam_Exploding[5];
extern const u16 sDragonOAM_Unused_0[7];
extern const u16 sDragonOAM_Unused_1[7];
extern const u16 sDragonFireballOAM_Moving_Frame0[4];
extern const u16 sDragonFireballOAM_Moving_Frame1[4];
extern const u16 sDragonFireballOAM_Moving_Frame2[4];
extern const u16 sDragonFireballOAM_Exploding_Frame0[4];
extern const u16 sDragonFireballOAM_Exploding_Frame1[4];
extern const u16 sDragonFireballOAM_Exploding_Frame2[4];
extern const u16 sDragonFireballOAM_Exploding_Frame3[4];
extern const struct FrameData sDragonOAM_Idle[4];
extern const struct FrameData sDragonOAM_Warning[3];
extern const struct FrameData sDragonOAM_Spitting[3];
extern const struct FrameData sDragonOAM_TurningAround[3];
extern const struct FrameData sDragonOAM_TurningAroundPart2[3];
extern const struct FrameData sDragonFireballOAM_Moving[4];
extern const struct FrameData sDragonFireballOAM_Exploding[5];
#endif
#endif /* DRAGON_DATA_H */

View File

@ -27,7 +27,7 @@ void SpriteUtilMakeSpriteFaceAwayFromSamusXFlip(void);
void SpriteUtilMakeSpriteFaceAwayFromSamusDirection(void);
void unk_f978(s16 movement);
void unk_f9e4(s16 movement);
u8 SpriteUtilMakeSpriteFaceSamusRotation(s32 oamRotation, s32 targetY, s32 targetX, s32 spriteY, s32 spriteX);
u8 SpriteUtilMakeSpriteFaceSamusRotation(s32 rotation, s32 targetY, s32 targetX, s32 spriteY, s32 spriteX);
u32 SpriteUtilCheckEndCurrentSpriteAnim(void);
u32 SpriteUtilCheckNearEndCurrentSpriteAnim(void);
u8 SpriteUtilCheckEndSpriteAnim(u8 ramSlot);

View File

@ -3,10 +3,12 @@
#include "types.h"
#define CHOZO_STATUE_BEHAVIOR_ITEM 0x0
#define CHOZO_STATUE_BEHAVIOR_REFILL 0x1
#define CHOZO_STATUE_BEHAVIOR_HINT 0x2
#define CHOZO_STATUE_BEHAVIOR_HINT_TAKEN 0x3
enum ChozoStatueBehavior {
CHOZO_STATUE_BEHAVIOR_ITEM,
CHOZO_STATUE_BEHAVIOR_REFILL,
CHOZO_STATUE_BEHAVIOR_HINT,
CHOZO_STATUE_BEHAVIOR_HINT_TAKEN,
};
#define CHOZO_STATUE_POSE_IDLE 0x9
#define CHOZO_STATUE_POSE_DO_NOTHING 0xF
@ -34,9 +36,6 @@ enum ChozoStatuePart {
CHOZO_STATUE_PART_END
};
#define CHOZO_STATUE_HAND_X_OFFSET 0x38
#define CHOZO_STATUE_HAND_Y_OFFSET 0x11
#define CHOZO_STATUE_PART_POSE_ARM_CHECK_GRAB_SAMUS_HINT 0x9
#define CHOZO_STATUE_PART_POSE_LEG_IDLE 0xF
#define CHOZO_STATUE_PART_POSE_ARM_SITTING 0x23
@ -59,6 +58,7 @@ enum ChozoStatuePart {
#define CHOZO_BALL_POSE_GETTING 0x23
#define CHOZO_BALL_POSE_REVEALING 0x67
#ifndef CHOZO_STATUE_IGNORE_FUNCTIONS
void ChozoStatueSyncSubSprites(void);
void ChozoStatueRegisterItem(u8 spriteId);
void ChozoStatueSetDirection(void);
@ -95,5 +95,6 @@ void ChozoStatuePartLegIdle(void);
void ChozoStatue(void);
void ChozoStatuePart(void);
void ChozoStatueRefill(void);
#endif /* CHOZO_STATUE_IGNORE_FUNCTIONS */
#endif /* CHOZO_STATUE_AI_H */

View File

@ -18,10 +18,10 @@
void DragonYMovement(void);
void DragonInit(void);
void DragonIdleInit(void);
void DragonGoUp(void);
void DragonIdle(void);
void DragonTurningAroundInit(void);
void DragonCheckTurningAroundFirstHalfAnimEnded(void);
void DragonCheckTurningAroundSecondHalfAnimEnded(void);
void DragonTurningAroundFirstHalf(void);
void DragonTurningAroundSecondHalf(void);
void DragonWarningInit(void);
void DragonWarning(void);
void DragonSpit(void);

View File

@ -3,11 +3,6 @@
#include "types.h"
#define UNKNOWN_ITEM_CHOZO_STATUE_BEHAVIOR_ITEM 0x0
#define UNKNOWN_ITEM_CHOZO_STATUE_BEHAVIOR_REFILL 0x1
#define UNKNOWN_ITEM_CHOZO_STATUE_BEHAVIOR_HINT 0x2
#define UNKNOWN_ITEM_CHOZO_STATUE_BEHAVIOR_HINT_TAKEN 0x3
#define UNKNOWN_ITEM_CHOZO_STATUE_POSE_IDLE 0x9
#define UNKNOWN_ITEM_CHOZO_STATUE_POSE_DO_NOTHING 0xF
#define UNKNOWN_ITEM_CHOZO_STATUE_POSE_REGISTER_HINT 0x22

View File

@ -34,7 +34,7 @@ struct ChozodiaEscapeData {
s16 oamYOffset;
u8 padding_51[18];
u16 oamScaling;
u16 scaling;
u8 padding_64[8];
u8 hblankCode[128];

View File

@ -2,6 +2,9 @@
#define FILE_SELECT_STRUCT_H
#include "types.h"
#include "constants/samus.h"
#include "structs/menu.h"
#define FILE_SELECT_DATA sNonGameplayRamPointer->fileSelect
@ -23,7 +26,7 @@ struct FileSelectCursorOamData {
u16 xPosition;
u16 yPosition;
u8 unk_4;
u8 oamIds[3];
u8 oamIds[SUIT_END];
};
struct OptionsSubroutineInfo {

View File

@ -12,10 +12,10 @@ struct PowerBomb {
u8 unk_3;
u16 xPosition;
u16 yPosition;
s16 hitboxLeftOffset;
s16 hitboxRightOffset;
s16 hitboxTopOffset;
s16 hitboxBottomOffset;
s16 hitboxLeft;
s16 hitboxRight;
s16 hitboxTop;
s16 hitboxBottom;
u8 powerBombPlaced;
u8 owner;
u8 unk_12;

View File

@ -18,10 +18,10 @@ struct ProjectileData {
u8 movementStage;
u8 drawDistanceOffset;
u8 timer;
s16 hitboxTopOffset;
s16 hitboxBottomOffset;
s16 hitboxLeftOffset;
s16 hitboxRightOffset;
s16 hitboxTop;
s16 hitboxBottom;
s16 hitboxLeft;
s16 hitboxRight;
};
// Globals

View File

@ -91,9 +91,9 @@ struct SamusPhysics {
u16 armCannonYPositionOffset;
u8 horizontalMovingDirection;
u8 verticalMovingDirection;
s16 hitboxLeftOffset;
s16 hitboxRightOffset;
s16 hitboxTopOffset;
s16 hitboxLeft;
s16 hitboxRight;
s16 hitboxTop;
u8 standingStatus;
u8 hitboxType;
u8 touchingSideBlock;
@ -110,9 +110,9 @@ struct SamusPhysics {
s16 midairXVelocityCap;
s16 midairMorphedXVelocityCap;
s16 drawDistanceLeftOffset;
s16 drawDistanceTopOffset;
s16 drawDistanceTop;
s16 drawDistanceRightOffset;
s16 drawDistanceBottomOffset;
s16 drawDistanceBottom;
};
struct ScrewSpeedAnimation {

View File

@ -45,11 +45,11 @@ struct SpriteData {
u16 xPosition;
u16 yPositionSpawn;
u16 xPositionSpawn;
s16 hitboxTopOffset;
s16 hitboxBottomOffset;
s16 hitboxLeftOffset;
s16 hitboxRightOffset;
u16 oamScaling;
s16 hitboxTop;
s16 hitboxBottom;
s16 hitboxLeft;
s16 hitboxRight;
u16 scaling;
u16 health;
u16 currentAnimationFrame;
const struct FrameData* pOam;
@ -64,10 +64,10 @@ struct SpriteData {
u8 pose;
u8 samusCollision;
u8 ignoreSamusCollisionTimer;
u8 drawDistanceTopOffset;
u8 drawDistanceBottomOffset;
u8 drawDistanceHorizontalOffset;
u8 oamRotation;
u8 drawDistanceTop;
u8 drawDistanceBottom;
u8 drawDistanceHorizontal;
u8 rotation;
u8 invincibilityStunFlashTimer;
u8 work0;
u8 work1;

View File

@ -28,7 +28,7 @@ struct TourianEscapeData {
u8 oamPriorities[TOURIAN_ESCAPE_MAX_OBJECTS];
u16 unk_82;
u16 oamScaling;
u16 scaling;
u8 padding_86[16];

View File

@ -187,7 +187,7 @@ void BgClipApplyClipdataChangingTransparency(void)
xPosition = position >> 6;
// Get Y position
position = gSamusData.yPosition + (gSamusPhysics.drawDistanceTopOffset >> 1);
position = gSamusData.yPosition + (gSamusPhysics.drawDistanceTop >> 1);
CLAMP2(position, 0, gBgPointersAndDimensions.clipdataHeight * BLOCK_SIZE);
yPosition = position >> 6;
@ -280,7 +280,7 @@ void BgClipCheckWalkingOnCrumbleBlock(void)
xPosition = (u32)behavior / BLOCK_SIZE;
behavior = gSamusData.yPosition + gSamusPhysics.drawDistanceBottomOffset;
behavior = gSamusData.yPosition + gSamusPhysics.drawDistanceBottom;
yPosition = (u32)(behavior + 2) / BLOCK_SIZE;
if (yPosition > gBgPointersAndDimensions.clipdataHeight)
@ -344,11 +344,11 @@ void BgClipCheckTouchingTransitionOnElevator(void)
// Get Y position
if (!goingDown)
{
position = gSamusData.yPosition + gSamusPhysics.drawDistanceBottomOffset + BLOCK_SIZE * 2;
position = gSamusData.yPosition + gSamusPhysics.drawDistanceBottom + BLOCK_SIZE * 2;
}
else
{
position = gSamusData.yPosition + gSamusPhysics.drawDistanceTopOffset - BLOCK_SIZE * 2;
position = gSamusData.yPosition + gSamusPhysics.drawDistanceTop - BLOCK_SIZE * 2;
}
behavior = position;
@ -417,17 +417,17 @@ void BgClipCheckTouchingTransitionOrTank(void)
// Get Y positions
// Center
j = (gSamusPhysics.drawDistanceTopOffset >> 1) + gSamusData.yPosition;
j = (gSamusPhysics.drawDistanceTop >> 1) + gSamusData.yPosition;
CLAMP2(j, 0, gBgPointersAndDimensions.clipdataHeight * BLOCK_SIZE);
yPositions[0] = j >> 6;
// Bottom
j = (gSamusPhysics.drawDistanceTopOffset >> 2) + gSamusData.yPosition;
j = (gSamusPhysics.drawDistanceTop >> 2) + gSamusData.yPosition;
CLAMP2(j, 0, gBgPointersAndDimensions.clipdataHeight * BLOCK_SIZE);
yPositions[1] = j >> 6;
// Top
j = (gSamusPhysics.drawDistanceTopOffset >> 2) + (gSamusPhysics.drawDistanceTopOffset >> 1) + gSamusData.yPosition;
j = (gSamusPhysics.drawDistanceTop >> 2) + (gSamusPhysics.drawDistanceTop >> 1) + gSamusData.yPosition;
CLAMP2(j, 0, gBgPointersAndDimensions.clipdataHeight * BLOCK_SIZE);
yPositions[2] = j >> 6;

View File

@ -1405,8 +1405,8 @@ u32 BlockCheckSamusInReformingBlock(u8 xPosition, u8 yPosition)
// Check in Y
inY = FALSE;
if ((gSamusData.yPosition + gSamusPhysics.drawDistanceTopOffset) >> 6 <= yPosition &&
yPosition <= (gSamusData.yPosition + gSamusPhysics.drawDistanceBottomOffset) >> 6)
if ((gSamusData.yPosition + gSamusPhysics.drawDistanceTop) >> 6 <= yPosition &&
yPosition <= (gSamusData.yPosition + gSamusPhysics.drawDistanceBottom) >> 6)
inY = TRUE;
inBlock = FALSE;

View File

@ -349,10 +349,10 @@ void ChozodiaEscapeProcessOam_2(void)
*dst++ = *src++;
dst++;
ProcessComplexOam(currSlot, xPosition, yPosition, 0, CHOZODIA_ESCAPE_DATA.oamScaling, TRUE, 0);
ProcessComplexOam(currSlot, xPosition, yPosition, 0, CHOZODIA_ESCAPE_DATA.scaling, TRUE, 0);
}
CalculateOamPart4(0, CHOZODIA_ESCAPE_DATA.oamScaling, 0);
CalculateOamPart4(0, CHOZODIA_ESCAPE_DATA.scaling, 0);
}
for (i = 1; i < CHOZODIA_ESCAPE_MAX_OBJECTS - 2; i++)
@ -451,7 +451,7 @@ void ChozodiaEscapeInit(void)
CHOZODIA_ESCAPE_DATA.oamYPositions[CHOZODIA_ESCAPE_OAM_BLUE_SHIP] = 0x63;
CHOZODIA_ESCAPE_DATA.oamYOffset = 8;
CHOZODIA_ESCAPE_DATA.oamScaling = Q_8_8(.25f / 2);
CHOZODIA_ESCAPE_DATA.scaling = Q_8_8(.25f / 2);
CHOZODIA_ESCAPE_DATA.oamTypes[CHOZODIA_ESCAPE_OAM_MOTHER_SHIP_DOOR]++;
CHOZODIA_ESCAPE_DATA.oamPointers[CHOZODIA_ESCAPE_OAM_MOTHER_SHIP_DOOR] = sChozodiaEscapeOam_MotherShipDoorClosed_Frame0;
@ -540,7 +540,7 @@ u8 ChozodiaEscapeShipLeaving(void)
CHOZODIA_ESCAPE_DATA.oamYPositions[CHOZODIA_ESCAPE_OAM_BLUE_SHIP] = BLOCK_SIZE * 3 - QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2;
CHOZODIA_ESCAPE_DATA.oamYOffset = -QUARTER_BLOCK_SIZE;
CHOZODIA_ESCAPE_DATA.oamScaling = Q_8_8(1.f);
CHOZODIA_ESCAPE_DATA.scaling = Q_8_8(1.f);
break;
case 312:
@ -550,13 +550,13 @@ u8 ChozodiaEscapeShipLeaving(void)
// Update blue ship
if (CHOZODIA_ESCAPE_DATA.oamTypes[CHOZODIA_ESCAPE_OAM_BLUE_SHIP] == CHOZODIA_ESCAPE_OAM_TYPE_NORMAL)
{
CHOZODIA_ESCAPE_DATA.oamScaling += Q_8_8(0.02f);
if (CHOZODIA_ESCAPE_DATA.oamScaling > Q_8_8(1.f))
CHOZODIA_ESCAPE_DATA.scaling += Q_8_8(0.02f);
if (CHOZODIA_ESCAPE_DATA.scaling > Q_8_8(1.f))
{
if (MOD_AND(CHOZODIA_ESCAPE_DATA.timer, 8) == 0)
CHOZODIA_ESCAPE_DATA.oamYOffset++;
}
else if (CHOZODIA_ESCAPE_DATA.oamScaling > Q_8_8(0.22f))
else if (CHOZODIA_ESCAPE_DATA.scaling > Q_8_8(0.22f))
{
if (MOD_AND(CHOZODIA_ESCAPE_DATA.timer, 4) == 0)
CHOZODIA_ESCAPE_DATA.oamYOffset++;
@ -567,7 +567,7 @@ u8 ChozodiaEscapeShipLeaving(void)
}
else if (CHOZODIA_ESCAPE_DATA.oamTypes[CHOZODIA_ESCAPE_OAM_BLUE_SHIP] == CHOZODIA_ESCAPE_OAM_TYPE_SCALING)
{
CHOZODIA_ESCAPE_DATA.oamScaling += Q_8_8(0.25f / 4);
CHOZODIA_ESCAPE_DATA.scaling += Q_8_8(0.25f / 4);
CHOZODIA_ESCAPE_DATA.oamYOffset -= 8;
}
@ -575,8 +575,8 @@ u8 ChozodiaEscapeShipLeaving(void)
{
velocity = CHOZODIA_ESCAPE_DATA.oamYOffset;
if (CHOZODIA_ESCAPE_DATA.oamScaling > Q_8_8(2.f))
CHOZODIA_ESCAPE_DATA.oamScaling = Q_8_8(2.f);
if (CHOZODIA_ESCAPE_DATA.scaling > Q_8_8(2.f))
CHOZODIA_ESCAPE_DATA.scaling = Q_8_8(2.f);
CHOZODIA_ESCAPE_DATA.oamYPositions[CHOZODIA_ESCAPE_OAM_BLUE_SHIP] += DIV_SHIFT(velocity, 8);
}
@ -992,7 +992,7 @@ u8 ChozodiaEscapeShipLeavingPlanet(void)
CHOZODIA_ESCAPE_DATA.oamXOffset = -39;
CHOZODIA_ESCAPE_DATA.oamYOffset = 6;
CHOZODIA_ESCAPE_DATA.oamScaling = Q_8_8(0.91f);
CHOZODIA_ESCAPE_DATA.scaling = Q_8_8(0.91f);
CHOZODIA_ESCAPE_DATA.oamXPositions[CHOZODIA_ESCAPE_OAM_MOTHER_SHIP_DOOR] =
CHOZODIA_ESCAPE_DATA.oamXPositions[CHOZODIA_ESCAPE_OAM_BLUE_SHIP] * 8;
@ -1058,9 +1058,9 @@ u8 ChozodiaEscapeShipLeavingPlanet(void)
CHOZODIA_ESCAPE_DATA.oamXPositions[CHOZODIA_ESCAPE_OAM_BLUE_SHIP] = (u16)xPosition / 8;
CHOZODIA_ESCAPE_DATA.oamYPositions[CHOZODIA_ESCAPE_OAM_BLUE_SHIP] = (u16)yPosition / 8;
CHOZODIA_ESCAPE_DATA.oamScaling += Q_8_8(0.05f);
if (CHOZODIA_ESCAPE_DATA.oamScaling > Q_8_8(2.f))
CHOZODIA_ESCAPE_DATA.oamScaling = Q_8_8(2.f);
CHOZODIA_ESCAPE_DATA.scaling += Q_8_8(0.05f);
if (CHOZODIA_ESCAPE_DATA.scaling > Q_8_8(2.f))
CHOZODIA_ESCAPE_DATA.scaling = Q_8_8(2.f);
ChozodiaEscapeProcessOam_2();
}

View File

@ -70,10 +70,10 @@ const struct PowerBomb sPowerBomb_Empty = {
.unk_3 = 0,
.xPosition = 0,
.yPosition = 0,
.hitboxLeftOffset = 0,
.hitboxRightOffset = 0,
.hitboxTopOffset = 0,
.hitboxBottomOffset = 0,
.hitboxLeft = 0,
.hitboxRight = 0,
.hitboxTop = 0,
.hitboxBottom = 0,
.powerBombPlaced = FALSE,
.owner = 0,
.unk_12 = 0

View File

@ -39,7 +39,7 @@ const u16 sGameOverSamusHeadYPositions[2] = {
[TRUE] = BLOCK_SIZE * 8 + HALF_BLOCK_SIZE
};
const u8 sGameOverSamusHeadOamIds[3][3] = {
const u8 sGameOverSamusHeadOamIds[SUIT_END][SAMUS_CURSOR_ACTION_END] = {
[SUIT_NORMAL] = {
[SAMUS_CURSOR_ACTION_LOADING] = GAME_OVER_OAM_ID_SUIT_LOADING,
[SAMUS_CURSOR_ACTION_MOVING] = GAME_OVER_OAM_ID_SUIT_MOVING,

View File

@ -15,33 +15,33 @@ const s16 sDragonFireballOamRotation[40] = {
};
const u32 sDragonGfx[512] = INCBIN_U32("data/sprites/Dragon.gfx.lz");
const u16 sDragonPal[32] = INCBIN_U16("data/sprites/Dragon.pal");
const u16 sDragonPal[16 * 2] = INCBIN_U16("data/sprites/Dragon.pal");
const u16 sDragonOAM_Spitting_Frame0[7] = {
static const u16 sDragonOam_Spitting_Frame0[OAM_DATA_SIZE(2)] = {
0x2,
0xe6, OBJ_SIZE_32x32 | 0x1f0, OBJ_SPRITE_OAM | 0x200,
OBJ_SHAPE_VERTICAL | 0x3, OBJ_SIZE_16x32 | 0x1f6, OBJ_SPRITE_OAM | 0x20d
};
const u16 sDragonOAM_Spitting_Frame1[7] = {
static const u16 sDragonOam_Spitting_Frame1[OAM_DATA_SIZE(2)] = {
0x2,
0xe5, OBJ_SIZE_32x32 | 0x1f1, OBJ_SPRITE_OAM | 0x200,
OBJ_SHAPE_VERTICAL | 0x3, OBJ_SIZE_16x32 | 0x1f7, OBJ_SPRITE_OAM | 0x20d
};
const u16 sDragonOAM_Idle_Frame0[7] = {
static const u16 sDragonOam_Idle_Frame0[OAM_DATA_SIZE(2)] = {
0x2,
0x6, OBJ_SIZE_16x16 | 0x1f7, OBJ_SPRITE_OAM | 0x24b,
0xe9, OBJ_SIZE_32x32 | 0x1f8, OBJ_SPRITE_OAM | 0x204
};
const u16 sDragonOAM_Idle_Frame1[7] = {
static const u16 sDragonOam_Idle_Frame1[OAM_DATA_SIZE(2)] = {
0x2,
0xea, OBJ_SIZE_32x32 | 0x1f0, OBJ_SPRITE_OAM | 0x207,
0x4, OBJ_SIZE_16x16 | 0x1f7, OBJ_SPRITE_OAM | 0x24b
};
const u16 sDragonOAM_Idle_Frame2[13] = {
static const u16 sDragonOam_Idle_Frame2[OAM_DATA_SIZE(4)] = {
0x4,
0xe9, OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x20b,
OBJ_SHAPE_VERTICAL | 0xe9, OBJ_SIZE_8x32 | 0x1f8, OBJ_SPRITE_OAM | 0x204,
@ -49,132 +49,161 @@ const u16 sDragonOAM_Idle_Frame2[13] = {
0x5, OBJ_SIZE_16x16 | 0x1f7, OBJ_SPRITE_OAM | 0x24b
};
const u16 sDragonOAM_TurningAround_Frame0[7] = {
static const u16 sDragonOam_TurningAround_Frame0[OAM_DATA_SIZE(2)] = {
0x2,
0xe9, OBJ_SIZE_32x32 | 0x1f8, OBJ_SPRITE_OAM | 0x20f,
0x5, OBJ_SIZE_16x16 | 0x1f9, OBJ_SPRITE_OAM | 0x215
};
const u16 sDragonOAM_TurningAround_Frame1[7] = {
static const u16 sDragonOam_TurningAround_Frame1[OAM_DATA_SIZE(2)] = {
0x2,
OBJ_SHAPE_VERTICAL | 0xea, OBJ_SIZE_16x32 | 0x1fa, OBJ_SPRITE_OAM | 0x213,
0x5, OBJ_SIZE_16x16 | 0x1f9, OBJ_SPRITE_OAM | 0x255
};
const u16 sDragonOAM_Unused_0[7] = {
static const u16 sDragonOam_Unused_0[OAM_DATA_SIZE(2)] = {
0x2,
OBJ_SHAPE_VERTICAL | 0xea, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0x1fb, OBJ_SPRITE_OAM | 0x213,
0x5, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x1fc, OBJ_SPRITE_OAM | 0x255
};
const u16 sDragonOAM_Unused_1[7] = {
static const u16 sDragonOam_Unused_1[OAM_DATA_SIZE(2)] = {
0x2,
0xe9, OBJ_X_FLIP | OBJ_SIZE_32x32 | 0x1ec, OBJ_SPRITE_OAM | 0x20f,
0x5, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x1fb, OBJ_SPRITE_OAM | 0x215
};
const u16 sDragonFireballOAM_Moving_Frame0[4] = {
static const u16 sDragonFireballOam_Moving_Frame0[OAM_DATA_SIZE(1)] = {
0x1,
0xf8, OBJ_SIZE_16x16 | 0x1f8, OBJ_SPRITE_OAM | 0x25a
};
const u16 sDragonFireballOAM_Moving_Frame1[4] = {
static const u16 sDragonFireballOam_Moving_Frame1[OAM_DATA_SIZE(1)] = {
0x1,
0xf8, OBJ_SIZE_16x16 | 0x1f8, OBJ_SPRITE_OAM | 0x25c
};
const u16 sDragonFireballOAM_Moving_Frame2[4] = {
static const u16 sDragonFireballOam_Moving_Frame2[OAM_DATA_SIZE(1)] = {
0x1,
0xf8, OBJ_SIZE_16x16 | 0x1f8, OBJ_SPRITE_OAM | 0x25e
};
const u16 sDragonFireballOAM_Exploding_Frame0[4] = {
static const u16 sDragonFireballOam_Exploding_Frame0[OAM_DATA_SIZE(1)] = {
0x1,
0xf8, OBJ_SIZE_16x16 | 0x1f8, OBJ_SPRITE_OAM | 0x21a
};
const u16 sDragonFireballOAM_Exploding_Frame1[4] = {
static const u16 sDragonFireballOam_Exploding_Frame1[OAM_DATA_SIZE(1)] = {
0x1,
0xf8, OBJ_SIZE_16x16 | 0x1f8, OBJ_SPRITE_OAM | 0x21c
};
const u16 sDragonFireballOAM_Exploding_Frame2[4] = {
static const u16 sDragonFireballOam_Exploding_Frame2[OAM_DATA_SIZE(1)] = {
0x1,
0xf8, OBJ_SIZE_16x16 | 0x1f8, OBJ_SPRITE_OAM | 0x21e
};
const u16 sDragonFireballOAM_Exploding_Frame3[4] = {
static const u16 sDragonFireballOam_Exploding_Frame3[OAM_DATA_SIZE(1)] = {
0x1,
0xf7, OBJ_SIZE_16x16 | 0x1f8, OBJ_SPRITE_OAM | 0x121e
};
const struct FrameData sDragonOAM_Idle[4] = {
sDragonOAM_Idle_Frame0,
0xC,
sDragonOAM_Idle_Frame1,
0xC,
sDragonOAM_Idle_Frame2,
0xC,
NULL,
0x0
const struct FrameData sDragonOam_Idle[4] = {
[0] = {
.pFrame = sDragonOam_Idle_Frame0,
.timer = CONVERT_SECONDS(.2f)
},
[1] = {
.pFrame = sDragonOam_Idle_Frame1,
.timer = CONVERT_SECONDS(.2f)
},
[2] = {
.pFrame = sDragonOam_Idle_Frame2,
.timer = CONVERT_SECONDS(.2f)
},
[3] = FRAME_DATA_TERMINATOR
};
const struct FrameData sDragonOAM_Warning[3] = {
sDragonOAM_Idle_Frame0,
0x6,
sDragonOAM_Idle_Frame1,
0x6,
NULL,
0x0
const struct FrameData sDragonOam_Warning[3] = {
[0] = {
.pFrame = sDragonOam_Idle_Frame0,
.timer = CONVERT_SECONDS(.1f)
},
[1] = {
.pFrame = sDragonOam_Idle_Frame1,
.timer = CONVERT_SECONDS(.1f)
},
[2] = FRAME_DATA_TERMINATOR
};
const struct FrameData sDragonOAM_Spitting[3] = {
sDragonOAM_Spitting_Frame0,
0x4,
sDragonOAM_Spitting_Frame1,
0x4,
NULL,
0x0
const struct FrameData sDragonOam_Spitting[3] = {
[0] = {
.pFrame = sDragonOam_Spitting_Frame0,
.timer = CONVERT_SECONDS(1.f / 15)
},
[1] = {
.pFrame = sDragonOam_Spitting_Frame1,
.timer = CONVERT_SECONDS(1.f / 15)
},
[2] = FRAME_DATA_TERMINATOR
};
const struct FrameData sDragonOAM_TurningAround[3] = {
sDragonOAM_TurningAround_Frame0,
0x3,
sDragonOAM_TurningAround_Frame1,
0x3,
NULL,
0x0
const struct FrameData sDragonOam_TurningAround[3] = {
[0] = {
.pFrame = sDragonOam_TurningAround_Frame0,
.timer = CONVERT_SECONDS(.05f)
},
[1] = {
.pFrame = sDragonOam_TurningAround_Frame1,
.timer = CONVERT_SECONDS(.05f)
},
[2] = FRAME_DATA_TERMINATOR
};
const struct FrameData sDragonOAM_TurningAroundPart2[3] = {
sDragonOAM_TurningAround_Frame1,
0x3,
sDragonOAM_TurningAround_Frame0,
0x3,
NULL,
0x0
const struct FrameData sDragonOam_TurningAroundPart2[3] = {
[0] = {
.pFrame = sDragonOam_TurningAround_Frame1,
.timer = CONVERT_SECONDS(.05f)
},
[1] = {
.pFrame = sDragonOam_TurningAround_Frame0,
.timer = CONVERT_SECONDS(.05f)
},
[2] = FRAME_DATA_TERMINATOR
};
const struct FrameData sDragonFireballOAM_Moving[4] = {
sDragonFireballOAM_Moving_Frame0,
0x1,
sDragonFireballOAM_Moving_Frame1,
0x4,
sDragonFireballOAM_Moving_Frame2,
0x4,
NULL,
0x0
const struct FrameData sDragonFireballOam_Moving[4] = {
[0] = {
.pFrame = sDragonFireballOam_Moving_Frame0,
.timer = CONVERT_SECONDS(1.f / 60)
},
[1] = {
.pFrame = sDragonFireballOam_Moving_Frame1,
.timer = CONVERT_SECONDS(1.f / 15)
},
[2] = {
.pFrame = sDragonFireballOam_Moving_Frame2,
.timer = CONVERT_SECONDS(1.f / 15)
},
[3] = FRAME_DATA_TERMINATOR
};
const struct FrameData sDragonFireballOAM_Exploding[5] = {
sDragonFireballOAM_Exploding_Frame0,
0x4,
sDragonFireballOAM_Exploding_Frame1,
0x4,
sDragonFireballOAM_Exploding_Frame2,
0x4,
sDragonFireballOAM_Exploding_Frame3,
0x4,
NULL,
0x0
const struct FrameData sDragonFireballOam_Exploding[5] = {
[0] = {
.pFrame = sDragonFireballOam_Exploding_Frame0,
.timer = CONVERT_SECONDS(1.f / 15)
},
[1] = {
.pFrame = sDragonFireballOam_Exploding_Frame1,
.timer = CONVERT_SECONDS(1.f / 15)
},
[2] = {
.pFrame = sDragonFireballOam_Exploding_Frame2,
.timer = CONVERT_SECONDS(1.f / 15)
},
[3] = {
.pFrame = sDragonFireballOam_Exploding_Frame3,
.timer = CONVERT_SECONDS(1.f / 15)
},
[4] = FRAME_DATA_TERMINATOR
};

View File

@ -90,10 +90,10 @@ void PowerBombExplosion(void)
if ((gBgPointersAndDimensions.clipdataHeight * BLOCK_SIZE) < (gCurrentPowerBomb.yPosition + verticalAxis))
hitboxBottom = (s16)(gBgPointersAndDimensions.clipdataHeight * BLOCK_SIZE - gCurrentPowerBomb.yPosition);
gCurrentPowerBomb.hitboxLeftOffset = hitboxLeft;
gCurrentPowerBomb.hitboxRightOffset = hitboxRight;
gCurrentPowerBomb.hitboxTopOffset = hitboxTop;
gCurrentPowerBomb.hitboxBottomOffset = hitboxBottom;
gCurrentPowerBomb.hitboxLeft = hitboxLeft;
gCurrentPowerBomb.hitboxRight = hitboxRight;
gCurrentPowerBomb.hitboxTop = hitboxTop;
gCurrentPowerBomb.hitboxBottom = hitboxBottom;
if (gCurrentPowerBomb.animationState < PB_STATE_IMPLODING)
{
@ -247,10 +247,10 @@ void PowerBombExplosionBegin(void)
gCurrentPowerBomb.stage = 0;
gCurrentPowerBomb.semiMinorAxis = 0x4;
gCurrentPowerBomb.hitboxLeftOffset = 0;
gCurrentPowerBomb.hitboxRightOffset = 0;
gCurrentPowerBomb.hitboxTopOffset = 0;
gCurrentPowerBomb.hitboxBottomOffset = 0;
gCurrentPowerBomb.hitboxLeft = 0;
gCurrentPowerBomb.hitboxRight = 0;
gCurrentPowerBomb.hitboxTop = 0;
gCurrentPowerBomb.hitboxBottom = 0;
gCurrentPowerBomb.unk_12 = 0;
gCurrentPowerBomb.unk_3 = 0;

View File

@ -85,10 +85,10 @@ void ProjectileProcessNormalBeam(struct ProjectileData* pProj)
pProj->status &= ~PROJ_STATUS_NOT_DRAWN;
pProj->animationDurationCounter = 0x0;
pProj->currentAnimationFrame = 0x0;
pProj->hitboxTopOffset = -0x8;
pProj->hitboxBottomOffset = 0x8;
pProj->hitboxLeftOffset = -0x8;
pProj->hitboxRightOffset = 0x8;
pProj->hitboxTop = -0x8;
pProj->hitboxBottom = 0x8;
pProj->hitboxLeft = -0x8;
pProj->hitboxRight = 0x8;
pProj->movementStage = 0x1;
ProjectileCheckHitBlock(pProj, CAA_BEAM, PE_HITTING_SOMETHING_WITH_NORMAL_BEAM);
}
@ -163,10 +163,10 @@ void ProjectileProcessLongBeam(struct ProjectileData* pProj)
pProj->status &= ~PROJ_STATUS_NOT_DRAWN;
pProj->animationDurationCounter = 0x0;
pProj->currentAnimationFrame = 0x0;
pProj->hitboxTopOffset = -0xC;
pProj->hitboxBottomOffset = 0xC;
pProj->hitboxLeftOffset = -0xC;
pProj->hitboxRightOffset = 0xC;
pProj->hitboxTop = -0xC;
pProj->hitboxBottom = 0xC;
pProj->hitboxLeft = -0xC;
pProj->hitboxRight = 0xC;
pProj->movementStage = 0x1;
ProjectileCheckHitBlock(pProj, CAA_BEAM, PE_HITTING_SOMETHING_WITH_LONG_BEAM);
pProj->timer++;
@ -242,10 +242,10 @@ void ProjectileProcessIceBeam(struct ProjectileData* pProj)
pProj->status &= ~PROJ_STATUS_NOT_DRAWN;
pProj->animationDurationCounter = 0x0;
pProj->currentAnimationFrame = 0x0;
pProj->hitboxTopOffset = -0x14;
pProj->hitboxBottomOffset = 0x14;
pProj->hitboxLeftOffset = -0x14;
pProj->hitboxRightOffset = 0x14;
pProj->hitboxTop = -0x14;
pProj->hitboxBottom = 0x14;
pProj->hitboxLeft = -0x14;
pProj->hitboxRight = 0x14;
pProj->movementStage = 0x1;
ProjectileCheckHitBlock(pProj, CAA_BEAM, PE_HITTING_SOMETHING_WITH_ICE_BEAM);
}
@ -401,27 +401,27 @@ void ProjectileProcessWaveBeam(struct ProjectileData* pProj)
pProj->status |= PROJ_STATUS_YFLIP;
case ACD_DIAGONALLY_UP:
pProj->pOam = sWaveBeamOAM_Diagonal;
pProj->hitboxTopOffset = -0x10;
pProj->hitboxBottomOffset = 0x40;
pProj->hitboxLeftOffset = -0x28;
pProj->hitboxRightOffset = 0x28;
pProj->hitboxTop = -0x10;
pProj->hitboxBottom = 0x40;
pProj->hitboxLeft = -0x28;
pProj->hitboxRight = 0x28;
break;
case ACD_DOWN:
pProj->status |= PROJ_STATUS_YFLIP;
case ACD_UP:
pProj->pOam = sWaveBeamOAM_Vertical;
pProj->hitboxTopOffset = -0x14;
pProj->hitboxBottomOffset = 0x14;
pProj->hitboxLeftOffset = -0x40;
pProj->hitboxRightOffset = 0x40;
pProj->hitboxTop = -0x14;
pProj->hitboxBottom = 0x14;
pProj->hitboxLeft = -0x40;
pProj->hitboxRight = 0x40;
break;
default:
case ACD_FORWARD:
pProj->pOam = sWaveBeamOAM_Horizontal;
pProj->hitboxTopOffset = -0x40;
pProj->hitboxBottomOffset = 0x40;
pProj->hitboxLeftOffset = -0x14;
pProj->hitboxRightOffset = 0x14;
pProj->hitboxTop = -0x40;
pProj->hitboxBottom = 0x40;
pProj->hitboxLeft = -0x14;
pProj->hitboxRight = 0x14;
}
pProj->drawDistanceOffset = 0xA0;
@ -486,10 +486,10 @@ void ProjectileProcessPlasmaBeam(struct ProjectileData* pProj)
if (hasWave)
{
pProj->pOam = sPlasmaBeamOAM_Diagonal_Wave;
pProj->hitboxTopOffset = -0x10;
pProj->hitboxBottomOffset = 0x40;
pProj->hitboxLeftOffset = -0x30;
pProj->hitboxRightOffset = 0x30;
pProj->hitboxTop = -0x10;
pProj->hitboxBottom = 0x40;
pProj->hitboxLeft = -0x30;
pProj->hitboxRight = 0x30;
}
else
pProj->pOam = sPlasmaBeamOAM_Diagonal_NoWave;
@ -501,10 +501,10 @@ void ProjectileProcessPlasmaBeam(struct ProjectileData* pProj)
if (hasWave)
{
pProj->pOam = sPlasmaBeamOAM_Vertical_Wave;
pProj->hitboxTopOffset = -0x20;
pProj->hitboxBottomOffset = 0x20;
pProj->hitboxLeftOffset = -0x40;
pProj->hitboxRightOffset = 0x40;
pProj->hitboxTop = -0x20;
pProj->hitboxBottom = 0x20;
pProj->hitboxLeft = -0x40;
pProj->hitboxRight = 0x40;
}
else
pProj->pOam = sPlasmaBeamOAM_Vertical_NoWave;
@ -515,10 +515,10 @@ void ProjectileProcessPlasmaBeam(struct ProjectileData* pProj)
if (hasWave)
{
pProj->pOam = sPlasmaBeamOAM_Horizontal_Wave;
pProj->hitboxTopOffset = -0x40;
pProj->hitboxBottomOffset = 0x40;
pProj->hitboxLeftOffset = -0x20;
pProj->hitboxRightOffset = 0x20;
pProj->hitboxTop = -0x40;
pProj->hitboxBottom = 0x40;
pProj->hitboxLeft = -0x20;
pProj->hitboxRight = 0x20;
}
else
pProj->pOam = sPlasmaBeamOAM_Horizontal_NoWave;
@ -532,10 +532,10 @@ void ProjectileProcessPlasmaBeam(struct ProjectileData* pProj)
else
{
pProj->drawDistanceOffset = 0x50;
pProj->hitboxTopOffset = -0x14;
pProj->hitboxBottomOffset = 0x14;
pProj->hitboxLeftOffset = -0x14;
pProj->hitboxRightOffset = 0x14;
pProj->hitboxTop = -0x14;
pProj->hitboxBottom = 0x14;
pProj->hitboxLeft = -0x14;
pProj->hitboxRight = 0x14;
}
pProj->status &= ~PROJ_STATUS_NOT_DRAWN;
@ -614,10 +614,10 @@ void ProjectileProcessPistol(struct ProjectileData* pProj)
pProj->status &= ~PROJ_STATUS_NOT_DRAWN;
pProj->animationDurationCounter = 0x0;
pProj->currentAnimationFrame = 0x0;
pProj->hitboxTopOffset = -0x4;
pProj->hitboxBottomOffset = 0x4;
pProj->hitboxLeftOffset = -0x4;
pProj->hitboxRightOffset = 0x4;
pProj->hitboxTop = -0x4;
pProj->hitboxBottom = 0x4;
pProj->hitboxLeft = -0x4;
pProj->hitboxRight = 0x4;
pProj->movementStage = 0x1;
ProjectileCheckHitBlock(pProj, CAA_BOMB_PISTOL, PE_HITTING_SOMETHING_WITH_NORMAL_BEAM);
pProj->timer++;
@ -684,10 +684,10 @@ void ProjectileProcessChargedNormalBeam(struct ProjectileData* pProj)
pProj->animationDurationCounter = 0x0;
pProj->currentAnimationFrame = 0x0;
pProj->hitboxTopOffset = -0xC;
pProj->hitboxBottomOffset = 0xC;
pProj->hitboxLeftOffset = -0xC;
pProj->hitboxRightOffset= 0xC;
pProj->hitboxTop = -0xC;
pProj->hitboxBottom = 0xC;
pProj->hitboxLeft = -0xC;
pProj->hitboxRight= 0xC;
pProj->movementStage = 0x1;
ProjectileCheckHitBlock(pProj, CAA_BEAM, PE_HITTING_SOMETHING_WITH_NORMAL_BEAM);
@ -757,10 +757,10 @@ void ProjectileProcessChargedLongBeam(struct ProjectileData* pProj)
pProj->animationDurationCounter = 0x0;
pProj->currentAnimationFrame = 0x0;
pProj->hitboxTopOffset = -0x10;
pProj->hitboxBottomOffset = 0x10;
pProj->hitboxLeftOffset = -0x10;
pProj->hitboxRightOffset = 0x10;
pProj->hitboxTop = -0x10;
pProj->hitboxBottom = 0x10;
pProj->hitboxLeft = -0x10;
pProj->hitboxRight = 0x10;
pProj->movementStage = 0x1;
ProjectileCheckHitBlock(pProj, CAA_BEAM, PE_HITTING_SOMETHING_WITH_LONG_BEAM);
@ -832,10 +832,10 @@ void ProjectileProcessChargedIceBeam(struct ProjectileData* pProj)
pProj->animationDurationCounter = 0x0;
pProj->currentAnimationFrame = 0x0;
pProj->hitboxTopOffset = -0x18;
pProj->hitboxBottomOffset = 0x18;
pProj->hitboxLeftOffset = -0x18;
pProj->hitboxRightOffset = 0x18;
pProj->hitboxTop = -0x18;
pProj->hitboxBottom = 0x18;
pProj->hitboxLeft = -0x18;
pProj->hitboxRight = 0x18;
pProj->movementStage = 0x1;
ProjectileCheckHitBlock(pProj, CAA_BEAM, PE_HITTING_SOMETHING_WITH_ICE_BEAM);
@ -882,10 +882,10 @@ void ProjectileProcessChargedWaveBeam(struct ProjectileData* pProj)
case ACD_DIAGONALLY_UP:
pProj->pOam = sChargedWaveBeamOAM_Diagonal;
pProj->hitboxTopOffset = -0x10;
pProj->hitboxBottomOffset = 0x48;
pProj->hitboxLeftOffset = -0x30;
pProj->hitboxRightOffset = 0x30;
pProj->hitboxTop = -0x10;
pProj->hitboxBottom = 0x48;
pProj->hitboxLeft = -0x30;
pProj->hitboxRight = 0x30;
break;
case ACD_DOWN:
@ -893,20 +893,20 @@ void ProjectileProcessChargedWaveBeam(struct ProjectileData* pProj)
case ACD_UP:
pProj->pOam = sChargedWaveBeamOAM_Vertical;
pProj->hitboxTopOffset = -0x14;
pProj->hitboxBottomOffset = 0x14;
pProj->hitboxLeftOffset = -0x48;
pProj->hitboxRightOffset = 0x48;
pProj->hitboxTop = -0x14;
pProj->hitboxBottom = 0x14;
pProj->hitboxLeft = -0x48;
pProj->hitboxRight = 0x48;
break;
case ACD_FORWARD:
default:
pProj->pOam = sChargedWaveBeamOAM_Horizontal;
pProj->hitboxTopOffset = -0x48;
pProj->hitboxBottomOffset = 0x48;
pProj->hitboxLeftOffset = -0x14;
pProj->hitboxRightOffset = 0x14;
pProj->hitboxTop = -0x48;
pProj->hitboxBottom = 0x48;
pProj->hitboxLeft = -0x14;
pProj->hitboxRight = 0x14;
}
pProj->drawDistanceOffset = 0xC0;
@ -984,10 +984,10 @@ void ProjectileProcessChargedPlasmaBeam(struct ProjectileData* pProj)
if (hasWave)
{
pProj->pOam = sChargedPlasmaBeamOAM_Diagonal_Wave;
pProj->hitboxTopOffset = -0x10;
pProj->hitboxBottomOffset = 0x48;
pProj->hitboxLeftOffset = -0x38;
pProj->hitboxRightOffset = 0x38;
pProj->hitboxTop = -0x10;
pProj->hitboxBottom = 0x48;
pProj->hitboxLeft = -0x38;
pProj->hitboxRight = 0x38;
}
else
pProj->pOam = sChargedPlasmaBeamOAM_Diagonal_NoWave;
@ -999,10 +999,10 @@ void ProjectileProcessChargedPlasmaBeam(struct ProjectileData* pProj)
if (hasWave)
{
pProj->pOam = sChargedPlasmaBeamOAM_Vertical_Wave;
pProj->hitboxTopOffset = -0x24;
pProj->hitboxBottomOffset = 0x24;
pProj->hitboxLeftOffset = -0x48;
pProj->hitboxRightOffset = 0x48;
pProj->hitboxTop = -0x24;
pProj->hitboxBottom = 0x24;
pProj->hitboxLeft = -0x48;
pProj->hitboxRight = 0x48;
}
else
pProj->pOam = sChargedPlasmaBeamOAM_Vertical_NoWave;
@ -1013,10 +1013,10 @@ void ProjectileProcessChargedPlasmaBeam(struct ProjectileData* pProj)
if (hasWave)
{
pProj->pOam = sChargedPlasmaBeamOAM_Horizontal_Wave;
pProj->hitboxTopOffset = -0x48;
pProj->hitboxBottomOffset = 0x48;
pProj->hitboxLeftOffset = -0x24;
pProj->hitboxRightOffset = 0x24;
pProj->hitboxTop = -0x48;
pProj->hitboxBottom = 0x48;
pProj->hitboxLeft = -0x24;
pProj->hitboxRight = 0x24;
}
else
pProj->pOam = sChargedPlasmaBeamOAM_Horizontal_NoWave;
@ -1035,10 +1035,10 @@ void ProjectileProcessChargedPlasmaBeam(struct ProjectileData* pProj)
else
{
pProj->drawDistanceOffset = 0xC0;
pProj->hitboxTopOffset = -0x18;
pProj->hitboxBottomOffset = 0x18;
pProj->hitboxLeftOffset = -0x18;
pProj->hitboxRightOffset = 0x18;
pProj->hitboxTop = -0x18;
pProj->hitboxBottom = 0x18;
pProj->hitboxLeft = -0x18;
pProj->hitboxRight = 0x18;
}
}
@ -1113,10 +1113,10 @@ void ProjectileProcessChargedPistol(struct ProjectileData* pProj)
pProj->status &= ~PROJ_STATUS_NOT_DRAWN;
pProj->animationDurationCounter = 0x0;
pProj->currentAnimationFrame = 0x0;
pProj->hitboxTopOffset = -0xC;
pProj->hitboxBottomOffset = 0xC;
pProj->hitboxLeftOffset = -0xC;
pProj->hitboxRightOffset = 0xC;
pProj->hitboxTop = -0xC;
pProj->hitboxBottom = 0xC;
pProj->hitboxLeft = -0xC;
pProj->hitboxRight = 0xC;
pProj->movementStage = 0x1;
ProjectileCheckHitBlock(pProj, CAA_BOMB_PISTOL, PE_HITTING_SOMETHING_WITH_LONG_BEAM);
pProj->timer++;
@ -1207,10 +1207,10 @@ void ProjectileProcessMissile(struct ProjectileData* pProj)
ProjectileDecrementMissileCounter(pProj);
pProj->animationDurationCounter = 0x0;
pProj->currentAnimationFrame = 0x0;
pProj->hitboxTopOffset = -0x8;
pProj->hitboxBottomOffset = 0x8;
pProj->hitboxLeftOffset = -0x8;
pProj->hitboxRightOffset = 0x8;
pProj->hitboxTop = -0x8;
pProj->hitboxBottom = 0x8;
pProj->hitboxLeft = -0x8;
pProj->hitboxRight = 0x8;
pProj->movementStage++;
ProjectileCheckHitBlock(pProj, CAA_MISSILE, PE_HITTING_SOMETHING_WITH_MISSILE);
}
@ -1306,10 +1306,10 @@ void ProjectileProcessSuperMissile(struct ProjectileData* pProj)
ProjectileDecrementSuperMissileCounter(pProj);
pProj->animationDurationCounter = 0x0;
pProj->currentAnimationFrame = 0x0;
pProj->hitboxTopOffset = -0xC;
pProj->hitboxBottomOffset = 0xC;
pProj->hitboxLeftOffset = -0xC;
pProj->hitboxRightOffset = 0xC;
pProj->hitboxTop = -0xC;
pProj->hitboxBottom = 0xC;
pProj->hitboxLeft = -0xC;
pProj->hitboxRight = 0xC;
pProj->movementStage++;
ProjectileCheckHitBlock(pProj, CAA_SUPER_MISSILE, PE_HITTING_SOMETHING_WITH_SUPER_MISSILE);
}
@ -1343,17 +1343,17 @@ void ProjectileMorphballLauncherCheckLaunchSamus(struct ProjectileData* pProj)
samusY = gSamusData.yPosition;
samusX = gSamusData.xPosition;
samusTop = samusY + gSamusPhysics.drawDistanceTopOffset;
samusBottom = samusY + gSamusPhysics.drawDistanceBottomOffset;
samusTop = samusY + gSamusPhysics.drawDistanceTop;
samusBottom = samusY + gSamusPhysics.drawDistanceBottom;
samusLeft = samusX + gSamusPhysics.drawDistanceLeftOffset;
samusRight = samusX + gSamusPhysics.drawDistanceRightOffset;
projY = pProj->yPosition;
projX = pProj->xPosition;
projTop = projY + pProj->hitboxTopOffset;
projBottom = projY + pProj->hitboxBottomOffset;
projLeft = projX + pProj->hitboxLeftOffset;
projRight = projX + pProj->hitboxRightOffset;
projTop = projY + pProj->hitboxTop;
projBottom = projY + pProj->hitboxBottom;
projLeft = projX + pProj->hitboxLeft;
projRight = projX + pProj->hitboxRight;
if (SpriteUtilCheckObjectsTouching(samusTop, samusBottom, samusLeft, samusRight, projTop, projBottom, projLeft, projRight) && gSamusData.invincibilityTimer == 0x0)
{
@ -1398,17 +1398,17 @@ void ProjectileCheckSamusBombBounce(struct ProjectileData* pProj)
!(ClipdataProcess(samusY - (BLOCK_SIZE + HALF_BLOCK_SIZE), samusX) & CLIPDATA_TYPE_SOLID_FLAG))
{
previousX = gPreviousXPosition;
samusTop = samusY + gSamusPhysics.drawDistanceTopOffset;
samusBottom = samusY + gSamusPhysics.drawDistanceBottomOffset;
samusTop = samusY + gSamusPhysics.drawDistanceTop;
samusBottom = samusY + gSamusPhysics.drawDistanceBottom;
samusLeft = samusX + gSamusPhysics.drawDistanceLeftOffset;
samusRight = samusX + gSamusPhysics.drawDistanceRightOffset;
projY = pProj->yPosition;
projX = pProj->xPosition;
projTop = projY + pProj->hitboxTopOffset;
projBottom = projY + pProj->hitboxBottomOffset;
projLeft = projX + pProj->hitboxLeftOffset;
projRight = projX + pProj->hitboxRightOffset;
projTop = projY + pProj->hitboxTop;
projBottom = projY + pProj->hitboxBottom;
projLeft = projX + pProj->hitboxLeft;
projRight = projX + pProj->hitboxRight;
if (SpriteUtilCheckObjectsTouching(samusTop, samusBottom, samusLeft, samusRight,
projTop, projBottom, projLeft, projRight))
@ -1452,10 +1452,10 @@ void ProjectileProcessBomb(struct ProjectileData* pProj)
pProj->animationDurationCounter = 0x0;
pProj->currentAnimationFrame = 0x0;
pProj->drawDistanceOffset = 0x20;
pProj->hitboxTopOffset = -0x3C;
pProj->hitboxBottomOffset = 0x30;
pProj->hitboxLeftOffset = -0x30;
pProj->hitboxRightOffset = 0x30;
pProj->hitboxTop = -0x3C;
pProj->hitboxBottom = 0x30;
pProj->hitboxLeft = -0x30;
pProj->hitboxRight = 0x30;
pProj->status &= ~(PROJ_STATUS_NOT_DRAWN | PROJ_STATUS_XFLIP); // Clear Not Drawn and X Flip status, X Flip is cleared to make it always face the same way, cancelling the automatic X Flip if samus is facing right
pProj->status |= PROJ_STATUS_HIGH_PRIORITY;
pProj->timer = 0x10; // Timer before the bomb starts spinning faster
@ -1598,10 +1598,10 @@ void ProjectileProcessPowerBomb(struct ProjectileData* pProj)
pProj->animationDurationCounter = 0x0;
pProj->currentAnimationFrame = 0x0;
pProj->drawDistanceOffset = 0x20;
pProj->hitboxTopOffset = -0x10;
pProj->hitboxBottomOffset = 0x10;
pProj->hitboxLeftOffset = -0x10;
pProj->hitboxRightOffset = 0x10;
pProj->hitboxTop = -0x10;
pProj->hitboxBottom = 0x10;
pProj->hitboxLeft = -0x10;
pProj->hitboxRight = 0x10;
pProj->status &= ~(PROJ_STATUS_NOT_DRAWN | PROJ_STATUS_XFLIP);
pProj->status |= PROJ_STATUS_HIGH_PRIORITY;
pProj->timer = 0x36;

View File

@ -140,10 +140,10 @@ u8 ProjectileInit(u8 type, u16 yPosition, u16 xPosition)
pProj->type = type;
pProj->yPosition = yPosition;
pProj->xPosition = xPosition;
pProj->hitboxTopOffset = -0x1;
pProj->hitboxBottomOffset = hitbox;
pProj->hitboxLeftOffset = -0x1;
pProj->hitboxRightOffset = hitbox;
pProj->hitboxTop = -0x1;
pProj->hitboxBottom = hitbox;
pProj->hitboxLeft = -0x1;
pProj->hitboxRight = hitbox;
pProj->movementStage = 0x0;
pProj->timer = pProj->movementStage;
pProj->direction = pData->armCannonDirection;
@ -1140,10 +1140,10 @@ void ProjectileCheckHittingSprite(void)
{
o1y = gCurrentPowerBomb.yPosition;
o1x = gCurrentPowerBomb.xPosition;
o1Top = o1y + gCurrentPowerBomb.hitboxTopOffset;
o1Bottom = o1y + gCurrentPowerBomb.hitboxBottomOffset;
o1Left = o1x + gCurrentPowerBomb.hitboxLeftOffset;
o1Right = o1x + gCurrentPowerBomb.hitboxRightOffset;
o1Top = o1y + gCurrentPowerBomb.hitboxTop;
o1Bottom = o1y + gCurrentPowerBomb.hitboxBottom;
o1Left = o1x + gCurrentPowerBomb.hitboxLeft;
o1Right = o1x + gCurrentPowerBomb.hitboxRight;
statusCheck = SPRITE_STATUS_EXISTS | SPRITE_STATUS_IGNORE_PROJECTILES;
@ -1153,10 +1153,10 @@ void ProjectileCheckHittingSprite(void)
{
o2y = pSprite->yPosition;
o2x = pSprite->xPosition;
o2Top = o2y + pSprite->hitboxTopOffset;
o2Bottom = o2y + pSprite->hitboxBottomOffset;
o2Left = o2x + pSprite->hitboxLeftOffset;
o2Right = o2x + pSprite->hitboxRightOffset;
o2Top = o2y + pSprite->hitboxTop;
o2Bottom = o2y + pSprite->hitboxBottom;
o2Left = o2x + pSprite->hitboxLeft;
o2Right = o2x + pSprite->hitboxRight;
if (SpriteUtilCheckObjectsTouching(o2Top, o2Bottom, o2Left, o2Right, o1Top, o1Bottom, o1Left, o1Right))
ProjectilePowerBombDealDamage(pSprite);
@ -1186,10 +1186,10 @@ void ProjectileCheckHittingSprite(void)
{
o1y = pSprite->yPosition;
o1x = pSprite->xPosition;
o1Top = o1y + pSprite->hitboxTopOffset;
o1Bottom = o1y + pSprite->hitboxBottomOffset;
o1Left = o1x + pSprite->hitboxLeftOffset;
o1Right = o1x + pSprite->hitboxRightOffset;
o1Top = o1y + pSprite->hitboxTop;
o1Bottom = o1y + pSprite->hitboxBottom;
o1Left = o1x + pSprite->hitboxLeft;
o1Right = o1x + pSprite->hitboxRight;
statusCheck = PROJ_STATUS_EXISTS | PROJ_STATUS_CAN_AFFECT_ENVIRONMENT;
for (pProj = gProjectileData; pProj < gProjectileData + MAX_AMOUNT_OF_PROJECTILES; pProj++)
@ -1199,10 +1199,10 @@ void ProjectileCheckHittingSprite(void)
o2y = pProj->yPosition;
o2x = pProj->xPosition;
o2Top = o2y + pProj->hitboxTopOffset;
o2Bottom = o2y + pProj->hitboxBottomOffset;
o2Left = o2x + pProj->hitboxLeftOffset;
o2Right = o2x + pProj->hitboxRightOffset;
o2Top = o2y + pProj->hitboxTop;
o2Bottom = o2y + pProj->hitboxBottom;
o2Left = o2x + pProj->hitboxLeft;
o2Right = o2x + pProj->hitboxRight;
if (!SpriteUtilCheckObjectsTouching(o1Top, o1Bottom, o1Left, o1Right, o2Top, o2Bottom, o2Left, o2Right))
continue;
@ -1450,7 +1450,7 @@ void ProjectileCheckHittingSprite(void)
case PROJ_TYPE_CHARGED_PISTOL:
if (pSprite->samusCollision == SSC_SPACE_PIRATE)
{
pSprite->standingOnSprite = FALSE;
pSprite->standingOnSprite = SAMUS_STANDING_ON_SPRITE_OFF;
pSprite->freezeTimer = 60;
pSprite->paletteRow = 1;
pSprite->absolutePaletteRow = 1;
@ -1524,10 +1524,10 @@ u8 ProjectileIceBeamDealDamage(struct SpriteData* pSprite, u16 damage)
pSprite->properties |= SP_DESTROYED;
pSprite->freezeTimer = 0x0;
pSprite->paletteRow = 0x0;
if (pSprite->standingOnSprite && gSamusData.standingStatus == STANDING_ENEMY)
if (pSprite->standingOnSprite != SAMUS_STANDING_ON_SPRITE_OFF && gSamusData.standingStatus == STANDING_ENEMY)
{
gSamusData.standingStatus = STANDING_MIDAIR;
pSprite->standingOnSprite = FALSE;
pSprite->standingOnSprite = SAMUS_STANDING_ON_SPRITE_OFF;
}
pSprite->pose = SPRITE_POSE_DESTROYED;
pSprite->ignoreSamusCollisionTimer = 0x1;
@ -1559,10 +1559,10 @@ u8 ProjectileDealDamage(struct SpriteData* pSprite, u16 damage)
pSprite->properties |= SP_DESTROYED;
pSprite->freezeTimer = 0x0;
pSprite->paletteRow = 0x0;
if (pSprite->standingOnSprite && gSamusData.standingStatus == STANDING_ENEMY)
if (pSprite->standingOnSprite != SAMUS_STANDING_ON_SPRITE_OFF && gSamusData.standingStatus == STANDING_ENEMY)
{
gSamusData.standingStatus = STANDING_MIDAIR;
pSprite->standingOnSprite = FALSE;
pSprite->standingOnSprite = SAMUS_STANDING_ON_SPRITE_OFF;
}
pSprite->pose = SPRITE_POSE_DESTROYED;
pSprite->ignoreSamusCollisionTimer = 0x1;
@ -1638,10 +1638,10 @@ void ProjectilePowerBombDealDamage(struct SpriteData* pSprite)
pSprite->properties |= SP_DESTROYED;
pSprite->freezeTimer = 0x0;
pSprite->paletteRow = 0x0;
if (pSprite->standingOnSprite && gSamusData.standingStatus == STANDING_ENEMY)
if (pSprite->standingOnSprite != SAMUS_STANDING_ON_SPRITE_OFF && gSamusData.standingStatus == STANDING_ENEMY)
{
gSamusData.standingStatus = STANDING_MIDAIR;
pSprite->standingOnSprite = FALSE;
pSprite->standingOnSprite = SAMUS_STANDING_ON_SPRITE_OFF;
}
pSprite->pose = SPRITE_POSE_DESTROYED;
pSprite->ignoreSamusCollisionTimer = 0x1;

View File

@ -524,7 +524,7 @@ void RoomReset(void)
gSamusDoorPositionOffset = 0;
else
{
temp = gSamusPhysics.drawDistanceTopOffset;
temp = gSamusPhysics.drawDistanceTop;
yOffset = (u16)-temp;
temp = (u16)yOffset;
if (temp + gSamusDoorPositionOffset > UCHAR_MAX)

View File

@ -53,13 +53,13 @@ void SamusCheckScrewSpeedboosterAffectingEnvironment(struct SamusData* pData, st
if (action == DESTRUCTING_ACTION_NONE)
return;
hitboxLeft = pData->xPosition + pPhysics->hitboxLeftOffset;
hitboxRight = pData->xPosition + pPhysics->hitboxRightOffset;
hitboxTop = pData->yPosition + pPhysics->hitboxTopOffset;
hitboxLeft = pData->xPosition + pPhysics->hitboxLeft;
hitboxRight = pData->xPosition + pPhysics->hitboxRight;
hitboxTop = pData->yPosition + pPhysics->hitboxTop;
hitboxBottom = pData->yPosition;
checkBlockBelow = FALSE;
if (pPhysics->hitboxTopOffset < -BLOCK_SIZE)
if (pPhysics->hitboxTop < -BLOCK_SIZE)
checkBlockBelow = TRUE;
BlockSamusApplyScrewSpeedboosterDamageToEnvironment(hitboxLeft, hitboxTop, action);
@ -186,11 +186,11 @@ u8 unk_5604(struct SamusData* pData, struct SamusPhysics* pPhysics, u16 xPositio
result = SAMUS_COLLISION_DETECTION_NONE;
if (pPhysics->horizontalMovingDirection == HDMOVING_LEFT)
*pPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxLeftOffset;
*pPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxLeft;
else
*pPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxRightOffset + SUB_PIXEL_POSITION_FLAG;
*pPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxRight + SUB_PIXEL_POSITION_FLAG;
yPosition = pData->yPosition + pPhysics->hitboxTopOffset;
yPosition = pData->yPosition + pPhysics->hitboxTop;
clipdata = ClipdataProcessForSamus(yPosition, xPosition);
switch (LOW_BYTE(clipdata))
@ -208,7 +208,7 @@ u8 unk_5604(struct SamusData* pData, struct SamusPhysics* pPhysics, u16 xPositio
result += SAMUS_COLLISION_DETECTION_LEFT_MOST;
}
if (pPhysics->hitboxTopOffset >= -BLOCK_SIZE)
if (pPhysics->hitboxTop >= -BLOCK_SIZE)
return result;
clipdata = ClipdataProcessForSamus(yPosition + BLOCK_SIZE, xPosition);
@ -249,9 +249,9 @@ u8 SamusCheckTopSideCollisionMidAir(struct SamusData* pData, struct SamusPhysics
result = SAMUS_COLLISION_DETECTION_NONE;
if (pPhysics->horizontalMovingDirection == HDMOVING_LEFT)
*pPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxLeftOffset;
*pPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxLeft;
else
*pPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxRightOffset + SUB_PIXEL_POSITION_FLAG;
*pPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxRight + SUB_PIXEL_POSITION_FLAG;
yPosition = pData->yPosition;
clipdata = ClipdataProcessForSamus(yPosition, xPosition);
@ -289,7 +289,7 @@ u8 SamusCheckTopSideCollisionMidAir(struct SamusData* pData, struct SamusPhysics
}
}
if (pPhysics->hitboxTopOffset < -BLOCK_SIZE)
if (pPhysics->hitboxTop < -BLOCK_SIZE)
{
clipdata = ClipdataProcessForSamus(yPosition - BLOCK_SIZE, xPosition);
@ -385,7 +385,7 @@ u8 SamusCheckCollisionAbove(struct SamusData* pData, s32 hitbox)
result = SAMUS_COLLISION_DETECTION_NONE;
yPosition = pData->yPosition + hitbox;
clipdata = ClipdataProcessForSamus(yPosition, pData->xPosition + pPhysics->hitboxLeftOffset);
clipdata = ClipdataProcessForSamus(yPosition, pData->xPosition + pPhysics->hitboxLeft);
if (clipdata & CLIPDATA_TYPE_SOLID_FLAG)
result += SAMUS_COLLISION_DETECTION_LEFT_MOST;
@ -398,7 +398,7 @@ u8 SamusCheckCollisionAbove(struct SamusData* pData, s32 hitbox)
if (clipdata & CLIPDATA_TYPE_SOLID_FLAG)
result += SAMUS_COLLISION_DETECTION_MIDDLE_RIGHT;
clipdata = ClipdataProcessForSamus(yPosition, pData->xPosition + pPhysics->hitboxRightOffset);
clipdata = ClipdataProcessForSamus(yPosition, pData->xPosition + pPhysics->hitboxRight);
if (clipdata & CLIPDATA_TYPE_SOLID_FLAG)
result += SAMUS_COLLISION_DETECTION_RIGHT_MOST;
@ -427,14 +427,14 @@ u8 SamusCheckWalkingSidesCollision(struct SamusData* pData, struct SamusPhysics*
if (pPhysics->horizontalMovingDirection == HDMOVING_LEFT)
{
slope = KEY_LEFT;
frontHitbox = pPhysics->hitboxLeftOffset;
backHitbox = pPhysics->hitboxRightOffset;
frontHitbox = pPhysics->hitboxLeft;
backHitbox = pPhysics->hitboxRight;
}
else
{
slope = KEY_RIGHT;
frontHitbox = pPhysics->hitboxRightOffset;
backHitbox = pPhysics->hitboxLeftOffset;
frontHitbox = pPhysics->hitboxRight;
backHitbox = pPhysics->hitboxLeft;
}
result = unk_5604(pData, pPhysics, pData->xPosition + frontHitbox, &nextX);
@ -557,9 +557,9 @@ u8 SamusCheckWalkingSidesCollision(struct SamusData* pData, struct SamusPhysics*
if (result != SAMUS_COLLISION_DETECTION_NONE)
{
if (pPhysics->horizontalMovingDirection == HDMOVING_LEFT)
pData->xPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxLeftOffset;
pData->xPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxLeft;
else
pData->xPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxRightOffset + SUB_PIXEL_POSITION_FLAG;
pData->xPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxRight + SUB_PIXEL_POSITION_FLAG;
pData->yPosition = nextY - ONE_SUB_PIXEL;
}
@ -624,24 +624,24 @@ u8 SamusCheckStandingOnGroundCollision(struct SamusData* pData, struct SamusPhys
u16 xPosition;
u16 slope;
above = SamusCheckCollisionAbove(pData, pPhysics->hitboxTopOffset);
above = SamusCheckCollisionAbove(pData, pPhysics->hitboxTop);
if (above == SAMUS_COLLISION_DETECTION_LEFT_MOST ||
above == (SAMUS_COLLISION_DETECTION_LEFT_MOST | SAMUS_COLLISION_DETECTION_MIDDLE_LEFT))
{
pData->xPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxLeftOffset;
pData->xPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxLeft;
}
else if (above == SAMUS_COLLISION_DETECTION_RIGHT_MOST ||
above == (SAMUS_COLLISION_DETECTION_RIGHT_MOST | SAMUS_COLLISION_DETECTION_MIDDLE_RIGHT))
{
pData->xPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxRightOffset + SUB_PIXEL_POSITION_FLAG;
pData->xPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxRight + SUB_PIXEL_POSITION_FLAG;
}
if (pData->standingStatus != STANDING_ENEMY)
{
if (SamusCheckCollisionAtPosition(pData->xPosition + pPhysics->hitboxLeftOffset, pData->yPosition + 1,
if (SamusCheckCollisionAtPosition(pData->xPosition + pPhysics->hitboxLeft, pData->yPosition + 1,
&xPosition, &yPosition, &slope) == CLIPDATA_TYPE_AIR)
{
if (SamusCheckCollisionAtPosition(pData->xPosition + pPhysics->hitboxRightOffset, pData->yPosition + 1,
if (SamusCheckCollisionAtPosition(pData->xPosition + pPhysics->hitboxRight, pData->yPosition + 1,
&xPosition, &yPosition, &slope) == CLIPDATA_TYPE_AIR)
return SPOSE_MID_AIR_REQUEST;
}
@ -675,12 +675,12 @@ u8 SamusCheckLandingCollision(struct SamusData* pData, struct SamusPhysics* pPhy
if (pPhysics->horizontalMovingDirection == HDMOVING_LEFT)
{
hHitbox = pPhysics->hitboxLeftOffset;
hHitbox = pPhysics->hitboxLeft;
}
else
{
hHitbox = pPhysics->hitboxLeftOffset;
hHitbox = pPhysics->hitboxRightOffset;
hHitbox = pPhysics->hitboxLeft;
hHitbox = pPhysics->hitboxRight;
}
if (unk_5604(pData, pPhysics, pData->xPosition + hHitbox, &resultXLeft) != SAMUS_COLLISION_DETECTION_NONE)
@ -695,10 +695,10 @@ u8 SamusCheckLandingCollision(struct SamusData* pData, struct SamusPhysics* pPhy
blockY = pData->yPosition & BLOCK_POSITION_FLAG;
prevBlockY = gPreviousYPosition & BLOCK_POSITION_FLAG;
collisionLeft = SamusCheckCollisionAtPosition(pData->xPosition + pPhysics->hitboxLeftOffset, pData->yPosition,
collisionLeft = SamusCheckCollisionAtPosition(pData->xPosition + pPhysics->hitboxLeft, pData->yPosition,
&resultXLeft, &resultYLeft, &resultSlopeLeft);
collisionRight = SamusCheckCollisionAtPosition(pData->xPosition + pPhysics->hitboxRightOffset, pData->yPosition,
collisionRight = SamusCheckCollisionAtPosition(pData->xPosition + pPhysics->hitboxRight, pData->yPosition,
&resultXRight, &resultYRight, &resultSlopeRight);
if (blockY > prevBlockY)
@ -721,7 +721,7 @@ u8 SamusCheckLandingCollision(struct SamusData* pData, struct SamusPhysics* pPhy
{
u16 tmpResultSlopeLeft;
SamusCheckCollisionAtPosition(pData->xPosition + pPhysics->hitboxLeftOffset, pData->yPosition - BLOCK_SIZE,
SamusCheckCollisionAtPosition(pData->xPosition + pPhysics->hitboxLeft, pData->yPosition - BLOCK_SIZE,
&resultXLeft, &resultYLeft, &resultSlopeLeft);
pData->yPosition = resultYLeft;
@ -741,7 +741,7 @@ u8 SamusCheckLandingCollision(struct SamusData* pData, struct SamusPhysics* pPhy
}
else
{
SamusCheckCollisionAtPosition(pData->xPosition + pPhysics->hitboxRightOffset, pData->yPosition - BLOCK_SIZE,
SamusCheckCollisionAtPosition(pData->xPosition + pPhysics->hitboxRight, pData->yPosition - BLOCK_SIZE,
&resultXLeft, &resultYLeft, &resultSlopeLeft);
pData->yPosition = resultYLeft;
@ -769,7 +769,7 @@ u8 SamusCheckLandingCollision(struct SamusData* pData, struct SamusPhysics* pPhy
return SPOSE_LANDING_REQUEST;
}
pData->xPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxLeftOffset;
pData->xPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxLeft;
pPhysics->touchingSideBlock++;
}
else if (collisionRight != CLIPDATA_TYPE_AIR)
@ -781,7 +781,7 @@ u8 SamusCheckLandingCollision(struct SamusData* pData, struct SamusPhysics* pPhy
return SPOSE_LANDING_REQUEST;
}
pData->xPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxRightOffset + SUB_PIXEL_POSITION_FLAG;
pData->xPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxRight + SUB_PIXEL_POSITION_FLAG;
pPhysics->touchingSideBlock++;
}
@ -807,10 +807,10 @@ u8 SamusCheckTopCollision(struct SamusData* pData, struct SamusPhysics* pPhysics
u16 nextSlope;
if (pPhysics->horizontalMovingDirection == HDMOVING_LEFT)
hitbox = pPhysics->hitboxLeftOffset;
hitbox = pPhysics->hitboxLeft;
else
hitbox = pPhysics->hitboxRightOffset;
pLeftHitbox = &pPhysics->hitboxLeftOffset;
hitbox = pPhysics->hitboxRight;
pLeftHitbox = &pPhysics->hitboxLeft;
result = SamusCheckTopSideCollisionMidAir(pData, pPhysics, pData->xPosition + hitbox, &nextX);
@ -832,7 +832,7 @@ u8 SamusCheckTopCollision(struct SamusData* pData, struct SamusPhysics* pPhysics
pPhysics->touchingSideBlock++;
}
result = SamusCheckCollisionAbove(pData, pPhysics->hitboxTopOffset);
result = SamusCheckCollisionAbove(pData, pPhysics->hitboxTop);
if (result == SAMUS_COLLISION_DETECTION_LEFT_MOST)
{
@ -841,13 +841,13 @@ u8 SamusCheckTopCollision(struct SamusData* pData, struct SamusPhysics* pPhysics
}
else if (result == SAMUS_COLLISION_DETECTION_RIGHT_MOST)
{
pData->xPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxRightOffset + SUB_PIXEL_POSITION_FLAG;
pData->xPosition = (pData->xPosition & BLOCK_POSITION_FLAG) - pPhysics->hitboxRight + SUB_PIXEL_POSITION_FLAG;
gPreviousXPosition = pData->xPosition;
}
else if (result & SAMUS_COLLISION_DETECTION_MIDDILE)
{
topOffset = pData->yPosition + pPhysics->hitboxTopOffset;
pData->yPosition = (topOffset & BLOCK_POSITION_FLAG) - pPhysics->hitboxTopOffset + BLOCK_SIZE;
topOffset = pData->yPosition + pPhysics->hitboxTop;
pData->yPosition = (topOffset & BLOCK_POSITION_FLAG) - pPhysics->hitboxTop + BLOCK_SIZE;
pData->yVelocity = 0;
pPhysics->touchingTopBlock++;
}
@ -1241,7 +1241,7 @@ void SamusCheckSetEnvironmentalEffect(struct SamusData* pData, u32 defaultOffset
xPosition = pData->xPosition - (QUARTER_BLOCK_SIZE - PIXEL_SIZE);
// Spawn near head
yPosition = pData->yPosition + pPhysics->drawDistanceTopOffset + QUARTER_BLOCK_SIZE;
yPosition = pData->yPosition + pPhysics->drawDistanceTop + QUARTER_BLOCK_SIZE;
SoundPlay(SOUND_WATER_BUBBLES);
break;
@ -1386,13 +1386,13 @@ void SamusUpdateEnvironmentalEffect(struct SamusData* pData)
// Get liquid at the current position and above samus
affecting = LOW_BYTE(ClipdataCheckCurrentAffectingAtPosition(yPosition, pData->xPosition));
affectingTop = LOW_BYTE(ClipdataCheckCurrentAffectingAtPosition(yPosition + pPhysics->drawDistanceTopOffset - PIXEL_SIZE * 2,
affectingTop = LOW_BYTE(ClipdataCheckCurrentAffectingAtPosition(yPosition + pPhysics->drawDistanceTop - PIXEL_SIZE * 2,
pData->xPosition));
if (pPhysics->drawDistanceTopOffset > -BLOCK_SIZE)
if (pPhysics->drawDistanceTop > -BLOCK_SIZE)
liquidY = yPosition - BLOCK_SIZE;
else
liquidY = yPosition + pPhysics->drawDistanceTopOffset;
liquidY = yPosition + pPhysics->drawDistanceTop;
affectingLiquid = LOW_BYTE(ClipdataCheckCurrentAffectingAtPosition(liquidY, pData->xPosition));
@ -2685,9 +2685,9 @@ void SamusUpdateHitboxMovingDirection(void)
pPhysics->standingStatus = sSamusVisualData[pData->pose][2];
// Update hitbox
pPhysics->hitboxLeftOffset = sSamusHitboxData[pPhysics->hitboxType][SAMUS_HITBOX_LEFT];
pPhysics->hitboxRightOffset = sSamusHitboxData[pPhysics->hitboxType][SAMUS_HITBOX_RIGHT];
pPhysics->hitboxTopOffset = sSamusHitboxData[pPhysics->hitboxType][SAMUS_HITBOX_TOP];
pPhysics->hitboxLeft = sSamusHitboxData[pPhysics->hitboxType][SAMUS_HITBOX_LEFT];
pPhysics->hitboxRight = sSamusHitboxData[pPhysics->hitboxType][SAMUS_HITBOX_RIGHT];
pPhysics->hitboxTop = sSamusHitboxData[pPhysics->hitboxType][SAMUS_HITBOX_TOP];
if (pPhysics->standingStatus == STANDING_NOT_IN_CONTROL)
pPhysics->verticalMovingDirection = VDMOVING_DOWN;
@ -7581,9 +7581,9 @@ void SamusUpdateDrawDistanceAndStandingStatus(struct SamusData* pData, struct Sa
offset = sSamusVisualData[pData->pose][0];
pPhysics->drawDistanceLeftOffset = sSamusDrawDistanceOffsets[offset][0];
pPhysics->drawDistanceTopOffset = sSamusDrawDistanceOffsets[offset][1];
pPhysics->drawDistanceTop = sSamusDrawDistanceOffsets[offset][1];
pPhysics->drawDistanceRightOffset = sSamusDrawDistanceOffsets[offset][2];
pPhysics->drawDistanceBottomOffset = sSamusDrawDistanceOffsets[offset][3];
pPhysics->drawDistanceBottom = sSamusDrawDistanceOffsets[offset][3];
standing = sSamusVisualData[pData->pose][2];
if (pData->standingStatus != STANDING_ENEMY)

View File

@ -557,8 +557,8 @@ void SpriteDraw(struct SpriteData* pSprite, s32 slot)
if (status_unk3)
{
rotation = pSprite->oamRotation;
scaling = pSprite->oamScaling;
rotation = pSprite->rotation;
scaling = pSprite->scaling;
// Rotation matrix (column major mode) :
// [ cos / scaling, -sin / scaling ]
@ -583,8 +583,8 @@ void SpriteDraw(struct SpriteData* pSprite, s32 slot)
}
else
{
rotation = pSprite->oamRotation;
scaling = pSprite->oamScaling;
rotation = pSprite->rotation;
scaling = pSprite->scaling;
mosaic = pSprite->status & SPRITE_STATUS_MOSAIC;
@ -781,14 +781,14 @@ void SpriteCheckOnScreen(struct SpriteData* pSprite)
bgYRange = bgBaseY + BLOCK_TO_SUB_PIXEL(CEIL(SCREEN_SIZE_X_BLOCKS / 2));
spriteYRange = spriteY + BLOCK_TO_SUB_PIXEL(CEIL(SCREEN_SIZE_X_BLOCKS / 2));
spriteBottom = bgYRange - PIXEL_TO_SUB_PIXEL(pSprite->drawDistanceBottomOffset);
drawOffset = PIXEL_TO_SUB_PIXEL(pSprite->drawDistanceTopOffset) + SCREEN_SIZE_Y_SUB_PIXEL;
spriteBottom = bgYRange - PIXEL_TO_SUB_PIXEL(pSprite->drawDistanceBottom);
drawOffset = PIXEL_TO_SUB_PIXEL(pSprite->drawDistanceTop) + SCREEN_SIZE_Y_SUB_PIXEL;
spriteTop = bgYRange + drawOffset;
bgXRange = bgBaseX + BLOCK_TO_SUB_PIXEL(CEIL(SCREEN_SIZE_X_BLOCKS / 2));
spriteXRange = spriteX + BLOCK_TO_SUB_PIXEL(CEIL(SCREEN_SIZE_X_BLOCKS / 2));
spriteLeft = bgXRange - PIXEL_TO_SUB_PIXEL(pSprite->drawDistanceHorizontalOffset);
drawOffset = PIXEL_TO_SUB_PIXEL(pSprite->drawDistanceHorizontalOffset) + SCREEN_SIZE_X_SUB_PIXEL;
spriteLeft = bgXRange - PIXEL_TO_SUB_PIXEL(pSprite->drawDistanceHorizontal);
drawOffset = PIXEL_TO_SUB_PIXEL(pSprite->drawDistanceHorizontal) + SCREEN_SIZE_X_SUB_PIXEL;
spriteRight = bgXRange + drawOffset;
if (spriteLeft < spriteXRange && spriteXRange < spriteRight && spriteBottom < spriteYRange && spriteYRange < spriteTop)
@ -963,7 +963,7 @@ void SpriteClearData(void)
for (i = 0; i < MAX_AMOUNT_OF_SPRITES; i++)
{
gSpriteData[i].status = 0;
gSpriteData[i].standingOnSprite = FALSE;
gSpriteData[i].standingOnSprite = SAMUS_STANDING_ON_SPRITE_OFF;
gSpriteData[i].roomSlot = UCHAR_MAX;
}
@ -1066,7 +1066,7 @@ void SpriteInitPrimary(u8 spritesetSlot, u16 yPosition, u16 xPosition, u8 roomSl
pSprite->ignoreSamusCollisionTimer = 1;
pSprite->primarySpriteRamSlot = ramSlot;
pSprite->freezeTimer = 0;
pSprite->standingOnSprite = FALSE;
pSprite->standingOnSprite = SAMUS_STANDING_ON_SPRITE_OFF;
break;
}
}
@ -1119,7 +1119,7 @@ u8 SpriteSpawnSecondary(u8 spriteId, u8 roomSlot, u8 gfxSlot, u8 ramSlot, u16 yP
pSprite->primarySpriteRamSlot = ramSlot;
pSprite->freezeTimer = 0;
pSprite->standingOnSprite = FALSE;
pSprite->standingOnSprite = SAMUS_STANDING_ON_SPRITE_OFF;
return newSlot;
}
@ -1174,7 +1174,7 @@ u8 SpriteSpawnPrimary(u8 spriteId, u8 roomSlot, u8 gfxSlot, u16 yPosition, u16 x
pSprite->primarySpriteRamSlot = newSlot;
pSprite->freezeTimer = 0;
pSprite->standingOnSprite = FALSE;
pSprite->standingOnSprite = SAMUS_STANDING_ON_SPRITE_OFF;
return newSlot;
}
@ -1230,7 +1230,7 @@ u8 SpriteSpawnDropFollowers(u8 spriteId, u8 roomSlot, u8 gfxSlot, u8 ramSlot, u1
pSprite->primarySpriteRamSlot = ramSlot;
pSprite->freezeTimer = 0;
pSprite->standingOnSprite = FALSE;
pSprite->standingOnSprite = SAMUS_STANDING_ON_SPRITE_OFF;
return newSlot;
}

View File

@ -52,7 +52,7 @@ void SpriteUtilInitLocationText(void)
gSpriteData[0].ignoreSamusCollisionTimer = 1;
gSpriteData[0].primarySpriteRamSlot = 0;
gSpriteData[0].freezeTimer = 0;
gSpriteData[0].standingOnSprite = FALSE;
gSpriteData[0].standingOnSprite = SAMUS_STANDING_ON_SPRITE_OFF;
}
}
@ -235,8 +235,8 @@ void SpriteUtilSamusAndSpriteCollision(void)
samusX = pData->xPosition;
previousX = gPreviousXPosition;
samusTop = samusY + gSamusPhysics.drawDistanceTopOffset;
samusBottom = samusY + gSamusPhysics.drawDistanceBottomOffset;
samusTop = samusY + gSamusPhysics.drawDistanceTop;
samusBottom = samusY + gSamusPhysics.drawDistanceBottom;
samusLeft = samusX + gSamusPhysics.drawDistanceLeftOffset;
samusRight = samusX + gSamusPhysics.drawDistanceRightOffset;
@ -284,10 +284,10 @@ void SpriteUtilSamusAndSpriteCollision(void)
spriteY = pSprite->yPosition;
spriteX = pSprite->xPosition;
spriteTop = pSprite->yPosition + pSprite->hitboxTopOffset;
spriteBottom = pSprite->yPosition + pSprite->hitboxBottomOffset;
spriteLeft = pSprite->xPosition + pSprite->hitboxLeftOffset;
spriteRight = pSprite->xPosition + pSprite->hitboxRightOffset;
spriteTop = pSprite->yPosition + pSprite->hitboxTop;
spriteBottom = pSprite->yPosition + pSprite->hitboxBottom;
spriteLeft = pSprite->xPosition + pSprite->hitboxLeft;
spriteRight = pSprite->xPosition + pSprite->hitboxRight;
if (!SpriteUtilCheckObjectsTouching(samusTop, samusBottom, samusLeft, samusRight, spriteTop, spriteBottom, spriteLeft, spriteRight))
continue;
@ -325,20 +325,20 @@ void SpriteUtilSamusAndSpriteCollision(void)
{
if ((samusY - 0x18) < spriteTop)
{
SpriteUtilCheckCollisionAtPosition(spriteTop + ONE_SUB_PIXEL + gSamusPhysics.drawDistanceTopOffset, samusX);
SpriteUtilCheckCollisionAtPosition(spriteTop + ONE_SUB_PIXEL + gSamusPhysics.drawDistanceTop, samusX);
if (gPreviousCollisionCheck == COLLISION_AIR && pData->yVelocity <= 0)
{
pData->yPosition = spriteTop + ONE_SUB_PIXEL;
pSprite->status |= SPRITE_STATUS_SAMUS_ON_TOP;
pSprite->standingOnSprite = 0x2;
pSprite->standingOnSprite = SAMUS_STANDING_ON_SPRITE_ON;
}
}
else if (samusTop + QUARTER_BLOCK_SIZE > spriteBottom)
{
SpriteUtilCheckCollisionAtPosition(spriteBottom - gSamusPhysics.drawDistanceTopOffset, samusX);
SpriteUtilCheckCollisionAtPosition(spriteBottom - gSamusPhysics.drawDistanceTop, samusX);
if (gPreviousCollisionCheck == COLLISION_AIR)
{
pData->yPosition = spriteBottom - gSamusPhysics.drawDistanceTopOffset;
pData->yPosition = spriteBottom - gSamusPhysics.drawDistanceTop;
if (pData->yVelocity > 0 && gEquipment.currentEnergy != 0)
pData->yVelocity = 0;
}
@ -369,20 +369,20 @@ void SpriteUtilSamusAndSpriteCollision(void)
{
if (samusY - 0x18 < spriteTop)
{
SpriteUtilCheckCollisionAtPosition(spriteTop + 1 + gSamusPhysics.drawDistanceTopOffset, samusX);
SpriteUtilCheckCollisionAtPosition(spriteTop + 1 + gSamusPhysics.drawDistanceTop, samusX);
if (gPreviousCollisionCheck == COLLISION_AIR && pData->yVelocity <= 0)
{
pData->yPosition = spriteTop + ONE_SUB_PIXEL;
pSprite->status |= SPRITE_STATUS_SAMUS_ON_TOP;
pSprite->standingOnSprite = 2;
pSprite->standingOnSprite = SAMUS_STANDING_ON_SPRITE_ON;
}
}
else if (samusTop + 0x10 > spriteBottom)
{
SpriteUtilCheckCollisionAtPosition(spriteBottom - gSamusPhysics.drawDistanceTopOffset, samusX);
SpriteUtilCheckCollisionAtPosition(spriteBottom - gSamusPhysics.drawDistanceTop, samusX);
if (gPreviousCollisionCheck == COLLISION_AIR)
{
pData->yPosition = spriteBottom - gSamusPhysics.drawDistanceTopOffset;
pData->yPosition = spriteBottom - gSamusPhysics.drawDistanceTop;
if (pData->yVelocity > 0 && gEquipment.currentEnergy != 0)
pData->yVelocity = 0;
}
@ -400,12 +400,12 @@ void SpriteUtilSamusAndSpriteCollision(void)
case SSC_ESCAPE_SHIP:
if (!SpriteUtilCheckPullingSelfUp() && SpriteUtilSpriteTakeDamageFromSamusContact(pSprite, pData) == DCT_NONE && samusY - 0x18 < spriteTop)
{
SpriteUtilCheckCollisionAtPosition(spriteTop + 1 + gSamusPhysics.drawDistanceTopOffset, samusX);
SpriteUtilCheckCollisionAtPosition(spriteTop + 1 + gSamusPhysics.drawDistanceTop, samusX);
if (gPreviousCollisionCheck == COLLISION_AIR && pData->yVelocity <= 0)
{
pData->yPosition = spriteTop + 1;
pSprite->status |= SPRITE_STATUS_SAMUS_ON_TOP;
pSprite->standingOnSprite = 2;
pSprite->standingOnSprite = SAMUS_STANDING_ON_SPRITE_ON;
}
}
break;
@ -417,12 +417,12 @@ void SpriteUtilSamusAndSpriteCollision(void)
{
if (!SpriteUtilCheckPullingSelfUp() && pData->invincibilityTimer < 40)
{
SpriteUtilCheckCollisionAtPosition(spriteTop + 1 + gSamusPhysics.drawDistanceTopOffset, samusX);
SpriteUtilCheckCollisionAtPosition(spriteTop + 1 + gSamusPhysics.drawDistanceTop, samusX);
if (gPreviousCollisionCheck == COLLISION_AIR && pData->yVelocity < 1)
{
pData->yPosition = spriteTop + 1;
pSprite->status |= SPRITE_STATUS_SAMUS_ON_TOP;
pSprite->standingOnSprite = 2;
pSprite->standingOnSprite = SAMUS_STANDING_ON_SPRITE_ON;
}
}
}
@ -457,12 +457,12 @@ void SpriteUtilSamusAndSpriteCollision(void)
}
else if (samusY - 0x18 < spriteTop && !SpriteUtilCheckPullingSelfUp() && pData->invincibilityTimer < 38)
{
SpriteUtilCheckCollisionAtPosition(spriteTop + 1 + gSamusPhysics.drawDistanceTopOffset, samusX);
SpriteUtilCheckCollisionAtPosition(spriteTop + 1 + gSamusPhysics.drawDistanceTop, samusX);
if (gPreviousCollisionCheck == COLLISION_AIR && pData->yVelocity < 1)
{
pData->yPosition = spriteTop + 1;
pSprite->status |= SPRITE_STATUS_SAMUS_ON_TOP;
pSprite->standingOnSprite = 2;
pSprite->standingOnSprite = SAMUS_STANDING_ON_SPRITE_ON;
}
}
@ -484,7 +484,7 @@ void SpriteUtilSamusAndSpriteCollision(void)
{
if (pSprite->status & SPRITE_STATUS_FACING_RIGHT)
{
if ((u8)(pSprite->oamRotation - 0x21) <= 0x1E)
if ((u8)(pSprite->rotation - 0x21) <= 0x1E)
{
pSprite->status |= SPRITE_STATUS_SAMUS_COLLIDING;
if (SpriteUtilTakeDamageFromSprite(TRUE, pSprite, 1))
@ -497,7 +497,7 @@ void SpriteUtilSamusAndSpriteCollision(void)
}
else
{
if ((u8)(pSprite->oamRotation + 0x3F) <= 0x1E)
if ((u8)(pSprite->rotation + 0x3F) <= 0x1E)
{
pSprite->status |= SPRITE_STATUS_SAMUS_COLLIDING;
if (SpriteUtilTakeDamageFromSprite(TRUE, pSprite, 1))
@ -724,7 +724,7 @@ void SpriteUtilSamusAndSpriteCollision(void)
}
else if (gPreviousCollisionCheck == COLLISION_AIR)
{
SpriteUtilCheckCollisionAtPosition(samusY + 0x1 + gSamusPhysics.drawDistanceTopOffset, samusX);
SpriteUtilCheckCollisionAtPosition(samusY + 0x1 + gSamusPhysics.drawDistanceTop, samusX);
if (gPreviousCollisionCheck == COLLISION_AIR)
{
SamusSetPose(SPOSE_KNOCKBACK_REQUEST);
@ -1013,22 +1013,22 @@ void unk_f608(void)
u16 xPosition;
u32 blockTop;
yPosition = gCurrentSprite.yPosition + gCurrentSprite.hitboxBottomOffset;
yPosition = gCurrentSprite.yPosition + gCurrentSprite.hitboxBottom;
xPosition = gCurrentSprite.xPosition;
blockTop = SpriteUtilCheckVerticalCollisionAtPosition(yPosition - 0x4, xPosition);
if ((gPreviousVerticalCollisionCheck & (0x1 | COLLISION_LEFT_SLIGHT_FLOOR_SLOPE | COLLISION_LEFT_STEEP_FLOOR_SLOPE | 0x8)) > 0x1)
gCurrentSprite.yPosition = blockTop - gCurrentSprite.hitboxBottomOffset;
gCurrentSprite.yPosition = blockTop - gCurrentSprite.hitboxBottom;
else
{
blockTop = SpriteUtilCheckVerticalCollisionAtPosition(yPosition, xPosition);
if ((gPreviousVerticalCollisionCheck & (0x1 | COLLISION_LEFT_SLIGHT_FLOOR_SLOPE | COLLISION_LEFT_STEEP_FLOOR_SLOPE | 0x8)) > 0x1)
gCurrentSprite.yPosition = blockTop - gCurrentSprite.hitboxBottomOffset;
gCurrentSprite.yPosition = blockTop - gCurrentSprite.hitboxBottom;
else
{
blockTop = SpriteUtilCheckVerticalCollisionAtPosition(yPosition + 0x4, xPosition);
if (gPreviousVerticalCollisionCheck != COLLISION_AIR)
gCurrentSprite.yPosition = blockTop - gCurrentSprite.hitboxBottomOffset;
gCurrentSprite.yPosition = blockTop - gCurrentSprite.hitboxBottom;
}
}
}
@ -1313,26 +1313,26 @@ void unk_f9e4(s16 movement)
/**
* @brief fa78 | 150 | Calcultes the new oam rotation to rotate a sprite towards a target
*
* @param oamRotation Current rotation
* @param rotation Current rotation
* @param targetY Target Y
* @param targetX Target X
* @param spriteY Current Y
* @param spriteX Current X
* @return u8 New rotation
*/
u8 SpriteUtilMakeSpriteFaceSamusRotation(s32 oamRotation, s32 targetY, s32 targetX, s32 spriteY, s32 spriteX)
u8 SpriteUtilMakeSpriteFaceSamusRotation(s32 rotation, s32 targetY, s32 targetX, s32 spriteY, s32 spriteX)
{
s32 var_0;
u16 var_1;
s32 intensity;
s32 rotation;
s32 _rotation;
s32 dstY;
s32 dstX;
s32 y;
s32 x;
rotation = (s16)oamRotation;
_rotation = (s16)rotation;
dstY = (s16)targetY;
dstX = (s16)targetX;
y = (s16)spriteY;
@ -1387,62 +1387,62 @@ u8 SpriteUtilMakeSpriteFaceSamusRotation(s32 oamRotation, s32 targetY, s32 targe
if (var_0 == 0)
{
if ((u16)(rotation - 1) < BLOCK_SIZE * 2 - 1)
rotation = (s16)(rotation - intensity);
else if (rotation >+ BLOCK_SIZE * 2 - 1)
rotation = (s16)(rotation + intensity);
if ((u16)(_rotation - 1) < BLOCK_SIZE * 2 - 1)
_rotation = (s16)(_rotation - intensity);
else if (_rotation >+ BLOCK_SIZE * 2 - 1)
_rotation = (s16)(_rotation + intensity);
}
else if (var_0 == HALF_BLOCK_SIZE)
{
if ((u16)(rotation - HALF_BLOCK_SIZE - 1) < BLOCK_SIZE * 2 - 1)
rotation = (s16)(rotation - intensity);
else if ((u16)(rotation - HALF_BLOCK_SIZE) > BLOCK_SIZE * 2 - 1)
rotation = (s16)(rotation + intensity);
if ((u16)(_rotation - HALF_BLOCK_SIZE - 1) < BLOCK_SIZE * 2 - 1)
_rotation = (s16)(_rotation - intensity);
else if ((u16)(_rotation - HALF_BLOCK_SIZE) > BLOCK_SIZE * 2 - 1)
_rotation = (s16)(_rotation + intensity);
}
else if (var_0 == BLOCK_SIZE)
{
if ((u16)(rotation - BLOCK_SIZE - 1) < BLOCK_SIZE * 2 - 1)
rotation = (s16)(rotation - intensity);
else if ((u16)(rotation - BLOCK_SIZE) > BLOCK_SIZE * 2 - 1)
rotation = (s16)(rotation + intensity);
if ((u16)(_rotation - BLOCK_SIZE - 1) < BLOCK_SIZE * 2 - 1)
_rotation = (s16)(_rotation - intensity);
else if ((u16)(_rotation - BLOCK_SIZE) > BLOCK_SIZE * 2 - 1)
_rotation = (s16)(_rotation + intensity);
}
else if (var_0 == BLOCK_SIZE + HALF_BLOCK_SIZE)
{
if ((u16)(rotation - (BLOCK_SIZE + HALF_BLOCK_SIZE) - 1) < BLOCK_SIZE * 2 - 1)
rotation = (s16)(rotation - intensity);
else if ((u16)(rotation - (BLOCK_SIZE + HALF_BLOCK_SIZE)) > BLOCK_SIZE * 2 - 1)
rotation = (s16)(rotation + intensity);
if ((u16)(_rotation - (BLOCK_SIZE + HALF_BLOCK_SIZE) - 1) < BLOCK_SIZE * 2 - 1)
_rotation = (s16)(_rotation - intensity);
else if ((u16)(_rotation - (BLOCK_SIZE + HALF_BLOCK_SIZE)) > BLOCK_SIZE * 2 - 1)
_rotation = (s16)(_rotation + intensity);
}
else if (var_0 == BLOCK_SIZE * 2)
{
if ((u16)(rotation - 1) < BLOCK_SIZE * 2 - 1)
rotation = (s16)(rotation + intensity);
else if (rotation > BLOCK_SIZE * 2)
rotation = (s16)(rotation - intensity);
if ((u16)(_rotation - 1) < BLOCK_SIZE * 2 - 1)
_rotation = (s16)(_rotation + intensity);
else if (_rotation > BLOCK_SIZE * 2)
_rotation = (s16)(_rotation - intensity);
}
else if (var_0 == BLOCK_SIZE * 2 + HALF_BLOCK_SIZE)
{
if ((u16)(rotation - HALF_BLOCK_SIZE - 1) < BLOCK_SIZE * 2 - 1)
rotation = (s16)(rotation + intensity);
else if ((u16)(rotation - HALF_BLOCK_SIZE - 1) > BLOCK_SIZE * 2 - 1)
rotation = (s16)(rotation - intensity);
if ((u16)(_rotation - HALF_BLOCK_SIZE - 1) < BLOCK_SIZE * 2 - 1)
_rotation = (s16)(_rotation + intensity);
else if ((u16)(_rotation - HALF_BLOCK_SIZE - 1) > BLOCK_SIZE * 2 - 1)
_rotation = (s16)(_rotation - intensity);
}
else if (var_0 == BLOCK_SIZE * 3)
{
if ((u16)(rotation - BLOCK_SIZE - 1) < BLOCK_SIZE * 2 - 1)
rotation = (s16)(rotation + intensity);
else if ((u16)(rotation - BLOCK_SIZE - 1) > BLOCK_SIZE * 2 - 1)
rotation = (s16)(rotation - intensity);
if ((u16)(_rotation - BLOCK_SIZE - 1) < BLOCK_SIZE * 2 - 1)
_rotation = (s16)(_rotation + intensity);
else if ((u16)(_rotation - BLOCK_SIZE - 1) > BLOCK_SIZE * 2 - 1)
_rotation = (s16)(_rotation - intensity);
}
else if (var_0 == BLOCK_SIZE * 3 + HALF_BLOCK_SIZE)
{
if ((u16)(rotation - (BLOCK_SIZE + HALF_BLOCK_SIZE) - 1) < BLOCK_SIZE * 2 - 1)
rotation = (s16)(rotation + intensity);
else if ((u16)(rotation - (BLOCK_SIZE + HALF_BLOCK_SIZE) - 1) > BLOCK_SIZE * 2 - 1)
rotation = (s16)(rotation - intensity);
if ((u16)(_rotation - (BLOCK_SIZE + HALF_BLOCK_SIZE) - 1) < BLOCK_SIZE * 2 - 1)
_rotation = (s16)(_rotation + intensity);
else if ((u16)(_rotation - (BLOCK_SIZE + HALF_BLOCK_SIZE) - 1) > BLOCK_SIZE * 2 - 1)
_rotation = (s16)(_rotation - intensity);
}
return rotation;
return _rotation;
}
u32 SpriteUtilCheckEndCurrentSpriteAnim(void)
@ -1629,7 +1629,7 @@ u8 SpriteUtilCheckSamusNearSpriteLeftRight(u16 yRange, u16 xRange)
result = NSLR_OUT_OF_RANGE;
// Get samus middle position visually
samusY = gSamusData.yPosition + gSamusPhysics.drawDistanceTopOffset / 2;
samusY = gSamusData.yPosition + gSamusPhysics.drawDistanceTop / 2;
samusX = gSamusData.xPosition;
// Get sprite position
@ -1685,7 +1685,7 @@ u8 SpriteUtilCheckSamusNearSpriteAboveBelow(u16 yRange, u16 xRange)
result = NSAB_OUT_OF_RANGE;
// Get samus middle position visually
samusY = gSamusData.yPosition + gSamusPhysics.drawDistanceTopOffset / 2;
samusY = gSamusData.yPosition + gSamusPhysics.drawDistanceTop / 2;
samusX = gSamusData.xPosition;
// Get sprite position
@ -1744,7 +1744,7 @@ u32 SpriteUtilCheckSamusNearSpriteFrontBehind(u16 yRange, u16 xRangeFront, u16 x
xFlip = FALSE;
// Get samus middle position visually
samusY = gSamusData.yPosition + gSamusPhysics.drawDistanceTopOffset / 2;
samusY = gSamusData.yPosition + gSamusPhysics.drawDistanceTop / 2;
samusX = gSamusData.xPosition;
// Get sprite position
@ -1813,8 +1813,6 @@ u32 SpriteUtilCheckSamusNearSpriteFrontBehind(u16 yRange, u16 xRangeFront, u16 x
*/
void SpriteUtilSamusStandingOnSprite(struct SpriteData* pSprite)
{
u8 standing;
if (pSprite->status & SPRITE_STATUS_SAMUS_ON_TOP)
{
if (gSamusData.standingStatus != STANDING_ENEMY)
@ -1829,21 +1827,18 @@ void SpriteUtilSamusStandingOnSprite(struct SpriteData* pSprite)
return;
}
standing = pSprite->standingOnSprite;
if (standing != 0x1)
{
if (standing == 0x2)
{
pSprite->standingOnSprite = TRUE;
if (gSamusDataCopy.yPosition <= gSamusData.yPosition)
gSamusData.yPosition = pSprite->yPosition + pSprite->hitboxTopOffset + ONE_SUB_PIXEL;
}
}
else
switch (pSprite->standingOnSprite)
{
pSprite->standingOnSprite = FALSE;
if (gSamusData.standingStatus == STANDING_ENEMY)
gSamusData.standingStatus = STANDING_MIDAIR;
case SAMUS_STANDING_ON_SPRITE_ON:
pSprite->standingOnSprite = SAMUS_STANDING_ON_SPRITE_RELEASING;
if (gSamusDataCopy.yPosition <= gSamusData.yPosition)
gSamusData.yPosition = pSprite->yPosition + pSprite->hitboxTop + ONE_SUB_PIXEL;
break;
case SAMUS_STANDING_ON_SPRITE_RELEASING:
pSprite->standingOnSprite = SAMUS_STANDING_ON_SPRITE_OFF;
if (gSamusData.standingStatus == STANDING_ENEMY)
gSamusData.standingStatus = STANDING_MIDAIR;
}
}
@ -2359,10 +2354,10 @@ u32 SpriteUtilSpriteTakeDamageFromSamusContact(struct SpriteData* pSprite, struc
pSprite->paletteRow = 0;
// Update samus if she was standing on it
if (pSprite->standingOnSprite && pData->standingStatus == STANDING_ENEMY)
if (pSprite->standingOnSprite != SAMUS_STANDING_ON_SPRITE_OFF && pData->standingStatus == STANDING_ENEMY)
{
pData->standingStatus = STANDING_MIDAIR;
pSprite->standingOnSprite = FALSE;
pSprite->standingOnSprite = SAMUS_STANDING_ON_SPRITE_OFF;
}
// Set destructed pose
@ -2697,7 +2692,7 @@ void SpriteUtilMoveSpriteTowardsSamus(u16 samusY, u16 samusX, u8 ySpeed, u8 xSpe
}
flip = FALSE;
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
if (gCurrentSprite.work0 == 0)
{
@ -2772,7 +2767,7 @@ void SpriteUtilMoveSpriteTowardsSamus(u16 samusY, u16 samusX, u8 ySpeed, u8 xSpe
if (flip)
{
gCurrentSprite.status ^= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status ^= SPRITE_STATUS_FACING_DOWN;
gCurrentSprite.work3 = 1;
}
}
@ -2809,7 +2804,7 @@ void SpriteUtilRidleyFireballMove(u16 dstY, u16 samusX, u8 ySpeed, u8 xSpeed, u8
flip = FALSE;
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
if (gCurrentSprite.work0 == 0)
{
@ -2893,7 +2888,7 @@ void SpriteUtilRidleyFireballMove(u16 dstY, u16 samusX, u8 ySpeed, u8 xSpeed, u8
if (flip)
{
gCurrentSprite.status ^= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status ^= SPRITE_STATUS_FACING_DOWN;
gCurrentSprite.work3 = 1;
}
}
@ -3273,7 +3268,7 @@ void SpriteUtilSpriteDeath(u8 deathType, u16 yPosition, u16 xPosition, u8 playSo
gCurrentSprite.paletteRow = 0;
gCurrentSprite.frozenPaletteRowOffset = 0;
gCurrentSprite.absolutePaletteRow = 0;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.freezeTimer = 0;
}
}
@ -3495,16 +3490,16 @@ u8 SpriteCheckCollidingWithSamusDrawing(void)
spriteY = gCurrentSprite.yPosition;
spriteX = gCurrentSprite.xPosition;
spriteTop = spriteY + gCurrentSprite.hitboxTopOffset;
spriteBottom = spriteY + gCurrentSprite.hitboxBottomOffset;
spriteLeft = spriteX + gCurrentSprite.hitboxLeftOffset;
spriteRight = spriteX + gCurrentSprite.hitboxRightOffset;
spriteTop = spriteY + gCurrentSprite.hitboxTop;
spriteBottom = spriteY + gCurrentSprite.hitboxBottom;
spriteLeft = spriteX + gCurrentSprite.hitboxLeft;
spriteRight = spriteX + gCurrentSprite.hitboxRight;
samusY = gSamusData.yPosition;
samusX = gSamusData.xPosition;
samusTop = gSamusPhysics.drawDistanceTopOffset + gSamusData.yPosition;
samusBottom = gSamusData.yPosition + gSamusPhysics.drawDistanceBottomOffset;
samusTop = gSamusPhysics.drawDistanceTop + gSamusData.yPosition;
samusBottom = gSamusData.yPosition + gSamusPhysics.drawDistanceBottom;
samusLeft = gSamusPhysics.drawDistanceLeftOffset + gSamusData.xPosition;
samusRight = gSamusData.xPosition + gSamusPhysics.drawDistanceRightOffset;

View File

@ -39,9 +39,9 @@ void AcidWormHandleRotation(void)
u8 angle;
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
angle = gCurrentSprite.oamRotation + PI;
angle = gCurrentSprite.rotation + PI;
else
angle = gCurrentSprite.oamRotation;
angle = gCurrentSprite.rotation;
if (gSubSpriteData1.workVariable3 == TRUE)
offset = PI * 3;
@ -280,14 +280,14 @@ void AcidWormInit(void)
u8 gfxSlot;
u8 ramSlot;
gCurrentSprite.hitboxTopOffset = -(HALF_BLOCK_SIZE + QUARTER_BLOCK_SIZE);
gCurrentSprite.hitboxBottomOffset = (HALF_BLOCK_SIZE + QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxLeftOffset = -(HALF_BLOCK_SIZE + QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxRightOffset = (HALF_BLOCK_SIZE + QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxTop = -(HALF_BLOCK_SIZE + QUARTER_BLOCK_SIZE);
gCurrentSprite.hitboxBottom = (HALF_BLOCK_SIZE + QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxLeft = -(HALF_BLOCK_SIZE + QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxRight = (HALF_BLOCK_SIZE + QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.pOam = sAcidWormOam_Idle;
gCurrentSprite.animationDurationCounter = 0;
@ -298,7 +298,7 @@ void AcidWormInit(void)
gCurrentSprite.properties |= SP_IMMUNE_TO_PROJECTILES;
gCurrentSprite.pose = ACID_WORM_POSE_CHECK_SAMUS_ON_ZIPLINE;
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400 | SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN | SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.work3 = 0;
gCurrentSprite.work2 = 20;
@ -485,8 +485,8 @@ void AcidWormSpawnRetracting(void)
// Enable rotation/scaling
gCurrentSprite.status |= SPRITE_STATUS_ROTATION_SCALING;
gCurrentSprite.oamScaling = Q_8_8(1.f);
gCurrentSprite.oamRotation = 0;
gCurrentSprite.scaling = Q_8_8(1.f);
gCurrentSprite.rotation = 0;
gCurrentSprite.work0 = 60;
}
else
@ -516,7 +516,7 @@ void AcidWormIdleInit(void)
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.pose = ACID_WORM_POSE_IDLE;
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
}
/**
@ -563,7 +563,7 @@ void AcidWormIdle(void)
gCurrentSprite.pose = ACID_WORM_POSE_CHECK_WARNING_ENDED;
SpriteUtilMakeSpriteFaceSamusDirection();
gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_DOWN;
SoundPlay(0x1B5);
}
@ -651,10 +651,10 @@ void AcidWormExtend(void)
checks = 0;
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
{
if (gCurrentSprite.oamRotation >= PI / 2 - 1)
if (gCurrentSprite.rotation >= PI / 2 - 1)
checks++; // Fully rotated
else
gCurrentSprite.oamRotation += speed;
gCurrentSprite.rotation += speed;
if (gSubSpriteData1.xPosition < gCurrentSprite.xPositionSpawn + BLOCK_SIZE)
gSubSpriteData1.xPosition += speed;
@ -663,10 +663,10 @@ void AcidWormExtend(void)
}
else
{
if ((u8)(gCurrentSprite.oamRotation - 1) <= PI + PI / 2 - 1)
if ((u8)(gCurrentSprite.rotation - 1) <= PI + PI / 2 - 1)
checks++; // Fully rotated
else
gCurrentSprite.oamRotation -= speed;
gCurrentSprite.rotation -= speed;
if (gSubSpriteData1.xPosition > gCurrentSprite.xPositionSpawn - BLOCK_SIZE)
gSubSpriteData1.xPosition -= speed;
@ -872,14 +872,14 @@ void AcidWormRetracting(void)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
{
if (gCurrentSprite.oamRotation < 0x3)
if (gCurrentSprite.rotation < 0x3)
{
// Finished rotation
checks++;
gCurrentSprite.oamRotation = 0x0;
gCurrentSprite.rotation = 0x0;
}
else
gCurrentSprite.oamRotation -= 0x2;
gCurrentSprite.rotation -= 0x2;
if (gSubSpriteData1.xPosition > gCurrentSprite.xPositionSpawn)
{
@ -893,15 +893,15 @@ void AcidWormRetracting(void)
}
else
{
if (gCurrentSprite.oamRotation < 0x3)
if (gCurrentSprite.rotation < 0x3)
{
// Finished rotation
checks++;
gCurrentSprite.oamRotation = 0x0;
gCurrentSprite.rotation = 0x0;
}
else
{
gCurrentSprite.oamRotation += 0x2;
gCurrentSprite.rotation += 0x2;
}
if (gSubSpriteData1.xPosition < gCurrentSprite.xPositionSpawn)
@ -1045,7 +1045,7 @@ void AcidWormDeathFlashingAnim(void)
{
u8 isft;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
AcidWormHandleRotation();
@ -1139,18 +1139,18 @@ void AcidWormBodyInit(void)
gCurrentSprite.currentAnimationFrame = 0x0;
gCurrentSprite.properties |= SP_IMMUNE_TO_PROJECTILES;
gCurrentSprite.health = 0x400;
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x10;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x10;
gCurrentSprite.drawDistanceHorizontal = 0x10;
gCurrentSprite.work2 = 0x14 - (gCurrentSprite.roomSlot * 0x2);
switch (gCurrentSprite.roomSlot)
{
case ACID_WORM_BODY_PART_AROUND_MOUTH:
gCurrentSprite.hitboxTopOffset = -0x10;
gCurrentSprite.hitboxBottomOffset = 0x10;
gCurrentSprite.hitboxLeftOffset = -0x10;
gCurrentSprite.hitboxRightOffset = 0x10;
gCurrentSprite.hitboxTop = -0x10;
gCurrentSprite.hitboxBottom = 0x10;
gCurrentSprite.hitboxLeft = -0x10;
gCurrentSprite.hitboxRight = 0x10;
gCurrentSprite.drawOrder = 0x3;
gCurrentSprite.pOam = sAcidWormBodyOam_AroundMouth;
gCurrentSprite.work0 = 0x8;
@ -1158,10 +1158,10 @@ void AcidWormBodyInit(void)
break;
case ACID_WORM_BODY_PART_WEAK_POINT:
gCurrentSprite.hitboxTopOffset = -0x30;
gCurrentSprite.hitboxBottomOffset = 0x30;
gCurrentSprite.hitboxLeftOffset = -0x30;
gCurrentSprite.hitboxRightOffset = 0x30;
gCurrentSprite.hitboxTop = -0x30;
gCurrentSprite.hitboxBottom = 0x30;
gCurrentSprite.hitboxLeft = -0x30;
gCurrentSprite.hitboxRight = 0x30;
gCurrentSprite.drawOrder = 0x2;
gCurrentSprite.pOam = sAcidWormBodyOam_WeakPoint;
gCurrentSprite.work0 = 0x10;
@ -1170,10 +1170,10 @@ void AcidWormBodyInit(void)
break;
case ACID_WORM_BODY_PART_BELOW_WEAK_POINT:
gCurrentSprite.hitboxTopOffset = -0x30;
gCurrentSprite.hitboxBottomOffset = 0x30;
gCurrentSprite.hitboxLeftOffset = -0x28;
gCurrentSprite.hitboxRightOffset = 0x28;
gCurrentSprite.hitboxTop = -0x30;
gCurrentSprite.hitboxBottom = 0x30;
gCurrentSprite.hitboxLeft = -0x28;
gCurrentSprite.hitboxRight = 0x28;
gCurrentSprite.drawOrder = 0x3;
gCurrentSprite.pOam = sAcidWormBodyOam_BelowWeakPoint;
gCurrentSprite.work0 = 0x18;
@ -1181,10 +1181,10 @@ void AcidWormBodyInit(void)
break;
case ACID_WORM_BODY_PART_ABOVE_SEGMENTS:
gCurrentSprite.hitboxTopOffset = -0x24;
gCurrentSprite.hitboxBottomOffset = 0x24;
gCurrentSprite.hitboxLeftOffset = -0x24;
gCurrentSprite.hitboxRightOffset = 0x24;
gCurrentSprite.hitboxTop = -0x24;
gCurrentSprite.hitboxBottom = 0x24;
gCurrentSprite.hitboxLeft = -0x24;
gCurrentSprite.hitboxRight = 0x24;
gCurrentSprite.drawOrder = 0x4;
gCurrentSprite.pOam = sAcidWormBodyOam_AboveSegments;
gCurrentSprite.work0 = 0x20;
@ -1192,10 +1192,10 @@ void AcidWormBodyInit(void)
break;
case ACID_WORM_BODY_PART_SEGMENT1:
gCurrentSprite.hitboxTopOffset = -0x20;
gCurrentSprite.hitboxBottomOffset = 0x20;
gCurrentSprite.hitboxLeftOffset = -0x20;
gCurrentSprite.hitboxRightOffset = 0x20;
gCurrentSprite.hitboxTop = -0x20;
gCurrentSprite.hitboxBottom = 0x20;
gCurrentSprite.hitboxLeft = -0x20;
gCurrentSprite.hitboxRight = 0x20;
gCurrentSprite.drawOrder = 0x5;
gCurrentSprite.pOam = sAcidWormBodyOam_Segment;
gCurrentSprite.work0 = 0x28;
@ -1203,10 +1203,10 @@ void AcidWormBodyInit(void)
break;
case ACID_WORM_BODY_PART_SEGMENT2:
gCurrentSprite.hitboxTopOffset = -0x20;
gCurrentSprite.hitboxBottomOffset = 0x20;
gCurrentSprite.hitboxLeftOffset = -0x20;
gCurrentSprite.hitboxRightOffset = 0x20;
gCurrentSprite.hitboxTop = -0x20;
gCurrentSprite.hitboxBottom = 0x20;
gCurrentSprite.hitboxLeft = -0x20;
gCurrentSprite.hitboxRight = 0x20;
gCurrentSprite.drawOrder = 0x5;
gCurrentSprite.pOam = sAcidWormBodyOam_Segment;
gCurrentSprite.work0 = 0x30;
@ -1214,10 +1214,10 @@ void AcidWormBodyInit(void)
break;
case ACID_WORM_BODY_PART_SEGMENT3:
gCurrentSprite.hitboxTopOffset = -0x20;
gCurrentSprite.hitboxBottomOffset = 0x20;
gCurrentSprite.hitboxLeftOffset = -0x20;
gCurrentSprite.hitboxRightOffset = 0x20;
gCurrentSprite.hitboxTop = -0x20;
gCurrentSprite.hitboxBottom = 0x20;
gCurrentSprite.hitboxLeft = -0x20;
gCurrentSprite.hitboxRight = 0x20;
gCurrentSprite.drawOrder = 0x5;
gCurrentSprite.pOam = sAcidWormBodyOam_Segment;
gCurrentSprite.work0 = 0x38;
@ -1225,10 +1225,10 @@ void AcidWormBodyInit(void)
break;
case ACID_WORM_BODY_PART_SEGMENT4:
gCurrentSprite.hitboxTopOffset = -0x20;
gCurrentSprite.hitboxBottomOffset = 0x20;
gCurrentSprite.hitboxLeftOffset = -0x20;
gCurrentSprite.hitboxRightOffset = 0x20;
gCurrentSprite.hitboxTop = -0x20;
gCurrentSprite.hitboxBottom = 0x20;
gCurrentSprite.hitboxLeft = -0x20;
gCurrentSprite.hitboxRight = 0x20;
gCurrentSprite.drawOrder = 0x5;
gCurrentSprite.pOam = sAcidWormBodyOam_Segment;
gCurrentSprite.work0 = 0x40;
@ -1236,10 +1236,10 @@ void AcidWormBodyInit(void)
break;
case ACID_WORM_BODY_PART_SEGMENT5:
gCurrentSprite.hitboxTopOffset = -0x20;
gCurrentSprite.hitboxBottomOffset = 0x20;
gCurrentSprite.hitboxLeftOffset = -0x20;
gCurrentSprite.hitboxRightOffset = 0x20;
gCurrentSprite.hitboxTop = -0x20;
gCurrentSprite.hitboxBottom = 0x20;
gCurrentSprite.hitboxLeft = -0x20;
gCurrentSprite.hitboxRight = 0x20;
gCurrentSprite.drawOrder = 0x5;
gCurrentSprite.pOam = sAcidWormBodyOam_Segment;
gCurrentSprite.work0 = 0x48;
@ -1282,8 +1282,8 @@ void AcidWormBodyMove(void) {
{
gCurrentSprite.pose = 0x9;
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_80;
gCurrentSprite.oamScaling = Q_8_8(1.f);
gCurrentSprite.oamRotation = 0x0;
gCurrentSprite.scaling = Q_8_8(1.f);
gCurrentSprite.rotation = 0x0;
}
if (0x42 < gSpriteData[slot].pose)
gCurrentSprite.status &= ~SPRITE_STATUS_IGNORE_PROJECTILES;
@ -1330,15 +1330,15 @@ void AcidWormBodyMainLoop(void)
if (gSpriteData[slot].status & SPRITE_STATUS_FACING_RIGHT)
{
gCurrentSprite.status |= SPRITE_STATUS_FACING_RIGHT;
gCurrentSprite.oamRotation = gSpriteData[slot].oamRotation - timer;
gCurrentSprite.rotation = gSpriteData[slot].rotation - timer;
}
else
{
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_RIGHT;
gCurrentSprite.oamRotation = timer + gSpriteData[slot].oamRotation;
gCurrentSprite.rotation = timer + gSpriteData[slot].rotation;
}
if (!(gSpriteData[slot].status & SPRITE_STATUS_UNKNOWN_400))
if (!(gSpriteData[slot].status & SPRITE_STATUS_FACING_DOWN))
{
oldY = gCurrentSprite.yPosition;
AcidWormHandleRotation();
@ -1386,14 +1386,14 @@ void AcidWormBodyMainLoop(void)
gCurrentSprite.health = 0;
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
SoundPlay(0x1BD);
return;
}
}
if (gSpriteData[slot].oamRotation != 0)
if (gSpriteData[slot].rotation != 0)
gCurrentSprite.status &= ~SPRITE_STATUS_IGNORE_PROJECTILES;
else
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
@ -1410,7 +1410,7 @@ void AcidWormBodyDeath(void)
u8 effect;
ramSlot = gCurrentSprite.primarySpriteRamSlot;
gCurrentSprite.ignoreSamusCollisionTimer = 1; // Remove collision
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME; // Remove collision
AcidWormHandleRotation();
@ -1463,14 +1463,14 @@ void AcidWormSpitInit(void)
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.properties |= SP_KILL_OFF_SCREEN;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxBottom = QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxRight = QUARTER_BLOCK_SIZE;
gCurrentSprite.pOam = sAcidWormSpitOAM_Moving;
gCurrentSprite.animationDurationCounter = 0;
@ -1586,7 +1586,7 @@ void AcidWormSpitExplodingGfxInit(void)
*/
void AcidWormSpitCheckExplodingAnimEnded(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (SpriteUtilCheckEndCurrentSpriteAnim())
gCurrentSprite.status = 0; // Kill sprite
}
@ -1599,7 +1599,7 @@ void AcidWormSpitCheckExplodingOnAcidAnimEnded(void)
{
gCurrentSprite.yPosition = gEffectYPosition; // Sync position
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (SpriteUtilCheckEndCurrentSpriteAnim())
gCurrentSprite.status = 0; // Kill sprite

View File

@ -21,14 +21,14 @@ void AreaBannerInit(void)
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.properties |= SP_ALWAYS_ACTIVE;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 8);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 8);
gCurrentSprite.hitboxTopOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxBottomOffset = PIXEL_SIZE;
gCurrentSprite.hitboxLeftOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxRightOffset = PIXEL_SIZE;
gCurrentSprite.hitboxTop = -PIXEL_SIZE;
gCurrentSprite.hitboxBottom = PIXEL_SIZE;
gCurrentSprite.hitboxLeft = -PIXEL_SIZE;
gCurrentSprite.hitboxRight = PIXEL_SIZE;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
@ -142,7 +142,7 @@ void AreaBannerLeaving(void)
*/
void AreaBanner(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{

View File

@ -61,7 +61,7 @@ void AtomicSmoothMovement(void)
hittingSolidX++;
}
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
if (SpriteUtilGetCollisionAtPosition(spriteY + HALF_BLOCK_SIZE, spriteX) != COLLISION_AIR)
hittingSolidY++;
@ -148,7 +148,7 @@ void AtomicSmoothMovement(void)
flip = FALSE;
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
if (!hittingSolidY)
{
@ -209,7 +209,7 @@ void AtomicSmoothMovement(void)
if (flip)
{
gCurrentSprite.status ^= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status ^= SPRITE_STATUS_FACING_DOWN;
gCurrentSprite.work3 = 0x1;
}
}
@ -240,9 +240,9 @@ void AtomicUpdateDirectionToFleeSamus(void)
{
// Set opposite vertical direction
if (spriteY > samusY)
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
else
gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_DOWN;
// Set opposite horizontal direction
if (spriteX > samusX)
@ -266,13 +266,13 @@ void AtomicCheckShootElectricity(void)
u8 palette;
u8 offset;
if (gCurrentSprite.oamScaling != 0x0)
if (gCurrentSprite.scaling != 0x0)
{
gCurrentSprite.oamScaling--;
if (gCurrentSprite.oamScaling == 0x0)
gCurrentSprite.scaling--;
if (gCurrentSprite.scaling == 0x0)
{
gCurrentSprite.work1 = 0x0;
gCurrentSprite.oamRotation = 0x1;
gCurrentSprite.rotation = 0x1;
SpriteSpawnSecondary(SSPRITE_ATOMIC_ELECTRICITY, gCurrentSprite.roomSlot, gCurrentSprite.spritesetGfxSlot,
gCurrentSprite.primarySpriteRamSlot, gCurrentSprite.yPosition, gCurrentSprite.xPosition, 0x0);
@ -280,8 +280,8 @@ void AtomicCheckShootElectricity(void)
}
else
{
gCurrentSprite.oamRotation--;
if (gCurrentSprite.oamRotation == 0x0)
gCurrentSprite.rotation--;
if (gCurrentSprite.rotation == 0x0)
{
offset = gCurrentSprite.work1++;
@ -291,13 +291,13 @@ void AtomicCheckShootElectricity(void)
if (sAtomicDynamicPaletteData[offset][1] != 0x0)
{
gCurrentSprite.oamRotation = sAtomicDynamicPaletteData[offset][1];
gCurrentSprite.rotation = sAtomicDynamicPaletteData[offset][1];
if (offset == 0x10 && gCurrentSprite.status & SPRITE_STATUS_ONSCREEN)
SoundPlayNotAlreadyPlaying(0x260);
}
else
{
gCurrentSprite.oamScaling = 0xC8;
gCurrentSprite.scaling = 0xC8;
}
}
}
@ -313,14 +313,14 @@ void AtomicInit(void)
gCurrentSprite.status = 0x0;
else
{
gCurrentSprite.drawDistanceTopOffset = 0xC;
gCurrentSprite.drawDistanceBottomOffset = 0xC;
gCurrentSprite.drawDistanceHorizontalOffset = 0xC;
gCurrentSprite.drawDistanceTop = 0xC;
gCurrentSprite.drawDistanceBottom = 0xC;
gCurrentSprite.drawDistanceHorizontal = 0xC;
gCurrentSprite.hitboxTopOffset = -0x20;
gCurrentSprite.hitboxBottomOffset = 0x20;
gCurrentSprite.hitboxLeftOffset = -0x20;
gCurrentSprite.hitboxRightOffset = 0x20;
gCurrentSprite.hitboxTop = -0x20;
gCurrentSprite.hitboxBottom = 0x20;
gCurrentSprite.hitboxLeft = -0x20;
gCurrentSprite.hitboxRight = 0x20;
gCurrentSprite.pOam = sAtomicOAM_Idle;
gCurrentSprite.animationDurationCounter = 0x0;
@ -332,7 +332,7 @@ void AtomicInit(void)
gCurrentSprite.yPositionSpawn = gCurrentSprite.yPosition;
gCurrentSprite.xPositionSpawn = gCurrentSprite.xPosition;
gCurrentSprite.oamScaling = gSpriteRng * 16;
gCurrentSprite.scaling = gSpriteRng * 16;
}
}
@ -422,14 +422,14 @@ void AtomicMove(void)
gCurrentSprite.work3--;
movement = gCurrentSprite.work3;
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
// Move down
SpriteUtilCheckCollisionAtPosition(yPosition + HALF_BLOCK_SIZE, xPosition);
if (gPreviousCollisionCheck == COLLISION_AIR)
gCurrentSprite.yPosition += movement;
else
gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_DOWN;
}
else
{
@ -438,7 +438,7 @@ void AtomicMove(void)
if (gPreviousCollisionCheck == COLLISION_AIR)
gCurrentSprite.yPosition -= movement;
else
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
}
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
@ -494,9 +494,9 @@ void AtomicMaybeMoveBackToIdle(void)
// Set directions
if ((ySpawn & mask) < (yPosition & mask))
gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_DOWN;
else if ((ySpawn & mask) > (yPosition & mask))
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
if ((xSpawn & mask) < (xPosition & mask))
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_RIGHT;
@ -505,7 +505,7 @@ void AtomicMaybeMoveBackToIdle(void)
// Move
movement = 0x2;
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
SpriteUtilCheckCollisionAtPosition(yPosition + HALF_BLOCK_SIZE, xPosition);
if (gPreviousCollisionCheck == COLLISION_AIR)
@ -564,10 +564,10 @@ void AtomicChaseSamus(void)
if (gSamusWeaponInfo.chargeCounter == 0x0)
{
gCurrentSprite.pose = ATOMIC_POSE_IDLE_INIT;
if (gCurrentSprite.oamScaling == 0x0)
if (gCurrentSprite.scaling == 0x0)
{
gCurrentSprite.work1 = 0x0;
gCurrentSprite.oamRotation = 0x1;
gCurrentSprite.rotation = 0x1;
}
}
else
@ -604,14 +604,14 @@ void AtomicElectriciytInit(void)
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.drawDistanceTopOffset = 0x30;
gCurrentSprite.drawDistanceBottomOffset = 0x30;
gCurrentSprite.drawDistanceHorizontalOffset = 0x30;
gCurrentSprite.drawDistanceTop = 0x30;
gCurrentSprite.drawDistanceBottom = 0x30;
gCurrentSprite.drawDistanceHorizontal = 0x30;
gCurrentSprite.hitboxTopOffset = -0x4;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = -0x4;
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.hitboxTop = -0x4;
gCurrentSprite.hitboxBottom = 0x4;
gCurrentSprite.hitboxLeft = -0x4;
gCurrentSprite.hitboxRight = 0x4;
gCurrentSprite.pOam = sAtomicElectricityOAM_Charging;
gCurrentSprite.animationDurationCounter = 0x0;
@ -647,7 +647,7 @@ void AtomicElectricitySpawn(void)
// Sync position
gCurrentSprite.yPosition = gSpriteData[ramSlot].yPosition;
gCurrentSprite.xPosition = gSpriteData[ramSlot].xPosition;
if (gSpriteData[ramSlot].oamScaling == 0xC8)
if (gSpriteData[ramSlot].scaling == 0xC8)
{
// Charging done, set moving behavior
if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN)
@ -670,24 +670,24 @@ void AtomicElectricitySpawn(void)
if (spriteY > samusY)
gCurrentSprite.status |= SPRITE_STATUS_YFLIP;
else
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
if ((spriteY + BLOCK_SIZE) > samusY && (spriteY - BLOCK_SIZE) < samusY)
{
// Shooting horizontally
gCurrentSprite.pOam = sAtomicElectricityOAM_MovingHorizontal;
gCurrentSprite.work1 = 0x1; // Direction
gCurrentSprite.hitboxTopOffset = -0x1C;
gCurrentSprite.hitboxBottomOffset = 0x1C;
gCurrentSprite.hitboxTop = -0x1C;
gCurrentSprite.hitboxBottom = 0x1C;
if (gCurrentSprite.status & SPRITE_STATUS_XFLIP)
{
gCurrentSprite.hitboxLeftOffset = 0x0;
gCurrentSprite.hitboxRightOffset = 0xA0;
gCurrentSprite.hitboxLeft = 0x0;
gCurrentSprite.hitboxRight = 0xA0;
}
else
{
gCurrentSprite.hitboxLeftOffset = -0xA0;
gCurrentSprite.hitboxRightOffset = 0x0;
gCurrentSprite.hitboxLeft = -0xA0;
gCurrentSprite.hitboxRight = 0x0;
}
}
else if ((spriteX + BLOCK_SIZE) > samusX && (spriteX - BLOCK_SIZE) < samusX)
@ -695,17 +695,17 @@ void AtomicElectricitySpawn(void)
// Shooting vertically
gCurrentSprite.pOam = sAtomicElectricityOAM_MovingVertical;
gCurrentSprite.work1 = 0x2; // Direction
gCurrentSprite.hitboxLeftOffset = -0x1C;
gCurrentSprite.hitboxRightOffset = 0x1C;
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
gCurrentSprite.hitboxLeft = -0x1C;
gCurrentSprite.hitboxRight = 0x1C;
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
gCurrentSprite.hitboxTopOffset = 0x0;
gCurrentSprite.hitboxBottomOffset = 0xA0;
gCurrentSprite.hitboxTop = 0x0;
gCurrentSprite.hitboxBottom = 0xA0;
}
else
{
gCurrentSprite.hitboxTopOffset = -0xA0;
gCurrentSprite.hitboxBottomOffset = 0x0;
gCurrentSprite.hitboxTop = -0xA0;
gCurrentSprite.hitboxBottom = 0x0;
}
}
else
@ -716,24 +716,24 @@ void AtomicElectricitySpawn(void)
if (gCurrentSprite.status & SPRITE_STATUS_XFLIP)
{
gCurrentSprite.hitboxLeftOffset = 0x20;
gCurrentSprite.hitboxRightOffset = 0x60;
gCurrentSprite.hitboxLeft = 0x20;
gCurrentSprite.hitboxRight = 0x60;
}
else
{
gCurrentSprite.hitboxLeftOffset = -0x60;
gCurrentSprite.hitboxRightOffset = -0x20;
gCurrentSprite.hitboxLeft = -0x60;
gCurrentSprite.hitboxRight = -0x20;
}
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
gCurrentSprite.hitboxTopOffset = 0x60;
gCurrentSprite.hitboxBottomOffset = 0x20;
gCurrentSprite.hitboxTop = 0x60;
gCurrentSprite.hitboxBottom = 0x20;
}
else
{
gCurrentSprite.hitboxTopOffset = -0x20;
gCurrentSprite.hitboxBottomOffset = -0x60;
gCurrentSprite.hitboxTop = -0x20;
gCurrentSprite.hitboxBottom = -0x60;
}
}
}
@ -751,7 +751,7 @@ void AtomicElectricityMove(void)
// Check move Y
if (!(gCurrentSprite.work1 & 0x1))
{
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
gCurrentSprite.yPosition += speed;
else
gCurrentSprite.yPosition -= speed;
@ -772,12 +772,12 @@ void AtomicElectricityMove(void)
gCurrentSprite.bgPriority = gIoRegistersBackup.BG1CNT & 0x3;
gCurrentSprite.pose = ATOMIC_ELECTRICITY_POSE_EXPLODING;
gCurrentSprite.hitboxTopOffset = -0x60;
gCurrentSprite.hitboxBottomOffset = 0x60;
gCurrentSprite.hitboxLeftOffset = -0x60;
gCurrentSprite.hitboxRightOffset = 0x60;
gCurrentSprite.hitboxTop = -0x60;
gCurrentSprite.hitboxBottom = 0x60;
gCurrentSprite.hitboxLeft = -0x60;
gCurrentSprite.hitboxRight = 0x60;
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.animationDurationCounter = 0x0;
gCurrentSprite.currentAnimationFrame = 0x0;
@ -797,15 +797,15 @@ void AtomicElectricityMove(void)
void AtomicElectricityExploding(void)
{
if (gCurrentSprite.currentAnimationFrame < 0x4)
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (SpriteUtilCheckEndCurrentSpriteAnim())
{
gCurrentSprite.pose = 0x25;
gCurrentSprite.hitboxTopOffset = -0x10;
gCurrentSprite.hitboxBottomOffset = 0x10;
gCurrentSprite.hitboxLeftOffset = -0x10;
gCurrentSprite.hitboxRightOffset = 0x10;
gCurrentSprite.hitboxTop = -0x10;
gCurrentSprite.hitboxBottom = 0x10;
gCurrentSprite.hitboxLeft = -0x10;
gCurrentSprite.hitboxRight = 0x10;
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
gCurrentSprite.pOam = sAtomicElectricityOAM_Charging;
gCurrentSprite.animationDurationCounter = 0x0;

View File

@ -72,14 +72,14 @@ void BaristuteInit(void)
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = -(BLOCK_SIZE + QUARTER_BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxRightOffset = (BLOCK_SIZE + QUARTER_BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxTop = -(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = -(BLOCK_SIZE + QUARTER_BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxRight = (BLOCK_SIZE + QUARTER_BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
gCurrentSprite.health = GET_PSPRITE_HEALTH(gCurrentSprite.spriteId);
@ -115,8 +115,8 @@ void BaristuteCheckBeforeJumpingAnimEnded(void)
xPosition = gCurrentSprite.xPosition;
// Check if there's still ground under the baristute
if (SpriteUtilGetCollisionAtPosition(yPosition, xPosition + gCurrentSprite.hitboxRightOffset) == COLLISION_AIR &&
SpriteUtilGetCollisionAtPosition(yPosition, xPosition + gCurrentSprite.hitboxLeftOffset) == COLLISION_AIR)
if (SpriteUtilGetCollisionAtPosition(yPosition, xPosition + gCurrentSprite.hitboxRight) == COLLISION_AIR &&
SpriteUtilGetCollisionAtPosition(yPosition, xPosition + gCurrentSprite.hitboxLeft) == COLLISION_AIR)
{
// Set falling
gCurrentSprite.pose = BARISTUTE_POSE_FALLING_INIT;
@ -152,7 +152,7 @@ void BaristuteJumping(void)
{
// Check wall on right
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition - QUARTER_BLOCK_SIZE,
gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset + PIXEL_SIZE);
gCurrentSprite.xPosition + gCurrentSprite.hitboxRight + PIXEL_SIZE);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
@ -168,7 +168,7 @@ void BaristuteJumping(void)
{
// Check wall on left
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition - QUARTER_BLOCK_SIZE,
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset - PIXEL_SIZE);
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft - PIXEL_SIZE);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
@ -201,7 +201,7 @@ void BaristuteJumping(void)
else
{
// Check for ceiling if velocity is negative
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxTopOffset, gCurrentSprite.xPosition);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxTop, gCurrentSprite.xPosition);
if (gPreviousCollisionCheck == COLLISION_SOLID)
gCurrentSprite.pose = BARISTUTE_POSE_FALLING_INIT;
}
@ -265,8 +265,8 @@ void BaristuteIdle(void)
xPosition = gCurrentSprite.xPosition;
// Check if there's still ground under the baristute
if (SpriteUtilGetCollisionAtPosition(yPosition, xPosition + gCurrentSprite.hitboxRightOffset) == COLLISION_AIR &&
SpriteUtilGetCollisionAtPosition(yPosition, xPosition + gCurrentSprite.hitboxLeftOffset) == COLLISION_AIR)
if (SpriteUtilGetCollisionAtPosition(yPosition, xPosition + gCurrentSprite.hitboxRight) == COLLISION_AIR &&
SpriteUtilGetCollisionAtPosition(yPosition, xPosition + gCurrentSprite.hitboxLeft) == COLLISION_AIR)
{
// Set falling
gCurrentSprite.pose = BARISTUTE_POSE_FALLING_INIT;
@ -286,8 +286,8 @@ void BaristuteIdle(void)
// Check should walk or jump, get the collision in front of the baristute
if ((gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT
? SpriteUtilGetCollisionAtPosition(yPosition - QUARTER_BLOCK_SIZE, xPosition + gCurrentSprite.hitboxRightOffset + QUARTER_BLOCK_SIZE)
: SpriteUtilGetCollisionAtPosition(yPosition - QUARTER_BLOCK_SIZE, xPosition + gCurrentSprite.hitboxLeftOffset - QUARTER_BLOCK_SIZE)) == COLLISION_AIR)
? SpriteUtilGetCollisionAtPosition(yPosition - QUARTER_BLOCK_SIZE, xPosition + gCurrentSprite.hitboxRight + QUARTER_BLOCK_SIZE)
: SpriteUtilGetCollisionAtPosition(yPosition - QUARTER_BLOCK_SIZE, xPosition + gCurrentSprite.hitboxLeft - QUARTER_BLOCK_SIZE)) == COLLISION_AIR)
{
if (gCurrentSprite.spriteId == PSPRITE_BARISTUTE_KRAID_UPPER)
{
@ -391,8 +391,8 @@ void BaristuteWalking(void)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
{
// Check collision
if (SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition - QUARTER_BLOCK_SIZE, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset + PIXEL_SIZE) == COLLISION_AIR &&
SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset + PIXEL_SIZE) == COLLISION_SOLID)
if (SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition - QUARTER_BLOCK_SIZE, gCurrentSprite.xPosition + gCurrentSprite.hitboxRight + PIXEL_SIZE) == COLLISION_AIR &&
SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRight + PIXEL_SIZE) == COLLISION_SOLID)
{
currentDistance = gCurrentSprite.xPosition - gCurrentSprite.xPositionSpawn;
if (currentDistance > walkingDistance)
@ -417,8 +417,8 @@ void BaristuteWalking(void)
else
{
// Check collision
if (SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition - QUARTER_BLOCK_SIZE, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset - PIXEL_SIZE) == COLLISION_AIR &&
SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset - PIXEL_SIZE) == COLLISION_SOLID)
if (SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition - QUARTER_BLOCK_SIZE, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft - PIXEL_SIZE) == COLLISION_AIR &&
SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft - PIXEL_SIZE) == COLLISION_SOLID)
{
currentDistance = gCurrentSprite.xPositionSpawn - gCurrentSprite.xPosition;
if (currentDistance > walkingDistance)

View File

@ -41,10 +41,10 @@ void BlackSpacePirateProjectileCollision(void)
spriteY = pSprite->yPosition;
spriteX = pSprite->xPosition;
spriteTop = spriteY + pSprite->hitboxTopOffset;
spriteBottom = spriteY + pSprite->hitboxBottomOffset;
spriteLeft = spriteX + pSprite->hitboxLeftOffset;
spriteRight = spriteX + pSprite->hitboxRightOffset;
spriteTop = spriteY + pSprite->hitboxTop;
spriteBottom = spriteY + pSprite->hitboxBottom;
spriteLeft = spriteX + pSprite->hitboxLeft;
spriteRight = spriteX + pSprite->hitboxRight;
for (pProj = gProjectileData; pProj < gProjectileData + MAX_AMOUNT_OF_PROJECTILES; pProj++)
{
@ -227,10 +227,10 @@ void BlackSpacePirateCollidingWithLaser(void)
pirateY = gCurrentSprite.yPosition;
pirateX = gCurrentSprite.xPosition;
pirateTop = pirateY + gCurrentSprite.hitboxTopOffset;
pirateBottom = pirateY + gCurrentSprite.hitboxBottomOffset;
pirateLeft = pirateX + gCurrentSprite.hitboxLeftOffset;
pirateRight = pirateX + gCurrentSprite.hitboxRightOffset;
pirateTop = pirateY + gCurrentSprite.hitboxTop;
pirateBottom = pirateY + gCurrentSprite.hitboxBottom;
pirateLeft = pirateX + gCurrentSprite.hitboxLeft;
pirateRight = pirateX + gCurrentSprite.hitboxRight;
laserSize = 4;
@ -266,20 +266,20 @@ void BlackSpacePirateInit(void)
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = 0x40;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.drawDistanceHorizontalOffset = 0x28;
gCurrentSprite.drawDistanceTop = 0x40;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.drawDistanceHorizontal = 0x28;
gCurrentSprite.hitboxTopOffset = -0xA0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxTop = -0xA0;
gCurrentSprite.hitboxBottom = 0;
health = GET_PSPRITE_HEALTH(gCurrentSprite.spriteId);
gCurrentSprite.health = health;
gCurrentSprite.yPositionSpawn = health;
gCurrentSprite.oamScaling = Q_8_8(1.f);
gCurrentSprite.scaling = Q_8_8(1.f);
gCurrentSprite.work2 = 0;
gCurrentSprite.oamRotation = 0;
gCurrentSprite.rotation = 0;
gCurrentSprite.samusCollision = SSC_SPACE_PIRATE;
gCurrentSprite.absolutePaletteRow = 2;
@ -466,7 +466,7 @@ void BlackSpacePirateJumping(void)
if (!SpriteUtilCheckNearEndCurrentSpriteAnim())
return;
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
if (SpacePirateCheckSamusInShootingRange())
return;
@ -531,7 +531,7 @@ void BlackSpacePirateJumping(void)
return;
}
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
speed = gCurrentSprite.work2 / 4;
if (speed <= 5)
@ -580,7 +580,7 @@ void BlackSpacePirateJumping(void)
gCurrentSprite.xPosition -= speed;
}
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
if (collisions != 0)
{
@ -630,7 +630,7 @@ void BlackSpacePirateJumping(void)
}
else
{
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
if (gSpriteDrawOrder[3] == TRUE)
{
@ -812,7 +812,7 @@ void BlackSpacePirateWalkingAlerted(void)
gCurrentSprite.work2 = 0;
}
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
unk_f978(gCurrentSprite.work2 / 4);
@ -869,7 +869,7 @@ void BlackSpacePirateHitByLaser(void)
{
u8 timer;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.animationDurationCounter--;
timer = --gCurrentSprite.work0;
@ -899,7 +899,7 @@ void BlackSpacePirate(void)
BlackSpacePirateProjectileCollision();
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
alerted = TRUE;
else
alerted = FALSE;
@ -908,17 +908,17 @@ void BlackSpacePirate(void)
{
SpacePirateSamusDetection();
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
if (gSpriteDrawOrder[2] == TRUE)
gAlarmTimer = ALARM_TIMER_ACTIVE_TIMER;
else if (gAlarmTimer == 0)
gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_DOWN;
}
else
{
if (gAlarmTimer != 0 && gCurrentSprite.pose != 0)
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
}
BlackSpacePirateCollidingWithLaser();
@ -1177,6 +1177,6 @@ void BlackSpacePirate(void)
BlackSpacePirateDeath(TRUE);
}
if (!alerted && (gCurrentSprite.status & (SPRITE_STATUS_EXISTS | SPRITE_STATUS_ONSCREEN | SPRITE_STATUS_UNKNOWN_400 | SPRITE_STATUS_IGNORE_PROJECTILES)) == (SPRITE_STATUS_EXISTS | SPRITE_STATUS_ONSCREEN | SPRITE_STATUS_UNKNOWN_400))
if (!alerted && (gCurrentSprite.status & (SPRITE_STATUS_EXISTS | SPRITE_STATUS_ONSCREEN | SPRITE_STATUS_FACING_DOWN | SPRITE_STATUS_IGNORE_PROJECTILES)) == (SPRITE_STATUS_EXISTS | SPRITE_STATUS_ONSCREEN | SPRITE_STATUS_FACING_DOWN))
SoundPlayNotAlreadyPlaying(0x169);
}

View File

@ -135,14 +135,14 @@ void KraidStatueInit(void)
{
gCurrentSprite.xPosition -= HALF_BLOCK_SIZE;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 6);
gCurrentSprite.drawDistanceBottomOffset = 0;
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 7);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 6);
gCurrentSprite.drawDistanceBottom = 0;
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 7);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.bgPriority = BGCNT_GET_PRIORITY(gIoRegistersBackup.BG1CNT);
gCurrentSprite.drawOrder = 1;
@ -367,14 +367,14 @@ void RidleyStatueInit(void)
{
gCurrentSprite.xPosition += HALF_BLOCK_SIZE;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 7);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 7);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.bgPriority = BGCNT_GET_PRIORITY(gIoRegistersBackup.BG1CNT);
gCurrentSprite.drawOrder = 1;
@ -542,7 +542,7 @@ void KraidStatue(void)
{
struct ProjectileData* pProj;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
@ -607,7 +607,7 @@ void KraidStatue(void)
*/
void RidleyStatue(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{

View File

@ -33,14 +33,14 @@ void ChargeBeamInit(void)
gCurrentSprite.properties |= SP_IMMUNE_TO_PROJECTILES;
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.hitboxTopOffset = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxBottomOffset = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxLeftOffset = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxRightOffset = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxTop = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxBottom = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxLeft = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxRight = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.pOam = sChargeBeamOam_Spawning;
gCurrentSprite.animationDurationCounter = 0;
@ -60,7 +60,7 @@ void ChargeBeamInit(void)
*/
void ChargeBeamSpawnGlow(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (SpriteUtilCheckNearEndCurrentSpriteAnim())
{
@ -77,7 +77,7 @@ void ChargeBeamSpawnGlow(void)
*/
void ChargeBeamVisibleInit(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.pose = CHARGE_BEAM_POSE_IDLE;
gCurrentSprite.pOam = sChargeBeamOam_Visible;
@ -119,7 +119,7 @@ void ChargeBeamIdle(void)
gPreventMovementTimer = SAMUS_ITEM_PMT;
gCurrentSprite.properties |= SP_ALWAYS_ACTIVE;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.pose = CHARGE_BEAM_POSE_FLASHING;
gCurrentSprite.work0 = 0;
@ -144,7 +144,7 @@ void ChargeBeamIdle(void)
*/
void ChargeBeamFlashingAnim(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.animationDurationCounter--;
// Flicker
@ -165,14 +165,14 @@ void ChargeBeamGlowInit(void)
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawOrder = 3;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxBottom = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRight = HALF_BLOCK_SIZE;
gCurrentSprite.pOam = sChargeBeamGlowOam_Idle;
gCurrentSprite.animationDurationCounter = 0;

View File

@ -194,14 +194,14 @@ void ChozoBallInit(void)
{
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.hitboxTopOffset = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxBottomOffset = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxLeftOffset = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxRightOffset = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxTop = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxBottom = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxLeft = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxRight = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
@ -271,7 +271,7 @@ void ChozoBallRegisterItem(void)
{
gPreventMovementTimer = SAMUS_ITEM_PMT;
gCurrentSprite.properties |= SP_ALWAYS_ACTIVE;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.pose = CHOZO_BALL_POSE_GETTING;
gCurrentSprite.work0 = 0;
@ -288,7 +288,7 @@ void ChozoBallRegisterItem(void)
*/
void ChozoBallFlashAnimation(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (MOD_AND(gCurrentSprite.work0, 2) == 0)
gCurrentSprite.status ^= SPRITE_STATUS_NOT_DRAWN;

View File

@ -20,6 +20,14 @@
#include "structs/samus.h"
#include "structs/scroll.h"
#define CHOZO_STATUE_HAND_X_OFFSET (BLOCK_SIZE - EIGHTH_BLOCK_SIZE)
#define CHOZO_STATUE_HAND_Y_OFFSET (QUARTER_BLOCK_SIZE + ONE_SUB_PIXEL)
#define CHOZO_BALL_OFFSET_Y (BLOCK_SIZE + HALF_BLOCK_SIZE)
#define CHOZO_BALL_OFFSET_X (BLOCK_SIZE - EIGHTH_BLOCK_SIZE)
#define DELAY_BEFORE_HINT (CONVERT_SECONDS(2.f))
/**
* @brief 13850 | 88 | Synchronize the sub sprites of a chozo statue
*
@ -318,21 +326,22 @@ void ChozoStatueInit(void)
gSubSpriteData1.yPosition = gCurrentSprite.yPosition;
gCurrentSprite.drawDistanceTopOffset = 0x20;
gCurrentSprite.drawDistanceBottomOffset = 0x20;
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = 0x4;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = 0x4;
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.hitboxTop = PIXEL_SIZE;
gCurrentSprite.hitboxBottom = PIXEL_SIZE;
gCurrentSprite.hitboxLeft = PIXEL_SIZE;
gCurrentSprite.hitboxRight = PIXEL_SIZE;
gCurrentSprite.drawOrder = 0x3;
gCurrentSprite.drawOrder = 3;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.health = 0x1;
gCurrentSprite.health = 1;
gSubSpriteData1.animationDurationCounter = 0;
gSubSpriteData1.currentAnimationFrame = 0;
gSubSpriteData1.workVariable2 = 0;
gSubSpriteData1.workVariable3 = FALSE;
@ -370,18 +379,21 @@ void ChozoStatueInit(void)
if (gCurrentSprite.status & SPRITE_STATUS_XFLIP)
{
SpriteSpawnSecondary(SSPRITE_CHOZO_BALL, 0, gCurrentSprite.spritesetGfxSlot,
gCurrentSprite.primarySpriteRamSlot, gSubSpriteData1.yPosition - (BLOCK_SIZE + HALF_BLOCK_SIZE),
gSubSpriteData1.xPosition + 0x38, 0);
gCurrentSprite.primarySpriteRamSlot, gSubSpriteData1.yPosition - CHOZO_BALL_OFFSET_Y,
gSubSpriteData1.xPosition + CHOZO_BALL_OFFSET_X, 0);
}
else
{
SpriteSpawnSecondary(SSPRITE_CHOZO_BALL, 0, gCurrentSprite.spritesetGfxSlot,
gCurrentSprite.primarySpriteRamSlot, gSubSpriteData1.yPosition - (BLOCK_SIZE + HALF_BLOCK_SIZE),
gSubSpriteData1.xPosition - 0x38, 0);
gCurrentSprite.primarySpriteRamSlot, gSubSpriteData1.yPosition - CHOZO_BALL_OFFSET_Y,
gSubSpriteData1.xPosition - CHOZO_BALL_OFFSET_X, 0);
}
}
else
gCurrentSprite.pose = CHOZO_STATUE_POSE_IDLE; // Refill
{
// Refill
gCurrentSprite.pose = CHOZO_STATUE_POSE_IDLE;
}
}
gCurrentSprite.roomSlot = CHOZO_STATUE_PART_HEAD;
@ -406,6 +418,7 @@ void ChozoStatueInit(void)
// Spawn glow
newRamSlot = SpriteSpawnSecondary(SSPRITE_CHOZO_STATUE_PART, CHOZO_STATUE_PART_GLOW, gfxSlot,
ramSlot, yPosition, xPosition, gCurrentSprite.status & SPRITE_STATUS_XFLIP);
gSpriteData[newRamSlot].work1 = behavior;
}
@ -431,19 +444,22 @@ void ChozoStatueRegisterHint(void)
gSpriteData[eyeSlot].pose = CHOZO_STATUE_PART_POSE_EYE_OPENING_INIT;
gCurrentSprite.pose = CHOZO_STATUE_POSE_HINT_FLASHING;
gCurrentSprite.work0 = 0x78;
gCurrentSprite.work2 = 0xC;
gCurrentSprite.work0 = DELAY_BEFORE_HINT;
gCurrentSprite.work2 = CONVERT_SECONDS(.2f);
gCurrentSprite.work3 = 0;
if (gCurrentSprite.spriteId == PSPRITE_CHOZO_STATUE_LONG_HINT)
{
MakeBackgroundFlash(BG_FLASH_CHOZO_LONG_TRANSPARENCY);
gCurrentSprite.work0 += 0x28;
// Increase timer to have time for the background fade
gCurrentSprite.work0 += TWO_THIRD_SECOND;
}
// Register hint
ChozoStatueRegisterItem(gCurrentSprite.spriteId);
FadeMusic(0x3C);
FadeMusic(CONVERT_SECONDS(1.f));
}
/**
@ -452,13 +468,13 @@ void ChozoStatueRegisterHint(void)
*/
void ChozoStatueHintFlashing(void)
{
u8 ramSlot;
u8 eyeSlot;
ramSlot = gCurrentSprite.work1;
eyeSlot = gCurrentSprite.work1;
if (gSpriteData[ramSlot].pose == 0x61)
if (gSpriteData[eyeSlot].pose == CHOZO_STATUE_PART_POSE_DO_NOTHING)
{
gCurrentSprite.work0--;
APPLY_DELTA_TIME(gCurrentSprite.work0);
if (gCurrentSprite.work0 == 0)
{
gCurrentSprite.pose = CHOZO_STATUE_POSE_SITTING_INIT;
@ -471,25 +487,29 @@ void ChozoStatueHintFlashing(void)
}
else
{
if (gCurrentSprite.work0 == 0x77)
if (gCurrentSprite.work0 == (DELAY_BEFORE_HINT - DELTA_TIME))
{
MakeBackgroundFlash(BG_FLASH_SLIGHT_YELLOW);
SoundPlay(0x11B); // Chozo hint
SoundPlay(SOUND_CHOZO_STATUE_HINT);
}
else if (gCurrentSprite.work0 > 0x77)
else if (gCurrentSprite.work0 > (DELAY_BEFORE_HINT - DELTA_TIME))
{
return;
}
// Update palette
gCurrentSprite.work2--;
APPLY_DELTA_TIME(gCurrentSprite.work2);
if (gCurrentSprite.work2 == 0)
{
// Reset delay
gCurrentSprite.work2 = 0xC;
gCurrentSprite.work2 = CONVERT_SECONDS(.2f);
// Change row
gCurrentSprite.paletteRow = sChozoStatueFlashingPaletteRows[gCurrentSprite.work3];
// Update offset
if (gCurrentSprite.work3 > 0x2)
if (gCurrentSprite.work3 >= ARRAY_SIZE(sChozoStatueFlashingPaletteRows) - 1)
gCurrentSprite.work3 = 0;
else
gCurrentSprite.work3++;
@ -513,7 +533,7 @@ void ChozoStatueSittingInit(void)
ChozoStatueStandingChangeCcaa(CAA_REMOVE_SOLID, CAA_REMOVE_SOLID);
SoundPlay(0x11C);
gSlowScrollingTimer = 0x3C;
gSlowScrollingTimer = CONVERT_SECONDS(1.f);
}
/**
@ -533,7 +553,7 @@ void ChozoStatueSitting(void)
gSubSpriteData1.currentAnimationFrame = 0;
gCurrentSprite.pose = CHOZO_STATUE_POSE_DELAY_AFTER_SITTING;
gCurrentSprite.work0 = 0x1E;
gCurrentSprite.work0 = CONVERT_SECONDS(.5f);
ChozoStatueSeatedChangeCcaa(CAA_MAKE_NON_POWER_GRIP);
}
@ -545,7 +565,7 @@ void ChozoStatueSitting(void)
*/
void ChozoStatueDelayBeforeRefillAfterHint(void)
{
gCurrentSprite.work0--;
APPLY_DELTA_TIME(gCurrentSprite.work0);
if (gCurrentSprite.work0 == 0)
gCurrentSprite.pose = CHOZO_STATUE_POSE_IDLE;
}
@ -561,7 +581,7 @@ void ChozoStatueWaitForItemToBeCollected(void)
{
// Hint behavior, thus item was took
gCurrentSprite.pose = CHOZO_STATUE_POSE_TIMER_AFTER_ITEM;
gCurrentSprite.work0 = 0x28;
gCurrentSprite.work0 = TWO_THIRD_SECOND;
}
}
@ -571,7 +591,7 @@ void ChozoStatueWaitForItemToBeCollected(void)
*/
void ChozoStatueTimerAfterItemGrabbed(void)
{
gCurrentSprite.work0--;
APPLY_DELTA_TIME(gCurrentSprite.work0);
if (gCurrentSprite.work0 == 0)
gCurrentSprite.pose = CHOZO_STATUE_POSE_IDLE;
}
@ -583,7 +603,7 @@ void ChozoStatueTimerAfterItemGrabbed(void)
void ChozoStatueRefillInit(void)
{
gCurrentSprite.pose = CHOZO_STATUE_POSE_REFILL;
gCurrentSprite.work2 = 0x4;
gCurrentSprite.work2 = CONVERT_SECONDS(1.f / 15);
gCurrentSprite.work3 = 0;
SpriteSpawnSecondary(SSPRITE_CHOZO_STATUE_REFILL, 0, gCurrentSprite.spritesetGfxSlot,
@ -597,16 +617,17 @@ void ChozoStatueRefillInit(void)
void ChozoStatueRefillSamus(void)
{
// Update palette
gCurrentSprite.work2--;
APPLY_DELTA_TIME(gCurrentSprite.work2);
if (gCurrentSprite.work2 == 0)
{
// Reset delay
gCurrentSprite.work2 = 0x4;
gCurrentSprite.work2 = CONVERT_SECONDS(1.f / 15);
// Change row
gCurrentSprite.paletteRow = sChozoStatueFlashingPaletteRows[gCurrentSprite.work3];
// Update offset
if (gCurrentSprite.work3 > 0x2)
if (gCurrentSprite.work3 >= ARRAY_SIZE(sChozoStatueFlashingPaletteRows) - 1)
gCurrentSprite.work3 = 0;
else
gCurrentSprite.work3++;
@ -621,7 +642,7 @@ void ChozoStatueSleepingInit(void)
{
gCurrentSprite.pose = CHOZO_STATUE_POSE_SLEEPING;
gCurrentSprite.paletteRow = 0;
gCurrentSprite.work0 = 0x46;
gCurrentSprite.work0 = CONVERT_SECONDS(1.f + 1.f / 6);
}
/**
@ -630,14 +651,14 @@ void ChozoStatueSleepingInit(void)
*/
void ChozoStatueSleeping(void)
{
u8 ramSlot;
u8 eyeSlot;
gCurrentSprite.work0--;
APPLY_DELTA_TIME(gCurrentSprite.work0);
if (gCurrentSprite.work0 == 0)
{
// Close eye
ramSlot = gCurrentSprite.work1;
gSpriteData[ramSlot].pose = CHOZO_STATUE_PART_POSE_EYE_CLOSING_INIT;
eyeSlot = gCurrentSprite.work1;
gSpriteData[eyeSlot].pose = CHOZO_STATUE_PART_POSE_EYE_CLOSING_INIT;
gCurrentSprite.pose = CHOZO_STATUE_POSE_DO_NOTHING;
@ -663,21 +684,21 @@ void ChozoStatuePartInit(void)
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.drawOrder = 0x2;
gCurrentSprite.drawOrder = 2;
gCurrentSprite.hitboxTopOffset = 0x4;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = 0x4;
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.hitboxTop = PIXEL_SIZE;
gCurrentSprite.hitboxBottom = PIXEL_SIZE;
gCurrentSprite.hitboxLeft = PIXEL_SIZE;
gCurrentSprite.hitboxRight = PIXEL_SIZE;
behavior = ChozoStatueGetBehavior(gSpriteData[ramSlot].spriteId);
switch (gCurrentSprite.roomSlot)
{
case CHOZO_STATUE_PART_ARM:
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x1E;
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 - EIGHTH_BLOCK_SIZE);
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
@ -694,9 +715,9 @@ void ChozoStatuePartInit(void)
break;
case CHOZO_STATUE_PART_LEG:
gCurrentSprite.drawDistanceTopOffset = 0x30;
gCurrentSprite.drawDistanceBottomOffset = 0;
gCurrentSprite.drawDistanceHorizontalOffset = 0x20;
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
if (behavior == CHOZO_STATUE_BEHAVIOR_HINT)
gCurrentSprite.pose = CHOZO_STATUE_PART_POSE_LEG_IDLE;
@ -705,9 +726,9 @@ void ChozoStatuePartInit(void)
break;
case CHOZO_STATUE_PART_EYE:
gCurrentSprite.drawDistanceTopOffset = 0x8;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.drawDistanceHorizontalOffset = 0x8;
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.pose = CHOZO_STATUE_PART_POSE_DO_NOTHING;
gCurrentSprite.animationDurationCounter = 0;
@ -720,9 +741,9 @@ void ChozoStatuePartInit(void)
break;
case CHOZO_STATUE_PART_GLOW:
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x1;
gCurrentSprite.drawDistanceHorizontalOffset = 0xC;
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE + QUARTER_BLOCK_SIZE);
gCurrentSprite.pOam = sChozoStatuePartOam_GlowIdle;
gCurrentSprite.animationDurationCounter = 0;
@ -758,8 +779,11 @@ void ChozoStatuePartGlowIdle(void)
gCurrentSprite.currentAnimationFrame = 0;
}
}
else if (!(gCurrentSprite.status & SPRITE_STATUS_NOT_DRAWN))
gCurrentSprite.status |= SPRITE_STATUS_NOT_DRAWN;
else
{
if (!(gCurrentSprite.status & SPRITE_STATUS_NOT_DRAWN))
gCurrentSprite.status |= SPRITE_STATUS_NOT_DRAWN;
}
}
/**
@ -781,10 +805,14 @@ void ChozoStatuePartArmCheckGrabSamusHint(void)
xPosition -= CHOZO_STATUE_HAND_X_OFFSET;
// In range, chozo statue is idle, either morph ball or rolling
if (gSpriteData[ramSlot].pose == CHOZO_STATUE_POSE_IDLE &&
gSamusData.yPosition == gCurrentSprite.yPosition - CHOZO_STATUE_HAND_Y_OFFSET &&
gSamusData.xPosition > xPosition - QUARTER_BLOCK_SIZE && gSamusData.xPosition < xPosition + QUARTER_BLOCK_SIZE &&
(u8)(gSamusData.pose - SPOSE_MORPH_BALL) < (SPOSE_UNMORPHING - SPOSE_MORPH_BALL))
if (gSpriteData[ramSlot].pose != CHOZO_STATUE_POSE_IDLE)
return;
if (gSamusData.yPosition != gCurrentSprite.yPosition - CHOZO_STATUE_HAND_Y_OFFSET)
return;
if (gSamusData.xPosition > xPosition - QUARTER_BLOCK_SIZE && gSamusData.xPosition < xPosition + QUARTER_BLOCK_SIZE &&
(gSamusData.pose == SPOSE_MORPH_BALL || gSamusData.pose == SPOSE_ROLLING))
{
// Set pose
SamusSetPose(SPOSE_GRABBED_BY_CHOZO_STATUE);
@ -872,7 +900,9 @@ void ChozoStatuePartArmCheckGrabSamusRefill(void)
// Update OAM
if (gCurrentSprite.pOam == sChozoStatuePartOam_ArmIdle && gPreventMovementTimer == 0 &&
ChozoStatueGetBehavior(gSpriteData[ramSlot].spriteId) != CHOZO_STATUE_BEHAVIOR_ITEM)
{
gCurrentSprite.pOam = sChozoStatuePartOam_ArmGlow;
}
isGrabbed = FALSE;
xPosition = gCurrentSprite.xPosition;
@ -908,7 +938,7 @@ void ChozoStatuePartArmCheckGrabSamusRefill(void)
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.work0 = 0x1E;
gCurrentSprite.work0 = CONVERT_SECONDS(.5f);
}
}
}
@ -930,7 +960,7 @@ void ChozoStatuePartArmRefill(void)
// Refill energy
if (!SpriteUtilRefillEnergy())
{
gCurrentSprite.work0--;
APPLY_DELTA_TIME(gCurrentSprite.work0);
gEnergyRefillAnimation = 0xD;
}
}
@ -938,10 +968,12 @@ void ChozoStatuePartArmRefill(void)
{
// Refill missiles
if (gEnergyRefillAnimation != 0)
{
gEnergyRefillAnimation--;
}
else if (!SpriteUtilRefillMissiles())
{
gCurrentSprite.work0--;
APPLY_DELTA_TIME(gCurrentSprite.work0);
gMissileRefillAnimation = 0xD;
}
}
@ -949,10 +981,12 @@ void ChozoStatuePartArmRefill(void)
{
// Refill super missiles
if (gMissileRefillAnimation != 0)
{
gMissileRefillAnimation--;
}
else if (!SpriteUtilRefillSuperMissiles())
{
gCurrentSprite.work0--;
APPLY_DELTA_TIME(gCurrentSprite.work0);
gSuperMissileRefillAnimation = 0xD;
}
}
@ -960,10 +994,12 @@ void ChozoStatuePartArmRefill(void)
{
// Refill power bombs
if (gSuperMissileRefillAnimation != 0)
{
gSuperMissileRefillAnimation--;
}
else if (!SpriteUtilRefillPowerBombs())
{
gCurrentSprite.work0--;
APPLY_DELTA_TIME(gCurrentSprite.work0);
gPowerBombRefillAnimation = 0xD;
}
}
@ -971,9 +1007,13 @@ void ChozoStatuePartArmRefill(void)
{
// Check refill anim ended
if (gPowerBombRefillAnimation != 0)
{
gPowerBombRefillAnimation--;
}
else if (gCurrentSprite.work0 != 0)
gCurrentSprite.work0--; // Update timer
{
APPLY_DELTA_TIME(gCurrentSprite.work0);
}
else
{
// Set sleeping
@ -984,13 +1024,13 @@ void ChozoStatuePartArmRefill(void)
if (gEquipment.maxMissiles == 0 && gEquipment.maxSuperMissiles == 0 && gEquipment.maxPowerBombs == 0)
{
// Only energy
SpriteSpawnPrimary(PSPRITE_ITEM_BANNER, MESSAGE_ENERGY_TANK_RECHARGE_COMPLETE, 0x6,
SpriteSpawnPrimary(PSPRITE_ITEM_BANNER, MESSAGE_ENERGY_TANK_RECHARGE_COMPLETE, 6,
gCurrentSprite.yPosition, gCurrentSprite.xPosition, 0);
}
else
{
// Energy and weapons
SpriteSpawnPrimary(PSPRITE_ITEM_BANNER, MESSAGE_WEAPONS_AND_ENERGY_RESTORED, 0x6,
SpriteSpawnPrimary(PSPRITE_ITEM_BANNER, MESSAGE_WEAPONS_AND_ENERGY_RESTORED, 6,
gCurrentSprite.yPosition, gCurrentSprite.xPosition, 0);
}
}
@ -1116,7 +1156,9 @@ void ChozoStatuePartLegIdle(void)
SpawnChozoStatueMovement(gSubSpriteData1.workVariable2);
}
else if (gSpriteData[ramSlot].pose == CHOZO_STATUE_POSE_DELAY_AFTER_SITTING)
{
gCurrentSprite.pose = CHOZO_STATUE_PART_POSE_DO_NOTHING;
}
}
/**
@ -1125,11 +1167,11 @@ void ChozoStatuePartLegIdle(void)
*/
void ChozoStatue(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
case 0:
case SPRITE_POSE_UNINITIALIZED:
ChozoStatueInit();
break;
@ -1193,12 +1235,12 @@ void ChozoStatuePart(void)
{
u8 ramSlot;
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
ramSlot = gCurrentSprite.primarySpriteRamSlot;
switch (gCurrentSprite.pose)
{
case 0:
case SPRITE_POSE_UNINITIALIZED:
ChozoStatuePartInit();
break;
@ -1274,25 +1316,25 @@ void ChozoStatueRefill(void)
{
u8 ramSlot;
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
ramSlot = gCurrentSprite.primarySpriteRamSlot;
if (gCurrentSprite.pose == 0)
if (gCurrentSprite.pose == SPRITE_POSE_UNINITIALIZED)
{
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.properties |= SP_ALWAYS_ACTIVE;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.drawOrder = 0x1;
gCurrentSprite.drawOrder = 1;
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x10;
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = 0x4;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = 0x4;
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.hitboxTop = PIXEL_SIZE;
gCurrentSprite.hitboxBottom = PIXEL_SIZE;
gCurrentSprite.hitboxLeft = PIXEL_SIZE;
gCurrentSprite.hitboxRight = PIXEL_SIZE;
gCurrentSprite.pose = 0x9;
@ -1300,11 +1342,11 @@ void ChozoStatueRefill(void)
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.pOam = sChozoStatueRefillOam;
SoundPlay(0x10F); // Chozo statue refill
SoundPlay(SOUND_CHOZO_STATUE_REFILL);
}
else if (gSpriteData[ramSlot].pose == CHOZO_STATUE_POSE_SLEEPING)
{
gCurrentSprite.status = 0;
SoundFade(0x10F, 0x1E); // Chozo statue refill
SoundFade(SOUND_CHOZO_STATUE_REFILL, CONVERT_SECONDS(.5f));
}
}

View File

@ -63,9 +63,9 @@ void SpawnChozoStatueMovement(u8 stage)
gSpriteData[i].animationDurationCounter = 0;
gSpriteData[i].currentAnimationFrame = gCurrentSprite.currentAnimationFrame;
gSpriteData[i].drawDistanceTopOffset = gCurrentSprite.drawDistanceTopOffset;
gSpriteData[i].drawDistanceBottomOffset = gCurrentSprite.drawDistanceBottomOffset;
gSpriteData[i].drawDistanceHorizontalOffset = gCurrentSprite.drawDistanceHorizontalOffset;
gSpriteData[i].drawDistanceTop = gCurrentSprite.drawDistanceTop;
gSpriteData[i].drawDistanceBottom = gCurrentSprite.drawDistanceBottom;
gSpriteData[i].drawDistanceHorizontal = gCurrentSprite.drawDistanceHorizontal;
break;
}
}
@ -76,7 +76,7 @@ void SpawnChozoStatueMovement(u8 stage)
*/
void ChozoStatueMovement(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.status ^= SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.animationDurationCounter--;
gCurrentSprite.work0--;

View File

@ -52,14 +52,14 @@ void CrocomireInit(void)
gCurrentSprite.xPositionSpawn = xPosition;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3);
gCurrentSprite.hitboxTopOffset = -BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE * 2;
gCurrentSprite.hitboxTop = -BLOCK_SIZE;
gCurrentSprite.hitboxBottom = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxRight = BLOCK_SIZE * 2;
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
gCurrentSprite.health = GET_PSPRITE_HEALTH(gCurrentSprite.spriteId);
@ -119,67 +119,67 @@ void CrocomirePartInit(void)
switch (gCurrentSprite.roomSlot)
{
case CROCOMIRE_PART_RIGHT_ARM:
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxBottomOffset = PIXEL_SIZE;
gCurrentSprite.hitboxLeftOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxRightOffset = PIXEL_SIZE;
gCurrentSprite.hitboxTop = -PIXEL_SIZE;
gCurrentSprite.hitboxBottom = PIXEL_SIZE;
gCurrentSprite.hitboxLeft = -PIXEL_SIZE;
gCurrentSprite.hitboxRight = PIXEL_SIZE;
gCurrentSprite.drawOrder = 2;
break;
case CROCOMIRE_PART_LEGS:
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = -(BLOCK_SIZE * 3);
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE;
gCurrentSprite.hitboxTop = -(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = -(BLOCK_SIZE * 3);
gCurrentSprite.hitboxRight = BLOCK_SIZE;
gCurrentSprite.drawOrder = 3;
break;
case CROCOMIRE_PART_BODY:
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3);
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE * 3 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = -(BLOCK_SIZE * 2);
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE * 2 + HALF_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -(BLOCK_SIZE * 3 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = -(BLOCK_SIZE * 2);
gCurrentSprite.hitboxRight = BLOCK_SIZE * 2 + HALF_BLOCK_SIZE;
gCurrentSprite.drawOrder = 5;
break;
case CROCOMIRE_PART_TONGUE:
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.drawOrder = 6;
gCurrentSprite.samusCollision = SSC_NONE;
break;
case CROCOMIRE_PART_LEFT_ARM:
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxBottomOffset = PIXEL_SIZE;
gCurrentSprite.hitboxLeftOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxRightOffset = PIXEL_SIZE;
gCurrentSprite.hitboxTop = -PIXEL_SIZE;
gCurrentSprite.hitboxBottom = PIXEL_SIZE;
gCurrentSprite.hitboxLeft = -PIXEL_SIZE;
gCurrentSprite.hitboxRight = PIXEL_SIZE;
gCurrentSprite.drawOrder = 6;
break;
@ -191,7 +191,7 @@ void CrocomirePartInit(void)
void Crocomire(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
@ -218,7 +218,7 @@ void CrocomirePart(void)
{
u8 ramSlot;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
ramSlot = gCurrentSprite.primarySpriteRamSlot;
if (gSpriteData[ramSlot].pose > 0x61 && gCurrentSprite.pose < 0x62)

View File

@ -260,7 +260,7 @@ u8 DeoremCheckLeaving(u8 ramSlot)
gCurrentSprite.pOam = sDeoremOam_Closing;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.hitboxBottomOffset = 0x40;
gCurrentSprite.hitboxBottom = 0x40;
gSpriteData[ramSlot].status |= SPRITE_STATUS_IGNORE_PROJECTILES;
SoundPlay(0x199);
}
@ -359,13 +359,13 @@ void DeoremInit(void)
gBossWork.work1 = gCurrentSprite.yPosition - HALF_BLOCK_SIZE;
gBossWork.work2 = gCurrentSprite.xPosition;
gCurrentSprite.yPosition -= BLOCK_SIZE * 2 + HALF_BLOCK_SIZE;
gCurrentSprite.hitboxTopOffset = -0x60;
gCurrentSprite.hitboxBottomOffset = 0x40;
gCurrentSprite.hitboxLeftOffset = -0x60;
gCurrentSprite.hitboxRightOffset = 0x60;
gCurrentSprite.drawDistanceTopOffset = 0x20;
gCurrentSprite.drawDistanceBottomOffset = 0x20;
gCurrentSprite.drawDistanceHorizontalOffset = 0x30;
gCurrentSprite.hitboxTop = -0x60;
gCurrentSprite.hitboxBottom = 0x40;
gCurrentSprite.hitboxLeft = -0x60;
gCurrentSprite.hitboxRight = 0x60;
gCurrentSprite.drawDistanceTop = 0x20;
gCurrentSprite.drawDistanceBottom = 0x20;
gCurrentSprite.drawDistanceHorizontal = 0x30;
gCurrentSprite.pOam = sDeoremOam_ClosedSlow;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
@ -374,7 +374,7 @@ void DeoremInit(void)
gCurrentSprite.health = GET_PSPRITE_HEALTH(gCurrentSprite.spriteId);
gCurrentSprite.work0 = 0;
gCurrentSprite.pose = DEOREM_POSE_SPAWN_GOING_DOWN;
gCurrentSprite.oamRotation = 0;
gCurrentSprite.rotation = 0;
}
/**
@ -690,7 +690,7 @@ void DeoremAfterSpawn(void)
gCurrentSprite.pOam = sDeoremOam_Opening;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxBottom = 0;
gSpriteData[ramSlot].status &= ~SPRITE_STATUS_IGNORE_PROJECTILES;
@ -712,7 +712,7 @@ void DeoremMainLoop(void)
u32 spriteOffset = gCurrentSprite.work3;
u16 health = gSpriteData[spriteOffset].health;
if (gCurrentSprite.work0 != 0 && !(gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400))
if (gCurrentSprite.work0 != 0 && !(gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN))
{
if (!DeoremCheckLeaving(gCurrentSprite.work3))
{
@ -741,24 +741,24 @@ void DeoremMainLoop(void)
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.status &= ~SPRITE_STATUS_MOSAIC;
SoundPlay(0x19D);
gCurrentSprite.oamRotation = 0;
gCurrentSprite.rotation = 0;
if (health == 60)
{
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
gCurrentSprite.work0 = 8;
}
else if ((gCurrentSprite.xPosition - (BLOCK_SIZE + HALF_BLOCK_SIZE) < gSamusData.xPosition) &&
(gCurrentSprite.xPosition + BLOCK_SIZE + HALF_BLOCK_SIZE > gSamusData.xPosition))
{
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
gCurrentSprite.work0 = 8;
}
else
{
gCurrentSprite.work1 = 0;
gCurrentSprite.work2 = 1;
gCurrentSprite.oamScaling = gSamusData.xPosition;
gCurrentSprite.scaling = gSamusData.xPosition;
ScreenShakeStartVertical(0x14, 0x81);
}
@ -768,7 +768,7 @@ void DeoremMainLoop(void)
gCurrentSprite.pOam = sDeoremOam_Closing;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.hitboxBottomOffset = BLOCK_SIZE;
gCurrentSprite.hitboxBottom = BLOCK_SIZE;
gSpriteData[spriteOffset].status |= SPRITE_STATUS_IGNORE_PROJECTILES;
SoundPlay(0x199);
@ -795,7 +795,7 @@ void DeoremMainLoop(void)
}
else
{
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
yRange = 0x1F4;
if (health == 0x3C)
@ -814,7 +814,7 @@ void DeoremMainLoop(void)
}
else
{
DeoremMoveDiagonally(0x14, gCurrentSprite.oamScaling);
DeoremMoveDiagonally(0x14, gCurrentSprite.scaling);
yRange = 0x1D0;
movement = 8;
}
@ -822,10 +822,10 @@ void DeoremMainLoop(void)
if (gCurrentSprite.yPosition < gCurrentSprite.yPositionSpawn + yRange)
{
gCurrentSprite.yPosition += movement;
if (gCurrentSprite.oamRotation != 0)
if (gCurrentSprite.rotation != 0)
return;
gCurrentSprite.oamRotation += 1;
gCurrentSprite.rotation += 1;
if (8 < movement)
SoundPlay(0x194);
@ -839,7 +839,7 @@ void DeoremMainLoop(void)
gCurrentSprite.pOam = sDeoremOam_Opening;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxBottom = 0;
gSpriteData[spriteOffset].status &= ~SPRITE_STATUS_IGNORE_PROJECTILES;
SoundPlay(0x198);
@ -865,19 +865,19 @@ void DeoremRetracting(void)
gCurrentSprite.pOam = sDeoremOam_OpenedFast;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.hitboxLeftOffset = -(BLOCK_SIZE * 2 + QUARTER_BLOCK_SIZE);
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE * 2 + QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -(BLOCK_SIZE * 2 + QUARTER_BLOCK_SIZE);
gCurrentSprite.hitboxRight = BLOCK_SIZE * 2 + QUARTER_BLOCK_SIZE;
}
gCurrentSprite.work0--;
if (gCurrentSprite.work0 >= 0x19)
{
if (!(gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400))
if (!(gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN))
DeoremMoveDiagonally(0x10, gSamusData.xPosition);
}
else if (gCurrentSprite.work0 == 0)
{
gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_DOWN;
SoundPlay(0x195);
}
}
@ -886,8 +886,8 @@ void DeoremRetracting(void)
gCurrentSprite.yPosition -= 8;
if (gCurrentSprite.yPosition < gCurrentSprite.yPositionSpawn + BLOCK_SIZE * 2 + HALF_BLOCK_SIZE)
{
gCurrentSprite.hitboxLeftOffset = -(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE + HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxRight = BLOCK_SIZE + HALF_BLOCK_SIZE;
gCurrentSprite.yPosition = gCurrentSprite.yPositionSpawn + BLOCK_SIZE * 2 + HALF_BLOCK_SIZE;
if (!DeoremCheckLeaving(spriteOffset))
@ -906,7 +906,7 @@ void DeoremRetracting(void)
else
gCurrentSprite.pose = DEOREM_POSE_THORNS_2;
gCurrentSprite.work0 = 0xFF;
gCurrentSprite.oamRotation = 0;
gCurrentSprite.rotation = 0;
}
else
{
@ -939,10 +939,10 @@ void DeoremThrowingThorns(void)
changeAnimTime = 30;
}
if (!(gCurrentSprite.oamRotation & 15))
if (!(gCurrentSprite.rotation & 15))
SoundPlay(0x196);
gCurrentSprite.oamRotation++;
gCurrentSprite.rotation++;
if (gCurrentSprite.work0 < changeAnimTime)
{
@ -951,7 +951,7 @@ void DeoremThrowingThorns(void)
gCurrentSprite.pOam = sDeoremOam_Closing;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.hitboxBottomOffset = BLOCK_SIZE;
gCurrentSprite.hitboxBottom = BLOCK_SIZE;
gSpriteData[spriteOffset].status |= SPRITE_STATUS_IGNORE_PROJECTILES;
SoundPlay(0x199);
}
@ -1027,7 +1027,7 @@ void DeoremDying(void)
*/
void DeoremDyingGoingDown(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gCurrentSprite.yPosition < gCurrentSprite.yPositionSpawn + BLOCK_SIZE * 7 + QUARTER_BLOCK_SIZE)
{
@ -1048,7 +1048,7 @@ void DeoremDyingGoingDown(void)
*/
void DeoremDeath(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.work0--;
if (gCurrentSprite.work0 == 0x0)
{
@ -1076,7 +1076,7 @@ void DeoremCheckLeavingCeilingAnimEnded(void)
{
gCurrentSprite.pose = DEOREM_POSE_LEAVING;
gCurrentSprite.work0 = 0x3C;
gCurrentSprite.oamRotation = 0;
gCurrentSprite.rotation = 0;
}
}
@ -1181,7 +1181,7 @@ void DeoremLeavingAnim(void)
*/
void DeoremLeavingInGroundDebris(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (!(gFrameCounter8Bit & 0xF))
{
@ -1249,36 +1249,36 @@ void DeoremSegmentInit(void)
if (roomSlot == 18)
{
gCurrentSprite.drawDistanceTopOffset = 0x30;
gCurrentSprite.drawDistanceBottomOffset = 0x30;
gCurrentSprite.drawDistanceHorizontalOffset = 0x1A;
gCurrentSprite.hitboxTopOffset = -3 * HALF_BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = 3 * HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -3 * QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = 3 * QUARTER_BLOCK_SIZE;
gCurrentSprite.drawDistanceTop = 0x30;
gCurrentSprite.drawDistanceBottom = 0x30;
gCurrentSprite.drawDistanceHorizontal = 0x1A;
gCurrentSprite.hitboxTop = -3 * HALF_BLOCK_SIZE;
gCurrentSprite.hitboxBottom = 3 * HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -3 * QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxRight = 3 * QUARTER_BLOCK_SIZE;
gCurrentSprite.pOam = sDeoremSegmentOam_Tail;
}
else if ((roomSlot == 0) || (roomSlot == 6) || (roomSlot == 12))
{
gCurrentSprite.drawDistanceTopOffset = 0x18;
gCurrentSprite.drawDistanceBottomOffset = 0x18;
gCurrentSprite.drawDistanceHorizontalOffset = 0x20;
gCurrentSprite.hitboxTopOffset = -BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -3 * HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = 3 * HALF_BLOCK_SIZE;
gCurrentSprite.drawDistanceTop = 0x18;
gCurrentSprite.drawDistanceBottom = 0x18;
gCurrentSprite.drawDistanceHorizontal = 0x20;
gCurrentSprite.hitboxTop = -BLOCK_SIZE;
gCurrentSprite.hitboxBottom = BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -3 * HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRight = 3 * HALF_BLOCK_SIZE;
gCurrentSprite.pOam = sDeoremSegmentOam_Junction;
gCurrentSprite.drawOrder = 11;
}
else
{
gCurrentSprite.drawDistanceTopOffset = 0x12;
gCurrentSprite.drawDistanceBottomOffset = 0x12;
gCurrentSprite.drawDistanceHorizontalOffset = 0x22;
gCurrentSprite.hitboxTopOffset = -BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -3 * HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = 3 * HALF_BLOCK_SIZE;
gCurrentSprite.drawDistanceTop = 0x12;
gCurrentSprite.drawDistanceBottom = 0x12;
gCurrentSprite.drawDistanceHorizontal = 0x22;
gCurrentSprite.hitboxTop = -BLOCK_SIZE;
gCurrentSprite.hitboxBottom = BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -3 * HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRight = 3 * HALF_BLOCK_SIZE;
gCurrentSprite.pOam = sDeoremSegmentOam_Middle;
}
@ -1781,14 +1781,14 @@ void DeoremSegmentLeftLeaving(void)
{
if (gCurrentSprite.roomSlot == 19)
{
gCurrentSprite.drawDistanceTopOffset = 16;
gCurrentSprite.drawDistanceBottomOffset = 48;
gCurrentSprite.drawDistanceHorizontalOffset = 24;
gCurrentSprite.drawDistanceTop = 16;
gCurrentSprite.drawDistanceBottom = 48;
gCurrentSprite.drawDistanceHorizontal = 24;
gCurrentSprite.hitboxTopOffset = -3 * BLOCK_SIZE / 4;
gCurrentSprite.hitboxBottomOffset = 5 * BLOCK_SIZE / 2;
gCurrentSprite.hitboxLeftOffset = -BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE;
gCurrentSprite.hitboxTop = -3 * BLOCK_SIZE / 4;
gCurrentSprite.hitboxBottom = 5 * BLOCK_SIZE / 2;
gCurrentSprite.hitboxLeft = -BLOCK_SIZE;
gCurrentSprite.hitboxRight = BLOCK_SIZE;
gCurrentSprite.pOam = sDeoremSegmentOam_Tail;
gCurrentSprite.animationDurationCounter = 0;
@ -1876,14 +1876,14 @@ void DeoremSegmentRightLeaving(void)
{
if (gCurrentSprite.roomSlot == 17)
{
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x30;
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x30;
gCurrentSprite.drawDistanceHorizontal = 0x18;
gCurrentSprite.hitboxTopOffset = -3 * QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = 5 * HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE;
gCurrentSprite.hitboxTop = -3 * QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxBottom = 5 * HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -BLOCK_SIZE;
gCurrentSprite.hitboxRight = BLOCK_SIZE;
gCurrentSprite.pOam = sDeoremSegmentOam_Tail;
gCurrentSprite.animationDurationCounter = 0;
@ -2001,7 +2001,7 @@ void DeoremSegmentDying(void)
u8 rng;
u8 randomMovement;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
xPosition = gCurrentSprite.xPosition;
roomSlot = gCurrentSprite.roomSlot;
rng = gSpriteRng;
@ -2034,19 +2034,19 @@ void DeoremSegmentDying(void)
void DeoremEyeInit(void)
{
gCurrentSprite.status |= SPRITE_STATUS_ROTATION_SCALING;
gCurrentSprite.oamScaling = 256;
gCurrentSprite.scaling = 256;
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawOrder = 11;
gCurrentSprite.health = GET_SSPRITE_HEALTH(gCurrentSprite.spriteId);
gCurrentSprite.drawDistanceTopOffset = 16;
gCurrentSprite.drawDistanceBottomOffset = 16;
gCurrentSprite.drawDistanceHorizontalOffset = 16;
gCurrentSprite.drawDistanceTop = 16;
gCurrentSprite.drawDistanceBottom = 16;
gCurrentSprite.drawDistanceHorizontal = 16;
gCurrentSprite.hitboxTopOffset = -64;
gCurrentSprite.hitboxBottomOffset = 48;
gCurrentSprite.hitboxLeftOffset = -40;
gCurrentSprite.hitboxRightOffset = 40;
gCurrentSprite.hitboxTop = -64;
gCurrentSprite.hitboxBottom = 48;
gCurrentSprite.hitboxLeft = -40;
gCurrentSprite.hitboxRight = 40;
gCurrentSprite.pOam = sDeoremEyeOam_Pulsing;
gCurrentSprite.animationDurationCounter = 0;
@ -2063,12 +2063,12 @@ void DeoremEyeInit(void)
if (gCurrentSprite.xPosition > gSamusData.xPosition)
{
gCurrentSprite.oamRotation = 128;
gCurrentSprite.rotation = 128;
gCurrentSprite.work0 = 128;
}
else
{
gCurrentSprite.oamRotation = 0;
gCurrentSprite.rotation = 0;
gCurrentSprite.work0 = 0;
}
@ -2213,7 +2213,7 @@ void DeoremEyeMove(void)
gCurrentSprite.yPosition = gSpriteData[ramSlot].yPosition - 28;
gCurrentSprite.xPosition = gSpriteData[ramSlot].xPosition - 4;
gCurrentSprite.work0 = rotation;
gCurrentSprite.oamRotation = rotation;
gCurrentSprite.rotation = rotation;
}
/**
@ -2279,9 +2279,9 @@ void DeoremEyeDyingSpinningAnim(void)
gCurrentSprite.xPosition = gSpriteData[ramSlot].xPosition - 4;
if (gSpriteData[ramSlot].pose == DEOREM_POSE_DEATH && gSpriteData[ramSlot].work0 < 0x1F)
gCurrentSprite.oamRotation += 8;
gCurrentSprite.rotation += 8;
else
gCurrentSprite.oamRotation += 4;
gCurrentSprite.rotation += 4;
if (gSpriteData[ramSlot].pose == DEOREM_POSE_DEATH && gSpriteData[ramSlot].work0 < 2)
{
@ -2300,7 +2300,7 @@ void DeoremEyeDyingMovingAnim(void)
u16 xPos;
u8 timer;
gCurrentSprite.oamRotation += 0xC;
gCurrentSprite.rotation += 0xC;
if (gCurrentSprite.work0 < 100)
gCurrentSprite.yPosition--;
@ -2338,20 +2338,20 @@ void DeoremThornInit(void)
{
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_80;
gCurrentSprite.oamScaling = Q_8_8(1.f);
gCurrentSprite.oamRotation = 0;
gCurrentSprite.scaling = Q_8_8(1.f);
gCurrentSprite.rotation = 0;
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.properties |= SP_KILL_OFF_SCREEN;
gCurrentSprite.drawDistanceTopOffset = 8;
gCurrentSprite.drawDistanceBottomOffset = 8;
gCurrentSprite.drawDistanceHorizontalOffset = 8;
gCurrentSprite.drawDistanceTop = 8;
gCurrentSprite.drawDistanceBottom = 8;
gCurrentSprite.drawDistanceHorizontal = 8;
gCurrentSprite.hitboxTopOffset = -0x1C;
gCurrentSprite.hitboxBottomOffset = 0x1C;
gCurrentSprite.hitboxLeftOffset = -0x18;
gCurrentSprite.hitboxRightOffset = 0x18;
gCurrentSprite.hitboxTop = -0x1C;
gCurrentSprite.hitboxBottom = 0x1C;
gCurrentSprite.hitboxLeft = -0x18;
gCurrentSprite.hitboxRight = 0x18;
gCurrentSprite.pOam = sDeoremThornOam_Idle;
gCurrentSprite.animationDurationCounter = 0;
@ -2366,12 +2366,12 @@ void DeoremThornInit(void)
if ((gCurrentSprite.status & SPRITE_STATUS_XFLIP) != 0)
{
gCurrentSprite.status |= SPRITE_STATUS_FACING_RIGHT;
gCurrentSprite.oamRotation = 0x80;
gCurrentSprite.rotation = 0x80;
}
else
{
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_RIGHT;
gCurrentSprite.oamRotation = 0;
gCurrentSprite.rotation = 0;
}
gCurrentSprite.status &= ~SPRITE_STATUS_XFLIP;
@ -2400,9 +2400,9 @@ void DeoremThornSpawning(void)
gCurrentSprite.drawOrder = 3;
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
gCurrentSprite.oamRotation += 0x20;
gCurrentSprite.rotation += 0x20;
else
gCurrentSprite.oamRotation -= 0x20;
gCurrentSprite.rotation -= 0x20;
}
/**
@ -2433,16 +2433,16 @@ void DeoremThornMovement(void)
s32 newXPos;
if (arrayOffset >= 0x24)
gCurrentSprite.oamRotation = 0xB8;
gCurrentSprite.rotation = 0xB8;
else if (arrayOffset >= 0x21)
gCurrentSprite.oamRotation = 0xB0;
gCurrentSprite.rotation = 0xB0;
else if (arrayOffset >= 0x1D)
if (gCurrentSprite.oamRotation >= 0xA0)
gCurrentSprite.oamRotation = 0xA0;
if (gCurrentSprite.rotation >= 0xA0)
gCurrentSprite.rotation = 0xA0;
else
gCurrentSprite.oamRotation += 8;
gCurrentSprite.rotation += 8;
else
gCurrentSprite.oamRotation += 0x10;
gCurrentSprite.rotation += 0x10;
newXPos = xMovement + gCurrentSprite.xPosition; // Why (needed to avoid reg swap)
gCurrentSprite.xPosition = newXPos;
@ -2450,16 +2450,16 @@ void DeoremThornMovement(void)
else
{
if (arrayOffset >= 0x24)
gCurrentSprite.oamRotation = 200;
gCurrentSprite.rotation = 200;
else if (arrayOffset >= 0x21)
gCurrentSprite.oamRotation = 0xD0;
gCurrentSprite.rotation = 0xD0;
else if (arrayOffset >= 0x1D)
if (gCurrentSprite.oamRotation < 0xE1)
gCurrentSprite.oamRotation = 0xE0;
if (gCurrentSprite.rotation < 0xE1)
gCurrentSprite.rotation = 0xE0;
else
gCurrentSprite.oamRotation -= 8;
gCurrentSprite.rotation -= 8;
else
gCurrentSprite.oamRotation -= 0x10;
gCurrentSprite.rotation -= 0x10;
gCurrentSprite.xPosition -= xMovement;
}
@ -2568,7 +2568,7 @@ void DeoremSegment(void)
if (gSpriteData[ramSlot].pose > 0x61) // TODO: Pose names
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gSpriteData[ramSlot].pose == 0x68 && gCurrentSprite.pose < 0x62)
gCurrentSprite.pose = 0x62;
}
@ -2671,7 +2671,7 @@ void DeoremEye(void)
u8 ramSlot;
u8 isft;
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gCurrentSprite.pose < 0x68)
{
ramSlot = gCurrentSprite.primarySpriteRamSlot;
@ -2684,7 +2684,7 @@ void DeoremEye(void)
gSpriteData[ramSlot].pOam = sDeoremOam_ClosedFast;
gSpriteData[ramSlot].animationDurationCounter = 0x0;
gSpriteData[ramSlot].currentAnimationFrame = 0x0;
gSpriteData[ramSlot].hitboxBottomOffset = 0x40;
gSpriteData[ramSlot].hitboxBottom = 0x40;
if (gCurrentSprite.health < 0x15)
gSpriteData[ramSlot].absolutePaletteRow = 0x2;
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;

View File

@ -74,22 +74,22 @@ void DessgeegaInit(void)
gCurrentSprite.work0 = 0x0;
if (gCurrentSprite.status & SPRITE_STATUS_YFLIP)
{
gCurrentSprite.drawDistanceTopOffset = 0x8;
gCurrentSprite.drawDistanceBottomOffset = 0x28;
gCurrentSprite.hitboxTopOffset = 0x0;
gCurrentSprite.hitboxBottomOffset = 0x58;
gCurrentSprite.drawDistanceTop = 0x8;
gCurrentSprite.drawDistanceBottom = 0x28;
gCurrentSprite.hitboxTop = 0x0;
gCurrentSprite.hitboxBottom = 0x58;
}
else
{
gCurrentSprite.drawDistanceTopOffset = 0x28;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.hitboxTopOffset = -0x58;
gCurrentSprite.hitboxBottomOffset = 0x0;
gCurrentSprite.drawDistanceTop = 0x28;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.hitboxTop = -0x58;
gCurrentSprite.hitboxBottom = 0x0;
}
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.hitboxLeftOffset = -0x40;
gCurrentSprite.hitboxRightOffset = 0x40;
gCurrentSprite.drawDistanceHorizontal = 0x18;
gCurrentSprite.hitboxLeft = -0x40;
gCurrentSprite.hitboxRight = 0x40;
gCurrentSprite.pOam = sDessgeegaOAM_Idle;
gCurrentSprite.animationDurationCounter = 0x0;
@ -201,11 +201,11 @@ void DessgeegaJumpWarningGround(void)
if (SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition) == COLLISION_AIR)
{
// Check right block
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRight);
if (gPreviousCollisionCheck == COLLISION_AIR)
{
// Check left block
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft);
if (gPreviousCollisionCheck == COLLISION_AIR)
{
DessgeegaFallingInit();
@ -248,7 +248,7 @@ void DessgeegaJumpingGround(void)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
{
// Check colliding with wall on right
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition - 0x10, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset + 4);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition - 0x10, gCurrentSprite.xPosition + gCurrentSprite.hitboxRight + 4);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
collision++;
@ -262,7 +262,7 @@ void DessgeegaJumpingGround(void)
else
{
// Check colliding with wall on left
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition - 0x10, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset - 4);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition - 0x10, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft - 4);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
collision++;
@ -300,12 +300,12 @@ void DessgeegaJumpingGround(void)
{
// Block on right
topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition,
gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset);
gCurrentSprite.xPosition + gCurrentSprite.hitboxRight);
if (gPreviousVerticalCollisionCheck == COLLISION_AIR)
{
// Block on left
topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition,
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset);
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft);
if (gPreviousVerticalCollisionCheck != COLLISION_AIR)
collision = TRUE;
@ -324,7 +324,7 @@ void DessgeegaJumpingGround(void)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
{
// Check block on top right
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxTopOffset, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxTop, gCurrentSprite.xPosition + gCurrentSprite.hitboxRight);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
// Set falling behavior
@ -336,7 +336,7 @@ void DessgeegaJumpingGround(void)
else
{
// Check block on top left
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxTopOffset, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxTop, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
// Set falling behavior
@ -372,7 +372,7 @@ void DessgeegaJumpingCeiling(void)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
{
// Check colliding with wall on right
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + 0x10, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset + 4);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + 0x10, gCurrentSprite.xPosition + gCurrentSprite.hitboxRight + 4);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
collision++;
@ -386,7 +386,7 @@ void DessgeegaJumpingCeiling(void)
else
{
// Check colliding with wall on left
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + 0x10, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset - 4);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + 0x10, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft - 4);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
collision++;
@ -410,7 +410,7 @@ void DessgeegaJumpingCeiling(void)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
{
// Check block on bottom right
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxBottomOffset, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxBottom, gCurrentSprite.xPosition + gCurrentSprite.hitboxRight);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
// Set falling behavior
@ -422,7 +422,7 @@ void DessgeegaJumpingCeiling(void)
else
{
// Check block on bottom left
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxBottomOffset, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxBottom, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
// Set falling behavior
@ -456,12 +456,12 @@ void DessgeegaJumpingCeiling(void)
{
// Block on right
topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition,
gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset);
gCurrentSprite.xPosition + gCurrentSprite.hitboxRight);
if (!(gPreviousVerticalCollisionCheck & 0xF))
{
// Block on left
topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition,
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset);
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft);
if (gPreviousVerticalCollisionCheck & 0xF)
collision = TRUE;
@ -505,13 +505,13 @@ void DessgeegaFallingGround(void)
else
{
topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition,
gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset);
gCurrentSprite.xPosition + gCurrentSprite.hitboxRight);
if (gPreviousVerticalCollisionCheck != COLLISION_AIR)
colliding++;
else
{
topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition,
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset);
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft);
if (gPreviousVerticalCollisionCheck != COLLISION_AIR)
colliding++;
}
@ -559,12 +559,12 @@ void DessgeegaFallingCeiling(void)
colliding++;
else
{
topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset);
topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRight);
if (gPreviousVerticalCollisionCheck != COLLISION_AIR)
colliding++;
else
{
topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset);
topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft);
if (gPreviousVerticalCollisionCheck != COLLISION_AIR)
colliding++;
}
@ -604,10 +604,10 @@ void DessgeegaIdleGround(void)
DessgeegaJumpWarningInit();
else
{
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRight);
if (gPreviousCollisionCheck == COLLISION_AIR)
{
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft);
if (gPreviousCollisionCheck == COLLISION_AIR)
{
DessgeegaFallingInit();
@ -682,7 +682,7 @@ void DessgeegaLongBeamDetectSamus(void)
u16 yPosition;
u16 xPosition;
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
// Detect samus

View File

@ -4,6 +4,7 @@
#include "data/sprites/dragon.h"
#include "data/sprite_data.h"
#include "constants/audio.h"
#include "constants/clipdata.h"
#include "constants/particle.h"
#include "constants/sprite.h"
@ -13,6 +14,15 @@
#include "structs/samus.h"
#include "structs/sprite.h"
#define DRAGON_Y_VELOCITY (PIXEL_SIZE / 2)
#define DRAGON_SPIT_Y_OFFSET (BLOCK_SIZE + EIGHTH_BLOCK_SIZE)
#define DRAGON_SPIT_X_OFFSET (HALF_BLOCK_SIZE + EIGHTH_BLOCK_SIZE)
#define DRAGON_MAX_RISING_HEIGHT (BLOCK_SIZE * 2 - ONE_SUB_PIXEL)
// The sprite status flag is used with "reverse" intent, when it's set, the dragon rises
#define STATUS_RISING (SPRITE_STATUS_FACING_DOWN)
/**
* @brief 20564 | 50 | Handles the Y movement of a dragon
*
@ -25,17 +35,19 @@ void DragonYMovement(void)
oldY = gCurrentSprite.yPosition;
ySpawn = gCurrentSprite.yPositionSpawn;
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & STATUS_RISING)
{
if (ySpawn - (BLOCK_SIZE * 2 - PIXEL_SIZE / SUB_PIXEL_RATIO) < gCurrentSprite.yPosition)
gCurrentSprite.yPosition -= PIXEL_SIZE / 2;
// Check for the max height threshold
if (ySpawn - DRAGON_MAX_RISING_HEIGHT < gCurrentSprite.yPosition)
gCurrentSprite.yPosition -= DRAGON_Y_VELOCITY;
SpriteUtilCheckOutOfRoomEffect(oldY, gCurrentSprite.yPosition, gCurrentSprite.xPosition, SPLASH_SMALL);
}
else
{
if (ySpawn - PIXEL_SIZE / 2 > gCurrentSprite.yPosition)
gCurrentSprite.yPosition += PIXEL_SIZE / 2;
// Check has reached the spawn position
if (ySpawn - DRAGON_Y_VELOCITY > gCurrentSprite.yPosition)
gCurrentSprite.yPosition += DRAGON_Y_VELOCITY;
SpriteUtilCheckInRoomEffect(oldY, gCurrentSprite.yPosition, gCurrentSprite.xPosition, SPLASH_SMALL);
}
@ -47,16 +59,16 @@ void DragonYMovement(void)
*/
void DragonInit(void)
{
gCurrentSprite.hitboxTopOffset = -BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = BLOCK_SIZE + QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxRightOffset = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxTop = -BLOCK_SIZE;
gCurrentSprite.hitboxBottom = BLOCK_SIZE + QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -(QUARTER_BLOCK_SIZE + EIGHTH_BLOCK_SIZE);
gCurrentSprite.hitboxRight = (QUARTER_BLOCK_SIZE + EIGHTH_BLOCK_SIZE);
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.pOam = sDragonOAM_Idle;
gCurrentSprite.pOam = sDragonOam_Idle;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
@ -77,36 +89,49 @@ void DragonIdleInit(void)
{
gCurrentSprite.pose = DRAGON_POSE_IDLE;
gCurrentSprite.pOam = sDragonOAM_Idle;
gCurrentSprite.pOam = sDragonOam_Idle;
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.work0 = 100;
// Spitting interval
gCurrentSprite.work0 = CONVERT_SECONDS(1.f) + TWO_THIRD_SECOND;
}
/**
* @brief 20650 | d0 | Handles the dragon going up
*
*/
void DragonGoUp(void)
void DragonIdle(void)
{
u8 nslr;
u16 xPosition;
u16 yPosition;
if (gCurrentSprite.work0 != 0)
gCurrentSprite.work0--;
APPLY_DELTA_TIME(gCurrentSprite.work0);
// Move vertically
DragonYMovement();
gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN_400;
// Default to sinking
gCurrentSprite.status &= ~STATUS_RISING;
// If samus is below the dragon, don't do anything
if (gSamusData.yPosition > gCurrentSprite.yPosition)
return;
// Check where samus is
nslr = SpriteUtilCheckSamusNearSpriteLeftRight(BLOCK_SIZE * 6, BLOCK_SIZE * 6);
if (nslr != NSLR_OUT_OF_RANGE)
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
if (nslr != NSLR_OUT_OF_RANGE)
{
// Samus is in range, set rising
// Due to this only being checked if samus isn't below the dragon, if samus is in range, but below the rising range of the dragon,
// it'll stutter (sink for one frame, rise for one frame, sink, rise...)
gCurrentSprite.status |= STATUS_RISING;
}
// Check should turn around
if (nslr == NSLR_RIGHT)
{
if (!(gCurrentSprite.status & SPRITE_STATUS_XFLIP))
@ -130,12 +155,15 @@ void DragonGoUp(void)
if (gCurrentSprite.work0 == 0)
{
yPosition = gCurrentSprite.yPosition - 0x88;
// Check if there's nothing 2 blocks above and 1 in front
// If the intent was to check for a block where the fireball would spawn, that doesn't work
// In fact, the fireball never colldes with the block that's checked here
yPosition = gCurrentSprite.yPosition - (BLOCK_SIZE * 2 + EIGHTH_BLOCK_SIZE);
if (gCurrentSprite.status & SPRITE_STATUS_XFLIP)
xPosition = gCurrentSprite.xPosition + 0x48;
xPosition = gCurrentSprite.xPosition + (BLOCK_SIZE + EIGHTH_BLOCK_SIZE);
else
xPosition = gCurrentSprite.xPosition - 0x48;
xPosition = gCurrentSprite.xPosition - (BLOCK_SIZE + EIGHTH_BLOCK_SIZE);
SpriteUtilCheckCollisionAtPosition(yPosition, xPosition);
if (gPreviousCollisionCheck == COLLISION_AIR)
@ -152,7 +180,7 @@ void DragonTurningAroundInit(void)
{
gCurrentSprite.pose = DRAGON_POSE_TURN_AROUND_FIRST_HALF;
gCurrentSprite.pOam = sDragonOAM_TurningAround;
gCurrentSprite.pOam = sDragonOam_TurningAround;
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.animationDurationCounter = 0;
}
@ -161,7 +189,7 @@ void DragonTurningAroundInit(void)
* @brief 20740 | 30 | Checks if the first part of the turning around animation ended
*
*/
void DragonCheckTurningAroundFirstHalfAnimEnded(void)
void DragonTurningAroundFirstHalf(void)
{
DragonYMovement();
@ -169,7 +197,7 @@ void DragonCheckTurningAroundFirstHalfAnimEnded(void)
{
gCurrentSprite.pose = DRAGON_POSE_TURN_AROUND_SECOND_HALF;
gCurrentSprite.pOam = sDragonOAM_TurningAroundPart2;
gCurrentSprite.pOam = sDragonOam_TurningAroundPart2;
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.animationDurationCounter = 0;
@ -181,12 +209,15 @@ void DragonCheckTurningAroundFirstHalfAnimEnded(void)
* @brief 20778 | 20 | Checks if the second part of the turning around animation ended
*
*/
void DragonCheckTurningAroundSecondHalfAnimEnded(void)
void DragonTurningAroundSecondHalf(void)
{
DragonYMovement();
if (SpriteUtilCheckNearEndCurrentSpriteAnim())
{
// Immediatly spit after turning around
gCurrentSprite.pose = DRAGON_POSE_WARNING_INIT;
}
}
/**
@ -197,11 +228,11 @@ void DragonWarningInit(void)
{
gCurrentSprite.pose = DRAGON_POSE_WARNING;
gCurrentSprite.pOam = sDragonOAM_Warning;
gCurrentSprite.pOam = sDragonOam_Warning;
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.work0 = 30;
gCurrentSprite.work0 = CONVERT_SECONDS(.5f);
}
/**
@ -212,12 +243,13 @@ void DragonWarning(void)
{
DragonYMovement();
gCurrentSprite.work0--;
APPLY_DELTA_TIME(gCurrentSprite.work0);
if (gCurrentSprite.work0 == 0)
{
gCurrentSprite.pose = DRAGON_POSE_SPIT;
gCurrentSprite.pOam = sDragonOAM_Spitting;
gCurrentSprite.pOam = sDragonOam_Spitting;
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.animationDurationCounter = 0;
@ -226,7 +258,7 @@ void DragonWarning(void)
}
/**
* @brief 20800 | Handles the dragon spitting
* @brief 20800 | 70 | Handles the dragon spitting
*
*/
void DragonSpit(void)
@ -234,16 +266,16 @@ void DragonSpit(void)
u16 yPosition;
u16 xPosition;
gCurrentSprite.work0--;
APPLY_DELTA_TIME(gCurrentSprite.work0);
if (gCurrentSprite.work0 == 0)
{
DragonIdleInit();
yPosition = gCurrentSprite.yPosition - (BLOCK_SIZE + PIXEL_SIZE * 2);
yPosition = gCurrentSprite.yPosition - DRAGON_SPIT_Y_OFFSET;
if (gCurrentSprite.status & SPRITE_STATUS_XFLIP)
xPosition = gCurrentSprite.xPosition + (HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
xPosition = gCurrentSprite.xPosition + DRAGON_SPIT_X_OFFSET;
else
xPosition = gCurrentSprite.xPosition - (HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
xPosition = gCurrentSprite.xPosition - DRAGON_SPIT_X_OFFSET;
// Spawn projectile
SpriteSpawnSecondary(SSPRITE_DRAGON_FIREBALL, 0, gCurrentSprite.spritesetGfxSlot,
@ -260,16 +292,16 @@ void DragonFireballInit(void)
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.properties |= SP_KILL_OFF_SCREEN;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxBottom = QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxRight = QUARTER_BLOCK_SIZE;
gCurrentSprite.pOam = sDragonFireballOAM_Moving;
gCurrentSprite.pOam = sDragonFireballOam_Moving;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
@ -282,14 +314,16 @@ void DragonFireballInit(void)
if (gCurrentSprite.status & SPRITE_STATUS_XFLIP)
{
gCurrentSprite.status |= SPRITE_STATUS_FACING_RIGHT;
gCurrentSprite.oamRotation = PI / 2;
gCurrentSprite.rotation = PI / 2;
gCurrentSprite.status &= ~SPRITE_STATUS_XFLIP;
}
else
gCurrentSprite.oamRotation = 0;
{
gCurrentSprite.rotation = 0;
}
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_80;
gCurrentSprite.oamScaling = Q_8_8(1.f);
gCurrentSprite.scaling = Q_8_8(1.f);
gCurrentSprite.work3 = 0;
SoundPlay(0x14C);
@ -330,12 +364,12 @@ void DragonFireballMove(void)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
{
gCurrentSprite.xPosition += xMovement;
gCurrentSprite.oamRotation = rotation + PI / 2;
gCurrentSprite.rotation = rotation + PI / 2;
}
else
{
gCurrentSprite.xPosition -= xMovement;
gCurrentSprite.oamRotation = -rotation;
gCurrentSprite.rotation = -rotation;
}
if (SpriteUtilCheckInRoomEffect(oldY, gCurrentSprite.yPosition, gCurrentSprite.xPosition, SPLASH_NONE))
@ -355,9 +389,9 @@ void DragonFireballMove(void)
*/
void DragonFireballExplodingInit(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.pOam = sDragonFireballOAM_Exploding;
gCurrentSprite.pOam = sDragonFireballOam_Exploding;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
@ -372,10 +406,10 @@ void DragonFireballExplodingInit(void)
*/
void DragonFireballCheckExplodingAnimEnded(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (SpriteUtilCheckEndCurrentSpriteAnim())
gCurrentSprite.status = 0; // Kill sprite
gCurrentSprite.status = 0;
}
/**
@ -387,8 +421,9 @@ void Dragon(void)
if (gCurrentSprite.properties & SP_DAMAGED)
{
gCurrentSprite.properties &= ~SP_DAMAGED;
if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN)
SoundPlayNotAlreadyPlaying(0x14D);
SoundPlayNotAlreadyPlaying(SOUND_DRAGON_DAMAGED);
}
if (gCurrentSprite.freezeTimer != 0)
@ -410,18 +445,18 @@ void Dragon(void)
DragonIdleInit();
case DRAGON_POSE_IDLE:
DragonGoUp();
DragonIdle();
break;
case DRAGON_POSE_TURN_AROUND_INIT:
DragonTurningAroundInit();
case DRAGON_POSE_TURN_AROUND_FIRST_HALF:
DragonCheckTurningAroundFirstHalfAnimEnded();
DragonTurningAroundFirstHalf();
break;
case DRAGON_POSE_TURN_AROUND_SECOND_HALF:
DragonCheckTurningAroundSecondHalfAnimEnded();
DragonTurningAroundSecondHalf();
break;
case DRAGON_POSE_WARNING_INIT:

View File

@ -15,7 +15,7 @@
*/
void ElevatorPad(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gCurrentSprite.pose == SPRITE_POSE_UNINITIALIZED)
{
@ -24,14 +24,14 @@ void ElevatorPad(void)
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.pose = 0x9;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxBottomOffset = PIXEL_SIZE;
gCurrentSprite.hitboxLeftOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxRightOffset = PIXEL_SIZE;
gCurrentSprite.hitboxTop = -PIXEL_SIZE;
gCurrentSprite.hitboxBottom = PIXEL_SIZE;
gCurrentSprite.hitboxLeft = -PIXEL_SIZE;
gCurrentSprite.hitboxRight = PIXEL_SIZE;
gCurrentSprite.pOam = sElevatorPadOAM_Idle;
gCurrentSprite.animationDurationCounter = 0;

View File

@ -63,13 +63,13 @@ void KraidElevatorStatueChangeCAA(u8 caa)
*/
void KraidElevatorStatueFallenInit(void)
{
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -(QUARTER_BLOCK_SIZE * 3 + PIXEL_SIZE * 3); // Hitbox even though there's no samus collision?
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = -(BLOCK_SIZE * 4);
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE + HALF_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -(QUARTER_BLOCK_SIZE * 3 + PIXEL_SIZE * 3); // Hitbox even though there's no samus collision?
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = -(BLOCK_SIZE * 4);
gCurrentSprite.hitboxRight = BLOCK_SIZE + HALF_BLOCK_SIZE;
gCurrentSprite.pOam = sKraidElevatorStatueOAM_Fallen;
gCurrentSprite.currentAnimationFrame = 0;
@ -85,7 +85,7 @@ void KraidElevatorStatueFallenInit(void)
*/
void KraidElevatorStatueInit(void)
{
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5);
gCurrentSprite.bgPriority = 1;
gCurrentSprite.drawOrder = 2;
@ -98,13 +98,13 @@ void KraidElevatorStatueInit(void)
return;
}
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 6);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 6);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE * 6); // Hitbox even though there's no samus collision?
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = -BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE;
gCurrentSprite.hitboxTop = -(BLOCK_SIZE * 6); // Hitbox even though there's no samus collision?
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = -BLOCK_SIZE;
gCurrentSprite.hitboxRight = BLOCK_SIZE;
gCurrentSprite.pOam = sKraidElevatorStatueOAM_Idle;
gCurrentSprite.currentAnimationFrame = 0;
@ -178,14 +178,14 @@ void KraidElevatorStatueFalling(void)
case 4:
// Update draw distance
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 4);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 4);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
break;
case 6:
// Update draw distance
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
if (gCurrentSprite.animationDurationCounter == 2)
{
@ -235,13 +235,13 @@ void RidleyElevatorStatueChangeCcaa(u8 caa)
*/
void RidleyElevatorStatueFallenInit(void)
{
gCurrentSprite.drawDistanceTopOffset = HALF_BLOCK_SIZE + PIXEL_SIZE * 2;
gCurrentSprite.drawDistanceBottomOffset = QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2;
gCurrentSprite.drawDistanceTop = HALF_BLOCK_SIZE + PIXEL_SIZE * 2;
gCurrentSprite.drawDistanceBottom = QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2;
gCurrentSprite.hitboxTopOffset = -(QUARTER_BLOCK_SIZE * 3 + PIXEL_SIZE * 3); // Hitbox even though there's no samus collision?
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = -(BLOCK_SIZE * 4);
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE + HALF_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -(QUARTER_BLOCK_SIZE * 3 + PIXEL_SIZE * 3); // Hitbox even though there's no samus collision?
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = -(BLOCK_SIZE * 4);
gCurrentSprite.hitboxRight = BLOCK_SIZE + HALF_BLOCK_SIZE;
gCurrentSprite.pOam = sRidleyElevatorStatueOAM_Fallen;
gCurrentSprite.currentAnimationFrame = 0;
@ -257,7 +257,7 @@ void RidleyElevatorStatueFallenInit(void)
*/
void RidleyElevatorStatueInit(void)
{
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5);
gCurrentSprite.bgPriority = 1;
gCurrentSprite.drawOrder = 2;
@ -271,13 +271,13 @@ void RidleyElevatorStatueInit(void)
return;
}
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 6);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 6);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE * 6); // Hitbox even though there's no samus collision?
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = -BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE;
gCurrentSprite.hitboxTop = -(BLOCK_SIZE * 6); // Hitbox even though there's no samus collision?
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = -BLOCK_SIZE;
gCurrentSprite.hitboxRight = BLOCK_SIZE;
gCurrentSprite.pOam = sRidleyElevatorStatueOAM_Idle;
gCurrentSprite.currentAnimationFrame = 0;
@ -350,19 +350,19 @@ void RidleyElevatorStatueFalling(void)
case 4:
// Update draw distance
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
break;
case 5:
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
break;
case 0x6:
// Update draw distance
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 4 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 4 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
if (gCurrentSprite.animationDurationCounter == 2)
{
@ -386,7 +386,7 @@ void RidleyElevatorStatueFalling(void)
*/
void KraidElevatorStatue(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
@ -413,7 +413,7 @@ void KraidElevatorStatue(void)
*/
void RidleyElevatorStatue(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
@ -440,7 +440,7 @@ void RidleyElevatorStatue(void)
*/
void ElevatorStatueDebris(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
@ -449,10 +449,10 @@ void ElevatorStatueDebris(void)
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.properties |= SP_ALWAYS_ACTIVE;
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.pose = ELEVATOR_STATUE_DEBRIS_POSE_IDLE;
gCurrentSprite.samusCollision = SSC_NONE;
@ -466,9 +466,9 @@ void ElevatorStatueDebris(void)
{
gCurrentSprite.drawOrder = 1;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5);
gCurrentSprite.pOam = sElevatorStatueDebrisOAM_Dust;
}
@ -476,9 +476,9 @@ void ElevatorStatueDebris(void)
{
gCurrentSprite.drawOrder = 5;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 6);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 6);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
if (gCurrentSprite.roomSlot == ELEVATOR_STATUE_DEBRIS_PART_KRAID)
gCurrentSprite.pOam = sElevatorStatueDebrisOAM_Kraid;

View File

@ -26,9 +26,9 @@ void EnemyDropInit(void)
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.bgPriority = MOD_AND(gIoRegistersBackup.BG1CNT, 4);
gCurrentSprite.drawOrder = 1;
@ -72,10 +72,10 @@ void EnemyDropInit(void)
gCurrentSprite.samusCollision = SSC_SMALL_ENERGY_DROP;
}
gCurrentSprite.hitboxTopOffset = -(HALF_BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxBottomOffset = (HALF_BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxLeftOffset = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -(HALF_BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxBottom = (HALF_BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxLeft = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRight = HALF_BLOCK_SIZE;
}
/**

View File

@ -75,14 +75,14 @@ void EscapeGate(void)
gCurrentSprite.status |= SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.xPosition += HALF_BLOCK_SIZE;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 4 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 4 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.pOam = sEscapeGateOAM_Closed,

View File

@ -108,10 +108,10 @@ void EscapeShipPirateCollision(void)
spriteY = gCurrentSprite.yPosition;
spriteX = gCurrentSprite.xPosition;
spriteTop = spriteY + gCurrentSprite.hitboxTopOffset;
spriteBottom = spriteY + gCurrentSprite.hitboxBottomOffset;
spriteLeft = spriteX + gCurrentSprite.hitboxLeftOffset;
spriteRight = spriteX + gCurrentSprite.hitboxRightOffset;
spriteTop = spriteY + gCurrentSprite.hitboxTop;
spriteBottom = spriteY + gCurrentSprite.hitboxBottom;
spriteLeft = spriteX + gCurrentSprite.hitboxLeft;
spriteRight = spriteX + gCurrentSprite.hitboxRight;
for (pSprite = gSpriteData; pSprite < gSpriteData + MAX_AMOUNT_OF_SPRITES; pSprite++)
{
@ -119,10 +119,10 @@ void EscapeShipPirateCollision(void)
{
pirateY = pSprite->yPosition;
pirateX = pSprite->xPosition;
pirateTop = pirateY + pSprite->hitboxTopOffset;
pirateBottom = pirateY + pSprite->hitboxBottomOffset;
pirateLeft = pirateX + pSprite->hitboxLeftOffset;
pirateRight = pirateX + pSprite->hitboxRightOffset;
pirateTop = pirateY + pSprite->hitboxTop;
pirateBottom = pirateY + pSprite->hitboxBottom;
pirateLeft = pirateX + pSprite->hitboxLeft;
pirateRight = pirateX + pSprite->hitboxRight;
if (SpriteUtilCheckObjectsTouching(spriteTop, spriteBottom, spriteLeft, spriteRight,
pirateTop, pirateBottom, pirateLeft, pirateRight))
@ -158,10 +158,10 @@ void EscapeShipCheckCollidingWithLaser(void)
spriteY = gCurrentSprite.yPosition;
spriteX = gCurrentSprite.xPosition;
spriteTop = spriteY + gCurrentSprite.hitboxTopOffset;
spriteBottom = spriteY + gCurrentSprite.hitboxBottomOffset;
spriteLeft = spriteX + gCurrentSprite.hitboxLeftOffset;
spriteRight = spriteX + gCurrentSprite.hitboxRightOffset;
spriteTop = spriteY + gCurrentSprite.hitboxTop;
spriteBottom = spriteY + gCurrentSprite.hitboxBottom;
spriteLeft = spriteX + gCurrentSprite.hitboxLeft;
spriteRight = spriteX + gCurrentSprite.hitboxRight;
offset = 0x4;
for (pSprite = gSpriteData; pSprite < gSpriteData + MAX_AMOUNT_OF_SPRITES; pSprite++)
@ -200,14 +200,14 @@ void EscapeShip(void)
switch (gCurrentSprite.pose)
{
case 0:
gCurrentSprite.drawDistanceTopOffset = 0x30;
gCurrentSprite.drawDistanceBottomOffset = 0x0;
gCurrentSprite.drawDistanceHorizontalOffset = 0x58;
gCurrentSprite.drawDistanceTop = 0x30;
gCurrentSprite.drawDistanceBottom = 0x0;
gCurrentSprite.drawDistanceHorizontal = 0x58;
gCurrentSprite.hitboxTopOffset = -0x2C;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0x38;
gCurrentSprite.hitboxRightOffset = 0x68;
gCurrentSprite.hitboxTop = -0x2C;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0x38;
gCurrentSprite.hitboxRight = 0x68;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.drawOrder = 11;
@ -254,7 +254,7 @@ void EscapeShip(void)
case ESCAPE_SHIP_POSE_OPENED:
if (gCurrentSprite.status & SPRITE_STATUS_SAMUS_ON_TOP)
{
gCurrentSprite.standingOnSprite = FALSE;
gCurrentSprite.standingOnSprite = SAMUS_STANDING_ON_SPRITE_OFF;
gCurrentSprite.status &= ~SPRITE_STATUS_SAMUS_ON_TOP;
gCurrentSprite.drawOrder = 4;
gCurrentSprite.pose = ESCAPE_SHIP_POSE_DELAY_BEFORE_CLOSING;
@ -271,10 +271,10 @@ void EscapeShip(void)
EventFunction(EVENT_ACTION_SETTING, EVENT_ESCAPED_CHOZODIA);
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE * 5;
gCurrentSprite.hitboxTop = -(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = BLOCK_SIZE * 5;
}
break;
@ -476,10 +476,10 @@ void EscapeShipPart(void)
gCurrentSprite.properties |= SP_ALWAYS_ACTIVE;
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.animationDurationCounter = 0;
@ -487,9 +487,9 @@ void EscapeShipPart(void)
if (roomSlot == ESCAPE_SHIP_PART_TOP)
{
gCurrentSprite.drawDistanceTopOffset = 0x30;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.drawDistanceHorizontalOffset = 0x58;
gCurrentSprite.drawDistanceTop = 0x30;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.drawDistanceHorizontal = 0x58;
gCurrentSprite.drawOrder = 10;
gCurrentSprite.pOam = sEscapeShipPartOAM_Top;
@ -497,9 +497,9 @@ void EscapeShipPart(void)
}
else if (roomSlot == ESCAPE_SHIP_PART_TAIL)
{
gCurrentSprite.drawDistanceTopOffset = 0x30;
gCurrentSprite.drawDistanceBottomOffset = 0;
gCurrentSprite.drawDistanceHorizontalOffset = 0x70;
gCurrentSprite.drawDistanceTop = 0x30;
gCurrentSprite.drawDistanceBottom = 0;
gCurrentSprite.drawDistanceHorizontal = 0x70;
gCurrentSprite.drawOrder = 13;
gCurrentSprite.pOam = sEscapeShipPartOAM_Tail;
@ -509,9 +509,9 @@ void EscapeShipPart(void)
}
else if (roomSlot == ESCAPE_SHIP_PART_FLAMES)
{
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.drawDistanceHorizontalOffset = 0x60;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.drawDistanceHorizontal = 0x60;
gCurrentSprite.drawOrder = 14;
gCurrentSprite.pOam = sEscapeShipPartOAM_Flames;

View File

@ -18,17 +18,17 @@
*/
void EscapeShipSpacePirateInit(void)
{
gCurrentSprite.drawDistanceTopOffset = 0x40;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.drawDistanceHorizontalOffset = 0x28;
gCurrentSprite.drawDistanceTop = 0x40;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.drawDistanceHorizontal = 0x28;
gCurrentSprite.hitboxTopOffset = -0xA0;
gCurrentSprite.hitboxBottomOffset = 0x0;
gCurrentSprite.hitboxTop = -0xA0;
gCurrentSprite.hitboxBottom = 0x0;
gCurrentSprite.health = 0x0;
gCurrentSprite.oamScaling = Q_8_8(1.f);
gCurrentSprite.scaling = Q_8_8(1.f);
gCurrentSprite.work2 = 0x0;
gCurrentSprite.oamRotation = 0x0;
gCurrentSprite.rotation = 0x0;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.pOam = sSpacePirateOAM_Jumping;
@ -97,7 +97,7 @@ void EscapeShipSpacePirate(void)
u8 alerted;
u8 freezeTimer;
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
alerted = TRUE;
else
alerted = FALSE;
@ -129,7 +129,7 @@ void EscapeShipSpacePirate(void)
gCurrentSprite.absolutePaletteRow = 0x0;
}
}
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
}
else
SpriteUtilUpdateFreezeTimer();
@ -141,17 +141,17 @@ void EscapeShipSpacePirate(void)
{
SpacePirateSamusDetection();
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
if (gSpriteDrawOrder[2] == TRUE)
gAlarmTimer = ALARM_TIMER_ACTIVE_TIMER;
else if (gAlarmTimer == 0x0)
gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_DOWN;
}
else
{
if (gAlarmTimer != 0x0 && gCurrentSprite.pose != 0x0)
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
}
SpacePirateCheckCollidingWithLaser();
@ -403,6 +403,6 @@ void EscapeShipSpacePirate(void)
SpacePirateDeath(TRUE);
}
if (!alerted && (gCurrentSprite.status & (SPRITE_STATUS_EXISTS | SPRITE_STATUS_ONSCREEN | SPRITE_STATUS_UNKNOWN_400 | SPRITE_STATUS_IGNORE_PROJECTILES)) == (SPRITE_STATUS_EXISTS | SPRITE_STATUS_ONSCREEN | SPRITE_STATUS_UNKNOWN_400))
if (!alerted && (gCurrentSprite.status & (SPRITE_STATUS_EXISTS | SPRITE_STATUS_ONSCREEN | SPRITE_STATUS_FACING_DOWN | SPRITE_STATUS_IGNORE_PROJECTILES)) == (SPRITE_STATUS_EXISTS | SPRITE_STATUS_ONSCREEN | SPRITE_STATUS_FACING_DOWN))
SoundPlayNotAlreadyPlaying(0x169);
}

View File

@ -26,14 +26,14 @@ void ExplosionZebesEscape(void)
{
gCurrentSprite.status |= SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = 1;
gCurrentSprite.drawDistanceBottomOffset = 1;
gCurrentSprite.drawDistanceHorizontalOffset = 1;
gCurrentSprite.drawDistanceTop = 1;
gCurrentSprite.drawDistanceBottom = 1;
gCurrentSprite.drawDistanceHorizontal = 1;
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.samusCollision = SSC_NONE;

View File

@ -24,14 +24,14 @@ void FallingChozoPillar(void)
gCurrentSprite.status |= SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.xPosition += 0x20;
gCurrentSprite.hitboxTopOffset = -0x100;
gCurrentSprite.hitboxBottomOffset = 0x0;
gCurrentSprite.hitboxLeftOffset = -0x80;
gCurrentSprite.hitboxRightOffset = 0x80;
gCurrentSprite.hitboxTop = -0x100;
gCurrentSprite.hitboxBottom = 0x0;
gCurrentSprite.hitboxLeft = -0x80;
gCurrentSprite.hitboxRight = 0x80;
gCurrentSprite.drawDistanceTopOffset = 0x40;
gCurrentSprite.drawDistanceBottomOffset = 0x0;
gCurrentSprite.drawDistanceHorizontalOffset = 0x20;
gCurrentSprite.drawDistanceTop = 0x40;
gCurrentSprite.drawDistanceBottom = 0x0;
gCurrentSprite.drawDistanceHorizontal = 0x20;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.bgPriority = gIoRegistersBackup.BG1CNT & 0x3;

View File

@ -68,14 +68,14 @@ void GadoraInit(void)
gCurrentSprite.pose = GADORA_POSE_IDLE_INIT;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -0x78;
gCurrentSprite.hitboxBottomOffset = 0x78;
gCurrentSprite.hitboxLeftOffset = -0x14;
gCurrentSprite.hitboxRightOffset = 0x14;
gCurrentSprite.hitboxTop = -0x78;
gCurrentSprite.hitboxBottom = 0x78;
gCurrentSprite.hitboxLeft = -0x14;
gCurrentSprite.hitboxRight = 0x14;
gCurrentSprite.pOam = sGadoraOAM_EyeClosed;
gCurrentSprite.animationDurationCounter = 0;
@ -365,7 +365,7 @@ void GadoraEye(void)
u32 rng;
u32 yOffset;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gCurrentSprite.properties & SP_DAMAGED)
{
@ -395,14 +395,14 @@ void GadoraEye(void)
gCurrentSprite.health = GET_SSPRITE_HEALTH(gCurrentSprite.spriteId);
}
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -0x28;
gCurrentSprite.hitboxBottomOffset = 0x28;
gCurrentSprite.hitboxLeftOffset = -0x10;
gCurrentSprite.hitboxRightOffset = 0x10;
gCurrentSprite.hitboxTop = -0x28;
gCurrentSprite.hitboxBottom = 0x28;
gCurrentSprite.hitboxLeft = -0x10;
gCurrentSprite.hitboxRight = 0x10;
gCurrentSprite.pOam = sEnemyDropOAM_LargeEnergy; // No graphics
gCurrentSprite.animationDurationCounter = 0.;
@ -460,12 +460,12 @@ void GadoraBeam(void)
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.properties |= SP_KILL_OFF_SCREEN;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -(QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.hitboxBottomOffset = (QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.hitboxTop = -(QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.hitboxBottom = (QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.pOam = sGadoraBeamOAM_Moving;
gCurrentSprite.animationDurationCounter = 0;
@ -478,8 +478,8 @@ void GadoraBeam(void)
gCurrentSprite.health = 1;
gCurrentSprite.work0 = 16; // Delay before it starts actually moving
gCurrentSprite.hitboxLeftOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxRightOffset = QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2;
gCurrentSprite.hitboxLeft = -PIXEL_SIZE;
gCurrentSprite.hitboxRight = QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2;
case GADORA_BEAM_POSE_MOVING:
if (gCurrentSprite.work0 != 0)

View File

@ -17,14 +17,14 @@
*/
void GametInit(void)
{
gCurrentSprite.hitboxTopOffset = -0x1C;
gCurrentSprite.hitboxBottomOffset = 0x1C;
gCurrentSprite.hitboxLeftOffset = -0x18;
gCurrentSprite.hitboxRightOffset = 0x18;
gCurrentSprite.hitboxTop = -0x1C;
gCurrentSprite.hitboxBottom = 0x1C;
gCurrentSprite.hitboxLeft = -0x18;
gCurrentSprite.hitboxRight = 0x18;
gCurrentSprite.drawDistanceTopOffset = 0x8;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.drawDistanceHorizontalOffset = 0x10;
gCurrentSprite.drawDistanceTop = 0x8;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.drawDistanceHorizontal = 0x10;
gCurrentSprite.work1 = 0x1;
gCurrentSprite.health = GET_PSPRITE_HEALTH(gCurrentSprite.spriteId);
@ -93,7 +93,7 @@ void GametIdle(void)
else
{
// Samus in range, set going up
gCurrentSprite.oamScaling = gSamusData.yPosition;
gCurrentSprite.scaling = gSamusData.yPosition;
gCurrentSprite.pose = GAMET_POSE_GOING_UP;
gCurrentSprite.work0 = 0x2;
gCurrentSprite.status &= ~(SPRITE_STATUS_NOT_DRAWN | SPRITE_STATUS_IGNORE_PROJECTILES);
@ -113,7 +113,7 @@ void GametIdle(void)
if (ramSlot != 0xFF)
{
gSpriteData[ramSlot].oamScaling = gCurrentSprite.oamScaling;
gSpriteData[ramSlot].scaling = gCurrentSprite.scaling;
gSpriteData[ramSlot].work0 = 0xA;
// Second follower
@ -124,7 +124,7 @@ void GametIdle(void)
if (ramSlot != 0xFF)
{
gSpriteData[ramSlot].oamScaling = gCurrentSprite.oamScaling;
gSpriteData[ramSlot].scaling = gCurrentSprite.scaling;
gSpriteData[ramSlot].work0 = 0x12;
}
}
@ -155,8 +155,8 @@ void GametGoingUp(void)
}
else
{
if (gCurrentSprite.oamScaling < gSamusData.yPosition && gSamusData.yPosition > gCurrentSprite.yPositionSpawn - BLOCK_SIZE * 2)
positionRange = gCurrentSprite.oamScaling;
if (gCurrentSprite.scaling < gSamusData.yPosition && gSamusData.yPosition > gCurrentSprite.yPositionSpawn - BLOCK_SIZE * 2)
positionRange = gCurrentSprite.scaling;
else
positionRange = gSamusData.yPosition;
@ -198,7 +198,7 @@ void GametRespawn(void)
gCurrentSprite.paletteRow = 0x0;
gCurrentSprite.frozenPaletteRowOffset = 0x0;
gCurrentSprite.absolutePaletteRow = 0x0;
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.freezeTimer = 0x0;
}
}

View File

@ -17,14 +17,14 @@
*/
void GeegaInit(void)
{
gCurrentSprite.hitboxTopOffset = -0x1C;
gCurrentSprite.hitboxBottomOffset = 0x1C;
gCurrentSprite.hitboxLeftOffset = -0x18;
gCurrentSprite.hitboxRightOffset = 0x18;
gCurrentSprite.hitboxTop = -0x1C;
gCurrentSprite.hitboxBottom = 0x1C;
gCurrentSprite.hitboxLeft = -0x18;
gCurrentSprite.hitboxRight = 0x18;
gCurrentSprite.drawDistanceTopOffset = 0xA;
gCurrentSprite.drawDistanceBottomOffset = 0xA;
gCurrentSprite.drawDistanceHorizontalOffset = 0xC;
gCurrentSprite.drawDistanceTop = 0xA;
gCurrentSprite.drawDistanceBottom = 0xA;
gCurrentSprite.drawDistanceHorizontal = 0xC;
gCurrentSprite.work1 = 0x1;
gCurrentSprite.health = GET_PSPRITE_HEALTH(gCurrentSprite.spriteId);
@ -94,7 +94,7 @@ void GeegaIdle(void)
else
{
// Samus in range, set going up
gCurrentSprite.oamScaling = gSamusData.yPosition;
gCurrentSprite.scaling = gSamusData.yPosition;
gCurrentSprite.pose = GEEGA_POSE_GOING_UP;
gCurrentSprite.work0 = 0x2;
gCurrentSprite.status &= ~(SPRITE_STATUS_NOT_DRAWN | SPRITE_STATUS_IGNORE_PROJECTILES);
@ -114,7 +114,7 @@ void GeegaIdle(void)
if (ramSlot != 0xFF)
{
gSpriteData[ramSlot].oamScaling = gCurrentSprite.oamScaling;
gSpriteData[ramSlot].scaling = gCurrentSprite.scaling;
gSpriteData[ramSlot].work0 = 0x12;
}
}
@ -141,8 +141,8 @@ void GeegaGoingUp(void)
}
else
{
if (gCurrentSprite.oamScaling < gSamusData.yPosition && gSamusData.yPosition > gCurrentSprite.yPositionSpawn - BLOCK_SIZE * 2)
positionRange = gCurrentSprite.oamScaling;
if (gCurrentSprite.scaling < gSamusData.yPosition && gSamusData.yPosition > gCurrentSprite.yPositionSpawn - BLOCK_SIZE * 2)
positionRange = gCurrentSprite.scaling;
else
positionRange = gSamusData.yPosition;
@ -183,7 +183,7 @@ void GeegaRespawn(void)
gCurrentSprite.paletteRow = 0x0;
gCurrentSprite.frozenPaletteRowOffset = 0x0;
gCurrentSprite.absolutePaletteRow = 0x0;
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.freezeTimer = 0x0;
}
}

View File

@ -28,7 +28,7 @@ void Geron(void)
u32 eventCheck;
struct SpriteData* pSprite;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
@ -74,14 +74,14 @@ void Geron(void)
break;
}
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + QUARTER_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + QUARTER_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE * 3);
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = -(QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.hitboxRightOffset = (QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.hitboxTop = -(BLOCK_SIZE * 3);
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = -(QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.hitboxRight = (QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.drawOrder = 5;
gCurrentSprite.currentAnimationFrame = 0;
@ -122,10 +122,10 @@ void Geron(void)
break;
case GERON_POSE_IDLE:
spriteTop = gCurrentSprite.yPosition + gCurrentSprite.hitboxTopOffset;
spriteTop = gCurrentSprite.yPosition + gCurrentSprite.hitboxTop;
spriteBottom = gCurrentSprite.yPosition + PIXEL_SIZE * 2;
spriteLeft = gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset;
spriteRight = gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset;
spriteLeft = gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft;
spriteRight = gCurrentSprite.xPosition + gCurrentSprite.hitboxRight;
// Check make parasites grab geron
for (pSprite = gSpriteData; pSprite < gSpriteData + MAX_AMOUNT_OF_SPRITES; pSprite++)

View File

@ -20,7 +20,7 @@ void GeronNorfair(void)
u16 yPosition;
u16 xPosition;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gCurrentSprite.pose == SPRITE_POSE_UNINITIALIZED)
{
@ -30,14 +30,14 @@ void GeronNorfair(void)
return;
}
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + QUARTER_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + QUARTER_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE * 3);
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = -(QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.hitboxRightOffset = (QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.hitboxTop = -(BLOCK_SIZE * 3);
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = -(QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.hitboxRight = (QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.drawOrder = 5;

View File

@ -83,14 +83,14 @@ void GerutaInit(void)
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
SpriteUtilMakeSpriteFaceSamusDirection();
gCurrentSprite.drawDistanceTopOffset = 0x18;
gCurrentSprite.drawDistanceBottomOffset = 0x18;
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.drawDistanceTop = 0x18;
gCurrentSprite.drawDistanceBottom = 0x18;
gCurrentSprite.drawDistanceHorizontal = 0x18;
gCurrentSprite.hitboxTopOffset = -0x20;
gCurrentSprite.hitboxBottomOffset = 0x20;
gCurrentSprite.hitboxLeftOffset = -0x30;
gCurrentSprite.hitboxRightOffset = 0x30;
gCurrentSprite.hitboxTop = -0x20;
gCurrentSprite.hitboxBottom = 0x20;
gCurrentSprite.hitboxLeft = -0x30;
gCurrentSprite.hitboxRight = 0x30;
gCurrentSprite.pOam = sGerutaOAM_Idle;
gCurrentSprite.animationDurationCounter = 0x0;

View File

@ -88,14 +88,14 @@ void GlassTubeChangeCcaa(void)
*/
void GlassTubeInit(void)
{
gCurrentSprite.drawDistanceTopOffset = 0x30;
gCurrentSprite.drawDistanceBottomOffset = 0x30;
gCurrentSprite.drawDistanceHorizontalOffset = 0x70;
gCurrentSprite.drawDistanceTop = 0x30;
gCurrentSprite.drawDistanceBottom = 0x30;
gCurrentSprite.drawDistanceHorizontal = 0x70;
gCurrentSprite.hitboxTopOffset = -0x80;
gCurrentSprite.hitboxBottomOffset = 0x80;
gCurrentSprite.hitboxLeftOffset = -0x100;
gCurrentSprite.hitboxRightOffset = 0x100;
gCurrentSprite.hitboxTop = -0x80;
gCurrentSprite.hitboxBottom = 0x80;
gCurrentSprite.hitboxLeft = -0x100;
gCurrentSprite.hitboxRight = 0x100;
gCurrentSprite.animationDurationCounter = 0x0;
gCurrentSprite.currentAnimationFrame = 0x0;
@ -143,17 +143,17 @@ void GlassTubeCheckPowerBombCollision(void)
{
bombY = gCurrentPowerBomb.yPosition;
bombX = gCurrentPowerBomb.xPosition;
bombTop = gCurrentPowerBomb.hitboxTopOffset + bombY;
bombBottom = gCurrentPowerBomb.hitboxBottomOffset + bombY;
bombLeft = gCurrentPowerBomb.hitboxLeftOffset + bombX;
bombRight = gCurrentPowerBomb.hitboxRightOffset + bombX;
bombTop = gCurrentPowerBomb.hitboxTop + bombY;
bombBottom = gCurrentPowerBomb.hitboxBottom + bombY;
bombLeft = gCurrentPowerBomb.hitboxLeft + bombX;
bombRight = gCurrentPowerBomb.hitboxRight + bombX;
spriteY = gCurrentSprite.yPosition;
spriteX = gCurrentSprite.xPosition;
spriteTop = gCurrentSprite.hitboxTopOffset + spriteY;
spriteBottom = gCurrentSprite.hitboxBottomOffset + spriteY;
spriteLeft = gCurrentSprite.hitboxLeftOffset + spriteX;
spriteRight = gCurrentSprite.hitboxRightOffset + spriteX;
spriteTop = gCurrentSprite.hitboxTop + spriteY;
spriteBottom = gCurrentSprite.hitboxBottom + spriteY;
spriteLeft = gCurrentSprite.hitboxLeft + spriteX;
spriteRight = gCurrentSprite.hitboxRight + spriteX;
if (SpriteUtilCheckObjectsTouching(spriteTop, spriteBottom, spriteLeft, spriteRight, bombTop, bombBottom, bombLeft, bombRight))
{
@ -232,7 +232,7 @@ void GlassTubeCheckBreakingAnimEnded(void)
*/
void GlassTube(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
case 0x0:

View File

@ -38,29 +38,29 @@ void GunshipFlickerFlames(void)
if (!(gCurrentSprite.status & SPRITE_STATUS_MOSAIC) && gCurrentSprite.work2 == 0x4)
{
row = gCurrentSprite.oamScaling;
row = gCurrentSprite.scaling;
flag = 0x80;
// Update palette row
if (row & flag)
{
if (row > 0x80)
gCurrentSprite.oamScaling--;
gCurrentSprite.scaling--;
if (gCurrentSprite.oamScaling == 0x80)
gCurrentSprite.oamScaling = 0x0;
if (gCurrentSprite.scaling == 0x80)
gCurrentSprite.scaling = 0x0;
}
else
{
if (row < 0x2)
gCurrentSprite.oamScaling++;
gCurrentSprite.scaling++;
if (gCurrentSprite.oamScaling == 0x2)
gCurrentSprite.oamScaling |= flag;
if (gCurrentSprite.scaling == 0x2)
gCurrentSprite.scaling |= flag;
}
// Transfer palette
offset = gCurrentSprite.oamScaling & 0x7F;
offset = gCurrentSprite.scaling & 0x7F;
DMA_SET(3, (sGunshipFlashingPal + offset * 16),
(PALRAM_BASE + 0x340), (DMA_ENABLE << 0x10) | 0x10);
}
@ -133,7 +133,7 @@ u8 GunshipCheckSamusEnter(void)
gCurrentSprite.work0 = 0x38;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.standingOnSprite = FALSE;
gCurrentSprite.standingOnSprite = SAMUS_STANDING_ON_SPRITE_OFF;
gCurrentSprite.status &= ~SPRITE_STATUS_SAMUS_ON_TOP;
return TRUE;
}
@ -162,14 +162,14 @@ void GunshipInit(void)
gCurrentSprite.properties |= SP_ALWAYS_ACTIVE;
gCurrentSprite.hitboxTopOffset = -0xC4;
gCurrentSprite.hitboxBottomOffset = 0x0;
gCurrentSprite.hitboxLeftOffset = -0x40;
gCurrentSprite.hitboxRightOffset = 0x40;
gCurrentSprite.hitboxTop = -0xC4;
gCurrentSprite.hitboxBottom = 0x0;
gCurrentSprite.hitboxLeft = -0x40;
gCurrentSprite.hitboxRight = 0x40;
gCurrentSprite.drawDistanceTopOffset = 0x30;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.drawDistanceHorizontalOffset = 0x78;
gCurrentSprite.drawDistanceTop = 0x30;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.drawDistanceHorizontal = 0x78;
gCurrentSprite.pOam = sGunshipOAM_Idle;
gCurrentSprite.animationDurationCounter = 0x0;
@ -388,7 +388,7 @@ void GunshipRefill(void)
gCurrentSprite.pose = GUNSHIP_POSE_AFTER_REFILL;
gCurrentSprite.work0 = 0x1E;
gCurrentSprite.oamRotation = SpriteSpawnPrimary(PSPRITE_ITEM_BANNER, MESSAGE_WEAPONS_AND_ENERGY_RESTORED,
gCurrentSprite.rotation = SpriteSpawnPrimary(PSPRITE_ITEM_BANNER, MESSAGE_WEAPONS_AND_ENERGY_RESTORED,
0x6, gCurrentSprite.yPosition, gCurrentSprite.xPosition, 0x0);
SoundFade(0x21E, 0xF);
}
@ -402,7 +402,7 @@ void GunshipAfterRefill(void)
{
u8 ramSlot;
ramSlot = gCurrentSprite.oamRotation;
ramSlot = gCurrentSprite.rotation;
if (gSpriteData[ramSlot].pose == ITEM_BANNER_POSE_REMOVAL_ANIMATION)
{
if (gCurrentSprite.work0 != 0x0)
@ -411,7 +411,7 @@ void GunshipAfterRefill(void)
if (gCurrentSprite.work0 == 0x0)
{
// Spawn save prompt
gCurrentSprite.oamRotation = SpriteSpawnPrimary(PSPRITE_ITEM_BANNER, MESSAGE_SAVE_PROMPT,
gCurrentSprite.rotation = SpriteSpawnPrimary(PSPRITE_ITEM_BANNER, MESSAGE_SAVE_PROMPT,
0x6, gCurrentSprite.yPosition, gCurrentSprite.xPosition, 0x0);
}
}
@ -445,7 +445,7 @@ void GunshipSaving(void)
if (gCurrentSprite.work0 == 0x0)
{
gCurrentSprite.pose = GUNSHIP_POSE_AFTER_SAVE;
gCurrentSprite.oamRotation = SpriteSpawnPrimary(PSPRITE_ITEM_BANNER, MESSAGE_SAVE_COMPLETE,
gCurrentSprite.rotation = SpriteSpawnPrimary(PSPRITE_ITEM_BANNER, MESSAGE_SAVE_COMPLETE,
0x6, gCurrentSprite.yPosition, gCurrentSprite.xPosition, 0x0);
}
}
@ -458,7 +458,7 @@ void GunshipAfterSave(void)
{
u8 ramSlot;
ramSlot = gCurrentSprite.oamRotation;
ramSlot = gCurrentSprite.rotation;
if (gSpriteData[ramSlot].pose == ITEM_BANNER_POSE_REMOVAL_ANIMATION)
{
// Eject samus
@ -649,7 +649,7 @@ void GunshipStartEscaping(void)
gCurrentSprite.pose = GUNSHIP_POSE_TAKING_OFF;
gCurrentSprite.work0 = 0x98;
gCurrentSprite.work3 = 0x0;
gCurrentSprite.oamScaling = 0x0;
gCurrentSprite.scaling = 0x0;
// Spawn flames
SpriteSpawnSecondary(SSPRITE_GUNSHIP_PART, GUNSHIP_PART_FLAMES_HORIZONTAL, gCurrentSprite.spritesetGfxSlot,
@ -752,17 +752,17 @@ void GunshipPartInit(void)
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.hitboxTopOffset = 0x0;
gCurrentSprite.hitboxBottomOffset = 0x0;
gCurrentSprite.hitboxLeftOffset = 0x0;
gCurrentSprite.hitboxRightOffset = 0x0;
gCurrentSprite.hitboxTop = 0x0;
gCurrentSprite.hitboxBottom = 0x0;
gCurrentSprite.hitboxLeft = 0x0;
gCurrentSprite.hitboxRight = 0x0;
switch (gCurrentSprite.roomSlot)
{
case GUNSHIP_PART_ENTRANCE_FRONT:
gCurrentSprite.drawDistanceTopOffset = 0x38;
gCurrentSprite.drawDistanceBottomOffset = 0x0;
gCurrentSprite.drawDistanceHorizontalOffset = 0x28;
gCurrentSprite.drawDistanceTop = 0x38;
gCurrentSprite.drawDistanceBottom = 0x0;
gCurrentSprite.drawDistanceHorizontal = 0x28;
gCurrentSprite.pOam = sGunshipPartOAM_EntranceFrontClosed;
@ -773,9 +773,9 @@ void GunshipPartInit(void)
break;
case GUNSHIP_PART_ENTRANCE_BACK:
gCurrentSprite.drawDistanceTopOffset = 0x40;
gCurrentSprite.drawDistanceBottomOffset = 0x0;
gCurrentSprite.drawDistanceHorizontalOffset = 0x20;
gCurrentSprite.drawDistanceTop = 0x40;
gCurrentSprite.drawDistanceBottom = 0x0;
gCurrentSprite.drawDistanceHorizontal = 0x20;
gCurrentSprite.drawOrder = 0xE;
gCurrentSprite.pOam = sGunshipPartOAM_EntranceBackClosed;
@ -787,9 +787,9 @@ void GunshipPartInit(void)
break;
case GUNSHIP_PART_PLATFORM:
gCurrentSprite.drawDistanceTopOffset = 0x0;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.drawDistanceHorizontalOffset = 0x10;
gCurrentSprite.drawDistanceTop = 0x0;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.drawDistanceHorizontal = 0x10;
gCurrentSprite.drawOrder = 0xD;
gCurrentSprite.pOam = sGunshipPartOAM_Platform;
@ -804,9 +804,9 @@ void GunshipPartInit(void)
break;
case GUNSHIP_PART_FLAMES_HORIZONTAL:
gCurrentSprite.drawDistanceTopOffset = 0x18;
gCurrentSprite.drawDistanceBottomOffset = 0x30;
gCurrentSprite.drawDistanceHorizontalOffset = 0x60;
gCurrentSprite.drawDistanceTop = 0x18;
gCurrentSprite.drawDistanceBottom = 0x30;
gCurrentSprite.drawDistanceHorizontal = 0x60;
gCurrentSprite.drawOrder = 0xF;
gCurrentSprite.pOam = sGunshipPartOAM_FlamesHorizontal;
@ -814,9 +814,9 @@ void GunshipPartInit(void)
break;
case GUNSHIP_PART_FLAMES_VERTICAL:
gCurrentSprite.drawDistanceTopOffset = 0x18;
gCurrentSprite.drawDistanceBottomOffset = 0x30;
gCurrentSprite.drawDistanceHorizontalOffset = 0x60;
gCurrentSprite.drawDistanceTop = 0x18;
gCurrentSprite.drawDistanceBottom = 0x30;
gCurrentSprite.drawDistanceHorizontal = 0x60;
gCurrentSprite.drawOrder = 0xF;
gCurrentSprite.pOam = sGunshipPartOAM_FlamesVertical;

View File

@ -47,14 +47,14 @@ void HiveInit(void)
return;
}
gCurrentSprite.drawDistanceTopOffset = 0x28;
gCurrentSprite.drawDistanceBottomOffset = 0x28;
gCurrentSprite.drawDistanceHorizontalOffset = 0x14;
gCurrentSprite.drawDistanceTop = 0x28;
gCurrentSprite.drawDistanceBottom = 0x28;
gCurrentSprite.drawDistanceHorizontal = 0x14;
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE * 2);
gCurrentSprite.hitboxBottomOffset = BLOCK_SIZE * 2;
gCurrentSprite.hitboxLeftOffset = -(HALF_BLOCK_SIZE + QUARTER_BLOCK_SIZE);
gCurrentSprite.hitboxRightOffset = HALF_BLOCK_SIZE + QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -(BLOCK_SIZE * 2);
gCurrentSprite.hitboxBottom = BLOCK_SIZE * 2;
gCurrentSprite.hitboxLeft = -(HALF_BLOCK_SIZE + QUARTER_BLOCK_SIZE);
gCurrentSprite.hitboxRight = HALF_BLOCK_SIZE + QUARTER_BLOCK_SIZE;
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS_NO_PASS_THROUGH;
gCurrentSprite.frozenPaletteRowOffset = 1;
@ -237,7 +237,7 @@ void HiveDying(void)
*/
void HiveIgnoreSamusCollision(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
}
/**
@ -248,13 +248,13 @@ void HiveRootsInit(void)
{
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.drawDistanceTopOffset = 0x0;
gCurrentSprite.drawDistanceBottomOffset = 0x20;
gCurrentSprite.drawDistanceHorizontalOffset = 0x14;
gCurrentSprite.hitboxTopOffset = -0x4;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = -0x4;
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.drawDistanceTop = 0x0;
gCurrentSprite.drawDistanceBottom = 0x20;
gCurrentSprite.drawDistanceHorizontal = 0x14;
gCurrentSprite.hitboxTop = -0x4;
gCurrentSprite.hitboxBottom = 0x4;
gCurrentSprite.hitboxLeft = -0x4;
gCurrentSprite.hitboxRight = 0x4;
gCurrentSprite.pose = 0x9;
gCurrentSprite.pOam = sHiveRootsOAM_Idle;
gCurrentSprite.animationDurationCounter = 0x0;
@ -289,14 +289,14 @@ void MellowInit(struct SpriteData* pSprite)
{
pSprite->status &= ~SPRITE_STATUS_NOT_DRAWN;
pSprite->drawDistanceTopOffset = 0x8;
pSprite->drawDistanceBottomOffset = 0x8;
pSprite->drawDistanceHorizontalOffset = 0xC;
pSprite->drawDistanceTop = 0x8;
pSprite->drawDistanceBottom = 0x8;
pSprite->drawDistanceHorizontal = 0xC;
pSprite->hitboxTopOffset = -0xC;
pSprite->hitboxBottomOffset = 0xC;
pSprite->hitboxLeftOffset = -0x20;
pSprite->hitboxRightOffset = 0x20;
pSprite->hitboxTop = -0xC;
pSprite->hitboxBottom = 0xC;
pSprite->hitboxLeft = -0x20;
pSprite->hitboxRight = 0x20;
pSprite->animationDurationCounter = 0x0;
pSprite->currentAnimationFrame = 0x0;
@ -329,12 +329,12 @@ void MellowInit(struct SpriteData* pSprite)
pSprite->work3 = 0x1;
pSprite->xPositionSpawn = gSpriteRng & 0x3;
pSprite->pose = 0x23;
pSprite->oamScaling = 0x20;
pSprite->scaling = 0x20;
SpriteUtilMakeSpriteFaceSamusDirection();
if (pSprite->yPosition > gSamusData.yPosition + gSamusPhysics.drawDistanceTopOffset)
pSprite->status &= ~SPRITE_STATUS_UNKNOWN_400;
if (pSprite->yPosition > gSamusData.yPosition + gSamusPhysics.drawDistanceTop)
pSprite->status &= ~SPRITE_STATUS_FACING_DOWN;
else
pSprite->status |= SPRITE_STATUS_UNKNOWN_400;
pSprite->status |= SPRITE_STATUS_FACING_DOWN;
}
}
}
@ -433,12 +433,12 @@ void MellowSamusDetectedInit(struct SpriteData* pSprite)
pSprite->work3 = 0x1;
pSprite->xPositionSpawn = 0x0;
pSprite->pose = 0x23;
pSprite->oamScaling = 0x20;
pSprite->scaling = 0x20;
SpriteUtilMakeSpriteFaceSamusDirection();
if (pSprite->yPosition > gSamusData.yPosition + gSamusPhysics.drawDistanceTopOffset)
pSprite->status &= ~SPRITE_STATUS_UNKNOWN_400;
if (pSprite->yPosition > gSamusData.yPosition + gSamusPhysics.drawDistanceTop)
pSprite->status &= ~SPRITE_STATUS_FACING_DOWN;
else
pSprite->status |= SPRITE_STATUS_UNKNOWN_400;
pSprite->status |= SPRITE_STATUS_FACING_DOWN;
}
#ifdef NON_MATCHING
@ -528,7 +528,7 @@ void MellowMove(struct SpriteData* pSprite)
}
else
{
spriteY = gSamusData.yPosition + gSamusPhysics.drawDistanceTopOffset;
spriteY = gSamusData.yPosition + gSamusPhysics.drawDistanceTop;
spriteX = gSamusData.xPosition;
limit = 0x1E;
offset = 0x28;
@ -629,7 +629,7 @@ void MellowMove(struct SpriteData* pSprite)
flip = FALSE;
if (pSprite->status & SPRITE_STATUS_UNKNOWN_400)
if (pSprite->status & SPRITE_STATUS_FACING_DOWN)
{
if (pSprite->work0 == 0)
{
@ -696,15 +696,15 @@ void MellowMove(struct SpriteData* pSprite)
if (flip)
{
pSprite->status ^= SPRITE_STATUS_UNKNOWN_400;
pSprite->status ^= SPRITE_STATUS_FACING_DOWN;
///pSprite->work3 = 1;
gCurrentSprite.work3 = 1;
}
pSprite->oamScaling--;
if (pSprite->oamScaling == 0)
pSprite->scaling--;
if (pSprite->scaling == 0)
{
pSprite->oamScaling = 32;
pSprite->scaling = 32;
if (pSprite->status & SPRITE_STATUS_ONSCREEN)
SoundPlayNotAlreadyPlaying(0x15E);
}
@ -1310,7 +1310,7 @@ void HiveRoots(void)
u8 ramSlot;
ramSlot = gCurrentSprite.primarySpriteRamSlot;
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gSpriteData[ramSlot].spriteId == PSPRITE_HIVE)
{
gCurrentSprite.paletteRow = gSpriteData[ramSlot].paletteRow;
@ -1398,7 +1398,7 @@ void MellowSwarm(void)
u16 y_pos;
count = 0x0;
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gCurrentSprite.pose == 0x0)
{
if (EventFunction(EVENT_ACTION_CHECKING, EVENT_THREE_HIVES_DESTROYED))
@ -1406,13 +1406,13 @@ void MellowSwarm(void)
else
{
gCurrentSprite.status |= (SPRITE_STATUS_NOT_DRAWN | SPRITE_STATUS_IGNORE_PROJECTILES);
gCurrentSprite.hitboxTopOffset = -0x4;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = -0x4;
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.drawDistanceTopOffset = 0x1;
gCurrentSprite.drawDistanceBottomOffset = 0x1;
gCurrentSprite.drawDistanceHorizontalOffset = 0x1;
gCurrentSprite.hitboxTop = -0x4;
gCurrentSprite.hitboxBottom = 0x4;
gCurrentSprite.hitboxLeft = -0x4;
gCurrentSprite.hitboxRight = 0x4;
gCurrentSprite.drawDistanceTop = 0x1;
gCurrentSprite.drawDistanceBottom = 0x1;
gCurrentSprite.drawDistanceHorizontal = 0x1;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.pOam = sMellowOAM_Idle;
gCurrentSprite.currentAnimationFrame = 0x0;
@ -1450,7 +1450,7 @@ void MellowSwarm(void)
}
else
{
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400 && gCurrentSprite.yPositionSpawn != 0x0)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN && gCurrentSprite.yPositionSpawn != 0x0)
gCurrentSprite.yPositionSpawn--;
else
{
@ -1463,11 +1463,11 @@ void MellowSwarm(void)
pSprite++;
}
if ((gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400) == 0x0)
if ((gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN) == 0x0)
{
if (count >= gCurrentSprite.work2)
{
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
return;
}
}

View File

@ -118,14 +118,14 @@ u8 HoltzXMovement(u16 movement)
void HoltzInit(void)
{
SpriteUtilMakeSpriteFaceSamusDirection();
gCurrentSprite.drawDistanceTopOffset = 0xC;
gCurrentSprite.drawDistanceBottomOffset = 0x18;
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.drawDistanceTop = 0xC;
gCurrentSprite.drawDistanceBottom = 0x18;
gCurrentSprite.drawDistanceHorizontal = 0x18;
gCurrentSprite.hitboxTopOffset = -0x20;
gCurrentSprite.hitboxBottomOffset = 0x20;
gCurrentSprite.hitboxLeftOffset = -0x28;
gCurrentSprite.hitboxRightOffset = 0x28;
gCurrentSprite.hitboxTop = -0x20;
gCurrentSprite.hitboxBottom = 0x20;
gCurrentSprite.hitboxLeft = -0x28;
gCurrentSprite.hitboxRight = 0x28;
gCurrentSprite.pOam = sHoltzOAM_Idle;
gCurrentSprite.animationDurationCounter = 0x0;

View File

@ -143,12 +143,12 @@ void ImagoCoreFlashingAnim(void)
if (!(gCurrentSprite.invincibilityStunFlashTimer & 0x7F))
{
// Update delay
if (gCurrentSprite.oamScaling != 0)
gCurrentSprite.oamScaling--;
if (gCurrentSprite.scaling != 0)
gCurrentSprite.scaling--;
else
{
// Update offset
offset = gCurrentSprite.oamRotation++;
offset = gCurrentSprite.rotation++;
// Get palette row
palette = sImagoDynamicPaletteData[offset][0];
@ -156,7 +156,7 @@ void ImagoCoreFlashingAnim(void)
if (palette == 0x80)
{
// Reset offset
gCurrentSprite.oamRotation = 0x1;
gCurrentSprite.rotation = 0x1;
offset = 0;
palette = sImagoDynamicPaletteData[offset][0];
}
@ -167,7 +167,7 @@ void ImagoCoreFlashingAnim(void)
// Update palette and delay
gCurrentSprite.absolutePaletteRow = palette;
gCurrentSprite.paletteRow = palette;
gCurrentSprite.oamScaling = delay;
gCurrentSprite.scaling = delay;
}
}
}
@ -180,13 +180,13 @@ void ImagoSetSidesHitbox(void)
{
if (gCurrentSprite.status & SPRITE_STATUS_XFLIP)
{
gCurrentSprite.hitboxLeftOffset = -0x40;
gCurrentSprite.hitboxRightOffset = 0x18;
gCurrentSprite.hitboxLeft = -0x40;
gCurrentSprite.hitboxRight = 0x18;
}
else
{
gCurrentSprite.hitboxLeftOffset = -0x18;
gCurrentSprite.hitboxRightOffset = 0x40;
gCurrentSprite.hitboxLeft = -0x18;
gCurrentSprite.hitboxRight = 0x40;
}
}
@ -225,17 +225,17 @@ void ImagoInit(void)
gCurrentSprite.status |= (SPRITE_STATUS_XFLIP | SPRITE_STATUS_IGNORE_PROJECTILES);
gCurrentSprite.drawDistanceTopOffset = 0x20;
gCurrentSprite.drawDistanceBottomOffset = 0x28;
gCurrentSprite.drawDistanceHorizontalOffset = 0x1A;
gCurrentSprite.drawDistanceTop = 0x20;
gCurrentSprite.drawDistanceBottom = 0x28;
gCurrentSprite.drawDistanceHorizontal = 0x1A;
gCurrentSprite.hitboxTopOffset = -0x4;
gCurrentSprite.hitboxBottomOffset = 0x80;
gCurrentSprite.hitboxTop = -0x4;
gCurrentSprite.hitboxBottom = 0x80;
ImagoSetSidesHitbox();
gCurrentSprite.frozenPaletteRowOffset = 0x1;
gCurrentSprite.oamScaling = 0;
gCurrentSprite.oamRotation = 0;
gCurrentSprite.scaling = 0;
gCurrentSprite.rotation = 0;
gCurrentSprite.samusCollision = SSC_IMAGO_STINGER;
gCurrentSprite.work0 = 0x50;
@ -750,7 +750,7 @@ void ImagoDyingInit(void)
gSubSpriteData1.animationDurationCounter = 0;
gSubSpriteData1.currentAnimationFrame = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.samusCollision = SSC_NONE;
// Retrieve previous pose
gCurrentSprite.pose = gSubSpriteData1.workVariable2;
@ -1039,7 +1039,7 @@ void ImagoDying(void)
*/
void ImagoSetEvent(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gEquipment.maxSuperMissiles > gSubSpriteData1.workVariable4)
{
// More supers than at the beginning of the fight
@ -1059,13 +1059,13 @@ void ImagoPartSetBodySidesHitbox(void)
{
if (gCurrentSprite.status & SPRITE_STATUS_XFLIP)
{
gCurrentSprite.hitboxLeftOffset = -0x28;
gCurrentSprite.hitboxRightOffset = 0xC0;
gCurrentSprite.hitboxLeft = -0x28;
gCurrentSprite.hitboxRight = 0xC0;
}
else
{
gCurrentSprite.hitboxLeftOffset = -0xC0;
gCurrentSprite.hitboxRightOffset = 0x28;
gCurrentSprite.hitboxLeft = -0xC0;
gCurrentSprite.hitboxRight = 0x28;
}
}
@ -1083,26 +1083,26 @@ void ImagoPartInit(void)
{
case IMAGO_PART_LEFT_WING_INTERNAL:
case IMAGO_PART_LEFT_WING_EXTERNAL:
gCurrentSprite.drawDistanceTopOffset = 0x38;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.drawDistanceHorizontalOffset = 0x28;
gCurrentSprite.drawDistanceTop = 0x38;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.drawDistanceHorizontal = 0x28;
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.drawOrder = 0x2;
gCurrentSprite.samusCollision = SSC_NONE;
break;
case IMAGO_PART_BODY:
gCurrentSprite.drawDistanceTopOffset = 0x28;
gCurrentSprite.drawDistanceBottomOffset = 0x20;
gCurrentSprite.drawDistanceHorizontalOffset = 0x3C;
gCurrentSprite.drawDistanceTop = 0x28;
gCurrentSprite.drawDistanceBottom = 0x20;
gCurrentSprite.drawDistanceHorizontal = 0x3C;
gCurrentSprite.hitboxTopOffset = -0x80;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxTop = -0x80;
gCurrentSprite.hitboxBottom = 0;
ImagoPartSetBodySidesHitbox();
gCurrentSprite.drawOrder = 0x3;
@ -1114,27 +1114,27 @@ void ImagoPartInit(void)
case IMAGO_PART_RIGHT_WING_INTERNAL:
case IMAGO_PART_RIGHT_WING_EXTERNAL:
gCurrentSprite.drawDistanceTopOffset = 0x38;
gCurrentSprite.drawDistanceBottomOffset = 0;
gCurrentSprite.drawDistanceHorizontalOffset = 0x48;
gCurrentSprite.drawDistanceTop = 0x38;
gCurrentSprite.drawDistanceBottom = 0;
gCurrentSprite.drawDistanceHorizontal = 0x48;
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.samusCollision = SSC_NONE;
break;
case IMAGO_PART_CORE:
gCurrentSprite.drawDistanceTopOffset = 0x20;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x20;
gCurrentSprite.drawDistanceTop = 0x20;
gCurrentSprite.drawDistanceBottom = 0x10;
gCurrentSprite.drawDistanceHorizontal = 0x20;
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.frozenPaletteRowOffset = 0x1;
@ -1394,7 +1394,7 @@ void ImagoPart(void)
if (gSpriteData[ramSlot].health == 0)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
if (gSpriteData[ramSlot].pose >= IMAGO_POSE_CHARGING_THROUGH_WALL)
@ -1490,14 +1490,14 @@ void ImagoNeedle(void)
{
case 0:
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = 0x8;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.drawDistanceHorizontalOffset = 0x8;
gCurrentSprite.drawDistanceTop = 0x8;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.drawDistanceHorizontal = 0x8;
gCurrentSprite.hitboxTopOffset = -0xC;
gCurrentSprite.hitboxBottomOffset = 0xC;
gCurrentSprite.hitboxLeftOffset = -0xC;
gCurrentSprite.hitboxRightOffset = 0xC;
gCurrentSprite.hitboxTop = -0xC;
gCurrentSprite.hitboxBottom = 0xC;
gCurrentSprite.hitboxLeft = -0xC;
gCurrentSprite.hitboxRight = 0xC;
gCurrentSprite.health = GET_SSPRITE_HEALTH(gCurrentSprite.spriteId);
gCurrentSprite.pOam = sImagoNeedleOam;
@ -1541,21 +1541,21 @@ void ImagoDamagedStinger(void)
s32 movement;
u8 offset;
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
case 0:
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = 0x20;
gCurrentSprite.drawDistanceBottomOffset = 0x20;
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.drawDistanceTop = 0x20;
gCurrentSprite.drawDistanceBottom = 0x20;
gCurrentSprite.drawDistanceHorizontal = 0x18;
gCurrentSprite.hitboxTopOffset = -0x60;
gCurrentSprite.hitboxBottomOffset = 0x60;
gCurrentSprite.hitboxLeftOffset = -0x20;
gCurrentSprite.hitboxRightOffset = 0x20;
gCurrentSprite.hitboxTop = -0x60;
gCurrentSprite.hitboxBottom = 0x60;
gCurrentSprite.hitboxLeft = -0x20;
gCurrentSprite.hitboxRight = 0x20;
gCurrentSprite.pOam = sImagoDamagedStingerOam;
gCurrentSprite.animationDurationCounter = 0;
@ -1630,14 +1630,14 @@ void ImagoEgg(void)
case 0:
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = 0x18;
gCurrentSprite.drawDistanceBottomOffset = 0;
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.drawDistanceTop = 0x18;
gCurrentSprite.drawDistanceBottom = 0;
gCurrentSprite.drawDistanceHorizontal = 0x18;
gCurrentSprite.hitboxTopOffset = -0x44;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = -0x1C;
gCurrentSprite.hitboxRightOffset = 0x1C;
gCurrentSprite.hitboxTop = -0x44;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = -0x1C;
gCurrentSprite.hitboxRight = 0x1C;
gCurrentSprite.health = 0x1;
gCurrentSprite.pOam = sImagoEggOam_Standing;
@ -1669,7 +1669,7 @@ void ImagoEgg(void)
case IMAGO_EGG_POSE_BREAKING:
if (gCurrentSprite.currentAnimationFrame > 0x2)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.pose = IMAGO_EGG_POSE_DISAPPEARING;
gCurrentSprite.work0 = 0xB4;

View File

@ -146,15 +146,15 @@ void ImagoCocoonChangeOAMScaling(u16 limit, u16 value)
{
if (gCurrentSprite.work2) // Check growing/shrinking
{
if (gCurrentSprite.oamScaling > (0x100 - limit))
gCurrentSprite.oamScaling -= value;
if (gCurrentSprite.scaling > (0x100 - limit))
gCurrentSprite.scaling -= value;
else
gCurrentSprite.work2 = FALSE; // Set growing
}
else
{
if (gCurrentSprite.oamScaling < (limit + 0x100))
gCurrentSprite.oamScaling += value;
if (gCurrentSprite.scaling < (limit + 0x100))
gCurrentSprite.scaling += value;
else
gCurrentSprite.work2 = TRUE; // Set shrinking
}
@ -189,19 +189,19 @@ void ImagoCocoonInit(void)
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.drawDistanceTopOffset = 0x38;
gCurrentSprite.drawDistanceBottomOffset = 0x18;
gCurrentSprite.drawDistanceHorizontalOffset = 0x28;
gCurrentSprite.drawDistanceTop = 0x38;
gCurrentSprite.drawDistanceBottom = 0x18;
gCurrentSprite.drawDistanceHorizontal = 0x28;
gCurrentSprite.hitboxTopOffset = 0x0;
gCurrentSprite.hitboxBottomOffset = 0x0;
gCurrentSprite.hitboxLeftOffset = 0x0;
gCurrentSprite.hitboxRightOffset = 0x0;
gCurrentSprite.hitboxTop = 0x0;
gCurrentSprite.hitboxBottom = 0x0;
gCurrentSprite.hitboxLeft = 0x0;
gCurrentSprite.hitboxRight = 0x0;
gCurrentSprite.drawOrder = 0x4;
gCurrentSprite.status |= SPRITE_STATUS_ROTATION_SCALING;
gCurrentSprite.oamScaling = Q_8_8(1.f);
gCurrentSprite.oamRotation = 0;
gCurrentSprite.scaling = Q_8_8(1.f);
gCurrentSprite.rotation = 0;
gCurrentSprite.roomSlot = IMAGO_COCOON_PART_IMAGO_COCOON;
gSubSpriteData1.pMultiOam = sImagoCocoonMultiSpriteData_Idle;
@ -222,22 +222,22 @@ void ImagoCocoonInit(void)
xPosition = gSubSpriteData1.xPosition;
gCurrentSprite.yPositionSpawn = yPosition;
gCurrentSprite.drawDistanceTopOffset = 0x38;
gCurrentSprite.drawDistanceBottomOffset = 0x18;
gCurrentSprite.drawDistanceHorizontalOffset = 0x28;
gCurrentSprite.drawDistanceTop = 0x38;
gCurrentSprite.drawDistanceBottom = 0x18;
gCurrentSprite.drawDistanceHorizontal = 0x28;
gCurrentSprite.hitboxTopOffset = -0xA0;
gCurrentSprite.hitboxBottomOffset = 0x0;
gCurrentSprite.hitboxLeftOffset = -0x60;
gCurrentSprite.hitboxRightOffset = 0x60;
gCurrentSprite.hitboxTop = -0xA0;
gCurrentSprite.hitboxBottom = 0x0;
gCurrentSprite.hitboxLeft = -0x60;
gCurrentSprite.hitboxRight = 0x60;
gCurrentSprite.drawOrder = 0x6;
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
gCurrentSprite.health = GET_PSPRITE_HEALTH(gCurrentSprite.spriteId);
gCurrentSprite.status |= SPRITE_STATUS_ROTATION_SCALING;
gCurrentSprite.oamScaling = Q_8_8(1.f);
gCurrentSprite.oamRotation = 0x0;
gCurrentSprite.scaling = Q_8_8(1.f);
gCurrentSprite.rotation = 0x0;
gCurrentSprite.work2 = FALSE;
gSubSpriteData1.pMultiOam = sImagoCocoonMultiSpriteData_Idle;
@ -489,7 +489,7 @@ void ImagoCocoonFallingAfterBlocks(void)
ScreenShakeStartVertical(0x28, 0x81);
SoundPlay(0x1A5);
gCurrentSprite.oamScaling = Q_8_8(1.f);
gCurrentSprite.scaling = Q_8_8(1.f);
gCurrentSprite.work2 = FALSE;
FadeMusic(0x55);
@ -527,9 +527,9 @@ void ImagoCocoonInGround(void)
if (gCurrentSprite.work2)
{
// Scale up
if (gCurrentSprite.oamScaling > 0xFC)
if (gCurrentSprite.scaling > 0xFC)
{
gCurrentSprite.oamScaling--;
gCurrentSprite.scaling--;
gSubSpriteData1.yPosition--;
}
else
@ -541,9 +541,9 @@ void ImagoCocoonInGround(void)
else
{
// Scale down
if (gCurrentSprite.oamScaling < 0x104)
if (gCurrentSprite.scaling < 0x104)
{
gCurrentSprite.oamScaling++;
gCurrentSprite.scaling++;
gSubSpriteData1.yPosition++;
}
else
@ -563,14 +563,14 @@ void ImagoCocoonVineInit(void)
switch (gCurrentSprite.roomSlot)
{
case IMAGO_COCOON_PART_VINE_LEFT_MIDDLE:
gCurrentSprite.drawDistanceTopOffset = 0x20;
gCurrentSprite.drawDistanceBottomOffset = 0x20;
gCurrentSprite.drawDistanceHorizontalOffset = 0x10;
gCurrentSprite.drawDistanceTop = 0x20;
gCurrentSprite.drawDistanceBottom = 0x20;
gCurrentSprite.drawDistanceHorizontal = 0x10;
gCurrentSprite.hitboxTopOffset = -0x60;
gCurrentSprite.hitboxBottomOffset = 0x40;
gCurrentSprite.hitboxLeftOffset = -0x10;
gCurrentSprite.hitboxRightOffset = 0x10;
gCurrentSprite.hitboxTop = -0x60;
gCurrentSprite.hitboxBottom = 0x40;
gCurrentSprite.hitboxLeft = -0x10;
gCurrentSprite.hitboxRight = 0x10;
gCurrentSprite.health = GET_SSPRITE_HEALTH(gCurrentSprite.spriteId);
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
@ -579,14 +579,14 @@ void ImagoCocoonVineInit(void)
break;
case IMAGO_COCOON_PART_VINE_RIGHT_MIDDLE:
gCurrentSprite.drawDistanceTopOffset = 0x18;
gCurrentSprite.drawDistanceBottomOffset = 0x20;
gCurrentSprite.drawDistanceHorizontalOffset = 0x10;
gCurrentSprite.drawDistanceTop = 0x18;
gCurrentSprite.drawDistanceBottom = 0x20;
gCurrentSprite.drawDistanceHorizontal = 0x10;
gCurrentSprite.hitboxTopOffset = -0x60;
gCurrentSprite.hitboxBottomOffset = 0x60;
gCurrentSprite.hitboxLeftOffset = -0x10;
gCurrentSprite.hitboxRightOffset = 0x10;
gCurrentSprite.hitboxTop = -0x60;
gCurrentSprite.hitboxBottom = 0x60;
gCurrentSprite.hitboxLeft = -0x10;
gCurrentSprite.hitboxRight = 0x10;
gCurrentSprite.health = GET_SSPRITE_HEALTH(gCurrentSprite.spriteId);
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
@ -595,14 +595,14 @@ void ImagoCocoonVineInit(void)
break;
case IMAGO_COCOON_PART_VINE_RIGHT_RIGHT:
gCurrentSprite.drawDistanceTopOffset = 0x18;
gCurrentSprite.drawDistanceBottomOffset = 0x20;
gCurrentSprite.drawDistanceHorizontalOffset = 0x10;
gCurrentSprite.drawDistanceTop = 0x18;
gCurrentSprite.drawDistanceBottom = 0x20;
gCurrentSprite.drawDistanceHorizontal = 0x10;
gCurrentSprite.hitboxTopOffset = -0x40;
gCurrentSprite.hitboxBottomOffset = 0x60;
gCurrentSprite.hitboxLeftOffset = -0x10;
gCurrentSprite.hitboxRightOffset = 0x10;
gCurrentSprite.hitboxTop = -0x40;
gCurrentSprite.hitboxBottom = 0x60;
gCurrentSprite.hitboxLeft = -0x10;
gCurrentSprite.hitboxRight = 0x10;
gCurrentSprite.health = GET_SSPRITE_HEALTH(gCurrentSprite.spriteId);
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
@ -611,14 +611,14 @@ void ImagoCocoonVineInit(void)
break;
case IMAGO_COCOON_PART_VINE_LEFT_LEFT:
gCurrentSprite.drawDistanceTopOffset = 0x20;
gCurrentSprite.drawDistanceBottomOffset = 0x28;
gCurrentSprite.drawDistanceHorizontalOffset = 0x10;
gCurrentSprite.drawDistanceTop = 0x20;
gCurrentSprite.drawDistanceBottom = 0x28;
gCurrentSprite.drawDistanceHorizontal = 0x10;
gCurrentSprite.hitboxTopOffset = -0x60;
gCurrentSprite.hitboxBottomOffset = 0x80;
gCurrentSprite.hitboxLeftOffset = -0x18;
gCurrentSprite.hitboxRightOffset = 0x18;
gCurrentSprite.hitboxTop = -0x60;
gCurrentSprite.hitboxBottom = 0x80;
gCurrentSprite.hitboxLeft = -0x18;
gCurrentSprite.hitboxRight = 0x18;
gCurrentSprite.health = GET_SSPRITE_HEALTH(gCurrentSprite.spriteId);
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
@ -627,14 +627,14 @@ void ImagoCocoonVineInit(void)
break;
case IMAGO_COCOON_PART_VINE_RIGHT_LEFT:
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x10;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x10;
gCurrentSprite.drawDistanceHorizontal = 0x10;
gCurrentSprite.hitboxTopOffset = -0x38;
gCurrentSprite.hitboxBottomOffset = 0x38;
gCurrentSprite.hitboxLeftOffset = -0x10;
gCurrentSprite.hitboxRightOffset = 0x10;
gCurrentSprite.hitboxTop = -0x38;
gCurrentSprite.hitboxBottom = 0x38;
gCurrentSprite.hitboxLeft = -0x10;
gCurrentSprite.hitboxRight = 0x10;
gCurrentSprite.health = GET_SSPRITE_HEALTH(gCurrentSprite.spriteId);
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
@ -643,14 +643,14 @@ void ImagoCocoonVineInit(void)
break;
case IMAGO_COCOON_PART_VINE_LEFT_RIGHT:
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x8;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x10;
gCurrentSprite.drawDistanceHorizontal = 0x8;
gCurrentSprite.hitboxTopOffset = -0x38;
gCurrentSprite.hitboxBottomOffset = 0x38;
gCurrentSprite.hitboxLeftOffset = -0x10;
gCurrentSprite.hitboxRightOffset = 0x10;
gCurrentSprite.hitboxTop = -0x38;
gCurrentSprite.hitboxBottom = 0x38;
gCurrentSprite.hitboxLeft = -0x10;
gCurrentSprite.hitboxRight = 0x10;
gCurrentSprite.health = GET_SSPRITE_HEALTH(gCurrentSprite.spriteId);
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
@ -659,14 +659,14 @@ void ImagoCocoonVineInit(void)
break;
case IMAGO_COCOON_PART_VINE_LEFT_VINE_DECORATIONS:
gCurrentSprite.drawDistanceTopOffset = 0x38;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x20;
gCurrentSprite.drawDistanceTop = 0x38;
gCurrentSprite.drawDistanceBottom = 0x10;
gCurrentSprite.drawDistanceHorizontal = 0x20;
gCurrentSprite.hitboxTopOffset = -0x4;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = -0x4;
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.hitboxTop = -0x4;
gCurrentSprite.hitboxBottom = 0x4;
gCurrentSprite.hitboxLeft = -0x4;
gCurrentSprite.hitboxRight = 0x4;
// Set spawning spores behavior
gCurrentSprite.samusCollision = SSC_NONE;
@ -676,14 +676,14 @@ void ImagoCocoonVineInit(void)
break;
case IMAGO_COCOON_PART_VINE_RIGHT_VINE_DECORATIONS:
gCurrentSprite.drawDistanceTopOffset = 0x38;
gCurrentSprite.drawDistanceBottomOffset = 0x18;
gCurrentSprite.drawDistanceHorizontalOffset = 0x28;
gCurrentSprite.drawDistanceTop = 0x38;
gCurrentSprite.drawDistanceBottom = 0x18;
gCurrentSprite.drawDistanceHorizontal = 0x28;
gCurrentSprite.hitboxTopOffset = -0x4;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = -0x4;
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.hitboxTop = -0x4;
gCurrentSprite.hitboxBottom = 0x4;
gCurrentSprite.hitboxLeft = -0x4;
gCurrentSprite.hitboxRight = 0x4;
// Set spawning spores behavior
gCurrentSprite.samusCollision = SSC_NONE;
@ -692,14 +692,14 @@ void ImagoCocoonVineInit(void)
break;
case IMAGO_COCOON_PART_CEILING_VINE:
gCurrentSprite.drawDistanceTopOffset = 0x8;
gCurrentSprite.drawDistanceBottomOffset = 0x28;
gCurrentSprite.drawDistanceHorizontalOffset = 0x20;
gCurrentSprite.drawDistanceTop = 0x8;
gCurrentSprite.drawDistanceBottom = 0x28;
gCurrentSprite.drawDistanceHorizontal = 0x20;
gCurrentSprite.hitboxTopOffset = -0x20;
gCurrentSprite.hitboxBottomOffset = 0xA0;
gCurrentSprite.hitboxLeftOffset = -0x20;
gCurrentSprite.hitboxRightOffset = 0x20;
gCurrentSprite.hitboxTop = -0x20;
gCurrentSprite.hitboxBottom = 0xA0;
gCurrentSprite.hitboxLeft = -0x20;
gCurrentSprite.hitboxRight = 0x20;
gCurrentSprite.health = 0x1;
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
@ -847,7 +847,7 @@ void ImagoCocoonCeilingVineIdle(void)
{
if (gSubSpriteData1.health == 0x0 && gSubSpriteData1.currentAnimationFrame > 0x7)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.pose = IMAGO_COCOON_VINE_POSE_CEILING_VINE_DEATH;
@ -862,7 +862,7 @@ void ImagoCocoonCeilingVineDeath(void)
{
u8 ramSlot;
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
ramSlot = gCurrentSprite.primarySpriteRamSlot;
if (gSpriteData[ramSlot].pose == IMAGO_COCOON_POSE_UNLOCK_PASSAGE)
@ -903,14 +903,14 @@ void ImagoCocoonSporeInit(void)
if (gCurrentSprite.roomSlot == IMAGO_COCOON_SPORE_PART_DOWN)
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = 0xC;
gCurrentSprite.drawDistanceBottomOffset = 0xC;
gCurrentSprite.drawDistanceHorizontalOffset = 0xC;
gCurrentSprite.drawDistanceTop = 0xC;
gCurrentSprite.drawDistanceBottom = 0xC;
gCurrentSprite.drawDistanceHorizontal = 0xC;
gCurrentSprite.hitboxTopOffset = -0x8;
gCurrentSprite.hitboxBottomOffset = 0x8;
gCurrentSprite.hitboxLeftOffset = -0x8;
gCurrentSprite.hitboxRightOffset = 0x8;
gCurrentSprite.hitboxTop = -0x8;
gCurrentSprite.hitboxBottom = 0x8;
gCurrentSprite.hitboxLeft = -0x8;
gCurrentSprite.hitboxRight = 0x8;
gCurrentSprite.pOam = sImagoCocoonSporeOam_Spawning;
gCurrentSprite.animationDurationCounter = 0x0;
@ -923,7 +923,7 @@ void ImagoCocoonSporeInit(void)
gCurrentSprite.health = GET_SSPRITE_HEALTH(gCurrentSprite.spriteId);
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
ImagoCocoonSporeSyncPosition();
}
@ -1046,7 +1046,7 @@ void ImagoCocoonSporeMove(void)
*/
void ImagoCocoonSporeExplodingInit(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.pOam = sImagoCocoonSpore_Exploding;
gCurrentSprite.animationDurationCounter = 0x0;
@ -1062,7 +1062,7 @@ void ImagoCocoonSporeExplodingInit(void)
*/
void ImagoCocoonSporeCheckExplodingAnimEnded(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (SpriteUtilCheckEndCurrentSpriteAnim())
gCurrentSprite.status = 0x0;
}
@ -1095,17 +1095,17 @@ u8 WingedRipperImagoCollision(void)
{
spriteY = gCurrentSprite.yPosition;
spriteX = gCurrentSprite.xPosition;
spriteTop = spriteY + gCurrentSprite.hitboxTopOffset;
spriteBottom = spriteY + gCurrentSprite.hitboxBottomOffset;
spriteLeft = spriteX + gCurrentSprite.hitboxLeftOffset;
spriteRight = spriteX + gCurrentSprite.hitboxRightOffset;
spriteTop = spriteY + gCurrentSprite.hitboxTop;
spriteBottom = spriteY + gCurrentSprite.hitboxBottom;
spriteLeft = spriteX + gCurrentSprite.hitboxLeft;
spriteRight = spriteX + gCurrentSprite.hitboxRight;
imagoY = gSpriteData[ramSlot].yPosition;
imagoX = gSpriteData[ramSlot].xPosition;
imagoTop = imagoY + gSpriteData[ramSlot].hitboxTopOffset;
imagoBottom = imagoY + gSpriteData[ramSlot].hitboxBottomOffset;
imagoLeft = imagoX + gSpriteData[ramSlot].hitboxLeftOffset;
imagoRight = imagoX + gSpriteData[ramSlot].hitboxRightOffset;
imagoTop = imagoY + gSpriteData[ramSlot].hitboxTop;
imagoBottom = imagoY + gSpriteData[ramSlot].hitboxBottom;
imagoLeft = imagoX + gSpriteData[ramSlot].hitboxLeft;
imagoRight = imagoX + gSpriteData[ramSlot].hitboxRight;
if (SpriteUtilCheckObjectsTouching(spriteTop, spriteBottom, spriteLeft, spriteRight, imagoTop, imagoBottom, imagoLeft, imagoRight))
{
@ -1126,14 +1126,14 @@ void WingedRipperInit(void)
{
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.hitboxTopOffset = -0x20;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = -0x20;
gCurrentSprite.hitboxRightOffset = 0x20;
gCurrentSprite.hitboxTop = -0x20;
gCurrentSprite.hitboxBottom = 0x4;
gCurrentSprite.hitboxLeft = -0x20;
gCurrentSprite.hitboxRight = 0x20;
gCurrentSprite.drawDistanceTopOffset = 0xC;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.drawDistanceHorizontalOffset = 0x10;
gCurrentSprite.drawDistanceTop = 0xC;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.drawDistanceHorizontal = 0x10;
gCurrentSprite.pOam = sWingedRipperOam_Moving;
gCurrentSprite.animationDurationCounter = 0x0;
@ -1144,7 +1144,7 @@ void WingedRipperInit(void)
gCurrentSprite.drawOrder = 0x8;
gCurrentSprite.pose = WINGED_RIPPER_POSE_MOVING_INIT;
gCurrentSprite.oamScaling = 0xC0;
gCurrentSprite.scaling = 0xC0;
gCurrentSprite.work1 = 0x80;
gCurrentSprite.status |= SPRITE_STATUS_FACING_RIGHT;
@ -1246,7 +1246,7 @@ void WingedRipperMove(void)
gCurrentSprite.work1--;
}
radius = (s16)gCurrentSprite.oamScaling;
radius = (s16)gCurrentSprite.scaling;
angle = gCurrentSprite.work1;
// Update Y position
@ -1316,11 +1316,11 @@ void WingedRipperMove(void)
*/
void WingedRipperDeath(void)
{
if (gCurrentSprite.standingOnSprite)
if (gCurrentSprite.standingOnSprite != SAMUS_STANDING_ON_SPRITE_OFF)
{
if (gSamusData.standingStatus == STANDING_ENEMY)
gSamusData.standingStatus = STANDING_MIDAIR;
gCurrentSprite.standingOnSprite = FALSE;
gCurrentSprite.standingOnSprite = SAMUS_STANDING_ON_SPRITE_OFF;
}
SpriteUtilSpriteDeath(DEATH_NORMAL, gCurrentSprite.yPosition + 0x8, gCurrentSprite.xPosition, TRUE, PE_SPRITE_EXPLOSION_MEDIUM);
@ -1485,20 +1485,20 @@ void WingedRipper(void)
*/
void DefeatedImagoCocoon(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gCurrentSprite.pose == 0x0)
{
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.drawDistanceTopOffset = 0xC;
gCurrentSprite.drawDistanceBottomOffset = 0x28;
gCurrentSprite.drawDistanceHorizontalOffset = 0x30;
gCurrentSprite.drawDistanceTop = 0xC;
gCurrentSprite.drawDistanceBottom = 0x28;
gCurrentSprite.drawDistanceHorizontal = 0x30;
gCurrentSprite.hitboxTopOffset = -0x4;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = -0x4;
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.hitboxTop = -0x4;
gCurrentSprite.hitboxBottom = 0x4;
gCurrentSprite.hitboxLeft = -0x4;
gCurrentSprite.hitboxRight = 0x4;
gCurrentSprite.pOam = sDefeatedImagoCocoonOam;
gCurrentSprite.animationDurationCounter = 0x0;
@ -1516,20 +1516,20 @@ void DefeatedImagoCocoon(void)
*/
void ImagoCocoonCeilingVine(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gCurrentSprite.pose == 0x0)
{
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.drawDistanceTopOffset = 0xC;
gCurrentSprite.drawDistanceBottomOffset = 0x28;
gCurrentSprite.drawDistanceHorizontalOffset = 0x30;
gCurrentSprite.drawDistanceTop = 0xC;
gCurrentSprite.drawDistanceBottom = 0x28;
gCurrentSprite.drawDistanceHorizontal = 0x30;
gCurrentSprite.hitboxTopOffset = -0x4;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = -0x4;
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.hitboxTop = -0x4;
gCurrentSprite.hitboxBottom = 0x4;
gCurrentSprite.hitboxLeft = -0x4;
gCurrentSprite.hitboxRight = 0x4;
gCurrentSprite.pOam = sImagoCocoonOam_CeilingVineBroken;
gCurrentSprite.animationDurationCounter = 0x0;
@ -1558,14 +1558,14 @@ void EventTriggerDiscoveredImagoPassage(void)
gCurrentSprite.status |= SPRITE_STATUS_NOT_DRAWN | SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.samusCollision = SSC_ABILITY_LASER_SEARCHLIGHT;
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x0;
gCurrentSprite.drawDistanceHorizontalOffset = 0x8;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x0;
gCurrentSprite.drawDistanceHorizontal = 0x8;
gCurrentSprite.hitboxTopOffset = -0x40;
gCurrentSprite.hitboxBottomOffset = 0x0;
gCurrentSprite.hitboxLeftOffset = -0x20;
gCurrentSprite.hitboxRightOffset = 0x20;
gCurrentSprite.hitboxTop = -0x40;
gCurrentSprite.hitboxBottom = 0x0;
gCurrentSprite.hitboxLeft = -0x20;
gCurrentSprite.hitboxRight = 0x20;
gCurrentSprite.pose = 0x8;
gCurrentSprite.pOam = sEnemyDropOAM_LargeEnergy;
@ -1587,17 +1587,17 @@ void EventTriggerDiscoveredImagoPassage(void)
*/
void ImagoCocoonAfterFight(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gCurrentSprite.pose == 0x0)
{
gCurrentSprite.drawDistanceTopOffset = 0x30;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x20;
gCurrentSprite.drawDistanceTop = 0x30;
gCurrentSprite.drawDistanceBottom = 0x10;
gCurrentSprite.drawDistanceHorizontal = 0x20;
gCurrentSprite.hitboxTopOffset = -0x4;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = -0x4;
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.hitboxTop = -0x4;
gCurrentSprite.hitboxBottom = 0x4;
gCurrentSprite.hitboxLeft = -0x4;
gCurrentSprite.hitboxRight = 0x4;
gCurrentSprite.pOam = sDefeatedImagoCocoonOam;
gCurrentSprite.animationDurationCounter = 0x0;

View File

@ -109,8 +109,8 @@ void ImagoLarvaInit(struct SubSpriteData* pSub)
{
// Left larva
gCurrentSprite.status |= SPRITE_STATUS_XFLIP;
gCurrentSprite.hitboxLeftOffset = -IMAGO_LARVA_TAIL_HITBOX;
gCurrentSprite.hitboxRightOffset = IMAGO_LARVA_HEAD_HITBOX;
gCurrentSprite.hitboxLeft = -IMAGO_LARVA_TAIL_HITBOX;
gCurrentSprite.hitboxRight = IMAGO_LARVA_HEAD_HITBOX;
gCurrentSprite.pose = IMAGO_LARVA_POSE_IDLE;
// Lock doors
@ -122,8 +122,8 @@ void ImagoLarvaInit(struct SubSpriteData* pSub)
else
{
// Right larva
gCurrentSprite.hitboxLeftOffset = -IMAGO_LARVA_HEAD_HITBOX;
gCurrentSprite.hitboxRightOffset = IMAGO_LARVA_TAIL_HITBOX;
gCurrentSprite.hitboxLeft = -IMAGO_LARVA_HEAD_HITBOX;
gCurrentSprite.hitboxRight = IMAGO_LARVA_TAIL_HITBOX;
// Move to cocoon
pSub->xPosition += BLOCK_SIZE * 11;
@ -131,12 +131,12 @@ void ImagoLarvaInit(struct SubSpriteData* pSub)
gCurrentSprite.pose = IMAGO_LARVA_POSE_DETECT_SAMUS;
}
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE - QUARTER_BLOCK_SIZE);
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxTop = -(BLOCK_SIZE - QUARTER_BLOCK_SIZE);
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.work2 = 0;
gCurrentSprite.work3 = 0;
@ -488,14 +488,14 @@ void ImagoLarvaPartInit(struct SubSpriteData* pSub)
case IMAGO_LARVA_PART_RIGHT_DOT:
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxBottomOffset = PIXEL_SIZE;
gCurrentSprite.hitboxLeftOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxRightOffset = PIXEL_SIZE;
gCurrentSprite.hitboxTop = -PIXEL_SIZE;
gCurrentSprite.hitboxBottom = PIXEL_SIZE;
gCurrentSprite.hitboxLeft = -PIXEL_SIZE;
gCurrentSprite.hitboxRight = PIXEL_SIZE;
gCurrentSprite.pOam = sImagoLarvaPartOam_RightDotVisible;
gCurrentSprite.animationDurationCounter = 0;
@ -508,14 +508,14 @@ void ImagoLarvaPartInit(struct SubSpriteData* pSub)
case IMAGO_LARVA_PART_MIDDLE_DOT:
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxBottomOffset = PIXEL_SIZE;
gCurrentSprite.hitboxLeftOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxRightOffset = PIXEL_SIZE;
gCurrentSprite.hitboxTop = -PIXEL_SIZE;
gCurrentSprite.hitboxBottom = PIXEL_SIZE;
gCurrentSprite.hitboxLeft = -PIXEL_SIZE;
gCurrentSprite.hitboxRight = PIXEL_SIZE;
gCurrentSprite.pOam = sImagoLarvaPartOam_MiddleDotVisible;
gCurrentSprite.animationDurationCounter = 0;
@ -528,14 +528,14 @@ void ImagoLarvaPartInit(struct SubSpriteData* pSub)
case IMAGO_LARVA_PART_LEFT_DOT:
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxBottomOffset = PIXEL_SIZE;
gCurrentSprite.hitboxLeftOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxRightOffset = PIXEL_SIZE;
gCurrentSprite.hitboxTop = -PIXEL_SIZE;
gCurrentSprite.hitboxBottom = PIXEL_SIZE;
gCurrentSprite.hitboxLeft = -PIXEL_SIZE;
gCurrentSprite.hitboxRight = PIXEL_SIZE;
gCurrentSprite.pOam = sImagoLarvaPartOam_LeftDotVisible;
gCurrentSprite.animationDurationCounter = 0;
@ -546,22 +546,22 @@ void ImagoLarvaPartInit(struct SubSpriteData* pSub)
break;
case IMAGO_LARVA_PART_SHELL:
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE * 3 - QUARTER_BLOCK_SIZE);
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxTop = -(BLOCK_SIZE * 3 - QUARTER_BLOCK_SIZE);
gCurrentSprite.hitboxBottom = 0;
if (gCurrentSprite.status & SPRITE_STATUS_XFLIP)
{
gCurrentSprite.hitboxLeftOffset = -IMAGO_LARVA_SHELL_TAIL_HITBOX;
gCurrentSprite.hitboxRightOffset = IMAGO_LARVA_SHELL_HEAD_HITBOX;
gCurrentSprite.hitboxLeft = -IMAGO_LARVA_SHELL_TAIL_HITBOX;
gCurrentSprite.hitboxRight = IMAGO_LARVA_SHELL_HEAD_HITBOX;
}
else
{
gCurrentSprite.hitboxLeftOffset = -IMAGO_LARVA_SHELL_HEAD_HITBOX;
gCurrentSprite.hitboxRightOffset = IMAGO_LARVA_SHELL_TAIL_HITBOX;
gCurrentSprite.hitboxLeft = -IMAGO_LARVA_SHELL_HEAD_HITBOX;
gCurrentSprite.hitboxRight = IMAGO_LARVA_SHELL_TAIL_HITBOX;
}
gCurrentSprite.samusCollision = SSC_KRAID;
@ -573,14 +573,14 @@ void ImagoLarvaPartInit(struct SubSpriteData* pSub)
case IMAGO_LARVA_PART_CLAWS:
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxBottomOffset = PIXEL_SIZE;
gCurrentSprite.hitboxLeftOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxRightOffset = PIXEL_SIZE;
gCurrentSprite.hitboxTop = -PIXEL_SIZE;
gCurrentSprite.hitboxBottom = PIXEL_SIZE;
gCurrentSprite.hitboxLeft = -PIXEL_SIZE;
gCurrentSprite.hitboxRight = PIXEL_SIZE;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.drawOrder = 3;
@ -623,9 +623,9 @@ void ImagoLarvaPartShellIdle(struct SubSpriteData* pSub)
// This allows for the larva to be hit with precise missile shots
if (pSub->xPosition - (BLOCK_SIZE * 3 + QUARTER_BLOCK_SIZE) < gSamusData.xPosition &&
pSub->xPosition + (BLOCK_SIZE + HALF_BLOCK_SIZE) > gSamusData.xPosition)
gCurrentSprite.hitboxBottomOffset = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxBottom = -HALF_BLOCK_SIZE;
else
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxBottom = 0;
if (SPRITE_HAS_ISFT(gCurrentSprite))
{
@ -871,7 +871,7 @@ void ImagoLarva(void)
else
pSub = &gSubSpriteData1;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if ((u8)(gCurrentSprite.pose - 1) < IMAGO_LARVA_POSE_DYING_INIT - 1)
{

View File

@ -9,20 +9,20 @@
*/
void ImagoLarvaRightSide(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gCurrentSprite.pose == 0x0)
{
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.hitboxTopOffset = -0x4;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = -0x4;
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.hitboxTop = -0x4;
gCurrentSprite.hitboxBottom = 0x4;
gCurrentSprite.hitboxLeft = -0x4;
gCurrentSprite.hitboxRight = 0x4;
gCurrentSprite.drawDistanceTopOffset = 0x30;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.drawDistanceHorizontalOffset = 0x30;
gCurrentSprite.drawDistanceTop = 0x30;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.drawDistanceHorizontal = 0x30;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.pOam = sImagoLarvaRightSideOAM;

View File

@ -43,14 +43,14 @@ void ItemBannerInit(void)
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.properties |= (SP_ALWAYS_ACTIVE | SP_ABSOLUTE_POSITION);
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 8);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 8);
gCurrentSprite.hitboxTopOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxBottomOffset = PIXEL_SIZE;
gCurrentSprite.hitboxLeftOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxRightOffset = PIXEL_SIZE;
gCurrentSprite.hitboxTop = -PIXEL_SIZE;
gCurrentSprite.hitboxBottom = PIXEL_SIZE;
gCurrentSprite.hitboxLeft = -PIXEL_SIZE;
gCurrentSprite.hitboxRight = PIXEL_SIZE;
gCurrentSprite.pOam = sItemBannerOAM_TwoLinesSpawn;
gCurrentSprite.animationDurationCounter = 0;
@ -319,7 +319,7 @@ void ItemBannerRemovalAnimation(void)
*/
void ItemBanner(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
@ -357,7 +357,7 @@ void SaveYesNoCursor(void)
{
u8 ramSlot;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
ramSlot = gCurrentSprite.primarySpriteRamSlot;
switch (gCurrentSprite.pose)
@ -371,14 +371,14 @@ void SaveYesNoCursor(void)
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.properties |= (SP_ALWAYS_ACTIVE | SP_ABSOLUTE_POSITION);
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxBottomOffset = PIXEL_SIZE;
gCurrentSprite.hitboxLeftOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxRightOffset = PIXEL_SIZE;
gCurrentSprite.hitboxTop = -PIXEL_SIZE;
gCurrentSprite.hitboxBottom = PIXEL_SIZE;
gCurrentSprite.hitboxLeft = -PIXEL_SIZE;
gCurrentSprite.hitboxRight = PIXEL_SIZE;
gCurrentSprite.pOam = sSaveYesNoCursorOAM_Idle;
gCurrentSprite.animationDurationCounter = 0;

File diff suppressed because it is too large Load Diff

View File

@ -24,13 +24,13 @@ void MapStationInit(void)
{
gCurrentSprite.yPosition += BLOCK_SIZE * 2;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 8);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 - QUARTER_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 8);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 - QUARTER_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE * 8);
gCurrentSprite.hitboxLeftOffset = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -(BLOCK_SIZE * 8);
gCurrentSprite.hitboxLeft = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRight = HALF_BLOCK_SIZE;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.drawOrder = 4;
@ -41,7 +41,7 @@ void MapStationInit(void)
// Check set inactive
if (HAS_AREA_MAP(gCurrentArea) || gAlarmTimer != 0)
{
gCurrentSprite.hitboxBottomOffset = -BLOCK_SIZE;
gCurrentSprite.hitboxBottom = -BLOCK_SIZE;
gCurrentSprite.pose = MAP_STATION_POSE_DO_NOTHING;
gCurrentSprite.pOam = sMapStationOAM_Inactive;
@ -50,7 +50,7 @@ void MapStationInit(void)
}
else
{
gCurrentSprite.hitboxBottomOffset = BLOCK_SIZE;
gCurrentSprite.hitboxBottom = BLOCK_SIZE;
gCurrentSprite.pose = MAP_STATION_POSE_IDLE;
gCurrentSprite.pOam = sMapStationOAM_Idle;
@ -190,7 +190,7 @@ void MapStationSpawnMessage(void)
gCurrentSprite.work1 = SpriteSpawnPrimary(PSPRITE_ITEM_BANNER, text, 6,
gCurrentSprite.yPosition, gCurrentSprite.xPosition, 0);
gCurrentSprite.hitboxBottomOffset = -BLOCK_SIZE;
gCurrentSprite.hitboxBottom = -BLOCK_SIZE;
gCurrentSprite.pose = MAP_STATION_POSE_WAIT_FOR_MESSAGE;
gSamusData.currentAnimationFrame = 0;
gSamusData.timer = 1;
@ -248,7 +248,7 @@ void MapStationRetracting(void)
*/
void MapStation(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
@ -293,7 +293,7 @@ void MapStationPart(void)
{
u8 ramSlot;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
ramSlot = gCurrentSprite.primarySpriteRamSlot;
switch (gCurrentSprite.pose)
@ -306,14 +306,14 @@ void MapStationPart(void)
gCurrentSprite.drawOrder = 3;
gCurrentSprite.bgPriority = 1;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;

View File

@ -348,7 +348,7 @@ void MechaRidleyClawAttackInit(u8 leftArmSlot)
gSpriteData[leftArmSlot].currentAnimationFrame = 0;
gCurrentSprite.pose = MECHA_RIDLEY_POSE_CLAW_ATTACK;
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
gBossWork.work4 = EYE_STATE_BLINKING_INIT;
}
@ -399,14 +399,14 @@ void MechaRidleyInit(void)
yPosition = gSubSpriteData1.yPosition;
xPosition = gSubSpriteData1.xPosition;
gCurrentSprite.drawDistanceTopOffset = 8;
gCurrentSprite.drawDistanceBottomOffset = 8;
gCurrentSprite.drawDistanceHorizontalOffset = 8;
gCurrentSprite.drawDistanceTop = 8;
gCurrentSprite.drawDistanceBottom = 8;
gCurrentSprite.drawDistanceHorizontal = 8;
gCurrentSprite.hitboxTopOffset = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxBottom = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRight = HALF_BLOCK_SIZE;
gCurrentSprite.frozenPaletteRowOffset = 5;
gCurrentSprite.drawOrder = 10;
@ -425,7 +425,7 @@ void MechaRidleyInit(void)
// Set delay before crawling
gCurrentSprite.yPositionSpawn = 60 * 5;
gCurrentSprite.work3 = gSpriteRng;
gCurrentSprite.oamRotation = 0;
gCurrentSprite.rotation = 0;
// Set crawling
gSubSpriteData1.pMultiOam = sMechaRidleyMultiSpriteData_CrawlingForwardLow;
@ -609,11 +609,11 @@ u8 MechaRidleyCheckStartFireballAttack(u8 ramSlot)
{
if (!(gCurrentSprite.work3 & 0x3F))
{
if (!(gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400) && gSpriteRng < 8)
if (!(gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN) && gSpriteRng < 8)
MechaRidleyClawAttackInit(ramSlot); // Start claw attack
else
{
gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_DOWN;
if (gSubSpriteData1.workVariable3 == HEALTH_THRESHOLD_COVER_DAMAGED && gBossWork.work6 == 0)
{
@ -1297,14 +1297,14 @@ void MechaRidleyPartInit(void)
switch (gCurrentSprite.roomSlot)
{
case MECHA_RIDLEY_PART_RIGHT_ARM:
gCurrentSprite.drawDistanceTopOffset = 0x18;
gCurrentSprite.drawDistanceBottomOffset = 0x38;
gCurrentSprite.drawDistanceHorizontalOffset = 0x58;
gCurrentSprite.drawDistanceTop = 0x18;
gCurrentSprite.drawDistanceBottom = 0x38;
gCurrentSprite.drawDistanceHorizontal = 0x58;
gCurrentSprite.hitboxTopOffset = -4;
gCurrentSprite.hitboxBottomOffset = 4;
gCurrentSprite.hitboxLeftOffset = -4;
gCurrentSprite.hitboxRightOffset = 4;
gCurrentSprite.hitboxTop = -4;
gCurrentSprite.hitboxBottom = 4;
gCurrentSprite.hitboxLeft = -4;
gCurrentSprite.hitboxRight = 4;
gCurrentSprite.properties |= SP_IMMUNE_TO_PROJECTILES;
gCurrentSprite.drawOrder = 0x3;
@ -1312,14 +1312,14 @@ void MechaRidleyPartInit(void)
break;
case MECHA_RIDLEY_PART_LEFT_ARM:
gCurrentSprite.drawDistanceTopOffset = 0x50;
gCurrentSprite.drawDistanceBottomOffset = 0x38;
gCurrentSprite.drawDistanceHorizontalOffset = 0x70;
gCurrentSprite.drawDistanceTop = 0x50;
gCurrentSprite.drawDistanceBottom = 0x38;
gCurrentSprite.drawDistanceHorizontal = 0x70;
gCurrentSprite.hitboxTopOffset = -4;
gCurrentSprite.hitboxBottomOffset = 4;
gCurrentSprite.hitboxLeftOffset = -4;
gCurrentSprite.hitboxRightOffset = 4;
gCurrentSprite.hitboxTop = -4;
gCurrentSprite.hitboxBottom = 4;
gCurrentSprite.hitboxLeft = -4;
gCurrentSprite.hitboxRight = 4;
gCurrentSprite.properties |= SP_IMMUNE_TO_PROJECTILES;
gCurrentSprite.drawOrder = 0xD;
@ -1327,14 +1327,14 @@ void MechaRidleyPartInit(void)
break;
case MECHA_RIDLEY_PART_EYE:
gCurrentSprite.drawDistanceTopOffset = 8;
gCurrentSprite.drawDistanceBottomOffset = 8;
gCurrentSprite.drawDistanceHorizontalOffset = 8;
gCurrentSprite.drawDistanceTop = 8;
gCurrentSprite.drawDistanceBottom = 8;
gCurrentSprite.drawDistanceHorizontal = 8;
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.drawOrder = 0x4;
@ -1343,14 +1343,14 @@ void MechaRidleyPartInit(void)
break;
case MECHA_RIDLEY_PART_HEAD:
gCurrentSprite.drawDistanceTopOffset = 0x28;
gCurrentSprite.drawDistanceBottomOffset = 0x28;
gCurrentSprite.drawDistanceHorizontalOffset = 0x38;
gCurrentSprite.drawDistanceTop = 0x28;
gCurrentSprite.drawDistanceBottom = 0x28;
gCurrentSprite.drawDistanceHorizontal = 0x38;
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxBottomOffset = (BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxLeftOffset = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxBottom = (BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxLeft = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRight = HALF_BLOCK_SIZE;
gCurrentSprite.health = 0x1;
gCurrentSprite.properties |= SP_IMMUNE_TO_PROJECTILES;
@ -1364,14 +1364,14 @@ void MechaRidleyPartInit(void)
break;
case MECHA_RIDLEY_PART_NECK:
gCurrentSprite.drawDistanceTopOffset = 0x30;
gCurrentSprite.drawDistanceBottomOffset = 0x20;
gCurrentSprite.drawDistanceHorizontalOffset = 0x40;
gCurrentSprite.drawDistanceTop = 0x30;
gCurrentSprite.drawDistanceBottom = 0x20;
gCurrentSprite.drawDistanceHorizontal = 0x40;
gCurrentSprite.hitboxTopOffset = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxBottom = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRight = HALF_BLOCK_SIZE;
gCurrentSprite.health = 0x1;
gCurrentSprite.properties |= SP_IMMUNE_TO_PROJECTILES;
@ -1380,14 +1380,14 @@ void MechaRidleyPartInit(void)
break;
case MECHA_RIDLEY_PART_COVER:
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x10;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x10;
gCurrentSprite.drawDistanceHorizontal = 0x10;
gCurrentSprite.hitboxTopOffset = -0x28;
gCurrentSprite.hitboxBottomOffset = BLOCK_SIZE - QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -(BLOCK_SIZE - QUARTER_BLOCK_SIZE);
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE;
gCurrentSprite.hitboxTop = -0x28;
gCurrentSprite.hitboxBottom = BLOCK_SIZE - QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -(BLOCK_SIZE - QUARTER_BLOCK_SIZE);
gCurrentSprite.hitboxRight = BLOCK_SIZE;
gCurrentSprite.health = GET_SSPRITE_HEALTH(gCurrentSprite.spriteId);
@ -1404,28 +1404,28 @@ void MechaRidleyPartInit(void)
break;
case MECHA_RIDLEY_PART_TORSO:
gCurrentSprite.drawDistanceTopOffset = 0x28;
gCurrentSprite.drawDistanceBottomOffset = 0x18;
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.drawDistanceTop = 0x28;
gCurrentSprite.drawDistanceBottom = 0x18;
gCurrentSprite.drawDistanceHorizontal = 0x18;
gCurrentSprite.hitboxTopOffset = -BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE;
gCurrentSprite.hitboxTop = -BLOCK_SIZE;
gCurrentSprite.hitboxBottom = BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxRight = BLOCK_SIZE;
gCurrentSprite.properties |= SP_IMMUNE_TO_PROJECTILES;
gCurrentSprite.drawOrder = 11;
break;
case MECHA_RIDLEY_PART_WAISTBAND:
gCurrentSprite.drawDistanceTopOffset = 0x18;
gCurrentSprite.drawDistanceBottomOffset = 0x18;
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.drawDistanceTop = 0x18;
gCurrentSprite.drawDistanceBottom = 0x18;
gCurrentSprite.drawDistanceHorizontal = 0x18;
gCurrentSprite.hitboxTopOffset = -BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE;
gCurrentSprite.hitboxTop = -BLOCK_SIZE;
gCurrentSprite.hitboxBottom = BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -BLOCK_SIZE;
gCurrentSprite.hitboxRight = BLOCK_SIZE;
gCurrentSprite.health = 1;
gCurrentSprite.properties |= SP_IMMUNE_TO_PROJECTILES;
@ -1433,14 +1433,14 @@ void MechaRidleyPartInit(void)
break;
case MECHA_RIDLEY_PART_TAIL:
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x30;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x10;
gCurrentSprite.drawDistanceHorizontal = 0x30;
gCurrentSprite.hitboxTopOffset = -BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -(BLOCK_SIZE * 3);
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE * 3;
gCurrentSprite.hitboxTop = -BLOCK_SIZE;
gCurrentSprite.hitboxBottom = BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -(BLOCK_SIZE * 3);
gCurrentSprite.hitboxRight = BLOCK_SIZE * 3;
gCurrentSprite.health = 1;
gCurrentSprite.properties |= SP_IMMUNE_TO_PROJECTILES;
@ -1448,14 +1448,14 @@ void MechaRidleyPartInit(void)
break;
case MECHA_RIDLEY_PART_MISSILE_LAUNCHER:
gCurrentSprite.drawDistanceTopOffset = 0x20;
gCurrentSprite.drawDistanceBottomOffset = 0x20;
gCurrentSprite.drawDistanceHorizontalOffset = 0x20;
gCurrentSprite.drawDistanceTop = 0x20;
gCurrentSprite.drawDistanceBottom = 0x20;
gCurrentSprite.drawDistanceHorizontal = 0x20;
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxBottomOffset = BLOCK_SIZE + HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE + HALF_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxBottom = BLOCK_SIZE + HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxRight = BLOCK_SIZE + HALF_BLOCK_SIZE;
gCurrentSprite.health = 1;
gCurrentSprite.properties |= SP_IMMUNE_TO_PROJECTILES;
@ -1912,12 +1912,12 @@ void MechaRidleyPartRightArmIdle(void)
}
}
gCurrentSprite.hitboxTopOffset = topHitbox;
gCurrentSprite.hitboxBottomOffset = bottomHitbox;
gCurrentSprite.hitboxLeftOffset = leftHitbox;
gCurrentSprite.hitboxTop = topHitbox;
gCurrentSprite.hitboxBottom = bottomHitbox;
gCurrentSprite.hitboxLeft = leftHitbox;
rHitbox = rightHitbox;
gCurrentSprite.hitboxRightOffset = rHitbox;
gCurrentSprite.hitboxRight = rHitbox;
}
/**
@ -2119,10 +2119,10 @@ void MechaRidleyPartLeftArmIdle(void)
}
}
gCurrentSprite.hitboxTopOffset = topHitbox;
gCurrentSprite.hitboxBottomOffset = bottomHitbox;
gCurrentSprite.hitboxLeftOffset = leftHitbox;
gCurrentSprite.hitboxRightOffset = rightHitbox;
gCurrentSprite.hitboxTop = topHitbox;
gCurrentSprite.hitboxBottom = bottomHitbox;
gCurrentSprite.hitboxLeft = leftHitbox;
gCurrentSprite.hitboxRight = rightHitbox;
}
/**
@ -2321,12 +2321,12 @@ void MechaRidleyPartNeckIdle(void)
}
}
gCurrentSprite.hitboxTopOffset = topHitbox;
gCurrentSprite.hitboxBottomOffset = bottomHitbox;
gCurrentSprite.hitboxLeftOffset = leftHitbox;
gCurrentSprite.hitboxTop = topHitbox;
gCurrentSprite.hitboxBottom = bottomHitbox;
gCurrentSprite.hitboxLeft = leftHitbox;
rHitbox = rightHitbox;
gCurrentSprite.hitboxRightOffset = rHitbox;
gCurrentSprite.hitboxRight = rHitbox;
}
/**
@ -2352,15 +2352,15 @@ void MechaRidley(void)
if (samusY > spriteY)
{
if (gCurrentSprite.oamRotation == 0)
if (gCurrentSprite.rotation == 0)
{
if (gBossWork.work3 != MECHA_RIDLEY_SAMUS_POSITION_LOW)
gCurrentSprite.oamRotation = 120;
gCurrentSprite.rotation = 120;
}
else
{
gCurrentSprite.oamRotation--;
if (gCurrentSprite.oamRotation == 0)
gCurrentSprite.rotation--;
if (gCurrentSprite.rotation == 0)
gBossWork.work3 = MECHA_RIDLEY_SAMUS_POSITION_LOW;
}
}
@ -2370,15 +2370,15 @@ void MechaRidley(void)
gBossWork.work3 = MECHA_RIDLEY_SAMUS_POSITION_HIGH;
else if (gBossWork.work3 != MECHA_RIDLEY_SAMUS_POSITION_LOW)
{
if (gCurrentSprite.oamRotation == 0)
if (gCurrentSprite.rotation == 0)
{
if (gBossWork.work3 != MECHA_RIDLEY_SAMUS_POSITION_MIDDLE)
gCurrentSprite.oamRotation = 120;
gCurrentSprite.rotation = 120;
}
else
{
gCurrentSprite.oamRotation--;
if (gCurrentSprite.oamRotation == 0)
gCurrentSprite.rotation--;
if (gCurrentSprite.rotation == 0)
gBossWork.work3 = MECHA_RIDLEY_SAMUS_POSITION_MIDDLE;
}
}
@ -2517,7 +2517,7 @@ void MechaRidleyPart(void)
if (gSpriteData[ramSlot].pose > 0x61)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.invincibilityStunFlashTimer = gSpriteData[ramSlot].invincibilityStunFlashTimer;
@ -2705,14 +2705,14 @@ void MechaRidleyLaser(void)
{
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = 8;
gCurrentSprite.drawDistanceBottomOffset = 8;
gCurrentSprite.drawDistanceHorizontalOffset = 8;
gCurrentSprite.drawDistanceTop = 8;
gCurrentSprite.drawDistanceBottom = 8;
gCurrentSprite.drawDistanceHorizontal = 8;
gCurrentSprite.hitboxTopOffset = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxBottom = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRight = HALF_BLOCK_SIZE;
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
gCurrentSprite.drawOrder = 3;
@ -2796,22 +2796,22 @@ void MechaRidleyMissile(void)
case 0:
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_80;
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x10;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x10;
gCurrentSprite.drawDistanceHorizontal = 0x10;
gCurrentSprite.hitboxTopOffset = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxBottom = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRight = HALF_BLOCK_SIZE;
gCurrentSprite.pOam = sMechaRidleyMissileOam;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.health = GET_SSPRITE_HEALTH(gCurrentSprite.spriteId);
gCurrentSprite.oamRotation = 0xA0;
gCurrentSprite.oamScaling = Q_8_8(1.f);
gCurrentSprite.rotation = 0xA0;
gCurrentSprite.scaling = Q_8_8(1.f);
gCurrentSprite.work0 = 30;
gCurrentSprite.pose = 9;
@ -2835,7 +2835,7 @@ void MechaRidleyMissile(void)
if (movement < 3)
{
gCurrentSprite.oamRotation = SpriteUtilMakeSpriteFaceSamusRotation(gCurrentSprite.oamRotation,
gCurrentSprite.rotation = SpriteUtilMakeSpriteFaceSamusRotation(gCurrentSprite.rotation,
gSamusData.yPosition - BLOCK_SIZE, gSamusData.xPosition,
gCurrentSprite.yPosition, gCurrentSprite.xPosition);
}
@ -2861,7 +2861,7 @@ void MechaRidleyMissile(void)
SpriteUtilMoveSpriteTowardsSamus(gSamusData.yPosition - HALF_BLOCK_SIZE, gSamusData.xPosition, 0x28, 0x28, 2);
gCurrentSprite.oamRotation = SpriteUtilMakeSpriteFaceSamusRotation(gCurrentSprite.oamRotation,
gCurrentSprite.rotation = SpriteUtilMakeSpriteFaceSamusRotation(gCurrentSprite.rotation,
gSamusData.yPosition - movement, gSamusData.xPosition,
gCurrentSprite.yPosition, gCurrentSprite.xPosition);
@ -2902,14 +2902,14 @@ void MechaRidleyFireball(void)
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_80;
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = 0x14;
gCurrentSprite.drawDistanceBottomOffset = 0x14;
gCurrentSprite.drawDistanceHorizontalOffset = 0x14;
gCurrentSprite.drawDistanceTop = 0x14;
gCurrentSprite.drawDistanceBottom = 0x14;
gCurrentSprite.drawDistanceHorizontal = 0x14;
gCurrentSprite.hitboxTopOffset = -0x1C;
gCurrentSprite.hitboxBottomOffset = 0x1C;
gCurrentSprite.hitboxLeftOffset = -0x1C;
gCurrentSprite.hitboxRightOffset = 0x1C;
gCurrentSprite.hitboxTop = -0x1C;
gCurrentSprite.hitboxBottom = 0x1C;
gCurrentSprite.hitboxLeft = -0x1C;
gCurrentSprite.hitboxRight = 0x1C;
gCurrentSprite.pOam = sMechaRidleyFireballOam;
gCurrentSprite.animationDurationCounter = 0;
@ -2921,12 +2921,12 @@ void MechaRidleyFireball(void)
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS_STOP_DIES_WHEN_HIT;
gCurrentSprite.drawOrder = 2;
gCurrentSprite.oamScaling = Q_8_8(1.f);
gCurrentSprite.scaling = Q_8_8(1.f);
if (gCurrentSprite.roomSlot != FIREBALL_LOW)
gCurrentSprite.oamRotation = 0x28;
gCurrentSprite.rotation = 0x28;
else
gCurrentSprite.oamRotation = 0;
gCurrentSprite.rotation = 0;
gBossWork.work8++;
break;

View File

@ -110,14 +110,14 @@ u8 MellaXMovement(u16 movement)
*/
void MellaInit(void)
{
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxBottom = QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRight = HALF_BLOCK_SIZE;
gCurrentSprite.pOam = sMellaOAM_Idle;
gCurrentSprite.animationDurationCounter = 0;

View File

@ -110,7 +110,7 @@ void MetroidMove(u16 dstY, u16 dstX, u8 ySpeedCap, u8 xSpeedCap, u8 speedDivisor
}
// Check for Y collision
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
SpriteUtilCheckCollisionAtPosition(yPosition + (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2), xPosition - HALF_BLOCK_SIZE);
if (gPreviousCollisionCheck != COLLISION_AIR)
@ -218,7 +218,7 @@ void MetroidMove(u16 dstY, u16 dstX, u8 ySpeedCap, u8 xSpeedCap, u8 speedDivisor
}
bouncing = 0;
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
if (!hittingSolidY)
{
@ -288,7 +288,7 @@ void MetroidMove(u16 dstY, u16 dstX, u8 ySpeedCap, u8 xSpeedCap, u8 speedDivisor
if (bouncing)
{
// Bouncing, flip
gCurrentSprite.status ^= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status ^= SPRITE_STATUS_FACING_DOWN;
if (bouncing == 2)
{
// Set bouncing speed
@ -325,10 +325,10 @@ u8 MetroidBombDetection(void)
spriteY = gCurrentSprite.yPosition;
spriteX = gCurrentSprite.xPosition;
spriteTop = spriteY + gCurrentSprite.hitboxTopOffset;
spriteBottom = spriteY + gCurrentSprite.hitboxBottomOffset;
spriteLeft = spriteX + gCurrentSprite.hitboxLeftOffset;
spriteRight = spriteX + gCurrentSprite.hitboxRightOffset;
spriteTop = spriteY + gCurrentSprite.hitboxTop;
spriteBottom = spriteY + gCurrentSprite.hitboxBottom;
spriteLeft = spriteX + gCurrentSprite.hitboxLeft;
spriteRight = spriteX + gCurrentSprite.hitboxRight;
status = PROJ_STATUS_EXISTS | PROJ_STATUS_CAN_AFFECT_ENVIRONMENT;
for (i = 0; i < MAX_AMOUNT_OF_PROJECTILES; i++)
@ -338,10 +338,10 @@ u8 MetroidBombDetection(void)
{
projY = pProj->yPosition;
projX = pProj->xPosition;
projTop = projY + pProj->hitboxTopOffset;
projBottom = projY + pProj->hitboxBottomOffset;
projLeft = projX + pProj->hitboxLeftOffset;
projRight = projX + pProj->hitboxRightOffset;
projTop = projY + pProj->hitboxTop;
projBottom = projY + pProj->hitboxBottom;
projLeft = projX + pProj->hitboxLeft;
projRight = projX + pProj->hitboxRight;
if (SpriteUtilCheckObjectsTouching(spriteTop, spriteBottom, spriteLeft, spriteRight, projTop, projBottom, projLeft, projRight))
return TRUE;
@ -417,7 +417,7 @@ void MetroidCheckBouncingOnMetroid(u16 movement)
gSpriteData[ramSlot].xPosition) == COLLISION_AIR)
{
gSpriteData[ramSlot].yPosition -= movement;
gSpriteData[ramSlot].status &= ~SPRITE_STATUS_UNKNOWN_400;
gSpriteData[ramSlot].status &= ~SPRITE_STATUS_FACING_DOWN;
gSpriteData[ramSlot].work0 = 0;
gSpriteData[ramSlot].work3 = movement * 16;
}
@ -428,7 +428,7 @@ void MetroidCheckBouncingOnMetroid(u16 movement)
gSpriteData[ramSlot].xPosition) == COLLISION_AIR)
{
gSpriteData[ramSlot].yPosition += movement;
gSpriteData[ramSlot].status |= SPRITE_STATUS_UNKNOWN_400;
gSpriteData[ramSlot].status |= SPRITE_STATUS_FACING_DOWN;
gSpriteData[ramSlot].work0 = 0;
gSpriteData[ramSlot].work3 = movement * 16;
}
@ -555,17 +555,17 @@ void MetroidInit(void)
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_80;
gCurrentSprite.oamScaling = Q_8_8(.25f);
gCurrentSprite.oamRotation = 0;
gCurrentSprite.scaling = Q_8_8(.25f);
gCurrentSprite.rotation = 0;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxTopOffset = -(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxBottomOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxRightOffset = (HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxTop = -(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxBottom = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxRight = (HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.pOam = sMetroidOAM_Spanwing;
gCurrentSprite.animationDurationCounter = 0;
@ -601,9 +601,9 @@ void MetroidCheckSpawn(void)
// Set spawning behavior
gCurrentSprite.pose = METROID_POSE_SPAWNING;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + QUARTER_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + QUARTER_BLOCK_SIZE);
gCurrentSprite.work0 = gSpriteRng * 4 + 1;
}
@ -646,15 +646,15 @@ void MetroidSpawning(void)
return;
}
if (gCurrentSprite.oamScaling < Q_8_8(1.f))
if (gCurrentSprite.scaling < Q_8_8(1.f))
{
// Make metroid bigger
gCurrentSprite.oamScaling += Q_8_8(.0175f);
gCurrentSprite.scaling += Q_8_8(.0175f);
// Update palette accordingly
if (gCurrentSprite.oamScaling >= Q_8_8(.82f))
if (gCurrentSprite.scaling >= Q_8_8(.82f))
gCurrentSprite.paletteRow = 1;
else if (gCurrentSprite.oamScaling >= Q_8_8(.63f))
else if (gCurrentSprite.scaling >= Q_8_8(.63f))
gCurrentSprite.paletteRow = 2;
}
else
@ -718,7 +718,7 @@ void MetroidMovement(void)
// Move
MetroidCheckBouncingOnMetroid(1);
MetroidMove(gSamusData.yPosition + gSamusPhysics.drawDistanceTopOffset, gSamusData.xPosition,
MetroidMove(gSamusData.yPosition + gSamusPhysics.drawDistanceTop, gSamusData.xPosition,
HALF_BLOCK_SIZE - PIXEL_SIZE / 2, HALF_BLOCK_SIZE + PIXEL_SIZE * 2, 2);
}
@ -738,7 +738,7 @@ void MetroidSamusGrabbedInit(void)
gCurrentSprite.work1 = 4;
gCurrentSprite.frozenPaletteRowOffset = 4;
gCurrentSprite.oamRotation = 0;
gCurrentSprite.rotation = 0;
gEquipment.grabbedByMetroid = TRUE;
}
@ -772,7 +772,7 @@ void MetroidSamusGrabbed(void)
else
gCurrentSprite.xPosition = gSamusData.xPosition;
gCurrentSprite.yPosition = gSamusData.yPosition + gSamusPhysics.drawDistanceTopOffset;
gCurrentSprite.yPosition = gSamusData.yPosition + gSamusPhysics.drawDistanceTop;
if (MetroidBombDetection())
{
@ -785,9 +785,9 @@ void MetroidSamusGrabbed(void)
// Set moving behavior
gCurrentSprite.pose = METROID_POSE_MOVING;
gCurrentSprite.paletteRow = 0;
gCurrentSprite.ignoreSamusCollisionTimer = 15;
gCurrentSprite.ignoreSamusCollisionTimer = CONVERT_SECONDS(.25f);
gCurrentSprite.status &= ~(SPRITE_STATUS_UNKNOWN_400 | SPRITE_STATUS_IGNORE_PROJECTILES);
gCurrentSprite.status &= ~(SPRITE_STATUS_FACING_DOWN | SPRITE_STATUS_IGNORE_PROJECTILES);
gCurrentSprite.work0 = 0;
gCurrentSprite.work3 = velocity;
gCurrentSprite.work1 = 0;
@ -803,7 +803,7 @@ void MetroidSamusGrabbed(void)
else
{
// Check play sucking sound
if (MOD_AND(gCurrentSprite.oamRotation, 32) == 0)
if (MOD_AND(gCurrentSprite.rotation, 32) == 0)
{
SoundPlayNotAlreadyPlaying(0x81);
@ -819,7 +819,7 @@ void MetroidSamusGrabbed(void)
SoundPlay(0x16E);
}
gCurrentSprite.oamRotation++; // Sound counter
gCurrentSprite.rotation++; // Sound counter
}
}
@ -942,10 +942,10 @@ void Metroid(void)
if (gCurrentSprite.freezeTimer != 0)
{
// Set frozen metroid behavior
gCurrentSprite.hitboxTopOffset = -(QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.hitboxBottomOffset = HALF_BLOCK_SIZE + PIXEL_SIZE * 2;
gCurrentSprite.hitboxLeftOffset = -BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE;
gCurrentSprite.hitboxTop = -(QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.hitboxBottom = HALF_BLOCK_SIZE + PIXEL_SIZE * 2;
gCurrentSprite.hitboxLeft = -BLOCK_SIZE;
gCurrentSprite.hitboxRight = BLOCK_SIZE;
MetroidCheckBouncingOnMetroid(1);
@ -961,10 +961,10 @@ void Metroid(void)
if (gCurrentSprite.spriteId == PSPRITE_FROZEN_METROID)
{
// Unfreeze, set movement behavior
gCurrentSprite.hitboxTopOffset = -(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxBottomOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxRightOffset = (HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxTop = -(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxBottom = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxRight = (HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.spriteId = PSPRITE_METROID;
@ -1019,7 +1019,7 @@ void MetroidShell(void)
u16 xPosition;
slot = gCurrentSprite.primarySpriteRamSlot;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.paletteRow = gSpriteData[slot].paletteRow;
if (gSpriteData[slot].health == 0)
@ -1043,14 +1043,14 @@ void MetroidShell(void)
{
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + QUARTER_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + QUARTER_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxBottomOffset = PIXEL_SIZE;
gCurrentSprite.hitboxLeftOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxRightOffset = PIXEL_SIZE;
gCurrentSprite.hitboxTop = -PIXEL_SIZE;
gCurrentSprite.hitboxBottom = PIXEL_SIZE;
gCurrentSprite.hitboxLeft = -PIXEL_SIZE;
gCurrentSprite.hitboxRight = PIXEL_SIZE;
gCurrentSprite.pose = 0x9;
gCurrentSprite.drawOrder = 3;
@ -1073,21 +1073,21 @@ void MetroidShell(void)
*/
void MetroidDoorLock(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gCurrentSprite.pose == SPRITE_POSE_UNINITIALIZED)
{
gCurrentSprite.status |= SPRITE_STATUS_NOT_DRAWN | SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.pose = 0x8;

View File

@ -23,14 +23,14 @@ void MorphBallInit(void)
}
gCurrentSprite.properties |= SP_IMMUNE_TO_PROJECTILES;
gCurrentSprite.hitboxTopOffset = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxBottomOffset = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxLeftOffset = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxRightOffset = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxTop = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxBottom = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxLeft = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxRight = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.pOam = sMorphBallOam_Idle;
gCurrentSprite.animationDurationCounter = 0;
@ -57,7 +57,7 @@ void MorphBallGet(void)
{
gPreventMovementTimer = SAMUS_ITEM_PMT;
gCurrentSprite.properties |= SP_ALWAYS_ACTIVE;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.pose = MORPH_BALL_POSE_BEING_ACQUIRED;
@ -76,7 +76,7 @@ void MorphBallGet(void)
*/
void MorphBallFlashAnim(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
// Flicker (timer will always be 0 though)
if (MOD_AND(gCurrentSprite.work0, 2) == 0)
@ -93,14 +93,14 @@ void MorphBallFlashAnim(void)
*/
void MorphBallOutsideInit(void)
{
gCurrentSprite.hitboxTopOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxBottomOffset = PIXEL_SIZE;
gCurrentSprite.hitboxLeftOffset = -PIXEL_SIZE;
gCurrentSprite.hitboxRightOffset = PIXEL_SIZE;
gCurrentSprite.hitboxTop = -PIXEL_SIZE;
gCurrentSprite.hitboxBottom = PIXEL_SIZE;
gCurrentSprite.hitboxLeft = -PIXEL_SIZE;
gCurrentSprite.hitboxRight = PIXEL_SIZE;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.pOam = sMorphBallOutsideOam_Idle;
gCurrentSprite.animationDurationCounter = 0;
@ -154,7 +154,7 @@ void MorphBall(void)
*/
void MorphBallOutside(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{

View File

@ -56,14 +56,14 @@ void MorphBallLauncherInit(void)
{
gCurrentSprite.yPosition -= HALF_BLOCK_SIZE;
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.samusCollision = SSC_NONE;
@ -180,7 +180,7 @@ void MorphBallLauncherLaunchSamus(void)
*/
void MorphBallLauncher(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
@ -217,17 +217,17 @@ void MorphBallLauncherPart(void)
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
if (gCurrentSprite.roomSlot == MORPH_BALL_LAUNCHER_PART_BACK)
{
gCurrentSprite.pOam = sMorphBallLauncherPartOam_Back;
gCurrentSprite.drawDistanceTopOffset = PIXEL_SIZE * 2;
gCurrentSprite.drawDistanceBottomOffset = 0;
gCurrentSprite.drawDistanceHorizontalOffset = QUARTER_BLOCK_SIZE;
gCurrentSprite.drawDistanceTop = PIXEL_SIZE * 2;
gCurrentSprite.drawDistanceBottom = 0;
gCurrentSprite.drawDistanceHorizontal = QUARTER_BLOCK_SIZE;
gCurrentSprite.bgPriority = MOD_AND(MOD_AND(gIoRegistersBackup.BG1CNT, 4) + 1, 4);
gCurrentSprite.drawOrder = 12;
@ -236,9 +236,9 @@ void MorphBallLauncherPart(void)
else if (gCurrentSprite.roomSlot == MORPH_BALL_LAUNCHER_PART_ENERGY)
{
gCurrentSprite.pOam = sMorphBallLauncherPartOam_Energy;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.bgPriority = MOD_AND(gIoRegistersBackup.BG1CNT, 4);
gCurrentSprite.drawOrder = 1;

View File

@ -56,18 +56,18 @@ void MotherBrainUpdatePalette(void)
u8 offset;
u8 newTimer;
if (gCurrentSprite.oamScaling != 0)
if (gCurrentSprite.scaling != 0)
{
gCurrentSprite.oamScaling--;
gCurrentSprite.paletteRow = sMotherBrainDynamicPaletteData[gCurrentSprite.oamRotation][0];
gCurrentSprite.scaling--;
gCurrentSprite.paletteRow = sMotherBrainDynamicPaletteData[gCurrentSprite.rotation][0];
}
else
{
offset = gCurrentSprite.oamRotation++;
offset = gCurrentSprite.rotation++;
timer = sMotherBrainDynamicPaletteData[offset][0];
if (timer == 0x80)
{
gCurrentSprite.oamRotation = 0x1;
gCurrentSprite.rotation = 0x1;
offset = 0;
timer = sMotherBrainDynamicPaletteData[offset][0];
}
@ -77,7 +77,7 @@ void MotherBrainUpdatePalette(void)
SoundPlay(0x2BB);
gCurrentSprite.paletteRow = timer;
gCurrentSprite.oamScaling = newTimer;
gCurrentSprite.scaling = newTimer;
}
}
@ -108,22 +108,22 @@ void MotherBrainInit(void)
gBossWork.work4 = 0;
gBossWork.work5 = 0;
gCurrentSprite.drawDistanceTopOffset = 0x28;
gCurrentSprite.drawDistanceBottomOffset = 0x20;
gCurrentSprite.drawDistanceHorizontalOffset = 0x30;
gCurrentSprite.drawDistanceTop = 0x28;
gCurrentSprite.drawDistanceBottom = 0x20;
gCurrentSprite.drawDistanceHorizontal = 0x30;
gCurrentSprite.hitboxTopOffset = -0x70;
gCurrentSprite.hitboxBottomOffset = 0x60;
gCurrentSprite.hitboxLeftOffset = -0xA0;
gCurrentSprite.hitboxRightOffset = 0x80;
gCurrentSprite.hitboxTop = -0x70;
gCurrentSprite.hitboxBottom = 0x60;
gCurrentSprite.hitboxLeft = -0xA0;
gCurrentSprite.hitboxRight = 0x80;
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
gCurrentSprite.health = GET_PSPRITE_HEALTH(gCurrentSprite.spriteId);
gCurrentSprite.properties |= SP_IMMUNE_TO_PROJECTILES;
gCurrentSprite.work0 = 0;
gCurrentSprite.work1 = 0;
gCurrentSprite.oamScaling = 0;
gCurrentSprite.oamRotation = 0;
gCurrentSprite.scaling = 0;
gCurrentSprite.rotation = 0;
gCurrentSprite.work2 = 0;
gSubSpriteData1.pMultiOam = sMotherBrainMultiSpriteData;
@ -294,8 +294,8 @@ void MotherBrainMainLoop(void)
gCurrentSprite.work1 = 0x48;
gCurrentSprite.work0 = 0x48;
gCurrentSprite.oamScaling = 0;
gCurrentSprite.oamRotation = 0;
gCurrentSprite.scaling = 0;
gCurrentSprite.rotation = 0;
}
}
}
@ -439,14 +439,14 @@ void MotherBrainPartInit(void)
switch (gCurrentSprite.roomSlot)
{
case MOTHER_BRAIN_PART_BEAM_SHOOTER:
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x40;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x10;
gCurrentSprite.drawDistanceHorizontal = 0x40;
gCurrentSprite.hitboxTopOffset = -0x4;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = -0x4,
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.hitboxTop = -0x4;
gCurrentSprite.hitboxBottom = 0x4;
gCurrentSprite.hitboxLeft = -0x4,
gCurrentSprite.hitboxRight = 0x4;
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
gCurrentSprite.drawOrder = 0x3;
@ -459,14 +459,14 @@ void MotherBrainPartInit(void)
case MOTHER_BRAIN_PART_EYE:
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x10;
gCurrentSprite.drawDistanceHorizontal = 0x18;
gCurrentSprite.hitboxTopOffset = -0x28;
gCurrentSprite.hitboxBottomOffset = 0x20;
gCurrentSprite.hitboxLeftOffset = -0x20;
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.hitboxTop = -0x28;
gCurrentSprite.hitboxBottom = 0x20;
gCurrentSprite.hitboxLeft = -0x20;
gCurrentSprite.hitboxRight = 0x4;
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
gCurrentSprite.drawOrder = 0x5;
@ -475,14 +475,14 @@ void MotherBrainPartInit(void)
case MOTHER_BRAIN_PART_BOTTOM:
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x14;
gCurrentSprite.drawDistanceHorizontalOffset = 0x20;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x14;
gCurrentSprite.drawDistanceHorizontal = 0x20;
gCurrentSprite.hitboxTopOffset = -0xF8;
gCurrentSprite.hitboxBottomOffset = 0x20;
gCurrentSprite.hitboxLeftOffset = -0xB0;
gCurrentSprite.hitboxRightOffset = 0xB0;
gCurrentSprite.hitboxTop = -0xF8;
gCurrentSprite.hitboxBottom = 0x20;
gCurrentSprite.hitboxLeft = -0xB0;
gCurrentSprite.hitboxRight = 0xB0;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.drawOrder = 0x6;
@ -506,7 +506,7 @@ void MotherBrainPartHitboxInit(void)
{
if (gCurrentSprite.status & SPRITE_STATUS_NOT_DRAWN)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
}
else
@ -515,31 +515,31 @@ void MotherBrainPartHitboxInit(void)
switch (gCurrentSprite.currentAnimationFrame)
{
case 0x1:
gCurrentSprite.hitboxTopOffset = -0x10;
gCurrentSprite.hitboxBottomOffset = 0x10;
gCurrentSprite.hitboxLeftOffset = 0x20;
gCurrentSprite.hitboxRightOffset = 0x60;
gCurrentSprite.hitboxTop = -0x10;
gCurrentSprite.hitboxBottom = 0x10;
gCurrentSprite.hitboxLeft = 0x20;
gCurrentSprite.hitboxRight = 0x60;
break;
case 0x2:
gCurrentSprite.hitboxTopOffset = -0x20;
gCurrentSprite.hitboxBottomOffset = 0x20;
gCurrentSprite.hitboxLeftOffset = 0x40;
gCurrentSprite.hitboxRightOffset = 0xA0;
gCurrentSprite.hitboxTop = -0x20;
gCurrentSprite.hitboxBottom = 0x20;
gCurrentSprite.hitboxLeft = 0x40;
gCurrentSprite.hitboxRight = 0xA0;
break;
case 0x3:
gCurrentSprite.hitboxTopOffset = -0x30;
gCurrentSprite.hitboxBottomOffset = 0x30;
gCurrentSprite.hitboxLeftOffset = 0xA0;
gCurrentSprite.hitboxRightOffset = 0xE0;
gCurrentSprite.hitboxTop = -0x30;
gCurrentSprite.hitboxBottom = 0x30;
gCurrentSprite.hitboxLeft = 0xA0;
gCurrentSprite.hitboxRight = 0xE0;
break;
default:
gCurrentSprite.hitboxTopOffset = -0x8;
gCurrentSprite.hitboxBottomOffset = 0x8;
gCurrentSprite.hitboxLeftOffset = -0x4;
gCurrentSprite.hitboxRightOffset = 0x20;
gCurrentSprite.hitboxTop = -0x8;
gCurrentSprite.hitboxBottom = 0x8;
gCurrentSprite.hitboxLeft = -0x4;
gCurrentSprite.hitboxRight = 0x20;
}
}
}
@ -773,7 +773,7 @@ void MotherBrainBeam(void)
{
if (gSubSpriteData1.workVariable3 > 0x1)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.status ^= SPRITE_STATUS_NOT_DRAWN;
}
@ -783,14 +783,14 @@ void MotherBrainBeam(void)
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.properties |= (SP_KILL_OFF_SCREEN | SP_IMMUNE_TO_PROJECTILES);
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x30;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x10;
gCurrentSprite.drawDistanceHorizontal = 0x30;
gCurrentSprite.hitboxTopOffset = -0x30;
gCurrentSprite.hitboxBottomOffset = 0x30;
gCurrentSprite.hitboxLeftOffset = -0x20;
gCurrentSprite.hitboxRightOffset = 0x20;
gCurrentSprite.hitboxTop = -0x30;
gCurrentSprite.hitboxBottom = 0x30;
gCurrentSprite.hitboxLeft = -0x20;
gCurrentSprite.hitboxRight = 0x20;
gCurrentSprite.pOam = sMotherBrainBeamOam_Moving;
gCurrentSprite.animationDurationCounter = 0;
@ -823,14 +823,14 @@ void MotherBrainBlock(void)
{
if (gCurrentSprite.pose == 0)
{
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x8;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x10;
gCurrentSprite.drawDistanceHorizontal = 0x8;
gCurrentSprite.hitboxTopOffset = -0x20;
gCurrentSprite.hitboxBottomOffset = 0x20;
gCurrentSprite.hitboxLeftOffset = -0x20;
gCurrentSprite.hitboxRightOffset = 0x20;
gCurrentSprite.hitboxTop = -0x20;
gCurrentSprite.hitboxBottom = 0x20;
gCurrentSprite.hitboxLeft = -0x20;
gCurrentSprite.hitboxRight = 0x20;
gCurrentSprite.pOam = sMotherBrainBlockOAM;
gCurrentSprite.animationDurationCounter = 0;
@ -868,14 +868,14 @@ void MotherBrainGlassBreaking(void)
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.properties |= SP_KILL_OFF_SCREEN;
gCurrentSprite.drawDistanceTopOffset = 0x30;
gCurrentSprite.drawDistanceBottomOffset = 0x30;
gCurrentSprite.drawDistanceHorizontalOffset = 0x50;
gCurrentSprite.drawDistanceTop = 0x30;
gCurrentSprite.drawDistanceBottom = 0x30;
gCurrentSprite.drawDistanceHorizontal = 0x50;
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.pOam = sMotherBrainGlassBreakingOam_Breaking;
gCurrentSprite.animationDurationCounter = 0;

View File

@ -17,14 +17,14 @@
*/
void MultiviolaInit(void)
{
gCurrentSprite.drawDistanceTopOffset = 0x20;
gCurrentSprite.drawDistanceBottomOffset = 0xC;
gCurrentSprite.drawDistanceHorizontalOffset = 0x10;
gCurrentSprite.drawDistanceTop = 0x20;
gCurrentSprite.drawDistanceBottom = 0xC;
gCurrentSprite.drawDistanceHorizontal = 0x10;
gCurrentSprite.hitboxTopOffset = -0x20;
gCurrentSprite.hitboxBottomOffset = 0x20;
gCurrentSprite.hitboxLeftOffset = -0x20;
gCurrentSprite.hitboxRightOffset = 0x20;
gCurrentSprite.hitboxTop = -0x20;
gCurrentSprite.hitboxBottom = 0x20;
gCurrentSprite.hitboxLeft = -0x20;
gCurrentSprite.hitboxRight = 0x20;
gCurrentSprite.pOam = sMultiviolaOAM_Moving;
gCurrentSprite.animationDurationCounter = 0x0;
@ -51,7 +51,7 @@ void MultiviolaMove(void)
if (gCurrentSprite.status & SPRITE_STATUS_XFLIP)
{
// Move right
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRight);
if (gPreviousCollisionCheck == COLLISION_AIR)
gCurrentSprite.xPosition += 0x3;
else
@ -64,7 +64,7 @@ void MultiviolaMove(void)
else
{
// Move left
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft);
if (gPreviousCollisionCheck == COLLISION_AIR)
gCurrentSprite.xPosition -= 0x3;
else
@ -75,29 +75,29 @@ void MultiviolaMove(void)
}
}
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
// Move up
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxTopOffset, gCurrentSprite.xPosition);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxTop, gCurrentSprite.xPosition);
if (gPreviousCollisionCheck == COLLISION_AIR)
gCurrentSprite.yPosition -= yMovement;
else
{
// Bounce Y
gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_DOWN;
isBouncing++;
}
}
else
{
// Move down
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxBottomOffset, gCurrentSprite.xPosition);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxBottom, gCurrentSprite.xPosition);
if (gPreviousCollisionCheck == COLLISION_AIR)
gCurrentSprite.yPosition += yMovement;
else
{
// Bounce Y
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
isBouncing++;
}
}

View File

@ -55,14 +55,14 @@ void ParasiteInit(struct SpriteData* pSprite)
u16 yPosition;
u16 xPosition;
pSprite->hitboxTopOffset = -0x4;
pSprite->hitboxBottomOffset = 0x0;
pSprite->hitboxLeftOffset = -0x4;
pSprite->hitboxRightOffset = 0x4;
pSprite->hitboxTop = -0x4;
pSprite->hitboxBottom = 0x0;
pSprite->hitboxLeft = -0x4;
pSprite->hitboxRight = 0x4;
pSprite->drawDistanceTopOffset = 0x8;
pSprite->drawDistanceBottomOffset = 0x4;
pSprite->drawDistanceHorizontalOffset = 0x8;
pSprite->drawDistanceTop = 0x8;
pSprite->drawDistanceBottom = 0x4;
pSprite->drawDistanceHorizontal = 0x8;
pSprite->pOam = sParasiteOAM_Idle;
pSprite->animationDurationCounter = 0x0;
@ -129,7 +129,7 @@ void ParasiteGrabSamus(struct SpriteData* pSprite)
pSprite->work0 = 0x0;
// Get samus position
samusY = gSamusData.yPosition + gSamusPhysics.drawDistanceTopOffset;
samusY = gSamusData.yPosition + gSamusPhysics.drawDistanceTop;
samusX = gSamusData.xPosition + gSamusPhysics.drawDistanceLeftOffset;
// Get Y offset
@ -181,7 +181,7 @@ void ParasiteSamusGrabbed(struct SpriteData* pSprite)
// Check update vertical direction
if (pSprite->status & SPRITE_STATUS_YFLIP)
{
if (gSamusData.yPosition + gSamusPhysics.drawDistanceBottomOffset < pSprite->yPosition + 0x8)
if (gSamusData.yPosition + gSamusPhysics.drawDistanceBottom < pSprite->yPosition + 0x8)
{
pSprite->status &= ~SPRITE_STATUS_YFLIP;
pSprite->work0 = gSpriteRng;
@ -189,7 +189,7 @@ void ParasiteSamusGrabbed(struct SpriteData* pSprite)
}
else
{
if (gSamusData.yPosition + gSamusPhysics.drawDistanceTopOffset > pSprite->yPosition - 0x8)
if (gSamusData.yPosition + gSamusPhysics.drawDistanceTop > pSprite->yPosition - 0x8)
{
pSprite->status |= SPRITE_STATUS_YFLIP;
pSprite->work0 = gSpriteRng;
@ -245,7 +245,7 @@ void ParasiteSamusGrabbed(struct SpriteData* pSprite)
pSprite->work0--;
// Get samus position
samusY = gSamusData.yPosition + gSamusPhysics.drawDistanceTopOffset;
samusY = gSamusData.yPosition + gSamusPhysics.drawDistanceTop;
samusX = gSamusData.xPosition + gSamusPhysics.drawDistanceLeftOffset;
// Update position
@ -1123,8 +1123,8 @@ void ParasiteGrabGeron(struct SpriteData* pSprite)
ramSlot = pSprite->work1;
// Get geron position
geronY = gSpriteData[ramSlot].yPosition + gSpriteData[ramSlot].hitboxTopOffset;
geronX = gSpriteData[ramSlot].xPosition + gSpriteData[ramSlot].hitboxLeftOffset;
geronY = gSpriteData[ramSlot].yPosition + gSpriteData[ramSlot].hitboxTop;
geronX = gSpriteData[ramSlot].xPosition + gSpriteData[ramSlot].hitboxLeft;
// Get Y offset
if (pSprite->yPosition < geronY)
@ -1188,7 +1188,7 @@ void ParasiteGeronGrabbed(struct SpriteData* pSprite)
}
else
{
if (gSpriteData[ramSlot].yPosition + gSpriteData[ramSlot].hitboxTopOffset > pSprite->yPosition - 0x8)
if (gSpriteData[ramSlot].yPosition + gSpriteData[ramSlot].hitboxTop > pSprite->yPosition - 0x8)
{
pSprite->status |= SPRITE_STATUS_YFLIP;
pSprite->work0 = gSpriteRng;
@ -1198,7 +1198,7 @@ void ParasiteGeronGrabbed(struct SpriteData* pSprite)
// Check update horizontal direction
if (pSprite->status & SPRITE_STATUS_XFLIP)
{
if (gSpriteData[ramSlot].xPosition + gSpriteData[ramSlot].hitboxRightOffset < pSprite->xPosition + 0x8)
if (gSpriteData[ramSlot].xPosition + gSpriteData[ramSlot].hitboxRight < pSprite->xPosition + 0x8)
{
pSprite->status &= ~SPRITE_STATUS_XFLIP;
pSprite->work0 = gSpriteRng;
@ -1206,7 +1206,7 @@ void ParasiteGeronGrabbed(struct SpriteData* pSprite)
}
else
{
if (gSpriteData[ramSlot].xPosition + gSpriteData[ramSlot].hitboxLeftOffset > pSprite->xPosition - 0x8)
if (gSpriteData[ramSlot].xPosition + gSpriteData[ramSlot].hitboxLeft > pSprite->xPosition - 0x8)
{
pSprite->status |= SPRITE_STATUS_XFLIP;
pSprite->work0 = gSpriteRng;
@ -1244,8 +1244,8 @@ void ParasiteGeronGrabbed(struct SpriteData* pSprite)
pSprite->work0--;
// Get geron position
geronY = gSpriteData[ramSlot].yPosition + gSpriteData[ramSlot].hitboxTopOffset;
geronX = gSpriteData[ramSlot].xPosition + gSpriteData[ramSlot].hitboxLeftOffset;
geronY = gSpriteData[ramSlot].yPosition + gSpriteData[ramSlot].hitboxTop;
geronX = gSpriteData[ramSlot].xPosition + gSpriteData[ramSlot].hitboxLeft;
// Update position
pSprite->yPosition = geronY + pSprite->yPositionSpawn;
@ -1273,7 +1273,7 @@ void ParasiteBombCollision(struct SpriteData* pSprite)
u16 spriteLeft;
u16 spriteRight;
u16 yPos, hitboxBottomOffset;
u16 yPos, hitboxBottom;
if (pSprite->invincibilityStunFlashTimer & 0x80)
{
@ -1284,24 +1284,24 @@ void ParasiteBombCollision(struct SpriteData* pSprite)
kill = FALSE;
yPos = pSprite->yPosition;
spriteTop = yPos + pSprite->hitboxTopOffset;
spriteTop = yPos + pSprite->hitboxTop;
spriteBottom = yPos;
hitboxBottomOffset = pSprite->hitboxBottomOffset;
spriteBottom += hitboxBottomOffset;
hitboxBottom = pSprite->hitboxBottom;
spriteBottom += hitboxBottom;
spriteLeft = pSprite->xPosition + pSprite->hitboxLeftOffset;
spriteRight = pSprite->xPosition + pSprite->hitboxRightOffset;
spriteLeft = pSprite->xPosition + pSprite->hitboxLeft;
spriteRight = pSprite->xPosition + pSprite->hitboxRight;
for (pProj = gProjectileData; pProj < gProjectileData + MAX_AMOUNT_OF_PROJECTILES; pProj++)
{
status = pProj->status;
if (status & PROJ_STATUS_EXISTS && pProj->type == PROJ_TYPE_BOMB && pProj->movementStage == BOMB_STAGE_EXPLODING)
{
projTop = pProj->yPosition + pProj->hitboxTopOffset;
projBottom = pProj->yPosition + pProj->hitboxBottomOffset;
projLeft = pProj->xPosition + pProj->hitboxLeftOffset;
projRight = pProj->xPosition + pProj->hitboxRightOffset;
projTop = pProj->yPosition + pProj->hitboxTop;
projBottom = pProj->yPosition + pProj->hitboxBottom;
projLeft = pProj->xPosition + pProj->hitboxLeft;
projRight = pProj->xPosition + pProj->hitboxRight;
if (SpriteUtilCheckObjectsTouching(spriteTop, spriteBottom, spriteLeft, spriteRight, projTop, projBottom, projLeft, projRight))
{

View File

@ -132,12 +132,12 @@ u8 PistonCheckSamusIn(void)
*/
void PistonInit(void)
{
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 6 + QUARTER_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 6 + QUARTER_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxLeftOffset = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxRightOffset = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxLeft = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxRight = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.health = 256;
@ -160,8 +160,8 @@ void PistonGfxInit(void)
gCurrentSprite.pose = PISTON_POSE_CHECK_FOR_PROJECTILES;
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE + QUARTER_BLOCK_SIZE * 3 + PIXEL_SIZE);
gCurrentSprite.hitboxBottomOffset = -(BLOCK_SIZE + HALF_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxTop = -(BLOCK_SIZE + QUARTER_BLOCK_SIZE * 3 + PIXEL_SIZE);
gCurrentSprite.hitboxBottom = -(BLOCK_SIZE + HALF_BLOCK_SIZE + PIXEL_SIZE * 3);
}
/**
@ -216,8 +216,8 @@ void PistonOpen(void)
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.pose = PISTON_POSE_OPENED;
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE * 2 + QUARTER_BLOCK_SIZE * 3 + PIXEL_SIZE);
gCurrentSprite.hitboxBottomOffset = -(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxTop = -(BLOCK_SIZE * 2 + QUARTER_BLOCK_SIZE * 3 + PIXEL_SIZE);
gCurrentSprite.hitboxBottom = -(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE + PIXEL_SIZE * 3);
}
}

View File

@ -17,14 +17,14 @@
*/
void PolypInit(void)
{
gCurrentSprite.hitboxTopOffset = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = -(BLOCK_SIZE - PIXEL_SIZE * 2);
gCurrentSprite.hitboxRightOffset = (BLOCK_SIZE - PIXEL_SIZE * 2);
gCurrentSprite.hitboxTop = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = -(BLOCK_SIZE - PIXEL_SIZE * 2);
gCurrentSprite.hitboxRight = (BLOCK_SIZE - PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.samusCollision = SSC_KNOCKS_BACK_SAMUS;
gCurrentSprite.health = GET_PSPRITE_HEALTH(gCurrentSprite.spriteId);
@ -160,14 +160,14 @@ void PolypProjectileInit(void)
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.properties |= SP_KILL_OFF_SCREEN;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxBottom = QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxRight = QUARTER_BLOCK_SIZE;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
@ -273,7 +273,7 @@ void PolypProjectileExplodingInit(void)
*/
void PolypProjectileCheckExplodingAnimEnded(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (SpriteUtilCheckEndCurrentSpriteAnim())
gCurrentSprite.status = 0; // Kill sprite

View File

@ -32,14 +32,14 @@ void PowerGrip(void)
break;
}
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxBottomOffset = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxLeftOffset = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxRightOffset = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxTop = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxBottom = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxLeft = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.hitboxRight = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 3);
gCurrentSprite.pOam = sPowerGripOAM_Idle;
gCurrentSprite.animationDurationCounter = 0;
@ -60,7 +60,7 @@ void PowerGrip(void)
{
gPreventMovementTimer = SAMUS_ITEM_PMT;
gCurrentSprite.properties |= SP_ALWAYS_ACTIVE;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.pose = POWER_GRIP_POSE_BEING_ACQUIRED;
gCurrentSprite.work0 = 0;
gEquipment.suitMisc |= SMF_POWER_GRIP;
@ -72,7 +72,7 @@ void PowerGrip(void)
break;
case POWER_GRIP_POSE_BEING_ACQUIRED:
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
// Flicker
if (MOD_AND(gCurrentSprite.work0, 2) == 0)
@ -95,14 +95,14 @@ void PowerGripGlow(void)
case SPRITE_POSE_UNINITIALIZED:
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.pOam = sPowerGripGlowOAM_Idle;
gCurrentSprite.animationDurationCounter = 0;

View File

@ -14,21 +14,21 @@
*/
void PrimarySpriteB3(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gCurrentSprite.pose == SPRITE_POSE_UNINITIALIZED)
{
gCurrentSprite.status |= (SPRITE_STATUS_NOT_DRAWN | SPRITE_STATUS_IGNORE_PROJECTILES);
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.pOam = sEnemyDropOAM_LargeEnergy;
gCurrentSprite.animationDurationCounter = 0;

View File

@ -18,14 +18,14 @@
*/
void ReoInit(void)
{
gCurrentSprite.drawDistanceTopOffset = 0x18;
gCurrentSprite.drawDistanceBottomOffset = 0x18;
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.drawDistanceTop = 0x18;
gCurrentSprite.drawDistanceBottom = 0x18;
gCurrentSprite.drawDistanceHorizontal = 0x18;
gCurrentSprite.hitboxTopOffset = -0x20;
gCurrentSprite.hitboxBottomOffset = 0x20;
gCurrentSprite.hitboxLeftOffset = -0x38;
gCurrentSprite.hitboxRightOffset = 0x38;
gCurrentSprite.hitboxTop = -0x20;
gCurrentSprite.hitboxBottom = 0x20;
gCurrentSprite.hitboxLeft = -0x38;
gCurrentSprite.hitboxRight = 0x38;
gCurrentSprite.pOam = sReoOAM_Idle;
gCurrentSprite.animationDurationCounter = 0x0;
@ -37,7 +37,7 @@ void ReoInit(void)
SpriteUtilChooseRandomXDirection();
if (0x8 < gSpriteRng)
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
gCurrentSprite.pose = REO_POSE_IDLE_INIT;
}
@ -105,7 +105,7 @@ void ReoMovingInit(void)
gCurrentSprite.xPositionSpawn = gSpriteRng & 0x3;
gCurrentSprite.pose = REO_POSE_MOVING;
gCurrentSprite.oamScaling = 0x20;
gCurrentSprite.scaling = 0x20;
gCurrentSprite.pOam = sReoOAM_Moving;
gCurrentSprite.animationDurationCounter = 0x0;
@ -113,10 +113,10 @@ void ReoMovingInit(void)
SpriteUtilMakeSpriteFaceSamusDirection();
if (gCurrentSprite.yPosition > gSamusData.yPosition + gSamusPhysics.drawDistanceTopOffset)
gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN_400;
if (gCurrentSprite.yPosition > gSamusData.yPosition + gSamusPhysics.drawDistanceTop)
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_DOWN;
else
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
}
/**
@ -194,14 +194,14 @@ void ReoMove(void)
gCurrentSprite.work2 = 1;
}
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
collision = SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition + HALF_BLOCK_SIZE, gCurrentSprite.xPosition);
else
collision = SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition - HALF_BLOCK_SIZE, gCurrentSprite.xPosition);
if (collision != COLLISION_AIR)
{
gCurrentSprite.status ^= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status ^= SPRITE_STATUS_FACING_DOWN;
gCurrentSprite.work0 = 0;
gCurrentSprite.work3 = 1;
}
@ -275,7 +275,7 @@ void ReoMove(void)
}
}
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
if (gCurrentSprite.work0 == 0)
{
@ -297,7 +297,7 @@ void ReoMove(void)
}
else
{
gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_DOWN;
gCurrentSprite.work3 = 1;
}
}
@ -326,7 +326,7 @@ void ReoMove(void)
}
else
{
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
gCurrentSprite.work3 = 1;
}
}
@ -334,10 +334,10 @@ void ReoMove(void)
SpriteUtilCheckOutOfRoomEffect(yPosition, gCurrentSprite.yPosition, gCurrentSprite.xPosition, SPLASH_SMALL);
}
gCurrentSprite.oamScaling--;
if (gCurrentSprite.oamScaling == 0)
gCurrentSprite.scaling--;
if (gCurrentSprite.scaling == 0)
{
gCurrentSprite.oamScaling = 0x20;
gCurrentSprite.scaling = 0x20;
if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN)
SoundPlayNotAlreadyPlaying(0x158);
}

View File

@ -502,12 +502,12 @@ void RidleyInit(void)
gCurrentSprite.drawOrder = 8;
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
gCurrentSprite.drawDistanceTopOffset = 0x20;
gCurrentSprite.drawDistanceBottomOffset = 0x40;
gCurrentSprite.drawDistanceHorizontalOffset = 0x28;
gCurrentSprite.drawDistanceTop = 0x20;
gCurrentSprite.drawDistanceBottom = 0x40;
gCurrentSprite.drawDistanceHorizontal = 0x28;
gCurrentSprite.hitboxTopOffset = -0xA0;
gCurrentSprite.hitboxBottomOffset = 0x80;
gCurrentSprite.hitboxTop = -0xA0;
gCurrentSprite.hitboxBottom = 0x80;
// Move in ceiling
gCurrentSprite.yPosition -= BLOCK_SIZE * 8;
@ -593,7 +593,7 @@ void RidleyCheckPlayCutscene(void)
inRange = FALSE;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gSamusData.yPosition == RIDLEY_GROUND_POSITION)
{
@ -621,7 +621,7 @@ void RidleyCheckPlayCutscene(void)
gCurrentSprite.work3 = 0;
// Timer
gCurrentSprite.oamScaling = 300;
gCurrentSprite.scaling = 300;
StartEffectForCutscene(EFFECT_CUTSCENE_RIDLEY_SPAWN);
}
@ -730,12 +730,12 @@ void RidleySpawning(void)
case RIDLEY_SPAWNING_ACTION_SPITTING_FIREBALLS:
// Spawn fireballs
if (MOD_AND(gCurrentSprite.oamScaling, 16) == 0)
RidleySpawnAscendingFireball(gCurrentSprite.oamScaling);
if (MOD_AND(gCurrentSprite.scaling, 16) == 0)
RidleySpawnAscendingFireball(gCurrentSprite.scaling);
if (gCurrentSprite.oamScaling != 0)
if (gCurrentSprite.scaling != 0)
{
gCurrentSprite.oamScaling--;
gCurrentSprite.scaling--;
// Check turn if samus is behind
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
@ -1431,7 +1431,7 @@ void RidleySmallFireballsAttackInit(void)
gCurrentSprite.pose = RIDLEY_POSE_SMALL_FIREBALLS_ATTACK;
gCurrentSprite.work1 = RIDLEY_SMALL_FIREBALLS_ATTACK_ACTION_GOING_DOWN;
gCurrentSprite.work3 = 0;
gCurrentSprite.oamScaling = 0xB4;
gCurrentSprite.scaling = 0xB4;
}
/**
@ -1509,12 +1509,12 @@ void RidleySmallFireballsAttack(void)
case RIDLEY_SMALL_FIREBALLS_ATTACK_ACTION_SPITTING_FIREBALLS:
// Spawn fireball
if (!(gCurrentSprite.oamScaling & 0xF))
RidleySpawnAscendingFireball(gCurrentSprite.oamScaling);
if (!(gCurrentSprite.scaling & 0xF))
RidleySpawnAscendingFireball(gCurrentSprite.scaling);
if (gCurrentSprite.oamScaling != 0)
if (gCurrentSprite.scaling != 0)
{
gCurrentSprite.oamScaling--;
gCurrentSprite.scaling--;
// Check stop attack if samus is behind Ridley
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
{
@ -1753,7 +1753,7 @@ void RidleyDying(void)
u8 rngParam1;
u8 rngParam2;
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gCurrentSprite.work2 != 0)
{
@ -1858,14 +1858,14 @@ void RidleyPartInit(void)
case RIDLEY_PART_LEFT_WING:
gCurrentSprite.drawOrder = 0x6;
gCurrentSprite.drawDistanceTopOffset = 0x38;
gCurrentSprite.drawDistanceBottomOffset = 0x28;
gCurrentSprite.drawDistanceHorizontalOffset = 0x30;
gCurrentSprite.drawDistanceTop = 0x38;
gCurrentSprite.drawDistanceBottom = 0x28;
gCurrentSprite.drawDistanceHorizontal = 0x30;
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.samusCollision = SSC_NONE;
break;
@ -1873,14 +1873,14 @@ void RidleyPartInit(void)
case RIDLEY_PART_HEAD:
gCurrentSprite.drawOrder = 0x7;
gCurrentSprite.drawDistanceTopOffset = 0x20;
gCurrentSprite.drawDistanceBottomOffset = 0x28;
gCurrentSprite.drawDistanceHorizontalOffset = 0x28;
gCurrentSprite.drawDistanceTop = 0x20;
gCurrentSprite.drawDistanceBottom = 0x28;
gCurrentSprite.drawDistanceHorizontal = 0x28;
gCurrentSprite.hitboxTopOffset = -0x40;
gCurrentSprite.hitboxBottomOffset = 0x40;
gCurrentSprite.hitboxLeftOffset = -0x20;
gCurrentSprite.hitboxRightOffset = 0x20;
gCurrentSprite.hitboxTop = -0x40;
gCurrentSprite.hitboxBottom = 0x40;
gCurrentSprite.hitboxLeft = -0x20;
gCurrentSprite.hitboxRight = 0x20;
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
break;
@ -1888,14 +1888,14 @@ void RidleyPartInit(void)
case RIDLEY_PART_CLAW:
gCurrentSprite.drawOrder = 0x9;
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x30;
gCurrentSprite.drawDistanceHorizontalOffset = 0x58;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x30;
gCurrentSprite.drawDistanceHorizontal = 0x58;
gCurrentSprite.hitboxTopOffset = 0x60;
gCurrentSprite.hitboxBottomOffset = 0xA0;
gCurrentSprite.hitboxLeftOffset = -0xE0;
gCurrentSprite.hitboxRightOffset = -0xA0;
gCurrentSprite.hitboxTop = 0x60;
gCurrentSprite.hitboxBottom = 0xA0;
gCurrentSprite.hitboxLeft = -0xE0;
gCurrentSprite.hitboxRight = -0xA0;
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
gCurrentSprite.work1 = 0;
@ -1904,14 +1904,14 @@ void RidleyPartInit(void)
case RIDLEY_PART_TAIL:
gCurrentSprite.drawOrder = 0x8;
gCurrentSprite.drawDistanceTopOffset = 0x1;
gCurrentSprite.drawDistanceBottomOffset = 0x1;
gCurrentSprite.drawDistanceHorizontalOffset = 0x1;
gCurrentSprite.drawDistanceTop = 0x1;
gCurrentSprite.drawDistanceBottom = 0x1;
gCurrentSprite.drawDistanceHorizontal = 0x1;
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.samusCollision = SSC_NONE;
break;
@ -1919,14 +1919,14 @@ void RidleyPartInit(void)
case RIDLEY_PART_RIGHT_WING:
gCurrentSprite.drawOrder = 0xA;
gCurrentSprite.drawDistanceTopOffset = 0x38;
gCurrentSprite.drawDistanceBottomOffset = 0x28;
gCurrentSprite.drawDistanceHorizontalOffset = 0x20;
gCurrentSprite.drawDistanceTop = 0x38;
gCurrentSprite.drawDistanceBottom = 0x28;
gCurrentSprite.drawDistanceHorizontal = 0x20;
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.samusCollision = SSC_NONE;
break;
@ -1995,13 +1995,13 @@ void RidleyPartClawUpdateSidesHitbox(void)
{
if (gCurrentSprite.status & SPRITE_STATUS_XFLIP)
{
gCurrentSprite.hitboxLeftOffset = 0xA0;
gCurrentSprite.hitboxRightOffset = 0xE0;
gCurrentSprite.hitboxLeft = 0xA0;
gCurrentSprite.hitboxRight = 0xE0;
}
else
{
gCurrentSprite.hitboxLeftOffset = -0xE0;
gCurrentSprite.hitboxRightOffset = -0xA0;
gCurrentSprite.hitboxLeft = -0xE0;
gCurrentSprite.hitboxRight = -0xA0;
}
}
@ -2085,26 +2085,26 @@ void RidleyTailInit(void)
gCurrentSprite.yPositionSpawn = 0;
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x10;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x10;
gCurrentSprite.drawDistanceHorizontal = 0x10;
gCurrentSprite.hitboxTopOffset = -0x30;
gCurrentSprite.hitboxBottomOffset = 0x30;
gCurrentSprite.hitboxLeftOffset = -0x30;
gCurrentSprite.hitboxRightOffset = 0x30;
gCurrentSprite.hitboxTop = -0x30;
gCurrentSprite.hitboxBottom = 0x30;
gCurrentSprite.hitboxLeft = -0x30;
gCurrentSprite.hitboxRight = 0x30;
}
else
{
// Initialize parts
gCurrentSprite.drawDistanceTopOffset = 0x8;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.drawDistanceHorizontalOffset = 0x8;
gCurrentSprite.drawDistanceTop = 0x8;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.drawDistanceHorizontal = 0x8;
gCurrentSprite.hitboxTopOffset = -0x20;
gCurrentSprite.hitboxBottomOffset = 0x20;
gCurrentSprite.hitboxLeftOffset = -0x20;
gCurrentSprite.hitboxRightOffset = 0x20;
gCurrentSprite.hitboxTop = -0x20;
gCurrentSprite.hitboxBottom = 0x20;
gCurrentSprite.hitboxLeft = -0x20;
gCurrentSprite.hitboxRight = 0x20;
}
}
@ -2464,14 +2464,14 @@ void RidleyFireballCheckSlideOnWall(void)
{
// Check wall on right
if (SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition,
gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset) != COLLISION_AIR)
gCurrentSprite.xPosition + gCurrentSprite.hitboxRight) != COLLISION_AIR)
gCurrentSprite.pose = RIDLEY_FIREBALL_POSE_SLIDE_ON_WALL_INIT;
}
else
{
// Check wall on left
if (SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition,
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset) != COLLISION_AIR)
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft) != COLLISION_AIR)
gCurrentSprite.pose = RIDLEY_FIREBALL_POSE_SLIDE_ON_WALL_INIT;
}
}
@ -2493,28 +2493,28 @@ void RidleyFireballInit(void)
if (gCurrentSprite.spriteId == SSPRITE_RIDLEY_BIG_FIREBALL)
{
// Big fireball
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxBottomOffset = (HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxLeftOffset = -(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxRightOffset = (HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxTop = -(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxBottom = (HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxLeft = -(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxRight = (HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.pOam = sRidleyFireballOam_Big;
}
else
{
// Small fireball
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -0x1C;
gCurrentSprite.hitboxBottomOffset = 0x1C;
gCurrentSprite.hitboxLeftOffset = -0x1C;
gCurrentSprite.hitboxRightOffset = 0x1C;
gCurrentSprite.hitboxTop = -0x1C;
gCurrentSprite.hitboxBottom = 0x1C;
gCurrentSprite.hitboxLeft = -0x1C;
gCurrentSprite.hitboxRight = 0x1C;
gCurrentSprite.pOam = sRidleyFireballOam_Small;
}
@ -2523,7 +2523,7 @@ void RidleyFireballInit(void)
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.health = GET_SSPRITE_HEALTH(gCurrentSprite.spriteId);
gCurrentSprite.oamRotation = 0;
gCurrentSprite.rotation = 0;
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
gCurrentSprite.status |= SPRITE_STATUS_XFLIP;
@ -2533,14 +2533,14 @@ void RidleyFireballInit(void)
{
// Diagonal pattern (when Samus is grabbed)
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS_STOP_DIES_WHEN_HIT_NO_KNOCKBACK;
gCurrentSprite.oamScaling = Q_8_8(.5f);
gCurrentSprite.scaling = Q_8_8(.5f);
gCurrentSprite.pose = RIDLEY_FIREBALL_POSE_MOVE_DIAGONAL_PATTERN;
}
else if (gCurrentSprite.roomSlot & RIDLEY_FIREBALL_PART_FLOATING_PATTERN)
{
// Floating pattern (big fireballs)
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS_STOP_DIES_WHEN_HIT;
gCurrentSprite.oamScaling = Q_8_8(1.f);
gCurrentSprite.scaling = Q_8_8(1.f);
gCurrentSprite.pose = RIDLEY_FIREBALL_POSE_MOVE_FLOATING_PATTERN;
}
else
@ -2548,14 +2548,14 @@ void RidleyFireballInit(void)
// Descending pattern (small fireballs)
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS_STOP_DIES_WHEN_HIT;
gCurrentSprite.oamScaling = Q_8_8(.5f);
gCurrentSprite.scaling = Q_8_8(.5f);
gCurrentSprite.work0 = 16;
gCurrentSprite.work2 = 0;
gCurrentSprite.pose = RIDLEY_FIREBALL_POSE_MOVE_DESCENDING_PATTERN;
if (gCurrentSprite.yPosition < gSamusData.yPosition)
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
}
}
@ -2565,10 +2565,10 @@ void RidleyFireballInit(void)
*/
void RidleyFireballMoveDiagonalPattern(void)
{
if (gCurrentSprite.oamScaling < Q_8_8(.94f))
if (gCurrentSprite.scaling < Q_8_8(.94f))
{
gCurrentSprite.yPosition = gSpriteData[gCurrentSprite.primarySpriteRamSlot].yPosition - (BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.oamScaling += Q_8_8(.065f);
gCurrentSprite.scaling += Q_8_8(.065f);
}
else
{
@ -2630,8 +2630,8 @@ void RidleyFireballMoveDescendingPattern(void)
movement = gCurrentSprite.work2++;
if (gCurrentSprite.oamScaling < Q_8_8(.94f))
gCurrentSprite.oamScaling += Q_8_8(.065f);
if (gCurrentSprite.scaling < Q_8_8(.94f))
gCurrentSprite.scaling += Q_8_8(.065f);
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
gCurrentSprite.xPosition += movement;
@ -2787,13 +2787,13 @@ void Ridley(void)
if (gCurrentSprite.status & SPRITE_STATUS_XFLIP)
{
gCurrentSprite.hitboxLeftOffset = -0x60;
gCurrentSprite.hitboxRightOffset = 0x80;
gCurrentSprite.hitboxLeft = -0x60;
gCurrentSprite.hitboxRight = 0x80;
}
else
{
gCurrentSprite.hitboxLeftOffset = -0x80;
gCurrentSprite.hitboxRightOffset = 0x60;
gCurrentSprite.hitboxLeft = -0x80;
gCurrentSprite.hitboxRight = 0x60;
}
if (gSamusData.yPosition < (BLOCK_SIZE * 13 - 1) && !(gSpriteData[gSubSpriteData1.workVariable5].status & SPRITE_STATUS_SAMUS_COLLIDING))
@ -2836,7 +2836,7 @@ void RidleyTail(void)
if (gCurrentSprite.status & SPRITE_STATUS_NOT_DRAWN)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (!(gSpriteData[ramSlot].status & SPRITE_STATUS_NOT_DRAWN))
gCurrentSprite.status &= ~(SPRITE_STATUS_NOT_DRAWN | SPRITE_STATUS_IGNORE_PROJECTILES);
}
@ -2983,7 +2983,7 @@ void RidleyPart(void)
if (part != RIDLEY_PART_TAIL && gCurrentSprite.status & SPRITE_STATUS_NOT_DRAWN)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (!(gSpriteData[ramSlot].status & SPRITE_STATUS_NOT_DRAWN))
gCurrentSprite.status &= ~(SPRITE_STATUS_NOT_DRAWN | SPRITE_STATUS_IGNORE_PROJECTILES);
}
@ -3064,7 +3064,7 @@ void RidleyFireball(void)
}
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
gCurrentSprite.oamRotation += 0x20;
gCurrentSprite.rotation += 0x20;
else
gCurrentSprite.oamRotation -= 0x20;
gCurrentSprite.rotation -= 0x20;
}

View File

@ -23,14 +23,14 @@
*/
void RinkaInit(void)
{
gCurrentSprite.hitboxTopOffset = -0x14;
gCurrentSprite.hitboxBottomOffset = 0x14;
gCurrentSprite.hitboxLeftOffset = -0x14;
gCurrentSprite.hitboxRightOffset = 0x14;
gCurrentSprite.hitboxTop = -0x14;
gCurrentSprite.hitboxBottom = 0x14;
gCurrentSprite.hitboxLeft = -0x14;
gCurrentSprite.hitboxRight = 0x14;
gCurrentSprite.drawDistanceTopOffset = 0x8;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.drawDistanceHorizontalOffset = 0x8;
gCurrentSprite.drawDistanceTop = 0x8;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.drawDistanceHorizontal = 0x8;
gCurrentSprite.health = GET_PSPRITE_HEALTH(gCurrentSprite.spriteId);
gCurrentSprite.yPosition -= (HALF_BLOCK_SIZE);
@ -84,7 +84,7 @@ void RinkaRespawn(void)
gCurrentSprite.frozenPaletteRowOffset = 0x0;
gCurrentSprite.absolutePaletteRow = 0x0;
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.freezeTimer = 0x0;
// Set spawn delay
@ -95,7 +95,7 @@ void RinkaRespawn(void)
gCurrentSprite.status |= (SPRITE_STATUS_NOT_DRAWN | SPRITE_STATUS_IGNORE_PROJECTILES);
// Duplicated code
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
}
/**
@ -112,14 +112,14 @@ void RinkaSpawning(void)
// Spawn delay
if (gCurrentSprite.work1 != 0x0)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.work1--;
}
else
{
if (gCurrentSprite.status & SPRITE_STATUS_NOT_DRAWN)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN)
{
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
@ -133,7 +133,7 @@ void RinkaSpawning(void)
// Vulnerability delay
if (gCurrentSprite.work0 != 0x0)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.work0--;
if (gCurrentSprite.work0 == 0x0)
gCurrentSprite.status &= ~SPRITE_STATUS_IGNORE_PROJECTILES;
@ -148,7 +148,7 @@ void RinkaSpawning(void)
gCurrentSprite.pose = RINKA_POSE_MOVING;
gCurrentSprite.currentAnimationFrame = 0x0;
gCurrentSprite.animationDurationCounter = 0x0;
gCurrentSprite.oamScaling = 0x0;
gCurrentSprite.scaling = 0x0;
samusY = gSamusData.yPosition - 0x3C;
samusX = gSamusData.xPosition;
@ -161,9 +161,9 @@ void RinkaSpawning(void)
// Set direction
if (samusY < spriteY)
gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_DOWN;
else
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
if (samusX < spriteX)
@ -200,13 +200,13 @@ void RinkaMove(void)
else
velocity = 0x4;
acceleration = ++gCurrentSprite.oamScaling;
acceleration = ++gCurrentSprite.scaling;
velocity *= (acceleration);
spawnY = gCurrentSprite.work3 * BLOCK_SIZE + (HALF_BLOCK_SIZE);
spawnX = gCurrentSprite.work2 * BLOCK_SIZE + (HALF_BLOCK_SIZE);
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
distanceYUp = gCurrentSprite.yPositionSpawn - spawnY;
else
distanceYDown = spawnY - gCurrentSprite.yPositionSpawn;
@ -218,7 +218,7 @@ void RinkaMove(void)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
{
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
totalDistance = (u16)Sqrt(distanceXRight * distanceXRight + distanceYUp * distanceYUp);
if (totalDistance != 0x0)
@ -239,7 +239,7 @@ void RinkaMove(void)
}
else
{
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
totalDistance = (u16)Sqrt(distanceXLeft * distanceXLeft + distanceYUp * distanceYUp);
if (totalDistance != 0x0)
@ -413,14 +413,14 @@ void RinkaMotherBrainSpawning(void)
// Spawn delay
if (gCurrentSprite.work1 != 0x0)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.work1--;
}
else
{
if (gCurrentSprite.status & SPRITE_STATUS_NOT_DRAWN)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN)
{
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
@ -436,7 +436,7 @@ void RinkaMotherBrainSpawning(void)
// Vulnerability delay
if (gCurrentSprite.work0 != 0x0)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.work0--;
if (gCurrentSprite.work0 == 0x0)
gCurrentSprite.status &= ~SPRITE_STATUS_IGNORE_PROJECTILES;
@ -448,7 +448,7 @@ void RinkaMotherBrainSpawning(void)
gCurrentSprite.pose = RINKA_POSE_MOVING;
gCurrentSprite.currentAnimationFrame = 0x0;
gCurrentSprite.animationDurationCounter = 0x0;
gCurrentSprite.oamScaling = 0x0;
gCurrentSprite.scaling = 0x0;
samusY = gSamusData.yPosition - 0x3C;
samusX = gSamusData.xPosition;
@ -461,9 +461,9 @@ void RinkaMotherBrainSpawning(void)
// Set direction
if (samusY < spriteY)
gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_DOWN;
else
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
if (samusX < spriteX)
@ -498,7 +498,7 @@ void RinkaMotherBrainMove(void)
respawn = FALSE;
acceleration = ++gCurrentSprite.oamScaling;
acceleration = ++gCurrentSprite.scaling;
velocity = acceleration * 4;
tileX = gCurrentSprite.work2;
@ -542,7 +542,7 @@ void RinkaMotherBrainMove(void)
spawnY = tileY * BLOCK_SIZE + (HALF_BLOCK_SIZE);
spawnX = tileX * BLOCK_SIZE + (HALF_BLOCK_SIZE);
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
distanceYUp = gCurrentSprite.yPositionSpawn - spawnY;
else
distanceYDown = spawnY - gCurrentSprite.yPositionSpawn;
@ -554,7 +554,7 @@ void RinkaMotherBrainMove(void)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
{
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
totalDistance = (u16)Sqrt(distanceXRight * distanceXRight + distanceYUp * distanceYUp);
if (totalDistance != 0x0)
@ -575,7 +575,7 @@ void RinkaMotherBrainMove(void)
}
else
{
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
totalDistance = (u16)Sqrt(distanceXLeft * distanceXLeft + distanceYUp * distanceYUp);
if (totalDistance != 0x0)
@ -691,10 +691,10 @@ void RinkaMotherBrain(void)
ParticleSet(gCurrentSprite.yPosition, gCurrentSprite.xPosition, PE_SPRITE_EXPLOSION_SMALL);
}
if (gCurrentSprite.standingOnSprite && gSamusData.standingStatus == STANDING_ENEMY)
if (gCurrentSprite.standingOnSprite != SAMUS_STANDING_ON_SPRITE_OFF && gSamusData.standingStatus == STANDING_ENEMY)
{
gSamusData.standingStatus = STANDING_MIDAIR;
gCurrentSprite.standingOnSprite = FALSE;
gCurrentSprite.standingOnSprite = SAMUS_STANDING_ON_SPRITE_OFF;
}
gCurrentSprite.status = 0x0;

View File

@ -18,14 +18,14 @@
*/
void RipperInit(void)
{
gCurrentSprite.hitboxTopOffset = -(HALF_BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -(HALF_BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxRight = HALF_BLOCK_SIZE;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.pOam = sRipperOam_Moving;
gCurrentSprite.animationDurationCounter = 0;

View File

@ -18,14 +18,14 @@
*/
void Ripper2Init(void)
{
gCurrentSprite.hitboxTopOffset = -(HALF_BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxBottomOffset = PIXEL_SIZE * 2;
gCurrentSprite.hitboxLeftOffset = -(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxRightOffset = (HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxTop = -(HALF_BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxBottom = PIXEL_SIZE * 2;
gCurrentSprite.hitboxLeft = -(HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxRight = (HALF_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.pOam = sRipper2Oam_Moving;
gCurrentSprite.animationDurationCounter = 0;

View File

@ -206,14 +206,14 @@ void RisingChozoPillar(void)
gCurrentSprite.status |= SPRITE_STATUS_NOT_DRAWN | SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(PIXEL_SIZE);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.pOam = sEnemyDropOAM_LargeEnergy;
gCurrentSprite.animationDurationCounter = 0;
@ -225,17 +225,17 @@ void RisingChozoPillar(void)
if (EventFunction(EVENT_ACTION_CHECKING, EVENT_POWER_GRIP_OBTAINED))
{
gCurrentSprite.pose = RISING_CHOZO_PILLAR_POSE_EXTENDING;
gCurrentSprite.oamScaling = 704;
gCurrentSprite.scaling = 704;
SoundPlay(0x125);
}
break;
case RISING_CHOZO_PILLAR_POSE_EXTENDING:
if (MOD_AND(gCurrentSprite.oamScaling, 32) == 0)
if (MOD_AND(gCurrentSprite.scaling, 32) == 0)
ScreenShakeStartVertical(30, 0x80 | 1);
gCurrentSprite.oamScaling--;
if (gCurrentSprite.oamScaling != 0)
gCurrentSprite.scaling--;
if (gCurrentSprite.scaling != 0)
{
gBg2Movement.yOffset += 2;
}
@ -247,8 +247,8 @@ void RisingChozoPillar(void)
debrisY = yPosition + HALF_BLOCK_SIZE;
debrisX = xPosition + BLOCK_SIZE * 3 + HALF_BLOCK_SIZE;
RisingChozoPillarRandomSpriteDebris(debrisY, debrisX, MOD_AND(gCurrentSprite.oamScaling, 16));
RisingChozoPillarRandomParticles(debrisY, debrisX, MOD_AND(gCurrentSprite.oamScaling, 128));
RisingChozoPillarRandomSpriteDebris(debrisY, debrisX, MOD_AND(gCurrentSprite.scaling, 16));
RisingChozoPillarRandomParticles(debrisY, debrisX, MOD_AND(gCurrentSprite.scaling, 128));
break;
case RISING_CHOZO_PILLAR_POSE_SPAWN_3_PLATFORMS:
@ -282,7 +282,7 @@ void RisingChozoPillar(void)
*/
void ChozoPillarPlatform(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
@ -292,14 +292,14 @@ void ChozoPillarPlatform(void)
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
@ -357,7 +357,7 @@ void ChozoPillarPlatform(void)
*/
void ChozoPillarPlatformShadow(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gCurrentSprite.pose == 0)
{
@ -365,14 +365,14 @@ void ChozoPillarPlatformShadow(void)
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.pose = 8;

View File

@ -114,12 +114,12 @@ void RuinsTestMoveToPosition(u16 yStart, u16 xStart, u16 yTarget, u16 xTarget, u
if (yTarget > yStart)
{
distanceY = yTarget - yStart;
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
}
else
{
distanceY = yStart - yTarget;
gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_DOWN;
}
if (xTarget > xStart)
@ -135,7 +135,7 @@ void RuinsTestMoveToPosition(u16 yStart, u16 xStart, u16 yTarget, u16 xTarget, u
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
{
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
totalDistance = Sqrt(distanceX * distanceX + distanceY * distanceY);
if (totalDistance != 0)
@ -156,7 +156,7 @@ void RuinsTestMoveToPosition(u16 yStart, u16 xStart, u16 yTarget, u16 xTarget, u
}
else
{
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
totalDistance = Sqrt(distanceX * distanceX + distanceY * distanceY);
if (totalDistance != 0)
@ -202,10 +202,10 @@ u8 RuinsTestProjectileCollision(void)
spriteY = gCurrentSprite.yPosition;
spriteX = gCurrentSprite.xPosition;
spriteTop = spriteY + gCurrentSprite.hitboxTopOffset;
spriteBottom = spriteY + gCurrentSprite.hitboxBottomOffset;
spriteLeft = spriteX + gCurrentSprite.hitboxLeftOffset;
spriteRight = spriteX + gCurrentSprite.hitboxRightOffset;
spriteTop = spriteY + gCurrentSprite.hitboxTop;
spriteBottom = spriteY + gCurrentSprite.hitboxBottom;
spriteLeft = spriteX + gCurrentSprite.hitboxLeft;
spriteRight = spriteX + gCurrentSprite.hitboxRight;
for (pProj = gProjectileData; pProj < gProjectileData + MAX_AMOUNT_OF_PROJECTILES; pProj++)
{
@ -290,7 +290,7 @@ u8 RuinsTestCheckSymbolShooted(void)
gCurrentSprite.pose = RUINS_TEST_POSE_BACK_TO_CENTER;
gSubSpriteData1.workVariable3 = RUINS_TEST_FIGHT_STAGE_LAST_SYMBOL_HIT;
gSubSpriteData1.workVariable1 = 1;
gCurrentSprite.oamScaling = 0;
gCurrentSprite.scaling = 0;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
@ -421,7 +421,7 @@ void RuinsTestGhostMove(u8 dAngle)
else
gCurrentSprite.work1 -= dAngle;
radius = (s16)gCurrentSprite.oamScaling;
radius = (s16)gCurrentSprite.scaling;
angle = gCurrentSprite.work1;
temp = s = sin(angle);
@ -458,14 +458,14 @@ void RuinsTestInit(void)
u16 yPosition;
u16 xPosition;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxBottomOffset = (BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxLeftOffset = -(BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxRightOffset = (BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxTop = -(BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxBottom = (BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxLeft = -(BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.hitboxRight = (BLOCK_SIZE + PIXEL_SIZE);
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
@ -659,7 +659,7 @@ void RuinsTestSpawnGhost(void)
void RuinsTestMovingInit(void)
{
gCurrentSprite.work1 = 0x40;
gCurrentSprite.oamScaling = 0;
gCurrentSprite.scaling = 0;
gCurrentSprite.pose = RUINS_TEST_POSE_MOVING_CIRCLE_PATTERN;
gCurrentSprite.status |= SPRITE_STATUS_SAMUS_COLLIDING;
}
@ -689,13 +689,13 @@ void RuinsTestMoveCirclePattern(void)
speed = 1;
// Update radius
if (gCurrentSprite.oamScaling < PI + PI / 2)
if (gCurrentSprite.scaling < PI + PI / 2)
{
gCurrentSprite.oamScaling += 3;
gCurrentSprite.scaling += 3;
gBossWork.work6 = 0;
}
else
gCurrentSprite.oamScaling = PI + PI / 2;
gCurrentSprite.scaling = PI + PI / 2;
// Move
if (!gBossWork.work4)
@ -710,7 +710,7 @@ void RuinsTestMoveCirclePattern(void)
{
// Try move to atom pattern
gCurrentSprite.status &= ~SPRITE_STATUS_SAMUS_COLLIDING;
if ((u8)(gCurrentSprite.work1 + 0x41) < 0x3 && gCurrentSprite.oamScaling == PI + PI / 2)
if ((u8)(gCurrentSprite.work1 + 0x41) < 0x3 && gCurrentSprite.scaling == PI + PI / 2)
{
// In a "corner", set atom pattern
gCurrentSprite.pose = RUINS_TEST_POSE_MOVING_ATOM_PATTERN;
@ -970,7 +970,7 @@ void RuinsTestMoveToCenter(void)
else
{
RuinsTestMoveToPosition(gSubSpriteData1.yPosition, gSubSpriteData1.xPosition,
targetY, targetX, gCurrentSprite.oamScaling++, PIXEL_SIZE);
targetY, targetX, gCurrentSprite.scaling++, PIXEL_SIZE);
}
}
@ -1044,14 +1044,14 @@ void RuinsTestGhostInit(void)
if (gCurrentSprite.roomSlot == RUINS_TEST_GHOST_PART_GHOST)
{
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5 + QUARTER_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 5 + QUARTER_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 3 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE * 4);
gCurrentSprite.hitboxBottomOffset = BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxRightOffset = (BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTop = -(BLOCK_SIZE * 4);
gCurrentSprite.hitboxBottom = BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxRight = (BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.drawOrder = 13;
gCurrentSprite.pOam = sRuinsTestGhostOam_NotMoving;
@ -1079,14 +1079,14 @@ void RuinsTestGhostInit(void)
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_10;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = BLOCK_SIZE;
gCurrentSprite.hitboxTop = -BLOCK_SIZE;
gCurrentSprite.hitboxBottom = BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -BLOCK_SIZE;
gCurrentSprite.hitboxRight = BLOCK_SIZE;
gCurrentSprite.drawOrder = 1;
gCurrentSprite.pOam = sRuinsTestGhostOam_SymbolShot;
@ -1100,7 +1100,7 @@ void RuinsTestGhostInit(void)
gCurrentSprite.yPositionSpawn = gCurrentSprite.yPosition;
gCurrentSprite.xPositionSpawn = gCurrentSprite.xPosition;
gCurrentSprite.oamScaling = 0;
gCurrentSprite.scaling = 0;
gCurrentSprite.work0 = 4;
gCurrentSprite.work1 = 0;
}
@ -1328,7 +1328,7 @@ void RuinsTestGhostMoveSymbolToPlace(void)
{
// Move
RuinsTestMoveToPosition(gCurrentSprite.yPositionSpawn, gCurrentSprite.xPositionSpawn,
targetY, targetX, gCurrentSprite.oamScaling++, PIXEL_SIZE);
targetY, targetX, gCurrentSprite.scaling++, PIXEL_SIZE);
}
}
@ -1581,14 +1581,14 @@ void RuinsTestSymbol(void)
case SPRITE_POSE_UNINITIALIZED:
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 4);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 4);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 6 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 4);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 4);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 6 + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.pOam = sRuinsTestSymbolOam_FourSymbols;
gCurrentSprite.currentAnimationFrame = 0;
@ -1731,14 +1731,14 @@ void RuinsTestSamusReflectionStart(void)
case SPRITE_POSE_UNINITIALIZED:
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.pOam = sRuinsTestSamusReflectionOAM;
gCurrentSprite.currentAnimationFrame = 0;
@ -1815,14 +1815,14 @@ void RuinsTestReflectionCover(void)
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_10;
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.pOam = sRuinsTestReflectionCoverOAM;
gCurrentSprite.currentAnimationFrame = 0;
@ -1863,14 +1863,14 @@ void RuinsTestGhostOutline(void)
case SPRITE_POSE_UNINITIALIZED:
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.animationDurationCounter = 0;
@ -1952,14 +1952,14 @@ void RuinsTestShootableSymbol(void)
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.pOam = sRuinsTestShootableSymbolOam_Spawning;
gCurrentSprite.currentAnimationFrame = 0;
@ -2110,14 +2110,14 @@ void RuinsTestSamusReflectionEnd(void)
case SPRITE_POSE_UNINITIALIZED:
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2 + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = 0;
gCurrentSprite.pOam = sRuinsTestSamusReflectionOAM;
gCurrentSprite.currentAnimationFrame = 0;
@ -2238,10 +2238,10 @@ void RuinsTestLightningOnGroundInit(void)
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.hitboxTopOffset = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = -(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxRightOffset = (BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTop = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = -(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxRight = (BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.pose = RUINS_TEST_LIGHTNING_POSE_ON_GROUND_HORIZONTAL;
}
@ -2267,19 +2267,19 @@ void RuinsTestLightning(void)
case SPRITE_POSE_UNINITIALIZED:
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = 0x50;
gCurrentSprite.drawDistanceBottomOffset = 0x20;
gCurrentSprite.drawDistanceHorizontalOffset = 0x28;
gCurrentSprite.drawDistanceTop = 0x50;
gCurrentSprite.drawDistanceBottom = 0x20;
gCurrentSprite.drawDistanceHorizontal = 0x28;
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
if (gCurrentSprite.roomSlot != RUINS_TEST_LIGHTNING_PART_GROUND_RIGHT)
{
// Normal lightning
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE * 4);
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxLeftOffset = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -(BLOCK_SIZE * 4);
gCurrentSprite.hitboxBottom = 0;
gCurrentSprite.hitboxLeft = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxRight = QUARTER_BLOCK_SIZE;
gCurrentSprite.pOam = sRuinsTestLightningOam_InAir;
gCurrentSprite.currentAnimationFrame = 0x0;
@ -2325,11 +2325,11 @@ void RuinsTestLightning(void)
{
// Move
gCurrentSprite.yPosition += velocity;
if (!(gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400))
if (!(gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN))
{
if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN)
{
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
SoundPlay(0x1DC);
}
}
@ -2368,10 +2368,10 @@ void RuinsTestLightning(void)
gCurrentSprite.currentAnimationFrame = 0;
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxBottomOffset = (BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxLeftOffset = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxRightOffset = QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxTop = -(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxBottom = (BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxLeft = -QUARTER_BLOCK_SIZE;
gCurrentSprite.hitboxRight = QUARTER_BLOCK_SIZE;
gCurrentSprite.pose = RUINS_TEST_LIGHTNING_POSE_ON_GROUND_VERTICAL;

View File

@ -48,14 +48,14 @@ void SavePlatformInit(void)
gCurrentSprite.yPositionSpawn = 0x0;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x28;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x10;
gCurrentSprite.drawDistanceHorizontal = 0x28;
gCurrentSprite.hitboxTopOffset = -0x4;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = -0x4;
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.hitboxTop = -0x4;
gCurrentSprite.hitboxBottom = 0x4;
gCurrentSprite.hitboxLeft = -0x4;
gCurrentSprite.hitboxRight = 0x4;
if (gAlarmTimer != 0x0)
gCurrentSprite.work2 = TRUE;
@ -341,19 +341,19 @@ void SavePlatformPartInit(void)
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.properties |= SP_ALWAYS_ACTIVE;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.hitboxTopOffset = -0x4;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = -0x4;
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.hitboxTop = -0x4;
gCurrentSprite.hitboxBottom = 0x4;
gCurrentSprite.hitboxLeft = -0x4;
gCurrentSprite.hitboxRight = 0x4;
gCurrentSprite.animationDurationCounter = 0x0;
gCurrentSprite.currentAnimationFrame = 0x0;
switch (gCurrentSprite.roomSlot)
{
case SAVE_PLATFORM_PART_TUBE:
gCurrentSprite.drawDistanceTopOffset = 0x50;
gCurrentSprite.drawDistanceBottomOffset = 0x0;
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.drawDistanceTop = 0x50;
gCurrentSprite.drawDistanceBottom = 0x0;
gCurrentSprite.drawDistanceHorizontal = 0x18;
if (gSpriteData[ramSlot].pose == SAVE_PLATFORM_POSE_RELEASE_SAMUS)
{
gCurrentSprite.pOam = sSavePlatformPartOAM_TubeIdle;
@ -370,27 +370,27 @@ void SavePlatformPartInit(void)
case SAVE_PLATFORM_PART_TUBE_SHADOW:
gCurrentSprite.drawOrder = 0xC;
gCurrentSprite.pOam = sSavePlatformPartOAM_TubeShadow;
gCurrentSprite.drawDistanceTopOffset = 0x50;
gCurrentSprite.drawDistanceBottomOffset = 0x0;
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.drawDistanceTop = 0x50;
gCurrentSprite.drawDistanceBottom = 0x0;
gCurrentSprite.drawDistanceHorizontal = 0x18;
gCurrentSprite.pose = SAVE_PLATFORM_PART_POSE_TUBE_SHADOW_IDLE;
break;
case SAVE_PLATFORM_PART_RAY:
gCurrentSprite.drawOrder = 0x5;
gCurrentSprite.pOam = sSavePlatformPartOAM_Ray;
gCurrentSprite.drawDistanceTopOffset = 0x8;
gCurrentSprite.drawDistanceBottomOffset = 0x0;
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.drawDistanceTop = 0x8;
gCurrentSprite.drawDistanceBottom = 0x0;
gCurrentSprite.drawDistanceHorizontal = 0x18;
gCurrentSprite.pose = SAVE_PLATFORM_PART_POSE_RAY_IDLE;
gCurrentSprite.work0 = 0x60;
break;
case SAVE_PLATFORM_PART_TOP:
gCurrentSprite.drawOrder = 0x3;
gCurrentSprite.drawDistanceTopOffset = 0x20;
gCurrentSprite.drawDistanceBottomOffset = 0x40;
gCurrentSprite.drawDistanceHorizontalOffset = 0x20;
gCurrentSprite.drawDistanceTop = 0x20;
gCurrentSprite.drawDistanceBottom = 0x40;
gCurrentSprite.drawDistanceHorizontal = 0x20;
gCurrentSprite.pose = SAVE_PLATFORM_PART_POSE_TOP_IDLE;
if (gSpriteData[ramSlot].pose == SAVE_PLATFORM_POSE_RELEASE_SAMUS)
gCurrentSprite.pOam = sSavePlatformPartOAM_TopExtended;
@ -564,7 +564,7 @@ void SavePlatformPartRayIdle(void)
*/
void SavePlatform(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
case 0x0:
@ -626,7 +626,7 @@ void SavePlatform(void)
*/
void SavePlatformPart(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
case 0x0:

View File

@ -24,14 +24,14 @@ void SavePlatformChozodiaInit(void)
gCurrentSprite.yPositionSpawn = 0x0;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.drawDistanceTopOffset = 0x18;
gCurrentSprite.drawDistanceBottomOffset = 0x10;
gCurrentSprite.drawDistanceHorizontalOffset = 0x28;
gCurrentSprite.drawDistanceTop = 0x18;
gCurrentSprite.drawDistanceBottom = 0x10;
gCurrentSprite.drawDistanceHorizontal = 0x28;
gCurrentSprite.hitboxTopOffset = -0x4;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = -0x4;
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.hitboxTop = -0x4;
gCurrentSprite.hitboxBottom = 0x4;
gCurrentSprite.hitboxLeft = -0x4;
gCurrentSprite.hitboxRight = 0x4;
if (gAlarmTimer != 0x0)
gCurrentSprite.work2 = TRUE;
@ -505,10 +505,10 @@ void SavePlatformChozodiaPartInit(void)
gCurrentSprite.properties |= SP_ALWAYS_ACTIVE;
gCurrentSprite.samusCollision = SSC_NONE;
gCurrentSprite.hitboxTopOffset = -0x4;
gCurrentSprite.hitboxBottomOffset = 0x4;
gCurrentSprite.hitboxLeftOffset = -0x4;
gCurrentSprite.hitboxRightOffset = 0x4;
gCurrentSprite.hitboxTop = -0x4;
gCurrentSprite.hitboxBottom = 0x4;
gCurrentSprite.hitboxLeft = -0x4;
gCurrentSprite.hitboxRight = 0x4;
gCurrentSprite.animationDurationCounter = 0x0;
gCurrentSprite.currentAnimationFrame = 0x0;
@ -516,9 +516,9 @@ void SavePlatformChozodiaPartInit(void)
switch (gCurrentSprite.roomSlot)
{
case SAVE_PLATFORM_CHOZODIA_PART_TUBE:
gCurrentSprite.drawDistanceTopOffset = 0x50;
gCurrentSprite.drawDistanceBottomOffset = 0x0;
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.drawDistanceTop = 0x50;
gCurrentSprite.drawDistanceBottom = 0x0;
gCurrentSprite.drawDistanceHorizontal = 0x18;
if (gSpriteData[ramSlot].pose == SAVE_PLATFORM_CHOZODIA_POSE_RELEASE_SAMUS)
{
@ -537,9 +537,9 @@ void SavePlatformChozodiaPartInit(void)
gCurrentSprite.drawOrder = 0xC;
gCurrentSprite.pOam = sSavePlatformChozodiaPartOAM_TubeShadow;
gCurrentSprite.drawDistanceTopOffset = 0x50;
gCurrentSprite.drawDistanceBottomOffset = 0x0;
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.drawDistanceTop = 0x50;
gCurrentSprite.drawDistanceBottom = 0x0;
gCurrentSprite.drawDistanceHorizontal = 0x18;
gCurrentSprite.pose = SAVE_PLATFORM_CHOZODIA_PART_POSE_TUBE_SHADOW_IDLE;
break;
@ -548,9 +548,9 @@ void SavePlatformChozodiaPartInit(void)
gCurrentSprite.drawOrder = 0x5;
gCurrentSprite.pOam = sSavePlatformChozodiaPartOAM_Ray;
gCurrentSprite.drawDistanceTopOffset = 0x8;
gCurrentSprite.drawDistanceBottomOffset = 0x0;
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.drawDistanceTop = 0x8;
gCurrentSprite.drawDistanceBottom = 0x0;
gCurrentSprite.drawDistanceHorizontal = 0x18;
gCurrentSprite.pose = SAVE_PLATFORM_CHOZODIA_PART_POSE_RAY_IDLE;
gCurrentSprite.work0 = 0x60;
@ -558,9 +558,9 @@ void SavePlatformChozodiaPartInit(void)
case SAVE_PLATFORM_CHOZODIA_PART_TOP:
gCurrentSprite.drawOrder = 0x3;
gCurrentSprite.drawDistanceTopOffset = 0x40;
gCurrentSprite.drawDistanceBottomOffset = 0x40;
gCurrentSprite.drawDistanceHorizontalOffset = 0x20;
gCurrentSprite.drawDistanceTop = 0x40;
gCurrentSprite.drawDistanceBottom = 0x40;
gCurrentSprite.drawDistanceHorizontal = 0x20;
gCurrentSprite.pose = SAVE_PLATFORM_CHOZODIA_PART_POSE_TOP_IDLE;
@ -574,9 +574,9 @@ void SavePlatformChozodiaPartInit(void)
gCurrentSprite.drawOrder = 0x5;
gCurrentSprite.pOam = sSavePlatformChozodiaPartOAM_RefillLight;
gCurrentSprite.drawDistanceTopOffset = 0x50;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.drawDistanceHorizontalOffset = 0x14;
gCurrentSprite.drawDistanceTop = 0x50;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.drawDistanceHorizontal = 0x14;
gCurrentSprite.pose = SAVE_PLATFORM_CHOZODIA_PART_POSE_REFILL_LIGHT_IDLE;
break;
@ -768,7 +768,7 @@ void SavePlatformChozodiaPartRayIdle(void)
*/
void SavePlatformChozodia(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
@ -844,7 +844,7 @@ void SavePlatformChozodia(void)
*/
void SavePlatformChozodiaPart(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{

View File

@ -20,14 +20,14 @@ void Searchlight(void)
gCurrentSprite.status = 0x0; // Kill if alarm is active
else
{
gCurrentSprite.drawDistanceTopOffset = 0x20;
gCurrentSprite.drawDistanceBottomOffset = 0x20;
gCurrentSprite.drawDistanceHorizontalOffset = 0x20;
gCurrentSprite.drawDistanceTop = 0x20;
gCurrentSprite.drawDistanceBottom = 0x20;
gCurrentSprite.drawDistanceHorizontal = 0x20;
gCurrentSprite.hitboxTopOffset = -0x30;
gCurrentSprite.hitboxBottomOffset = 0x30;
gCurrentSprite.hitboxLeftOffset = -0x30;
gCurrentSprite.hitboxRightOffset = 0x30;
gCurrentSprite.hitboxTop = -0x30;
gCurrentSprite.hitboxBottom = 0x30;
gCurrentSprite.hitboxLeft = -0x30;
gCurrentSprite.hitboxRight = 0x30;
gCurrentSprite.pOam = sSearchlightOAM_Moving;
gCurrentSprite.animationDurationCounter = 0x0;
@ -40,9 +40,9 @@ void Searchlight(void)
// Set initial direction based on sprite ID
if (gCurrentSprite.spriteId == PSPRITE_SEARCHLIGHT)
gCurrentSprite.status |= (SPRITE_STATUS_FACING_RIGHT | SPRITE_STATUS_UNKNOWN_400);
gCurrentSprite.status |= (SPRITE_STATUS_FACING_RIGHT | SPRITE_STATUS_FACING_DOWN);
else if (gCurrentSprite.spriteId == PSPRITE_SEARCHLIGHT2)
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
else if (gCurrentSprite.spriteId == PSPRITE_SEARCHLIGHT3)
gCurrentSprite.status |= SPRITE_STATUS_FACING_RIGHT;
}
@ -82,12 +82,12 @@ void Searchlight(void)
gCurrentSprite.xPosition -= 0x2;
}
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
// Move down
SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition + BLOCK_SIZE, gCurrentSprite.xPosition);
if (gCurrentAffectingClipdata.movement == CLIPDATA_MOVEMENT_STOP_ENEMY_BLOCK_SOLID)
gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN_400; // Change direction if colliding with stop enemy
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_DOWN; // Change direction if colliding with stop enemy
else
gCurrentSprite.yPosition += 0x2;
}
@ -96,7 +96,7 @@ void Searchlight(void)
// Move up
SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition - BLOCK_SIZE, gCurrentSprite.xPosition);
if (gCurrentAffectingClipdata.movement == CLIPDATA_MOVEMENT_STOP_ENEMY_BLOCK_SOLID)
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400; // Change direction if colliding with stop enemy
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN; // Change direction if colliding with stop enemy
else
gCurrentSprite.yPosition -= 0x2;
}

View File

@ -30,14 +30,14 @@ void SearchlightEyeInit(void)
if (!EventFunction(EVENT_ACTION_CHECKING, EVENT_FULLY_POWERED_SUIT_OBTAINED))
gCurrentSprite.properties |= SP_IMMUNE_TO_PROJECTILES;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE * 3 + EIGHTH_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE * 3 + EIGHTH_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE * 3 + EIGHTH_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE * 3 + EIGHTH_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(QUARTER_BLOCK_SIZE * 3);
gCurrentSprite.hitboxTopOffset = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -(PIXEL_SIZE * 3);
gCurrentSprite.hitboxRightOffset = (PIXEL_SIZE * 3);
gCurrentSprite.hitboxTop = -HALF_BLOCK_SIZE;
gCurrentSprite.hitboxBottom = HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -(PIXEL_SIZE * 3);
gCurrentSprite.hitboxRight = (PIXEL_SIZE * 3);
gCurrentSprite.bgPriority = 1;
gCurrentSprite.pOam = sSearchlightEyeOAM_Idle;
@ -59,7 +59,7 @@ void SearchlightEyeInit(void)
}
if (gCurrentSprite.spriteId == PSPRITE_SEARCHLIGHT_EYE)
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
if (gAlarmTimer != 0)
{
@ -108,7 +108,7 @@ void SearchlightEyeMove(void)
else
xPosition += QUARTER_BLOCK_SIZE;
if (gCurrentSprite.status & SPRITE_STATUS_UNKNOWN_400)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN)
{
// Move down
gCurrentSprite.yPosition += ONE_SUB_PIXEL;
@ -116,7 +116,7 @@ void SearchlightEyeMove(void)
SpriteUtilGetCollisionAtPosition(yPosition + HALF_BLOCK_SIZE, xPosition);
if (gCurrentAffectingClipdata.movement == CLIPDATA_MOVEMENT_STOP_ENEMY_BLOCK_SOLID)
gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN_400; // Change direction
gCurrentSprite.status &= ~SPRITE_STATUS_FACING_DOWN; // Change direction
}
else
{
@ -126,7 +126,7 @@ void SearchlightEyeMove(void)
SpriteUtilGetCollisionAtPosition(yPosition - HALF_BLOCK_SIZE, xPosition);
if (gCurrentAffectingClipdata.movement == CLIPDATA_MOVEMENT_STOP_ENEMY_BLOCK_SOLID)
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400; // Change direction
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN; // Change direction
}
}
@ -227,14 +227,14 @@ void SearchlightEyeBeamInit(void)
{
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(SEARCHLIGHT_EYE_BEAM_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(SEARCHLIGHT_EYE_BEAM_SIZE);
gCurrentSprite.hitboxTopOffset = -EIGHTH_BLOCK_SIZE;
gCurrentSprite.hitboxBottomOffset = EIGHTH_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -SEARCHLIGHT_EYE_BEAM_SIZE;
gCurrentSprite.hitboxRightOffset = SEARCHLIGHT_EYE_BEAM_SIZE;
gCurrentSprite.hitboxTop = -EIGHTH_BLOCK_SIZE;
gCurrentSprite.hitboxBottom = EIGHTH_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -SEARCHLIGHT_EYE_BEAM_SIZE;
gCurrentSprite.hitboxRight = SEARCHLIGHT_EYE_BEAM_SIZE;
gCurrentSprite.bgPriority = 3;
gCurrentSprite.drawOrder = 12;
@ -347,7 +347,7 @@ void SearchlightEyeBeamDetectSamus(void)
*/
void SearchlightEyeBeamDisappear(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
// Flicker
if (MOD_AND(gCurrentSprite.work0, 4) == 0)
@ -364,7 +364,7 @@ void SearchlightEyeBeamDisappear(void)
*/
void SearchlightEye(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
@ -436,12 +436,12 @@ void SearchlightEyeProjectile(void)
gCurrentSprite.status &= ~SPRITE_STATUS_NOT_DRAWN;
gCurrentSprite.properties |= SP_KILL_OFF_SCREEN;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -(QUARTER_BLOCK_SIZE + EIGHTH_BLOCK_SIZE);
gCurrentSprite.hitboxBottomOffset = (QUARTER_BLOCK_SIZE + EIGHTH_BLOCK_SIZE);
gCurrentSprite.hitboxTop = -(QUARTER_BLOCK_SIZE + EIGHTH_BLOCK_SIZE);
gCurrentSprite.hitboxBottom = (QUARTER_BLOCK_SIZE + EIGHTH_BLOCK_SIZE);
gCurrentSprite.pOam = sSearchlightEyeProjectileOAM_Moving;
gCurrentSprite.animationDurationCounter = 0;
@ -454,13 +454,13 @@ void SearchlightEyeProjectile(void)
if (gCurrentSprite.status & SPRITE_STATUS_XFLIP)
{
gCurrentSprite.hitboxLeftOffset = 0;
gCurrentSprite.hitboxRightOffset = (QUARTER_BLOCK_SIZE + EIGHTH_BLOCK_SIZE);
gCurrentSprite.hitboxLeft = 0;
gCurrentSprite.hitboxRight = (QUARTER_BLOCK_SIZE + EIGHTH_BLOCK_SIZE);
}
else
{
gCurrentSprite.hitboxLeftOffset = -(QUARTER_BLOCK_SIZE + EIGHTH_BLOCK_SIZE);
gCurrentSprite.hitboxRightOffset = 0;
gCurrentSprite.hitboxLeft = -(QUARTER_BLOCK_SIZE + EIGHTH_BLOCK_SIZE);
gCurrentSprite.hitboxRight = 0;
}
if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN)

View File

@ -86,13 +86,13 @@ void SecurityGateDefaultOpenInit(void)
gCurrentSprite.pose = 0x9;
}
gCurrentSprite.hitboxTopOffset = -0x100;
gCurrentSprite.hitboxBottomOffset = 0x0;
gCurrentSprite.hitboxLeftOffset = -0x18;
gCurrentSprite.hitboxRightOffset = 0x18;
gCurrentSprite.drawDistanceTopOffset = 0x40;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.drawDistanceHorizontalOffset = 0x8;
gCurrentSprite.hitboxTop = -0x100;
gCurrentSprite.hitboxBottom = 0x0;
gCurrentSprite.hitboxLeft = -0x18;
gCurrentSprite.hitboxRight = 0x18;
gCurrentSprite.drawDistanceTop = 0x40;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.drawDistanceHorizontal = 0x8;
gCurrentSprite.animationDurationCounter = 0x0;
gCurrentSprite.currentAnimationFrame = 0x0;
gCurrentSprite.samusCollision = SSC_NONE;
@ -201,13 +201,13 @@ void SecurityGateDefaultClosedInit(void)
SecurityGateChangeCcaa(CAA_MAKE_NON_POWER_GRIP);
}
gCurrentSprite.hitboxTopOffset = -0x100;
gCurrentSprite.hitboxBottomOffset = 0x0;
gCurrentSprite.hitboxLeftOffset = -0x18;
gCurrentSprite.hitboxRightOffset = 0x18;
gCurrentSprite.drawDistanceTopOffset = 0x40;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.drawDistanceHorizontalOffset = 0x8;
gCurrentSprite.hitboxTop = -0x100;
gCurrentSprite.hitboxBottom = 0x0;
gCurrentSprite.hitboxLeft = -0x18;
gCurrentSprite.hitboxRight = 0x18;
gCurrentSprite.drawDistanceTop = 0x40;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.drawDistanceHorizontal = 0x8;
gCurrentSprite.animationDurationCounter = 0x0;
gCurrentSprite.currentAnimationFrame = 0x0;
gCurrentSprite.samusCollision = SSC_NONE;
@ -248,7 +248,7 @@ void SecurityGateDefaultClosedCloseAfterAlarm(void)
*/
void SecurityGateDefaultOpen(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
case 0x0:
@ -277,7 +277,7 @@ void SecurityGateDefaultOpen(void)
*/
void SecurityGateDefaultClosed(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
switch (gCurrentSprite.pose)
{
case 0x0:

View File

@ -20,44 +20,44 @@ void SecurityLaserInit(void)
if (gCurrentSprite.spriteId == PSPRITE_SECURITY_LASER_VERTICAL || gCurrentSprite.spriteId == PSPRITE_SECURITY_LASER_VERTICAL2)
{
// Initialize vertical laser
gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN_400;
gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN;
// Get size
if (SpriteUtilGetCollisionAtPosition(yPosition - (BLOCK_SIZE * 2 + HALF_BLOCK_SIZE), xPosition) != COLLISION_AIR)
{
gCurrentSprite.pOam = sSecurityLaserOAM_VerticalSmall;
gCurrentSprite.drawDistanceTopOffset = 0x20;
gCurrentSprite.hitboxTopOffset = -0x64;
gCurrentSprite.drawDistanceTop = 0x20;
gCurrentSprite.hitboxTop = -0x64;
gCurrentSprite.work1 = SECURITY_LASER_VERTICAL | SECURITY_LASER_SMALL;
}
else if (SpriteUtilGetCollisionAtPosition(yPosition - (BLOCK_SIZE * 3 + HALF_BLOCK_SIZE), xPosition) != COLLISION_AIR)
{
gCurrentSprite.pOam = sSecurityLaserOAM_VerticalMedium;
gCurrentSprite.drawDistanceTopOffset = 0x30;
gCurrentSprite.hitboxTopOffset = -0xA4;
gCurrentSprite.drawDistanceTop = 0x30;
gCurrentSprite.hitboxTop = -0xA4;
gCurrentSprite.work1 = SECURITY_LASER_VERTICAL | SECURITY_LASER_MEDIUM;
}
else if (SpriteUtilGetCollisionAtPosition(yPosition - (BLOCK_SIZE * 4 + HALF_BLOCK_SIZE), xPosition) != COLLISION_AIR)
{
gCurrentSprite.pOam = sSecurityLaserOAM_VerticalLarge;
gCurrentSprite.drawDistanceTopOffset = 0x40;
gCurrentSprite.hitboxTopOffset = -0xE4;
gCurrentSprite.drawDistanceTop = 0x40;
gCurrentSprite.hitboxTop = -0xE4;
gCurrentSprite.work1 = SECURITY_LASER_VERTICAL | SECURITY_LASER_LARGE;
}
else
{
gCurrentSprite.pOam = sSecurityLaserOAM_VerticalVeryLarge;
gCurrentSprite.drawDistanceTopOffset = 0x50;
gCurrentSprite.hitboxTopOffset = -0x124;
gCurrentSprite.drawDistanceTop = 0x50;
gCurrentSprite.hitboxTop = -0x124;
gCurrentSprite.work1 = SECURITY_LASER_VERTICAL | SECURITY_LASER_VERY_LARGE;
}
gCurrentSprite.drawDistanceBottomOffset = 0x0;
gCurrentSprite.drawDistanceHorizontalOffset = 0x8;
gCurrentSprite.drawDistanceBottom = 0x0;
gCurrentSprite.drawDistanceHorizontal = 0x8;
gCurrentSprite.hitboxBottomOffset = 0x0;
gCurrentSprite.hitboxLeftOffset = -0x8;
gCurrentSprite.hitboxRightOffset = 0x8;
gCurrentSprite.hitboxBottom = 0x0;
gCurrentSprite.hitboxLeft = -0x8;
gCurrentSprite.hitboxRight = 0x8;
}
else
{
@ -66,38 +66,38 @@ void SecurityLaserInit(void)
if (SpriteUtilGetCollisionAtPosition(yPosition - HALF_BLOCK_SIZE, xPosition + BLOCK_SIZE * 2) != COLLISION_AIR)
{
gCurrentSprite.pOam = sSecurityLaserOAM_HorizontalSmall;
gCurrentSprite.drawDistanceHorizontalOffset = 0x18;
gCurrentSprite.hitboxRightOffset = 0x44;
gCurrentSprite.drawDistanceHorizontal = 0x18;
gCurrentSprite.hitboxRight = 0x44;
gCurrentSprite.work1 = SECURITY_LASER_SMALL;
}
else if (SpriteUtilGetCollisionAtPosition(yPosition - HALF_BLOCK_SIZE, xPosition + BLOCK_SIZE * 3) != COLLISION_AIR)
{
gCurrentSprite.pOam = sSecurityLaserOAM_HorizontalMedium;
gCurrentSprite.drawDistanceHorizontalOffset = 0x28;
gCurrentSprite.hitboxRightOffset = 0x84;
gCurrentSprite.drawDistanceHorizontal = 0x28;
gCurrentSprite.hitboxRight = 0x84;
gCurrentSprite.work1 = SECURITY_LASER_MEDIUM;
}
else if (SpriteUtilGetCollisionAtPosition(yPosition - HALF_BLOCK_SIZE, xPosition + BLOCK_SIZE * 4) != COLLISION_AIR)
{
gCurrentSprite.pOam = sSecurityLaserOAM_HorizontalLarge;
gCurrentSprite.drawDistanceHorizontalOffset = 0x38;
gCurrentSprite.hitboxRightOffset = 0xC4;
gCurrentSprite.drawDistanceHorizontal = 0x38;
gCurrentSprite.hitboxRight = 0xC4;
gCurrentSprite.work1 = SECURITY_LASER_LARGE;
}
else
{
gCurrentSprite.pOam = sSecurityLaserOAM_HorizontalVeryLarge;
gCurrentSprite.drawDistanceHorizontalOffset = 0x48;
gCurrentSprite.hitboxRightOffset = 0x104;
gCurrentSprite.drawDistanceHorizontal = 0x48;
gCurrentSprite.hitboxRight = 0x104;
gCurrentSprite.work1 = SECURITY_LASER_VERY_LARGE;
}
gCurrentSprite.drawDistanceTopOffset = 0x10;
gCurrentSprite.drawDistanceBottomOffset = 0x0;
gCurrentSprite.drawDistanceTop = 0x10;
gCurrentSprite.drawDistanceBottom = 0x0;
gCurrentSprite.hitboxTopOffset = -0x28;
gCurrentSprite.hitboxBottomOffset = -0x18;
gCurrentSprite.hitboxLeftOffset = -0x4;
gCurrentSprite.hitboxTop = -0x28;
gCurrentSprite.hitboxBottom = -0x18;
gCurrentSprite.hitboxLeft = -0x4;
}
gCurrentSprite.samusCollision = SSC_ABILITY_LASER_SEARCHLIGHT;
@ -150,7 +150,7 @@ void SecurityLaserIdle(void)
gCurrentSprite.pose = SECURITY_LASER_POSE_DISAPPEARING;
gCurrentSprite.status &= ~SPRITE_STATUS_SAMUS_COLLIDING;
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gCurrentSprite.currentAnimationFrame = 0x0;
gCurrentSprite.animationDurationCounter = 0x0;
@ -203,7 +203,7 @@ void SecurityLaserIdle(void)
*/
void SecurityLaserCheckDespawnAnimEnded(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (SpriteUtilCheckEndCurrentSpriteAnim())
{
@ -258,7 +258,7 @@ void SecurityLaserCheckDespawnAnimEnded(void)
*/
void SecurityLaserSetAlarm(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
gAlarmTimer = ALARM_TIMER_ACTIVE_TIMER;
}
@ -268,7 +268,7 @@ void SecurityLaserSetAlarm(void)
*/
void SecurityLaser_Unused(void)
{
gCurrentSprite.ignoreSamusCollisionTimer = 0x1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (SpriteUtilCheckEndCurrentSpriteAnim())
{

View File

@ -50,22 +50,22 @@ void SidehopperInit(void)
if (gCurrentSprite.status & SPRITE_STATUS_YFLIP)
{
gCurrentSprite.drawDistanceTopOffset = 0x8;
gCurrentSprite.drawDistanceBottomOffset = 0x28;
gCurrentSprite.hitboxTopOffset = 0x0;
gCurrentSprite.hitboxBottomOffset = 0x5C;
gCurrentSprite.drawDistanceTop = 0x8;
gCurrentSprite.drawDistanceBottom = 0x28;
gCurrentSprite.hitboxTop = 0x0;
gCurrentSprite.hitboxBottom = 0x5C;
}
else
{
gCurrentSprite.drawDistanceTopOffset = 0x28;
gCurrentSprite.drawDistanceBottomOffset = 0x8;
gCurrentSprite.hitboxTopOffset = -0x5C;
gCurrentSprite.hitboxBottomOffset = 0x0;
gCurrentSprite.drawDistanceTop = 0x28;
gCurrentSprite.drawDistanceBottom = 0x8;
gCurrentSprite.hitboxTop = -0x5C;
gCurrentSprite.hitboxBottom = 0x0;
}
gCurrentSprite.drawDistanceHorizontalOffset = 0x1C;
gCurrentSprite.hitboxLeftOffset = -0x48;
gCurrentSprite.hitboxRightOffset = 0x48;
gCurrentSprite.drawDistanceHorizontal = 0x1C;
gCurrentSprite.hitboxLeft = -0x48;
gCurrentSprite.hitboxRight = 0x48;
gCurrentSprite.pOam = sSidehopperOAM_Idle;
gCurrentSprite.animationDurationCounter = 0x0;
@ -108,9 +108,9 @@ void SidehopperJumpingInit(void)
gCurrentSprite.work2 = FALSE;
if (gCurrentSprite.status & SPRITE_STATUS_YFLIP)
gCurrentSprite.hitboxBottomOffset = 0x70;
gCurrentSprite.hitboxBottom = 0x70;
else
gCurrentSprite.hitboxTopOffset = -0x70;
gCurrentSprite.hitboxTop = -0x70;
if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN)
SoundPlayNotAlreadyPlaying(0x17F);
@ -129,9 +129,9 @@ void SidehopperLandingInit(void)
gCurrentSprite.pOam = sSidehopperOAM_Landing;
if (gCurrentSprite.status & SPRITE_STATUS_YFLIP)
gCurrentSprite.hitboxBottomOffset = 0x5C;
gCurrentSprite.hitboxBottom = 0x5C;
else
gCurrentSprite.hitboxTopOffset = -0x5C;
gCurrentSprite.hitboxTop = -0x5C;
if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN)
SoundPlayNotAlreadyPlaying(0x180);
@ -186,10 +186,10 @@ void SidehopperJumpWarningGround(void)
{
if (SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition) == COLLISION_AIR)
{
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRight);
if (gPreviousCollisionCheck == COLLISION_AIR)
{
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft);
if (gPreviousCollisionCheck == COLLISION_AIR)
{
SidehopperFallingInit();
@ -233,7 +233,7 @@ void SidehopperJumpingGround(void)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
{
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition - QUARTER_BLOCK_SIZE,
gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset + 0x4);
gCurrentSprite.xPosition + gCurrentSprite.hitboxRight + 0x4);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
@ -248,7 +248,7 @@ void SidehopperJumpingGround(void)
else
{
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition - QUARTER_BLOCK_SIZE,
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset - 0x4);
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft - 0x4);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
@ -280,12 +280,12 @@ void SidehopperJumpingGround(void)
if (!colliding)
{
blockTop = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset);
blockTop = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRight);
if (gPreviousVerticalCollisionCheck != COLLISION_AIR)
colliding++;
else
{
blockTop = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset);
blockTop = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft);
if (gPreviousVerticalCollisionCheck != COLLISION_AIR)
colliding++;
}
@ -301,8 +301,8 @@ void SidehopperJumpingGround(void)
{
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
{
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxTopOffset,
gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxTop,
gCurrentSprite.xPosition + gCurrentSprite.hitboxRight);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
@ -313,8 +313,8 @@ void SidehopperJumpingGround(void)
}
else
{
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxTopOffset,
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxTop,
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
@ -350,7 +350,7 @@ void SidehopperJumpingCeiling(void)
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
{
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + QUARTER_BLOCK_SIZE,
gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset + 0x4);
gCurrentSprite.xPosition + gCurrentSprite.hitboxRight + 0x4);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
@ -365,7 +365,7 @@ void SidehopperJumpingCeiling(void)
else
{
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + QUARTER_BLOCK_SIZE,
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset - 0x4);
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft - 0x4);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
@ -386,8 +386,8 @@ void SidehopperJumpingCeiling(void)
{
if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT)
{
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxBottomOffset,
gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxBottom,
gCurrentSprite.xPosition + gCurrentSprite.hitboxRight);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
@ -398,8 +398,8 @@ void SidehopperJumpingCeiling(void)
}
else
{
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxBottomOffset,
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxBottom,
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft);
if (gPreviousCollisionCheck == COLLISION_SOLID)
{
@ -427,12 +427,12 @@ void SidehopperJumpingCeiling(void)
if (!colliding)
{
blockTop = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset);
blockTop = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRight);
if (gPreviousVerticalCollisionCheck & 0xF)
colliding++;
else
{
blockTop = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset);
blockTop = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft);
if (gPreviousVerticalCollisionCheck & 0xF)
colliding++;
}
@ -475,13 +475,13 @@ void SidehopperFallingGround(void)
else
{
blockTop = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition,
gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset);
gCurrentSprite.xPosition + gCurrentSprite.hitboxRight);
if (gPreviousVerticalCollisionCheck != COLLISION_AIR)
colliding++;
else
{
blockTop = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition,
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset);
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft);
if (gPreviousVerticalCollisionCheck != COLLISION_AIR)
colliding++;
}
@ -529,13 +529,13 @@ void SidehopperFallingCeiling(void)
else
{
blockTop = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition,
gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset);
gCurrentSprite.xPosition + gCurrentSprite.hitboxRight);
if (gPreviousVerticalCollisionCheck != COLLISION_AIR)
colliding++;
else
{
blockTop = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition,
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset);
gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft);
if (gPreviousVerticalCollisionCheck != COLLISION_AIR)
colliding++;
}
@ -574,10 +574,10 @@ void SidehopperIdleGround(void)
SidehopperJumpWarningInit();
else
{
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRight);
if (gPreviousCollisionCheck == COLLISION_AIR)
{
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset);
SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeft);
if (gPreviousCollisionCheck == COLLISION_AIR)
{
SidehopperFallingInit();

View File

@ -20,14 +20,14 @@
void SkreeInit(void)
{
gCurrentSprite.samusCollision = SSC_HURTS_SAMUS;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = 0;
gCurrentSprite.hitboxBottomOffset = BLOCK_SIZE + HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeftOffset = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxRightOffset = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxTop = 0;
gCurrentSprite.hitboxBottom = BLOCK_SIZE + HALF_BLOCK_SIZE;
gCurrentSprite.hitboxLeft = -(QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.hitboxRight = (QUARTER_BLOCK_SIZE + PIXEL_SIZE * 2);
gCurrentSprite.health = GET_PSPRITE_HEALTH(gCurrentSprite.spriteId);
gCurrentSprite.yPosition -= BLOCK_SIZE;
@ -126,12 +126,12 @@ void SkreeGoDown(void)
u32 yMovement;
u32 offset;
blockTop = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.hitboxBottomOffset + gCurrentSprite.yPosition,
blockTop = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.hitboxBottom + gCurrentSprite.yPosition,
gCurrentSprite.xPosition);
if (gPreviousVerticalCollisionCheck != 0)
{
gCurrentSprite.yPosition = blockTop - gCurrentSprite.hitboxBottomOffset;
gCurrentSprite.yPosition = blockTop - gCurrentSprite.hitboxBottom;
gCurrentSprite.pose = SKREE_POSE_CRASHING;
gCurrentSprite.work0 = 0x0;
if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN)
@ -251,14 +251,14 @@ void SkreeExplosionInit(void)
gCurrentSprite.status |= SPRITE_STATUS_IGNORE_PROJECTILES;
gCurrentSprite.properties |= SP_KILL_OFF_SCREEN;
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -(PIXEL_SIZE * 3);
gCurrentSprite.hitboxBottomOffset = (PIXEL_SIZE * 3);
gCurrentSprite.hitboxLeftOffset = -(PIXEL_SIZE * 3);
gCurrentSprite.hitboxRightOffset = (PIXEL_SIZE * 3);
gCurrentSprite.hitboxTop = -(PIXEL_SIZE * 3);
gCurrentSprite.hitboxBottom = (PIXEL_SIZE * 3);
gCurrentSprite.hitboxLeft = -(PIXEL_SIZE * 3);
gCurrentSprite.hitboxRight = (PIXEL_SIZE * 3);
gCurrentSprite.animationDurationCounter = 0;
gCurrentSprite.currentAnimationFrame = 0;
@ -270,8 +270,8 @@ void SkreeExplosionInit(void)
gCurrentSprite.yPosition += HALF_BLOCK_SIZE + PIXEL_SIZE * 2;
gCurrentSprite.status |= SPRITE_STATUS_DOUBLE_SIZE | SPRITE_STATUS_ROTATION_SCALING;
gCurrentSprite.oamScaling = Q_8_8(1.f);
gCurrentSprite.oamRotation = 0;
gCurrentSprite.scaling = Q_8_8(1.f);
gCurrentSprite.rotation = 0;
if (gCurrentSprite.roomSlot != SKREE_EXPLOSION_PART_GOING_UP)
gCurrentSprite.pOam = sSkreeExplosionOAM_GoingDown;
@ -286,17 +286,17 @@ void SkreeExplosionInit(void)
void SkreeExplosionMove(void)
{
if (gCurrentSprite.currentAnimationFrame > 1)
gCurrentSprite.ignoreSamusCollisionTimer = 1;
gCurrentSprite.ignoreSamusCollisionTimer = DELTA_TIME;
if (gCurrentSprite.status & SPRITE_STATUS_XFLIP)
{
gCurrentSprite.xPosition += PIXEL_SIZE * 2;
gCurrentSprite.oamRotation += PI / 4;
gCurrentSprite.rotation += PI / 4;
}
else
{
gCurrentSprite.xPosition -= PIXEL_SIZE * 2;
gCurrentSprite.oamRotation -= PI / 4;
gCurrentSprite.rotation -= PI / 4;
}
if (gCurrentSprite.roomSlot != SKREE_EXPLOSION_PART_GOING_UP)

View File

@ -21,13 +21,13 @@ void SkulteraSetSidesHitbox(void)
{
if (gCurrentSprite.status & SPRITE_STATUS_XFLIP)
{
gCurrentSprite.hitboxLeftOffset = -SKULTERA_TAIL_HITBOX;
gCurrentSprite.hitboxRightOffset = SKULTERA_HEAD_HITBOX;
gCurrentSprite.hitboxLeft = -SKULTERA_TAIL_HITBOX;
gCurrentSprite.hitboxRight = SKULTERA_HEAD_HITBOX;
}
else
{
gCurrentSprite.hitboxLeftOffset = -SKULTERA_HEAD_HITBOX;
gCurrentSprite.hitboxRightOffset = SKULTERA_TAIL_HITBOX;
gCurrentSprite.hitboxLeft = -SKULTERA_HEAD_HITBOX;
gCurrentSprite.hitboxRight = SKULTERA_TAIL_HITBOX;
}
}
@ -79,12 +79,12 @@ void SkulteraInit(void)
// Random direction
SpriteUtilChooseRandomXFlip();
gCurrentSprite.drawDistanceTopOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceBottomOffset = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontalOffset = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.drawDistanceTop = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE * 2);
gCurrentSprite.drawDistanceBottom = SUB_PIXEL_TO_PIXEL(0);
gCurrentSprite.drawDistanceHorizontal = SUB_PIXEL_TO_PIXEL(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxTopOffset = -(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxBottomOffset = 0;
gCurrentSprite.hitboxTop = -(BLOCK_SIZE + HALF_BLOCK_SIZE);
gCurrentSprite.hitboxBottom = 0;
SkulteraSetSidesHitbox();
@ -201,7 +201,7 @@ void SkulteraChasingSamus(void)
u16 spriteY;
u32 nslr;
samusY = gSamusData.yPosition + gSamusPhysics.drawDistanceTopOffset / 2;
samusY = gSamusData.yPosition + gSamusPhysics.drawDistanceTop / 2;
spriteY = gCurrentSprite.yPosition - HALF_BLOCK_SIZE;
// Check move vertically

Some files were not shown because too many files have changed in this diff Show More