This commit is contained in:
Clyybber
2020-05-23 17:23:25 +02:00
committed by GitHub
parent 05b910d9db
commit 1ad9a10050
40 changed files with 200 additions and 199 deletions

View File

@@ -13,7 +13,7 @@ using Robust.Shared.Random;
namespace Content.Server.GameObjects.Components.Mining
{
[RegisterComponent]
public class AsteroidRockComponent : Component, IAttackBy
public class AsteroidRockComponent : Component, IInteractUsing
{
public override string Name => "AsteroidRock";
private static readonly string[] SpriteStates = {"0", "1", "2", "3", "4"};
@@ -29,9 +29,9 @@ namespace Content.Server.GameObjects.Components.Mining
spriteComponent.LayerSetState(0, _random.Pick(SpriteStates));
}
bool IAttackBy.AttackBy(AttackByEventArgs eventArgs)
bool IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
{
var item = eventArgs.AttackWith;
var item = eventArgs.Using;
if (!item.TryGetComponent(out MeleeWeaponComponent meleeWeaponComponent)) return false;
Owner.GetComponent<DamageableComponent>().TakeDamage(DamageType.Brute, meleeWeaponComponent.Damage, item, eventArgs.User);