예제 #1
0
        public void Show(string[] arguments)
        {
            int      npcId    = int.Parse(arguments[0]);
            CBaseMap cBaseMap = App.Util.SceneManager.CurrentScene as CBaseMap;

            if (cBaseMap == null)
            {
                LSharpScript.Instance.Analysis();
                return;
            }
            cBaseMap.HideNpc(npcId, false);
            LSharpScript.Instance.Analysis();
        }
예제 #2
0
        public void Moveself(string[] arguments)
        {
            int      index    = int.Parse(arguments[0]);
            int      x        = int.Parse(arguments[1]);
            int      y        = int.Parse(arguments[2]);
            CBaseMap cBaseMap = App.Util.SceneManager.CurrentScene as CBaseMap;

            if (cBaseMap == null)
            {
                LSharpScript.Instance.Analysis();
                return;
            }
            cBaseMap.MoveSelf(index, x, y);
        }
예제 #3
0
        public void Setselfaction(string[] arguments)
        {
            int index = int.Parse(arguments[0]);

            App.Model.ActionType actionType = (App.Model.ActionType)Enum.Parse(typeof(App.Model.ActionType), arguments[1]);
            CBaseMap             cBaseMap   = App.Util.SceneManager.CurrentScene as CBaseMap;

            if (cBaseMap == null)
            {
                LSharpScript.Instance.Analysis();
                return;
            }
            cBaseMap.SetSelfAction(index, actionType);
        }
예제 #4
0
파일: LSharpTalk.cs 프로젝트: zlbsy/sh109
        public void Setnpc(string[] arguments)
        {
            int npcId = int.Parse(arguments[0]);
            //int faceType = int.Parse(arguments[1]); //TODO:表情扩展用
            string   message  = arguments[2];
            bool     isLeft   = arguments[3] == "true";
            CBaseMap cBaseMap = App.Util.SceneManager.CurrentScene as CBaseMap;

            if (cBaseMap != null)
            {
                cBaseMap.NpcFocus(npcId);
            }
            CTalkDialog.ToShowNpc(npcId, message, isLeft, LSharpScript.Instance.Analysis);
        }
예제 #5
0
        public void Setselfdirection(string[] arguments)
        {
            int index = int.Parse(arguments[0]);

            App.Model.Direction direction = (App.Model.Direction)System.Enum.Parse(typeof(App.Model.Direction), arguments[1], true);
            CBaseMap            cBaseMap  = App.Util.SceneManager.CurrentScene as CBaseMap;

            if (cBaseMap == null)
            {
                LSharpScript.Instance.Analysis();
                return;
            }
            cBaseMap.SetSelfDirection(index, direction);
            LSharpScript.Instance.Analysis();
        }
예제 #6
0
        /*public void Moveplayer(string[] arguments){
         *  int x = int.Parse(arguments[0]);
         *  int y = int.Parse(arguments[1]);
         *  CBaseMap cBaseMap = App.Util.SceneManager.CurrentScene as CBaseMap;
         *  if (cBaseMap == null)
         *  {
         *      LSharpScript.Instance.Analysis();
         *      return;
         *  }
         *  cBaseMap.MovePlayer(x, y);
         * }*/
        public void Setmission(string[] arguments)
        {
            int npcId = int.Parse(arguments[0]);

            App.Model.Mission mission  = (App.Model.Mission)Enum.Parse(typeof(App.Model.Mission), arguments[1]);
            CBaseMap          cBaseMap = App.Util.SceneManager.CurrentScene as CBaseMap;

            if (cBaseMap == null)
            {
                LSharpScript.Instance.Analysis();
                return;
            }
            cBaseMap.SetNpcMission(npcId, mission);
            LSharpScript.Instance.Analysis();
        }
예제 #7
0
파일: LSharpTalk.cs 프로젝트: zlbsy/sh109
        public void Setplayer(string[] arguments)
        {
            int userId = int.Parse(arguments[0]);
            //int faceType = int.Parse(arguments[1]); //TODO:表情扩展用
            string   message  = arguments[2];
            bool     isLeft   = arguments[3] == "true";
            CBaseMap cBaseMap = App.Util.SceneManager.CurrentScene as CBaseMap;

            if (cBaseMap != null)
            {
                App.Model.MCharacter mCharacter = System.Array.Find(Global.SUser.self.characters, c => c.CharacterId >= App.Util.Global.Constant.user_characters[0]);
                cBaseMap.CharacterFocus(mCharacter.CharacterId);
            }
            CTalkDialog.ToShowPlayer(userId, message, isLeft, LSharpScript.Instance.Analysis);
        }
예제 #8
0
        public void Removeskill(string[] arguments)
        {
            int characterId = int.Parse(arguments[0]);

            App.Model.Belong belong = (App.Model.Belong)Enum.Parse(typeof(App.Model.Belong), arguments[1]);
            int      skillId        = int.Parse(arguments[2]);
            CBaseMap cBaseMap       = App.Util.SceneManager.CurrentScene as CBaseMap;

            if (cBaseMap == null)
            {
                LSharpScript.Instance.Analysis();
                return;
            }
            cBaseMap.RemoveCharacterSkill(characterId, belong, skillId);
            LSharpScript.Instance.Analysis();
        }
예제 #9
0
파일: CTalkDialog.cs 프로젝트: zlbsy/sh109
        public override IEnumerator OnLoad(Request request)
        {
            int    faceId = 0;
            string name   = string.Empty;

            if (request.Has("userId"))
            {
                int             userId = request.Get <int>("userId");
                App.Model.MUser user   = App.Util.Cacher.UserCacher.Instance.Get(userId);
                faceId = user.Face;
                name   = user.name;
            }
            else if (request.Has("npcId"))
            {
                int                  npcId      = request.Get <int>("npcId");
                CBaseMap             cBaseMap   = App.Util.SceneManager.CurrentScene as CBaseMap;
                App.Model.MCharacter mCharacter = cBaseMap.GetCharacterFromNpc(npcId);
                faceId = mCharacter.CharacterId;
                name   = mCharacter.Master.name;
            }
            else if (request.Has("characterId"))
            {
                faceId = request.Get <int>("characterId");
                App.Model.Master.MCharacter mCharacter = CharacterCacher.Instance.Get(faceId);
                name = mCharacter.name;
            }
            message = request.Get <string>("message");
            if (name != string.Empty && faceId > 0)
            {
                face.CharacterId = faceId;
                bool isLeft = request.Get <bool>("isLeft");
                if (isLeft)
                {
                    characterNameLeft.text  = name;
                    characterNameRight.text = string.Empty;
                }
                else
                {
                    characterNameRight.text = name;
                    characterNameLeft.text  = string.Empty;
                }
            }
            characterTalk.text = string.Empty;
            StartCoroutine(UpdateMessage());
            yield return(StartCoroutine(base.OnLoad(request)));
        }
예제 #10
0
        public void Add(string[] arguments)
        {
            int    npcId  = int.Parse(arguments[0]);
            string action = arguments[1];

            if (action == "stand")
            {
                action = "idle";
            }
            string   directionStr = arguments[2];
            int      x            = int.Parse(arguments[3]);
            int      y            = int.Parse(arguments[4]);
            CBaseMap cBaseMap     = App.Util.SceneManager.CurrentScene as CBaseMap;

            if (cBaseMap == null)
            {
                LSharpScript.Instance.Analysis();
                return;
            }
            App.Model.ActionType actionType = (App.Model.ActionType)Enum.Parse(typeof(App.Model.ActionType), action);
            App.Model.Direction  direction  = (App.Model.Direction)System.Enum.Parse(typeof(App.Model.Direction), directionStr, true);
            cBaseMap.AddCharacter(npcId, actionType, direction, x, y);
            LSharpScript.Instance.Analysis();
        }