Particle emitters can be assigned to statuseffects, fixed item.Submarine not being set correctly for throwable items, flare particles + sounds, nerfed some of the medical items
This commit is contained in:
@@ -1123,6 +1123,9 @@
|
|||||||
<None Include="Content\Items\Tools\extinguisher.ogg">
|
<None Include="Content\Items\Tools\extinguisher.ogg">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<None Include="Content\Items\Tools\flare.ogg">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
<None Include="Content\Items\Tools\plasmaCutter.ogg">
|
<None Include="Content\Items\Tools\plasmaCutter.ogg">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
|||||||
@@ -53,6 +53,8 @@
|
|||||||
|
|
||||||
<fabricableitem name="Fulgurium Battery Cell" requireditems="Steel Bar, Fulgurium Bar, Sulphuric Acid" requiredtime="10"/>
|
<fabricableitem name="Fulgurium Battery Cell" requireditems="Steel Bar, Fulgurium Bar, Sulphuric Acid" requiredtime="10"/>
|
||||||
|
|
||||||
|
<fabricableitem name="Flare" requireditems="Phosphorus,Aluminium" requiredtime="10"/>
|
||||||
|
|
||||||
<fabricableitem name ="Stun Grenade" requireditems="Steel Bar, Flash Powder, Chloral Hydrate" requiredtime="20">
|
<fabricableitem name ="Stun Grenade" requireditems="Steel Bar, Flash Powder, Chloral Hydrate" requiredtime="20">
|
||||||
<RequiredSkill name="Construction" level="30"/>
|
<RequiredSkill name="Construction" level="30"/>
|
||||||
</fabricableitem>
|
</fabricableitem>
|
||||||
|
|||||||
@@ -319,7 +319,7 @@
|
|||||||
<Body width="25" height="5" density="10"/>
|
<Body width="25" height="5" density="10"/>
|
||||||
|
|
||||||
<Holdable slots="Any,RightHand,LeftHand">
|
<Holdable slots="Any,RightHand,LeftHand">
|
||||||
<StatusEffect type="OnUse" target="Character" Health="-2.0" duration="60.0">
|
<StatusEffect type="OnUse" target="Character" Health="-1.0" duration="60.0">
|
||||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||||
</StatusEffect>
|
</StatusEffect>
|
||||||
</Holdable>
|
</Holdable>
|
||||||
@@ -375,7 +375,7 @@
|
|||||||
<Body width="25" height="5" density="10"/>
|
<Body width="25" height="5" density="10"/>
|
||||||
|
|
||||||
<Holdable slots="Any,RightHand,LeftHand">
|
<Holdable slots="Any,RightHand,LeftHand">
|
||||||
<StatusEffect type="OnUse" target="Character" Health="-20.0" duration="60.0">
|
<StatusEffect type="OnUse" target="Character" Health="-10.0" duration="60.0">
|
||||||
<RequiredItem name="Medical Syringe" type="Container"/>
|
<RequiredItem name="Medical Syringe" type="Container"/>
|
||||||
</StatusEffect>
|
</StatusEffect>
|
||||||
</Holdable>
|
</Holdable>
|
||||||
|
|||||||
Binary file not shown.
@@ -250,19 +250,29 @@
|
|||||||
category="Equipment"
|
category="Equipment"
|
||||||
pickdistance="150"
|
pickdistance="150"
|
||||||
price="5"
|
price="5"
|
||||||
|
spritecolor="1.0,0.0,0.0,1.0"
|
||||||
tags="smallitem">
|
tags="smallitem">
|
||||||
|
|
||||||
<Sprite texture ="tools.png" sourcerect="0,37,22,9" depth="0.5"/>
|
<Deconstruct time="10">
|
||||||
|
<Item name="Phosphorus"/>
|
||||||
|
<Item name="Aluminium"/>
|
||||||
|
</Deconstruct>
|
||||||
|
|
||||||
<Body width="11" height="24" density="30"/>
|
|
||||||
|
|
||||||
<Throwable slots="Any,RightHand,LeftHand" holdpos="0,0" handle1="0,0" throwforce="4.0" aimpos="35,-10">
|
<Sprite texture ="tools.png" sourcerect="0,38,21,7" depth="0.5"/>
|
||||||
|
|
||||||
</Throwable>
|
<Body width="21" height="7" density="12"/>
|
||||||
|
|
||||||
|
<Throwable slots="Any,RightHand,LeftHand" holdpos="0,0" handle1="0,0" throwforce="4.0" aimpos="35,-10"/>
|
||||||
|
|
||||||
<LightComponent LightColor="1.0,0.0,0.0,1.0" Flicker="0.5" range="600" IsOn="false">
|
<LightComponent LightColor="1.0,0.0,0.0,1.0" Flicker="0.5" range="600" IsOn="false">
|
||||||
<StatusEffect type="OnActive" target="This" Condition="-0.5"/>
|
|
||||||
<StatusEffect type="OnUse" target="This" IsOn="true"/>
|
<StatusEffect type="OnUse" target="This" IsOn="true"/>
|
||||||
|
|
||||||
|
<StatusEffect type="OnActive" target="This" Condition="-0.5">
|
||||||
|
<ParticleEmitter particle="flare"/>
|
||||||
|
<ParticleEmitter particle="bubbles"/>
|
||||||
|
</StatusEffect>
|
||||||
|
<sound file="flare.ogg" type="OnActive" range="800.0" loop="true"/>
|
||||||
</LightComponent>
|
</LightComponent>
|
||||||
</Item>
|
</Item>
|
||||||
|
|
||||||
|
|||||||
@@ -219,4 +219,19 @@
|
|||||||
velocitychange="0.0, -0.5">
|
velocitychange="0.0, -0.5">
|
||||||
<sprite texture="Content/Particles/spatter.png" sourcerect="128,128,128,128"/>
|
<sprite texture="Content/Particles/spatter.png" sourcerect="128,128,128,128"/>
|
||||||
</extinguisher>
|
</extinguisher>
|
||||||
|
|
||||||
|
<flare
|
||||||
|
startsizemin="0.1,0.1" startsizemax="0.2,0.2"
|
||||||
|
sizechangemin="0.1,0.1" sizechangemax="0.2,0.2"
|
||||||
|
startrotationmin ="-180.0" startrotationmax="180"
|
||||||
|
startcolor="1.0, 1.0, 1.0" startalpha="1.0"
|
||||||
|
colorchange="-0.5, -1.0, -1.0, -0.5"
|
||||||
|
lifetime="2.5"
|
||||||
|
growtime ="0.05"
|
||||||
|
drawtarget="both"
|
||||||
|
collideswithwalls="true"
|
||||||
|
blendstate="additive"
|
||||||
|
velocitychange="0.0, 1.0">
|
||||||
|
<sprite texture="Content/Particles/spatter.png" sourcerect="128,128,128,128"/>
|
||||||
|
</flare>
|
||||||
</prefabs>
|
</prefabs>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Microsoft.Xna.Framework;
|
using Barotrauma.Particles;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -36,6 +37,8 @@ namespace Barotrauma
|
|||||||
|
|
||||||
private Explosion explosion;
|
private Explosion explosion;
|
||||||
|
|
||||||
|
private List<ParticleEmitterPrefab> particleEmitters;
|
||||||
|
|
||||||
public readonly float FireSize;
|
public readonly float FireSize;
|
||||||
|
|
||||||
private Sound sound;
|
private Sound sound;
|
||||||
@@ -68,6 +71,7 @@ namespace Barotrauma
|
|||||||
protected StatusEffect(XElement element)
|
protected StatusEffect(XElement element)
|
||||||
{
|
{
|
||||||
requiredItems = new List<RelatedItem>();
|
requiredItems = new List<RelatedItem>();
|
||||||
|
particleEmitters = new List<ParticleEmitterPrefab>();
|
||||||
|
|
||||||
IEnumerable<XAttribute> attributes = element.Attributes();
|
IEnumerable<XAttribute> attributes = element.Attributes();
|
||||||
List<XAttribute> propertyAttributes = new List<XAttribute>();
|
List<XAttribute> propertyAttributes = new List<XAttribute>();
|
||||||
@@ -156,6 +160,9 @@ namespace Barotrauma
|
|||||||
case "useitem":
|
case "useitem":
|
||||||
useItem = true;
|
useItem = true;
|
||||||
break;
|
break;
|
||||||
|
case "particleemitter":
|
||||||
|
particleEmitters.Add(new ParticleEmitterPrefab(subElement));
|
||||||
|
break;
|
||||||
case "requireditem":
|
case "requireditem":
|
||||||
case "requireditems":
|
case "requireditems":
|
||||||
RelatedItem newRequiredItem = RelatedItem.Load(subElement);
|
RelatedItem newRequiredItem = RelatedItem.Load(subElement);
|
||||||
@@ -253,12 +260,28 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (explosion != null) explosion.Explode(entity.WorldPosition);
|
if (explosion != null) explosion.Explode(entity.WorldPosition);
|
||||||
|
|
||||||
|
|
||||||
|
Hull hull = null;
|
||||||
|
if (entity is Character)
|
||||||
|
{
|
||||||
|
hull = ((Character)entity).AnimController.CurrentHull;
|
||||||
|
}
|
||||||
|
else if (entity is Item)
|
||||||
|
{
|
||||||
|
hull = ((Item)entity).CurrentHull;
|
||||||
|
}
|
||||||
|
|
||||||
if (FireSize > 0.0f)
|
if (FireSize > 0.0f)
|
||||||
{
|
{
|
||||||
var fire = new FireSource(entity.WorldPosition);
|
var fire = new FireSource(entity.WorldPosition, hull);
|
||||||
|
|
||||||
fire.Size = new Vector2(FireSize, fire.Size.Y);
|
fire.Size = new Vector2(FireSize, fire.Size.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (ParticleEmitterPrefab emitter in particleEmitters)
|
||||||
|
{
|
||||||
|
emitter.Emit(entity.WorldPosition, hull);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<object> ApplyToPropertyOverDuration(float duration, ObjectProperty property, object value)
|
private IEnumerable<object> ApplyToPropertyOverDuration(float duration, ObjectProperty property, object value)
|
||||||
|
|||||||
@@ -241,22 +241,16 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
public override void Update(float deltaTime, Camera cam)
|
public override void Update(float deltaTime, Camera cam)
|
||||||
{
|
{
|
||||||
if (item.body==null || !item.body.Enabled) return;
|
if (item.body == null || !item.body.Enabled) return;
|
||||||
if (!picker.HasSelectedItem(item)) IsActive = false;
|
if (!picker.HasSelectedItem(item)) IsActive = false;
|
||||||
|
|
||||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, picker);
|
ApplyStatusEffects(ActionType.OnActive, deltaTime, picker);
|
||||||
|
|
||||||
if (item.body.Dir != picker.AnimController.Dir) Flip(item);
|
if (item.body.Dir != picker.AnimController.Dir) Flip(item);
|
||||||
|
|
||||||
AnimController ac = picker.AnimController;
|
|
||||||
|
|
||||||
item.Submarine = picker.Submarine;
|
item.Submarine = picker.Submarine;
|
||||||
|
|
||||||
//if (picker.SelectedConstruction != null && picker.SelectedConstruction.GetComponent<Controller>() != null) return;
|
picker.AnimController.HoldItem(deltaTime, item, handlePos, holdPos, aimPos, picker.IsKeyDown(InputType.Aim), holdAngle);
|
||||||
|
|
||||||
//item.sprite.Depth = picker.AnimController.GetLimb(LimbType.RightHand).sprite.Depth + 0.01f;
|
|
||||||
|
|
||||||
ac.HoldItem(deltaTime, item, handlePos, holdPos, aimPos, picker.IsKeyDown(InputType.Aim), holdAngle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void Flip(Item item)
|
protected void Flip(Item item)
|
||||||
|
|||||||
@@ -82,6 +82,8 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
AnimController ac = picker.AnimController;
|
AnimController ac = picker.AnimController;
|
||||||
|
|
||||||
|
item.Submarine = picker.Submarine;
|
||||||
|
|
||||||
if (!throwing)
|
if (!throwing)
|
||||||
{
|
{
|
||||||
if (picker.IsKeyDown(InputType.Aim))
|
if (picker.IsKeyDown(InputType.Aim))
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace Barotrauma.Particles
|
|||||||
}
|
}
|
||||||
|
|
||||||
AngleMin = MathHelper.ToRadians(AngleMin);
|
AngleMin = MathHelper.ToRadians(AngleMin);
|
||||||
AngleMin = MathHelper.ToRadians(AngleMax);
|
AngleMax = MathHelper.ToRadians(AngleMax);
|
||||||
|
|
||||||
if (element.Attribute("velocity") == null)
|
if (element.Attribute("velocity") == null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user