started porting traits to use new trait args.

This commit is contained in:
Chris Forbes
2010-01-10 18:55:10 +13:00
parent 99a61ca8d9
commit e7f9023aca
9 changed files with 501 additions and 87 deletions

View File

@@ -13,8 +13,9 @@ namespace OpenRa.Game.Traits.Activities
void DoSell(Actor self)
{
var refund = Rules.General.RefundPercent
* self.Health * self.LegacyInfo.Cost / self.LegacyInfo.Strength;
var cost = self.Info.Traits.Get<BuildableInfo>().Cost;
var hp = self.Info.Traits.WithInterface<OwnedActorInfo>().First().HP;
var refund = Rules.General.RefundPercent * self.Health * cost / hp;
self.Owner.GiveCash((int)refund);
self.Health = 0;