SW tag that grants 1-time-use super weapons
- Superweapons can add 1-time superweapons to the firer like the nuke crate. Granted types can be additionally randomized using the same rules as with LimboDelivery (see above).
SW.GrantOneTime.InitialReadyspecifies if all new granted superweapons will be ready for launch. If not set this behaviour will be managed bySW.InitialReadyof the granted superweapon.SW.GrantOneTime.ReadyIfExistsspecifies if superweapons should be ready for launch if already exists. If not set this behaviour will be managed bySW.GrantOneTime.InitialReadyorSW.InitialReadyof the granted superweapon.SW.GrantOneTime.ResetIfExistsspecifies if superweapons timers should be reset if already exists. Takes precedence overSW.GrantOneTime.ReadyIfExists,SW.GrantOneTime.InitialReadyandSW.InitialReady.Message.GrantOneTimeLaunchedwill be displayed to the firer when the main superweapon is launched.EVA.GrantOneTimeLaunchedwill be played to the firer when the main superweapon is launched.- These superweapons can be made random with these optional tags. The game will randomly choose only a single superweapon from the list for each roll chance provided.
SW.GrantOneTime.RollChanceslists chances of each "dice roll" happening. Valid values range from 0% (never happens) to 100% (always happens). Defaults to a single sure roll.SW.GrantOneTime.RandomWeightsNlists the weights for each "dice roll" that increase the probability of picking a specific superweapon. Valid values are 0 (don't pick) and above (the higher value, the bigger the likelyhood).RandomWeightsare a valid alias forRandomWeights0. If a roll attempt doesn't have weights specified, the last weights will be used.
In rulesmd.ini:
[SOMESW] ; Super Weapon
SW.GrantOneTime= ; List of super weapons
SW.GrantOneTime.RollChances= ; List of percentages.
SW.GrantOneTime.RandomWeightsN= ; List of integers.
SW.GrantOneTime.InitialReady= ; boolean
SW.GrantOneTime.ReadyIfExists= ; boolean
SW.GrantOneTime.ResetIfExists=false ; boolean
Message.GrantOneTimeLaunched= ; CSF entry key
EVA.GrantOneTimeLaunched= ; EVA entry
- Tested in skirmish & in online and no desyncs were found.
- This grants a list of super weapons of only 1 use. Is like if you picked a Nuke SW from a crate so if you remember it doesn't follow the standard checks of the super weapons like aux./neg buildings etc.
Summary by CodeRabbit
- New Features
- Enhanced gameplay with the ability to grant one-time superweapons, adding strategic depth to the game.
- Documentation
- Updated documentation to explain the new one-time superweapon granting system and its impact on gameplay.
- Enhancements
- Improved superweapon mechanics to support one-time use superweapons, including readiness management and in-game messaging for a better player experience.
Walkthrough
The 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
| Files | Change Summary |
|---|---|
docs/New-or-Enhanced-Logics.md |
Added functionality to grant new superweapons in superweapons, allowing superweapons to add 1-time superweapons to the firer like the nuke crate. Introduces parameters for managing readiness and messaging related to the granted superweapons. |
src/Ext/SWType/Body.cpp, src/Ext/SWType/Body.h |
Added serialization and deserialization processes for SW_GrantOneTime, SW_GrantOneTime_InitialReady, SW_GrantOneTime_RandomWeightsData, SW_GrantOneTime_RollChances, Message_GrantOneTimeLaunched, and EVA_GrantOneTimeLaunched in the ExtData class. Added new member variables SW_GrantOneTime, SW_GrantOneTime_InitialReady, SW_GrantOneTime_RollChances, Message_GrantOneTimeLaunched, and EVA_GrantOneTimeLaunched, along with the method GrantOneTimeFromList, to the SWTypeExt class in Body.h. |
src/Ext/SWType/FireSuperWeapon.cpp |
Added functionality to grant super weapons one time from a list based on certain conditions, including resetting readiness and displaying messages. |
🐰✨
In the realm of code, where battles are fought,
A new power emerges, not sold but sought.
With a hop and a skip, Starkku's magic unfurls,
Granting one-time wonders, changing the world.
🚀💥
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?
Tips
Chat
There are 3 ways to chat with CodeRabbit:
:bangbang: IMPORTANT Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai generate interesting stats about this repository and render them as a table.@coderabbitai show all the console.log statements in this repository.@coderabbitai read src/utils.ts and generate unit testing code.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
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 as PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
Nightly build for this pull request:
- compiled-dll-a5df2e45d2a309c180526386eb15e20ee76e10bc.zip These artifacts will expire in 90 days and will not be available for download after that time.
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.
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