Skip to content
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

T2 Constructor Sharing Mode #4447

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

keithharvey
Copy link

@keithharvey keithharvey commented Mar 3, 2025

Closes #4416

Note for PR mergers: This is downstream and contains commits from #4433

T2 Constructor Sharing Mode

This implementation converts the "Disable Unit Sharing" option into a dropdown with three choices as requested:

  • Enabled (default)
  • T2 Constructor Sharing Only (new)
  • Disabled

Implementation Approach

  • Added logic to identify T2 constructors using customParams.techlevel
  • Properly checks if units are mobile constructors (not factories)
  • Preserves existing behavior for market units and captures

Testing Results

Verified with various unit types:

  • T2 constructors (armack, corack, legack) - sharing allowed
  • T1 constructors, factories, combat units - sharing blocked
  • Market units and captured units - sharing allowed as before

The implementation successfully provides the middle ground option requested in the original PR, allowing strategic sharing of build power while maintaining unit ownership boundaries.

Before

Image

After

Image

Removes automatic enabling and locking of unit sharing and assist
construction settings when resource sharing tax is non-zero. Each
setting now operates independently.

gh beyond-all-reason#4415
- Remove redundant whitelist and AllowUnitTransfer implementation
- Remove unused disable_unit_sharing and unitSharingMode variables
- Rely solely on unitPrice unit rules parameter for transfer control
- Clean up code to use standardized Spring unit rules parameter system

This change simplifies the unit market code by removing redundant unit sharing
checks that were previously used alongside the whitelist system. Now the market
relies solely on the unitPrice unit rules parameter to handle unit transfers,
which is properly checked by game_disable_unit_sharing.lua. This makes the code
cleaner and removes potential conflicts between the two gadgets.
Adds a middle ground between full unit sharing and no sharing by allowing
only T2 mobile constructors to be transferred between allies. This enables
strategic sharing of build power while maintaining unit ownership separation.

gh beyond-all-reason#4416
Rename disable_unit_sharing to unit_sharing_mode to better reflect its
current function as a multi-mode control rather than a simple disable
switch.
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.

Disabled Unit Sharing Except T2
1 participant