-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Build limit group #1243
base: develop
Are you sure you want to change the base?
Build limit group #1243
Conversation
# Conflicts: # YRpp
# Conflicts: # docs/Whats-New.md # src/Ext/TechnoType/Body.cpp # src/Ext/TechnoType/Body.h
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
I'll do a full code review later but I tested this in both skirmish and MP and it appeared to work fine, no crashes and no desyncs. |
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.
Looks mostly fine, couple of minor code style nitpicks though.
fa4ddd1
to
f995fe6
Compare
moved all hooks into Hooks.Upgrade and removed Hooks.BuildLimits, tho I didn't find out a duplicate of hook 0x50B669 yet I've asked ststl and made sure that __fastcall can be removed here. Also fixed other code style issues |
Why is non-upgrade related code in |
According to the suggestion of MigEater I've added these additional functions:
[SOMETECHNO] ; TechnoType
BuildLimitGroup.Factor=1 ; integer
BuildLimitGroup.ExtraLimit.Types= ; list of TechnoType names
BuildLimitGroup.ExtraLimit.Nums= ; list of integers
BuildLimitGroup.ExtraLimit.MaxCount= ; list of integers
BuildLimitGroup.ExtraLimit.MaxNum=0 ; integer Please test and review it when you have time, cuz I'm not 100% sure my calculation logic is correct |
29dbf4a
to
46ec38b
Compare
Different technos can now share build limit within a group. Originally implemented by ststl. I've gotten the permission to transplant it to mainline Phobos and make further enhancement on it.
BuildLimitGroup.Types
determines the technos that'll be used for build limit conditions of the selected techno.BuildLimitGroup.Nums
determines the amount of technos that would reach the build limit. If using a single integer, it'll use the sum of all technos in the group to calculate build limit. If using a list of integers with the same size ofBuildLimitGroup.Types
, it'll calculate build limit per techno.BuildLimitGroup.ContentIfAnyMatch
determines the rule of calculating build limit per techno. If set to true, build limit will be content if the amount of any techno in the group reaches itsBuildLimitGroup.Nums
value. If set to false, then it'll only be content if the amount of all technos in the group reached.BuildLimitGroup.NotBuildableIfQueueMatch
determines the moment to stop the techno's production. If set to true, its production will be stopped once the condition is content by the sum of real technos and technos in production queue. If set to false, it'll only be stopped when the condition is content by real technos.In
rulesmd.ini
: