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:
Joonas Rikkonen
2018-04-03 22:43:41 +03:00
parent faaaa69fa7
commit 9dd9425caa
5 changed files with 142 additions and 15 deletions

View File

@@ -62,6 +62,10 @@
<!-- Only give healing effect if their health is more than 50 --> <!-- Only give healing effect if their health is more than 50 -->
<Conditional Health="gt 50"/> <Conditional Health="gt 50"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</MeleeWeapon> </MeleeWeapon>
</Item> </Item>
@@ -81,6 +85,10 @@
<StatusEffect tags="poison,iron" type="OnUse" target="Character" Health="-2" duration="10"> <StatusEffect tags="poison,iron" type="OnUse" target="Character" Health="-2" duration="10">
<RequiredItem name="Medical Syringe" type="Container"/> <RequiredItem name="Medical Syringe" type="Container"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -107,6 +115,10 @@
<StatusEffect tags="medical" type="OnUse" target="Character" Health="0.3" Oxygen="0.3" duration="10"> <StatusEffect tags="medical" type="OnUse" target="Character" Health="0.3" Oxygen="0.3" duration="10">
<RequiredItem name="Medical Syringe" type="Container"/> <RequiredItem name="Medical Syringe" type="Container"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -126,6 +138,10 @@
<StatusEffect tags="poison,chlorine" type="OnUse" target="Character" Health="-0.1" duration="20.0"> <StatusEffect tags="poison,chlorine" type="OnUse" target="Character" Health="-0.1" duration="20.0">
<RequiredItem name="Medical Syringe" type="Container"/> <RequiredItem name="Medical Syringe" type="Container"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -151,6 +167,10 @@
<StatusEffect tags="drunk" type="OnUse" target="Character" SpeedMultiplier="0.8" setvalue="true" duration="20.0"> <StatusEffect tags="drunk" type="OnUse" target="Character" SpeedMultiplier="0.8" setvalue="true" duration="20.0">
<RequiredItem name="Medical Syringe" type="Container"/> <RequiredItem name="Medical Syringe" type="Container"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -170,6 +190,10 @@
<StatusEffect type="OnUse" target="Character" Health="-5.0" disabledeltatime="true"> <StatusEffect type="OnUse" target="Character" Health="-5.0" disabledeltatime="true">
<RequiredItem name="Medical Syringe" type="Container"/> <RequiredItem name="Medical Syringe" type="Container"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -193,6 +217,10 @@
<Sound file="Content/Items/Reactor/explosion.ogg"/> <Sound file="Content/Items/Reactor/explosion.ogg"/>
<Explosion range="250.0" structuredamage="10" damage="20" stun="5" force="5.0"/> <Explosion range="250.0" structuredamage="10" damage="20" stun="5" force="5.0"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -212,6 +240,10 @@
<StatusEffect type="OnUse" target="Character" Health="-5.0" disabledeltatime="true"> <StatusEffect type="OnUse" target="Character" Health="-5.0" disabledeltatime="true">
<RequiredItem name="Medical Syringe" type="Container"/> <RequiredItem name="Medical Syringe" type="Container"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -236,6 +268,10 @@
<Conditional Health="lt 0.1"/> <Conditional Health="lt 0.1"/>
<RequiredItem name="Medical Syringe" type="Container"/> <RequiredItem name="Medical Syringe" type="Container"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -257,6 +293,10 @@
<StatusEffect tags="medical" type="OnUse" target="Character" Health="-0.3" Oxygen="2.0" duration="10"> <StatusEffect tags="medical" type="OnUse" target="Character" Health="-0.3" Oxygen="2.0" duration="10">
<RequiredItem name="Medical Syringe" type="Container"/> <RequiredItem name="Medical Syringe" type="Container"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -277,6 +317,10 @@
<ItemComponent> <ItemComponent>
<StatusEffect tags="medical" type="OnUse" target="Character" Bleeding="-0.1" duration="10.0"/> <StatusEffect tags="medical" type="OnUse" target="Character" Bleeding="-0.1" duration="10.0"/>
<StatusEffect type="OnUse" target="This" Condition="-25.0" disabledeltatime="true"/> <StatusEffect type="OnUse" target="This" Condition="-25.0" disabledeltatime="true"/>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</ItemComponent> </ItemComponent>
<Throwable canBeCombined="true" slots="Any,RightHand,LeftHand" throwforce="4.0" aimpos="35,-10"> <Throwable canBeCombined="true" slots="Any,RightHand,LeftHand" throwforce="4.0" aimpos="35,-10">
@@ -303,7 +347,11 @@
<ItemComponent> <ItemComponent>
<StatusEffect type="OnUse" target="This" Condition="-25.0" disabledeltatime="true"/> <StatusEffect type="OnUse" target="This" Condition="-25.0" disabledeltatime="true"/>
<StatusEffect tags="medical" type="OnUse" target="Character, This" Health="-0.5" duration="10"/> <StatusEffect tags="medical" type="OnUse" target="Character, This" Health="-0.5" duration="10"/>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</ItemComponent> </ItemComponent>
<Throwable canBeCombined="true" slots="Any,RightHand,LeftHand" throwforce="4.0" aimpos="35,-10"> <Throwable canBeCombined="true" slots="Any,RightHand,LeftHand" throwforce="4.0" aimpos="35,-10">
@@ -318,8 +366,7 @@
category="Material" category="Material"
spritecolor="1.0,1.0,0.0,1.0" spritecolor="1.0,1.0,0.0,1.0"
cargocontainername="Chemical Crate" cargocontainername="Chemical Crate"
Tags="smallitem,chem,medical" Tags="smallitem,chem,medical"
description="A highly potent corrigodone-based stimulant." description="A highly potent corrigodone-based stimulant."
price="150"> price="150">
@@ -331,6 +378,10 @@
<StatusEffect tags="medical" type="OnUse" target="Character" Health="0.5" Oxygen="0.5" Bleeding="-0.025" duration="60.0"> <StatusEffect tags="medical" type="OnUse" target="Character" Health="0.5" Oxygen="0.5" Bleeding="-0.025" duration="60.0">
<RequiredItem name="Medical Syringe" type="Container"/> <RequiredItem name="Medical Syringe" type="Container"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -351,6 +402,10 @@
<StatusEffect tags="medical" type="OnUse" target="Character" SpeedMultiplier="1.5" setvalue="true" duration="60.0"> <StatusEffect tags="medical" type="OnUse" target="Character" SpeedMultiplier="1.5" setvalue="true" duration="60.0">
<RequiredItem name="Medical Syringe" type="Container"/> <RequiredItem name="Medical Syringe" type="Container"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -381,6 +436,10 @@
<Conditional SpeciesName="husk"/> <Conditional SpeciesName="husk"/>
<RequiredItem name="Medical Syringe" type="Container"/> <RequiredItem name="Medical Syringe" type="Container"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -403,6 +462,10 @@
<CancelStatusEffect/> <CancelStatusEffect/>
</Conditional> </Conditional>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -427,6 +490,10 @@
<sound file="Content/Items/Reactor/explosion.ogg"/> <sound file="Content/Items/Reactor/explosion.ogg"/>
<Explosion range="300.0" structuredamage="50" damage="30" stun="5" force="10.0"/> <Explosion range="300.0" structuredamage="50" damage="30" stun="5" force="10.0"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -451,6 +518,14 @@
<Sound file="Content/Items/Reactor/explosion.ogg"/> <Sound file="Content/Items/Reactor/explosion.ogg"/>
<Explosion range="500" damage="5" stun="3" force="0.1"/> <Explosion range="500" damage="5" stun="3" force="0.1"/>
</StatusEffect> </StatusEffect>
<StatusEffect type="OnUse" target="This" Condition="-100.0">
<Sound file="Content/Items/Reactor/explosion.ogg"/>
<Explosion range="500" damage="5" stun="3" force="0.1"/>
</StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -470,6 +545,10 @@
<StatusEffect type="OnUse" target="Character" Health="-5.0" Stun="10" disabledeltatime="true"> <StatusEffect type="OnUse" target="Character" Health="-5.0" Stun="10" disabledeltatime="true">
<RequiredItem name="Medical Syringe" type="Container"/> <RequiredItem name="Medical Syringe" type="Container"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -489,6 +568,10 @@
<StatusEffect tags="poison,acid" type="OnUse" target="Character" Health="-1.0" duration="30.0"> <StatusEffect tags="poison,acid" type="OnUse" target="Character" Health="-1.0" duration="30.0">
<RequiredItem name="Medical Syringe" type="Container"/> <RequiredItem name="Medical Syringe" type="Container"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -508,6 +591,10 @@
<StatusEffect tags="poison,uranium" type="OnUse" target="Character" bleeding="0.1" duration="60.0"> <StatusEffect tags="poison,uranium" type="OnUse" target="Character" bleeding="0.1" duration="60.0">
<RequiredItem name="Medical Syringe" type="Container"/> <RequiredItem name="Medical Syringe" type="Container"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -530,6 +617,10 @@
<Conditional HuskInfectionState="lt 0.01"/> <Conditional HuskInfectionState="lt 0.01"/>
<RequiredItem name="Medical Syringe" type="Container"/> <RequiredItem name="Medical Syringe" type="Container"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -550,6 +641,10 @@
<StatusEffect tags="poison,morbusine" type="OnUse" target="Character" Health="-5.0" duration="60.0"> <StatusEffect tags="poison,morbusine" type="OnUse" target="Character" Health="-5.0" duration="60.0">
<RequiredItem name="Medical Syringe" type="Container"/> <RequiredItem name="Medical Syringe" type="Container"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -573,6 +668,7 @@
<StatusEffect type="OnBroken" target="This" Condition="-100.0"> <StatusEffect type="OnBroken" target="This" Condition="-100.0">
<sound file="Content/Items/Reactor/explosion.ogg" range="3000"/> <sound file="Content/Items/Reactor/explosion.ogg" range="3000"/>
<Explosion range="600.0" structuredamage="400" damage="300" stun="5" force="20.0" severlimbsprobability="0.4" decal="explosion" decalsize="0.5"/> <Explosion range="600.0" structuredamage="400" damage="300" stun="5" force="20.0" severlimbsprobability="0.4" decal="explosion" decalsize="0.5"/>
<Remove/>
</StatusEffect> </StatusEffect>
<StatusEffect type="OnUse" target="This" Condition="-100.0"> <StatusEffect type="OnUse" target="This" Condition="-100.0">
@@ -602,6 +698,10 @@
<StatusEffect tags="poison,sufforin" type="OnUse" target="Character" Oxygen="-5.0" OxygenAvailable="-10000.0" Health="-0.5" duration="60.0" delay="20.0"> <StatusEffect tags="poison,sufforin" type="OnUse" target="Character" Oxygen="-5.0" OxygenAvailable="-10000.0" Health="-0.5" duration="60.0" delay="20.0">
<RequiredItem name="Medical Syringe" type="Container"/> <RequiredItem name="Medical Syringe" type="Container"/>
</StatusEffect> </StatusEffect>
<!-- Remove the item when fully used -->
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
</Items> </Items>

View File

@@ -5,8 +5,7 @@
category="Machine" category="Machine"
focusonselected="true" focusonselected="true"
offsetonselected="700" offsetonselected="700"
linkable="true" linkable="true">
>
<Sprite texture ="railgunetc.png" depth="0.01" sourcerect="64,180,47,76"/> <Sprite texture ="railgunetc.png" depth="0.01" sourcerect="64,180,47,76"/>
@@ -23,8 +22,7 @@
<Item <Item
name="Depth Charge Loader" name="Depth Charge Loader"
category="Machine" category="Machine"
linkable="true" linkable="true">
>
<Sprite texture="railgunetc.png" depth="0.8" sourcerect="0,160,61,96"/> <Sprite texture="railgunetc.png" depth="0.8" sourcerect="0,160,61,96"/>
@@ -53,7 +51,9 @@
<Projectile launchimpulse="5.0"> <Projectile launchimpulse="5.0">
<Attack damage="1" structuredamage="1" damagetype="Blunt"/> <Attack damage="1" structuredamage="1" damagetype="Blunt"/>
<StatusEffect type="OnImpact" target="Contained" Condition="-100.0"/> <StatusEffect type="OnImpact" target="Contained">
<Use/>
</StatusEffect>
</Projectile> </Projectile>
<ItemContainer hideitems="true" capacity="1" canbeselected = "true"> <ItemContainer hideitems="true" capacity="1" canbeselected = "true">
@@ -85,7 +85,9 @@
<sound file="Content/Items/Weapons/bigexplosion.ogg" range="10000"/> <sound file="Content/Items/Weapons/bigexplosion.ogg" range="10000"/>
<Explosion range="1000.0" structuredamage="1000" damage="1000" stun="10" force="50.0"/> <Explosion range="1000.0" structuredamage="1000" damage="1000" stun="10" force="50.0"/>
</StatusEffect> </StatusEffect>
<StatusEffect type="OnImpact" target="Contained" Condition="-100.0"/> <StatusEffect type="OnImpact" target="Contained">
<Use/>
</StatusEffect>
</Projectile> </Projectile>
<ItemContainer hideitems="true" capacity="1" canbeselected = "true"> <ItemContainer hideitems="true" capacity="1" canbeselected = "true">

View File

@@ -11,9 +11,10 @@
<Body width="24" height="8"/> <Body width="24" height="8"/>
<Throwable slots="Any,RightHand,LeftHand" throwforce="4.0" aimpos="35,-10"> <Throwable slots="Any,RightHand,LeftHand" throwforce="4.0" aimpos="35,-10">
<StatusEffect type="OnBroken" target="This" Condition="-100.0"> <StatusEffect type="OnUse" target="This" Condition="-100.0">
<sound file="Content/Items/Reactor/explosion.ogg" range="3000"/> <sound file="Content/Items/Reactor/explosion.ogg" range="3000"/>
<Explosion range="500.0" structuredamage="250" damage="200" stun="5" force="20.0" severlimbsprobability="0.5" decal="explosion" decalsize="0.5"/> <Explosion range="500.0" structuredamage="250" damage="200" stun="5" force="20.0" severlimbsprobability="0.5" decal="explosion" decalsize="0.5"/>
<Remove/>
</StatusEffect> </StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -30,9 +31,10 @@
<Throwable slots="Any,RightHand,LeftHand" throwforce="4.0" aimpos="35,-10"> <Throwable slots="Any,RightHand,LeftHand" throwforce="4.0" aimpos="35,-10">
<StatusEffect type="OnFire" target="This" Condition="-50.0"/> <StatusEffect type="OnFire" target="This" Condition="-50.0"/>
<StatusEffect type="OnBroken" target="This" Condition="-100.0"> <StatusEffect type="OnUse" target="This" Condition="-100.0">
<sound file="Content/Items/Reactor/explosion.ogg" range="3000"/> <sound file="Content/Items/Reactor/explosion.ogg" range="3000"/>
<Explosion range="600.0" structuredamage="150" damage="300" stun="5" force="20.0" severlimbsprobability="0.6" decal="explosion" decalsize="0.5"/> <Explosion range="600.0" structuredamage="150" damage="300" stun="5" force="20.0" severlimbsprobability="0.6" decal="explosion" decalsize="0.5"/>
<Remove/>
</StatusEffect> </StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -50,9 +52,15 @@
<Throwable slots="Any,RightHand,LeftHand" throwforce="4.0" aimpos="35,-10"> <Throwable slots="Any,RightHand,LeftHand" throwforce="4.0" aimpos="35,-10">
<StatusEffect type="Always" target="This" Condition="-0.35"/> <StatusEffect type="Always" target="This" Condition="-0.35"/>
<StatusEffect type="OnFire" target="This" Condition="-50.0"/> <StatusEffect type="OnFire" target="This" Condition="-50.0"/>
<StatusEffect type="OnBroken" target="This" Condition="-100.0"> <StatusEffect type="OnBroken" target="This">
<sound file="Content/Items/Reactor/explosion.ogg" range="3000"/> <sound file="Content/Items/Reactor/explosion.ogg" range="3000"/>
<Explosion range="600.0" structuredamage="150" damage="300" stun="5" force="20.0" severlimbsprobability="0.6" decal="explosion" decalsize="0.5"/> <Explosion range="600.0" structuredamage="150" damage="300" stun="5" force="20.0" severlimbsprobability="0.6" decal="explosion" decalsize="0.5"/>
<Remove/>
</StatusEffect>
<StatusEffect type="OnUse" target="This">
<sound file="Content/Items/Reactor/explosion.ogg" range="3000"/>
<Explosion range="600.0" structuredamage="150" damage="300" stun="5" force="20.0" severlimbsprobability="0.6" decal="explosion" decalsize="0.5"/>
<Remove/>
</StatusEffect> </StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -70,10 +78,11 @@
<Throwable slots="Any,RightHand,LeftHand" throwforce="4.0" aimpos="35,-10"> <Throwable slots="Any,RightHand,LeftHand" throwforce="4.0" aimpos="35,-10">
<StatusEffect type="OnFire" target="This" Condition="-50.0"/> <StatusEffect type="OnFire" target="This" Condition="-50.0"/>
<StatusEffect type="OnBroken" target="This" Condition="-100.0"> <StatusEffect type="OnUse" target="This" Condition="-100.0">
<sound file="Content/Items/Reactor/explosion.ogg" range="2000"/> <sound file="Content/Items/Reactor/explosion.ogg" range="2000"/>
<Explosion range="500.0" structuredamage="50" damage="300" stun="5" force="20.0" severlimbsprobability="0.6"/> <Explosion range="500.0" structuredamage="50" damage="300" stun="5" force="20.0" severlimbsprobability="0.6"/>
<Fire size="500"/> <Fire size="500"/>
<Remove/>
</StatusEffect> </StatusEffect>
</Throwable> </Throwable>
</Item> </Item>
@@ -101,7 +110,7 @@
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]"> <ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]">
<requireditem name="Screwdriver,Wire" type="Equipped"/> <requireditem name="Screwdriver,Wire" type="Equipped"/>
<input name="activate"> <input name="activate">
<StatusEffect type="OnUse" target="Contained" Condition="-100.0"> <StatusEffect type="OnUse" target="Contained">
<Use/> <Use/>
</StatusEffect> </StatusEffect>
</input> </input>

View File

@@ -132,7 +132,9 @@
<ParticleEmitter particle="bubbles" anglemin="0" anglemax="360" particleamount="10" velocitymin="0" velocitymax="50" scalemin="2" scalemax="5"/> <ParticleEmitter particle="bubbles" anglemin="0" anglemax="360" particleamount="10" velocitymin="0" velocitymax="50" scalemin="2" scalemax="5"/>
</StatusEffect> </StatusEffect>
<StatusEffect type="OnImpact" target="Contained" Condition="-100.0"/> <StatusEffect type="OnImpact" target="Contained">
<Use/>
</StatusEffect>
</Projectile> </Projectile>
<ItemContainer hideitems="true" capacity="1" canbeselected = "true"> <ItemContainer hideitems="true" capacity="1" canbeselected = "true">

View File

@@ -58,6 +58,8 @@ namespace Barotrauma
private readonly int useItemCount; private readonly int useItemCount;
private readonly bool removeItem;
public readonly ActionType type; public readonly ActionType type;
private Explosion explosion; private Explosion explosion;
@@ -211,6 +213,10 @@ namespace Barotrauma
case "useitem": case "useitem":
useItemCount++; useItemCount++;
break; break;
case "remove":
case "removeitem":
removeItem = true;
break;
case "requireditem": case "requireditem":
case "requireditems": case "requireditems":
RelatedItem newRequiredItem = RelatedItem.Load(subElement); 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) if (duration > 0.0f)
{ {
DurationListElement element = new DurationListElement(); DurationListElement element = new DurationListElement();