Add client pulling prediction (#2041)

* WIP changes

* Merge conflict fixes

* Bring pull controlelr to current year

* Sync and predict PullController on the client

* Clean imports

* Slow down pullers and make pulling tighter

* Stop pulls on pullable or puller component removals

* Make pulling not occur when moving towards the pulled entity
This commit is contained in:
DrSmugleaf
2020-10-16 20:35:09 +02:00
committed by GitHub
parent 0345fbbd22
commit b1fe4bad01
24 changed files with 734 additions and 341 deletions

View File

@@ -92,6 +92,23 @@ namespace Content.Client.GameObjects.Components.Mobs
_cooldown.Clear();
}
public override void ChangeStatusEffectIcon(StatusEffect effect, string icon)
{
if (_status.TryGetValue(effect, out var value) &&
value.Icon == icon)
{
return;
}
_status[effect] = new StatusEffectStatus
{
Icon = icon,
Cooldown = value.Cooldown
};
Dirty();
}
public void UpdateStatusEffects()
{
if (!CurrentlyControlled || _ui == null)
@@ -132,10 +149,15 @@ namespace Content.Client.GameObjects.Components.Mobs
SendNetworkMessage(new ClickStatusMessage(status.Effect));
}
public void RemoveStatusEffect(StatusEffect name)
public override void RemoveStatusEffect(StatusEffect effect)
{
_status.Remove(name);
if (!_status.Remove(effect))
{
return;
}
UpdateStatusEffects();
Dirty();
}
public void FrameUpdate(float frameTime)