-
Notifications
You must be signed in to change notification settings - Fork 10
Add RULE format #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add RULE format #170
Conversation
10fd2e5
to
0e037e7
Compare
Codecov ReportAttention: Patch coverage is
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. |
There was a problem hiding this 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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this right?
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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, |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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));
No description provided.