- some more medicine value tweaking

- medicine & toxic cabinet items (added to vanilla subs)
- updating the positions of items inside a moving container (caused explosions to happen in the wrong position if the explosive inside something like a grenade)
- renamed doctors as medical doctors
This commit is contained in:
Regalis
2016-03-27 20:25:24 +03:00
parent 7f40071565
commit 9a0bf07fc2
14 changed files with 119 additions and 36 deletions
@@ -67,6 +67,8 @@ namespace Barotrauma.Items.Components
public ItemComponent Parent;
private string msg;
[HasDefaultValue(0.0f, false)]
public float PickingTime
{
@@ -164,9 +166,7 @@ namespace Barotrauma.Items.Components
get { return msg; }
set { msg = value; }
}
private string msg;
public ItemComponent(Item item, XElement element)
{
this.item = item;
@@ -132,12 +132,20 @@ namespace Barotrauma.Items.Components
public override void Update(float deltaTime, Camera cam)
{
if (item.body != null && item.body.FarseerBody.Awake)
{
foreach (Item contained in Inventory.Items)
{
if (contained == null) continue;
contained.SetTransform(item.SimPosition, 0.0f);
}
}
if (!hasStatusEffects) return;
foreach (Item contained in Inventory.Items)
{
if (contained == null || contained.Condition <= 0.0f) continue;
//if (contained.body != null) contained.body.Enabled = false;
RelatedItem ri = containableItems.Find(x => x.MatchesItem(contained));
if (ri == null) continue;
@@ -161,7 +169,7 @@ namespace Barotrauma.Items.Components
Vector2 transformedItemPos = itemPos;
Vector2 transformedItemInterval = itemInterval;
float currentRotation = itemRotation;
//float transformedItemRotation = itemRotation;
if (item.body == null)
{
transformedItemPos = new Vector2(item.Rect.X, item.Rect.Y);