Begin generalizing crates; only give firepower bonus to units with weapons

This commit is contained in:
Paul Chote
2010-03-21 19:52:13 +13:00
parent a489b4aa56
commit 0510a7fb7f
8 changed files with 50 additions and 25 deletions

View File

@@ -62,7 +62,7 @@ namespace OpenRA.Traits
public void OnCrush(Actor crusher)
{
var shares = self.traits.WithInterface<ICrateAction>().Select(a => Pair.New(a, a.SelectionShares));
var shares = self.traits.WithInterface<ICrateAction>().Select(a => Pair.New(a, a.GetSelectionShares(crusher)));
var totalShares = shares.Sum(a => a.Second);
var n = self.World.SharedRandom.Next(totalShares);

View File

@@ -85,7 +85,7 @@ namespace OpenRA.Traits
public interface ICrateAction
{
int SelectionShares { get; }
int GetSelectionShares(Actor collector);
void Activate(Actor collector);
}