-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
SW tag that grants 1-time-use super weapons #1199
base: develop
Are you sure you want to change the base?
Conversation
- Superweapons can add 1-time superweapons to the firer like the famous nuke crate. - `SW.GrantOneTime.InitialReady` specifies if all new granted superweapons will be ready for launch. If not set this behaviour will be managed by `SW.InitialReady` of the granted superweapon. - `Message.GrantOneTimeLaunched` will be displayed to the firer when the main superweapon is launched. - `EVA.GrantOneTimeLaunched` will be played to the firer when the main superweapon is launched. In `rulesmd.ini`: ```ini [SOMESW] ; Super Weapon SW.GrantOneTime= ; List of Superweapons SW.GrantOneTime.InitialReady= ; boolean Message.GrantOneTimeLaunched= ; CSF entry key EVA.GrantOneTimeLaunched= ; EVA entry ``` - Tested in skirmish & in online and no desyncs were found. - This grants super weapons of only 1 use. Is like if you picked a Nuke SW from a crate so it doesn't follow the standard checks of the super weapons like aux./neg buildings etc.
WalkthroughThe project introduced a new feature that allows the granting of one-time superweapons to units, similar to acquiring a nuke crate. This enhancement includes serialization for persistence, initial readiness state management, and user feedback through messages. Starkku and FS-21 contributed to these changes, focusing on improving gameplay dynamics by adding more strategic options for players. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (6)
- CREDITS.md (1 hunks)
- docs/New-or-Enhanced-Logics.md (1 hunks)
- docs/Whats-New.md (1 hunks)
- src/Ext/SWType/Body.cpp (2 hunks)
- src/Ext/SWType/Body.h (3 hunks)
- src/Ext/SWType/FireSuperWeapon.cpp (3 hunks)
Additional comments: 9
src/Ext/SWType/Body.h (2)
- 66-69: Ensure the naming convention of the new member variables is consistent with the existing codebase and accurately reflects their purpose.
- 130-130: The method
GrantOneTimeFromList
is correctly placed within the class and follows the naming conventions. Ensure its implementation aligns with the intended functionality.src/Ext/SWType/Body.cpp (2)
- 48-51: The serialization process for the new member variables is correctly implemented. Ensure it aligns with the project's data handling standards.
- 187-190: The deserialization process for the new member variables from the INI file is correctly implemented. Verify that all necessary error handling and validation are in place.
src/Ext/SWType/FireSuperWeapon.cpp (2)
- 37-38: The conditional check for the existence of one-time superweapons to grant is correctly implemented. Ensure the subsequent method call is properly handling all scenarios.
- 322-378: The implementation of
GrantOneTimeFromList
method appears to correctly grant superweapons based on specified conditions. Ensure that performance implications of looping through superweapons and condition checks are acceptable and that all edge cases are handled.CREDITS.md (1)
- 132-132: The addition to the CREDITS.md file correctly acknowledges Starkku's contribution to the project. Ensure the formatting is consistent with the rest of the document.
docs/Whats-New.md (1)
- 358-358: The addition of the feature to grant new superweapons in superweapons is documented. Ensure this feature is consistently referenced and detailed in other relevant documentation files to maintain coherence across the project documentation.
docs/New-or-Enhanced-Logics.md (1)
- 652-667: The documentation clearly explains the new functionality for granting superweapons, including parameters for initial readiness, and user feedback through messages and EVA announcements.
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. |
- Added the RandomWeights and RollChances tags like the ones used in LimboDelibery and SW.Next
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (4)
- docs/New-or-Enhanced-Logics.md (1 hunks)
- src/Ext/SWType/Body.cpp (2 hunks)
- src/Ext/SWType/Body.h (3 hunks)
- src/Ext/SWType/FireSuperWeapon.cpp (3 hunks)
Files skipped from review as they are similar to previous changes (3)
- docs/New-or-Enhanced-Logics.md
- src/Ext/SWType/Body.cpp
- src/Ext/SWType/FireSuperWeapon.cpp
Additional comments: 4
src/Ext/SWType/Body.h (4)
- 63-63: Ensure
SW_GrantOneTime_RandomWeightsData
is used appropriately within the class, especially in the newGrantOneTimeFromList
method, to manage the randomness of granting superweapons effectively.- 67-71: The addition of
SW_GrantOneTime
,SW_GrantOneTime_InitialReady
,SW_GrantOneTime_RollChances
,Message_GrantOneTimeLaunched
, andEVA_GrantOneTimeLaunched
variables is consistent with the PR objectives. Verify that these variables are properly initialized, serialized, and deserialized to ensure their correct functionality across game sessions.- 108-113: Initialization of the new member variables in the
ExtData
constructor is correct. However, ensure thatNullable
andValueable
types are used appropriately throughout the class to handle optional and default values correctly, especially forSW_GrantOneTime_InitialReady
andEVA_GrantOneTimeLaunched
.- 134-134: The method
GrantOneTimeFromList
is crucial for the new feature. Ensure it correctly implements the logic for granting one-time-use superweapons, including handling the randomness, initial readiness, and user feedback through messages and EVA announcements. Additionally, verify that it properly interacts with other game systems and does not introduce any side effects or performance issues.
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.
other than the issues in comment it looks fine
Honestly I'm not sure how'll SuperClass::Grant handle a superweapon that's already owned by the house. But I would suggest to add extra options for these already-existed SWs for more extendibility. An example below In rulesmd.ini: SW.GrantOneTime.ReadyIfExist= ; boolean, when the granted superweapon is already existed, its cooldown will be cleared if set to true
SW.GrantOneTime.ResetIfExist= ; boolean, when the granted superweapon is already existed, its cooldown will be reset if set to true Technically you can even set superweapon's timer to any given value or percentage here |
Applied feedback from code reviews
SW.GrantOneTime.ResetIfExists
Added, documented & tested these 2 tags in skirmish: Takes precedence this last one if requisites are met. |
SW.GrantOneTime.InitialReady
specifies if all new granted superweapons will be ready for launch. If not set this behaviour will be managed bySW.InitialReady
of the granted superweapon.Message.GrantOneTimeLaunched
will be displayed to the firer when the main superweapon is launched.EVA.GrantOneTimeLaunched
will be played to the firer when the main superweapon is launched.In
rulesmd.ini
:Summary by CodeRabbit