Explosives, chemicals and medical items disappear when their condition falls to 0 (i.e. when they're fully used).
Railgun shells, detonators and depth charges also now "use" their contents instead of destroying them. (See #322)
This commit is contained in:
@@ -58,6 +58,8 @@ namespace Barotrauma
|
||||
|
||||
private readonly int useItemCount;
|
||||
|
||||
private readonly bool removeItem;
|
||||
|
||||
public readonly ActionType type;
|
||||
|
||||
private Explosion explosion;
|
||||
@@ -211,6 +213,10 @@ namespace Barotrauma
|
||||
case "useitem":
|
||||
useItemCount++;
|
||||
break;
|
||||
case "remove":
|
||||
case "removeitem":
|
||||
removeItem = true;
|
||||
break;
|
||||
case "requireditem":
|
||||
case "requireditems":
|
||||
RelatedItem newRequiredItem = RelatedItem.Load(subElement);
|
||||
@@ -368,6 +374,14 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
if (removeItem)
|
||||
{
|
||||
foreach (Item item in targets.FindAll(t => t is Item).Cast<Item>())
|
||||
{
|
||||
Entity.Spawner.AddToRemoveQueue(item);
|
||||
}
|
||||
}
|
||||
|
||||
if (duration > 0.0f)
|
||||
{
|
||||
DurationListElement element = new DurationListElement();
|
||||
|
||||
Reference in New Issue
Block a user