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
@@ -111,6 +111,8 @@ namespace Barotrauma
aiController.FillNetworkData(message);
return true;
case NetworkEventType.EntityUpdate:
if (AnimController.RefLimb.SimPosition.Length() > NetConfig.CharacterIgnoreDistance) return false;
message.Write((float)NetTime.Now);
message.Write(AnimController.TargetDir == Direction.Right);
+2 -2
View File
@@ -8,10 +8,10 @@ namespace Barotrauma
{
enum CauseOfDeath
{
Damage, Bloodloss, Pressure, Suffocation, Drowning
Damage, Bloodloss, Pressure, Suffocation, Drowning, Burn
}
public enum DamageType { None, Blunt, Slash }
public enum DamageType { None, Blunt, Slash, Burn }
public enum AttackType
{
@@ -272,6 +272,7 @@ namespace Barotrauma
DeathMsg[(int)CauseOfDeath.Drowning] = "drowned";
DeathMsg[(int)CauseOfDeath.Suffocation] = "suffocated";
DeathMsg[(int)CauseOfDeath.Pressure] = "been crushed by water pressure";
DeathMsg[(int)CauseOfDeath.Burn] = "burnt to death";
}
public Character(string file) : this(file, Vector2.Zero, null)
@@ -1030,6 +1031,8 @@ namespace Barotrauma
AttackResult attackResult = closestLimb.AddDamage(simPosition, damageType, amount, bleedingAmount, playSound);
health -= attackResult.Damage;
if (health <= 0.0f && damageType == DamageType.Burn) Kill(CauseOfDeath.Burn);
bleeding += attackResult.Bleeding;
return attackResult;
+11 -2
View File
@@ -50,7 +50,7 @@ namespace Barotrauma
public readonly float impactTolerance;
private float damage;
private float damage, burnt;
private readonly Vector2 armorSector;
private readonly float armorValue;
@@ -138,6 +138,12 @@ namespace Barotrauma
get { return stepOffset; }
}
public float Burnt
{
get { return burnt; }
set { burnt = MathHelper.Clamp(value,0.0f,100.0f); }
}
//public float Damage
//{
// get { return damage; }
@@ -381,6 +387,8 @@ namespace Barotrauma
if (!character.IsDead) damage = Math.Max(0.0f, damage-deltaTime*0.1f);
if (burnt > 0.0f) Burnt -= deltaTime;
if (LinearVelocity.X>100.0f)
{
//DebugConsole.ThrowError("CHARACTER EXPLODED");
@@ -435,7 +443,8 @@ namespace Barotrauma
public void Draw(SpriteBatch spriteBatch)
{
Color color = Color.White;// new Color(1.0f, 1.0f - damage / maxHealth, 1.0f - damage / maxHealth);
float brightness = 1.0f - (burnt / 100.0f) * 0.5f;
Color color = new Color(brightness, brightness, brightness);
body.Dir = Dir;