diff --git a/Content.Server/GameObjects/Components/Healing/HealingComponent.cs b/Content.Server/GameObjects/Components/Healing/HealingComponent.cs index b4f28cadfd..d20f9d18ee 100644 --- a/Content.Server/GameObjects/Components/Healing/HealingComponent.cs +++ b/Content.Server/GameObjects/Components/Healing/HealingComponent.cs @@ -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; } } diff --git a/Content.Server/GameObjects/Components/Stack/StackComponent.cs b/Content.Server/GameObjects/Components/Stack/StackComponent.cs index 3911005979..da4d4fd959 100644 --- a/Content.Server/GameObjects/Components/Stack/StackComponent.cs +++ b/Content.Server/GameObjects/Components/Stack/StackComponent.cs @@ -125,5 +125,7 @@ namespace Content.Server.GameObjects.Components.Stack Metal, Glass, Cable, + Ointment, + Brutepack, } } diff --git a/Resources/Maps/stationstation.yml b/Resources/Maps/stationstation.yml index db341e4fbe..6a3c92cb67 100644 --- a/Resources/Maps/stationstation.yml +++ b/Resources/Maps/stationstation.yml @@ -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 diff --git a/Resources/Prototypes/Entities/Medical.yml b/Resources/Prototypes/Entities/Medical.yml new file mode 100644 index 0000000000..cf5f2ea590 --- /dev/null +++ b/Resources/Prototypes/Entities/Medical.yml @@ -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 \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Medkit.yml b/Resources/Prototypes/Entities/Medkit.yml deleted file mode 100644 index 325dab1457..0000000000 --- a/Resources/Prototypes/Entities/Medkit.yml +++ /dev/null @@ -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 \ No newline at end of file diff --git a/Resources/Textures/Objects/brutepack.png b/Resources/Textures/Objects/brutepack.png new file mode 100644 index 0000000000..1bd215195f Binary files /dev/null and b/Resources/Textures/Objects/brutepack.png differ diff --git a/Resources/Textures/Objects/ointment.png b/Resources/Textures/Objects/ointment.png new file mode 100644 index 0000000000..413a72304c Binary files /dev/null and b/Resources/Textures/Objects/ointment.png differ