Skip to content

Conversation

henriquegemignani
Copy link
Member

No description provided.

Copy link

codecov bot commented Jan 26, 2025

Codecov Report

Attention: Patch coverage is 91.42857% with 3 lines in your changes missing coverage. Please review.

Project coverage is 69.85%. Comparing base (6f094a3) to head (0e037e7).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/retro_data_structures/formats/rule.py 91.17% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #170      +/-   ##
==========================================
+ Coverage   69.71%   69.85%   +0.13%     
==========================================
  Files          88       89       +1     
  Lines        5564     5599      +35     
==========================================
+ Hits         3879     3911      +32     
- Misses       1685     1688       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@duncathan duncathan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could optionally remove RULE from dependency_cheating, but it's accurate and fast so idc much either way

class RuleSet(BaseResource):
@classmethod
def resource_type(cls) -> AssetType:
return "SAND"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. Don't remember.


Action = construct.Struct(
id=FourCC,
properties=construct.PrefixedArray(construct.Int8ub, construct.Int32ub),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot_20250410_205841_Discord
might be more like...

def rebuild_action_count(ctx):
    if ctx.prop3 != 0:
        return 3
    if ctx.prop2 != 1:
        return 2
    return 1
count=construct.Rebuild(construct.Int8ub, rebuild_action_count),
prop1=construct.Float32b,
prop2=construct.If(construct.this.count >= 2, construct.Int32ub),
prop3=construct.If(construct.this.count >= 3, construct.Int32ub),

?

)

Action = construct.Struct(
id=FourCC,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we really oughta make an enum out of this



RuleCondition = construct.Struct(
id=FourCC,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one too. yonder posted this list which should correspond with one of these:

typedef enum ERuleItem {
    kRI_SZ_MIN = INT_MIN,
    
    kRI_CapacityDarkAmmo = 0x4344414D,
    kRI_RemainingMissile = 0x3F4D534C,
    kRI_PercentPowerBomb = 0x2550424D,
    kRI_PercentLightAmmo = 0x254C414D,
    kRI_PercentDarkAmmo = 0x2544414D,
    kRI_PercentMissile = 0x254D534C,
    kRI_RemainingHealth = 0x3F484C54,
    kRI_RemainingDarkBeam = 0x3F44424D, // Dark Ammo; checks if you have Dark Beam
    kRI_RemainingLightBeam = 0x3F4C424D, // Light Ammo; checks if you have Light Beam
    kRI_AmountLightAmmo = 0x414C414D,
    kRI_AmountDarkAmmo = 0x4144414D,
    kRI_RemainingPowerBomb = 0x3F50424D,
    kRI_AmountHealth = 0x41484C54,
    kRI_AmountMissile = 0x414D534C,
    kRI_Always = 0x414C5753,
    kRI_AmountPowerBomb = 0x4150424D,
    kRI_KonstWhenAnnihilatorBeam = 0x4B574142,
    kRI_HasDarkBeam = 0x4844424D,
    kRI_CapacityMissile = 0x434D534C,
    kRI_CapacityLightAmmo = 0x434C414D,
    kRI_CapacityPowerBomb = 0x4350424D,
    kRI_Unk_KFCH = 0x4B464348,
    kRI_HasLightBeam = 0x484C424D,
    kRI_KonstWhenAnyBeam = 0x4B4C4442,
    kRI_KonstWhenLightBeam = 0x4B574C42,
    kRI_KonstWhenDarkBeam = 0x4B574442,
    kRI_Unk_KWCB = 0x4B574342,
    kRI_Unk_KWKB = 0x4B574B42,
    kRI_Unk_KWPB = 0x4B575042,
    kRI_Unk_KWMS = 0x4B574D53,
    kRI_PercentHealth = 0x50484C54,
    
    kRI_SZ_MAX = INT_MAX
} PACK ERuleItem_t;

static_assert(alignof(ERuleItem_t) == 4);
static_assert(sizeof(ERuleItem_t) == sizeof(int32_t));

typedef enum ERuleType {
    kRT_SZ_MIN = INT_MIN,
    
    kRT_Bool = 0,
    kRT_Float,
    kRT_Int32,
    
    kRT_SZ_MAX = INT_MAX
} PACK ERuleType_t;

static_assert(alignof(ERuleType_t) == 4);
static_assert(sizeof(ERuleType_t) == sizeof(int32_t));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants