Molochs can damage characters, server log UI, stun weapons have a longer stun time, characters can't breathe when wearing a diving suit with no oxygen tank

This commit is contained in:
Regalis
2016-02-14 19:05:03 +02:00
parent bec6d95198
commit 94e34c0ed9
18 changed files with 136 additions and 68 deletions
@@ -311,6 +311,8 @@ namespace Barotrauma
{
IDamageable damageTarget = null;
float dist = ConvertUnits.ToDisplayUnits(Vector2.Distance(limb.SimPosition, attackPosition));
switch (limb.attack.Type)
{
case AttackType.PinchCW:
@@ -328,7 +330,6 @@ namespace Barotrauma
break;
}
float dist = ConvertUnits.ToDisplayUnits(Vector2.Distance(limb.SimPosition, attackPosition));
if (dist < limb.attack.Range * 0.5f)
{
attackTimer += deltaTime;
@@ -361,10 +362,16 @@ namespace Barotrauma
break;
}
if (ConvertUnits.ToDisplayUnits(Vector2.Distance(limb.SimPosition, attackPosition)) < limb.attack.Range)
if (dist < limb.attack.Range)
{
attackTimer += deltaTime;
limb.body.ApplyForce(limb.Mass * limb.attack.Force * Vector2.Normalize(attackPosition - limb.SimPosition));
if (damageTarget is Character && dist<limb.attack.Range*0.5f)
{
limb.attack.DoDamage(Character, damageTarget, limb.WorldPosition, deltaTime, false);
}
}
steeringManager.SteeringSeek(attackPosition + (limb.SimPosition-SimPosition), 5.0f);
+4 -4
View File
@@ -1096,7 +1096,7 @@ namespace Barotrauma
var attackingCharacter = attacker as Character;
if (attackingCharacter != null && attackingCharacter.AIController == null)
{
GameServer.Log(Name + " attacked by " + attackingCharacter.Name+". Damage: "+attackResult.Damage+" Bleeding damage: "+attackResult.Bleeding);
GameServer.Log(Name + " attacked by " + attackingCharacter.Name+". Damage: "+attackResult.Damage+" Bleeding damage: "+attackResult.Bleeding, Color.Orange);
}
return attackResult;
@@ -1259,7 +1259,7 @@ namespace Barotrauma
}
}
GameServer.Log(Name+" has died (cause of death: "+causeOfDeath+")");
GameServer.Log(Name+" has died (Cause of death: "+causeOfDeath+")", Color.Red);
if (OnDeath != null) OnDeath(this, causeOfDeath);
@@ -1464,11 +1464,11 @@ namespace Barotrauma
{
if (item == selectedConstruction)
{
GameServer.Log(Name + " deselected " + item.Name);
GameServer.Log(Name + " deselected " + item.Name, Color.Orange);
}
else
{
GameServer.Log(Name + " selected " + item.Name);
GameServer.Log(Name + " selected " + item.Name, Color.Orange);
}
item.Pick(this, false, pickHit, actionHit);
}