fixed some dumb bugs; more porting
This commit is contained in:
@@ -97,7 +97,7 @@ namespace OpenRa.Game.Graphics
|
|||||||
|
|
||||||
public void GoToStartLocation()
|
public void GoToStartLocation()
|
||||||
{
|
{
|
||||||
Center(Game.world.Actors.Where(a => a.LegacyInfo != null && a.Owner == Game.LocalPlayer));
|
Center(Game.world.Actors.Where(a => a.Info != null && a.Owner == Game.LocalPlayer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,9 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
public void Explore(Actor a)
|
public void Explore(Actor a)
|
||||||
{
|
{
|
||||||
foreach (var t in Game.FindTilesInCircle((1f / Game.CellSize * a.CenterLocation).ToInt2(), a.Info.Traits.Get<OwnedActorInfo>().Sight))
|
foreach (var t in Game.FindTilesInCircle(
|
||||||
|
(1f / Game.CellSize * a.CenterLocation).ToInt2(),
|
||||||
|
a.Info.Traits.WithInterface<OwnedActorInfo>().First().Sight))
|
||||||
explored[t.X, t.Y] = true;
|
explored[t.X, t.Y] = true;
|
||||||
|
|
||||||
dirty = true;
|
dirty = true;
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ namespace OpenRa.Game.Traits
|
|||||||
{
|
{
|
||||||
class ProductionInfo : ITraitInfo
|
class ProductionInfo : ITraitInfo
|
||||||
{
|
{
|
||||||
|
public readonly int[] SpawnOffset = null;
|
||||||
|
|
||||||
public object Create(Actor self) { return new Production(self); }
|
public object Create(Actor self) { return new Production(self); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,7 +25,7 @@ namespace OpenRa.Game.Traits
|
|||||||
|
|
||||||
public virtual int CreationFacing( Actor self, Actor newUnit )
|
public virtual int CreationFacing( Actor self, Actor newUnit )
|
||||||
{
|
{
|
||||||
return newUnit.LegacyInfo.InitialFacing;
|
return newUnit.Info.Traits.WithInterface<OwnedActorInfo>().FirstOrDefault().InitialFacing;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Produce( Actor self, LegacyUnitInfo producee )
|
public bool Produce( Actor self, LegacyUnitInfo producee )
|
||||||
@@ -43,10 +45,10 @@ namespace OpenRa.Game.Traits
|
|||||||
newUnit.QueueActivity( new Activities.Move( rp.rallyPoint, 1 ) );
|
newUnit.QueueActivity( new Activities.Move( rp.rallyPoint, 1 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
var bi = self.LegacyInfo as LegacyBuildingInfo;
|
var pi = self.Info.Traits.Get<ProductionInfo>();
|
||||||
if (bi != null && bi.SpawnOffset != null)
|
if (pi != null && pi.SpawnOffset != null)
|
||||||
newUnit.CenterLocation = self.CenterLocation
|
newUnit.CenterLocation = self.CenterLocation
|
||||||
+ new float2(bi.SpawnOffset[0], bi.SpawnOffset[1]);
|
+ new float2(pi.SpawnOffset[0], pi.SpawnOffset[1]);
|
||||||
|
|
||||||
Game.world.Add( newUnit );
|
Game.world.Add( newUnit );
|
||||||
|
|
||||||
|
|||||||
@@ -17,13 +17,14 @@ namespace OpenRa.Game.Traits
|
|||||||
{
|
{
|
||||||
var unit = self.traits.Get<Unit>();
|
var unit = self.traits.Get<Unit>();
|
||||||
var attack = self.traits.WithInterface<AttackBase>().First();
|
var attack = self.traits.WithInterface<AttackBase>().First();
|
||||||
|
var attackInfo = self.Info.Traits.WithInterface<AttackBaseInfo>().First();
|
||||||
|
|
||||||
var muzzleFlash = new Animation(self.LegacyInfo.Name);
|
var muzzleFlash = new Animation(GetImage(self));
|
||||||
muzzleFlash.PlayFetchIndex("muzzle",
|
muzzleFlash.PlayFetchIndex("muzzle",
|
||||||
() => (Util.QuantizeFacing(unit.Facing, 8)) * 6 + (int)(attack.primaryRecoil * 5.9f));
|
() => (Util.QuantizeFacing(unit.Facing, 8)) * 6 + (int)(attack.primaryRecoil * 5.9f));
|
||||||
anims.Add( "muzzle", new AnimationWithOffset(
|
anims.Add( "muzzle", new AnimationWithOffset(
|
||||||
muzzleFlash,
|
muzzleFlash,
|
||||||
() => self.LegacyInfo.PrimaryOffset.AbsOffset(),
|
() => attackInfo.PrimaryOffset.AbsOffset(),
|
||||||
() => attack.primaryRecoil <= 0 ) );
|
() => attack.primaryRecoil <= 0 ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,6 +139,10 @@ namespace RulesConverter
|
|||||||
{ "MuzzleFlash", "MuzzleFlash" }, // maybe
|
{ "MuzzleFlash", "MuzzleFlash" }, // maybe
|
||||||
{ "Recoil", "Recoil"} }
|
{ "Recoil", "Recoil"} }
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ "Production", new PL {
|
||||||
|
{ "SpawnOffset", "SpawnOffset" } }
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
traitMap["RenderUnit"] = traitMap["RenderBuilding"];
|
traitMap["RenderUnit"] = traitMap["RenderBuilding"];
|
||||||
|
|||||||
149
ra.yaml
149
ra.yaml
@@ -1195,6 +1195,7 @@ HPAD:
|
|||||||
Sight: 5
|
Sight: 5
|
||||||
RenderBuilding:
|
RenderBuilding:
|
||||||
Production:
|
Production:
|
||||||
|
SpawnOffset: 0,-4
|
||||||
BelowUnits:
|
BelowUnits:
|
||||||
Reservable:
|
Reservable:
|
||||||
IronCurtainable:
|
IronCurtainable:
|
||||||
@@ -1571,6 +1572,154 @@ MINV:
|
|||||||
BelowUnits:
|
BelowUnits:
|
||||||
InvisibleToOthers:
|
InvisibleToOthers:
|
||||||
|
|
||||||
|
T01:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: x_ x_
|
||||||
|
Dimensions: 2,2
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
T02:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: x_ x_
|
||||||
|
Dimensions: 2,2
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
T03:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: x_ x_
|
||||||
|
Dimensions: 2,2
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
T05:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: x_ x_
|
||||||
|
Dimensions: 2,2
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
T06:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: x_ x_
|
||||||
|
Dimensions: 2,2
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
T07:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: x_ x_
|
||||||
|
Dimensions: 2,2
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
T08:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: x_
|
||||||
|
Dimensions: 2,1
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
T10:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: xx xx
|
||||||
|
Dimensions: 2,2
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
T11:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: xx xx
|
||||||
|
Dimensions: 2,2
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
T12:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: xx xx
|
||||||
|
Dimensions: 2,2
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
T13:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: xx xx
|
||||||
|
Dimensions: 2,2
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
T14:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: xx xx
|
||||||
|
Dimensions: 2,2
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
T15:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: xx xx
|
||||||
|
Dimensions: 2,2
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
T16:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: x_ x_
|
||||||
|
Dimensions: 2,2
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
T17:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: x_ x_
|
||||||
|
Dimensions: 2,2
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
TC01:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: xx_ xx_
|
||||||
|
Dimensions: 3,2
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
TC02:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: xx_ xx_
|
||||||
|
Dimensions: 3,2
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
TC03:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: xx_ xx_
|
||||||
|
Dimensions: 3,2
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
TC04:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: xxx_ xxx_ xxx_
|
||||||
|
Dimensions: 4,3
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
TC05:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: xxx_ xxx_ xxx_
|
||||||
|
Dimensions: 4,3
|
||||||
|
RenderBuilding:
|
||||||
|
|
||||||
|
MINE:
|
||||||
|
Inherits: DefaultBuilding
|
||||||
|
Building:
|
||||||
|
Footprint: x
|
||||||
|
Dimensions: 1,1
|
||||||
|
RenderBuilding:
|
||||||
|
SeedsOre:
|
||||||
|
|
||||||
DOG:
|
DOG:
|
||||||
Inherits: DefaultInfantry
|
Inherits: DefaultInfantry
|
||||||
Buildable:
|
Buildable:
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
RulesConverter\bin\debug\RulesConverter.exe units.ini rules.ini ra.yaml
|
RulesConverter\bin\debug\RulesConverter.exe units.ini rules.ini trees.ini ra.yaml
|
||||||
RulesConverter\bin\debug\RulesConverter.exe aftermathUnits.ini aftrmath.ini aftermath.yaml
|
RulesConverter\bin\debug\RulesConverter.exe aftermathUnits.ini aftrmath.ini aftermath.yaml
|
||||||
Reference in New Issue
Block a user