Exemplo n.º 1
0
    public new void defaultAction()
    {
        // Debug.Log("run default aciont");
        if (waitPlan)
        {
            if (this.getGuangBoAction().isPlanSuccess())
            {
                this.sendMessageToPlayer(new string[] { "快点来,我的大刀已经饥渴难耐了。" });
            }
            else
            {
                this.sendMessageToPlayer(new string[] { "你们都不来吗? 那我等会再来问问" });
                waitPlan = false;
            }
        }
        else
        {
            if (this.getTargetRoomList().Count <= 0)
            {
                Debug.Log("随便找个房间看看");
                this.getTargetRoomList().Enqueue(roomContraller.getRandomRoom());
            }
            RoomInterface target = this.getTargetRoomList().Peek();

            if (AutoMoveManager.move(this, roomContraller, eventController, diceRoll, aPathManager, target.getXYZ()))
            {
            }
        }

        endRound();
    }
Exemplo n.º 2
0
    private void P5Move(Character chara, RoomContraller roomContraller, EventController eventController, DiceRollCtrl diceRoll, APathManager aPathManager,
                        RoundController roundController, BattleController battleController)
    {
        Character monster = roundController.getCharaByName(SystemConstant.MONSTER1_NAME);
        string    roomType;
        NPC       npc = (NPC)chara;

        if (this.P5TargetRooms.Count >= 1)
        {
            roomType = this.P5TargetRooms.Peek();
            if (P5Message.Count > 0)
            {
                npc.sendMessageToPlayer(P5Message.Dequeue());
            }
        }
        else
        {
            if (P5Message.Count > 0)
            {
                npc.sendMessageToPlayer(P5Message.Dequeue());
            }

            if (monster.isDead())
            {
                if (P5Message.Count > 0)
                {
                    npc.sendMessageToPlayer(P5Message.Dequeue());
                }
                roomType = roomContraller.getRandomRoom().getRoomType();
            }
            else
            {
                roomType = roomContraller.findRoomByXYZ(monster.getCurrentRoom()).getRoomType();
            }
            this.P5TargetRooms.Enqueue(roomType);
        }
        if (AutoMoveManager.move(chara, roomContraller,
                                 eventController, diceRoll, aPathManager, roomContraller.findRoomByRoomType(roomType).getXYZ()))
        {
            this.P5TargetRooms.Dequeue();

            if (roomType == RoomConstant.ROOM_TYPE_HOSPITAIL_MINITOR)
            {
                npc.sendMessageToPlayer(new string[] { "我在监控室了,这个有台电脑。", "我破解了文件夹,里面有很多照片,有一张很奇怪,大家来看看。" });
            }
            else
            {
                if (!monster.isDead())
                {
                    battleController.fighte(chara, monster);
                    if (monster.isDead())
                    {
                        P1Message.Enqueue(new string[] { "那个蜘蛛怪已经死了!。", "那个萝莉侦探还管不管了啊?" });
                    }
                }
            }
        }
    }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        roomContraller   = FindObjectOfType <RoomContraller>();
        diceRoll         = FindObjectOfType <DiceRollCtrl>();
        eventController  = FindObjectOfType <EventController>();
        roundController  = FindObjectOfType <RoundController>();
        battleController = FindObjectOfType <BattleController>();
        //duiHuaUImanager = FindObjectOfType<DuiHuaUImanager>();
        charaInfoManager = FindObjectOfType <CharaInfoManager>();
        setGuangBoListener(FindObjectOfType <GuangBoListener>());
        guangBoController = FindObjectOfType <GuangBoController>();
        storyController   = FindObjectOfType <StoryController>();
        bss = new BlackSignStory();
        this.setName(SystemConstant.P5_NAME);
        setDistance(-2.0f);
        //游戏一开始 所处的房间 默认房间的坐标为 0,0,0
        int[] roomXYZ;
        setBag(new Bag());
        if (this.neworLoad)
        {
            roomXYZ = new int[] { 0, 0, RoomConstant.ROOM_Z_GROUND };
            setCrazyFlag(false);
            setAbilityInfo(new int[] { 8, 3, 6, 7 });
            setMaxAbilityInfo(new int[] { 8, 3, 6, 7 });
            setActionPointrolled(false);
            setIsDead(false);


            this.setDesc("沉默寡言,不爱说话的黑客.");
            this.waitPlan = false;
            // this.setClickMessage(new string[] { "谁能给我一台电脑?" });
            getTargetRoomList().Enqueue(roomContraller.getRandomRoom());
            getTargetRoomList().Enqueue(roomContraller.findRoomByRoomType(RoomConstant.ROOM_TYPE_DOWNSTAIR_BACK));
        }
        else
        {
            P0 p = loadInfo(this.getName());
            roomXYZ       = p.Xyz;
            this.waitPlan = p.WaitPlan;
            loadInfo(this, p, roomContraller);
        }
        setCurrentRoom(roomXYZ);
        this.roomContraller.findRoomByXYZ(roomXYZ).setChara(this);
        this.roomContraller.setCharaInMiniMap(roomXYZ, this, true);
        this.setClickMessage(this.roomContraller.findRoomByXYZ(roomXYZ).findSomethingNews(this).ToArray());
    }
Exemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        roomContraller   = FindObjectOfType <RoomContraller>();
        diceRoll         = FindObjectOfType <DiceRollCtrl>();
        eventController  = FindObjectOfType <EventController>();
        roundController  = FindObjectOfType <RoundController>();
        battleController = FindObjectOfType <BattleController>();
        //duiHuaUImanager = FindObjectOfType<DuiHuaUImanager>();
        charaInfoManager = FindObjectOfType <CharaInfoManager>();
        setGuangBoListener(FindObjectOfType <GuangBoListener>());
        guangBoController = FindObjectOfType <GuangBoController>();
        this.setName(SystemConstant.P1_NAME);
        //游戏一开始 所处的房间 默认房间的坐标为 0,0,0
        int[] roomXYZ;
        setBag(new Bag());
        if (this.neworLoad)
        {
            roomXYZ = new int[] { 0, 0, RoomConstant.ROOM_Z_GROUND };
            setCrazyFlag(false);
            setAbilityInfo(new int[] { 8, 3, 6, 7 });
            setMaxAbilityInfo(new int[] { 8, 3, 6, 7 });
            setActionPointrolled(false);
            setIsDead(false);


            this.waitPlan = false;

            this.setDesc("一身脏兮兮的白大褂,第一感觉是个跳大神的庸医。");
            //this.setClickMessage(new string[] { "", "你就是犯人。" });
            getTargetRoomList().Enqueue(roomContraller.getRandomRoom());
            getTargetRoomList().Enqueue(roomContraller.findRoomByRoomType(RoomConstant.ROOM_TYPE_HOSPITAIL_COMMON));
        }
        else
        {
            P0 p = loadInfo(this.getName());
            roomXYZ       = p.Xyz;
            this.waitPlan = p.WaitPlan;
            loadInfo(this, p, roomContraller);
            Debug.Log(" idont kone? nolan is dead ?" + this.isDead());
        }
        setDistance(0.5f);
        setCurrentRoom(roomXYZ);
        this.roomContraller.findRoomByXYZ(roomXYZ).setChara(this);
        this.roomContraller.setCharaInMiniMap(roomXYZ, this, true);
        this.setClickMessage(this.roomContraller.findRoomByXYZ(roomXYZ).findSomethingNews(this).ToArray());
    }
Exemplo n.º 5
0
    public new void defaultAction()
    {
        //  Debug.Log("run default aciont");
        if (waitPlan)
        {
            if (this.getGuangBoAction().isPlanSuccess())
            {
                this.sendMessageToPlayer(new string[] { "我这里有新线索发现,都来听我分析。" });
                if (this.getGuangBoAction().isGuangBoActionEnd())
                {
                    waitPlan = false;
                }
            }
            else
            {
                this.sendMessageToPlayer(new string[] { "你们这群呆逼,都不来算了。" });
                waitPlan = false;
            }
        }
        else
        {
            if (this.getTargetRoomList().Count <= 0)
            {
                NPC ben = (NPC)FindObjectOfType <Ben>();
                if (ben.isDead())
                {
                    Debug.Log("随便找个房间看看");
                    this.getTargetRoomList().Enqueue(roomContraller.getRandomRoom());
                }
                else
                {
                    if (AutoMoveManager.move(this, roomContraller, eventController, diceRoll, aPathManager, ben.getCurrentRoom()))
                    {
                        Debug.Log("kate 开始跟踪冒险家");
                        if (this.getAbilityInfo()[3] <= 1)
                        {
                            Debug.Log("kate 疯了, 准备杀人了");
                            ben.sendMessageToPlayer(new string[] { "侦探疯了,他要杀死所有人!", " 大家快跑。。。", "啊。。。" });
                            ben.getAbilityInfo()[0]  = 0;
                            this.getAbilityInfo()[3] = 1;

                            if (storyController.checkStoryStartBySPEvnet(bss, this, roundController, roomContraller.findRoomByXYZ(this.getCurrentRoom())))
                            {
                                Debug.Log(" 黑色征兆 剧本开启");
                                this.sendMessageToPlayer(new string[] { "啊!啊!啊!。。。", "冒险家被我杀死了。。。" });
                                this.getAbilityInfo()[3] = 3;
                            }
                            else
                            {
                                Debug.Log(" 剧本开启失败");
                            }
                        }
                        else
                        {
                            Debug.Log("kate 没疯,暗中观察");
                            //this.setClickMessage(new string[] { SystemConstant.P2_NAME + ", 让我看一下你当年手术的地方吧?" });
                        }
                    }
                }
            }
            else
            {
                RoomInterface target = this.getTargetRoomList().Peek();
                if (target == null)
                {
                    Debug.Log("target is null !!!!error");
                }
                if (target.getRoomType() == RoomConstant.ROOM_TYPE_HOSPITAIL_TRI_OPERATION && isTargetRoomLocked())
                {
                    Debug.Log("NPC发现手术室被锁着 去保安室找钥匙");

                    if (AutoMoveManager.move(this, roomContraller, eventController, diceRoll, aPathManager, RoomConstant.ROOM_TYPE_HOSPITAIL_SECURITY))
                    {
                        Debug.Log("达到保安室");
                        H_securityRoom surgeryRoom = (H_securityRoom)roomContraller.findRoomByXYZ(this.getCurrentRoom());
                        Item           item        = surgeryRoom.getKeysCabinet().GetComponent <KeysCabinet>().getItem(this);
                        if (item != null)
                        {
                            this.getBag().insertItem(item);
                            this.setTargetRoomLocked(false);
                        }
                        else
                        {
                            //没有找到钥匙, 直接判断手术室有没有被打开
                            H_tridOperationRoom tridOperationRoom = (H_tridOperationRoom)roomContraller.findRoomByRoomType(RoomConstant.ROOM_TYPE_HOSPITAIL_TRI_OPERATION);
                            if (tridOperationRoom.isLock())
                            {
                                Debug.Log("第3手术室锁着, 我又没钥匙,暂定瞎逛");
                                AutoMoveManager.move(this, roomContraller, eventController, diceRoll, aPathManager, roomContraller.getRandomRoom().getRoomType());
                            }
                            else
                            {
                                this.setTargetRoomLocked(false);
                            }
                        }
                    }
                }
                else
                {
                    // Debug.Log("targetRoom is " + target.getXYZ()[0] + "," + target.getXYZ()[1] + "," + target.getXYZ()[2]);
                    if (AutoMoveManager.move(this, roomContraller, eventController, diceRoll, aPathManager, target.getXYZ()))
                    {
                        //  Debug.Log("reached the targetRoom is " + target.getXYZ()[0] + "," + target.getXYZ()[1] + "," + target.getXYZ()[2]);
                        this.getTargetRoomList().Dequeue();
                        if (target.getRoomType() == RoomConstant.ROOM_TYPE_HOSPITAIL_SURGERY)
                        {
                            Debug.Log("达到外科室");
                            H_surgeryRoom surgeryRoom = (H_surgeryRoom)roomContraller.findRoomByXYZ(this.getCurrentRoom());
                            Item          item        = surgeryRoom.getBookTable().GetComponent <BookTable>().getItem(this);
                            if (item != null)
                            {
                                string guangBoCode = this.getName() + "_" + RoomConstant.ROOM_TYPE_HOSPITAIL_SURGERY + "_gb";
                                getTargetChara().Add(SystemConstant.P2_NAME);
                                setGuangBoAction(new EveryoneGoTargetRoom(this.getName(), RoomConstant.ROOM_TYPE_HOSPITAIL_SURGERY, getTargetChara(), 8, guangBoCode));
                                guangBoController.insertGuangBo(this.getGuangBoAction());
                                waitPlan = true;
                                this.sendMessageToPlayer(new string[] { SystemConstant.P2_NAME + ", 这个病例上有你的名字", " 你最好来看看" }, guangBoCode);
                                this.getBag().insertItem(item);
                            }
                        }
                        else if (target.getRoomType() == RoomConstant.ROOM_TYPE_HOSPITAIL_TRI_OPERATION)
                        {
                            Debug.Log("到达第3手术室");
                            H_tridOperationRoom tridOperationRoom = (H_tridOperationRoom)roomContraller.findRoomByXYZ(this.getCurrentRoom());
                            Item item = tridOperationRoom.getOperatingTable().GetComponent <OperatingTable>().getItem(this);
                            if (item != null)
                            {
                                this.getBag().insertItem(item);
                                this.sendMessageToPlayer(new string[] { SystemConstant.P1_NAME + ", 你最好解释下这个解剖样本,这个是什么病?" });
                            }
                            else
                            {
                                Debug.Log("这个解剖手术太奇怪了,我一定错过了什么。我要好好检查下。");
                                this.sendMessageToPlayer(new string[] { "这个解剖手术太奇怪了,我一定错过了什么。", "我要好好检查下。" });
                            }
                            //  this.setClickMessage(tridOperationRoom.findSomethingNews(this).ToArray());
                        }
                        else if (target.getRoomType() == RoomConstant.ROOM_TYPE_HOSPITAIL_MORGUE)
                        {
                            Debug.Log("到达停尸房");
                            this.sendMessageToPlayer(new string[] { "这里有好多尸体都标明了实验失败的标签", "而且实验人全是写的你医生的名字", "大家把医生抓住啊,他有重大嫌疑!" });
                        }
                        else if (target.getRoomType() == RoomConstant.ROOM_TYPE_HOSPITAIL_STORE)
                        {
                            Debug.Log("到达储藏室");
                            H_storeRoom storeRoom = (H_storeRoom)roomContraller.findRoomByXYZ(this.getCurrentRoom());
                            Item        item      = storeRoom.getSafeCabinet().GetComponent <SafeCabinet>().getItem(this);
                            if (item != null)
                            {
                                this.getBag().insertItem(item);
                                this.getAbilityInfo()[3] = 1;
                                //发疯后行动力加强
                                this.getAbilityInfo()[0] = this.getAbilityInfo()[0] + 3;
                                this.getAbilityInfo()[1] = this.getAbilityInfo()[1] + 4;
                            }
                            else
                            {
                                if (!isCrazy())
                                {
                                    //this.sendMessageToPlayer(target.findSomethingNews(this.getName()).ToArray());
                                    // this.setClickMessage(target.findSomethingNews(this).ToArray());
                                }
                            }
                        }
                        else
                        {
                            Debug.Log("找路失败了");
                        }
                    }
                }
                //this.setClickMessage(this.roomContraller.findRoomByXYZ(this.getCurrentRoom()).findSomethingNews(this).ToArray());
            }
        }
        endRound();
    }
Exemplo n.º 6
0
 public new void defaultAction()
 {
     Debug.Log("随便找个房间看看");
     AutoMoveManager.move(this, roomContraller, eventController, diceRoll, aPathManager, roomContraller.getRandomRoom().getXYZ());
     endRound();
 }
Exemplo n.º 7
0
    private void P3Move(Character chara, RoomContraller roomContraller, EventController eventController, DiceRollCtrl diceRoll, APathManager aPathManager,
                        RoundController roundController, BattleController battleController)
    {
        NPC npc = (NPC)chara;

        if (P3Message.Count > 0)
        {
            npc.sendMessageToPlayer(P3Message.Dequeue());
        }
        Character kate = roundController.getCharaByName(SystemConstant.P4_NAME);

        if (!kate.isDead())
        {
            if (AutoMoveManager.move(chara, roomContraller, eventController, diceRoll, aPathManager, kate.getCurrentRoom()))
            {
                battleController.fighte(chara, kate);
                if (kate.isDead())
                {
                    P3Message.Enqueue(new string[] { "侦探死了?", "感谢神灵保佑,我永远是您忠实的仆从。", "哼,那个蜘蛛怪怕除虫剂的,随随便便就收拾了。" });
                }
            }
        }
        else
        {
            AutoMoveManager.move(chara, roomContraller, eventController, diceRoll, aPathManager, roomContraller.getRandomRoom().getXYZ());
        }
    }
Exemplo n.º 8
0
    private void P1Move(Character chara, RoomContraller roomContraller, EventController eventController, DiceRollCtrl diceRoll, APathManager aPathManager,
                        RoundController roundController, BattleController battleController)
    {
        Character monster = roundController.getCharaByName(SystemConstant.MONSTER1_NAME);

        Debug.Log("error: this.P1TargetRooms " + this.P1TargetRooms);
        Debug.Log("error: Count " + this.P1TargetRooms.Count);
        string roomType;
        NPC    npc = (NPC)chara;

        if (this.P1TargetRooms.Count >= 1)
        {
            roomType = this.P1TargetRooms.Peek();
            if (P1Message.Count > 0)
            {
                npc.sendMessageToPlayer(P1Message.Dequeue());
            }
        }
        else
        {
            if (P1Message.Count > 0)
            {
                npc.sendMessageToPlayer(P1Message.Dequeue());
            }

            if (monster.isDead())
            {
                if (P1Message.Count > 0)
                {
                    npc.sendMessageToPlayer(P1Message.Dequeue());
                }
                roomType = roomContraller.getRandomRoom().getRoomType();
            }
            else
            {
                roomType = roomContraller.findRoomByXYZ(monster.getCurrentRoom()).getRoomType();
            }
            this.P1TargetRooms.Enqueue(roomType);
        }
        if (AutoMoveManager.move(chara, roomContraller,
                                 eventController, diceRoll, aPathManager, roomContraller.findRoomByRoomType(roomType).getXYZ()))
        {
            this.P1TargetRooms.Dequeue();

            if (roomType == RoomConstant.ROOM_TYPE_HOSPITAIL_DEAN)
            {
                npc.sendMessageToPlayer(new string[] { "我在院长室了,这里有个保险箱,我打不开,快来帮忙" });
                P1Message.Enqueue(new string[] { "我们得杀死那个蜘蛛怪物。", "那个萝莉侦探疯了,我们不用管她。" });
            }
            else
            {
                if (!monster.isDead())
                {
                    battleController.fighte(chara, monster);
                    if (monster.isDead())
                    {
                        P1Message.Enqueue(new string[] { "那个蜘蛛怪物死了?。", "我们得想办法救救那个萝莉侦探。" });
                    }
                }
            }
        }
    }