diff --git a/Subsurface/Characters/Character.cs b/Subsurface/Characters/Character.cs
index 76356b75c..c9eff264b 100644
--- a/Subsurface/Characters/Character.cs
+++ b/Subsurface/Characters/Character.cs
@@ -356,7 +356,7 @@ namespace Subsurface
///
/// Control the characte
///
- public void Control(Camera cam, bool forcePick=false)
+ public void Control(float deltaTime, Camera cam, bool forcePick=false)
{
if (isDead) return;
@@ -383,15 +383,15 @@ namespace Subsurface
if (selectedItems[i] == null) continue;
if (i == 1 && selectedItems[0] == selectedItems[1]) continue;
- if (actionKeyDown.State) selectedItems[i].Use(this);
- if (secondaryKeyDown.State && selectedItems[i] != null) selectedItems[i].SecondaryUse(this);
+ if (actionKeyDown.State) selectedItems[i].Use(deltaTime, this);
+ if (secondaryKeyDown.State && selectedItems[i] != null) selectedItems[i].SecondaryUse(deltaTime, this);
}
if (selectedConstruction != null)
{
- if (actionKeyDown.State) selectedConstruction.Use(this);
- if (secondaryKeyDown.State) selectedConstruction.SecondaryUse(this);
+ if (actionKeyDown.State) selectedConstruction.Use(deltaTime, this);
+ if (secondaryKeyDown.State) selectedConstruction.SecondaryUse(deltaTime, this);
}
if (IsNetworkPlayer)
@@ -522,8 +522,8 @@ namespace Subsurface
}
if (controlled == this) ControlLocalPlayer(cam);
-
- Control(cam);
+
+ Control(deltaTime, cam);
UpdateSightRange();
aiTarget.SoundRange = 0.0f;
@@ -781,7 +781,7 @@ namespace Subsurface
new NetworkEvent(NetworkEventType.KillCharacter, ID, false);
}
- if (Game1.GameSession.crewManager!=null)
+ if (Game1.GameSession!=null && Game1.GameSession.crewManager != null)
{
Game1.GameSession.crewManager.KillCharacter(this);
}
diff --git a/Subsurface/Characters/DelayedEffect.cs b/Subsurface/Characters/DelayedEffect.cs
index 1ecb3098c..1b1646083 100644
--- a/Subsurface/Characters/DelayedEffect.cs
+++ b/Subsurface/Characters/DelayedEffect.cs
@@ -14,9 +14,7 @@ namespace Subsurface
private Item item;
private Character character;
-
- private Limb limb;
-
+
public float Timer
{
get { return timer; }
@@ -28,13 +26,12 @@ namespace Subsurface
delay = ToolBox.GetAttributeFloat(element, "delay", 1.0f);
}
- public override void Apply(ActionType type, float deltaTime, Item item, Character character = null, Limb limb = null)
+ public override void Apply(ActionType type, float deltaTime, Item item, Character character = null)
{
if (this.type != type) return;
this.item = item;
this.character = character;
- this.limb = limb;
timer = delay;
@@ -47,7 +44,7 @@ namespace Subsurface
if (timer > 0.0f) return;
- base.Apply(1.0f, character, item, limb);
+ base.Apply(1.0f, character, item);
list.Remove(this);
}
diff --git a/Subsurface/Characters/StatusEffect.cs b/Subsurface/Characters/StatusEffect.cs
index 2fa7fca9c..eea50dc26 100644
--- a/Subsurface/Characters/StatusEffect.cs
+++ b/Subsurface/Characters/StatusEffect.cs
@@ -1,4 +1,5 @@
-using System;
+using Microsoft.Xna.Framework;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
@@ -10,7 +11,7 @@ namespace Subsurface
[Flags]
public enum Target
{
- This = 1, Parent = 2, Character = 4, Contained = 8, Nearby = 16
+ This = 1, Parent = 2, Character = 4, Contained = 8, Nearby = 16, UseTarget=32
}
private Target targets;
@@ -142,14 +143,34 @@ namespace Subsurface
}
- public virtual void Apply(ActionType type, float deltaTime, Item item, Character character = null, Limb limb = null)
+ public virtual void Apply(ActionType type, float deltaTime, Item item, Character character = null)
{
if (this.type == type) Apply(deltaTime, character, item);
-
}
-
- protected virtual void Apply(float deltaTime, Character character, Item item, Limb limb = null)
+ public virtual void Apply(ActionType type, float deltaTime, Vector2 position, IPropertyObject target)
+ {
+ if (!targetNames.Contains(target.Name)) return;
+ if (this.type == type) Apply(deltaTime, position, target);
+ }
+
+ protected virtual void Apply(float deltaTime, Vector2 position, IPropertyObject target)
+ {
+ if (explosion != null) explosion.Explode(position);
+
+ if (sound != null) sound.Play(1.0f, 1000.0f, position);
+
+ for (int i = 0; i < propertyNames.Count(); i++)
+ {
+ ObjectProperty property;
+ if (target.ObjectProperties.TryGetValue(propertyNames[i], out property))
+ {
+ ApplyToProperty(property, propertyEffects[i], deltaTime);
+ }
+ }
+ }
+
+ protected virtual void Apply(float deltaTime, Character character, Item item)
{
if (explosion != null) explosion.Explode(item.SimPosition);
diff --git a/Subsurface/Content/Items/Diving/divinggear.xml b/Subsurface/Content/Items/Diving/divinggear.xml
index cdd318394..79cdf2cfb 100644
--- a/Subsurface/Content/Items/Diving/divinggear.xml
+++ b/Subsurface/Content/Items/Diving/divinggear.xml
@@ -12,10 +12,12 @@
+
+
diff --git a/Subsurface/Content/Items/OxygenTank/item.xml b/Subsurface/Content/Items/Diving/item.xml
similarity index 100%
rename from Subsurface/Content/Items/OxygenTank/item.xml
rename to Subsurface/Content/Items/Diving/item.xml
diff --git a/Subsurface/Content/Items/OxygenTank/oxygentank.png b/Subsurface/Content/Items/Diving/oxygentank.png
similarity index 100%
rename from Subsurface/Content/Items/OxygenTank/oxygentank.png
rename to Subsurface/Content/Items/Diving/oxygentank.png
diff --git a/Subsurface/Content/Items/Tools/fueltank.png b/Subsurface/Content/Items/Tools/fueltank.png
new file mode 100644
index 000000000..f26b70ebe
Binary files /dev/null and b/Subsurface/Content/Items/Tools/fueltank.png differ
diff --git a/Subsurface/Content/Items/Tools/plasmacutter.png b/Subsurface/Content/Items/Tools/plasmacutter.png
new file mode 100644
index 000000000..25fdfaa60
Binary files /dev/null and b/Subsurface/Content/Items/Tools/plasmacutter.png differ
diff --git a/Subsurface/Content/Items/Tools/tools.xml b/Subsurface/Content/Items/Tools/tools.xml
index ecf919bda..d6ca8fe5f 100644
--- a/Subsurface/Content/Items/Tools/tools.xml
+++ b/Subsurface/Content/Items/Tools/tools.xml
@@ -7,16 +7,64 @@
-