private static void Display(int x, Gladiator g) { g.Torso.Head.CheckStatus(); g.Torso.CheckStatus(); g.Torso.RightLeg.CheckStatus(); g.Torso.RightArm.CheckStatus(); g.Torso.RightArm.Hand.CheckStatus(); g.Torso.LeftLeg.CheckStatus(); g.Torso.LeftArm.CheckStatus(); g.Torso.LeftArm.Hand.CheckStatus(); g.Torso.Head.Armor.CheckStatus(); g.Torso.Armor.CheckStatus(); g.Torso.RightLeg.Armor.CheckStatus(); g.Torso.RightArm.Armor.CheckStatus(); g.Torso.RightArm.Hand.Armor.CheckStatus(); g.Torso.LeftLeg.Armor.CheckStatus(); g.Torso.LeftArm.Armor.CheckStatus(); g.Torso.LeftArm.Hand.Armor.CheckStatus(); Write.Character(x, 0, g.Name, "", ""); Write.Line(x, 2, $"Strength {g.Strength}"); Write.Line(x, 3, $"Offence {g.Offence}"); Write.Line(x, 4, $"Defence {g.Defence}"); Write.Line(x, 5, $"Endurance {g.Endurance}/{g.MaxEndurance}"); Write.Line(x + 17, 0, Colour.SPEAK + "Head Armor" + Colour.RESET); Write.Line(x + 17, 1, Colour.ITEM + g.Torso.Head.Armor.Name + Colour.RESET); Write.Line(x + 17, 2, Colour.SPEAK + "Body Armor" + Colour.RESET); Write.Line(x + 17, 3, Colour.ITEM + g.Torso.Armor.Name + Colour.RESET); Write.Line(x + 17, 4, Colour.SPEAK + "Leg Armor" + Colour.RESET); Write.Line(x + 17, 5, Colour.ITEM + g.Torso.RightLeg.Armor.Name + Colour.RESET); Write.Line(x + 17, 6, Colour.SPEAK + "Arm Armor" + Colour.RESET); Write.Line(x + 17, 7, Colour.ITEM + g.Torso.RightArm.Armor.Name + Colour.RESET); Write.Line(x + 17, 8, Colour.SPEAK + "Gloves" + Colour.RESET); Write.Line(x + 17, 9, Colour.ITEM + g.Torso.RightArm.Hand.Armor.Name + Colour.RESET); Write.Character(x, 11, "LOCATION", $"STATUS", "ARMOR"); Write.Character(x, 12, "Head", g.Torso.Head.Status, g.Torso.Head.Armor.Status); Write.Character(x, 13, "Torso", g.Torso.Status, g.Torso.Armor.Status); Write.Character(x, 14, "Right Arm", g.Torso.RightArm.Status, g.Torso.RightArm.Armor.Status); Write.Character(x, 15, "Right Hand", g.Torso.RightArm.Hand.Status, g.Torso.RightArm.Hand.Armor.Status); Write.Character(x, 16, "Left Arm", g.Torso.LeftArm.Status, g.Torso.LeftArm.Armor.Status); Write.Character(x, 17, "Left Hand", g.Torso.LeftArm.Hand.Status, g.Torso.LeftArm.Hand.Armor.Status); Write.Character(x, 18, "Right Leg", g.Torso.RightLeg.Status, g.Torso.RightLeg.Armor.Status); Write.Character(x, 19, "Left Leg", g.Torso.LeftLeg.Status, g.Torso.LeftLeg.Armor.Status); Write.Line(x + 43, 0, Colour.SPEAK + "Main Hand" + Colour.RESET); Write.Line(x + 43, 2, Colour.SPEAK + "Off Hand" + Colour.RESET); Write.Line(x + 43, 1, Colour.ITEM + g.Torso.RightArm.Hand.Weapon.Name + Colour.RESET); Write.Line(x + 43, 3, Colour.ITEM + g.Torso.LeftArm.Hand.Weapon.Name + Colour.RESET); Write.Line(x + 40, 11, "Traits"); if (g.Traits.Count > 0) { Write.Line(x + 40, 12, g.Trait1); } if (g.Traits.Count > 1) { Write.Line(x + 40, 13, g.Trait2); } if (g.Traits.Count > 2) { Write.Line(x + 40, 14, g.Trait3); } }
private static void CreateCharacter(byte Index, NetIncomingMessage Data) { byte Character = Player.EncontrarCharacter(Index, string.Empty); // Lê os Data string Name = Data.ReadString().Trim(); // Verifica se está tudo certo if (Name.Length < Game.Min_Character || Name.Length > Game.Max_Character) { Sending.Alert(Index, "The character name must contain " + Game.Min_Character + " and " + Game.Max_Character + " characters.", false); return; } if (Name.Contains(";") || Name.Contains(":")) { Sending.Alert(Index, "Cannot contain ';' and ':' in the Character name.", false); return; } if (Read.Characters_Names().Contains(";" + Name + ":")) { Sending.Alert(Index, "A character with this name already exists.", false); return; } // Define o Character que será usado Lists.TempPlayer[Index].Used = Character; // Define os valores iniciais do Character Player.Character(Index).Name = Name; Player.Character(Index).Level = 1; Player.Character(Index).Classe = Data.ReadByte(); Player.Character(Index).Genre = Data.ReadBoolean(); Player.Character(Index).Attribute = Lists.Classe[Player.Character(Index).Classe].Attribute; Player.Character(Index).Map = Lists.Classe[Player.Character(Index).Classe].Appearance_Map; Player.Character(Index).Direction = (Game.Location)Lists.Classe[Player.Character(Index).Classe].Appearance_Direction; Player.Character(Index).X = Lists.Classe[Player.Character(Index).Classe].Appearance_X; Player.Character(Index).Y = Lists.Classe[Player.Character(Index).Classe].Appearance_Y; for (byte i = 0; i <= (byte)Game.Vital.Amount - 1; i++) { Player.Character(Index).Vital[i] = Player.Character(Index).MaxVital(i); } // Salva a conta Write.Character(Name); Write.Player(Index); // Entra no Game Player.Entrar(Index); }
private static void CreateCharacter(byte Index, NetIncomingMessage Data) { byte Character = Player.FindCharacter(Index, string.Empty); // Lê os dados string Name = Data.ReadString().Trim(); // Verifica se está tudo certo if (Name.Length < Game.Min_Name_Length || Name.Length > Game.Max_Name_Length) { Send.Alert(Index, "The character name must contain between " + Game.Min_Name_Length + " and " + Game.Max_Name_Length + " characters.", false); return; } if (Name.Contains(";") || Name.Contains(":")) { Send.Alert(Index, "Can't contain ';' and ':' in the character name.", false); return; } if (Read.Characters_Name().Contains(";" + Name + ":")) { Send.Alert(Index, "A character with this name already exists", false); return; } // Define o personagem que será usado Lists.Temp_Player[Index].Using = Character; // Define os valores iniciais do personagem Player.Character(Index).Name = Name; Player.Character(Index).Level = 1; Player.Character(Index).Class = Data.ReadByte(); Lists.Structures.Class Class = Lists.Class[Player.Character(Index).Class]; Player.Character(Index).Genre = Data.ReadBoolean(); if (Player.Character(Index).Genre) { Player.Character(Index).Texture_Num = Class.Tex_Male[Data.ReadByte()]; } else { Player.Character(Index).Texture_Num = Class.Tex_Female[Data.ReadByte()]; } Player.Character(Index).Attribute = Class.Attribute; Player.Character(Index).Map = Class.Spawn_Map; Player.Character(Index).Direction = (Game.Directions)Class.Spawn_Direction; Player.Character(Index).X = Class.Spawn_X; Player.Character(Index).Y = Class.Spawn_Y; for (byte i = 0; i < (byte)Game.Vitals.Count; i++) { Player.Character(Index).Vital[i] = Player.Character(Index).MaxVital(i); } for (byte i = 0; i < (byte)Class.Item.Length; i++) { if (Lists.Item[Class.Item[i].Item1].Type == (byte)Game.Items.Equipment && Player.Character(Index).Equipment[Lists.Item[Class.Item[i].Item1].Equip_Type] == 0) { Player.Character(Index).Equipment[Lists.Item[Class.Item[i].Item1].Equip_Type] = Class.Item[i].Item1; } else { Player.GiveItem(Index, Class.Item[i].Item1, Class.Item[i].Item2); } } // Salva a conta Write.Character(Name); Write.Player(Index); // Entra no jogo Player.Join(Index); }