示例#1
0
        public static string GetPetInfo(CPet pet)
        {
            Console.Clear();

            var msg = new StringBuilder()
                      .Append($"이름 : {pet.Name}\n");

            if (pet.SecondaryType is EntityType)
            {
                msg.Append($"{pet.Type.ToString()}, {pet.SecondaryType.ToString()}");
            }
            else
            {
                msg.Append(pet.Type.ToString());
            }

            msg.Append("\n")
            .Append($"Lv. {pet.Info.Level}\n")
            .Append($"경험치 : {Math.Ceiling(pet.Info.Exp)}\n")
            .Append($"다음 레벨까지 {Math.Ceiling(pet.GetNeedExpForNextLvl())}필요\n\n")
            .Append($"채력 : {Math.Ceiling(pet.Info.Health)} / {Math.Ceiling(pet.Info.MaxHealth)}\n")
            .Append($"공격력 : {Math.Ceiling(pet.Info.GetAdAtk())} | {Math.Ceiling(pet.Info.GetApAtk())}\n")
            .Append($"방어력 : {Math.Ceiling(pet.Info.GetAdEndur())} | {Math.Ceiling(pet.Info.GetApEndur())}\n\n")
            .Append("기술\n");

            foreach (var s in pet.Skills)
            {
                if (s != null)
                {
                    msg.Append($"{s.Name} ({s.Point}/{s.MaxPoint})\n");
                }
            }

            return(msg.ToString());
        }
示例#2
0
        public static void AddPet(string name, CPet pet)
        {
            var current = LoadPetShell(name);
            var path    = Path(name);

            Stream ws         = new FileStream(path, FileMode.OpenOrCreate);
            var    serializer = new BinaryFormatter();

            current.Add(pet);
            serializer.Serialize(ws, current);
            ws.Close();
        }
示例#3
0
 public static void ShowPetInfo(CPet pet)
 {
     ConsoleUtil.WriteColor(GetPetInfo(pet));
 }