Merge pull request #7033 from Mailaender/d2k-carryall-tweaks

Tweaked spice harvester carryalls
This commit is contained in:
Paul Chote
2014-12-07 11:09:55 +13:00
15 changed files with 81 additions and 40 deletions

View File

@@ -151,6 +151,7 @@ namespace OpenRA.Mods.D2k
// Create a new animation for our carryable unit
anim = new Animation(self.World, RenderSprites.GetImage(carryable.Info), RenderSprites.MakeFacingFunc(self));
anim.PlayRepeating("idle");
anim.IsDecoration = true;
}
// Called when released

View File

@@ -460,6 +460,7 @@
<Compile Include="UtilityCommands\Extensions.cs" />
<Compile Include="Lint\CheckMapRules.cs" />
<Compile Include="Activities\Air\HeliFlyCircle.cs" />
<Compile Include="Render\Hovers.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenRA.Game\OpenRA.Game.csproj">

View File

@@ -0,0 +1,52 @@
#region Copyright & License Information
/*
* Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
* 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. For more information,
* see COPYING.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Mods.RA.Activities;
using OpenRA.Mods.RA.Traits;
using OpenRA.Traits;
namespace OpenRA.Mods.RA.Render
{
[Desc("Changes the visual Z position periodically.")]
class HoversInfo : ITraitInfo, Requires<IMoveInfo>
{
[Desc("Amount of Z axis changes in world units.")]
public readonly int OffsetModifier = -43;
public object Create(ActorInitializer init) { return new Hovers(this, init.self); }
}
class Hovers : IRenderModifier
{
readonly HoversInfo info;
readonly bool aircraft;
public Hovers(HoversInfo info, Actor self)
{
this.info = info;
aircraft = self.HasTrait<Aircraft>();
}
public IEnumerable<IRenderable> ModifyRender(Actor self, WorldRenderer wr, IEnumerable<IRenderable> r)
{
if (self.World.Paused)
return r;
var visualOffset = !aircraft || self.CenterPosition.Z > 0 ? (int)Math.Abs((self.ActorID + Game.LocalTick) / 5 % 4 - 1) - 1 : 0;
var worldVisualOffset = new WVec(0, 0, info.OffsetModifier * visualOffset);
return r.Select(a => a.OffsetBy(worldVisualOffset));
}
}
}

View File

@@ -37,13 +37,6 @@ namespace OpenRA.Mods.RA.Render
public IEnumerable<IRenderable> ModifyRender(Actor self, WorldRenderer wr, IEnumerable<IRenderable> r)
{
var ios = self.Trait<IOccupySpace>();
/* rude hack */
var flying = ios.CenterPosition.Z > 0;
var visualOffset = (ios is Helicopter && flying)
? (int)Math.Abs((self.ActorID + Game.LocalTick) / 5 % 4 - 1) - 1 : 0;
// Contrails shouldn't cast shadows
var shadowSprites = r.Where(s => !s.IsDecoration)
.Select(a => a.WithPalette(wr.Palette(info.Palette))
@@ -51,11 +44,7 @@ namespace OpenRA.Mods.RA.Render
.WithZOffset(a.ZOffset + a.Pos.Z)
.AsDecoration());
var worldVisualOffset = new WVec(0,0,-43*visualOffset);
var flyingSprites = !flying ? r :
r.Select(a => a.OffsetBy(worldVisualOffset));
return shadowSprites.Concat(flyingSprites);
return shadowSprites.Concat(r);
}
}
}

View File

@@ -32,7 +32,6 @@ TRAN:
WithRotor@SECONDARY:
Id: rotor_2
Offset: 597,0,85
WithShadow:
Cargo:
Types: Infantry
MaxWeight: 10
@@ -87,7 +86,6 @@ HELI:
WithRotor:
Offset: 0,0,85
WithMuzzleFlash:
WithShadow:
LeavesHusk:
HuskActor: HELI.Husk
AutoTarget:
@@ -133,7 +131,6 @@ ORCA:
Count: 2
Period: 100
RenderUnit:
WithShadow:
LeavesHusk:
HuskActor: ORCA.Husk
AutoTarget:
@@ -159,7 +156,6 @@ C17:
Armor:
Type: Heavy
RenderUnit:
WithShadow:
Cargo:
MaxWeight: 10
PipCount: 10
@@ -198,7 +194,6 @@ A10:
Armor:
Type: Heavy
RenderUnit:
WithShadow:
AttackBomber:
Armaments: gun, bombs
Guns: gun
@@ -240,7 +235,6 @@ TRAN.Husk:
Offset: 597,0,85
RenderUnit:
Image: tran
WithShadow:
HELI.Husk:
Inherits: ^HelicopterHusk
@@ -255,7 +249,6 @@ HELI.Husk:
Offset: 0,0,85
RenderUnit:
Image: heli
WithShadow:
ORCA.Husk:
Inherits: ^HelicopterHusk
@@ -268,5 +261,4 @@ ORCA.Husk:
Range: 10c0
RenderUnit:
Image: orca
WithShadow:

View File

@@ -147,6 +147,8 @@
UpgradeTypes: selfheal
UpgradeMinEnabledLevel: 1
UpgradeManager:
WithShadow:
Hovers:
^Infantry:
AppearsOnRadar:
@@ -338,6 +340,7 @@
UpgradeTypes: selfheal
UpgradeMinEnabledLevel: 1
UpgradeManager:
WithShadow:
^Ship:
AppearsOnRadar:

View File

@@ -4,7 +4,10 @@
Cost: 1200
Tooltip:
Name: Carryall
Description: Fully automated Carryall.\n Automatically transports your harvesters.
Description: Large winged, planet-bound ship\n Automatically lifts harvesters.
Buildable:
Queue: Aircraft
BuildPaletteOrder: 10
Health:
HP: 250
Armor:

View File

@@ -123,9 +123,7 @@ CARRYALLA:
RenderUnit:
Image: CARRYALL
Buildable:
Queue: Armor
Prerequisites: ~heavya, refinery, hightech
BuildPaletteOrder: 10
Prerequisites: refinery, ~hightecha
CARRYALLA.starport:
Inherits: CARRYALLA

View File

@@ -127,9 +127,7 @@ CARRYALLH:
RenderUnit:
Image: CARRYALL
Buildable:
Queue: Armor
Prerequisites: ~heavyh, refinery, hightech
BuildPaletteOrder: 10
Prerequisites: refinery, ~hightechh
CARRYALLH.starport:
Inherits: CARRYALLH

View File

@@ -203,9 +203,7 @@ CARRYALLO:
RenderUnit:
Image: CARRYALL
Buildable:
Queue: Armor
Prerequisites: ~heavyo, refinery, hightech
BuildPaletteOrder: 10
Prerequisites: refinery, ~hightecho
CARRYALLO.starport:
Inherits: CARRYALLO

View File

@@ -601,6 +601,11 @@ WALL:
Tooltip:
Name: High Tech Facility
Description: Unlocks advanced technology
Production:
Produces: Aircraft
Exit:
SpawnOffset: 0,0,728
ExitCell: 0,0
Building:
Footprint: _x_ xxx xxx
Dimensions: 3,3
@@ -613,8 +618,8 @@ WALL:
Range: 4c0
ProvidesCustomPrerequisite:
Prerequisite: hightech
# WithProductionOverlay@WELDING:
# Sequence: production-welding
WithProductionOverlay@WELDING:
Sequence: production-welding
Power:
Amount: -40

View File

@@ -11,7 +11,6 @@ BADR:
Speed: 149
Repulsable: False
RenderUnit:
WithShadow:
Cargo:
MaxWeight: 10
-Selectable:
@@ -51,7 +50,6 @@ BADR.Bomber:
Ammo: 7
RenderUnit:
Image: badr
WithShadow:
-Selectable:
-GainsExperience:
Tooltip:
@@ -108,7 +106,6 @@ MIG:
EnableStances: false
RenderUnit:
CameraPitch: 99
WithShadow:
LimitedAmmo:
Ammo: 8
ReturnOnIdle:
@@ -165,7 +162,6 @@ YAK:
EnableStances: false
RenderUnit:
CameraPitch: 99
WithShadow:
LimitedAmmo:
Ammo: 18
PipCount: 6
@@ -215,7 +211,6 @@ TRAN:
WithRotor@SECONDARY:
Id: rotor_2
Offset: 597,0,213
WithShadow:
Cargo:
Types: Infantry
MaxWeight: 8
@@ -262,7 +257,6 @@ HELI:
RenderUnit:
WithRotor:
Offset: 0,0,85
WithShadow:
LimitedAmmo:
Ammo: 8
Selectable:
@@ -313,7 +307,6 @@ HIND:
EnableStances: false
RenderUnit:
WithRotor:
WithShadow:
LimitedAmmo:
Ammo: 24
PipCount: 6
@@ -337,7 +330,6 @@ U2:
Speed: 373
Repulsable: False
RenderUnit:
WithShadow:
AttackBomber:
-Selectable:
-GainsExperience:

View File

@@ -341,6 +341,7 @@
UpgradeMaxAcceptedLevel: 2
TimedUpgradeBar:
Upgrade: invulnerability
WithShadow:
^Helicopter:
Inherits: ^Plane
@@ -348,6 +349,7 @@
GenericName: Helicopter
GpsDot:
String: Helicopter
Hovers:
^Building:
AppearsOnRadar:

View File

@@ -67,6 +67,7 @@ DSHP:
RenderSprites:
RenderVoxels:
WithVoxelBody:
Hovers:
ORCA:
Inherits: ^Helicopter
@@ -105,6 +106,7 @@ ORCA:
RenderSprites:
RenderVoxels:
WithVoxelBody:
Hovers:
ORCAB:
Inherits: ^Helicopter
@@ -142,6 +144,7 @@ ORCAB:
RenderSprites:
RenderVoxels:
WithVoxelBody:
Hovers:
ORCATRAN:
Inherits: ^Helicopter
@@ -173,6 +176,7 @@ ORCATRAN:
RenderSprites:
RenderVoxels:
WithVoxelBody:
Hovers:
TRNSPORT:
Inherits: ^Helicopter
@@ -200,6 +204,7 @@ TRNSPORT:
RenderSprites:
RenderVoxels:
WithVoxelBody:
Hovers:
SCRIN:
Inherits: ^Helicopter
@@ -277,4 +282,5 @@ APACHE:
RenderSprites:
RenderVoxels:
WithVoxelBody:
Hovers:

View File

@@ -156,6 +156,7 @@ HVR:
RenderVoxels:
WithVoxelBody:
WithVoxelTurret:
Hovers:
4TNK:
Inherits: ^Tank