コード例 #1
0
ファイル: Scene.cs プロジェクト: clear1oveseven/Utopia
    void StopAction()
    {
        BattleOperation msg = new BattleOperation();

        msg.Opera = EPlayerOpera.EpoStop;
        App.my.gameNetwork.Send(ProtoId.PidBattleOperaReq, msg);
    }
コード例 #2
0
ファイル: Scene.cs プロジェクト: clear1oveseven/Utopia
    void TraceUnit(ulong targetId)
    {
        BattleOperation msg = new BattleOperation();

        msg.Opera    = EPlayerOpera.EpoTrace;
        msg.TargetId = targetId;
        App.my.gameNetwork.Send(ProtoId.PidBattleOperaReq, msg);
    }
コード例 #3
0
ファイル: Scene.cs プロジェクト: clear1oveseven/Utopia
    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);
    }
コード例 #4
0
ファイル: Scene.cs プロジェクト: clear1oveseven/Utopia
    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);
    }
コード例 #5
0
ファイル: StrategyManager.cs プロジェクト: 01010100b/AoE2Lib
        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);
                }
            }
        }
コード例 #6
0
    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);
    }
コード例 #7
0
 public void SetRelativeBattleOperation(BattleOperation NewRelativeBattleOperation)
 {
     RelativeBattleOperation = NewRelativeBattleOperation;
 }