Skip to content

Commit

Permalink
Aircraft Take off change after engine upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
dnqbob committed Oct 15, 2023
1 parent 9fdde8e commit 0691394
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
38 changes: 38 additions & 0 deletions OpenRA.Mods.Sp/Traits/TakeOffOnMake.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#region Copyright & License Information
/*
* Copyright (c) The OpenRA Developers and Contributors
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion

using OpenRA.Mods.Common.Activities;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;

namespace OpenRA.Mods.SP.Traits
{
[Desc("Take off imediately after creation. For SP jumjet")]
public class TakeOffOnMakeInfo : TraitInfo, Requires<AircraftInfo>
{
public override object Create(ActorInitializer init) { return new TakeOffOnMake(); }
}

public class TakeOffOnMake : INotifyIdle
{
bool hasTakenOff;
public TakeOffOnMake() { }

void INotifyIdle.TickIdle(Actor self)
{
if (hasTakenOff)
return;

hasTakenOff = true;
self.QueueActivity(new TakeOff(self));
}
}
}
2 changes: 1 addition & 1 deletion mods/sp/rules/aircraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,6 @@ DRACHE:
Speed: 60
AltitudeVelocity: 150
MoveIntoShroud: true
TakeOffOnCreation: false
IdealSeparation: 1706
LandableTerrainTypes: Clear, Ice, Rough, Road, DirtRoad, Ground, Green, Tiberium, BlueTiberium
-Rearmable:
Expand Down Expand Up @@ -1171,6 +1170,7 @@ SCRGLYDER1:
Repulsable: true
MoveIntoShroud: true
LandableTerrainTypes: Clear, Ice, Rough, Road, DirtRoad, Ground, Green, Tiberium, BlueTiberium, Water
TakeOffOnMake:
-Rearmable:
Health:
HP: 20000
Expand Down
2 changes: 2 additions & 0 deletions mods/sp/rules/infantry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ JUMPJETAIR:
TakeOffOnResupply: true
VTOL: true
CanSlide: true
TakeOffOnMake:
Targetable@GROUND:
TargetTypes: Infantry, Ground
RequiresCondition: !airborne
Expand Down Expand Up @@ -637,6 +638,7 @@ JJCOMMAIR:
TakeOffOnResupply: true
VTOL: true
CanSlide: true
TakeOffOnMake:
Targetable@GROUND:
TargetTypes: Infantry, Ground
RequiresCondition: !airborne
Expand Down

0 comments on commit 0691394

Please sign in to comment.