void StopAction() { BattleOperation msg = new BattleOperation(); msg.Opera = EPlayerOpera.EpoStop; App.my.gameNetwork.Send(ProtoId.PidBattleOperaReq, msg); }
void TraceUnit(ulong targetId) { BattleOperation msg = new BattleOperation(); msg.Opera = EPlayerOpera.EpoTrace; msg.TargetId = targetId; App.my.gameNetwork.Send(ProtoId.PidBattleOperaReq, msg); }
void TryMoveToPos(Vector3 pos) { BattleOperation msg = new BattleOperation(); msg.Opera = EPlayerOpera.EpoMove; msg.Pos = new PBVector2() { X = pos.x, Y = pos.z }; App.my.gameNetwork.Send(ProtoId.PidBattleOperaReq, msg); }
void CastSkill(ESkillSlot skillSlot, ulong targetId, Vector3 pos) { BattleOperation msg = new BattleOperation(); msg.Opera = EPlayerOpera.EpoCastSkill; msg.TargetId = targetId; msg.Pos = new PBVector2() { X = pos.x, Y = pos.z }; msg.SkillSlot = skillSlot; App.my.gameNetwork.Send(ProtoId.PidBattleOperaReq, msg); }
private void DoAttacking() { var ops = Unary.OperationsManager; if (BattleOperation == null) { BattleOperation = new BattleOperation(ops); } BattleOperation.EnemyPriorities.Clear(); foreach (var player in Unary.PlayersModule.Players.Values.Where(p => p.Stance == PlayerStance.ENEMY)) { foreach (var unit in player.Units.Where(u => u.Visible && u[ObjectData.HITPOINTS] > 0 && u.GetData(ObjectData.CATEGORY) == 70)) { BattleOperation.EnemyPriorities.Add(unit, 1); } } Unary.Log.Info($"StrategyManager: {BattleOperation.EnemyPriorities.Count} enemies"); if (BattleOperation.EnemyPriorities.Count == 0) { BattleOperation.ClearUnits(); return; } foreach (var unit in BattleOperation.Manager.FreeUnits.Where(u => u.GetData(ObjectData.CMDID) == (int)CmdId.MILITARY).ToList()) { BattleOperation.AddUnit(unit); } foreach (var scouting in BattleOperation.Manager.Operations.OfType <ScoutOperation>()) { foreach (var unit in scouting.Units.ToList()) { BattleOperation.AddUnit(unit); } } }
void SendBattleOpera(EBattleOperation opera, ulong targetId, Vector3 pos) { BattleOperation msg = new BattleOperation(); msg.Opera = opera; msg.TargetId = targetId; if (null != pos) { msg.Pos = new PBVector2() { X = pos.x, Y = pos.z }; Vector3 tmp_dir = pos - mainHero.pos; msg.Dir = Vector2.SignedAngle(Vector2.up, new Vector2(tmp_dir.x, tmp_dir.z)); } if (null != pos) { } App.my.gameNetwork.Send(ProtoId.PidBattleOperaReq, msg); }
public void SetRelativeBattleOperation(BattleOperation NewRelativeBattleOperation) { RelativeBattleOperation = NewRelativeBattleOperation; }