Skip to content

Commit d7e9179

Browse files
committed
SonicGaugeCode
1 parent a59218b commit d7e9179

11 files changed

Lines changed: 373 additions & 7 deletions

File tree

MarathonRecomp/api/Marathon.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include "Sonicteam/Player/State/IMachine.h"
4747
#include "Sonicteam/Player/State/Machine2.h"
4848
#include "Sonicteam/Player/State/Object2.h"
49+
#include "Sonicteam/Player/State/SonicContext.h"
4950
#include "Sonicteam/Player/State/TailsContext.h"
5051
#include "Sonicteam/SoX/AI/StateMachine.h"
5152
#include "Sonicteam/SoX/Component.h"

MarathonRecomp/api/Sonicteam/GameImp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Sonicteam
1111
{
1212
be<uint32_t> ActorID;
1313
be<uint32_t> RingCount;
14-
MARATHON_INSERT_PADDING(4);
14+
be<uint32_t> TownRingCount;
1515
be<uint32_t> LifeCount;
1616
be<uint32_t> ScoreCount;
1717
be<float> AliveTime;

MarathonRecomp/api/Sonicteam/Player/SonicGauge.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ namespace Sonicteam::Player
1212
be<uint32_t> m_Flags;
1313
be<uint32_t> m_GroundedFlags;
1414
be<float> m_Maximum;
15-
MARATHON_INSERT_PADDING(0x28);
15+
be<float> m_Green;
16+
be<float> m_Red;
17+
be<float> m_Blue;
18+
be<float> m_White;
19+
be<float> m_Sky;
20+
be<float> m_Yellow;
21+
be<float> m_Purple;
22+
be<float> m_Super;
23+
be<float> m_Heal;
24+
be<float> m_HealDelay;
1625
};
1726
}

MarathonRecomp/api/Sonicteam/Player/State/CommonContext.h

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#pragma once
2-
32
#include <Marathon.inl>
43
#include <Sonicteam/Player/State/ICommonContext.h>
54
#include <Sonicteam/Player/IExportPostureRequestFlag.h>
@@ -8,10 +7,35 @@
87

98
namespace Sonicteam::Player::State
109
{
10+
11+
12+
1113
class CommonContext : public ICommonContext, public IExportPostureRequestFlag, public IExportWeaponRequestFlag
1214
{
1315
public:
14-
MARATHON_INSERT_PADDING(0x90);
16+
17+
//(Gordon Ramsay)
18+
enum PostureEnum:uint32_t{
19+
CC_GROUND = 0x1, // detects Ground
20+
CC_WALLBRUSHING = 0x8, // detects brushing against a wall
21+
CC_HEADONWALL = 0x10, // detects head-on wall collision (will always be enabled w/ 2^3)
22+
CC_RAILGRIND = 0x40, // Rail grinding
23+
CC_BEFOREFALL = 0x100, // seems like Neutral or Pre-Fall? The moment before transitioning from the Jump to Fall animation
24+
CC_FALL = 0x200, // FALL
25+
CC_WATERLCOL = 0x800, // Water collision (making you slide down an incline)? 2^8(CC_BEFOREFALL) is often set with this
26+
CC_LIGHTDASHIN = 0x4000, // Light Dashing (2 ^ 14)
27+
CC_QUICKROTATE = 0x8000, // is moving the control stick in a non-forward direction (usually only active for a frame since the character instantly rotates)
28+
CC_TENTATIVE = 0x10000, // is Tentative collision
29+
CC_WATERSLIDE = 0x20000, // Water sliding (2^17)
30+
CC_GRASS = 0x100000, // grass 2^20
31+
CC_DIRTCLAY = 0x200000, // dirt/clay (2^21)
32+
CC_STONE = 0x400000, // stone (2^22)
33+
CC_SHORELINE = 0x1000000, // shoreline? sand? Uncertain (2^24)
34+
};
35+
36+
MARATHON_INSERT_PADDING(0x2C);
37+
be<uint32_t> m_PostureFlags;
38+
MARATHON_INSERT_PADDING(0x60);
1539
xpointer<Score> m_pScore;
1640
MARATHON_INSERT_PADDING(0x104);
1741
};

MarathonRecomp/api/Sonicteam/Player/State/ContextSpeedAndJump.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,11 @@
44

55
namespace Sonicteam::Player::State
66
{
7-
class ContextSpeedAndJump {};
7+
class ContextSpeedAndJump
8+
{
9+
be<float> base_speed_z;
10+
be<float> gimmick_speed_z;
11+
be<float> base_speed_y;
12+
be<float> gimmick_speed_y;
13+
};
814
}

MarathonRecomp/api/Sonicteam/Player/State/ICommonContext.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#pragma once
2-
32
#include <Marathon.inl>
43
#include <Sonicteam/Player/State/ContextSpeedAndJump.h>
54
#include <Sonicteam/Player/State/ICommonContextIF.h>
@@ -10,6 +9,13 @@ namespace Sonicteam::Player::State
109
class ICommonContext : public IContext, public ICommonContextIF, public ContextSpeedAndJump
1110
{
1211
public:
13-
MARATHON_INSERT_PADDING(0x60);
12+
be<uint32_t> m_CurrentAnimation;
13+
be<float> m_LockInputTime;
14+
be<uint32_t> m_LastVelocityZ;
15+
be<uint32_t> m_LastVelocityY;
16+
be<uint32_t> m_LastLockInputTime;
17+
be<uint32_t> m_Input;
18+
MARATHON_INSERT_PADDING(0x38);
1419
};
20+
1521
}

MarathonRecomp/api/Sonicteam/Player/State/Machine2.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <Sonicteam/Player/State/IContext.h>
55
#include <Sonicteam/Player/State/IMachine.h>
66
#include <Sonicteam/SoX/AI/StateMachine.h>
7+
#include <Sonicteam/Player/State/IContext.h>
78

89
namespace Sonicteam::Player::State
910
{
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#pragma once
2+
#include <Marathon.inl>
3+
#include <Sonicteam/Player/State/CommonContext.h>
4+
#include <Sonicteam/Player/SonicGauge.h>
5+
#include <boost/smart_ptr/shared_ptr.h>
6+
7+
8+
namespace Sonicteam::Player::State
9+
{
10+
class SonicContext : public CommonContext
11+
{
12+
public:
13+
14+
15+
//Sprite
16+
enum GemsS:uint32_t {
17+
SGreen = 1,
18+
SRed,
19+
SBlue,
20+
SWhite,
21+
SSky,
22+
SYellow,
23+
SPurple,
24+
SSuper
25+
};
26+
enum Gems:uint32_t {
27+
Blue = 1,
28+
Red,
29+
Green,
30+
Purple,
31+
Sky,
32+
White,
33+
Yellow,
34+
Super
35+
};
36+
37+
38+
39+
be<GemsS> m_CurrentGemSprite;
40+
boost::shared_ptr<Sonicteam::Player::SonicGauge> m_Gauge;
41+
uint8_t m_HomingLockOn;
42+
uint8_t m_DisablePlayerMovement;
43+
uint8_t m_AntigravityHitBox;
44+
uint8_t m_23F;
45+
uint8_t m_BoundAttackHitBox;
46+
uint8_t m_241;
47+
uint8_t m_Shrink;
48+
uint8_t m_ThunderGuard;
49+
uint8_t m_Tornado;
50+
uint8_t m_FPS;
51+
uint8_t m_ThrowGem;
52+
uint8_t m_SlowTime;
53+
uint8_t m_MachAura;
54+
uint8_t m_GemsEnabled;
55+
uint8_t m_24A;
56+
uint8_t m_24B;
57+
be<uint32_t> m_HomingFlip;
58+
be<Gems> m_CurrentGem;
59+
};
60+
}

0 commit comments

Comments
 (0)