Exemplo n.º 1
0
        /// <summary>
        /// Decodes the <see cref="Message" />, using the <see cref="Reader" /> instance.
        /// </summary>
        internal override void Decode()
        {
            // 10-0F-00-01-01-00-00-00-06-42-65-72-6B-61-6E-10-0A-00-00-00-00-00-00-01-31-10-07-00-00-00-00-00-00-01-32-10-03-00-00-00-00-00-00-01-33-10-03-00-01-00-00-00-00-01-34-10-06-00-01-00-00-00-00-01-35

            this.Reader.ReadVInt();
            this.Reader.ReadVInt();
            this.Reader.ReadVInt();
            this.Reader.ReadVInt(); // Negative
            this.Reader.ReadVInt();

            int Count = this.Reader.ReadVInt();

            this.ShowBuffer();

            return;

            for (int i = 0; i < Count; i++)
            {
                BattlePlayer BattlePlayer = new BattlePlayer();

                BattlePlayer.CharacterType = this.Reader.ReadVInt(); // Character Type
                BattlePlayer.CharacterID   = this.Reader.ReadVInt(); // Character ID

                this.Reader.ReadVInt();                              // Unknown

                BattlePlayer.TeamID = this.Reader.ReadVInt();        // is Enemy
                BattlePlayer.isBot  = this.Reader.ReadVInt();        // is Bot

                BattlePlayer.Username = this.Reader.ReadString();    // Name

                this.Players.Add(BattlePlayer);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 开始战斗
        /// </summary>
        public void StartFight()
        {
            scoreT1 = 0;
            scoreT2 = 0;
            status  = Status.Fight;
            GameMessage msg = new GameMessage();

            msg.type = BitConverter.GetBytes((int)Protocol.Fight);

            var battleinfos = new List <BattlePlayer>();

            // 开始计时
            battleTimer.Elapsed += (sender, e) => {
                int winTeam = scoreT1 >= scoreT2 ? 1 : 2;
                UpdateWin(winTeam);
            };
            battleTimer.AutoReset = false;
            battleTimer.Enabled   = true;

            int teamPos1 = 1;
            int teamPos2 = 1;

            lock (playerDic) {
                foreach (Player p in playerDic.Values)
                {
                    BattlePlayer battlePlayer = new BattlePlayer();

                    p.tempData.hp     = 100;
                    battlePlayer.id   = p.id;
                    battlePlayer.team = p.tempData.team;
                    if (p.tempData.team == 1)
                    {
                        p.tempData.swopId   = teamPos1;
                        battlePlayer.swopId = teamPos1++;
                    }
                    else
                    {
                        p.tempData.swopId   = teamPos2;
                        battlePlayer.swopId = teamPos2++;
                    }
                    battlePlayer.playerHp = (int)p.tempData.hp;
                    p.tempData.status     = PlayerTempData.Status.Fight;

                    battleinfos.Add(battlePlayer);
                }

                // 对局时间

                byte[] battlebytes = BitConverter.GetBytes(battleLimitTime);
                byte[] tempBytes   = ProtoTransfer.Serialize(battleinfos);
                byte[] sendbytes   = new byte[tempBytes.Length + battlebytes.Length];
                Array.Copy(battlebytes, 0, sendbytes, 0, battlebytes.Length);
                Array.Copy(tempBytes, 0, sendbytes, battlebytes.Length, tempBytes.Length);
                msg.data = sendbytes;
                //广播Fight协议
                BroadcastTcp(msg);

                // GameStar();
            }
        }
Exemplo n.º 3
0
 private void getPlayer(GameObject go)
 {
     if (player == null)
     {
         player = go.GetComponent <BattlePlayer>();
     }
 }
Exemplo n.º 4
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;
            int          value  = M_SideEffectParam.GetParam_MultipliedInt("AttackValue");

            if (value < 0)
            {
                return(true);
            }
            if (TargetRange == TargetRange.Self) // 对自身
            {
                player.GameManager.GetMech(executorInfo.MechId).M_MechAttack += value;
            }
            else
            {
                player.GameManager.SideEffect_MechAction(
                    delegate(ModuleMech mech) { mech.M_MechAttack += value; },
                    player,
                    0,
                    executorInfo.TargetMechIds,
                    TargetRange,
                    TargetSelect,
                    -1
                    );
            }
            return(true);
        }
Exemplo n.º 5
0
    public void SpawnPlayer(int channelID)
    {
        var          index = Random.Range(0, SpawnPoints.Length);
        var          sp    = SpawnPoints[index];
        var          p     = GameObject.FindGameObjectsWithTag("Player");
        BattlePlayer found = null;

        foreach (var player in p)
        {
            var bp = player.GetComponent <BattlePlayer>();
            if (bp.tno.isMine)
            {
                found = bp;
            }
        }
        if (!found)
        {
            TNManager.Instantiate(channelID, "CreateBattlePlayer", "Prefabs/Player/Battle Network Player - swat", false, sp.transform.position, sp.transform.rotation);
        }
        else
        {
            found.transform.position = sp.transform.position;
            found.transform.rotation = sp.transform.rotation;
            found.GetComponent <Rigidbody>().isKinematic = false;
            found.Respawn();
        }
    }
Exemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     _battlePlayerGameObject          = GameObject.FindGameObjectWithTag(BattlePlayerTag);
     _battlePlayer                    = _battlePlayerGameObject.GetComponent <BattlePlayer>();
     _battlePlayerAnimationController = _battlePlayerGameObject.GetComponent <BattlePlayerAnimationController>();
     _currentHealth                   = PersistentData.data.health;
 }
Exemplo n.º 7
0
        // PRAGMA MARK - Internal
        protected override void Activate()
        {
            PlayerSpawner.SpawnAllPlayers();

            List <GameModeIntroView.Icon> icons = new List <GameModeIntroView.Icon>();

            foreach (Player player in RegisteredPlayers.AllPlayers)
            {
                icons.Add(GameModeIntroView.Icon.Player);
                icons.Add(GameModeIntroView.Icon.Swords);
            }
            icons.RemoveLast();

            BattlePlayerHealth.LaserDamage         = 0;
            BattlePlayerHealth.KnockbackMultiplier = 0.1f;

            GameModeIntroView.Show(DisplayTitle, icons);

            foreach (Player player in RegisteredPlayers.AllPlayers.Where(p => p.IsAI))
            {
                BattlePlayer battlePlayer = PlayerSpawner.GetBattlePlayerFor(player);
                battlePlayer.Rigidbody.constraints |= RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezePositionY | RigidbodyConstraints.FreezePositionZ;
            }

            PlayerSpawner.OnSpawnedPlayerRemoved += HandleSpawnedPlayerRemoved;
        }
Exemplo n.º 8
0
    void Start()
    {
        button = GetComponent <Button>();

        player    = GameObject.FindGameObjectWithTag("Player").GetComponent <BattlePlayer>();
        battleSys = GameObject.FindGameObjectWithTag("BattleSystem").GetComponent <BattleSystem>();
    }
Exemplo n.º 9
0
 /// <summary>
 /// 某个玩家被弹飞
 /// </summary>
 /// <param name="p"></param>
 public void ShootOff(BattlePlayer p)
 {
     if (p != null)
     {
         p.Die();
     }
 }
Exemplo n.º 10
0
        public override void Action()
        {
            base.Action();
            RPGCharacter target = Target();

            if (target == null)
            {
                return;
            }
            EquipWeapon(target.Logic);

            var side      = PositionMath.GetSidewayTilePos(target.GetTileCoord());
            var avSidePos = PositionMath.MoveableAreaPoints.Intersect(side).ToList();

            if (avSidePos.Count == 0)
            {
                return;
            }
            Vector2Int        bestPos  = PositionMath.GetBestTilePos(avSidePos);
            List <Vector2Int> routines = PositionMath.GetMoveRoutine(bestPos);
            var move = AddSequenceEvent <MoveCharacter>();

            move.CameraFollow      = true;
            move.Routine           = routines;
            move.CharacterID       = -1;
            move.WaitUntilFinished = true;
            move.Speed             = EModeSpeed.Normal;

            BattlePlayer.AssembleAttackSequenceEvent(AddSequenceEvent <AttackAnimation>, logic, target.Logic);
        }
Exemplo n.º 11
0
        /// <summary>
        /// 添加一个玩家
        /// </summary>
        /// <param name="p"></param>
        public void AddPlayer(PlayerTask p)
        {
            BattlePlayer player = null;

            if (playerDict.ContainsKey(p.ID))
            {
                player = playerDict[p.ID];
            }
            else
            {
                player = new BattlePlayer();
                //战斗中临时分配的ID
                player.ID = this.GetUserID();
                playerDict.Add(player.ID, player);
            }
            player.Task         = p;
            player.Map          = this.map;
            player.BornPosition = this.map.NextBornPos;
            //
            //
            //
            SceneObjectsMsg msg = new SceneObjectsMsg();

            msg.mine = player;

            List <BattlePlayer> list = new List <BattlePlayer>();

            foreach (var item in this.playerDict)
            {
                list.Add(item.Value);
            }
            msg.others = list;
            this.Broadcast(player, RoomEvent.SCENE_OBJECTS, msg);
        }
Exemplo n.º 12
0
    public GameObject GetPathingTarget(Camp camp, UnitInfo info)
    {
        GameObject   go = null;
        BattlePlayer bp = null;

        for (int i = 0; i < m_BattlePlayerList.Count; i++)
        {
            if (m_BattlePlayerList[i].m_Camp == camp)
            {
                bp = m_BattlePlayerList[i];
                break;
            }
        }
        if (bp != null)
        {
            for (int i = 0; i < bp.m_unitList.Count; i++)
            {
                BaseUnit bu = bp.m_unitList[i].GetComponent <BaseUnit>();
                if ((UnitType)bu.m_UnitInfo.unitType == UnitType.Crystal)
                {
                    go = bp.m_unitList[i];
                    break;
                }
            }
        }

        return(go);
    }
Exemplo n.º 13
0
    public BattlePlayerData(int monsterId, BattlePlayer owner) : base(null, null)
    {
        BattleMonsterTableSetting monster = BattleMonsterTableSettings.Get(monsterId);

        if (monster == null)
        {
            Debug.LogError("怪物表格配置错误");
            return;
        }
        m_CurrentCardList = new List <BattleCardData>(CardList);
        AP       = 0;
        MaxAP    = 0;
        HP       = monster.HP;
        MaxHP    = monster.MaxHp;
        MP       = monster.MP;
        MaxMP    = monster.MaxMP;
        AP       = monster.AP;
        MaxAP    = monster.MaxAP;
        Level    = monster.Level;
        HeadIcon = monster.IconId;
        for (int i = 0; i < monster.BattleCards.Count; i++)
        {
            m_CardList.Add(new BattleCardData(monster.BattleCards[i], owner));
        }
    }
Exemplo n.º 14
0
        private void Cleanup()
        {
            CancelAnimation();

            if (battlePlayer_ != null)
            {
                battlePlayer_.DustParticleSystem.gameObject.SetActive(true);
                SetAlpha(1.0f);
                foreach (Renderer r in battlePlayer_.BodyRenderers)
                {
                    Color diffuseColor = r.material.GetColor("_DiffuseColor");
                    r.material = GameConstants.Instance.PlayerOpaqueMaterial;
                    r.material.SetColor("_DiffuseColor", diffuseColor.WithAlpha(1.0f));
                    r.material.SetFloat("_Metallic", kBaseMetallic);
                    r.shadowCastingMode = ShadowCastingMode.On;
                }
                battlePlayer_ = null;
            }

            if (recyclablePrefab_ != null)
            {
                recyclablePrefab_.OnCleanup -= HandleCleanup;
                recyclablePrefab_            = null;
            }
        }
Exemplo n.º 15
0
 public AttackPattern1(Animator animator, Transform transform, BattlePlayer targetPlayer, Rigidbody rigidbodyComponent) : base(animator, rigidbodyComponent)
 {
     this.animator           = animator;
     this.transform          = transform;
     this.targetObject       = targetPlayer;
     this.rigidbodyComponent = rigidbodyComponent;
 }
Exemplo n.º 16
0
        public override bool IsTrigger(ExecutorInfo ei)
        {
            BattlePlayer player = (BattlePlayer)Player;

            if (ei.CardInstanceId != ExecutorInfo.EXECUTE_INFO_NONE)
            {
                CardBase card = player.HandManager.GetCardByCardInstanceId(ei.CardInstanceId);
                if (card != null)
                {
                    if (card.CardInfo.BaseInfo.CardType != CardTypes.Spell && card.CardInfo.BaseInfo.CardType != CardTypes.Energy)
                    {
                        return(false);
                    }
                }
            }

            foreach (SideEffectBase se in PeekSEE.SideEffectBases)
            {
                if (se is IDamage)
                {
                    if (se.M_SideEffectParam.HasParamCanBeMultiplied())
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Exemplo n.º 17
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;

            player.GameManager.SideEffect_ShipAction(
                delegate(BattlePlayer sp)
            {
                int cardCount = M_SideEffectParam.GetParam_ConstInt("CardCount");
                int copyCount = M_SideEffectParam.GetParam_MultipliedInt("CopyCount");

                if (executorInfo.CardInstanceId != ExecutorInfo.EXECUTE_INFO_NONE)
                {
                    List <int> cardIds = player.HandManager.GetRandomHandCardIds(cardCount, new HashSet <int> {
                        executorInfo.CardInstanceId
                    });

                    foreach (int cardId in cardIds)
                    {
                        player.HandManager.GetTempCardsByID(cardId, copyCount);
                    }
                }
            },
                player,
                ChoiceCount,
                TargetRange,
                TargetSelect,
                executorInfo.TargetClientIds);
            return(true);
        }
    public static int CreateBattlePlayer_s(IntPtr l)
    {
        int result;

        try
        {
            IConfigDataLoader configDataLoader;
            LuaObject.checkType <IConfigDataLoader>(l, 1, out configDataLoader);
            int playerLevel;
            LuaObject.checkType(l, 2, out playerLevel);
            List <TrainingTech> techs;
            LuaObject.checkType <List <TrainingTech> >(l, 3, out techs);
            ulong sessionId;
            LuaObject.checkType(l, 4, out sessionId);
            BattlePlayer o = BattleUtility.CreateBattlePlayer(configDataLoader, playerLevel, techs, sessionId);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Exemplo n.º 19
0
        // 复活玩家
        public void ReLifePlayer(Player player)
        {
            System.Timers.Timer relifeTimer = new System.Timers.Timer(5000);

            // 5秒后执行
            relifeTimer.Elapsed += (sender, e) => {
                if (playerDic[player.id] != null)
                {
                    GameMessage broadMsg = new GameMessage();
                    broadMsg.type = BitConverter.GetBytes((int)Protocol.RelifePlayer);

                    player.tempData.hp = 100;
                    BattlePlayer battlePlayer = new BattlePlayer();
                    battlePlayer.id       = player.id;
                    battlePlayer.team     = player.tempData.team;
                    battlePlayer.swopId   = player.tempData.swopId;
                    battlePlayer.playerHp = ((int)player.tempData.hp);

                    broadMsg.data = ProtoTransfer.Serialize(battlePlayer);
                    BroadcastTcp(broadMsg);
                }
            };

            relifeTimer.AutoReset = false;
            relifeTimer.Enabled   = true;
        }
Exemplo n.º 20
0
 private void HandlePlayerShotLaser(Laser laser, BattlePlayer battlePlayer)
 {
     foreach (BattlePlayer p in PlayerSpawner.AllSpawnedBattlePlayers)
     {
         ghostModeAddOns_[p].AnimateAlpha(kAlphaLevel, kAlphaShootDuration);
     }
 }
Exemplo n.º 21
0
 // PRAGMA MARK - Public Interface
 public void Init(BattlePlayer player, float timeLeft = kExplosiveTime)
 {
     player_   = player;
     timeLeft_ = timeLeft;
     ResetPulseTimer();
     enabled_ = true;
 }
Exemplo n.º 22
0
        private void Start()
        {
            if (isDebug)
            {
                Enemy  = debugBattleData.Enemy.CreateBattleEnemy(this);
                Player = debugBattleData.Player.CreateBattlePlayer(this);
            }

            uiView.Setup(this);

            stateController = new StateController <BattlePhase>(
                new List <IState <BattlePhase> >
            {
                new BattleState.Begin(this),
                new BattleState.PlayerTurnStart(this),
                new BattleState.EnemyTurnStart(this),
                new BattleState.PlayerTurnEnd(this),
                new BattleState.EnemyTurnEnd(this),
                new BattleState.PlayerSelectCommand(this),
                new BattleState.EnemySelectCommand(this),
                new BattleState.InvokeCommand(this),
                new BattleState.End(this)
            },
                BattlePhase.Begin
                );
        }
Exemplo n.º 23
0
    public void MakeWindow(BattlePlayer player, List <Enemy> enemylist)
    {
        this.player      = player;
        enemytextlist    = new List <GameObject>();
        commandtextlist  = new List <GameObject>();
        this.enemylist   = enemylist;
        this.commandlist = player.commandlist;
        GameObject canvas = GameObject.Find("Canvas");

        ar  = Instantiate(ArrowPrefab) as GameObject;
        wi  = Instantiate(WindowPrefab) as GameObject;
        wi2 = Instantiate(WindowPrefab2) as GameObject;

        for (int j = 0; j < commandlist.Count; j++)
        {
            co = Instantiate(CommandPrefab) as GameObject;
            co.transform.SetParent(canvas.transform, false);
            co.transform.localPosition    = new Vector3(-1350, -140 - (240 * j), 0);
            co.GetComponent <Text>().text = commandlist[j];
            commandtextlist.Add(co);
        }
        for (int k = 0; k < this.enemylist.Count; k++)
        {
            en = Instantiate(NamePrefab) as GameObject;
            en.transform.SetParent(canvas.transform, false);
            en.transform.localPosition    = new Vector3(300, -100 - (200 * k), 0);
            en.GetComponent <Text>().text = this.enemylist[k].NameGettter();
            enemytextlist.Add(en);
        }
        i    = 0;
        flag = false;
    }
Exemplo n.º 24
0
        public override IEnumerator ActivateSkill(BattlePlayer battlePlayer)
        {
            float buffTime = 0;

            battlePlayer.ChangeSpeed(0.5f);
            GameObject speedUpBuffParticle = ObjectPoolManager.Instance.SkillObjectPool.PopSkillParticle(SkillType.SpeedUpBuff);

            speedUpBuffParticle.transform.position = battlePlayer.transform.position;
            speedUpBuffParticle.SetActive(true);

            while (!speedUpBuffParticle.GetComponent <ParticleSystem>().isStopped)
            {
                buffTime += Time.deltaTime;
                yield return(null);
            }

            speedUpBuffParticle.SetActive(false);
            ObjectPoolManager.Instance.SkillObjectPool.PushSkillParticle(speedUpBuffParticle);

            yield return(new WaitForSeconds(2f - buffTime));

            battlePlayer.ChangeSpeed(-0.5f);

            yield return(null);
        }
Exemplo n.º 25
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;
            int          value  = M_SideEffectParam.GetParam_MultipliedInt("HealValue");

            if (TargetRange == TargetRange.Self) // 对自身
            {
                player.BattleGroundManager.GetMech(executorInfo.MechId).Heal(value);
            }
            else
            {
                player.GameManager.SideEffect_ILifeAction(
                    delegate(ILife life) { life.Heal(value); },
                    player,
                    ChoiceCount,
                    TargetRange,
                    TargetSelect,
                    executorInfo.TargetClientIds,
                    executorInfo.TargetMechIds
                    );
            }
            return(true);
        }
Exemplo n.º 26
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;
            int          value  = M_SideEffectParam.GetParam_MultipliedInt("Energy");
            int          times  = M_SideEffectParam.GetParam_ConstInt("Times");

            player.GameManager.SideEffect_ShipAction(
                delegate(BattlePlayer sp)
            {
                for (int i = 0; i < times; i++)
                {
                    sp.AddEnergy(value);
                }
            },
                player,
                ChoiceCount,
                TargetRange,
                TargetSelect,
                executorInfo.TargetClientIds);
            return(true);
        }
Exemplo n.º 27
0
    public void OnClickButton(string id)
    {
        if (id == "Battle")
        {
            if (nameFieldText.text == "")
            {
                return;
            }

            if (chosenWarriors.Count < 3)
            {
                return;
            }

            BattlePlayer player = new BattlePlayer(nameFieldText.text);
            foreach (WarriorType type in chosenWarriors)
            {
                player.AddWarrior(type);
            }
            controller.SetPlayer(player);
        }
        else if (id == "Back")
        {
            controller.ShowMainMenu();
        }
    }
Exemplo n.º 28
0
        private static void SpawnAIPlayerFor(AISpawnPoint spawnPoint)
        {
            if (AIPlayerExistsFor(spawnPoint))
            {
                Debug.LogWarning("Could not spawn AI player for: " + spawnPoint);
                return;
            }

            BattlePlayer battlePlayer = ObjectPoolManager.Create <BattlePlayer>(GamePrefabs.Instance.PlayerPrefab, spawnPoint.transform.position, Quaternion.identity, parent: ArenaManager.Instance.LoadedArena.GameObject);

            // spawn player with substitute AI
            GameConstants.Instance.ConfigureWithSubstitutePlayerAI(battlePlayer);
            battlePlayer.SetSkin(GameConstants.Instance.EnemySkin);

            RecyclablePrefab          recyclablePrefab  = battlePlayer.GetComponent <RecyclablePrefab>();
            Action <RecyclablePrefab> onCleanupCallback = null;

            onCleanupCallback = (RecyclablePrefab unused) => {
                recyclablePrefab.OnCleanup -= onCleanupCallback;
                RemovePlayer(spawnPoint);
            };
            recyclablePrefab.OnCleanup += onCleanupCallback;

            spawnPointMap_[spawnPoint] = battlePlayer;
        }
Exemplo n.º 29
0
    // Use this for initialization
    void Start()
    {
        this.player = new BattlePlayer(new Player(username, hp, intelligence, itemlist));
        foreach (string str in enemylistname)
        {
            enemylist.Add(new Enemy(
                              (int)UnityEngine.Random.Range(player.HpGetter() * 0.2f, player.HpGetter() * 0.6f),
                              (int)UnityEngine.Random.Range(player.IntGetter() * 0.4f, player.IntGetter() * 0.8f),
                              str
                              ));
        }
        this.hptext = GameObject.Find("HP");
        hptext.GetComponent <Text>().text = player.HpGetter().ToString();
        this.inttext = GameObject.Find("かしこさ");
        inttext.GetComponent <Text>().text = player.IntGetter().ToString();
        this.LogGenerator     = GameObject.Find("LogGenerator");
        this.CommandGenerator = GameObject.Find("CommandGenerator");
        string enemys = "";

        for (int j = 0; j < enemylist.Count; j++)
        {
            if (j > 0)
            {
                enemys += ",";
            }
            enemys += enemylist[j].NameGettter();;
        }
        enemys += "が現れた。";
        LogGenerator.GetComponent <LogGenerator>().BattleStart();
        AddLog(enemys);
        DisplayLog();
    }
Exemplo n.º 30
0
        private IEnumerator CheckDashAttack()
        {
            while (true)
            {
                yield return(new WaitForSeconds(GetRandomCheckAttackDelay()));

                if (!ShouldCheckDashAttack(StateMachine_.Player))
                {
                    continue;
                }

                BattlePlayer target = BattlePlayerUtil.GetClosestEnemyPlayerFor(StateMachine_.Player, whereCondition: (otherPlayer) => {
                    return(!AIUtil.DoesWallExistBetweenXZPoints(StateMachine_.Player.transform.position, otherPlayer.transform.position));
                });
                if (target == null)
                {
                    continue;
                }

                Vector2 playerToTargetVector = BattlePlayerUtil.XZVectorFromTo(StateMachine_.Player, target);

                if (playerToTargetVector.magnitude <= kDashAggroDistance)
                {
                    StateMachine_.SwitchState(AIStateMachine.State.DashAttack);
                }
            }
        }
Exemplo n.º 31
0
    // Update is called once per frame
    void Update()
    {
        switch (battleState)
        {
            case BattleState.waiting:
                if (characterSpeedManager.PlayerProcess())
                {
                    selectedPlayer = characterSpeedManager.selectedPlayer;
                    battleState = BattleState.playerChoosingCommand;
                    break;
                }
                characterSpeedManager.EnemyProcess();
                /*
                for (int i = 0; i < enemyList.Length; i++)
                {
                    if (enemyList[i].gameObject.activeSelf)
                    {
                        enemyList[i].Process();
                    }
                }

                for (int i = 0; i < playerList.Length; i++)
                {
                    if (playerList[i].gameObject.activeSelf)
                    {
                        playerList[i].Process();
                    }
                }
                */
                break;
            case BattleState.playerChoosingCommand:
                ChoosingCommandManagement();
                break;
        }
    }