This commit is contained in:
Chris Forbes
2010-01-11 22:26:14 +13:00
parent 9c520e07b1
commit e6e5275f05
10 changed files with 28 additions and 32 deletions

View File

@@ -14,7 +14,7 @@ namespace OpenRa.Game.Traits
Game.world.AddFrameEndTask(
w =>
{ /* create the free harvester! */
var harvester = new Actor(Rules.UnitInfo["harv"], self.Location + new int2(1, 2), self.Owner);
var harvester = new Actor("harv", self.Location + new int2(1, 2), self.Owner);
var unit = harvester.traits.Get<Unit>();
var mobile = harvester.traits.Get<Mobile>();
unit.Facing = 64;

View File

@@ -17,7 +17,7 @@ namespace OpenRa.Game.Traits.Activities
Sound.Play("placbldg.aud");
Sound.Play("build5.aud");
}
Game.world.Add( new Actor( Rules.UnitInfo["fact"], self.Location - new int2( 1, 1 ), self.Owner ) );
Game.world.Add( new Actor( "fact", self.Location - new int2( 1, 1 ), self.Owner ) );
} );
return this;
}

View File

@@ -14,7 +14,7 @@ namespace OpenRa.Game.Traits.Activities
ns.Sold(self);
w.Remove(self);
var mcv = new Actor(Rules.UnitInfo["MCV"], self.Location + new int2(1, 1), self.Owner);
var mcv = new Actor("mcv", self.Location + new int2(1, 1), self.Owner);
mcv.traits.Get<Unit>().Facing = 96;
w.Add(mcv);
}

View File

@@ -48,7 +48,7 @@ namespace OpenRa.Game.Traits
return inRange
.Where(a => a.Owner == self.Owner && a != self) /* todo: one day deal with friendly players */
.Where(a => Combat.HasAnyValidWeapons(self, a))
.Where(a => a.Health < a.LegacyInfo.Strength)
.Where(a => a.Health < a.Info.Traits.WithInterface<OwnedActorInfo>().First().HP)
.OrderBy(a => (a.Location - self.Location).LengthSquared)
.FirstOrDefault();
}

View File

@@ -33,7 +33,7 @@ namespace OpenRa.Game.Traits
// todo: delay a bit? (req making deploy-mine an activity)
Game.world.AddFrameEndTask(
w => w.Add(new Actor(Rules.UnitInfo[self.LegacyInfo.Primary], self.Location, self.Owner)));
w => w.Add(new Actor(self.LegacyInfo.Primary, self.Location, self.Owner)));
}
}
}

View File

@@ -35,7 +35,7 @@ namespace OpenRa.Game.Traits
if( location == null || Game.UnitInfluence.GetUnitsAt( location.Value ).Any() )
return false;
var newUnit = new Actor( producee, location.Value, self.Owner );
var newUnit = new Actor( producee.Name, location.Value, self.Owner );
newUnit.traits.Get<Unit>().Facing = CreationFacing( self, newUnit ); ;
var rp = self.traits.GetOrDefault<RallyPoint>();