|
@@ -49,7 +49,7 @@ namespace ET
|
|
|
var rand = new Random();
|
|
|
foreach (var id in units)
|
|
|
{
|
|
|
- var pos = GetRandomPos(2);
|
|
|
+ var pos = GetRandomPos();
|
|
|
session.Call(new C2G_AddUnitsToMap()
|
|
|
{
|
|
|
UnitId = id,
|
|
@@ -64,7 +64,7 @@ namespace ET
|
|
|
rand = new Random();
|
|
|
for (int i = 0; i < 2; i++)
|
|
|
{
|
|
|
- var pos = GetRandomPos(1);
|
|
|
+ var pos = GetRandomPos();
|
|
|
session.Call(new C2G_AddUnitsToMap()
|
|
|
{
|
|
|
UnitId = units2[rand.Next(units2.Length)],
|
|
@@ -79,7 +79,7 @@ namespace ET
|
|
|
rand = new Random();
|
|
|
for (int i = 0; i < 1; i++)
|
|
|
{
|
|
|
- var pos = GetRandomPos(0);
|
|
|
+ var pos = GetRandomPos();
|
|
|
session.Call(new C2G_AddUnitsToMap()
|
|
|
{
|
|
|
UnitId = units3[rand.Next(units3.Length)],
|
|
@@ -146,21 +146,22 @@ namespace ET
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public static int BattleCenterIndex = 0;
|
|
|
private Vector2 vecTemp = new Vector2();
|
|
|
- private Vector2 GetRandomPos(int index)
|
|
|
+ private Vector2 GetRandomPos()
|
|
|
{
|
|
|
Vector2[] TowerPos = { new Vector2(){ X = 103, Y = 197 }, new Vector2() { X = 190, Y = 133 }, new Vector2() { X = 104, Y = 69 } };
|
|
|
|
|
|
- var tower = TowerPos[index];
|
|
|
+ var tower = TowerPos[BattleCenterIndex];
|
|
|
var rand = new Random();
|
|
|
float r;
|
|
|
double ang;
|
|
|
- if(index == 0)
|
|
|
+ if(BattleCenterIndex == 0)
|
|
|
{
|
|
|
r = (float)Math.Sqrt(rand.Next(2500)) + 10;
|
|
|
ang = rand.Next(22) / 180.0f * Math.PI + Math.PI * 78f / 180f + Math.PI;
|
|
|
}
|
|
|
- else if(index == 1)
|
|
|
+ else if(BattleCenterIndex == 1)
|
|
|
{
|
|
|
r = (float)Math.Sqrt(rand.Next(3136)) + 10;
|
|
|
ang = rand.Next(20) / 180.0f * Math.PI + Math.PI * 76f / 180f;
|
|
@@ -177,6 +178,23 @@ namespace ET
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ [Event]
|
|
|
+ public class CameraPlaybleEventHandler : BEvent<CameraPlaybleEvent>
|
|
|
+ {
|
|
|
+ protected override async ETTask OnEvent(CameraPlaybleEvent a)
|
|
|
+ {
|
|
|
+ if (a.Playable == "Camera1_2")
|
|
|
+ {
|
|
|
+ BattleFuncHandler.BattleCenterIndex = 1;
|
|
|
+ }
|
|
|
+ else if (a.Playable == "Camera2_3")
|
|
|
+ {
|
|
|
+ BattleFuncHandler.BattleCenterIndex = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public partial class BattleMgr
|
|
|
{
|