Crates, some new chemicals, statuseffects that are triggered on impact, explosions can trigger "OnFire" statuseffects, applying impulses to items (and not just characters) when the submarine hits something
This commit is contained in:
@@ -39,8 +39,6 @@ namespace Barotrauma
|
||||
{
|
||||
GameMain.ParticleManager.CreateParticle("shockwave", worldPosition,
|
||||
Vector2.Zero, 0.0f, hull);
|
||||
|
||||
|
||||
}
|
||||
|
||||
for (int i = 0; i < attack.Range * 0.1f; i++)
|
||||
@@ -79,6 +77,21 @@ namespace Barotrauma
|
||||
|
||||
ApplyExplosionForces(worldPosition, attack.Range, force, attack.GetDamage(1.0f), attack.Stun);
|
||||
|
||||
if (flames)
|
||||
{
|
||||
foreach (Item item in Item.ItemList)
|
||||
{
|
||||
if (item.CurrentHull != hull || item.FireProof || item.Condition <= 0.0f) continue;
|
||||
//if (item.ParentInventory != null) return;
|
||||
|
||||
if (Vector2.Distance(item.WorldPosition, worldPosition) > attack.Range * 0.1f) continue;
|
||||
|
||||
//item.Condition -= (float)Math.Sqrt(size.X) * deltaTime;
|
||||
|
||||
item.ApplyStatusEffects(ActionType.OnFire, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private IEnumerable<object> DimLight()
|
||||
|
||||
@@ -250,7 +250,7 @@ namespace Barotrauma
|
||||
foreach (Item item in Item.ItemList)
|
||||
{
|
||||
if (item.CurrentHull != hull || item.FireProof || item.Condition <= 0.0f) continue;
|
||||
if (item.ParentInventory != null) return;
|
||||
//if (item.ParentInventory != null) return;
|
||||
|
||||
float range = (float)Math.Sqrt(size.X) * 10.0f;
|
||||
if (item.Position.X < position.X - range || item.Position.X > position.X + size.X + range) continue;
|
||||
|
||||
@@ -492,10 +492,10 @@ namespace Barotrauma
|
||||
SoundPlayer.PlayDamageSound(DamageSoundType.StructureBlunt, impact * 10.0f, ConvertUnits.ToDisplayUnits(lastContactPoint));
|
||||
GameMain.GameScreen.Cam.Shake = impact * 2.0f;
|
||||
|
||||
Vector2 limbForce = direction * impact * 0.5f;
|
||||
Vector2 impulse = direction * impact * 0.5f;
|
||||
|
||||
float length = limbForce.Length();
|
||||
if (length > 5.0f) limbForce = (limbForce / length) * 5.0f;
|
||||
float length = impulse.Length();
|
||||
if (length > 5.0f) impulse = (impulse / length) * 5.0f;
|
||||
|
||||
foreach (Character c in Character.CharacterList)
|
||||
{
|
||||
@@ -506,10 +506,17 @@ namespace Barotrauma
|
||||
foreach (Limb limb in c.AnimController.Limbs)
|
||||
{
|
||||
if (c.AnimController.LowestLimb == limb) continue;
|
||||
limb.body.ApplyLinearImpulse(limb.Mass * limbForce);
|
||||
limb.body.ApplyLinearImpulse(limb.Mass * impulse);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Item item in Item.ItemList)
|
||||
{
|
||||
if (item.Submarine != submarine || item.CurrentHull == null || item.body == null) continue;
|
||||
|
||||
item.body.ApplyLinearImpulse(item.body.Mass * impulse);
|
||||
}
|
||||
|
||||
Explosion.RangedStructureDamage(ConvertUnits.ToDisplayUnits(lastContactPoint), impact * 50.0f, impact * DamageMultiplier);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user