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:
@@ -62,6 +62,10 @@
|
||||
<!-- Only give healing effect if their health is more than 50 -->
|
||||
<Conditional Health="gt 50"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</MeleeWeapon>
|
||||
</Item>
|
||||
|
||||
@@ -81,6 +85,10 @@
|
||||
<StatusEffect tags="poison,iron" type="OnUse" target="Character" Health="-2" duration="10">
|
||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -107,6 +115,10 @@
|
||||
<StatusEffect tags="medical" type="OnUse" target="Character" Health="0.3" Oxygen="0.3" duration="10">
|
||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -126,6 +138,10 @@
|
||||
<StatusEffect tags="poison,chlorine" type="OnUse" target="Character" Health="-0.1" duration="20.0">
|
||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -151,6 +167,10 @@
|
||||
<StatusEffect tags="drunk" type="OnUse" target="Character" SpeedMultiplier="0.8" setvalue="true" duration="20.0">
|
||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -170,6 +190,10 @@
|
||||
<StatusEffect type="OnUse" target="Character" Health="-5.0" disabledeltatime="true">
|
||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -193,6 +217,10 @@
|
||||
<Sound file="Content/Items/Reactor/explosion.ogg"/>
|
||||
<Explosion range="250.0" structuredamage="10" damage="20" stun="5" force="5.0"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -212,6 +240,10 @@
|
||||
<StatusEffect type="OnUse" target="Character" Health="-5.0" disabledeltatime="true">
|
||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -236,6 +268,10 @@
|
||||
<Conditional Health="lt 0.1"/>
|
||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -257,6 +293,10 @@
|
||||
<StatusEffect tags="medical" type="OnUse" target="Character" Health="-0.3" Oxygen="2.0" duration="10">
|
||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -277,6 +317,10 @@
|
||||
<ItemComponent>
|
||||
<StatusEffect tags="medical" type="OnUse" target="Character" Bleeding="-0.1" duration="10.0"/>
|
||||
<StatusEffect type="OnUse" target="This" Condition="-25.0" disabledeltatime="true"/>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</ItemComponent>
|
||||
|
||||
<Throwable canBeCombined="true" slots="Any,RightHand,LeftHand" throwforce="4.0" aimpos="35,-10">
|
||||
@@ -303,7 +347,11 @@
|
||||
|
||||
<ItemComponent>
|
||||
<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>
|
||||
|
||||
<Throwable canBeCombined="true" slots="Any,RightHand,LeftHand" throwforce="4.0" aimpos="35,-10">
|
||||
@@ -318,8 +366,7 @@
|
||||
category="Material"
|
||||
spritecolor="1.0,1.0,0.0,1.0"
|
||||
cargocontainername="Chemical Crate"
|
||||
Tags="smallitem,chem,medical"
|
||||
|
||||
Tags="smallitem,chem,medical"
|
||||
description="A highly potent corrigodone-based stimulant."
|
||||
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">
|
||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -351,6 +402,10 @@
|
||||
<StatusEffect tags="medical" type="OnUse" target="Character" SpeedMultiplier="1.5" setvalue="true" duration="60.0">
|
||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -381,6 +436,10 @@
|
||||
<Conditional SpeciesName="husk"/>
|
||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -403,6 +462,10 @@
|
||||
<CancelStatusEffect/>
|
||||
</Conditional>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -427,6 +490,10 @@
|
||||
<sound file="Content/Items/Reactor/explosion.ogg"/>
|
||||
<Explosion range="300.0" structuredamage="50" damage="30" stun="5" force="10.0"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -451,6 +518,14 @@
|
||||
<Sound file="Content/Items/Reactor/explosion.ogg"/>
|
||||
<Explosion range="500" damage="5" stun="3" force="0.1"/>
|
||||
</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>
|
||||
</Item>
|
||||
|
||||
@@ -470,6 +545,10 @@
|
||||
<StatusEffect type="OnUse" target="Character" Health="-5.0" Stun="10" disabledeltatime="true">
|
||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -489,6 +568,10 @@
|
||||
<StatusEffect tags="poison,acid" type="OnUse" target="Character" Health="-1.0" duration="30.0">
|
||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -508,6 +591,10 @@
|
||||
<StatusEffect tags="poison,uranium" type="OnUse" target="Character" bleeding="0.1" duration="60.0">
|
||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -530,6 +617,10 @@
|
||||
<Conditional HuskInfectionState="lt 0.01"/>
|
||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -550,6 +641,10 @@
|
||||
<StatusEffect tags="poison,morbusine" type="OnUse" target="Character" Health="-5.0" duration="60.0">
|
||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
|
||||
@@ -573,6 +668,7 @@
|
||||
<StatusEffect type="OnBroken" target="This" Condition="-100.0">
|
||||
<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"/>
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
|
||||
<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">
|
||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||
</StatusEffect>
|
||||
<!-- Remove the item when fully used -->
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
</Items>
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
category="Machine"
|
||||
focusonselected="true"
|
||||
offsetonselected="700"
|
||||
linkable="true"
|
||||
>
|
||||
linkable="true">
|
||||
|
||||
<Sprite texture ="railgunetc.png" depth="0.01" sourcerect="64,180,47,76"/>
|
||||
|
||||
@@ -23,8 +22,7 @@
|
||||
<Item
|
||||
name="Depth Charge Loader"
|
||||
category="Machine"
|
||||
linkable="true"
|
||||
>
|
||||
linkable="true">
|
||||
|
||||
<Sprite texture="railgunetc.png" depth="0.8" sourcerect="0,160,61,96"/>
|
||||
|
||||
@@ -53,7 +51,9 @@
|
||||
|
||||
<Projectile launchimpulse="5.0">
|
||||
<Attack damage="1" structuredamage="1" damagetype="Blunt"/>
|
||||
<StatusEffect type="OnImpact" target="Contained" Condition="-100.0"/>
|
||||
<StatusEffect type="OnImpact" target="Contained">
|
||||
<Use/>
|
||||
</StatusEffect>
|
||||
</Projectile>
|
||||
|
||||
<ItemContainer hideitems="true" capacity="1" canbeselected = "true">
|
||||
@@ -85,7 +85,9 @@
|
||||
<sound file="Content/Items/Weapons/bigexplosion.ogg" range="10000"/>
|
||||
<Explosion range="1000.0" structuredamage="1000" damage="1000" stun="10" force="50.0"/>
|
||||
</StatusEffect>
|
||||
<StatusEffect type="OnImpact" target="Contained" Condition="-100.0"/>
|
||||
<StatusEffect type="OnImpact" target="Contained">
|
||||
<Use/>
|
||||
</StatusEffect>
|
||||
</Projectile>
|
||||
|
||||
<ItemContainer hideitems="true" capacity="1" canbeselected = "true">
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
<Body width="24" height="8"/>
|
||||
|
||||
<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"/>
|
||||
<Explosion range="500.0" structuredamage="250" damage="200" stun="5" force="20.0" severlimbsprobability="0.5" decal="explosion" decalsize="0.5"/>
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
@@ -30,9 +31,10 @@
|
||||
|
||||
<Throwable slots="Any,RightHand,LeftHand" throwforce="4.0" aimpos="35,-10">
|
||||
<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"/>
|
||||
<Explosion range="600.0" structuredamage="150" damage="300" stun="5" force="20.0" severlimbsprobability="0.6" decal="explosion" decalsize="0.5"/>
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
@@ -50,9 +52,15 @@
|
||||
<Throwable slots="Any,RightHand,LeftHand" throwforce="4.0" aimpos="35,-10">
|
||||
<StatusEffect type="Always" target="This" Condition="-0.35"/>
|
||||
<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"/>
|
||||
<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>
|
||||
</Throwable>
|
||||
</Item>
|
||||
@@ -70,10 +78,11 @@
|
||||
|
||||
<Throwable slots="Any,RightHand,LeftHand" throwforce="4.0" aimpos="35,-10">
|
||||
<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"/>
|
||||
<Explosion range="500.0" structuredamage="50" damage="300" stun="5" force="20.0" severlimbsprobability="0.6"/>
|
||||
<Fire size="500"/>
|
||||
<Remove/>
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
</Item>
|
||||
@@ -101,7 +110,7 @@
|
||||
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]">
|
||||
<requireditem name="Screwdriver,Wire" type="Equipped"/>
|
||||
<input name="activate">
|
||||
<StatusEffect type="OnUse" target="Contained" Condition="-100.0">
|
||||
<StatusEffect type="OnUse" target="Contained">
|
||||
<Use/>
|
||||
</StatusEffect>
|
||||
</input>
|
||||
|
||||
@@ -132,7 +132,9 @@
|
||||
<ParticleEmitter particle="bubbles" anglemin="0" anglemax="360" particleamount="10" velocitymin="0" velocitymax="50" scalemin="2" scalemax="5"/>
|
||||
</StatusEffect>
|
||||
|
||||
<StatusEffect type="OnImpact" target="Contained" Condition="-100.0"/>
|
||||
<StatusEffect type="OnImpact" target="Contained">
|
||||
<Use/>
|
||||
</StatusEffect>
|
||||
</Projectile>
|
||||
|
||||
<ItemContainer hideitems="true" capacity="1" canbeselected = "true">
|
||||
|
||||
@@ -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