public static void GladiatorCurrentEquipment(Gladiator g) { Write.Line(20, 11, Color.HEALTH + "Current" + Color.RESET); Write.Line(20, 13, $"{g.head.equipment.name}"); Write.Line(20, 14, $"{g.torso.equipment.name}"); Write.Line(20, 15, $"{g.legs.equipment.name}"); Write.Line(20, 17, $"{g.rightArm.equipment.name}"); Write.Line(20, 18, $"{g.leftArm.equipment.name} "); if (g.head.equipment.hp > 0) { Write.Line(35, 13, Color.DURABILITY + g.head.equipment.hp + " HP"); } if (g.torso.equipment.hp > 0) { Write.Line(35, 14, Color.DURABILITY + g.torso.equipment.hp + " HP"); } if (g.legs.equipment.hp > 0) { Write.Line(35, 15, Color.DURABILITY + g.legs.equipment.hp + " HP"); } if (g.rightArm.equipment.effect1 > 0) { Write.Line(35, 17, Color.DAMAGE + g.rightArm.equipment.effect1 + " DAM"); } if (g.leftArm.equipment.effect1 > 0) { Write.Line(35, 18, Color.DEFENCE + g.leftArm.equipment.effect1 + " DEF"); } }
public FightView(Gladiator Player, Gladiator Enemy) { InitializeComponent(); fight.Player = Player; fight.Enemy = Enemy; LoadGladiators(); }
public void FillWithGladiatorDetails(Gladiator g) { if (g == null) { name.text = ""; selectBackground.SetActive(false); foreach (Transform child in AvatarHolder.transform) { GameObject.Destroy(child.gameObject); } } else { name.text = g.Name; List <GameObject> children = new List <GameObject>(); foreach (Transform child in AvatarHolder.transform) { children.Add(child.gameObject); } children.ForEach(child => Destroy(child)); GameObject o = (GameObject)Instantiate(GameController.Instance.GetPrefabForGladiator(g)); o.transform.SetParent(AvatarHolder.transform, false); o.transform.localPosition = new Vector3(-4, 10, 0); o.transform.localScale = new Vector3(0.25f, 0.25f, 0.25f); } }
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); } }
public void AddToParty(Gladiator gladiator) { //TODO: fill this! - convert to party member if (!CanAddToParty()) { return; } int posToAddAt = 0; foreach (Gladiator g in _Party) { if (g == null) { break; } posToAddAt++; } //Converting to the ally type gladiator.Level = 1; gladiator.Flavour = Gladiator.GladiatorFlavour.Dude; //TODO: add dudessa _Party[posToAddAt] = gladiator; }
private void btnViewGladiator_click(object sender, EventArgs e) { string gladName = (string)dgvUI.CurrentCell.Value; GladiatorView gv = new GladiatorView(Gladiator.PickGladiatorFromDGV(MyGladList, gladName), MyGladList, Player.Inventory); gv.Show(); }
public static void Main(string[] args) { Arena myArena = new Arena("armeec"); Stat firstGlariatorStat = new Stat(20, 25, 35, 14, 48); Stat secondGlariatorStat = new Stat(40, 40, 40, 40, 40); Stat thirdGlariatorStat = new Stat(20, 25, 35, 14, 48); Weapon firstGlariatorWeapon = new Weapon(5, 28, 100); Weapon secondGlariatorWeapon = new Weapon(5, 28, 100); Weapon thirdGlariatorWeapon = new Weapon(50, 50, 50); Gladiator firstGladiator = new Gladiator("Stoyan", firstGlariatorStat, firstGlariatorWeapon); Gladiator secondGladiator = new Gladiator("Pesho", secondGlariatorStat, secondGlariatorWeapon); Gladiator thirdGladiator = new Gladiator("Gosho", thirdGlariatorStat, thirdGlariatorWeapon); myArena.Add(firstGladiator); myArena.Add(secondGladiator); myArena.Add(thirdGladiator); Gladiator test = myArena.GetGladitorWithHighestStatPower(); System.Console.WriteLine(test); System.Console.WriteLine(myArena.Count); Gladiator strongestGladiator = myArena.GetGladitorWithHighestTotalPower(); System.Console.WriteLine(strongestGladiator); }
public GladiatorView(Gladiator gladIn, bool myGladList, List <InventoryItem> inventory) { InitializeComponent(); inGladiator = gladIn; this.Text = inGladiator.Name; labelName.Text = inGladiator.Name; List <InventoryItem> Inventory = inventory; if (myGladList) { panelMyGladControls.Visible = true; } else { panelMyGladControls.Visible = false; } if (inGladiator.Nickname == null) { labelNickname.Text = ""; } else { labelNickname.Text = inGladiator.Nickname; } UpdateGladiator(); }
public void LoadAttacks(Gladiator g) { _ActionsCache = g.AttackQueue; _MyId = g._Id; PushActionToQueue(_ActionsCache); }
public async void AddGladiator(Gladiator glad) { //Need to figure out how to save all gladiator fields since it has methods on it, may have to store properties in another object, and instantiate a gladiator not sure //May have to refactor gladiator to just have a model/controller pattern //var collection = Database.GetCollection<Gladiator>("gladcontent"); //await collection.InsertOneAsync(glad); }
public void SetGladiatorInfo(Gladiator info) { Name.text = info.Name; Health.text = "HP: " + info.BaseLife; Adr.text = "ADR: " + info.BaseAdrenaline; #region Setting Avatar AvatarContainer.DeleteAllChildreen(); GameObject o = (GameObject)Instantiate(GameController.Instance.GetPrefabForGladiator(info)); o.transform.SetParent(AvatarContainer.transform, false); RectTransform r = o.GetComponent <RectTransform>(); o.transform.localPosition = new Vector3(-28, -32, 0); #endregion #region Setting ability list AbilitiesList.DeleteAllChildreen(); foreach (PassiveAbility p in info.PassiveAbilities) { ActionSmallIcon c = (ActionSmallIcon)Instantiate(AbilityIconPrefab); c.SetAbility(p); c.transform.SetParent(AbilitiesList.transform, false); } foreach (ActiveAbility a in info.ActiveAbilities) { ActionSmallIcon c = (ActionSmallIcon)Instantiate(AbilityIconPrefab); c.SetAbility(a); c.transform.SetParent(AbilitiesList.transform, false); } #endregion }
public Gladiator Figth() { List <Gladiator> result = new List <Gladiator>(); Gladiator winner = new Gladiator(); foreach (var turn in Order) { //On récupère les armes de même initiative result = Turn(turn); //Le résultat peux contenir soit un combattant ( le gagnant ) ou les 2 if (result.Count > 1) { Console.WriteLine("Les deux gladiateurs ont porté leurs coup en même temps, c'est match nul."); //On réinitialise les combattants ResetFigthers(); //On renvoie un Gladiator vide en cas de match nul return(winner); } else if (result.Count == 1) { Gladiator dead = GetReceiver(result[0]); Console.WriteLine(dead.Name + " est hors combat."); //On réinitialise les combattants ResetFigthers(); return(result[0]); } } SetIni(); return(Figth()); }
public override void EnterPath(Gladiator gladiator, GameObject path) { if (path.Equals(path)) { gladiator.Kill(); } }
public Duel(Gladiator g1, Gladiator g2) { g1.NbPlayed++; g2.NbPlayed++; Gladiators.Add(g1); Gladiators.Add(g2); SetIni(); }
public void SetGladiator(int index) { Gladiator glad = gladiators[index]; name.text = glad.name; background.text = glad.background.story; }
private static void Repair(Gladiator g) { g.action = Actions.Repairing; Console.Clear(); Return.Roster(player, 5); Write.Line(0, 20, Color.NAME + g.name + Color.RESET + " is " + Color.ITEM + "repairing" + Color.RESET); Write.KeyPress(0, 28); }
private static void Rest(Gladiator g) { g.action = Actions.Resting; Console.Clear(); Injuries(); Return.PlayerInfo(); Write.Line(0, 20, Color.NAME + g.name + Color.RESET + " is " + Color.HEALTH + "resting" + Color.RESET); Write.KeyPress(0, 28); }
public async void AddGladiatorToHistory(Gladiator glad) { var GladiatorDBModel = new GladiatorViewModel(glad); var Collec = Database.GetCollection <GladiatorViewModel>("gladiatorhist"); await Collec.InsertOneAsync(GladiatorDBModel); //Console.ReadLine(); }
public Gladiator CreateGladiator() { Background background = bs.GetNewBackground(); string name = ns.GetName(); Gladiator newGladiator = new Gladiator(background, name); return(newGladiator); }
private void Btn_Click(object sender, RoutedEventArgs e) { var a = (sender as Button); var b = Convert.ToInt32(a.Name.Replace("_", "")); enemy = _tempGladiators.Where(x => x.ID == b).FirstOrDefault(); var window = (ClientView)Application.Current.MainWindow; window.MainFrame.Navigate(new FightView(player, enemy)); }
public void Death(Gladiator g) { if (Owner.player) { Graveyard.dayOfDeath.Add(Hub.day); Graveyard.killedBy.Add(g); Graveyard.graveyard.Add(this); } Owner.roster.Remove(this); }
public override void EnterPath(Gladiator gladiator, GameObject path) { if (path.Equals(entry)) { visitors.Add(gladiator); } else if (path.Equals(exit)) { visitors.Remove(gladiator); } }
void SettingGladiator(Gladiator player, GamePad.Index index) { if (player == null) { return; } player.Walk(GamePad.GetAxis(GamePad.Axis.LeftStick, index).x); player.Jump(GamePad.GetButtonDown(GamePad.Button.A, index)); player.RotaShoulder(GamePad.GetAxis(GamePad.Axis.RightStick, index)); player.Attack(GamePad.GetTrigger(GamePad.Trigger.RightTrigger, index)); }
protected override void ExecuteOnOpponent(Gladiator gladiator, bool isSmirked) { float damageValue = Random.Range(_MinDamage, _MaxDamage + 1); if (isSmirked) { damageValue = Mathf.Ceil(damageValue * GameController.Instance.SmirkBoost); } TinyMessengerHub.Instance.Publish <Msg.DealDamage>(new Msg.DealDamage(gladiator._Id, damageValue)); }
static void rosterAdd(Gladiator g) { if (Create.player.roster.Count < 5) { Create.player.roster.Add(g); } else { Write.Line("Your roster is full! Release a gladiator!"); Write.KeyPress(); } }
private static void Train(Gladiator g) { Console.Clear(); Return.GladiatorInfo(g, 5, 6); Write.Line(0, 18, "What would you like to train?"); Write.Line(0, 23, "[1] " + Color.STRENGTH + "Strength" + Color.RESET); Write.Line(0, 24, "[2] " + Color.OFFENCE + "Offence" + Color.RESET); Write.Line(0, 25, "[3] " + Color.DEFENCE + "Defence" + Color.RESET); Write.Line(0, 26, "[4] " + Color.ENDURANCE + "Endurance" + Color.RESET); Write.Line(0, 28, "[0] to Return"); string choice = Return.Option(); if (choice == "0") { Gladiators(); } else if (choice == "1") { g.action = Actions.Strength; Console.Clear(); Return.GladiatorInfo(g, 5, 6); Write.Line(0, 20, Color.NAME + g.name + Color.RESET + " is training " + Color.STRENGTH + "strength" + Color.RESET); Write.KeyPress(0, 28); } else if (choice == "2") { g.action = Actions.Offence; Console.Clear(); Return.GladiatorInfo(g, 5, 6); Write.Line(0, 20, Color.NAME + g.name + Color.RESET + " is training " + Color.OFFENCE + "offence" + Color.RESET); Write.KeyPress(0, 28); } else if (choice == "3") { g.action = Actions.Defence; Console.Clear(); Return.GladiatorInfo(g, 5, 6); Write.Line(0, 20, Color.NAME + g.name + Color.RESET + " is training " + Color.DEFENCE + "defence" + Color.RESET); Write.KeyPress(0, 28); } else if (choice == "4") { g.action = Actions.Endurance; Console.Clear(); Return.GladiatorInfo(g, 5, 6); Write.Line(0, 20, Color.NAME + g.name + Color.RESET + " is training " + Color.ENDURANCE + "endurance" + Color.RESET); Write.KeyPress(0, 28); } else { Train(g); } }
public ActionResult DeleteConfirmed(int id) { var PlayerId = User.Identity.GetUserId(); var PlayerUser = db.Users.Include("Gladiators").SingleOrDefault(u => u.Id == PlayerId); Gladiator gladiator = PlayerUser.Gladiators.SingleOrDefault(u => u.Id == id); gladiator.PreviousUser = PlayerUser.UserName; gladiator.DateOfDelete = DateTime.Today; PlayerUser.Gladiators.Remove(gladiator); // Remove the gladiator from the player gladiator list but saving it in gladiator database. db.SaveChanges(); return(RedirectToAction("Index")); }
public bool CanPerformAbility(Gladiator g) { if (Color == AbilityColor.Neutral) { return(true); } if (g.Adrenaline < Math.Abs(AdrenalineCost)) { return(false); } return(true); }
public void ExecuteOnOpponent(Gladiator gladiator) { if (IsSmirkingAgainst(gladiator.LastActiveColor)) { TinyMessengerHub.Instance.Publish <Msg.AbilitySmirked>(new Msg.AbilitySmirked(gladiator._Id)); ExecuteOnOpponent(gladiator, true); } else { ExecuteOnOpponent(gladiator, false); } }
public static void Main(string[] args) { //Creates arena Arena arena = new Arena("Armeec"); //Creates stats Stat firstGlariatorStat = new Stat(20, 25, 35, 14, 48); Stat secondGlariatorStat = new Stat(40, 40, 40, 40, 40); Stat thirdGlariatorStat = new Stat(20, 25, 35, 14, 48); //Creates weapons Weapon firstGlariatorWeapon = new Weapon(5, 28, 100); Weapon secondGlariatorWeapon = new Weapon(5, 28, 100); Weapon thirdGlariatorWeapon = new Weapon(50, 50, 50); //Creates gladiators Gladiator firstGladiator = new Gladiator("Stoyan", firstGlariatorStat, firstGlariatorWeapon); Gladiator secondGladiator = new Gladiator("Pesho", secondGlariatorStat, secondGlariatorWeapon); Gladiator thirdGladiator = new Gladiator("Gosho", thirdGlariatorStat, thirdGlariatorWeapon); //Adds gladiators to arena arena.Add(firstGladiator); arena.Add(secondGladiator); arena.Add(thirdGladiator); //Prints gladiators count at the arena Console.WriteLine(arena.Count); //Gets strongest gladiator and print him Gladiator strongestGladiator = arena.GetGladiatorWithHighestTotalPower(); Console.WriteLine(strongestGladiator); //Gets gladiator with the strongest weapon and print him Gladiator bestWeaponGladiator = arena.GetGladiatorWithHighestWeaponPower(); Console.WriteLine(bestWeaponGladiator); //Gets gladiator with the strongest stat and print him Gladiator bestStatGladiator = arena.GetGladiatorWithHighestStatPower(); Console.WriteLine(bestStatGladiator); //Removes gladiator arena.Remove("Gosho"); //Prints gladiators count at the arena Console.WriteLine(arena.Count); //Prints the arena Console.WriteLine(arena); }
private int GetDamage( Gladiator gladiator, int maneuverId ) { foreach ( Weapon w in gladiator.Weapons ) { foreach ( Maneuver m in w.Maneuvers ) { if ( m.Id == maneuverId ) return (int)Math.Floor( ( gladiator.Strength * w.ItemConditionId ) + ( w.Damage * m.Score ) * 0.5 ); } } return 0; }
private int GetDefense( Gladiator gladiator, int maneuverScore ) { int armor = 0; foreach ( Armor a in gladiator.Armor ) armor += ( a.Damage * a.ItemConditionId ); return maneuverScore * armor; }
private int GetEndurance( Gladiator gladiator, int maneuverId ) { foreach ( Weapon w in gladiator.Weapons ) { foreach ( Maneuver m in w.Maneuvers ) { if ( m.Id == maneuverId ) return m.Endurance; } } foreach ( Armor a in gladiator.Armor ) { foreach ( Maneuver m in a.Maneuvers ) { if ( m.Id == maneuverId ) return m.Endurance; } } return 0; }
public static void Register( long facebookId, string facebookName, Gladiator gladiator ) { AIIdentity.Register( facebookId, facebookName, gladiator ); }