예제 #1
0
 public void MonsterDead(GameClient client, Monster monster)
 {
     if (client.ClientData.FuBenSeqID >= 0 && client.ClientData.CopyMapID >= 0 && this.IsCopyWolf(client.ClientData.FuBenID))
     {
         CopyWolfSceneInfo scene = null;
         if (this._runtimeData.SceneDict.TryGetValue(client.ClientData.FuBenSeqID, out scene) && scene != null)
         {
             if (scene.AddKilledMonster(monster))
             {
                 if (scene.SceneStatus < GameSceneStatuses.STATUS_END)
                 {
                     lock (scene)
                     {
                         int score = scene.AddMonsterScore(client.ClientData.RoleID, monster.MonsterInfo.WolfScore);
                         scene.ScoreData.RoleMonsterScore = scene.RoleMonsterScore;
                         GameManager.ClientMgr.BroadSpecialCopyMapMessage <CopyWolfScoreData>(1025, scene.ScoreData, scene.CopyMapInfo);
                         if (scene.IsMonsterFlag == 1 && scene.KilledMonsterHashSet.Count == scene.MonsterCountCreate)
                         {
                             scene.MonsterWaveOld = scene.MonsterWave;
                             if (scene.MonsterWave >= scene.MonsterWaveTotal)
                             {
                                 scene.SceneStatus = GameSceneStatuses.STATUS_END;
                             }
                             else
                             {
                                 scene.IsMonsterFlag = 0;
                             }
                         }
                     }
                 }
             }
         }
     }
 }
예제 #2
0
        public void MonsterDead(Monster monster)
        {
            CreateMonsterTagInfo tagInfo = monster.Tag as CreateMonsterTagInfo;

            if (tagInfo == null)
            {
                return;
            }

            int fubebSeqID = tagInfo.FuBenSeqId;

            if (fubebSeqID < 0 || monster.CopyMapID < 0 || !IsCopyWolf(monster.CurrentMapCode))
            {
                return;
            }

            CopyWolfSceneInfo scene = null;

            if (!_runtimeData.SceneDict.TryGetValue(fubebSeqID, out scene) || scene == null)
            {
                return;
            }
            if (scene.SceneStatus >= GameSceneStatuses.STATUS_END)
            {
                return;
            }

            //如果是重复记录击杀同一只怪,则直接返回
            if (!scene.AddKilledMonster(monster))
            {
                return;
            }

            if (scene.SceneStatus >= GameSceneStatuses.STATUS_END)
            {
                return;
            }

            lock (scene)
            {
                if (scene.IsMonsterFlag == 1 && scene.KilledMonsterHashSet.Count == scene.MonsterCountCreate)
                {
                    scene.MonsterWaveOld = scene.MonsterWave;
                    if (scene.MonsterWave >= scene.MonsterWaveTotal)
                    {
                        scene.SceneStatus = GameSceneStatuses.STATUS_END;
                    }
                    else
                    {
                        scene.IsMonsterFlag = 0;
                    }
                }
            }//lock
        }
예제 #3
0
        /// <summary>
        // 杀怪接口
        /// </summary>
        public void MonsterDead(GameClient client, Monster monster)
        {
            //if(client == null && monster.SceneType == (int)SceneUIClasses.CopyWolf)
            //    scene.AddKilledMonster(monster))

            if (client.ClientData.FuBenSeqID < 0 || client.ClientData.CopyMapID < 0 || !IsCopyWolf(client.ClientData.FuBenID))
            {
                return;
            }

            CopyWolfSceneInfo scene = null;

            if (!_runtimeData.SceneDict.TryGetValue(client.ClientData.FuBenSeqID, out scene) || scene == null)
            {
                return;
            }

            //如果是重复记录击杀同一只怪,则直接返回
            if (!scene.AddKilledMonster(monster))
            {
                return;
            }

            if (scene.SceneStatus >= GameSceneStatuses.STATUS_END)
            {
                return;
            }

            lock (scene)
            {
                //scene.MonsterCountKill++;
                //====Monsters===
                //int score = scene.AddMonsterScore(client.ClientData.RoleID, monster.MonsterInfo.WolfScore);
                //scene.ScoreData.RoleMonsterScore = scene.RoleMonsterScore;

                ////scene.ScoreData.MonsterCount -= 1;
                ////scene.ScoreData.MonsterCount = scene.ScoreData.MonsterCount < 0 ? 0 : scene.ScoreData.MonsterCount;
                //GameManager.ClientMgr.BroadSpecialCopyMapMessage((int)TCPGameServerCmds.CMD_SPR_COPY_WOLF_SCORE_INFO, scene.ScoreData, scene.CopyMapInfo);

                //if (scene.IsMonsterFlag == 1 && scene.KilledMonsterHashSet.Count == scene.MonsterCountCreate)
                //{
                //    scene.MonsterWaveOld = scene.MonsterWave;
                //    if (scene.MonsterWave >= scene.MonsterWaveTotal)
                //        scene.SceneStatus = GameSceneStatuses.STATUS_END;
                //    else
                //        scene.IsMonsterFlag = 0;
                //}
            }//lock
        }
예제 #4
0
        public void MonsterDead(Monster monster)
        {
            CreateMonsterTagInfo tagInfo = monster.Tag as CreateMonsterTagInfo;

            if (tagInfo != null)
            {
                int fubebSeqID = tagInfo.FuBenSeqId;
                if (fubebSeqID >= 0 && monster.CopyMapID >= 0 && this.IsCopyWolf(monster.CurrentMapCode))
                {
                    CopyWolfSceneInfo scene = null;
                    if (this._runtimeData.SceneDict.TryGetValue(fubebSeqID, out scene) && scene != null)
                    {
                        if (scene.SceneStatus < GameSceneStatuses.STATUS_END)
                        {
                            if (scene.AddKilledMonster(monster))
                            {
                                if (scene.SceneStatus < GameSceneStatuses.STATUS_END)
                                {
                                    lock (scene)
                                    {
                                        if (scene.IsMonsterFlag == 1 && scene.KilledMonsterHashSet.Count == scene.MonsterCountCreate)
                                        {
                                            scene.MonsterWaveOld = scene.MonsterWave;
                                            if (scene.MonsterWave >= scene.MonsterWaveTotal)
                                            {
                                                scene.SceneStatus = GameSceneStatuses.STATUS_END;
                                            }
                                            else
                                            {
                                                scene.IsMonsterFlag = 0;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }