Merge branch 'ai-overhaul'

Conflicts:
	Barotrauma/Source/Characters/Attack.cs
This commit is contained in:
Joonas Rikkonen
2017-06-29 17:02:37 +03:00
46 changed files with 1148 additions and 488 deletions
@@ -60,6 +60,8 @@ namespace Barotrauma.Items.Components
{
if (character != null && !characterUsable) return false;
User = character;
Launch(new Vector2(
(float)Math.Cos(item.body.Rotation),
(float)Math.Sin(item.body.Rotation)) * launchImpulse * item.body.Mass);
@@ -147,7 +149,7 @@ namespace Barotrauma.Items.Components
return false;
}
AttackResult attackResult = new AttackResult(0.0f, 0.0f);
AttackResult attackResult = new AttackResult();
if (attack != null)
{
var submarine = f2.Body.UserData as Submarine;
+3 -2
View File
@@ -190,7 +190,7 @@ namespace Barotrauma.Items.Components
}
}
Launch(projectiles[0].Item);
Launch(projectiles[0].Item, character);
if (character != null)
{
@@ -200,7 +200,7 @@ namespace Barotrauma.Items.Components
return true;
}
private void Launch(Item projectile)
private void Launch(Item projectile, Character user = null)
{
reload = reloadTime;
@@ -217,6 +217,7 @@ namespace Barotrauma.Items.Components
if (projectileComponent != null)
{
projectileComponent.Use((float)Timing.Step);
projectileComponent.User = user;
}
if (projectile.Container != null) projectile.Container.RemoveContained(projectile);