Move weapon/turret definitions out of AttackBase.

Weapons are now defined with the Armament trait
and turret parameters live in Turreted.
This has the side effect of allowing any number
and distribution of weapons and turrets.
This commit is contained in:
Paul Chote
2013-03-14 03:55:34 +13:00
parent aa6f12f0a1
commit 0167bbfbaa
81 changed files with 4023 additions and 820 deletions

View File

@@ -55,7 +55,9 @@ namespace OpenRA.Mods.RA
if (facing != null)
td.Add(new FacingInit( facing.Facing ));
var turreted = self.TraitOrDefault<Turreted>();
// TODO: This will only take the first turret if there are multiple
// This isn't a problem with the current units, but may be a problem for mods
var turreted = self.TraitsImplementing<Turreted>().FirstOrDefault();
if (turreted != null)
td.Add( new TurretFacingInit(turreted.turretFacing) );