Compare commits

...

16 Commits

Author SHA1 Message Date
Oliver Brakmann
ee3fc57b40 Fix an invalid owner init entry in nod05. 2015-05-31 09:17:27 +02:00
Oliver Brakmann
90b44e7d28 Fix tesla zaps being visible under the fog 2015-05-31 09:01:04 +02:00
penev92
7530cf9031 Make speedModifiers Lazy 2015-05-31 08:51:23 +02:00
Mustafa Alperen Seki
5f64c16439 Add hightech to Prerequisite of Stealth Raider 2015-05-30 13:57:06 +02:00
Oliver Brakmann
9bf3b84a9e Update gdi05a mission preview image. 2015-05-30 08:04:03 +02:00
Oliver Brakmann
0c51fe6419 Add missing DamageType to deviator weapon 2015-05-29 18:08:39 +02:00
Oliver Brakmann
eee612421c Add a missing DamageType to missions which re-define weapons 2015-05-29 18:08:16 +02:00
Matthias Mailänder
d43f5bbd0a use premultiplied alpha on geometric renderers
to fix transparency again
2015-05-29 14:07:06 +02:00
Oliver Brakmann
9166771113 Fix potentially removing actors twice from world in Actor::ChangeOwner 2015-05-27 22:12:28 +02:00
abcdefg30
468e607daa Disable hijackers in monster tank madness 2015-05-27 14:59:52 +02:00
abcdefg30
00042927bf Fixed captured buildings producing bot controled units 2015-05-27 14:59:52 +02:00
Oliver Brakmann
581596dd5f Fix Nod attacking the world in gdi05b 2015-05-27 00:10:49 +02:00
Matthias Mailänder
b6f5cacc47 copy it in the make dependencies step 2015-05-25 10:40:37 +01:00
Matthias Mailänder
b65508faad fix error CS0219:
The variable `zoom' is assigned but its value is never used
2015-05-25 01:29:18 +02:00
Paul Chote
02adf2b212 Add nuke flash to D2K. 2015-05-24 21:35:19 +02:00
Paul Chote
90af8fb07a Update NukePaletteEffect for premultiplied alpha. 2015-05-24 21:35:19 +02:00
31 changed files with 77 additions and 48 deletions

View File

@@ -319,6 +319,7 @@ osx-dependencies: cli-dependencies
dependencies: $(os-dependencies)
@./thirdparty/fetch-geoip-db.sh
@ $(CP) thirdparty/download/GeoLite2-Country.mmdb.gz .
all-dependencies: cli-dependencies windows-dependencies osx-dependencies

View File

@@ -242,12 +242,17 @@ namespace OpenRA
return;
var oldOwner = Owner;
var wasInWorld = IsInWorld;
// momentarily remove from world so the ownership queries don't get confused
w.Remove(this);
if (wasInWorld)
w.Remove(this);
Owner = newOwner;
Generation++;
w.Add(this);
if (wasInWorld)
w.Add(this);
foreach (var t in this.TraitsImplementing<INotifyOwnerChanged>())
t.OnOwnerChanged(this, oldOwner, newOwner);

View File

@@ -83,6 +83,7 @@ namespace OpenRA.Graphics
if (nv + 2 > renderer.TempBufferSize)
Flush();
color = Util.PremultiplyAlpha(color);
var r = color.R / 255.0f;
var g = color.G / 255.0f;
var b = color.B / 255.0f;
@@ -98,12 +99,14 @@ namespace OpenRA.Graphics
if (nv + 2 > renderer.TempBufferSize)
Flush();
startColor = Util.PremultiplyAlpha(startColor);
var r = startColor.R / 255.0f;
var g = startColor.G / 255.0f;
var b = startColor.B / 255.0f;
var a = startColor.A / 255.0f;
vertices[nv++] = new Vertex(start + Offset, r, g, b, a);
endColor = Util.PremultiplyAlpha(endColor);
r = endColor.R / 255.0f;
g = endColor.G / 255.0f;
b = endColor.B / 255.0f;
@@ -115,6 +118,7 @@ namespace OpenRA.Graphics
{
renderer.CurrentBatchRenderer = this;
color = Util.PremultiplyAlpha(color);
var r = color.R / 255.0f;
var g = color.G / 255.0f;
var b = color.B / 255.0f;

View File

@@ -51,6 +51,7 @@ namespace OpenRA.Graphics
if (nv + 4 > renderer.TempBufferSize)
Flush();
color = Util.PremultiplyAlpha(color);
var r = color.R / 255.0f;
var g = color.G / 255.0f;
var b = color.B / 255.0f;

View File

@@ -118,6 +118,18 @@ namespace OpenRA.Graphics
return Color.FromArgb(c.A, (byte)(c.R * a + 0.5f), (byte)(c.G * a + 0.5f), (byte)(c.B * a + 0.5f));
}
public static Color PremultipliedColorLerp(float t, Color c1, Color c2)
{
// Colors must be lerped in a non-multiplied color space
var a1 = 255f / c1.A;
var a2 = 255f / c2.A;
return PremultiplyAlpha(Color.FromArgb(
(int)(t * c2.A + (1 - t) * c1.A),
(int)((byte)(t * a2 * c2.R + 0.5f) + (1 - t) * (byte)(a1 * c1.R + 0.5f)),
(int)((byte)(t * a2 * c2.G + 0.5f) + (1 - t) * (byte)(a1 * c1.G + 0.5f)),
(int)((byte)(t * a2 * c2.B + 0.5f) + (1 - t) * (byte)(a1 * c1.B + 0.5f))));
}
public static float[] IdentityMatrix()
{
return Exts.MakeArray(16, j => (j % 5 == 0) ? 1.0f : 0);

View File

@@ -106,7 +106,6 @@ namespace OpenRA.Mods.Common.Widgets
var cellScreenPosition = worldRenderer.ScreenPxPosition(location);
var cellScreenPixel = worldRenderer.Viewport.WorldToViewPx(cellScreenPosition);
var zoom = worldRenderer.Viewport.Zoom;
preview.Bounds.X = cellScreenPixel.X;
preview.Bounds.Y = cellScreenPixel.Y;

View File

@@ -68,7 +68,7 @@ namespace OpenRA.Mods.Common.Traits
var ret = new Dictionary<string, TerrainInfo>();
foreach (var t in y.ToDictionary()["TerrainSpeeds"].Nodes)
{
var speed = FieldLoader.GetValue<decimal>("speed", t.Value.Value);
var speed = FieldLoader.GetValue<int>("speed", t.Value.Value);
var nodesDict = t.Value.ToDictionary();
var cost = nodesDict.ContainsKey("PathingCost")
? FieldLoader.GetValue<int>("cost", nodesDict["PathingCost"].Value)
@@ -100,7 +100,7 @@ namespace OpenRA.Mods.Common.Traits
public static readonly TerrainInfo Impassable = new TerrainInfo();
public readonly int Cost;
public readonly decimal Speed;
public readonly int Speed;
public TerrainInfo()
{
@@ -108,7 +108,7 @@ namespace OpenRA.Mods.Common.Traits
Speed = 0;
}
public TerrainInfo(decimal speed, int cost)
public TerrainInfo(int speed, int cost)
{
Speed = speed;
Cost = cost;
@@ -311,7 +311,7 @@ namespace OpenRA.Mods.Common.Traits
internal int TicksBeforePathing = 0;
readonly Actor self;
readonly ISpeedModifier[] speedModifiers;
readonly Lazy<ISpeedModifier[]> speedModifiers;
public readonly MobileInfo Info;
public bool IsMoving { get; set; }
@@ -351,7 +351,7 @@ namespace OpenRA.Mods.Common.Traits
self = init.Self;
Info = info;
speedModifiers = self.TraitsImplementing<ISpeedModifier>().ToArray();
speedModifiers = Exts.Lazy(() => self.TraitsImplementing<ISpeedModifier>().ToArray());
ToSubCell = FromSubCell = info.SharesCell ? init.World.Map.DefaultSubCell : SubCell.FullCell;
if (init.Contains<SubCellInit>())
@@ -593,16 +593,13 @@ namespace OpenRA.Mods.Common.Traits
if (index == byte.MaxValue)
return 0;
// TODO: Convert to integers
var speed = Info.TilesetTerrainInfo[self.World.TileSet][index].Speed;
if (speed == decimal.Zero)
var terrainSpeed = Info.TilesetTerrainInfo[self.World.TileSet][index].Speed;
if (terrainSpeed == 0)
return 0;
speed *= Info.Speed;
foreach (var t in speedModifiers)
speed *= t.GetSpeedModifier() / 100m;
var modifiers = speedModifiers.Value.Select(x => x.GetSpeedModifier()).Append(terrainSpeed);
return (int)(speed / 100);
return Util.ApplyPercentageModifiers(Info.Speed, modifiers);
}
public void AddInfluence()

View File

@@ -15,6 +15,8 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
using GUtil = OpenRA.Graphics.Util;
[Desc("Apply palette full screen rotations during atom bomb explosions. Add this to the world actor.")]
class NukePaletteEffectInfo : TraitInfo<NukePaletteEffect> { }
@@ -46,8 +48,8 @@ namespace OpenRA.Mods.Common.Traits
for (var x = 0; x < Palette.Size; x++)
{
var orig = pal.Value.GetColor(x);
var white = Color.FromArgb(orig.A, 255, 255, 255);
pal.Value.SetColor(x, Exts.ColorLerp(frac, orig, white));
var final = GUtil.PremultipliedColorLerp(frac, orig, GUtil.PremultiplyAlpha(Color.FromArgb(orig.A, Color.White)));
pal.Value.SetColor(x, final);
}
}
}

View File

@@ -70,6 +70,10 @@ namespace OpenRA.Mods.RA.Graphics
public void RenderDebugGeometry(WorldRenderer wr) { }
public void Render(WorldRenderer wr)
{
if (wr.World.FogObscures(wr.World.Map.CellContaining(pos)) &&
wr.World.FogObscures(wr.World.Map.CellContaining(pos + length)))
return;
if (!cache.Any() || length != cachedLength || pos != cachedPos)
cache = GenerateRenderables(wr);

Binary file not shown.

View File

@@ -116,6 +116,7 @@ elseif ($command -eq "dependencies")
cd thirdparty
./fetch-thirdparty-deps.ps1
cp download/*.dll ..
cp download/GeoLite2-Country.mmdb.gz ..
cp download/windows/*.dll ..
cd ..
echo "Dependencies copied."

View File

@@ -554,7 +554,7 @@ Weapons:
Versus:
Heavy: 50
Damage: 50
DamageTypes: Prone50Percent, TriggerProne
DamageTypes: Prone50Percent, TriggerProne, ExplosionDeath
Voices:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -101,7 +101,7 @@ Atk5TriggerFunction = function()
end
StartProduction = function(type)
if Hand1.IsInWorld then
if Hand1.IsInWorld and Hand1.Owner == nod then
Hand1.Build(type)
Trigger.AfterDelay(DateTime.Seconds(30), function() StartProduction(type) end)
end

View File

@@ -41,7 +41,7 @@ Players:
Name: Nod
Race: nod
ColorRamp: 3,255,127
Enemies: GDI, Neutral, AbandonedBase
Enemies: GDI, AbandonedBase
PlayerReference@GDI:
Name: GDI
Playable: True
@@ -60,10 +60,8 @@ Players:
NonCombatant: True
Race: gdi
ColorRamp: 31,222,183
Enemies: Nod
PlayerReference@AbandonedBase:
Name: AbandonedBase
OwnsWorld: True
NonCombatant: True
Race: gdi
ColorRamp: 31,222,183

View File

@@ -234,7 +234,7 @@ Tick = function()
Nod.MarkCompletedObjective(NodObjective1)
end
if DateTime.GameTime % DateTime.Seconds(3) == 0 and Barracks.IsInWorld then
if DateTime.GameTime % DateTime.Seconds(3) == 0 and Barracks.IsInWorld and Barracks.Owner == gdi then
checkProduction(GDI)
end
end
@@ -267,8 +267,8 @@ getStartUnits = function()
end)
end
IdleHunt = function(unit)
if not unit.IsDead then
Trigger.OnIdle(unit, unit.Hunt)
end
end
IdleHunt = function(unit)
if not unit.IsDead then
Trigger.OnIdle(unit, unit.Hunt)
end
end

View File

@@ -152,7 +152,7 @@ Tick = function()
Nod.MarkCompletedObjective(NodObjective1)
end
if DateTime.GameTime % DateTime.Seconds(3) == 0 and Barracks.IsInWorld then
if DateTime.GameTime % DateTime.Seconds(3) == 0 and Barracks.IsInWorld and Barracks.Owner == gdi then
checkProduction(GDI)
end
end
@@ -234,8 +234,8 @@ InsertNodUnits = function()
Reinforcements.Reinforce(Nod, { "mcv" }, { McvEntry.Location, McvRally.Location })
end
IdleHunt = function(unit)
if not unit.IsDead then
Trigger.OnIdle(unit, unit.Hunt)
end
end
IdleHunt = function(unit)
if not unit.IsDead then
Trigger.OnIdle(unit, unit.Hunt)
end
end

View File

@@ -229,7 +229,7 @@ Actors:
Owner: Neutral
Actor66: v32
Location: 19,41
Owner: Special
Owner: Neutral
Actor67: v30
Location: 15,40
Owner: Neutral

View File

@@ -295,9 +295,9 @@ checkProduction = function(player)
end
end
if #UnitsType > 0 then
if (type == 'jeep' or type == 'mtnk') and not Factory.IsDead then
if (type == 'jeep' or type == 'mtnk') and not Factory.IsDead and Factory.Owner == gdi then
Factory.Build(UnitsType)
elseif (type == 'e1' or type == 'e2') and not Barracks.IsDead then
elseif (type == 'e1' or type == 'e2') and not Barracks.IsDead and Barracks.Owner == gdi then
Barracks.Build(UnitsType)
end
end

View File

@@ -57,6 +57,11 @@
Name: effect50alpha
BasePalette: effect
Alpha: 0.5
PaletteFromPaletteWithAlpha@effectAdditive:
Name: effectAdditive
BasePalette: effect
Alpha: 0
Premultiply: false
PaletteFromScaledPalette@starportlights:
Name: starportlights
BasePalette: d2k
@@ -81,4 +86,5 @@
Alpha: 0.68
Premultiply: false
PlayerHighlightPalette:
NukePaletteEffect:

View File

@@ -213,6 +213,7 @@ refinery:
ordos: refinery.ordos
WithDockingOverlay@SMOKE:
Sequence: smoke
Palette: effectAdditive
Power:
Amount: -30
WithIdleOverlay@TOP:

View File

@@ -351,7 +351,7 @@ raider:
stealthraider:
Inherits: raider
Buildable:
Prerequisites: ~light.ordos, upgrade.light, ~techlevel.medium
Prerequisites: ~light.ordos, upgrade.light, hightech, ~techlevel.medium
BuildPaletteOrder: 30
Valued:
Cost: 400

View File

@@ -378,7 +378,6 @@ refinery.atreides:
Length: 14
Offset: 10,-16
Tick: 200
BlendMode: Additive
silo.atreides:
idle: DATA.R8
@@ -863,7 +862,6 @@ refinery.harkonnen:
Length: 14
Offset: 10,-16
Tick: 200
BlendMode: Additive
silo.harkonnen:
idle: DATA.R8
@@ -1257,7 +1255,6 @@ refinery.ordos:
Length: 14
Offset: 10,-16
Tick: 200
BlendMode: Additive
silo.ordos:
idle: DATA.R8

View File

@@ -392,7 +392,7 @@ NerveGasMissile:
None: 0
Wood: 0
Concrete: 0
DamageTypes: Prone50Percent, TriggerProne
DamageTypes: Prone50Percent, TriggerProne, SmallExplosionDeath
Warhead@2Smu: LeaveSmudge
SmudgeType: SandCrater, RockCrater
Warhead@3Eff: CreateEffect

View File

@@ -562,7 +562,7 @@ Weapons:
Burst: 1
Warhead: SpreadDamage
Damage: 20
DamageTypes: Prone50Percent, TriggerProne
DamageTypes: Prone50Percent, TriggerProne, BulletDeath
Voices:

View File

@@ -840,7 +840,7 @@ Weapons:
Burst: 1
Warhead: SpreadDamage
Damage: 20
DamageTypes: Prone50Percent, TriggerProne
DamageTypes: Prone50Percent, TriggerProne, BulletDeath
Voices:

View File

@@ -323,7 +323,7 @@ Weapons:
Light: 30
Heavy: 30
Damage: 400
DamageTypes: Prone50Percent, TriggerProne, Explosion
DamageTypes: Prone50Percent, TriggerProne, ExplosionDeath
Warhead@1Eff: CreateEffect
Explosion: large_explosion
WaterExplosion: large_splash

View File

@@ -2403,7 +2403,7 @@ Weapons:
Maverick:
Warhead@1Dam: SpreadDamage
Damage: 175
DamageTypes: Prone50Percent, TriggerProne
DamageTypes: Prone50Percent, TriggerProne, ExplosionDeath
Voices:

View File

@@ -2342,6 +2342,9 @@ Rules:
SHOK:
Buildable:
Prerequisites: ~disabled
HIJACKER:
Buildable:
Prerequisites: ~disabled
STNK:
Buildable:
Prerequisites: ~disabled

View File

@@ -14,6 +14,5 @@ if [[ ! -e $filename ]] || [[ -n $(find . -name $filename -mtime +30 -print) ]];
rm -f $filename
echo "Updating GeoIP country database from MaxMind."
curl -s -L -O http://geolite.maxmind.com/download/geoip/database/$filename
cp $filename ../..
fi

View File

@@ -135,7 +135,6 @@ if (!(Test-Path "GeoLite2-Country.mmdb.gz") -Or (((get-date) - (get-item "GeoLit
echo "Updating GeoIP country database from MaxMind."
$target = Join-Path $pwd.ToString() "GeoLite2-Country.mmdb.gz"
(New-Object System.Net.WebClient).DownloadFile("http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz", $target)
cp GeoLite2-Country.mmdb.gz ..\..
}
cd ..