- More gore particles when severing limbs!
- Explosions can sever limbs even if the target character is dead. Now explosive projectiles can explode creatures into pieces even if the creature dies of the initial projectile impact and not the explosion. - Disabled blood particles on carriers and fractal guardians.
This commit is contained in:
@@ -17,7 +17,7 @@ namespace Barotrauma
|
|||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
Sound hitSound;
|
private Sound hitSound;
|
||||||
|
|
||||||
public Sound HitSound
|
public Sound HitSound
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<Character name="carrier" humanoid="false" health="1000" doesbleed="false">
|
<Character name="carrier" humanoid="false" health="1000" doesbleed="false" usebloodparticles="false">
|
||||||
|
|
||||||
<sound file="Content/Characters/Carrier/alarm1.ogg" state="Attack" range="2000"/>
|
<sound file="Content/Characters/Carrier/alarm1.ogg" state="Attack" range="2000"/>
|
||||||
<sound file="Content/Characters/Carrier/carrier1.ogg" state="Attack" range="2000"/>
|
<sound file="Content/Characters/Carrier/carrier1.ogg" state="Attack" range="2000"/>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<Character name="fractalguardian" humanoid="false" health="500.0" doesbleed="false">
|
<Character name="fractalguardian" humanoid="false" health="500.0" doesbleed="false" usebloodparticles="false">
|
||||||
|
|
||||||
<sound file="Content/Characters/Fractalguardian/guardian1.ogg" state="Attack" range="3000" />
|
<sound file="Content/Characters/Fractalguardian/guardian1.ogg" state="Attack" range="3000" />
|
||||||
<sound file="Content/Characters/Fractalguardian/guardian2.ogg" state="Attack" range="3000" />
|
<sound file="Content/Characters/Fractalguardian/guardian2.ogg" state="Attack" range="3000" />
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<Character name="fractalguardian" humanoid="false" health="800.0" doesbleed="false">
|
<Character name="fractalguardian" humanoid="false" health="800.0" doesbleed="false" usebloodparticles="false">
|
||||||
|
|
||||||
<sound file="Content/Characters/Fractalguardian/guardian1.ogg" state="Attack" range="3000" />
|
<sound file="Content/Characters/Fractalguardian/guardian1.ogg" state="Attack" range="3000" />
|
||||||
<sound file="Content/Characters/Fractalguardian/guardian2.ogg" state="Attack" range="3000" />
|
<sound file="Content/Characters/Fractalguardian/guardian2.ogg" state="Attack" range="3000" />
|
||||||
|
|||||||
@@ -124,7 +124,7 @@
|
|||||||
|
|
||||||
<StatusEffect type="OnUse" Condition="-100.0" stun="10.0" disabledeltatime="true">
|
<StatusEffect type="OnUse" Condition="-100.0" stun="10.0" disabledeltatime="true">
|
||||||
<sound file="Content/Items/Weapons/bigexplosion.ogg"/>
|
<sound file="Content/Items/Weapons/bigexplosion.ogg"/>
|
||||||
<Explosion range="1000.0" structuredamage="1000" damage="1000" stun="10" force="50.0" severlimbsprobability="0.8" decal="explosion" decalsize="1.0"/>
|
<Explosion range="1000.0" structuredamage="1000" damage="1000" stun="10" force="50.0" severlimbsprobability="1.0" decal="explosion" decalsize="1.0"/>
|
||||||
</StatusEffect>
|
</StatusEffect>
|
||||||
|
|
||||||
<StatusEffect type="OnActive" target="This">
|
<StatusEffect type="OnActive" target="This">
|
||||||
|
|||||||
@@ -82,6 +82,121 @@
|
|||||||
<animatedsprite texture="Content/Particles/Smoke.png" sourcerect="0,0,4096,4096" columns="8" rows="8" origin="0.5,0.5"/>
|
<animatedsprite texture="Content/Particles/Smoke.png" sourcerect="0,0,4096,4096" columns="8" rows="8" origin="0.5,0.5"/>
|
||||||
</waterblood>
|
</waterblood>
|
||||||
|
|
||||||
|
<bloodtrail
|
||||||
|
lifetime="0.5"
|
||||||
|
angularvelocitymin="0"
|
||||||
|
angularvelocitymax="0"
|
||||||
|
startrotationmin="0"
|
||||||
|
startrotationmax="360"
|
||||||
|
rotatetodirection="False"
|
||||||
|
drag="0"
|
||||||
|
waterdrag="0.8"
|
||||||
|
velocitychange="0,0"
|
||||||
|
collisionradius="30"
|
||||||
|
collideswithwalls="False"
|
||||||
|
deleteoncollision="False"
|
||||||
|
friction="0.01"
|
||||||
|
restitution="0.2"
|
||||||
|
startsizemin="0.6,0.6"
|
||||||
|
startsizemax="1,1"
|
||||||
|
sizechangemin="0.2,0.2"
|
||||||
|
sizechangemax="0.5,0.5"
|
||||||
|
growtime="0.05"
|
||||||
|
startcolor="0.4941176,0,0,0.4941176"
|
||||||
|
startalpha="0.5"
|
||||||
|
colorchange="0,0,0,-1"
|
||||||
|
drawtarget="Both"
|
||||||
|
blendstate="AlphaBlend"
|
||||||
|
animduration="1"
|
||||||
|
loopanim="True">
|
||||||
|
<sprite texture="Content/Particles/spatter.png" sourcerect="0,0,128,128"/>
|
||||||
|
<sprite texture="Content/Particles/spatter.png" sourcerect="128,0,128,128"/>
|
||||||
|
<sprite texture="Content/Particles/spatter.png" sourcerect="0,128,128,128"/>
|
||||||
|
</bloodtrail>
|
||||||
|
|
||||||
|
<gib
|
||||||
|
lifetime="5"
|
||||||
|
angularvelocitymin="-500"
|
||||||
|
angularvelocitymax="500"
|
||||||
|
startrotationmin="0"
|
||||||
|
startrotationmax="360"
|
||||||
|
rotatetodirection="True"
|
||||||
|
drag="0"
|
||||||
|
waterdrag="0.3"
|
||||||
|
velocitychange="0,-8"
|
||||||
|
velocitychangewater="0,-1"
|
||||||
|
collisionradius="10"
|
||||||
|
collideswithwalls="True"
|
||||||
|
deleteoncollision="False"
|
||||||
|
friction="0.5"
|
||||||
|
restitution="0.1"
|
||||||
|
startsizemin="0.3,0.3"
|
||||||
|
startsizemax="0.6,0.6"
|
||||||
|
sizechangemin="-0.1,-0.1"
|
||||||
|
sizechangemax="-0.1,-0.1"
|
||||||
|
growtime="0"
|
||||||
|
startcolor="0.2980392,0,0,1"
|
||||||
|
startalpha="1"
|
||||||
|
colorchange="0,0,0,-0.3"
|
||||||
|
drawtarget="Both"
|
||||||
|
blendstate="AlphaBlend"
|
||||||
|
animduration="1"
|
||||||
|
loopanim="True">
|
||||||
|
<sprite texture="Content/Particles/shrapnel.png" sourcerect="0,64,32,32"/>
|
||||||
|
<sprite texture="Content/Particles/shrapnel.png" sourcerect="32,64,32,32"/>
|
||||||
|
<sprite texture="Content/Particles/shrapnel.png" sourcerect="64,64,32,32"/>
|
||||||
|
<sprite texture="Content/Particles/shrapnel.png" sourcerect="96,64,32,32"/>
|
||||||
|
<sprite texture="Content/Particles/shrapnel.png" sourcerect="128,64,32,32"/>
|
||||||
|
<sprite texture="Content/Particles/shrapnel.png" sourcerect="160,64,48,32"/>
|
||||||
|
<sprite texture="Content/Particles/shrapnel.png" sourcerect="208,64,48,32"/>
|
||||||
|
</gib>
|
||||||
|
|
||||||
|
<heavygib
|
||||||
|
lifetime="1"
|
||||||
|
angularvelocitymin="-500"
|
||||||
|
angularvelocitymax="500"
|
||||||
|
startrotationmin="0"
|
||||||
|
startrotationmax="360"
|
||||||
|
rotatetodirection="False"
|
||||||
|
drag="0"
|
||||||
|
waterdrag="0.3"
|
||||||
|
velocitychange="0,-8"
|
||||||
|
velocitychangewater="0,-1"
|
||||||
|
collisionradius="10"
|
||||||
|
collideswithwalls="True"
|
||||||
|
deleteoncollision="True"
|
||||||
|
friction="0.5"
|
||||||
|
restitution="0.5"
|
||||||
|
startsizemin="0.8,0.8"
|
||||||
|
startsizemax="1,1"
|
||||||
|
sizechangemin="-0.5,-0.5"
|
||||||
|
sizechangemax="-0.5,-0.5"
|
||||||
|
growtime="0"
|
||||||
|
startcolor="0.2980392,0,0,1"
|
||||||
|
startalpha="1"
|
||||||
|
colorchange="0,0,0,-0.3"
|
||||||
|
drawtarget="Both"
|
||||||
|
blendstate="AlphaBlend"
|
||||||
|
animduration="1"
|
||||||
|
loopanim="True">
|
||||||
|
<sprite texture="Content/Particles/shrapnel.png" sourcerect="0,64,32,32"/>
|
||||||
|
<sprite texture="Content/Particles/shrapnel.png" sourcerect="32,64,32,32"/>
|
||||||
|
<sprite texture="Content/Particles/shrapnel.png" sourcerect="64,64,32,32"/>
|
||||||
|
<sprite texture="Content/Particles/shrapnel.png" sourcerect="96,64,32,32"/>
|
||||||
|
<sprite texture="Content/Particles/shrapnel.png" sourcerect="128,64,32,32"/>
|
||||||
|
<sprite texture="Content/Particles/shrapnel.png" sourcerect="160,64,48,32"/>
|
||||||
|
<sprite texture="Content/Particles/shrapnel.png" sourcerect="208,64,48,32"/>
|
||||||
|
|
||||||
|
<ParticleEmitter
|
||||||
|
particle="bloodtrail"
|
||||||
|
particlespersecond="10"
|
||||||
|
position="0,0"
|
||||||
|
anglemin="0"
|
||||||
|
anglemax="360"
|
||||||
|
velocitymin="10"
|
||||||
|
velocitymax="20"/>
|
||||||
|
</heavygib>
|
||||||
|
|
||||||
<spark
|
<spark
|
||||||
startsizemin="0.5,0.2" startsizemax="1.0,0.7"
|
startsizemin="0.5,0.2" startsizemax="1.0,0.7"
|
||||||
sizechangemin="-0.5,-0.5" sizechangemax="-1.0,-1.0"
|
sizechangemin="-0.5,-0.5" sizechangemax="-1.0,-1.0"
|
||||||
@@ -314,7 +429,7 @@
|
|||||||
startcolor="1.0, 1.0, 1.0" startalpha="1.0"
|
startcolor="1.0, 1.0, 1.0" startalpha="1.0"
|
||||||
colorchange="0.0, 0.0, 0.0, -0.3"
|
colorchange="0.0, 0.0, 0.0, -0.3"
|
||||||
lifetime="10.0"
|
lifetime="10.0"
|
||||||
drawtarget="both"
|
drawtarget="water"
|
||||||
collideswithwalls="true"
|
collideswithwalls="true"
|
||||||
collisionradius="10.0"
|
collisionradius="10.0"
|
||||||
restitution="0.2"
|
restitution="0.2"
|
||||||
|
|||||||
@@ -541,12 +541,29 @@ namespace Barotrauma
|
|||||||
GetConnectedLimbs(connectedLimbs, checkedJoints, MainLimb);
|
GetConnectedLimbs(connectedLimbs, checkedJoints, MainLimb);
|
||||||
foreach (Limb limb in Limbs)
|
foreach (Limb limb in Limbs)
|
||||||
{
|
{
|
||||||
if (!connectedLimbs.Contains(limb))
|
if (connectedLimbs.Contains(limb)) continue;
|
||||||
{
|
|
||||||
limb.IsSevered = true;
|
limb.IsSevered = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CLIENT
|
||||||
|
if (character.UseBloodParticles)
|
||||||
|
{
|
||||||
|
foreach (Limb limb in new Limb[] { limbJoint.LimbA, limbJoint.LimbB })
|
||||||
|
{
|
||||||
|
for (int i = 0; i < MathHelper.Clamp(limb.Mass * 2.0f, 1.0f, 50.0f); i++)
|
||||||
|
{
|
||||||
|
GameMain.ParticleManager.CreateParticle("gib", limb.WorldPosition, Rand.Range(0.0f, MathHelper.TwoPi), Rand.Range(200.0f, 700.0f), character.CurrentHull);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < MathHelper.Clamp(limb.Mass * 2.0f, 1.0f, 10.0f); i++)
|
||||||
|
{
|
||||||
|
GameMain.ParticleManager.CreateParticle("heavygib", limb.WorldPosition, Rand.Range(0.0f, MathHelper.TwoPi), Rand.Range(50.0f, 250.0f), character.CurrentHull);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (GameMain.Server != null)
|
if (GameMain.Server != null)
|
||||||
{
|
{
|
||||||
GameMain.Server.CreateEntityEvent(character, new object[] { NetEntityEvent.Type.Status });
|
GameMain.Server.CreateEntityEvent(character, new object[] { NetEntityEvent.Type.Status });
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ namespace Barotrauma
|
|||||||
public float TargetForce { get; private set; }
|
public float TargetForce { get; private set; }
|
||||||
|
|
||||||
[Serialize(0.0f, false)]
|
[Serialize(0.0f, false)]
|
||||||
public float SeverLimbsProbability { get; private set; }
|
public float SeverLimbsProbability { get; set; }
|
||||||
|
|
||||||
[Serialize(0.0f, false)]
|
[Serialize(0.0f, false)]
|
||||||
public float Priority { get; private set; }
|
public float Priority { get; private set; }
|
||||||
|
|||||||
@@ -425,6 +425,12 @@ namespace Barotrauma
|
|||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool UseBloodParticles
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
|
|
||||||
public float BleedingDecreaseSpeed
|
public float BleedingDecreaseSpeed
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
@@ -633,6 +639,7 @@ namespace Barotrauma
|
|||||||
health = maxHealth;
|
health = maxHealth;
|
||||||
|
|
||||||
DoesBleed = doc.Root.GetAttributeBool("doesbleed", true);
|
DoesBleed = doc.Root.GetAttributeBool("doesbleed", true);
|
||||||
|
UseBloodParticles = doc.Root.GetAttributeBool("usebloodparticles", true);
|
||||||
BleedingDecreaseSpeed = doc.Root.GetAttributeFloat("bleedingdecreasespeed", 0.05f);
|
BleedingDecreaseSpeed = doc.Root.GetAttributeFloat("bleedingdecreasespeed", 0.05f);
|
||||||
|
|
||||||
needsAir = doc.Root.GetAttributeBool("needsair", false);
|
needsAir = doc.Root.GetAttributeBool("needsair", false);
|
||||||
|
|||||||
@@ -387,6 +387,8 @@ namespace Barotrauma
|
|||||||
SoundPlayer.PlayDamageSound(damageSoundType, amount, position);
|
SoundPlayer.PlayDamageSound(damageSoundType, amount, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (character.UseBloodParticles)
|
||||||
|
{
|
||||||
float bloodParticleAmount = bleedingAmount <= 0.0f ? 0 : (int)Math.Min(amount / 5, 10);
|
float bloodParticleAmount = bleedingAmount <= 0.0f ? 0 : (int)Math.Min(amount / 5, 10);
|
||||||
float bloodParticleSize = MathHelper.Clamp(amount / 50.0f, 0.1f, 1.0f);
|
float bloodParticleSize = MathHelper.Clamp(amount / 50.0f, 0.1f, 1.0f);
|
||||||
|
|
||||||
@@ -403,7 +405,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
character.CurrentHull.AddDecal("blood", WorldPosition, MathHelper.Clamp(bloodParticleSize, 0.5f, 1.0f));
|
character.CurrentHull.AddDecal("blood", WorldPosition, MathHelper.Clamp(bloodParticleSize, 0.5f, 1.0f));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (damageType == DamageType.Burn)
|
if (damageType == DamageType.Burn)
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ namespace Barotrauma
|
|||||||
public Explosion(float range, float force, float damage, float structureDamage)
|
public Explosion(float range, float force, float damage, float structureDamage)
|
||||||
{
|
{
|
||||||
attack = new Attack(damage, structureDamage, 0.0f, range);
|
attack = new Attack(damage, structureDamage, 0.0f, range);
|
||||||
|
attack.SeverLimbsProbability = 1.0f;
|
||||||
this.force = force;
|
this.force = force;
|
||||||
sparks = true;
|
sparks = true;
|
||||||
shockwave = true;
|
shockwave = true;
|
||||||
@@ -118,7 +119,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
explosionPos = ConvertUnits.ToSimUnits(explosionPos);
|
explosionPos = ConvertUnits.ToSimUnits(explosionPos);
|
||||||
|
|
||||||
bool wasDead = c.IsDead;
|
Dictionary<Limb, float> distFactors = new Dictionary<Limb, float>();
|
||||||
foreach (Limb limb in c.AnimController.Limbs)
|
foreach (Limb limb in c.AnimController.Limbs)
|
||||||
{
|
{
|
||||||
float dist = Vector2.Distance(limb.WorldPosition, worldPosition);
|
float dist = Vector2.Distance(limb.WorldPosition, worldPosition);
|
||||||
@@ -135,6 +136,8 @@ namespace Barotrauma
|
|||||||
//solid obstacles between the explosion and the limb reduce the effect of the explosion by 90%
|
//solid obstacles between the explosion and the limb reduce the effect of the explosion by 90%
|
||||||
if (Submarine.CheckVisibility(limb.SimPosition, explosionPos) != null) distFactor *= 0.1f;
|
if (Submarine.CheckVisibility(limb.SimPosition, explosionPos) != null) distFactor *= 0.1f;
|
||||||
|
|
||||||
|
distFactors.Add(limb, distFactor);
|
||||||
|
|
||||||
c.AddDamage(limb.WorldPosition, DamageType.None,
|
c.AddDamage(limb.WorldPosition, DamageType.None,
|
||||||
attack.GetDamage(1.0f) / c.AnimController.Limbs.Length * distFactor,
|
attack.GetDamage(1.0f) / c.AnimController.Limbs.Length * distFactor,
|
||||||
attack.GetBleedingDamage(1.0f) / c.AnimController.Limbs.Length * distFactor,
|
attack.GetBleedingDamage(1.0f) / c.AnimController.Limbs.Length * distFactor,
|
||||||
@@ -143,15 +146,24 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (limb.WorldPosition != worldPosition && force > 0.0f)
|
if (limb.WorldPosition != worldPosition && force > 0.0f)
|
||||||
{
|
{
|
||||||
limb.body.ApplyLinearImpulse(Vector2.Normalize(limb.WorldPosition - worldPosition) * distFactor * force);
|
Vector2 limbDiff = Vector2.Normalize(limb.WorldPosition - worldPosition);
|
||||||
|
Vector2 impulsePoint = limb.SimPosition - limbDiff * limbRadius;
|
||||||
|
limb.body.ApplyLinearImpulse(limbDiff * distFactor * force, impulsePoint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wasDead && c.IsDead)
|
//sever joints
|
||||||
|
if (c.IsDead && attack.SeverLimbsProbability > 0.0f)
|
||||||
{
|
{
|
||||||
|
foreach (Limb limb in c.AnimController.Limbs)
|
||||||
|
{
|
||||||
|
if (!distFactors.ContainsKey(limb)) continue;
|
||||||
|
|
||||||
foreach (LimbJoint joint in c.AnimController.LimbJoints)
|
foreach (LimbJoint joint in c.AnimController.LimbJoints)
|
||||||
{
|
{
|
||||||
if (Rand.Range(0.0f, 1.0f) < attack.SeverLimbsProbability)
|
if (joint.IsSevered || (joint.LimbA != limb && joint.LimbB != limb)) continue;
|
||||||
|
|
||||||
|
if (Rand.Range(0.0f, 1.0f) < attack.SeverLimbsProbability * distFactors[limb])
|
||||||
{
|
{
|
||||||
c.AnimController.SeverLimbJoint(joint);
|
c.AnimController.SeverLimbJoint(joint);
|
||||||
}
|
}
|
||||||
@@ -159,6 +171,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a dictionary where the keys are the structures that took damage and the values are the amount of damage taken
|
/// Returns a dictionary where the keys are the structures that took damage and the values are the amount of damage taken
|
||||||
|
|||||||
Reference in New Issue
Block a user