|
@@ -1,4 +1,6 @@
|
|
|
-namespace ET.Server
|
|
|
+using System;
|
|
|
+
|
|
|
+namespace ET.Server
|
|
|
{
|
|
|
/// <summary>
|
|
|
/// 抖音推送回调, 评论
|
|
@@ -54,11 +56,17 @@
|
|
|
|
|
|
string[] pos = map.GetCurXY().Split(";");
|
|
|
|
|
|
+ Random rand = new Random();
|
|
|
+ float r = (float)Math.Sqrt(rand.Next(2304)) + 12;
|
|
|
+ double ang = rand.Next(40) / 180.0f * Math.PI + Math.PI/2.0f + Math.PI;
|
|
|
+ float x = int.Parse(pos[0]) + (float)(r * Math.Cos(ang));
|
|
|
+ float y = int.Parse(pos[1]) - (float)(r * Math.Sin(ang));
|
|
|
+
|
|
|
Struct.MonsterUnit unit = new Struct.MonsterUnit();
|
|
|
unit.id = templateId;
|
|
|
unit.force = 1;
|
|
|
- unit.x = int.Parse(pos[0]);
|
|
|
- unit.y = int.Parse(pos[1]);
|
|
|
+ unit.x = (int)x;
|
|
|
+ unit.y = (int)y;
|
|
|
unit.autoGuard = true;
|
|
|
|
|
|
int objId = await map.AddUnits(unit, true);
|