|
@@ -27,6 +27,7 @@ namespace ET.Server
|
|
|
self.UnitPlayers = new Dictionary<string, Struct.UnitPlayerData>();
|
|
|
self.DeadUnits = new List<int>();
|
|
|
self.DeadUnitPlayer = new List<int>();
|
|
|
+ self.InitSth();
|
|
|
|
|
|
// 战斗服事件组件
|
|
|
self.AddComponent<MapEventComponent>();
|
|
@@ -56,11 +57,46 @@ namespace ET.Server
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private static void InitSth(this Map self)
|
|
|
+ {
|
|
|
+ float[,,] POS = new[, ,]
|
|
|
+ {
|
|
|
+ { {96,216},{102,216},{93,221.5f},{98.6f,224},{104,223},{93,227.5f},{97.5f,230},{102,230},{92.5f,233},{97,235},
|
|
|
+ {101.5f,236.5f},{105,235},{92.5f,238},{95,241},{99,240},{104,241},{108,240},{92,242.5f},{94.5f,245},{98,245},
|
|
|
+ {101,244},{103,247},{106,245},{109,244.5f},{91.5f,247},{95,249},{100,249},{102,251},{106,250},{108,249},
|
|
|
+ {91,253},{93,250},{95,253},{98,253},{101,254},{103,255},{106,254},{108,254},{111,255},{92,256}
|
|
|
+ },
|
|
|
+ { {195,119},{188,120},{197,112},{191,113.7f},{188,108},{198,103},{194,106},{191,101},{185.5f,103},{198,97},
|
|
|
+ {195,98},{192,95},{188.7f,96.5f},{185,97},{200,92},{195,92.5f},{192,89},{187,91},{202,89},{198,89},
|
|
|
+ {189,86},{186,87},{184,88},{199,85},{195,85},{191,83},{188,80},{199,80},{195,81},{185,83},
|
|
|
+ {201,77},{198,77},{192,77},{189,77},{185,77},{200,74},{196,75},{190,74},{195,70},{190,70}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ {94,60},{92,67},{87,55},{84,59.5f},{84,68},{80,50},{76,56},{77,62},{72,63},{74.5f,47},
|
|
|
+ {70,51},{70,55},{65,59},{69,44.5f},{65,47},{64.5f,51},{63,54},{60,58},{64,42},{60,40},
|
|
|
+ {60.5f,44},{60.5f,47},{60.5f,51},{58.8f,55},{55,56},{56.6f,38},{56.8f,41},{56.7f,43},{57,45},{57,48},
|
|
|
+ {57,51},{54,52.5f},{54,36.5f},{53,40},{53,42},{53,44.5f},{53,57},{53,50},{51.5f,37},{50,43}
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ self.ConstPositions = new[] {
|
|
|
+ new List<Vector2>(),
|
|
|
+ new List<Vector2>(),
|
|
|
+ new List<Vector2>()};
|
|
|
+ for(int i = 0; i < POS.GetLength(0); i++)
|
|
|
+ {
|
|
|
+ for(int j = 0; j < POS.GetLength(1); j++)
|
|
|
+ {
|
|
|
+ self.ConstPositions[i].Add(new Vector2(POS[i,j,0], POS[i,j,1]));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 初始化场景数据
|
|
|
/// </summary>
|
|
|
/// <param name="self"></param>
|
|
|
- public static void Init(this Map self)
|
|
|
+ public static void Reset(this Map self)
|
|
|
{
|
|
|
self.UnitPlayers.Clear();
|
|
|
self.TotalLikeNum = 0;
|
|
@@ -70,6 +106,7 @@ namespace ET.Server
|
|
|
self.DeadUnitPlayer.Clear();
|
|
|
self.IsGameOver = false;
|
|
|
self.CurBattleIndex = 0;
|
|
|
+ self.InitSth();
|
|
|
}
|
|
|
|
|
|
public static ZoneManagerPrx GetZoneManager(this Map self)
|
|
@@ -462,8 +499,15 @@ namespace ET.Server
|
|
|
/// <returns></returns>
|
|
|
public static Vector2 GetRandomPlayerPos(this Map self)
|
|
|
{
|
|
|
- Vector2[] TowerPos = { new Vector2() { X = 103, Y = 197 }, new Vector2() { X = 190, Y = 133 }, new Vector2() { X = 104, Y = 69 } };
|
|
|
int index = self.CurBattleIndex;
|
|
|
+ if (self.ConstPositions[index].Count > 0)
|
|
|
+ {
|
|
|
+ var pos = self.ConstPositions[index][0];
|
|
|
+ self.ConstPositions[index].RemoveAt(0);
|
|
|
+ return pos;
|
|
|
+ }
|
|
|
+
|
|
|
+ Vector2[] TowerPos = { new Vector2() { X = 103, Y = 197 }, new Vector2() { X = 190, Y = 133 }, new Vector2() { X = 104, Y = 69 } };
|
|
|
Vector2 tower = TowerPos[index];
|
|
|
Random rand = new Random();
|
|
|
float r;
|