Adds Ointment and Brutepack. (#150)

* Add Ointment and Brutepack to StackType

* Add Ointment and Brutepack sprites

* HealingComponent now works correctly with StackComponent

* Adds Ointment and Brutepack prototypes

* Adds Ointment and Brutepack to stationstation
This commit is contained in:
Víctor Aguilera Puerto
2019-03-22 15:03:29 +01:00
committed by Pieter-Jan Briers
parent 1cfed8b6c7
commit 62eb7db0c7
7 changed files with 98 additions and 18 deletions

View File

@@ -1,4 +1,5 @@
using System;
using Content.Server.GameObjects.Components.Stack;
using SS14.Shared.GameObjects;
using Content.Server.GameObjects.EntitySystems;
using SS14.Shared.Interfaces.GameObjects;
@@ -36,21 +37,39 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
{
return;
}
if (attacked.TryGetComponent(out DamageableComponent damagecomponent))
if (!attacked.TryGetComponent(out DamageableComponent damagecomponent)) return;
if (Owner.TryGetComponent(out StackComponent stackComponent))
{
if (!stackComponent.Use(1))
{
Owner.Delete();
return;
}
damagecomponent.TakeHealing(Damage, Heal);
Owner.Delete();
return;
}
damagecomponent.TakeHealing(Damage, Heal);
Owner.Delete();
}
bool IUse.UseEntity(IEntity user)
{
if (user.TryGetComponent(out DamageableComponent damagecomponent))
if (!user.TryGetComponent(out DamageableComponent damagecomponent)) return false;
if (Owner.TryGetComponent(out StackComponent stackComponent))
{
if (!stackComponent.Use(1))
{
Owner.Delete();
return false;
}
damagecomponent.TakeHealing(Damage, Heal);
Owner.Delete();
return false;
}
damagecomponent.TakeHealing(Damage, Heal);
Owner.Delete();
return false;
}
}

View File

@@ -125,5 +125,7 @@ namespace Content.Server.GameObjects.Components.Stack
Metal,
Glass,
Cable,
Ointment,
Brutepack,
}
}