HealingComponent can now heal different types of damage (#146)
```
- type: Healing
heal: 100
damage: Heat
```
This commit is contained in:
committed by
Pieter-Jan Briers
parent
4a40b5112c
commit
6649d06fd8
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using SS14.Shared.GameObjects;
|
using SS14.Shared.GameObjects;
|
||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
using SS14.Shared.Interfaces.GameObjects;
|
using SS14.Shared.Interfaces.GameObjects;
|
||||||
@@ -20,12 +20,14 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
|||||||
public override string Name => "Healing";
|
public override string Name => "Healing";
|
||||||
|
|
||||||
public int Heal = 100;
|
public int Heal = 100;
|
||||||
|
public DamageType Damage = DamageType.Brute;
|
||||||
|
|
||||||
public override void ExposeData(ObjectSerializer serializer)
|
public override void ExposeData(ObjectSerializer serializer)
|
||||||
{
|
{
|
||||||
base.ExposeData(serializer);
|
base.ExposeData(serializer);
|
||||||
|
|
||||||
serializer.DataField(ref Heal, "heal", 100);
|
serializer.DataField(ref Heal, "heal", 100);
|
||||||
|
serializer.DataField(ref Damage, "damage", DamageType.Brute);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IAfterAttack.Afterattack(IEntity user, GridCoordinates clicklocation, IEntity attacked)
|
void IAfterAttack.Afterattack(IEntity user, GridCoordinates clicklocation, IEntity attacked)
|
||||||
@@ -36,7 +38,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
|||||||
}
|
}
|
||||||
if (attacked.TryGetComponent(out DamageableComponent damagecomponent))
|
if (attacked.TryGetComponent(out DamageableComponent damagecomponent))
|
||||||
{
|
{
|
||||||
damagecomponent.TakeHealing(DamageType.Brute, Heal);
|
damagecomponent.TakeHealing(Damage, Heal);
|
||||||
Owner.Delete();
|
Owner.Delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,7 +47,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
|||||||
{
|
{
|
||||||
if (user.TryGetComponent(out DamageableComponent damagecomponent))
|
if (user.TryGetComponent(out DamageableComponent damagecomponent))
|
||||||
{
|
{
|
||||||
damagecomponent.TakeHealing(DamageType.Brute, Heal);
|
damagecomponent.TakeHealing(Damage, Heal);
|
||||||
Owner.Delete();
|
Owner.Delete();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,5 +9,6 @@
|
|||||||
texture: Objects/medkit_r.png
|
texture: Objects/medkit_r.png
|
||||||
- type: Healing
|
- type: Healing
|
||||||
heal: 100
|
heal: 100
|
||||||
|
damage: Brute
|
||||||
- type: Item
|
- type: Item
|
||||||
Size: 24
|
Size: 24
|
||||||
Reference in New Issue
Block a user