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:
committed by
Pieter-Jan Briers
parent
1cfed8b6c7
commit
62eb7db0c7
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using Content.Server.GameObjects.Components.Stack;
|
||||||
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;
|
||||||
@@ -36,21 +37,39 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
|||||||
{
|
{
|
||||||
return;
|
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);
|
damagecomponent.TakeHealing(Damage, Heal);
|
||||||
Owner.Delete();
|
return;
|
||||||
}
|
}
|
||||||
|
damagecomponent.TakeHealing(Damage, Heal);
|
||||||
|
Owner.Delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IUse.UseEntity(IEntity user)
|
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);
|
damagecomponent.TakeHealing(Damage, Heal);
|
||||||
Owner.Delete();
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
damagecomponent.TakeHealing(Damage, Heal);
|
||||||
|
Owner.Delete();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,5 +125,7 @@ namespace Content.Server.GameObjects.Components.Stack
|
|||||||
Metal,
|
Metal,
|
||||||
Glass,
|
Glass,
|
||||||
Cable,
|
Cable,
|
||||||
|
Ointment,
|
||||||
|
Brutepack,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -298,6 +298,18 @@ entities:
|
|||||||
pos: -1.984375,-4.484375
|
pos: -1.984375,-4.484375
|
||||||
rot: -1.570796 rad
|
rot: -1.570796 rad
|
||||||
type: Transform
|
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
|
- type: Medkit
|
||||||
components:
|
components:
|
||||||
- grid: 0
|
- grid: 0
|
||||||
|
|||||||
61
Resources/Prototypes/Entities/Medical.yml
Normal file
61
Resources/Prototypes/Entities/Medical.yml
Normal 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
|
||||||
@@ -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
|
|
||||||
BIN
Resources/Textures/Objects/brutepack.png
Normal file
BIN
Resources/Textures/Objects/brutepack.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 213 B |
BIN
Resources/Textures/Objects/ointment.png
Normal file
BIN
Resources/Textures/Objects/ointment.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 197 B |
Reference in New Issue
Block a user