Path: blob/master/SonicMania/Objects/GHZ/BurningLog.c
338 views
// ---------------------------------------------------------------------1// RSDK Project: Sonic Mania2// Object Description: BurningLog Object3// Object Author: Christian Whitehead/Simon Thomley/Hunter Bridges4// Decompiled by: Rubberduckycooly & RMGRich5// ---------------------------------------------------------------------67#include "Game.h"89ObjectBurningLog *BurningLog;1011void BurningLog_Update(void)12{13RSDK_THIS(BurningLog);1415RSDK.ProcessAnimation(&self->animator);1617if (RSDK.CheckOnScreen(self, &self->updateRange)) {18self->position.y += self->velocity.y;19self->velocity.y += 0x3800;20foreach_active(Player, player)21{22if (self->velocity.y < 0x380000)23Player_CheckCollisionPlatform(player, self, &BurningLog->hitboxPlatform);2425if (Player_CheckCollisionTouch(player, self, &BurningLog->hitboxFlame)) {26Player_ElementHurt(player, self, SHIELD_FIRE);27}28}29}30else {31destroyEntity(self);32}33}3435void BurningLog_LateUpdate(void) {}3637void BurningLog_StaticUpdate(void) {}3839void BurningLog_Draw(void)40{41RSDK_THIS(BurningLog);42RSDK.DrawSprite(&self->animator, NULL, false);43}4445void BurningLog_Create(void *data)46{47RSDK_THIS(BurningLog);48self->active = ACTIVE_NORMAL;49self->visible = true;50self->updateRange.x = 0x800000;51self->updateRange.y = 0x10000000;52self->drawGroup = Zone->objectDrawGroup[0];5354if (data)55self->timer = VOID_TO_INT(data);5657RSDK.SetSpriteAnimation(BurningLog->aniFrames, 0, &self->animator, true, 0);58}5960void BurningLog_StageLoad(void)61{62if (RSDK.CheckSceneFolder("GHZ"))63BurningLog->aniFrames = RSDK.LoadSpriteAnimation("GHZ/Fireball.bin", SCOPE_STAGE);6465BurningLog->hitboxPlatform.left = -8;66BurningLog->hitboxPlatform.top = -8;67BurningLog->hitboxPlatform.right = 8;68BurningLog->hitboxPlatform.bottom = 8;6970BurningLog->hitboxFlame.left = -8;71BurningLog->hitboxFlame.top = -16;72BurningLog->hitboxFlame.right = 8;73BurningLog->hitboxFlame.bottom = 8;74}7576#if GAME_INCLUDE_EDITOR77void BurningLog_EditorDraw(void) { BurningLog_Draw(); }7879void BurningLog_EditorLoad(void) { BurningLog->aniFrames = RSDK.LoadSpriteAnimation("GHZ/Fireball.bin", SCOPE_STAGE); }80#endif8182void BurningLog_Serialize(void) { RSDK_EDITABLE_VAR(BurningLog, VAR_ENUM, timer); }838485