Skip to content

Commit

Permalink
Merge commit 'matt/dune^'
Browse files Browse the repository at this point in the history
Conflicts:
	.gitignore
	mods/d2k/rules/system.yaml
  • Loading branch information
chrisforbes committed Jun 24, 2012
2 parents 2ed12f1 + 7220025 commit a2b92d0
Show file tree
Hide file tree
Showing 31 changed files with 585 additions and 196 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -55,3 +55,4 @@ OpenRA.Launcher.Mac/OpenRA.xcodeproj/*.mode1v3
*.config
*.resources

*.kate-swp
4 changes: 4 additions & 0 deletions OpenRA.Game/GameRules/VoiceInfo.cs
Expand Up @@ -18,9 +18,12 @@ namespace OpenRA.GameRules
public class VoiceInfo
{
[FieldLoader.Ignore] public readonly Dictionary<string,string[]> Variants;
[FieldLoader.Ignore] public readonly Dictionary<string,string[]> Prefixes;
[FieldLoader.Ignore] public readonly Dictionary<string,string[]> Voices;
public readonly string DefaultVariant = ".aud" ;
public readonly string DefaultPrefix = "" ;
public readonly string[] DisableVariants = { };
public readonly string[] DisablePrefixes = { };

static Dictionary<string, string[]> Load( MiniYaml y, string name )
{
Expand All @@ -37,6 +40,7 @@ public VoiceInfo( MiniYaml y )
{
FieldLoader.Load( this, y );
Variants = Load(y, "Variants");
Prefixes = Load(y, "Prefixes");
Voices = Load(y, "Voices");

if (!Voices.ContainsKey("Attack"))
Expand Down
4 changes: 3 additions & 1 deletion OpenRA.Game/Sound.cs
Expand Up @@ -259,7 +259,9 @@ public static bool PlayVoice(string phrase, Actor voicedUnit, string variant)

var variantExt = (vi.Variants.ContainsKey(variant) && !vi.DisableVariants.Contains(phrase)) ?
vi.Variants[variant][voicedUnit.ActorID % vi.Variants[variant].Length] : vi.DefaultVariant;
Play(clip + variantExt);
var prefix = (vi.Prefixes.ContainsKey(variant) && !vi.DisablePrefixes.Contains(phrase)) ?
vi.Prefixes[variant][voicedUnit.ActorID % vi.Prefixes[variant].Length] : vi.DefaultPrefix;
Play(prefix + clip + variantExt);
return true;
}
}
Expand Down
43 changes: 43 additions & 0 deletions OpenRA.Mods.D2k/BuildingCaptureNotification.cs
@@ -0,0 +1,43 @@
#region Copyright & License Information
/*
* Copyright 2007-2012 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 OpenRA.Traits;

namespace OpenRA.Mods.RA
{
class CaptureNotificationInfo : ITraitInfo
{
public readonly string Race = null;
public readonly string Notification = null;

public object Create(ActorInitializer init) { return new CaptureNotification(this); }
}

class CaptureNotification : INotifyCapture
{
CaptureNotificationInfo Info;
public CaptureNotification(CaptureNotificationInfo info)
{
Info = info;
}

public void OnCapture (Actor self, Actor captor, Player oldOwner, Player newOwner)
{
if (captor.World.LocalPlayer != captor.Owner)
return;

if (Info.Race != null && Info.Race != newOwner.Country.Race)
return;

Sound.PlayToPlayer(captor.World.LocalPlayer, Info.Notification);
}
}
}

1 change: 1 addition & 0 deletions OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj
Expand Up @@ -62,6 +62,7 @@
<Compile Include="Widgets\Logic\D2kExtractGameFilesLogic.cs" />
<Compile Include="Widgets\Logic\D2kInstallFromCDLogic.cs" />
<Compile Include="Widgets\Logic\D2kDownloadPackagesLogic.cs" />
<Compile Include="BuildingCaptureNotification.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
Expand Down
22 changes: 17 additions & 5 deletions OpenRA.Mods.D2k/Widgets/Logic/D2kExtractGameFilesLogic.cs
Expand Up @@ -59,14 +59,21 @@ void Extract()
var PathToTilesets = Path.Combine(Platform.SupportDir, "Content/d2k/Tilesets");

var ExtractGameFiles = new string[][]
{ new string[] {"--r8", PathToDataR8, PathToPalette, "0", "2", Path.Combine(PathToSHPs, "overlay")},
{
new string[] {"--r8", PathToDataR8, PathToPalette, "0", "2", Path.Combine(PathToSHPs, "overlay")},
new string[] {"--r8", PathToDataR8, PathToPalette, "3", "3", Path.Combine(PathToSHPs, "repairing")},
new string[] {"--r8", PathToDataR8, PathToPalette, "15", "16", Path.Combine(PathToSHPs, "dots")},
new string[] {"--r8", PathToDataR8, PathToPalette, "17", "26", Path.Combine(PathToSHPs, "numbers")},
//new string[] {"--r8", PathToDataR8, PathToPalette, "40", "101", Path.Combine(PathToSHPs, "shadow")},
new string[] {"--r8", PathToDataR8, PathToPalette, "102", "105", Path.Combine(PathToSHPs, "crates")},
new string[] {"--r8", PathToDataR8, PathToPalette, "107", "109", Path.Combine(PathToSHPs, "spicebloom")},
new string[] {"--r8", PathToDataR8, PathToPalette, "110", "111", Path.Combine(PathToSHPs, "stars")},
new string[] {"--r8", PathToDataR8, PathToPalette, "112", "112", Path.Combine(PathToSHPs, "greenuparrow")},
new string[] {"--r8", PathToDataR8, PathToPalette, "114", "129", Path.Combine(PathToSHPs, "rockcrater1")},
new string[] {"--r8", PathToDataR8, PathToPalette, "130", "145", Path.Combine(PathToSHPs, "rockcrater2")},
new string[] {"--r8", PathToDataR8, PathToPalette, "146", "161", Path.Combine(PathToSHPs, "sandcrater1")},
new string[] {"--r8", PathToDataR8, PathToPalette, "162", "177", Path.Combine(PathToSHPs, "sandcrater2")},
// ?
new string[] {"--r8", PathToDataR8, PathToPalette, "206", "381", Path.Combine(PathToSHPs, "rifle"), "--infantry"},
new string[] {"--r8", PathToDataR8, PathToPalette, "382", "457", Path.Combine(PathToSHPs, "rifledeath"), "--infantrydeath"},
new string[] {"--r8", PathToDataR8, PathToPalette, "458", "693", Path.Combine(PathToSHPs, "bazooka"), "--infantry"},
Expand Down Expand Up @@ -154,8 +161,8 @@ void Extract()
new string[] {"--r8", PathToDataR8, PathToPalette, "2996", "2997", Path.Combine(PathToSHPs, "palaceo"), "--building"},
new string[] {"--r8", PathToDataR8, PathToPalette, "3370", "3380", Path.Combine(PathToSHPs, "unload"), "--vehicle"},
//explosions
new string[] {"--r8", PathToDataR8, PathToPalette, "3549", "3564", Path.Combine(PathToSHPs, "sandwormmouth")},
new string[] {"--r8", PathToDataR8, PathToPalette, "3565", "3585", Path.Combine(PathToSHPs, "sandwormdust")},
new string[] {"--r8", PathToDataR8, PathToPalette, "3549", "3564", Path.Combine(PathToSHPs, "wormjaw")},
new string[] {"--r8", PathToDataR8, PathToPalette, "3565", "3585", Path.Combine(PathToSHPs, "wormdust")},
new string[] {"--r8", PathToDataR8, PathToPalette, "3586", "3600", Path.Combine(PathToSHPs, "wormsigns1")},
new string[] {"--r8", PathToDataR8, PathToPalette, "3601", "3610", Path.Combine(PathToSHPs, "wormsigns2")},
new string[] {"--r8", PathToDataR8, PathToPalette, "3611", "3615", Path.Combine(PathToSHPs, "wormsigns3")},
Expand Down Expand Up @@ -269,9 +276,14 @@ void Extract()
var SHPsToCreate = new string[][]
{
new string[] {"--shp", Path.Combine(PathToSHPs, "overlay.png"), "32"},
new string[] {"--shp", Path.Combine(PathToSHPs, "repairing.png"), "24"},
new string[] {"--shp", Path.Combine(PathToSHPs, "numbers.png"), "8"},
new string[] {"--shp", Path.Combine(PathToSHPs, "dots.png"), "4"},
new string[] {"--shp", Path.Combine(PathToSHPs, "crates.png"), "32"},
//new string[] {"--shp", Path.Combine(PathToSHPs, "shadow.png"), "32"},
new string[] {"--shp", Path.Combine(PathToSHPs, "spicebloom.png"), "32"},
new string[] {"--shp", Path.Combine(PathToSHPs, "stars.png"), "16"},
new string[] {"--shp", Path.Combine(PathToSHPs, "greenuparrow.png"), "16"},
new string[] {"--shp", Path.Combine(PathToSHPs, "rockcrater1.png"), "32"},
new string[] {"--shp", Path.Combine(PathToSHPs, "rockcrater2.png"), "32"},
new string[] {"--shp", Path.Combine(PathToSHPs, "sandcrater1.png"), "32"},
Expand Down Expand Up @@ -357,8 +369,8 @@ void Extract()
new string[] {"--shp", Path.Combine(PathToSHPs, "lighto.png"), "96"},
new string[] {"--shp", Path.Combine(PathToSHPs, "palaceo.png"), "96"},
new string[] {"--shp", Path.Combine(PathToSHPs, "unload.png"), "48"},
new string[] {"--shp", Path.Combine(PathToSHPs, "sandwormmouth.png"), "68"},
new string[] {"--shp", Path.Combine(PathToSHPs, "sandwormdust.png"), "68"},
new string[] {"--shp", Path.Combine(PathToSHPs, "wormjaw.png"), "68"},
new string[] {"--shp", Path.Combine(PathToSHPs, "wormdust.png"), "68"},
new string[] {"--shp", Path.Combine(PathToSHPs, "wormsigns1.png"), "16"},
new string[] {"--shp", Path.Combine(PathToSHPs, "wormsigns2.png"), "16"},
new string[] {"--shp", Path.Combine(PathToSHPs, "wormsigns3.png"), "16"},
Expand Down
3 changes: 3 additions & 0 deletions OpenRA.Mods.RA/ActorLostNotification.cs
Expand Up @@ -14,6 +14,7 @@ namespace OpenRA.Mods.RA
{
class ActorLostNotificationInfo : ITraitInfo
{
public readonly string Race = null;
public readonly string Notification = null;
public readonly bool NotifyAll = false;

Expand All @@ -31,6 +32,8 @@ public ActorLostNotification(ActorLostNotificationInfo info)
public void Killed(Actor self, AttackInfo e)
{
var player = (Info.NotifyAll) ? self.World.LocalPlayer : self.Owner;
if (Info.Race != null && Info.Race != self.Owner.Country.Race)
return;
Sound.PlayToPlayer(player, Info.Notification);
}
}
Expand Down
4 changes: 4 additions & 0 deletions OpenRA.Mods.RA/ConquestVictoryConditions.cs
Expand Up @@ -18,6 +18,8 @@ public class ConquestVictoryConditionsInfo : ITraitInfo
public string WinNotification = null;
public string LoseNotification = null;
public int NotificationDelay = 1500; // Milliseconds
public readonly string Race = null;

public object Create(ActorInitializer init) { return new ConquestVictoryConditions(this); }
}

Expand Down Expand Up @@ -53,6 +55,7 @@ public void ResolveOrder(Actor self, Order order)

public void Lose(Actor self)
{
if (Info.Race != null && Info.Race != self.Owner.Country.Race) return;
if (self.Owner.WinState == WinState.Lost) return;
self.Owner.WinState = WinState.Lost;

Expand All @@ -74,6 +77,7 @@ public void Lose(Actor self)

public void Win(Actor self)
{
if (Info.Race != null && Info.Race != self.Owner.Country.Race) return;
if (self.Owner.WinState == WinState.Won) return;
self.Owner.WinState = WinState.Won;

Expand Down
2 changes: 2 additions & 0 deletions OpenRA.Mods.RA/Player/BaseAttackNotifier.cs
Expand Up @@ -19,6 +19,7 @@ public class BaseAttackNotifierInfo : ITraitInfo
{
public readonly int NotifyInterval = 30; /* seconds */
public readonly string Audio = "baseatk1.aud";
public readonly string Race = null;

public object Create(ActorInitializer init) { return new BaseAttackNotifier(this); }
}
Expand All @@ -34,6 +35,7 @@ public class BaseAttackNotifier : INotifyDamage

public void Damaged(Actor self, AttackInfo e)
{
if (info.Race != null && info.Race != self.Owner.Country.Race) return;
/* only track last hit against our base */
if (!self.HasTrait<Building>())
return;
Expand Down
19 changes: 8 additions & 11 deletions mods/d2k/TODO
@@ -1,21 +1,22 @@
# make structures appear earlier when errecting from ground
# too few DATA.R8 frames?
# carryalls should automatically transport harvesters (needs complex logic)
# carryalls should pickup vehicles not land so that things can roll in
# carryalls should automatically transport harvesters
# carryalls should automatically transport vehicles to repair pad if player uses the repair cursor
# windtrap animations missing
# outpost animations missing
# construction yard crane animations missing
# welding animation (factories) missing
# chimney animation (refinery) missing
# harvester unload and harvest animation missing
# harvest animation missing
# harvester unload animation ugly
# add more spice tiles and make them fit
# add game logic for concrete plates (use terrain overlay from bridges/ressources)
# allow placing turrets on walls
# RenderBuildingTurreted does not support separate turret sequence
# ornithocopter should flap (might need new RenderOrni code for proper animation)
# R8 converter needs infantry frame resorter
# R8 converter needs infantry/ornithocopter frame resorter
# add grenade thrower
# add sandworm (behave like a moving anti-vehicle mine)
# add thumper which deploys and really attracts sandworms
# make sandworm behave like a moving anti-vehicle mine
# add neutral buildings: emperor palace, fremen siech, smugglers factory
# add deathhand missile (nuke)
# maybe add ornithocopter strikes (they are currently directly contrallable units with non-reloading machine guns as in Dune II)
Expand All @@ -26,14 +27,10 @@
# rework chrome UI, dialoges, tabs
# add sonic tank weapon (currently uses tesla)
# make deviator change the allegiance of ememy units (currently shoots rockets)
# allow frigate to deliver 5 units at once to starport
# starport prices should vary
# reinforcements have arrived is played twice when ordering via starport
# fix shroud, currently falls back to 24x24 shadow from RA (Dune's 32x32 tiles differ completely from RA/CnC)
# black spots on buildings should be fading team colors
# gamefile extraction (setup/setup.z) from CD fails
# support patch 1.06 gamefiles: DATA.R8 has more frames and currently fails to extract, also featuring new terrain with white houses and new unit: grenade thrower
# mouse cursor has no transparency and is a little pixelish
# infantry-only areas (Rough) do not show the dark-green mouse cursor
# put TilesetBuilder.Export into OpenRA.Utility to call the functions directly when extracting game-files (instead of opening a GUI)
# replace RA sounds by Dune 2000 ones
# put TilesetBuilder.Export into OpenRA.Utility to call the functions directly when extracting game-files (instead of opening a GUI)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
51 changes: 44 additions & 7 deletions mods/d2k/rules/atreides.yaml
Expand Up @@ -6,6 +6,18 @@ CONYARDA:
IntoActor: mcva
Offset:1,1
Facing: 270
ProductionQueue@Building:
QueuedAudio: AI_BUILD.AUD
OnHoldAudio: AI_HOLD.AUD
ReadyAudio: AI_BDRDY.AUD
CancelledAudio: AI_CANCL.AUD
BlockedAudio: AI_NROOM.AUD
ProductionQueue@Defense:
QueuedAudio: AI_BUILD.AUD
OnHoldAudio: AI_HOLD.AUD
ReadyAudio: AI_BDRDY.AUD
CancelledAudio: AI_CANCL.AUD
BlockedAudio: AI_NROOM.AUD

PWRA:
Inherits: ^POWER
Expand All @@ -26,12 +38,24 @@ BARRA:
Buildable:
Prerequisites: pwra
Owner: atreides
ProductionQueue@Infantry:
ReadyAudio: AI_UNRDY.AUD
QueuedAudio:AI_TRAIN.AUD
OnHoldAudio: AI_HOLD.AUD
CancelledAudio: AI_CANCL.AUD
BlockedAudio: AI_NROOM.AUD

HIGHTECHA:
Inherits: ^HIGHTECH
Buildable:
Prerequisites: radara
Owner: atreides
ProductionQueue@Plane:
ReadyAudio: AI_UNRDY.AUD
QueuedAudio:AI_TRAIN.AUD
OnHoldAudio: AI_HOLD.AUD
CancelledAudio: AI_CANCL.AUD
BlockedAudio: AI_NROOM.AUD

RESEARCHA:
Inherits: ^RESEARCH
Expand All @@ -58,6 +82,12 @@ LIGHTA:
Owner: atreides
RenderBuildingWarFactory:
Image: LIGHTA
ProductionQueue@Vehicle:
ReadyAudio: AI_UNRDY.AUD
QueuedAudio:AI_TRAIN.AUD
OnHoldAudio: AI_HOLD.AUD
CancelledAudio: AI_CANCL.AUD
BlockedAudio: AI_NROOM.AUD

HEAVYA:
Inherits: ^HEAVY
Expand All @@ -66,6 +96,12 @@ HEAVYA:
Owner: atreides
RenderBuildingWarFactory:
Image: HEAVYA
ProductionQueue@Vehicle:
ReadyAudio: AI_UNRDY.AUD
QueuedAudio:AI_TRAIN.AUD
OnHoldAudio: AI_HOLD.AUD
CancelledAudio: AI_CANCL.AUD
BlockedAudio: AI_NROOM.AUD

RADARA:
Inherits: ^RADAR
Expand All @@ -78,11 +114,14 @@ STARPORTA:
Buildable:
Prerequisites: radara
Owner: atreides
ProductionQueue:
QueuedAudio: AI_ORDER.AUD
ProductionAirdrop:
ReadyAudio: AI_REINF.AUD
ProductionQueue@Vehicle:
QueuedAudio: AI_ORDER.AUD
ReadyAudio:
OnHoldAudio: AI_HOLD.AUD
CancelledAudio: AI_CANCL.AUD
BlockedAudio: AI_NROOM.AUD

REPAIRA:
Inherits: ^REPAIR
Expand All @@ -99,7 +138,6 @@ MCVA:
Facing: 10
IntoActor: conyarda
Offset:-1,-1
TransformSounds: BUILD1.aud
NoTransformSounds: AI_DPLOY.AUD
RenderUnit:
Image: DMCV
Expand Down Expand Up @@ -152,13 +190,12 @@ FREMEN:
Prerequisites: palacea
Selectable:
Bounds: 12,17,0,-6
# Voice: CommandoVoice
Voice: FremenVoice
Mobile:
Speed: 5
Health:
HP: 200
Passenger:
PipType: Red
RevealsShroud:
Range: 6
AutoTarget:
Expand All @@ -171,5 +208,5 @@ FREMEN:
Cloak:
InitialDelay: 125
CloakDelay: 125
CloakSound:
UncloakSound:
CloakSound: STEALTH1.aud
UncloakSound: STEALTH2.aud

0 comments on commit a2b92d0

Please sign in to comment.