當前位置: 首頁>>代碼示例>>C#>>正文


C# PlayerObject.LevelUp方法代碼示例

本文整理匯總了C#中Server.MirObjects.PlayerObject.LevelUp方法的典型用法代碼示例。如果您正苦於以下問題:C# PlayerObject.LevelUp方法的具體用法?C# PlayerObject.LevelUp怎麽用?C# PlayerObject.LevelUp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Server.MirObjects.PlayerObject的用法示例。


在下文中一共展示了PlayerObject.LevelUp方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Act


//.........這裏部分代碼省略.........
                            monster.Master = player;
                            monster.MaxPetLevel = 7;
                            monster.Direction = player.Direction;
                            monster.ActionTime = SMain.Envir.Time + 1000;
                            monster.Spawn(player.CurrentMap, player.CurrentLocation);
                            player.Pets.Add(monster);
                        }
                        break;

                    case ActionType.AddNameList:
                        path = (string)act.Params[0];
                        if (File.ReadAllLines(path).All(t => player.Name != t))
                            {
                                using (var line = File.AppendText(path))
                                {
                                    line.WriteLine(player.Name);
                                }
                            }
                        break;

                    case ActionType.DelNameList:
                        path = (string)act.Params[0];
                        File.WriteAllLines(path, File.ReadLines(path).Where(l => l != player.Name).ToList());
                        break;

                    case ActionType.ClearNameList:
                        path = (string)act.Params[0];
                        File.WriteAllLines(path, new string[] { });
                        break;

                    case ActionType.GiveHP:
                        player.ChangeHP((int)act.Params[0]);
                        break;

                    case ActionType.GiveMP:
                        player.ChangeMP((int)act.Params[0]);
                        break;

                    case ActionType.ChangeLevel:
                        player.Level = (byte) act.Params[0];
                        player.LevelUp();
                        break;

                    case ActionType.SetPkPoint:
                        player.PKPoints = (int) act.Params[0];
                        break;

                    case ActionType.ChangeGender:
                        switch (player.Info.Gender)
                        {
                            case MirGender.Male:
                                player.Info.Gender = MirGender.Female;
                                break;
                            case MirGender.Female:
                                player.Info.Gender = MirGender.Male;
                                break;
                        }
                        break;

                    case ActionType.ChangeClass:
                        var data = (MirClass)act.Params[0];
                        switch (data)
                        {
                            case MirClass.Warrior:
                                player.Info.Class = MirClass.Warrior;
                                break;
                            case MirClass.Taoist:
                                player.Info.Class = MirClass.Taoist;
                                break;
                            case MirClass.Wizard:
                                player.Info.Class = MirClass.Wizard;
                                break;
                            case MirClass.Assassin:
                                player.Info.Class = MirClass.Assassin;
                                break;
                        }
                        break;

                    case ActionType.LineMessage:
                        player.ReceiveChat((string)act.Params[0], (ChatType)act.Params[1]);
                        break;

                    case ActionType.GiveSkill:
                        var magic = new UserMagic((Spell)act.Params[0]) { Level = (byte)act.Params[1] };

                        player.Info.Magics.Add(magic);
                        player.Enqueue(magic.GetInfo());
                        break;

                    case ActionType.Goto:
                        player.NPCGoto = true;
                        player.NPCGotoPage = "[" + act.Params[0] + "]";
                        break;

                    case ActionType.Set:
                        player.Info.Flags[(uint) act.Params[0]] = (bool) act.Params[1];
                        break;
                }
            }
        }
開發者ID:WillMcKill,項目名稱:MirRage,代碼行數:101,代碼來源:NPCObject.cs


注:本文中的Server.MirObjects.PlayerObject.LevelUp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。