예제 #1
0
    public override bool Execute()
    {
        SM.SceneRoom room       = SM.RandomRoomLevel.Singleton.LookupRoom(RoomGUID);
        Actor        eventActor = BattleArena.Singleton.m_blackBoard.GetBlackBoardActor("DropItemActor");

        foreach (var dropItemData in mDropItemDataList)
        {
            //掉落Func
            if ((ID)dropItemData.mDropItemId == ID.key)
            {
                DropItemPerformanceType itemType = new DropItemPerformanceType();
                itemType.m_intParam    = (int)dropItemData.mDropItemId;
                itemType.m_deadPos     = new Vector3(eventActor.MainObj.transform.position.x, eventActor.MainObj.transform.position.y, eventActor.MainObj.transform.position.z);
                itemType.m_eulerAngles = new Vector3(eventActor.MainObj.transform.localEulerAngles.x, eventActor.MainObj.transform.localEulerAngles.y, eventActor.MainObj.transform.localEulerAngles.z);
                MainGame.Singleton.StartCoroutine(DropItemPerformance.Singleton.LoadDropItem(itemType));
                BattleArena.Singleton.KeyCount += 1;
            }
            else
            {
//                 dropItemData.mTrapData.position = new Vector3(eventActor.MainObj.transform.position.x, eventActor.MainObj.transform.position.y, eventActor.MainObj.transform.position.z);
//                 SM.TrapRefresh.SpawnMe(room, dropItemData.mTrapData);
            }
        }
        return(true);
    }
예제 #2
0
 //RoomElement m_ele = null;
 //MonsterRoomData m_monsterData = null;
 public TrapRefresh(Transform trans, SceneRoom room, TrapData trapData)
 {
     m_refreshType = ENRefreshType.enTrapRefresh;
     m_room        = room;
     m_ObjectPred  = trans;
     m_trapData    = trapData;
 }
예제 #3
0
    public override bool Execute()
    {
        if (base.Execute())
        {
            SM.SceneRoom curRoom = SM.RandomRoomLevel.Singleton.LookupRoom(RoomGUID);
            if (null == curRoom)
            {
                return(false);
            }
            foreach (var item in mGateDataList)
            {
                switch (item.mGateType)
                {
                case ENGateType.specifiedGate:
                    SM.Gate gate = curRoom.CurRoomInfo.GetGate(item.mGateId);
                    if (gate.isGateOpen)
                    {
                        if (gate.OutIsActive != item.mGateAction)
                        {
                            curRoom.RoomOperateGate(gate, gate.gateDirectionIndex, item.mGateAction);
                        }
                    }
                    break;

                default:
                    break;
                }
            }

            return(true);
        }
        return(false);
    }
예제 #4
0
    public override bool Execute()
    {
        //if (IsEnabled)
        {
            SM.SceneRoom room = SM.RandomRoomLevel.Singleton.LookupRoom(RoomGUID);
            foreach (var trapData in mTrapDataList)
            {
                Actor trapActor = null;// GetTrapActor(trapData.mTrapType);//room.GetTrapByID(trapData.mTrapId);
                switch (trapData.mTrapType)
                {
                case ENTrapType.enSpecial:
                    trapActor = room.GetTrapByID(trapData.mTrapId);
                    break;

                default:
                    break;
                }
                if (trapActor == null)
                {
                    return(false);
                }
                Trap trap = trapActor as Trap;
                trap.SetTrapState(trapData.mTrapState);
            }
        }
        return(true);
    }
예제 #5
0
 /// <summary>
 /// ////////////////////////////////////////////////////////////////////////////////
 /// </summary>
 public SceneRoom(SceneRoomInfoTree curRoomInfo, SceneRoom preRoom)
 {
     CurRoomInfo      = curRoomInfo;
     ID               = CurRoomInfo.m_GUID;
     m_curMonstersNum = 0;
     m_preRoom        = preRoom;
 }
예제 #6
0
 public ActorRefresh(Transform trans, SceneRoom room)
 {
     m_refreshType = ENRefreshType.enActorRefresh;
     m_room        = room;
     m_ele         = trans.gameObject.GetComponent <RoomElement>();
     m_monsterData = m_ele.MonsterData;
 }
예제 #7
0
    public override void Tick()
    {
        base.Tick();
        SM.SceneRoom room = SM.RandomRoomLevel.Singleton.LookupRoom(RoomId);
        if (null != room)
        {
            SM.Gate curGateData = room.GetGateByID(mGateId);
            if (null != curGateData)
            {
                switch (mGateActiveType)
                {
                case GateActiveType.enOpen:
                    if (curGateData.OutIsActive)
                    {
                        IsEnabled = true;
                    }
                    break;

                case GateActiveType.enClose:
                    if (!curGateData.OutIsActive)
                    {
                        IsEnabled = true;
                    }
                    break;

                default:
                    break;
                }
            }
        }
    }
예제 #8
0
    public override void Tick()
    {
        base.Tick();
        SM.SceneRoom room = SM.RandomRoomLevel.Singleton.LookupRoom(RoomId);
        if (null != room)
        {
//             Actor tmpActor = room.GetMonsterByID(MonsterId);
            //int monsterUsedCount = tmpActor.Get
        }
    }
예제 #9
0
 public override bool Execute()
 {
     if (IsEnabled)
     {
         SM.SceneRoom room = SM.RandomRoomLevel.Singleton.LookupRoom(RoomGUID);
         SM.Gate      gate = room.GetGateByID(gateId);
         room.RoomOperateGate(gate, gate.gateDirectionIndex, gateActive);
     }
     return(true);
 }
예제 #10
0
        public static void SpawnMe(SceneRoom room, TrapData trapData)
        {
            string     objName  = "trap_" + trapData.trapId + "_" + trapData.trapObjId;
            GameObject childObj = new GameObject(objName);

            childObj.transform.parent        = room.m_parentObj.transform;
            childObj.transform.localPosition = new Vector3(trapData.position.x * SM.SceneRoom.blockWidth, 0f, trapData.position.z * SM.SceneRoom.blockHeight);
            TrapRefresh trap = new TrapRefresh(childObj.transform, room, trapData);

            room.m_trapRefreshList.Add(trap);
        }
예제 #11
0
 public override void Tick()
 {
     base.Tick();
     SM.SceneRoom room = SM.RandomRoomLevel.Singleton.LookupRoom(RoomId);
     if (null != room)
     {
         if (room.SkillAllMonster())
         {
             IsEnabled = true;
         }
     }
 }
예제 #12
0
    public override void Tick()
    {
        base.Tick();
        SM.SceneRoom room = SM.RandomRoomLevel.Singleton.LookupRoom(RoomId);
        if (null != room)
        {
            bool tmpIsEnable = true;
            foreach (var hpData in mHPEventDataList)
            {
                mCurActor = GetEventActor(hpData.mNpcId, (ENActorType)hpData.mNpcType);
                float tmpCurActorHp = 0;
                float tmpCurMaxHp   = 1000;
                if (mCurActor != null)
                {
                    tmpCurActorHp = mCurActor.HP;
                    tmpCurMaxHp   = mCurActor.MaxHP;
                }
                else
                {
                    SM.ActorRefresh actorRefuresh = room.GetActorRefreshById(hpData.mNpcId);
                    if (actorRefuresh != null)
                    {
                        tmpIsEnable = false;
                        break;
                    }
                    else
                    {
                        continue;
                    }
                }
                switch (hpData.mCompareType)
                {
                case ENCompareType.enValueLower:
                    tmpIsEnable = tmpCurActorHp < hpData.mHPValue;
                    break;

                case ENCompareType.enPercentLower:
                    tmpIsEnable = (tmpCurActorHp / tmpCurMaxHp) * 100 < hpData.mHPValue;
                    break;
//                     case ENCompareType.enValueGreater:
//                         IsEnabled = tmpCurActorHp > hpData.mHPValue;
//                         break;

//                     case ENCompareType.enPercentGreater:
//                         IsEnabled = (tmpCurActorHp / mCurActor.MaxHP) > hpData.mHPValue;
//                         break;
                default:
                    break;
                }
            }
            IsEnabled = tmpIsEnable;
        }
    }
예제 #13
0
    public override bool Execute()
    {
//        if (IsEnabled)
        {
            //刷新怪物
            //SM.ActorRefresh.RefreshCondDict.Add(mConditionID, true);
            SM.SceneRoom room = SM.RandomRoomLevel.Singleton.LookupRoom(RoomGUID);
            foreach (var refreshData in mRefreshMosterDataList)
            {
                SM.ActorRefresh actorRefuresh = room.GetActorRefreshById(refreshData.mMonsterId);
                if (actorRefuresh == null)
                {
                    continue;
                }
                actorRefuresh.SpawnMe();

                Actor sourceActor = null;
                switch (refreshData.mSwapPosType)
                {
                case ENSwapPosType.PlayerPositionOffset:
                    sourceActor = ActorManager.Singleton.MainActor;
                    break;

                case ENSwapPosType.triggerPositionOffset:
                    sourceActor = BattleArena.Singleton.m_blackBoard.GetBlackBoardActor("CurActor");
                    break;

                case ENSwapPosType.TargetActorOfTriggeringActor:
                    sourceActor = BattleArena.Singleton.m_blackBoard.GetBlackBoardActor("TargetActor");
                    break;

                case ENSwapPosType.CustomBlackboardStr:
                    sourceActor = BattleArena.Singleton.m_blackBoard.GetBlackBoardActor(refreshData.mBlackBoardActorStr);
                    break;

                case ENSwapPosType.ObjectPositionOffset:
                    sourceActor = room.GetMonsterByID(refreshData.mSwapActorId);
                    break;

                default:
                    break;
                }
                //Vector3 basePos = sourceActor.RealPos;// GetSwapBasePos(refreshData.mSwapPosType, refreshData.mSwapActorId, refreshData.mBlackBoardActorStr);
                if (sourceActor != null)
                {
                    Vector3 movePos = Vector3.zero;
                    movePos = sourceActor.RealPos + new Vector3(refreshData.mSwapPosX, 0, refreshData.mSwapPosZ);
                    actorRefuresh.m_curMonsterObj.ForceMoveToPosition(movePos);
                }
            }
        }
        return(base.Execute());
    }
예제 #14
0
    public Actor GetSpecialNPC(int actorId)
    {
        SM.SceneRoom curRoom = SM.RandomRoomLevel.Singleton.LookupRoom(RoomId);
        if (curRoom == null)
        {
            return(null);
        }
        Actor sourceActor = curRoom.GetMonsterByID(actorId);

        if (sourceActor == null)
        {
            return(null);
        }
        return(sourceActor);
    }
예제 #15
0
 //从黑板上Actor数据的字典中获取Actor数据
 public Actor GetBlackBoardActor(string actorStr)
 {
     SM.BlackBoardActorData blackBoardActorData = mDicBlackActor[actorStr];
     SM.SceneRoom           room = SM.RandomRoomLevel.Singleton.LookupRoom(blackBoardActorData.roomID);
     if (null != room)
     {
         if (blackBoardActorData.mBlackActorType == BlackActorType.enNPC)
         {
             return(room.GetMonster(blackBoardActorData.actorID));
         }
         else if (blackBoardActorData.mBlackActorType == BlackActorType.enBox)
         {
             return(room.GetTreatureByID(blackBoardActorData.actorID));
         }
     }
     return(null);
 }
예제 #16
0
    public override void Tick()
    {
        base.Tick();
        SM.SceneRoom room = SM.RandomRoomLevel.Singleton.LookupRoom(RoomId);

        if (null != room)
        {
            foreach (var item in mEventTrapDataList)
            {
                Actor tmpActor = room.GetTrapByID(item.mTrapId);
                if (null != tmpActor)
                {
                    Trap trap = tmpActor as Trap;
                    if (trap.mTrapState == item.mTrapState)
                    {
                        IsEnabled = true;
                    }
                }
            }
        }
    }
예제 #17
0
 public override void Tick()
 {
     base.Tick();
     SM.SceneRoom room = SM.RandomRoomLevel.Singleton.LookupRoom(RoomId);
     if (null != room)
     {
         foreach (var boxId in BoxIdList)
         {
             Actor treasureActor = room.GetTreatureByID(boxId);
             mCurActor = treasureActor;
             if (treasureActor == null)
             {
                 IsEnabled = true;
                 return;
             }
             NPC tracsure = treasureActor as NPC;
             if (tracsure.IsDead)
             {
                 IsEnabled = true;
             }
         }
     }
 }
예제 #18
0
    public bool AutoPathing()
    {
        if (m_curSceneRoom == null)
        {//监测当前所站立位置死否有房间
            return(false);
        }
        if (!m_curSceneRoom.IsOpenState)
        {//监测当前房间是否开门
            return(false);
        }
        if (Self.ActionControl.IsActionRunning(ActorAction.ENType.enStandAction) && m_autoMove)
        {//监测当前是否在站立状态
            m_autoMove = false;
        }
        else if (Self.ActionControl.IsActionRunning(ActorAction.ENType.enMoveAction))
        {//检测是否在移动状态
            MoveAction action = Self.ActionControl.LookupAction(ActorAction.ENType.enMoveAction) as MoveAction;
            if (action.IsStopMove && m_autoMove)
            {//在移动状态停止移动
                m_autoMove = false;
            }
        }
        if (m_autoMove)
        {
            return(false);
        }
        SM.SceneRoom curSceneRoom    = m_curSceneRoom;
        AutoMoveRoom curRoomMoveData = GetAutoMoveRoomData(curSceneRoom.ID);
        int          moveToRoomID    = -1;
        bool         noRoomCanTo     = true;

        for (int i = 0; i < curSceneRoom.CurRoomInfo.m_gateList.Count; i++)
        {//遍历当前房间闸门
            SM.Gate curGate = curSceneRoom.CurRoomInfo.m_gateList[i];
            if (curGate.GateToRoomObjID == -1)
            {
                continue;
            }
            if (!curGate.OutIsActive)
            {//检测当前房间房间门是否开放
                noRoomCanTo = false;
                continue;
            }
            if (curRoomMoveData.NeedToSearch(curGate.gateId))
            {//检测当前闸门是否还用再去探索
                continue;
            }
            moveToRoomID = curGate.GateToRoomObjID;
            break;
        }

        if (moveToRoomID == -1)
        {//闸门没有可去的那么返回上一个房间
            SM.SceneRoom preRoom = m_curSceneRoom.m_preRoom;
            if (preRoom == null)
            {
                return(false);
            }
            moveToRoomID = preRoom.ID;
            if (noRoomCanTo)
            {
                for (int i = 0; i < preRoom.CurRoomInfo.m_gateList.Count; i++)
                {
                    SM.Gate gate = preRoom.CurRoomInfo.m_gateList[i];
                    if (gate.GateToRoomObjID == curSceneRoom.ID)
                    {//将上一个房间通向这个房间的闸门标记为不再探索
                        GetAutoMoveRoomData(moveToRoomID).AcceptGatePathList(gate.gateId);
                    }
                }
            }
        }
        FindPathLogicData logicData = ScenePathfinder.Singleton.FindRoomNode(m_curSceneRoom.CurRoomInfo.m_GUID);

        foreach (FindPathLogicData.LinkInfo linkData in logicData.m_links)
        {
            foreach (FindPathLogicData.LinkInfo linkData1 in linkData.m_linkRoom.m_links)
            {
                if (linkData1.m_linkRoom.GUID == moveToRoomID)
                {
                    ActionMoveTo(linkData1.m_linkPos);
                    m_autoMove = true;
                    return(true);
                }
            }
        }
        return(false);
    }
예제 #19
0
    public override void Tick()
    {
        base.Tick();
        SM.SceneRoom room = SM.RandomRoomLevel.Singleton.LookupRoom(RoomId);
        if (null != room)
        {
            bool tmpIsEnabled = true;
            foreach (var mosterData in mDeadMonsterList)
            {
//                 if (!room.IsMonsterDead(mosterData.actorId))
//                 {
//                     return;
//                 }
                Actor tmpActor = null;// room.GetMonsterByID(mosterData.actorId);
                switch (mosterData.actorType)
                {
                case ENDeadActorType.enMainPlayer:
                    tmpActor = ActorManager.Singleton.MainActor;
                    break;

                case ENDeadActorType.enSpicalNpc:
                    tmpActor = room.GetMonster(mosterData.actorId);
                    break;

                default:
                    break;
                }

                bool tmpActorIsDead = false;
                if (tmpActor == null)
                {
                    SM.ActorRefresh actorRefuresh = room.GetActorRefreshById(mosterData.actorId);
                    if (actorRefuresh == null)
                    {
                        tmpActorIsDead = true;
                    }
                }
                else if (tmpActor.IsRealDead)
                {
                    tmpActorIsDead = true;
                }
                if (tmpActorIsDead)
                {
                    if (!mDeadOrderList.Contains(mosterData.actorId))
                    {
                        mDeadOrderList.Add(mosterData.actorId);
                    }
                }
                else
                {
                    tmpIsEnabled = false;
                    break;
                }
            }
            if (tmpIsEnabled)
            {
                SM.BlackBoardActorData tmpActorData = new SM.BlackBoardActorData();
                tmpActorData.roomID          = RoomId;
                tmpActorData.actorID         = mDeadOrderList[mDeadOrderList.Count - 1];
                tmpActorData.mBlackActorType = LevelBlackboard.BlackActorType.enNPC;
                mCurActor = tmpActorData;// mDeadOrderList[mDeadOrderList.Count - 1];
                IsEnabled = true;
            }
        }
    }