Implement animation effects for various tools#60
Conversation
This reverts commit 438bc1b.
Extremelyd1
left a comment
There was a problem hiding this comment.
Thanks for the PR Bobby! I love seeing the new effects in action.
I've already gone over and changed a few formatting issues, comments, etc. So make sure to pull those changes.
A few notes though:
- Make sure that you also add new entries in
ServerSettingsto the backing interfaceIServerSettings. I've already done this for now, but just something to keep in mind in the future. - The Flea Brew effect is normally cancelled when sitting on a bench, but this is not networked to other players. Very minor, not sure if we can easily remedy it. Maybe by implementing a "bench" effect that cancels various other effects, because I think more effects are cancelled when sitting on a bench so it could come in useful for other things as well.
- Perhaps it is better to separate the Magma Bell effect in two networked parts. Taking damage with it active and regaining the protection. This can be done with the effect info. There are a few ways in which the regaining of the effect is interrupted, which will incorrectly play it for remote players (for example taking damage again just before regaining the effect), because it is simply on a timer.
|
I've implemented the benching logic as requested. As for the magma bell, the logic is hardcoded to take a specific amount of time. The logic can be found in HeroController on line 1359. This is a simplified version of it: if (!dead && cooldownTimeLeft > 0f)
{
if (MagmaBell.IsEquipped)
{
float timeElapsed = Gameplay.LavaBellCooldownTime - cooldownTimeLeft;
cooldownTimeLeft -= Time.deltaTime;
float newTimeElapsed = MagmaBellCooldownTime - cooldownTimeLeft;
float lengthMinusAnimation = MagmaBellCooldownTime - 1.25f;
if (timeElapsed < lengthMinusAnimation && newTimeElapsed >= lengthMinusAnimation)
{
RechargeBell();
}
if (cooldownTimeLeft <= 0f)
{
spriteFlash.Flash();
}
}
else
{
ResetMagmaBell();
}
}Were you able to find an example in-game where the effect wasn't synced? |
Yes, any event that causes time dilation on the local player's game will cause it to be inconsistent with playing the effect on remote player's games. So, hazard respawning slightly delays time for the local player and remote players will play the effect slightly earlier. While I haven't tested it, winning an enemy arena causes a longer time dilation, which I think will also cause issues then. |
Extremelyd1
left a comment
There was a problem hiding this comment.
Could you split up the Magma Bell effects then? That way the effect is better synchronised across clients.
|
Sorry, I've been swamped the past few weeks. I have it ready, I just need to test it first. I'll try to have it pushed by tonight |
No worries, don't feel rushed to work this. I'm already very happy with the contributions! |
Adds the following tools:
Also adds a base class for tools that will be more useful going forward, as well as a component to identify the owner of a tool (or really any effect that does damage).