Change target Owner on warhead impact
[SOMEWARHEAD] ; Warhead IsOwnerChanger = yes ; boolean IsOwnerChanger.SetAsMindControl = no ; boolean, sets control as PermanentMindControl IsOwnerChanger.MindControlAnim = SOMEANIM ; animation on target when SetAsMindControl = yes IsOwnerChanger.AffectElites = yes ; boolean, sets if elite veterancy units can be affected to owner change. IsOwnerChanger.HealthThreshold = 1.0 ; float, target minimal health percentage to have owner changed.
Summary by CodeRabbit
-
New Features
- Introduced the ability for warheads to change the ownership of targets upon impact, including mind control effects and specific conditions like health thresholds and elite status.
-
Documentation
- Updated documentation to include details on the new warhead owner change functionality and its configuration parameters.
Nightly build for this pull request:
- compiled-dll-1aab7428a69307dbdb99ea1243649212893500e9.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.
Walkthrough
The latest update introduces the ability for warheads to change the ownership of targets upon detonation, incorporating mind control effects and various conditions such as immunity, armor type, health thresholds, and elite status. This enhancement allows for more strategic depth in gameplay, enabling players to turn enemy units to their side under specific circumstances.
Changes
| Files | Change Summary |
|---|---|
.../WarheadType/Body.cpp, .../Body.h, .../Detonate.cpp |
Added functionality for changing the owner of targets upon warhead impact, including properties for mind control effects, health thresholds, and handling elite units. Introduced ApplyOwnerChange method and updated DetonateOnOneUnit function. |
docs/Whats-New.md, docs/New-or-Enhanced-Logics.md |
Documented the new owner change functionality on warhead impact and the associated parameters in rulesmd.ini. |
🎉🚀🐰
In the realm of code, where warheads fly,
A change of heart, under the digital sky.
From foe to friend, with a magic blast,
A twist in fate, allies recast.
Let's hop with joy, for the new dawn,
Where battles sway, before they're won. 🌈💥
- @coderabbitai
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:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>. -
Generate unit-tests for this file.
-
- 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 tests 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 from git and render them as a table. -
@coderabbitai show all the console.log statements in this repository. -
@coderabbitai read src/utils.ts and generate unit tests. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
-
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 a review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai helpto get help.
Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
CodeRabbit Configration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - The JSON schema for the configuration file is available here.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json
CodeRabbit Discord Community
Join our Discord Community to get help, request features, and share feedback.
The IsOwnerChanger.ControlAnim anim doesn't follow the unit around like the normal mindcontrol animation as I would have expected. If not a bug, could this be added as an option?
The
IsOwnerChanger.ControlAnimanim doesn't follow the unit around like the normal mindcontrol animation as I would have expected. If not a bug, could this be added as an option?
weird, can you please provide settings for owner changer? As I tested, my anim is following techno as should
It's a bit messed up. If this is supposed to be a generic house change, fine, but do not mess up with existing MindControl or permanent mind control logic. Even if it's for a generic house change, a simple ownership change vtbl call is not sufficient. I would suggest you look at how it's done for permanent mind control in YR and Ares in the first place. Same issue with all your other pr. btw it seems the bot is triggered upon every commit, so plz don't just merge from upstream constantly
I'm not touching MC, instead I'm using PermaMC as it's much simpler. The only issue is that ownerchanged units without PermaMC set, allowed to enter in transports, makes their attached animation (if its looping) dissapear on leaving transport. So I'll just drop it for ares' attached anim instead.
weird, can you please provide settings for owner changer? As I tested, my anim is following techno as should
The nightly build seems to be failing so I can't test your latest changes but here's what I have
[Controller]
AnimList=YURICNTL
; MindControl=yes
Verses=100%,100%,100%,100%,100%,100%,0%,0%,0%,100%,100%
IsOwnerChanger=yes
IsOwnerChanger.SetAsMindControl=yes
IsOwnerChanger.ControlAnim=MINDANIM
IsOwnerChanger.AffectElites=yes
IsOwnerChanger.HealthThreshold=1.0
[MINDANIM]
LoopCount=-1
Rate=300
I also tested with EMP_FX01 and MINDANIMR (unchanged from vanilla).
Yep, as I thought, now 'ControlAnim' changed to 'MindControlAnim' and will follow target as it should.