protected void OnKilled(Object sender, KilledEventArgs e) { OnBreak(); Entity.Remove(); }
protected virtual void OnKilled(object sender, KilledEventArgs e) { World.SplashBlood(Position2D, 4.0f); StopMoving(); Anim.Start(DeadAnim); if (IsHoldingItem) DropItem(); if (IsSelected) Deselect(); Entity.RemoveComponent<HumanControl>(); Entity.RemoveComponent<Collision>(); Entity.RemoveComponent<Movement>(); Entity.UpdateComponents(); for (int i = 0; i < 4; ++i) { Face face = (Face) (1 << i); Vector2 ray = face.GetNormal() / 2.0f; TraceResult res = TraceLine.Quick(World, Position2D, Position2D + ray); if (res.Hit) Entity.Position2D -= res.Vector; } }
protected override void OnKilled(object sender, KilledEventArgs e) { if (IsInfected && Tools.Random.NextDouble() < 0.74) Zombify(); else base.OnKilled(sender, e); }