Fire extinguisher, burnt limbs, spectating improvements, option to disable spectating, jumpsuits for engi & mech, fireproof items, stuff

This commit is contained in:
Regalis
2015-11-18 20:02:45 +02:00
parent 7b6d92bb27
commit 9b08201972
36 changed files with 429 additions and 85 deletions
@@ -21,8 +21,6 @@ namespace Barotrauma.Items.Components
private string particles;
float structureFixAmount, limbFixAmount;
[HasDefaultValue(0.0f, false)]
public float Range
{
@@ -33,15 +31,18 @@ namespace Barotrauma.Items.Components
[HasDefaultValue(0.0f, false)]
public float StructureFixAmount
{
get { return structureFixAmount; }
set { structureFixAmount = value; }
get; set;
}
[HasDefaultValue(0.0f, false)]
public float LimbFixAmount
{
get { return limbFixAmount; }
set { limbFixAmount = value; }
get; set;
}
[HasDefaultValue(0.0f, false)]
public float ExtinquishAmount
{
get; set;
}
[HasDefaultValue("", false)]
@@ -51,6 +52,12 @@ namespace Barotrauma.Items.Components
set { particles = value; }
}
[HasDefaultValue(0.0f, false)]
public float ParticleSpeed
{
get; set;
}
[HasDefaultValue("0.0,0.0", false)]
public string BarrelPos
{
@@ -130,9 +137,18 @@ namespace Barotrauma.Items.Components
ignoredBodies.Add(limb.body.FarseerBody);
}
Body targetBody = Submarine.PickBody(TransformedBarrelPos, targetPosition, ignoredBodies);
pickedPosition = Submarine.LastPickedPosition;
if (ExtinquishAmount > 0.0f)
{
Vector2 displayPos = ConvertUnits.ToDisplayUnits(TransformedBarrelPos + (targetPosition-TransformedBarrelPos)*Submarine.LastPickedFraction*0.9f);
Hull hull = Hull.FindHull(displayPos, item.CurrentHull);
if (hull != null) hull.Extinquish(deltaTime, ExtinquishAmount, displayPos);
}
if (targetBody == null || targetBody.UserData == null) return true;
Structure targetStructure;
@@ -147,7 +163,7 @@ namespace Barotrauma.Items.Components
targetStructure.HighLightSection(sectionIndex);
targetStructure.AddDamage(sectionIndex, -structureFixAmount*degreeOfSuccess);
targetStructure.AddDamage(sectionIndex, -StructureFixAmount*degreeOfSuccess);
//if the next section is small enough, apply the effect to it as well
//(to make it easier to fix a small "left-over" section)
@@ -155,7 +171,7 @@ namespace Barotrauma.Items.Components
if (nextSectionLength > 0 && nextSectionLength < Structure.wallSectionSize * 0.3f)
{
targetStructure.HighLightSection(sectionIndex + 1);
targetStructure.AddDamage(sectionIndex + 1, -structureFixAmount * degreeOfSuccess);
targetStructure.AddDamage(sectionIndex + 1, -StructureFixAmount * degreeOfSuccess);
}
}
@@ -163,7 +179,7 @@ namespace Barotrauma.Items.Components
{
if (character.IsKeyDown(InputType.Aim))
{
targetLimb.character.Health += limbFixAmount * degreeOfSuccess;
targetLimb.character.Health += LimbFixAmount * degreeOfSuccess;
//isActive = true;
}
}
@@ -180,7 +196,6 @@ namespace Barotrauma.Items.Components
}
//ApplyStatusEffects(ActionType.OnUse, 1.0f, null, targ);
}
//if (Character.SecondaryKeyDown.State)
//{
// IPropertyObject propertyObject = targetBody.UserData as IPropertyObject;
@@ -210,7 +225,7 @@ namespace Barotrauma.Items.Components
if (!string.IsNullOrWhiteSpace(particles))
{
GameMain.ParticleManager.CreateParticle(particles, ConvertUnits.ToDisplayUnits(TransformedBarrelPos),
-item.body.Rotation + ((item.body.Dir>0.0f) ? 0.0f : MathHelper.Pi), 0.0f);
-item.body.Rotation + ((item.body.Dir>0.0f) ? 0.0f : MathHelper.Pi), ParticleSpeed);
}
//Vector2 startPos = ConvertUnits.ToDisplayUnits(item.body.Position);
@@ -182,7 +182,7 @@ namespace Barotrauma.Items.Components
IsActive = false;
if (activator != null) activator.AnimController.Anim = AnimController.Animation.None;
return false;
return true;
}
else
{
@@ -12,6 +12,8 @@ namespace Barotrauma.Items.Components
static float fullPower;
static float fullLoad;
const float FireProbability = 0.15f;
//affects how fast changes in power/load are carried over the grid
static float inertia = 5.0f;
@@ -71,7 +73,10 @@ namespace Barotrauma.Items.Components
if (particle != null) particle.Size *= Rand.Range(0.5f, 1.0f);
}
new FireSource(pt.item.Position);
if (FireProbability > 0.0f && Rand.Int((int)(1.0f / FireProbability)) == 1)
{
new FireSource(pt.item.Position);
}
}
}