- crouching (allows placing signal items at the bottom of a room and may be useful when doctors are added (CPR animation, using medical items on dead bodies?))

- changes to the dying logic: characters will be unconscious when their health or oxygen goes below 0.0, and die when it drops to -100.0 (if either of the values is below zero, it will automatically decrease so the character will quickly die without medical care)
- fixed LightSprite being drawn on LightComponents even if the item is inside an inventory
- characters extend their arm more when placing signal items
This commit is contained in:
Regalis
2016-03-20 20:15:47 +02:00
parent fc8b30c974
commit 0dbfb54b5f
11 changed files with 160 additions and 83 deletions

View File

@@ -10,7 +10,7 @@ namespace Barotrauma.Items.Components
{
class RepairTool : ItemComponent
{
private List<string> fixableEntities;
private readonly List<string> fixableEntities;
private float range;
@@ -80,13 +80,6 @@ namespace Barotrauma.Items.Components
{
this.item = item;
//range = ToolBox.GetAttributeFloat(element, "range", 100.0f);
//range = ConvertUnits.ToSimUnits(range);
//structureFixAmount = ToolBox.GetAttributeFloat(element, "structurefixamount", 1.0f);
//limbFixAmount = ToolBox.GetAttributeFloat(element, "limbfixamount", -0.5f);
fixableEntities = new List<string>();
foreach (XElement subElement in element.Elements())
{
@@ -194,23 +187,13 @@ namespace Barotrauma.Items.Components
}
else if ((targetItem = (targetBody.UserData as Item)) != null)
{
//targetItem.Condition -= structureFixAmount;
targetItem.IsHighlighted = true;
foreach (StatusEffect effect in statusEffects)
{
//if (Array.IndexOf(effect.TargetNames, targetItem.Name) == -1) continue;
effect.Apply(ActionType.OnUse, deltaTime, item, targetItem.AllPropertyObjects);
//targetItem.ApplyStatusEffect(effect, ActionType.OnUse, deltaTime);
}
//ApplyStatusEffects(ActionType.OnUse, 1.0f, null, targ);
}
//if (Character.SecondaryKeyDown.State)
//{
// IPropertyObject propertyObject = targetBody.UserData as IPropertyObject;
// if (propertyObject!=null) ApplyStatusEffects(ActionType.OnUse, 1.0f, item.SimPosition, propertyObject);
// //isActive = true;
//}
return true;
}

View File

@@ -150,9 +150,9 @@ namespace Barotrauma.Items.Components
public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, bool editing = false)
{
if (light.LightSprite != null)
if (light.LightSprite != null && (item.body==null || item.body.Enabled))
{
light.LightSprite.Draw(spriteBatch, new Vector2(item.DrawPosition.X, -item.DrawPosition.Y), lightColor * lightBrightness);
light.LightSprite.Draw(spriteBatch, new Vector2(item.DrawPosition.X, -item.DrawPosition.Y), lightColor * lightBrightness, 0.0f, 1.0f, Microsoft.Xna.Framework.Graphics.SpriteEffects.None, item.Sprite.Depth-0.0001f);
}
}