102 lines
3.2 KiB
C#
Executable File
102 lines
3.2 KiB
C#
Executable File
using System;
|
|
using Cal.DataTable;
|
|
using ET.EventType;
|
|
|
|
namespace ET
|
|
{
|
|
public partial class GlobalMethod
|
|
{
|
|
[DataTableMethod]
|
|
public static async ETTask ActiveStarSoulCopy(object arg)
|
|
{
|
|
try
|
|
{
|
|
ActiveArgs args = arg.As<ActiveArgs>();
|
|
var unit = args.unit;
|
|
if (!unit.IsTeamLeader)
|
|
return;
|
|
if (unit.teamState != TeamState.None)
|
|
return;
|
|
string[] param = args.param;
|
|
byte type = byte.Parse(param[0]);
|
|
byte difficulty = byte.Parse(param[1]);
|
|
int sceneId = type switch
|
|
{
|
|
1 => Sys_SceneId.Scene_StarSoulCopyA,
|
|
2 => Sys_SceneId.Scene_StarSoulCopyB,
|
|
3 => Sys_SceneId.Scene_StarSoulCopyC,
|
|
4 => Sys_SceneId.Scene_StarSoulCopyD,
|
|
5 => Sys_SceneId.Scene_StarSoulCopyE,
|
|
_ => throw new ArgumentOutOfRangeException()
|
|
};
|
|
var config = unit.GetOrAddComponent<StarSoulCopyConfigComponent>();
|
|
config.type = type;
|
|
config.difficulty = difficulty;
|
|
Game.EventSystem.Publish(new ChangeMap() { unit = unit, mapId = sceneId * 100 + 1 });
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Log.Error(e);
|
|
}
|
|
}
|
|
|
|
[DataTableMethod]
|
|
public static async ETTask ActiveWorldBossCopy(object arg)
|
|
{
|
|
try
|
|
{
|
|
ActiveArgs args = arg.As<ActiveArgs>();
|
|
var unit = args.unit;
|
|
if (!unit.IsTeamLeader)
|
|
return;
|
|
if (unit.teamState != TeamState.None)
|
|
return;
|
|
Game.EventSystem.Publish(new ChangeMap() { unit = unit, mapId = Sys_SceneId.Scene_WorldBoss * 100 + 1 });
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Log.Error(e);
|
|
}
|
|
}
|
|
|
|
[DataTableMethod]
|
|
public static async ETTask ActiveIdleBattle(object arg)
|
|
{
|
|
try
|
|
{
|
|
Log.Info("ActiveIdleBattle");
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Log.Error(e);
|
|
}
|
|
}
|
|
|
|
[DataTableMethod]
|
|
public static async ETTask ActiveXXCopy(object arg)
|
|
{
|
|
try
|
|
{
|
|
ActiveArgs args = arg.As<ActiveArgs>();
|
|
var unit = args.unit;
|
|
if (!unit.IsTeamLeader)
|
|
return;
|
|
if (unit.teamState != TeamState.None)
|
|
return;
|
|
string[] param = args.param;
|
|
int level = int.Parse(param[0]);
|
|
|
|
// var config = unit.GetOrAddComponent<StarSoulCopyConfigComponent>();
|
|
// config.type = type;
|
|
// config.difficulty = difficulty;
|
|
|
|
int sceneId = Sys_SceneId.Scene_Beach;
|
|
Game.EventSystem.Publish(new ChangeMap() { unit = unit, mapId = sceneId * 100 + 1 });
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Log.Error(e);
|
|
}
|
|
}
|
|
}
|
|
} |