tank production works

This commit is contained in:
Chris Forbes
2009-10-24 16:24:44 +13:00
parent ea3526a238
commit 979bb74bba
2 changed files with 28 additions and 6 deletions

View File

@@ -7,7 +7,8 @@ using System.Linq;
using IrrKlang;
using IjwFramework.Collections;
using System;
using IjwFramework.Types;
using IjwFramework.Types;
using OpenRa.Game.Traits;
namespace OpenRa.Game
{
@@ -180,6 +181,22 @@ namespace OpenRa.Game
public static readonly Pair<VoicePool, VoicePool> SovietVoices =
Pair.New(
new VoicePool("ackno", "affirm1", "noprob", "overout", "ritaway", "roger", "ugotit"),
new VoicePool("await1", "ready", "report1", "yessir1"));
new VoicePool("await1", "ready", "report1", "yessir1"));
public static void BuildUnit(Player player, string name)
{
var producer = world.Actors
.FirstOrDefault(a => a.unitInfo != null && a.unitInfo.Name == "weap" && a.Owner == player);
if (producer == null)
throw new InvalidOperationException("BuildUnit without suitable production structure!");
var unit = new Actor(name, (1/24f * producer.CenterLocation).ToInt2(), player);
unit.Order(unit.Location + new int2(0, 3)).Apply(false);
world.AddFrameEndTask(_ => world.Add(unit));
// todo: make the producing building play `build`
}
}
}