Esempio n. 1
0
        //---------------------------------------------------
        // ItemSpeedDecisionFunc
        //---------------------------------------------------
        int ItemSpeedDecisionFunc(ItemSpawnData item)
        {
            List <CharacterModel.Data> playerList = GetTeamCharacterDataList(TEAM_TYPE.PLAYER);
            float length         = 1000;
            int   executeActorId = -1;
            StateMachine <CHARACTER_MOVE_STATE> stateMachine;

            foreach (CharacterModel.Data character in playerList)
            {
                if (_getReservItemList.ContainsValue(character.ActorId) ||
                    character.Hp <= 0)
                {
                    continue;
                }

                stateMachine = _characterStateList [character.ActorId];
                CHARACTER_MOVE_STATE state = stateMachine.CurrentStateKey;

                if (length > (character.BlockPos - item.BlockPos).magnitude &&
                    state == CHARACTER_MOVE_STATE.ATTACK)
                {
                    executeActorId = character.ActorId;
                }
            }

            return(executeActorId);
        }
Esempio n. 2
0
        //---------------------------------------------------
        // ItemRecoverDecisionFunc
        //---------------------------------------------------
        int ItemRecoverDecisionFunc(ItemSpawnData item)
        {
            List <CharacterModel.Data> playerList = GetTeamCharacterDataList(TEAM_TYPE.PLAYER);
            int   executeActorId = -1;
            float hpRate         = 1;
            StateMachine <CHARACTER_MOVE_STATE> stateMachine;

            foreach (CharacterModel.Data character in playerList)
            {
                if (_getReservItemList.ContainsValue(character.ActorId) ||
                    character.Hp <= 0)
                {
                    continue;
                }

                stateMachine = _characterStateList [character.ActorId];
                CHARACTER_MOVE_STATE state = stateMachine.CurrentStateKey;
                float dstHpRate            = character.Hp / character.MaxHp;

                if (hpRate > dstHpRate &&
                    state == CHARACTER_MOVE_STATE.ATTACK)
                {
                    hpRate         = dstHpRate;
                    executeActorId = character.ActorId;
                }
            }

            return(executeActorId);
        }
Esempio n. 3
0
        //---------------------------------------------------
        // ItemSpawnCallback
        //---------------------------------------------------
        override public void ItemSpawnCallback(ItemSpawnData itemData)
        {
            if (itemData.ItemType == ItemData.ITEM_TYPE.ATTACK_UP)
            {
                //Debug.Log("攻撃力アップアイテム");
            }
            else if (itemData.ItemType == ItemData.ITEM_TYPE.SPEED_UP)
            {
                //Debug.Log("スピードアップアイテム");
            }
            else if (itemData.ItemType == ItemData.ITEM_TYPE.HP_RECOVER)
            {
                //Debug.Log("回復アイテム");
            }

            //生成された位置
            //Debug.Log(itemData.BlockPos);
        }
Esempio n. 4
0
        //---------------------------------------------------
        // MoveUpdateGetItemAttackState
        //---------------------------------------------------
        void CharacterGetItemMoveStateEnter(StateData data)
        {
            CharacterModel.Data character = GetAliveActor(_currentActorId, TEAM_TYPE.PLAYER);

            if (character == null)
            {
                return;
            }

            int itemActorId = (int)data.table["itemActorId"];
            int index       = _stageItemDataList.FindIndex(obj => obj.ActorId == itemActorId);

            if (index < 0)
            {
                _characterStateList[_currentActorId].SetNextState(CHARACTER_MOVE_STATE.ATTACK);
            }
            else
            {
                ItemSpawnData  item     = _stageItemDataList[index];
                List <Vector2> moveList = MoveTargetBlock(character.ActorId, item.BlockPos);
                data.table = Common.CreateHashTable("itemActorId", item.ActorId, "moveList", moveList);
            }
        }
Esempio n. 5
0
 //---------------------------------------------------
 // ItemSpawnCallback
 //---------------------------------------------------
 override public void ItemSpawnCallback(ItemSpawnData itemData)
 {
     x = itemData.BlockPos.x;
     y = itemData.BlockPos.y;
 }
Esempio n. 6
0
 /// <summary>
 /// アイテムがステージ上に出現したときに呼ばれるコールバック
 /// </summary>
 /// <remarks>
 /// スポーン時にしか呼ばれないので注意
 /// </remarks>
 /// <param name="itemData">アイテムデータ</param>
 virtual public void ItemSpawnCallback(ItemSpawnData itemData)
 {
 }
Esempio n. 7
0
 //---------------------------------------------------
 // ItemSpawnCallback
 //---------------------------------------------------
 override public void ItemSpawnCallback(ItemSpawnData itemData)
 {
 }
Esempio n. 8
0
 //---------------------------------------------------
 // ItemSpawnCallback
 //---------------------------------------------------
 override public void ItemSpawnCallback(ItemSpawnData itemData)
 {
     _stageItemDataList.Add(itemData);
 }
Esempio n. 9
0
 //---------------------------------------------------
 // ItemSpawnCallback
 //---------------------------------------------------
 override public void ItemSpawnCallback(ItemSpawnData itemData)
 {
     ItemPos.Add(itemData.BlockPos);
 }
Esempio n. 10
0
 public void SetItemData(ItemSpawnData data)
 {
     IsItemData = data;
 }
Esempio n. 11
0
 override public void ItemSpawnCallback(ItemSpawnData itemData)
 {
     SetItemData(itemData);
     //IsSetItem = true;
 }