Compare commits

...

13 Commits

Author SHA1 Message Date
Paul Chote
cc5619e912 Fix WithCargo desync. 2015-08-28 15:11:47 +02:00
Paul Chote
086889a713 Fix LST queue type. 2015-08-28 15:11:11 +02:00
Matthias Mailänder
b78d4baadf add the map to the exception.log 2015-08-24 00:31:11 +03:00
deniz1a
9aab94701d Removes LocalPlayer check from HideMapCrateAction and RevealMapCrateAction.
Fixes #9063.
Fixes #9127.
2015-08-23 23:20:48 +03:00
Guido L
08e159d326 Add Cell check to RadarWidget. 2015-08-22 23:00:29 +03:00
Paul Chote
e699768f2b Fix visibility queries when fog is disabled. 2015-08-22 22:57:08 +03:00
Zimmermann Gyula
95ab853179 Prevent infiltrating allied targets unless explicitly set. 2015-08-22 12:56:24 +02:00
Paul Chote
61bb6ef5d7 Replace icon veterancy overlay with new artwork.
New shp includes frames for higher level veterancy
for potential future use.
2015-08-16 09:34:38 +02:00
abcdefg30
afc0985675 Fix a crash in dropzone-w
We don't need RevealsShroud here anyway,
as the map disabled Shroud and Fog.
2015-08-15 10:30:05 +01:00
Zimmermann Gyula
57f229c0d6 Increase ShippedSoundtracks of the TD mod. 2015-08-15 10:20:02 +01:00
deniz1a
703a6e3073 Fixes observer widgets being loaded multiple times at game end. 2015-08-12 21:19:31 +02:00
abcdefg30
a97df93e01 Fix shroud outside map bounds being transparent 2015-08-09 20:57:18 +02:00
Matthias Mailänder
5720bde43b fix IsAtGroundLevel always being false for immobile actors 2015-08-09 15:55:06 +02:00
21 changed files with 109 additions and 45 deletions

View File

@@ -55,6 +55,12 @@ namespace OpenRA
Log.Write("exception", "{0} Mod at Version {1}", mod.Title, mod.Version);
}
if (Game.OrderManager != null && Game.OrderManager.World != null && Game.OrderManager.World.Map != null)
{
var map = Game.OrderManager.World.Map;
Log.Write("exception", "on map {0} ({1} by {2}).", map.Uid, map.Title, map.Author);
}
Log.Write("exception", "Operating System: {0} ({1})", Platform.CurrentPlatform, Environment.OSVersion);
Log.Write("exception", "Runtime Version: {0}", Platform.RuntimeVersion);
var rpt = BuildExceptionReport(e).ToString();

View File

@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Cnc.Traits
public object Create(ActorInitializer init) { return new WithCargo(init.Self, this); }
}
public class WithCargo : IRenderModifier
public class WithCargo : IRenderModifier, ITick
{
readonly Cargo cargo;
readonly IFacing facing;
@@ -45,6 +45,19 @@ namespace OpenRA.Mods.Cnc.Traits
body = self.Trait<IBodyOrientation>();
}
public void Tick(Actor self)
{
if (facing == null)
return;
foreach (var c in cargo.Passengers)
{
var cargoFacing = c.TraitOrDefault<IFacing>();
if (cargoFacing != null)
cargoFacing.Facing = facing.Facing;
}
}
public IEnumerable<IRenderable> ModifyRender(Actor self, WorldRenderer wr, IEnumerable<IRenderable> r)
{
foreach (var rr in r)
@@ -55,10 +68,6 @@ namespace OpenRA.Mods.Cnc.Traits
var i = 0;
foreach (var c in cargo.Passengers)
{
var cargoFacing = c.TraitOrDefault<IFacing>();
if (facing != null && cargoFacing != null)
cargoFacing.Facing = facing.Facing;
var cargoPassenger = c.Trait<Passenger>();
if (cargoInfo.DisplayTypes.Contains(cargoPassenger.Info.CargoType))
{

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common
if (self.IsDead)
return false;
if (!self.HasTrait<IPositionable>())
if (!self.HasTrait<IOccupySpace>())
return false;
if (!self.IsInWorld)

View File

@@ -32,9 +32,7 @@ namespace OpenRA.Mods.Common.Traits
public override void Activate(Actor collector)
{
if (collector.Owner == collector.World.LocalPlayer)
collector.Owner.Shroud.ResetExploration();
collector.Owner.Shroud.ResetExploration();
base.Activate(collector);
}
}

View File

@@ -8,8 +8,6 @@
*/
#endregion
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Reveals the entire map.")]
@@ -31,18 +29,15 @@ namespace OpenRA.Mods.Common.Traits
this.info = info;
}
bool ShouldReveal(Player collectingPlayer)
{
if (info.IncludeAllies)
return collectingPlayer.World.LocalPlayer != null &&
collectingPlayer.Stances[collectingPlayer.World.LocalPlayer] == Stance.Ally;
return collectingPlayer == collectingPlayer.World.LocalPlayer;
}
public override void Activate(Actor collector)
{
if (ShouldReveal(collector.Owner))
if (info.IncludeAllies)
{
foreach (var player in collector.World.Players)
if (collector.Owner.IsAlliedWith(player))
player.Shroud.ExploreAll(player.World);
}
else
collector.Owner.Shroud.ExploreAll(collector.World);
base.Activate(collector);

View File

@@ -60,13 +60,23 @@ namespace OpenRA.Mods.Common.Traits
visible = init.World.Players.ToDictionary(p => p, p => false);
}
bool IsVisibleInner(Actor self, Player byPlayer)
{
// If fog is disabled visibility is determined by shroud
if (!byPlayer.Shroud.FogEnabled)
return self.OccupiesSpace.OccupiedCells()
.Any(o => byPlayer.Shroud.IsExplored(o.First));
return visible[byPlayer];
}
public bool IsVisible(Actor self, Player byPlayer)
{
if (byPlayer == null)
return true;
var stance = self.Owner.Stances[byPlayer];
return info.AlwaysVisibleStances.HasStance(stance) || visible[byPlayer];
return info.AlwaysVisibleStances.HasStance(stance) || IsVisibleInner(self, byPlayer);
}
public void Tick(Actor self)

View File

@@ -28,6 +28,10 @@ namespace OpenRA.Mods.Common.Traits
protected override bool IsVisibleInner(Actor self, Player byPlayer)
{
// If fog is disabled visibility is determined by shroud
if (!byPlayer.Shroud.FogEnabled)
return base.IsVisibleInner(self, byPlayer);
if (Info.Type == VisibilityType.Footprint)
return self.OccupiesSpace.OccupiedCells()
.Any(o => byPlayer.Shroud.IsVisible(o.First));

View File

@@ -16,6 +16,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
public class LoadIngamePlayerOrObserverUILogic
{
bool loadingObserverWidgets = false;
[ObjectCreator.UseCtor]
public LoadIngamePlayerOrObserverUILogic(Widget widget, World world)
{
@@ -35,12 +37,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic
sidebarTicker.OnTick = () =>
{
// Switch to observer mode after win/loss
if (world.LocalPlayer.WinState != WinState.Undefined)
if (world.LocalPlayer.WinState != WinState.Undefined && !loadingObserverWidgets)
{
loadingObserverWidgets = true;
Game.RunAfterDelay(objectives != null ? objectives.Info.GameOverDelay : 0, () =>
{
playerRoot.RemoveChildren();
Game.LoadWidget(world, "OBSERVER_WIDGETS", playerRoot, new WidgetArgs());
});
}
};
}

View File

@@ -376,6 +376,9 @@ namespace OpenRA.Mods.Common.Widgets
foreach (var cell in t.Trait.RadarSignatureCells(t.Actor))
{
if (!world.Map.Contains(cell.First))
continue;
var uv = cell.First.ToMPos(world.Map.TileShape);
var color = cell.Second.ToArgb();
if (isDiamond)

View File

@@ -10,6 +10,7 @@
using OpenRA.Mods.Common.Activities;
using OpenRA.Mods.Common.Traits;
using OpenRA.Mods.RA.Traits;
using OpenRA.Traits;
namespace OpenRA.Mods.RA.Activities
@@ -20,17 +21,25 @@ namespace OpenRA.Mods.RA.Activities
readonly Cloak cloak;
readonly Infiltrates infiltrates;
public Infiltrate(Actor self, Actor target)
: base(self, target)
{
this.target = target;
cloak = self.TraitOrDefault<Cloak>();
infiltrates = self.TraitOrDefault<Infiltrates>();
}
protected override void OnInside(Actor self)
{
if (target.IsDead || target.Owner == self.Owner)
if (target.IsDead)
return;
var stance = self.Owner.Stances[target.Owner];
if (!infiltrates.Info.ValidStances.HasStance(stance))
return;
if (cloak != null && cloak.Info.UncloakOnInfiltrate)

View File

@@ -24,21 +24,24 @@ namespace OpenRA.Mods.RA.Traits
[VoiceReference] public readonly string Voice = "Action";
[Desc("What diplomatic stances can be infiltrated by this actor.")]
public readonly Stance ValidStances = Stance.Neutral | Stance.Enemy;
public object Create(ActorInitializer init) { return new Infiltrates(this); }
}
class Infiltrates : IIssueOrder, IResolveOrder, IOrderVoice
{
readonly InfiltratesInfo info;
public readonly InfiltratesInfo Info;
public Infiltrates(InfiltratesInfo info)
{
this.info = info;
Info = info;
}
public IEnumerable<IOrderTargeter> Orders
{
get { yield return new TargetTypeOrderTargeter(info.Types, "Infiltrate", 7, "enter", true, false); }
get { yield return new InfiltrationOrderTargeter(Info); }
}
public Order IssueOrder(Actor self, IOrderTargeter order, Target target, bool queued)
@@ -77,13 +80,13 @@ namespace OpenRA.Mods.RA.Traits
ai = order.TargetActor.Info;
var i = ai.Traits.GetOrDefault<ITargetableInfo>();
return i != null && i.GetTargetTypes().Intersect(info.Types).Any();
return i != null && i.GetTargetTypes().Intersect(Info.Types).Any();
}
public string VoicePhraseForOrder(Actor self, Order order)
{
return order.OrderString == "Infiltrate" && IsValidOrder(self, order)
? info.Voice : null;
? Info.Voice : null;
}
public void ResolveOrder(Actor self, Order order)
@@ -102,4 +105,35 @@ namespace OpenRA.Mods.RA.Traits
self.QueueActivity(new Infiltrate(self, target.Actor));
}
}
class InfiltrationOrderTargeter : UnitOrderTargeter
{
readonly InfiltratesInfo info;
public InfiltrationOrderTargeter(InfiltratesInfo info)
: base("Infiltrate", 7, "enter", true, false)
{
this.info = info;
}
public override bool CanTargetActor(Actor self, Actor target, TargetModifiers modifiers, ref string cursor)
{
var stance = self.Owner.Stances[target.Owner];
if (!info.ValidStances.HasStance(stance))
return false;
return target.TraitsImplementing<ITargetable>().Any(t => t.TargetTypes.Intersect(info.Types).Any());
}
public override bool CanTargetFrozenActor(Actor self, FrozenActor target, TargetModifiers modifiers, ref string cursor)
{
var stance = self.Owner.Stances[target.Owner];
if (!info.ValidStances.HasStance(stance))
return false;
return target.Info.Traits.WithInterface<ITargetableInfo>().Any(t => t.GetTargetTypes().Intersect(info.Types).Any());
}
}
}

View File

@@ -226,7 +226,7 @@ namespace OpenRA.Renderer.Sdl2
public void Clear()
{
GL.ClearColor(0, 0, 0, 0);
GL.ClearColor(0, 0, 0, 1);
ErrorHandler.CheckGlError();
GL.Clear(ClearBufferMask.ColorBufferBit);
ErrorHandler.CheckGlError();

View File

@@ -151,7 +151,7 @@ ContentInstaller:
.: speech.mix, tempicnh.mix, transit.mix
CopyFilesFromCD:
.: conquer.mix, desert.mix, general.mix, scores.mix, sounds.mix, temperat.mix, winter.mix
ShippedSoundtracks: 2
ShippedSoundtracks: 4
MusicPackageMirrorList: http://www.openra.net/packages/cnc-music-mirrors.txt
InstallShieldCABFileIds: 66, 45, 42, 65, 68, 67, 71, 47, 49, 60, 75, 73, 53

View File

@@ -41,7 +41,7 @@ LST:
Tooltip:
Name: Landing Craft
Buildable:
Queue: Vehicle
Queue: Vehicle.GDI
BuildPaletteOrder: 1000
Prerequisites: ~disabled
Mobile:

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -230,8 +230,6 @@ Rules:
HP: 1000
Mobile:
Speed: 170
RevealsShroud:
Range: 50c0
Armament@PRIMARY:
Weapon: M60mg
Armament@SECONDARY:

View File

@@ -10,10 +10,6 @@
Filename: temperat.pal
ShadowIndex: 3
AllowModifiers: false
PaletteFromFile@cameo-chevron:
Name: cameo-chevron
Filename: cameo-chevron.pal
AllowModifiers: false
PaletteFromFile@effect:
Name: effect
Filename: temperat.pal

View File

@@ -67,7 +67,6 @@ Player:
EnemyWatcher:
VeteranProductionIconOverlay:
Offset: 2, 2
Image: cameo-chevron
Sequence: idle
Palette: cameo-chevron
Image: iconchevrons
Sequence: veteran

View File

@@ -382,10 +382,8 @@ rank:
rank:
Length: *
cameo-chevron:
idle:
Length: *
BlendMode: Additive
iconchevrons:
veteran:
atomic:
up: atomicup