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

Change Command: god #114

Open
DestroyedClone opened this issue Dec 22, 2021 · 1 comment
Open

Change Command: god #114

DestroyedClone opened this issue Dec 22, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@DestroyedClone
Copy link
Contributor

Which Command
god

What should it do?
Include (or make a new command) an extra parameter for "true" godmode. The current godmode matches with what the game defines as godmode.
This secondary version should include immunity to HealthComponent's Suicide() and by extension, TrueKill (preventing the method from running, as it alters the Dio's Best Friend item count).
It shouldn't be replacing the first version as it will still be desirable to test the game's definition of godmode.

For this secondary version, consider marking the player as this "true godmode" state.
For MapZone.TryZoneStart, consider a subscription that mirrors this: https://github.com/KomradeSpectre/AetheriumMod/blob/rewrite-master/Aetherium/Items/UnstableDesign.cs#L505-L520
For HealthComponent.Suicide, consider returning after doing a NetworkServer check and checking for true godmode
For CharacterMaster.TrueKill, consider the same as the above.

Issue
godmode does not protect against HealthComponent.Suicide(), which is (iirc) called by: MapZone.TryZoneStart (if it's not on the player team), kill_all DT command, and the death attack of Void Reavers.
CharacterMaster.TrueKill() seems to just call HealthComponent.Suicide() and also cancel the invocation of the respawning methods.
The MapZone death can be accomplished by using change_team to switch to a non-player team.

@DestroyedClone DestroyedClone added the enhancement New feature or request label Dec 22, 2021
@SChinchi
Copy link
Collaborator

Unless I'm missing something, or the code has changed since this issue was made, HealthComponent.Suicide does check for god immunity.

CharacterMaster.TrueKill is also called a few other situations, such as running out of time on the moon (the game over is still inevitable), or entering Bulwark's Ambry while on team Monster. I guess one could skip the call to avoid modifying the reviving items, but it is really much of an issue with give_item?

With regards to MapZone.TryZoneStart, it depends on what behaviour one wants. If you're on team Monster, for example, and you jump off a cliff, you die. It makes sense that if you have god mode, you avoid the death but you keep falling forever. I think it's less consistent to die in one case, but tp back in the other.

What I think is missing from god mode though is protecting against negative regen, i.e., Heretic and the HealthDecay item. This is managed by HealthComponent.ServerFixedUpdate. Negative regen modifies your health directly, with no way to intercept it. The only way I can think of is capping it to 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants