Add crushing logic to aircraft.

This commit is contained in:
tovl
2019-03-17 19:52:14 +01:00
committed by reaperrr
parent c633e07410
commit 560f8c26bc
9 changed files with 111 additions and 9 deletions

View File

@@ -105,6 +105,7 @@ namespace OpenRA.Mods.Common.Activities
soundPlayed = true;
}
// We are taking off, so remove influence in ground cells.
if (self.IsAtGroundLevel())
aircraft.RemoveInfluence();

View File

@@ -98,6 +98,7 @@ namespace OpenRA.Mods.Common.Activities
soundPlayed = true;
}
// We are taking off, so remove influence in ground cells.
if (self.IsAtGroundLevel())
aircraft.RemoveInfluence();

View File

@@ -11,6 +11,7 @@
using OpenRA.Activities;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Activities
{
@@ -37,6 +38,13 @@ namespace OpenRA.Mods.Common.Activities
public override Activity Tick(Actor self)
{
if (ChildActivity != null)
{
ChildActivity = ActivityUtils.RunActivity(self, ChildActivity);
if (ChildActivity != null)
return this;
}
if (IsCanceling)
{
aircraft.RemoveInfluence();
@@ -48,11 +56,13 @@ namespace OpenRA.Mods.Common.Activities
var landingCell = self.Location;
if (!aircraft.CanLand(landingCell, ignoreActor))
{
QueueChild(self, new Wait(25), true);
self.NotifyBlocker(landingCell);
return this;
}
aircraft.AddInfluence(landingCell);
aircraft.EnteringCell(self);
landingInitiated = true;
}

View File

@@ -63,6 +63,7 @@ namespace OpenRA.Mods.Common.Activities
}
aircraft.AddInfluence(landingCell);
aircraft.EnteringCell(self);
landingInitiated = true;
}