find/replace "Game.world." -> "self.World." in all traits and activities.
This commit is contained in:
@@ -37,7 +37,7 @@ namespace OpenRa.Mods.RA.Activities
|
||||
}
|
||||
|
||||
// the engineer is sacrificed.
|
||||
Game.world.AddFrameEndTask(w => w.Remove(self));
|
||||
self.World.AddFrameEndTask(w => w.Remove(self));
|
||||
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace OpenRa.Mods.RA.Activities
|
||||
public IActivity Tick(Actor self)
|
||||
{
|
||||
if (target == null || target.IsDead) return NextActivity;
|
||||
Game.world.AddFrameEndTask(w => w.Add(new DelayedAction(25*2,
|
||||
self.World.AddFrameEndTask(w => w.Add(new DelayedAction(25*2,
|
||||
() => target.InflictDamage(self, target.Health, Rules.WarheadInfo["DemolishWarhead"]))));
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace OpenRa.Mods.RA.Activities
|
||||
foreach (var t in target.traits.WithInterface<IAcceptSpy>())
|
||||
t.OnInfiltrate(target, self);
|
||||
|
||||
Game.world.AddFrameEndTask(w => w.Remove(self));
|
||||
self.World.AddFrameEndTask(w => w.Remove(self));
|
||||
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRa.Mods.RA.Activities
|
||||
foreach (var t in target.traits.WithInterface<IAcceptThief>())
|
||||
t.OnSteal(target, self);
|
||||
|
||||
Game.world.AddFrameEndTask(w => w.Remove(self));
|
||||
self.World.AddFrameEndTask(w => w.Remove(self));
|
||||
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRa.Mods.RA
|
||||
public Mine(Actor self)
|
||||
{
|
||||
this.self = self;
|
||||
Game.world.UnitInfluence.Add(self, this);
|
||||
self.World.UnitInfluence.Add(self, this);
|
||||
}
|
||||
|
||||
public void OnCrush(Actor crusher)
|
||||
@@ -32,17 +32,17 @@ namespace OpenRa.Mods.RA
|
||||
var info = self.Info.Traits.Get<MineInfo>();
|
||||
var warhead = Rules.WarheadInfo[info.Warhead];
|
||||
|
||||
Game.world.AddFrameEndTask(_ =>
|
||||
self.World.AddFrameEndTask(_ =>
|
||||
{
|
||||
Game.world.Remove(self);
|
||||
Game.world.Add(new Explosion(self.CenterLocation.ToInt2(), warhead.Explosion, false));
|
||||
self.World.Remove(self);
|
||||
self.World.Add(new Explosion(self.CenterLocation.ToInt2(), warhead.Explosion, false));
|
||||
crusher.InflictDamage(crusher, info.Damage, warhead);
|
||||
});
|
||||
}
|
||||
|
||||
public bool IsPathableCrush(UnitMovementType umt, Player player)
|
||||
{
|
||||
return !self.Info.Traits.Get<MineInfo>().AvoidFriendly || (player != Game.world.LocalPlayer);
|
||||
return !self.Info.Traits.Get<MineInfo>().AvoidFriendly || (player != self.World.LocalPlayer);
|
||||
}
|
||||
|
||||
public bool IsCrushableBy(UnitMovementType umt, Player player)
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace OpenRa.Mods.RA
|
||||
return null;
|
||||
|
||||
// Ensure that the cell is empty except for the minelayer
|
||||
if (Game.world.UnitInfluence.GetUnitsAt(xy).Any(a => a != self))
|
||||
if (self.World.UnitInfluence.GetUnitsAt(xy).Any(a => a != self))
|
||||
return null;
|
||||
|
||||
if (mi.Button == MouseButton.Right && underCursor == self)
|
||||
@@ -36,7 +36,7 @@ namespace OpenRa.Mods.RA
|
||||
|
||||
// todo: delay a bit? (req making deploy-mine an activity)
|
||||
|
||||
Game.world.AddFrameEndTask(
|
||||
self.World.AddFrameEndTask(
|
||||
w => w.CreateActor(self.Info.Traits.Get<MinelayerInfo>().Mine, self.Location, self.Owner));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,15 +21,15 @@ namespace OpenRa.Mods.RA
|
||||
|
||||
public IEnumerable<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r)
|
||||
{
|
||||
if (self.Owner == Game.world.LocalPlayer)
|
||||
if (self.Owner == self.World.LocalPlayer)
|
||||
return r;
|
||||
|
||||
return r.Select(a => a.WithPalette(Game.world.LocalPlayer.Palette));
|
||||
return r.Select(a => a.WithPalette(self.World.LocalPlayer.Palette));
|
||||
}
|
||||
|
||||
public override void Tick(Actor self)
|
||||
{
|
||||
anim.ChangeImage(self.Owner == Game.world.LocalPlayer ? GetImage(self) : "e1");
|
||||
anim.ChangeImage(self.Owner == self.World.LocalPlayer ? GetImage(self) : "e1");
|
||||
base.Tick(self);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user