Begin generalizing crates; only give firepower bonus to units with weapons
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public interface ICrateAction
|
||||
{
|
||||
int SelectionShares { get; }
|
||||
int GetSelectionShares(Actor collector);
|
||||
void Activate(Actor collector);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user