race specific notifications/mcv-crate

This commit is contained in:
Matthias Mailänder
2012-06-20 21:35:23 +02:00
parent 6929ed024a
commit ac0389d04f
7 changed files with 154 additions and 22 deletions

View File

@@ -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);
}
}
}

View File

@@ -62,6 +62,7 @@
<Compile Include="Widgets\Logic\D2kExtractGameFilesLogic.cs" /> <Compile Include="Widgets\Logic\D2kExtractGameFilesLogic.cs" />
<Compile Include="Widgets\Logic\D2kInstallFromCDLogic.cs" /> <Compile Include="Widgets\Logic\D2kInstallFromCDLogic.cs" />
<Compile Include="Widgets\Logic\D2kDownloadPackagesLogic.cs" /> <Compile Include="Widgets\Logic\D2kDownloadPackagesLogic.cs" />
<Compile Include="BuildingCaptureNotification.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
@@ -91,7 +92,4 @@ cd "$(SolutionDir)"</PostBuildEvent>
<Name>OpenRA.Mods.RA</Name> <Name>OpenRA.Mods.RA</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Render\" />
</ItemGroup>
</Project> </Project>

View File

@@ -14,6 +14,7 @@ namespace OpenRA.Mods.RA
{ {
class ActorLostNotificationInfo : ITraitInfo class ActorLostNotificationInfo : ITraitInfo
{ {
public readonly string Race = null;
public readonly string Notification = null; public readonly string Notification = null;
public readonly bool NotifyAll = false; public readonly bool NotifyAll = false;
@@ -31,6 +32,8 @@ namespace OpenRA.Mods.RA
public void Killed(Actor self, AttackInfo e) public void Killed(Actor self, AttackInfo e)
{ {
var player = (Info.NotifyAll) ? self.World.LocalPlayer : self.Owner; 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); Sound.PlayToPlayer(player, Info.Notification);
} }
} }

View File

@@ -18,6 +18,8 @@ namespace OpenRA.Mods.RA
public string WinNotification = null; public string WinNotification = null;
public string LoseNotification = null; public string LoseNotification = null;
public int NotificationDelay = 1500; // Milliseconds public int NotificationDelay = 1500; // Milliseconds
public readonly string Race = null;
public object Create(ActorInitializer init) { return new ConquestVictoryConditions(this); } public object Create(ActorInitializer init) { return new ConquestVictoryConditions(this); }
} }
@@ -53,6 +55,7 @@ namespace OpenRA.Mods.RA
public void Lose(Actor self) public void Lose(Actor self)
{ {
if (Info.Race != null && Info.Race != self.Owner.Country.Race) return;
if (self.Owner.WinState == WinState.Lost) return; if (self.Owner.WinState == WinState.Lost) return;
self.Owner.WinState = WinState.Lost; self.Owner.WinState = WinState.Lost;
@@ -74,6 +77,7 @@ namespace OpenRA.Mods.RA
public void Win(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; if (self.Owner.WinState == WinState.Won) return;
self.Owner.WinState = WinState.Won; self.Owner.WinState = WinState.Won;

View File

@@ -6,7 +6,8 @@
# construction yard crane animations missing # construction yard crane animations missing
# welding animation (factories) missing # welding animation (factories) missing
# chimney animation (refinery) 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 more spice tiles and make them fit
# add game logic for concrete plates (use terrain overlay from bridges/ressources) # add game logic for concrete plates (use terrain overlay from bridges/ressources)
# allow placing turrets on walls # allow placing turrets on walls
@@ -14,8 +15,7 @@
# ornithocopter should flap (might need new RenderOrni code for proper animation) # ornithocopter should flap (might need new RenderOrni code for proper animation)
# R8 converter needs infantry frame resorter # R8 converter needs infantry frame resorter
# add grenade thrower # add grenade thrower
# add sandworm (behave like a moving anti-vehicle mine) # make sandworm behave like a moving anti-vehicle mine
# add thumper which deploys and really attracts sandworms
# add neutral buildings: emperor palace, fremen siech, smugglers factory # add neutral buildings: emperor palace, fremen siech, smugglers factory
# add deathhand missile (nuke) # add deathhand missile (nuke)
# maybe add ornithocopter strikes (they are currently directly contrallable units with non-reloading machine guns as in Dune II) # maybe add ornithocopter strikes (they are currently directly contrallable units with non-reloading machine guns as in Dune II)
@@ -33,7 +33,6 @@
# black spots on buildings should be fading team colors # black spots on buildings should be fading team colors
# gamefile extraction (setup/setup.z) from CD fails # 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 # 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 # 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) # 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 # replace RA sounds by Dune 2000 ones

View File

@@ -23,9 +23,15 @@
GainsExperience: GainsExperience:
GivesExperience: GivesExperience:
DrawLineToTarget: DrawLineToTarget:
#TODO: not race specific ActorLostNotification@Atreides:
ActorLostNotification: Race: atreides
Notification: AI_ULOST.AUD Notification: AI_ULOST.AUD
ActorLostNotification@Harkonnen:
Race: harkonnen
Notification: HI_ULOST.AUD
ActorLostNotification@Ordos:
Race: ordos
Notification: OI_ULOST.AUD
ProximityCaptor: ProximityCaptor:
Types:Vehicle Types:Vehicle
GivesBounty: GivesBounty:
@@ -58,8 +64,15 @@
GainsExperience: GainsExperience:
GivesExperience: GivesExperience:
DrawLineToTarget: DrawLineToTarget:
ActorLostNotification: ActorLostNotification@Atreides:
Race: atreides
Notification: AI_ULOST.AUD Notification: AI_ULOST.AUD
ActorLostNotification@Harkonnen:
Race: harkonnen
Notification: HI_ULOST.AUD
ActorLostNotification@Ordos:
Race: ordos
Notification: OI_ULOST.AUD
ProximityCaptor: ProximityCaptor:
Types:Tank Types:Tank
GivesBounty: GivesBounty:
@@ -101,8 +114,15 @@
GainsExperience: GainsExperience:
GivesExperience: GivesExperience:
DrawLineToTarget: DrawLineToTarget:
ActorLostNotification: ActorLostNotification@Atreides:
Race: atreides
Notification: AI_ULOST.AUD Notification: AI_ULOST.AUD
ActorLostNotification@Harkonnen:
Race: harkonnen
Notification: HI_ULOST.AUD
ActorLostNotification@Ordos:
Race: ordos
Notification: OI_ULOST.AUD
ProximityCaptor: ProximityCaptor:
Types:Infantry Types:Infantry
GivesBounty: GivesBounty:
@@ -122,8 +142,15 @@
GainsExperience: GainsExperience:
GivesExperience: GivesExperience:
DrawLineToTarget: DrawLineToTarget:
ActorLostNotification: ActorLostNotification@Atreides:
Race: atreides
Notification: AI_ULOST.AUD Notification: AI_ULOST.AUD
ActorLostNotification@Harkonnen:
Race: harkonnen
Notification: HI_ULOST.AUD
ActorLostNotification@Ordos:
Race: ordos
Notification: OI_ULOST.AUD
DebugAircraftFacing: DebugAircraftFacing:
DebugAircraftSubPxX: DebugAircraftSubPxX:
DebugAircraftSubPxY: DebugAircraftSubPxY:
@@ -159,7 +186,7 @@
WithBuildingExplosion: WithBuildingExplosion:
RepairableBuilding: RepairableBuilding:
EmitInfantryOnSell: EmitInfantryOnSell:
ActorTypes: rifle,rifle,rifle,rifle,rifle,rifle ActorTypes: rifle,rifle,rifle,bazooka,bazooka,engineer
MustBeDestroyed: MustBeDestroyed:
GivesExperience: GivesExperience:
# FrozenUnderFog: # FrozenUnderFog:
@@ -172,9 +199,15 @@
CaptureNotification@Ordos: CaptureNotification@Ordos:
Race: ordos Race: ordos
Notification: OI_CAPT.AUD Notification: OI_CAPT.AUD
#TODO: not Race-specific ActorLostNotification@Atreides:
ActorLostNotification: Race: atreides
Notification: AI_BLOST.AUD Notification: AI_BLOST.AUD
ActorLostNotification@Harkonnen:
Race: harkonnen
Notification: HI_BLOST.AUD
ActorLostNotification@Ordos:
Race: ordos
Notification: OI_BLOST.AUD
EditorAppearance: EditorAppearance:
RelativeToTopLeft: yes RelativeToTopLeft: yes
ShakeOnDeath: ShakeOnDeath:

View File

@@ -48,9 +48,18 @@ Player:
BlockedAudio: AI_NROOM.AUD BlockedAudio: AI_NROOM.AUD
PlaceBuilding: PlaceBuilding:
SupportPowerManager: SupportPowerManager:
ConquestVictoryConditions: ConquestVictoryConditions@Atreides:
Race: atreides
WinNotification: AI_MWIN.AUD WinNotification: AI_MWIN.AUD
LoseNotification: AI_MFAIL.AUD LoseNotification: AI_MFAIL.AUD
ConquestVictoryConditions@Harkonnen:
Race: harkonnen
WinNotification: HI_MWIN.AUD
LoseNotification: HI_MFAIL.AUD
ConquestVictoryConditions@Ordos:
Race: ordos
WinNotification: OI_MWIN.AUD
LoseNotification: OI_MFAIL.AUD
PowerManager: PowerManager:
AllyRepair: AllyRepair:
PlayerResources: PlayerResources:
@@ -246,17 +255,60 @@ CRATE:
RevealMapCrateAction: RevealMapCrateAction:
SelectionShares: 1 SelectionShares: 1
Effect: reveal-map Effect: reveal-map
#TODO: Currently only gives you an Atreides MCV GiveMcvCrateAction@Atreides:
GiveMcvCrateAction:
SelectionShares: 2 SelectionShares: 2
NoBaseSelectionShares: 9001 NoBaseSelectionShares: 9001
Unit: mcva Unit: mcva
GiveUnitCrateAction@trike: GiveMcvCrateAction@Harkonnen:
SelectionShares: 2
NoBaseSelectionShares: 9001
Unit: mcvh
GiveMcvCrateAction@Ordos:
SelectionShares: 2
NoBaseSelectionShares: 9001
Unit: mcvo
GiveUnitCrateAction@Trike:
SelectionShares: 7 SelectionShares: 7
Unit: trike Unit: trike
GiveUnitCrateAction@quad: GiveUnitCrateAction@Quad:
SelectionShares: 6 SelectionShares: 6
Unit: quad Unit: quad
GiveUnitCrateAction@Raider:
SelectionShares: 6
Unit: raider
GiveUnitCrateAction@SiegeTank:
SelectionShares: 6
Unit: siegetank
GiveUnitCrateAction@MissileTank:
SelectionShares: 6
Unit: missiletank
GiveUnitCrateAction@CombatA:
SelectionShares: 5
Unit: combata
GiveUnitCrateAction@CombatH:
SelectionShares: 5
Unit: combath
GiveUnitCrateAction@CombatO:
SelectionShares: 5
Unit: combato
GiveUnitCrateAction@Fremen:
SelectionShares: 4
Unit: fremen
GiveUnitCrateAction@Sardaukar:
SelectionShares: 4
Unit: sardaukar
GiveUnitCrateAction@Saboteur:
SelectionShares: 4
Unit: saboteur
GiveUnitCrateAction@SonicTank:
SelectionShares: 3
Unit: sonictank
GiveUnitCrateAction@Devast:
SelectionShares: 3
Unit: devast
GiveUnitCrateAction@deviatortank:
SelectionShares: 3
Unit: deviatortank
RenderSimple: RenderSimple:
BelowUnits: BelowUnits:
ProximityCaptor: ProximityCaptor: