当前位置: 首页>>代码示例>>C#>>正文


C# IMap.IsNpcSlotEmpty方法代码示例

本文整理汇总了C#中IMap.IsNpcSlotEmpty方法的典型用法代码示例。如果您正苦于以下问题:C# IMap.IsNpcSlotEmpty方法的具体用法?C# IMap.IsNpcSlotEmpty怎么用?C# IMap.IsNpcSlotEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMap的用法示例。


在下文中一共展示了IMap.IsNpcSlotEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnMapReloaded

 public static void OnMapReloaded(IMap map)
 {
     for (int i = 0; i < Constants.MAX_MAP_NPCS; i++) {
         if (!map.IsNpcSlotEmpty(i)) {
             map.ActiveNpc[i].CalculateOriginalStats();
             RefreshCharacterTraits(map.ActiveNpc[i], map, null);
         }
     }
 }
开发者ID:MandL27,项目名称:Server,代码行数:9,代码来源:Main.cs

示例2: UnlockRoom

 public static void UnlockRoom(Client client, IMap imap)
 {
     int remainingEnemies = 0;
     for (int i = 0; i < Constants.MAX_MAP_NPCS; i++) {
         if (!imap.IsNpcSlotEmpty(i)) remainingEnemies++;
     }
     if (remainingEnemies <= 1) {
         if (imap.MaxX == 19) {
             for (int i = 8; i <= 11; i++) {
                 if (imap.Tile[i,1].Type == Enums.TileType.Key) {
                     imap.SetTile(i, 1, 0, 0, 1);
                     imap.SetAttribute(i, 1, Enums.TileType.Walkable, 0, 0, 0, "", "", "");
                     Messenger.SendTile(i, 1, imap);
                 }
                 if (imap.Tile[i,13].Type == Enums.TileType.Key) {
                     imap.SetTile(i, 13, 0, 0, 1);
                     imap.SetAttribute(i, 13, Enums.TileType.Walkable, 0, 0, 0, "", "", "");
                     Messenger.SendTile(i, 13, imap);
                 }
             }
             for (int i = 6; i <= 8; i++) {
                 if (imap.Tile[1,i].Type == Enums.TileType.Key) {
                     imap.SetTile(1, i, 0, 0, 1);
                     imap.SetAttribute(1, i, Enums.TileType.Walkable, 0, 0, 0, "", "", "");
                     Messenger.SendTile(1, i, imap);
                 }
                 if (imap.Tile[18,i].Type == Enums.TileType.Key) {
                     imap.SetTile(18,i, 0, 0, 1);
                     imap.SetAttribute(18, i, Enums.TileType.Walkable, 0, 0, 0, "", "", "");
                     Messenger.SendTile(18, i, imap);
                 }
             }
         } else if (imap.MaxX == 46) {
             for (int i = 22; i <= 24; i++) {
                 if (imap.Tile[i,1].Type == Enums.TileType.Key) {
                     imap.SetTile(i, 1, 0, 0, 1);
                     imap.SetAttribute(i, 1, Enums.TileType.Walkable, 0, 0, 0, "", "", "");
                     Messenger.SendTile(i, 1, imap);
                 }
                 if (imap.Tile[i,33].Type == Enums.TileType.Key) {
                     imap.SetTile(i, 33, 0, 0, 1);
                     imap.SetAttribute(i, 33, Enums.TileType.Walkable, 0, 0, 0, "", "", "");
                     Messenger.SendTile(i, 33, imap);
                 }
             }
             for (int i = 16; i <= 18; i++) {
                 if (imap.Tile[1,i].Type == Enums.TileType.Key) {
                     imap.SetTile(1, i, 0, 0, 1);
                     imap.SetAttribute(1, i, Enums.TileType.Walkable, 0, 0, 0, "", "", "");
                     Messenger.SendTile(1, i, imap);
                 }
                 if (imap.Tile[45,i].Type == Enums.TileType.Key) {
                     imap.SetTile(45, i, 0, 0, 1);
                     imap.SetAttribute(45, i, Enums.TileType.Walkable, 0, 0, 0, "", "", "");
                     Messenger.SendTile(45, i, imap);
                 }
             }
         }
     }
 }
开发者ID:ScruffyKnight,项目名称:PMU-Server,代码行数:60,代码来源:PitchBlackAbyss.cs

示例3: OnMapLoad


//.........这里部分代码省略.........
            }
            //if (client.Player.Helmet > -1) {
            //    helmet = client.Player.Helmet;
            //}
            //TODO: restructure for party items
            switch (heldItemNum) {
                //case 66: {//x-ray specs
                //        Messenger.PlayerMsg(client, "Pokémon in this area:", Text.Yellow);
                        //substitute the 14 for max NPCs
                //        List<int> Npcs = new List<int>();
                //        for (int i = 0; i < Constants.MAX_MAP_NPCS; i++) {
                //            if (Npcs.Contains(map.Npc[i].NpcNum) == false && map.Npc[i].NpcNum > 0) {
                //                Npcs.Add(map.Npc[i].NpcNum);
                //                Messenger.PlayerMsg(client, "Lv." + map.ActiveNpc[i].Level + " " + NpcManagerBase.Npcs[map.Npc[i].NpcNum].Name, Text.Yellow);
                //            }
                //        }
                        //} else {

                        //}

                        //if (Npcs.Count == 0) {
                        //    Messenger.PlayerMsg(client, "(None)", Text.Yellow);
                        //}

                    //}
                    //break;
                case 544: {//gaggle specs
                        for (int j = 0; j < 14; j++) {
                            map.ActiveNpc[j].Target = client;
                        }
                    }
                    break;
            }

            //Castform stuff
            if (client.Player.LoggedIn) {
                //exPlayer.Get(client).TurnsTaken = 0;
            }

            //for gen5 egg
            //bool hasTriggerEvent = false;
            //for (int i = 0; i < client.Player.TriggerEvents.Count; i++) {
            //    if (client.Player.TriggerEvents[i].Trigger == TriggerEventTrigger.StepCounter &&
            //        client.Player.TriggerEvents[i].ID == "MysteryEggStepCounter") {
            //        hasTriggerEvent = true;
            //        break;
            //    }
            //}

            //if (client.Player.HasItem(131) > 0 && !hasTriggerEvent) {
            //    StepCounterTriggerEvent triggerEvent = new StepCounterTriggerEvent("MysteryEggStepCounter", TriggerEventAction.RunScript, 2, true, client, 200);
            //    client.Player.AddTriggerEvent(triggerEvent);
            //Messenger.PlayerMsg(client, "1", Text.BrightRed);
            //}

            //CTF issues
            if (ActiveCTF != null &&
                map.MapID != MapManager.GenerateMapID(CTF.REDMAP) &&
                map.MapID != MapManager.GenerateMapID(CTF.BLUEMAP) &&
                map.MapID != MapManager.GenerateMapID(CTF.HUBMAP)) {

                ActiveCTF.RemoveFromGame(client);
            }

            if (client.Player.CharID == Auction.AuctionMaster && client.Player.MapID != Auction.AUCTION_MAP) {
                //Auction.EndAuction(client);
                Auction.State = Auction.AuctionState.NotStarted;
                Auction.AuctionMaster = null;
            }

            // Snowball game cleanup
            if (exPlayer.Get(client).SnowballGameInstance != null) {
                SnowballGame snowballGame = exPlayer.Get(client).SnowballGameInstance;
                if (client.Player.Map != snowballGame.ArenaMap
                    && client.Player.MapID != SnowballGame.WaitingRoomMap) {

                    snowballGame.RemoveFromGame(client);
                }
            }

            if (!loggedIn) {

                if (client.Player.CurrentChapter == null && BossBattles.IsBossBattleMap(client)) {
                    bool empty = true;
                    for (int i = 0; i < Constants.MAX_MAP_NPCS; i++) {
                        if (!map.IsNpcSlotEmpty(i)) {
                            empty = false;
                            break;
                        }
                    }
                    if (empty) {
                        // TODO: You can completely skip the boss battle if you relog while the intro story
                        // 		 is playing and no NPC has been spawned yet. Disabled until a workaround is
                        //		 made.
                        // --Enabled until workaround is made.  The only thing achieved from getting around a boss is dungeon completion.
                        BossBattles.RunBossBattleCleanup(client, client.Player.Map.Name);
                    }
                }
            }
        }
开发者ID:MandL27,项目名称:Server,代码行数:101,代码来源:Main.cs


注:本文中的IMap.IsNpcSlotEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。