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,
}
}

View File

@@ -298,6 +298,18 @@ entities:
pos: -1.984375,-4.484375
rot: -1.570796 rad
type: Transform
- type: Ointment
components:
- grid: 0
pos: 0.779375,-3.7521875
rot: -1.570796 rad
type: Transform
- type: Brutepack
components:
- grid: 0
pos: 1.509375,-3.7521875
rot: -1.570796 rad
type: Transform
- type: Medkit
components:
- grid: 0

View File

@@ -0,0 +1,61 @@
- type: entity
name: Medkit
parent: BaseItem
id: Medkit
components:
- type: Sprite
texture: Objects/medkit_r.png
- type: Icon
texture: Objects/medkit_r.png
- type: Healing
heal: 100
damage: Brute
- type: Item
Size: 24
- type: entity
name: Medical Stack
id: MedicalStack
parent: BaseItem
components:
- type: Stack
- type: Item
- type: Healing
- type: entity
name: Ointment
description: Used to treat those nasty burns.
parent: MedicalStack
id: Ointment
components:
- type: Sprite
texture: Objects/ointment.png
- type: Icon
texture: Objects/ointment.png
- type: Healing
heal: 10
damage: Heat
- type: Stack
max: 5
count: 5
stacktype: enum.StackType.Ointment
- type: entity
name: Brutepack
description: Some sterile gauze to wrap around bloody stumps.
parent: MedicalStack
id: Brutepack
components:
- type: Sprite
texture: Objects/brutepack.png
- type: Icon
texture: Objects/brutepack.png
- type: Healing
heal: 10
damage: Brute
- type: Stack
max: 5
count: 5
stacktype: enum.StackType.Brutepack

View File

@@ -1,14 +0,0 @@
- type: entity
name: Medkit
parent: BaseItem
id: Medkit
components:
- type: Sprite
texture: Objects/medkit_r.png
- type: Icon
texture: Objects/medkit_r.png
- type: Healing
heal: 100
damage: Brute
- type: Item
Size: 24

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B