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


C# PlayerCharacter.LocationChangeLocation方法代码示例

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


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

示例1: handleUseMapObject

        // TODO: Temporary implemenation. Must use sripting/configuration external to server for handling actions connected with map objects usage
        // TODO: Add checking distance from object. Execute only if close enough
        // TODO: If change map fails and player move to IP, display massage and stop script
        private void handleUseMapObject(PlayerCharacter pc, IncommingMessage msg)
        {
            if (pc.LoginState == PlayerCharacterLoginState.LoginSuccesfull)
            {
                UseMapObjectIncommingMessage msgUseMapObject = (UseMapObjectIncommingMessage)msg;

                // Right now only handling for changing IP and IP insides maps!!!
                switch (pc.LocationCurrentMap.Name)
                {
                    case ("calindor_startmap.elm"):
                        {
                            switch (msgUseMapObject.TargetObjectID)
                            {
                                case(78):
                                    {
                                        pc.LocationChangeLocation(118, 35);
                                        break;
                                    }
                            }
                            break;
                        }
                    /*case ("startmap.elm"):
                        {
                            switch (msgUseMapObject.TargetObjectID)
                            {
                                case (501): // Secret location
                                    {
                                        RawTextOutgoingMessage msgToSender =
                                            (RawTextOutgoingMessage)OutgoingMessagesFactory.Create(OutgoingMessageType.RAW_TEXT);
                                        msgToSender.Color = PredefinedColor.Blue1;
                                        msgToSender.Channel = PredefinedChannel.CHAT_LOCAL;
                                        msgToSender.Text = "The world blurs... and you are taken to a place you didn't expect...";
                                        pc.PutMessageIntoMyQueue(msgToSender);

                                        pc.LocationChangeMap("cont2map5_insides.elm",606,133);
                                        break;
                                    }
                                case (520): // Movement to WS
                                    {
                                        RawTextOutgoingMessage msgToSender =
                                            (RawTextOutgoingMessage)OutgoingMessagesFactory.Create(OutgoingMessageType.RAW_TEXT);
                                        msgToSender.Color = PredefinedColor.Blue1;
                                        msgToSender.Channel = PredefinedChannel.CHAT_LOCAL;
                                        msgToSender.Text = "This land seems deserted and dead...";
                                        pc.PutMessageIntoMyQueue(msgToSender);

                                        pc.LocationChangeMap("map2.elm", 707, 162);
                                        break;
                                    }
                                case (1137): // IP cave
                                    {
                                        pc.LocationChangeMap("misc1.elm", 60, 138);
                                        break;
                                    }
                                case (73): // IP House, near veggies
                                    {
                                        pc.LocationChangeMap("startmap_insides.elm", 57, 13);
                                        break;
                                    }
                                case (63): // IP House, grandma
                                    {
                                        pc.LocationChangeMap("startmap_insides.elm", 15, 55);
                                        break;
                                    }
                                case (72): // IP Tavern
                                    {
                                        pc.LocationChangeMap("startmap_insides.elm", 18, 13);
                                        break;
                                    }
                                case (193): // IP hause - locked
                                    {
                                        RawTextOutgoingMessage msgToSender =
                                            (RawTextOutgoingMessage)OutgoingMessagesFactory.Create(OutgoingMessageType.RAW_TEXT);
                                        msgToSender.Color = PredefinedColor.Blue1;
                                        msgToSender.Channel = PredefinedChannel.CHAT_LOCAL;
                                        msgToSender.Text = "You hear strange noises as you approach... and the doors are locked...";
                                        pc.PutMessageIntoMyQueue(msgToSender);
                                        break;
                                    }
                                case (97): // IP hause - south of closed hause
                                    {
                                        pc.LocationChangeMap("startmap_insides.elm", 52, 49);
                                        break;
                                    }
                                case (1023): // IP tower
                                    {
                                        pc.LocationChangeMap("map7_insides.elm", 19, 66);
                                        break;
                                    }
                                default:
                                    break;
                            }

                            break;
                        }
                    case ("startmap_insides.elm"):
                        {
//.........这里部分代码省略.........
开发者ID:ago1024,项目名称:Calindor,代码行数:101,代码来源:WorldSimulationMapObjectsUsageHandling.cs


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