Revert "Refactor Damage to use Protoypes (#4262)"

This reverts commit 20bf5739a9.
This commit is contained in:
Silver
2021-08-24 00:50:39 -06:00
committed by Silver
parent 20bf5739a9
commit e708091518
121 changed files with 711 additions and 10237 deletions

View File

@@ -7,17 +7,12 @@ using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Physics.Dynamics;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.IoC;
using Content.Shared.Damage;
namespace Content.Server.Projectiles
{
[UsedImplicitly]
internal sealed class ProjectileSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
public override void Initialize()
{
base.Initialize();
@@ -44,27 +39,19 @@ namespace Content.Server.Projectiles
}
else
{
<<<<<<< HEAD
<<<<<<< refs/remotes/origin/master
var soundHit = component.SoundHit?.GetSound();
if (!string.IsNullOrEmpty(soundHit))
SoundSystem.Play(playerFilter, soundHit, coordinates);
=======
SoundSystem.Play(playerFilter, component.SoundHit.GetSound(), coordinates);
>>>>>>> Bring refactor-damageablecomponent branch up-to-date with master (#4510)
=======
SoundSystem.Play(playerFilter, component.SoundHit.GetSound(), coordinates);
>>>>>>> refactor-damageablecomponent
}
if (!otherEntity.Deleted && otherEntity.TryGetComponent(out IDamageableComponent? damage))
{
EntityManager.TryGetEntity(component.Shooter, out var shooter);
foreach (var (damageTypeID, amount) in component.Damages)
foreach (var (damageType, amount) in component.Damages)
{
damage.TryChangeDamage(_prototypeManager.Index<DamageTypePrototype>(damageTypeID), amount);
damage.ChangeDamage(damageType, amount, false, shooter);
}
component.DamagedEntity = true;