setup stances; not using team ids from lobby yet.
This commit is contained in:
@@ -263,6 +263,10 @@ namespace OpenRA
|
|||||||
|
|
||||||
foreach (var c in LobbyInfo.Clients)
|
foreach (var c in LobbyInfo.Clients)
|
||||||
world.AddPlayer(new Player(world, c));
|
world.AddPlayer(new Player(world, c));
|
||||||
|
|
||||||
|
foreach (var p in world.players.Values)
|
||||||
|
foreach (var q in world.players.Values)
|
||||||
|
p.Stances[q] = ChooseInitialStance(p, q);
|
||||||
|
|
||||||
world.Queries = new World.AllQueries(world);
|
world.Queries = new World.AllQueries(world);
|
||||||
|
|
||||||
@@ -273,6 +277,15 @@ namespace OpenRA
|
|||||||
orderManager.StartGame();
|
orderManager.StartGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Stance ChooseInitialStance(Player p, Player q)
|
||||||
|
{
|
||||||
|
if (p == q) return Stance.Ally;
|
||||||
|
if (p == world.NeutralPlayer || q == world.NeutralPlayer) return Stance.Neutral;
|
||||||
|
|
||||||
|
// todo: allies based on team index in LobbyInfo
|
||||||
|
return Stance.Enemy;
|
||||||
|
}
|
||||||
|
|
||||||
static int2 lastPos;
|
static int2 lastPos;
|
||||||
public static void DispatchMouseInput(MouseInputEvent ev, MouseEventArgs e, Modifiers modifierKeys)
|
public static void DispatchMouseInput(MouseInputEvent ev, MouseEventArgs e, Modifiers modifierKeys)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -195,5 +195,7 @@ namespace OpenRA
|
|||||||
Sound.PlayToPlayer(this, eva.CashTickDown);
|
Sound.PlayToPlayer(this, eva.CashTickDown);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Dictionary<Player, Stance> Stances = new Dictionary<Player, Stance>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user