public Warrior() : base() { _myName = "Landorin"; _myClassName = "Warrior"; _mySprite = Resources.Load <Sprite>("UI/CharacterInfo/Sprites/" + _myClassName); _myHealth = 200; _myMaxHealth = _myHealth; _myMana = 100; _myMaxMana = _myMana; _myOffense = new AttackStats(20, 0, 75, 20); _myDefenses = new DefenseStats(5, 10, -5, -5, -5, -5, -5); _myWeapon = new Axe(); _myAbilites.Add(new DoubleSlash()); _mySpeed = Random.Range(5, 50); _myMovement = 2; _currMovement = _myMovement; _gridPos = Vector2.zero; _dead = false; }
/// <summary> /// Gets all defensive season statistics for all 32 NFL teams /// </summary> /// <returns>List of string[] Containing defensive season stats for all 32 NFL teams</returns> public List <Defense> GetSeasonStats() { string DefSeason = "/overall_team_standings.json"; List <Defense> defenses = new List <Defense>(); JArray allTeams = (JArray)JObject.Parse(Submit(DefSeason))["overallteamstandings"]["teamstandingsentry"]; Defense currentDefense; Team currentTeam; DefenseStats currentStats; foreach (JToken team in allTeams) { currentStats = new DefenseStats(); currentStats.pa = (string)team["stats"]["PointsAgainst"]["#text"]; currentStats.sck = (string)team["stats"]["Sacks"]["#text"]; currentStats.fum = (string)team["stats"]["FumForced"]["#text"]; currentStats.intc = (string)team["stats"]["Interceptions"]["#text"]; currentStats.intTd = (string)team["stats"]["IntTD"]["#text"]; currentStats.fumTd = (string)team["stats"]["FumTD"]["#text"]; currentStats.sfty = (string)team["stats"]["Safeties"]["#text"]; currentStats.krTd = (string)team["stats"]["KrTD"]["#text"]; currentStats.prTd = (string)team["stats"]["PrTD"]["#text"]; currentStats.fgBlk = (string)team["stats"]["FgBlk"]["#text"]; currentStats.xpBlk = (string)team["stats"]["XpBlk"]["#text"]; currentTeam = new Team((string)team["team"]["Abbreviation"]); currentDefense = new Defense(currentTeam.abbr, currentStats); defenses.Add(currentDefense); } Thread.Sleep(10000); return(defenses); }
public void EquippedArmorIncreasesYourDefenseAndYourFlatFootedDefenseButNotTouchDefense() { var bag = new ComponentContainer(); var inventory = new Inventory(); bag.Add(inventory); bag.Add(new AbilityScores()); bag.Add(new SizeStats()); var def = new DefenseStats(); def.Initialize(bag); var startAC = def.ArmorClass.TotalValue; var startFlat = def.FlatFootedArmorClass.TotalValue; var startTouch = def.TouchArmorClass.TotalValue; var armor = new Armor(); armor.ArmorClass = 10; inventory.AddGear(armor); inventory.EquipItem(armor); Assert.Equal(startAC + 10, def.ArmorClass.TotalValue); Assert.Equal(startFlat + 10, def.FlatFootedArmorClass.TotalValue); Assert.Equal(startTouch, def.TouchArmorClass.TotalValue); }
public ActionResult DeleteConfirmed(int id) { DefenseStats defenseStats = db.Defense.Find(id); db.Defense.Remove(defenseStats); db.SaveChanges(); return(RedirectToAction("Home", "Coaches")); }
public void CanAddArmorProficiencies() { var def = new DefenseStats( new AbilityScores(), new SizeStats(), new Inventory()); def.AddArmorProficiencies(new string[] { "Light", "Heavy" }); Assert.IsTrue(def.IsProficient(Leather())); }
public ActionResult Edit([Bind(Include = "Key,PlayerID,CoachID,Positions,Games,IP,TC,PO,Assists,Errors,FPCT,CoachID")] DefenseStats defenseStats) { if (ModelState.IsValid) { db.Entry(defenseStats).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PlayerID = new SelectList(db.Players, "PlayerID", "FirstName", defenseStats.PlayerID); return(View(defenseStats)); }
public void ModifiersCanBeAppliedToArmorClass() { var def = new DefenseStats( new AbilityScores(), new SizeStats(), new Inventory() ); var ac = def.ArmorClass(); def.ProcessModifier(new MockMod()); Assert.AreEqual(ac + 1, def.ArmorClass()); }
public void SetUp() { var abilities = new AbilityScores(); abilities.SetScore(AbilityScoreTypes.Strength, 16); abilities.SetScore(AbilityScoreTypes.Dexterity, 16); abilities.SetScore(AbilityScoreTypes.Constitution, 9); abilities.SetScore(AbilityScoreTypes.Wisdom, 12); var size = new SizeStats(CharacterSize.Small); smallStats = new DefenseStats(abilities, size, new Inventory()); }
public ActionResult Create([Bind(Include = "Key,PlayerID,CoachID,Positions,IP,TC,PO,Assists,Errors,FPCT")] DefenseStats defenseStats) { if (ModelState.IsValid) { db.Defense.Add(defenseStats); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PlayerID = new SelectList(db.Players, "PlayerID", "FirstName", defenseStats.PlayerID); return(View(defenseStats)); }
public void CanTrackImmunitiesAndOtherSpecialAbilites() { var def = new DefenseStats( new AbilityScores(), new SizeStats(), new Inventory()); var immune = new ImmunityModifier(); def.ProcessSpecialAbilities(immune); Assert.AreEqual("vs. Fire", def.Immunities.First().Condition); Assert.AreEqual("Evasion", def.DefensiveAbilities.First().Condition); }
// GET: DefenseStats/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DefenseStats defenseStats = db.Defense.Find(id); if (defenseStats == null) { return(HttpNotFound()); } return(View(defenseStats)); }
//incredibly specific constructor public Character(string name, string tileMoniker, TeamType team, int hp, int mp, int att, int mag, int acc, int crit, int baseDef, int PhysRes, int fireRes, int iceRes, int thunRes, int lightRes, int darkRes, int speed, int move, Weapons weapon, Vector2 startPos) { _myTeam = team; _myClassName = "Default"; _myName = name + tileMoniker; _myTileInfo = tileMoniker; _myHealth = hp; _myMaxHealth = hp; _myMana = mp; _myMaxMana = mp; _myOffense = new AttackStats(att, mag, acc, crit); _myDefenses = new DefenseStats(baseDef, PhysRes, fireRes, iceRes, thunRes, lightRes, darkRes); switch (weapon) { case Weapons.SWORD: _myWeapon = new Sword(); break; case Weapons.SPEAR: _myWeapon = new Spear(); break; case Weapons.AXE: _myWeapon = new Axe(); break; case Weapons.BOW: _myWeapon = new Bow(); break; case Weapons.STAFF: _myWeapon = new Staff(); break; case Weapons.GAUNTLET: _myWeapon = new Gauntlets(); break; default: break; } _mySpeed = speed; _myMovement = move; _gridPos = startPos; _dead = false; }
private void Initialize() { UnitLevel = new Level(200); Conditions = Condition.None; Primary = new PrimaryStats(); Secondary = new SecondaryStats(); Defense = new DefenseStats(); ElementDefense = new ArcaneElementStats(); ArmorTypes = new ArmorTypeStats(); WeaponTypes = new WeaponDamageTypeStats(); SetMajorStats(); }
private void Initialize(int[] primary, int[] secondary, int[] defense, int[] element, int[] armorType, int[] weaponType) { UnitLevel = new Level(200); Conditions = Condition.None; Primary = new PrimaryStats(primary); Secondary = new SecondaryStats(secondary); Defense = new DefenseStats(defense); ElementDefense = new ArcaneElementStats(element); ArmorTypes = new ArmorTypeStats(armorType); WeaponTypes = new WeaponDamageTypeStats(weaponType); SetMajorStats(); }
public DefenseStatsTests() { character = CharacterTestTemplates.AverageBob(); character.AbilityScores.SetScore(AbilityScoreTypes.Strength, 16); character.AbilityScores.SetScore(AbilityScoreTypes.Dexterity, 16); character.AbilityScores.SetScore(AbilityScoreTypes.Constitution, 9); character.AbilityScores.SetScore(AbilityScoreTypes.Wisdom, 12); character.Size.SetSize(CharacterSize.Small, 1, 1); basicStats = character.Get <DefenseStats>(); var emptyCharacter = CharacterTestTemplates.AverageBob(); emptyStats = emptyCharacter.Get <DefenseStats>(); }
public void UnEquippedArmorMakesNoDifference() { var inv = new Inventory(); var def = new DefenseStats( new AbilityScores(), new SizeStats(), inv ); var armor = new Armor(); armor.ArmorClass = 12; inv.AddGear(armor); Assert.AreEqual(0, def.EquippedArmorBonus()); }
public void ModifiersCanBeAppliedToSavingsThrows() { var def = new DefenseStats( new AbilityScores(), new SizeStats(), new Inventory() ); var will = def.WillSave.TotalValue; var fort = def.FortitudeSave.TotalValue; var reflex = def.ReflexSave.TotalValue; def.ProcessModifier(new MockMod()); Assert.AreEqual(will + 1, def.WillSave.TotalValue); Assert.AreEqual(fort + 1, def.FortitudeSave.TotalValue); Assert.AreEqual(reflex + 1, def.ReflexSave.TotalValue); }
public Mage() : base() { _myName = "Xavier"; _myHealth = 100; _myMaxHealth = _myHealth; _myMana = 200; _myMaxMana = _myMana; _myOffense = new AttackStats(5, 40, 60, 10); _myDefenses = new DefenseStats(5, 0, 20, 20, 20, 20, 20); _myWeapon = new Staff(); _mySpeed = Random.Range(0, 31); _myMovement = 2; _gridPos = Vector2.zero; _dead = false; }
//base constructor public Character() { _myName = "Bert"; _myClassName = "Default"; _myHealth = 100; _myMaxHealth = 100; _myMana = 100; _myMaxMana = 100; _myOffense = new AttackStats(10, 10, 75, 25); _myDefenses = new DefenseStats(10, 0, 0, 0, 0, 0, 0); _myWeapon = new Weapon(); _mySpeed = 10; _myMovement = 2; _gridPos = Vector2.zero; _dead = false; }
private bool HandleDangers(Squad squad, T[] Dangers, Delegates.DefenseFunction <T> Scorer) { Dangers = Dangers.Where(x => Scorer(x).rank > 0).ToArray(); SquadPushPlugin Pusher = new SquadPushPlugin(x => Dangers.Any(y => y.UniqueId == x.UniqueId) ? Scorer(x as T).rank : 0, true, PushMapper); if (!Dangers.IsEmpty() && squad.Count > 0) { Pusher.DoTurn(squad); Squad CurrentSquad = squad; foreach (T danger in Dangers.OrderBy(x => Scorer(x).rank)) { DefenseStats stats = Scorer(danger); Squad LocalSquad = CurrentSquad.OrderBy(x => x.Distance(danger)).Take(stats.amount).ToList(); LocalSquad.ForEach(x => x.Sail(danger)); CurrentSquad = CurrentSquad.FilterOutBySquad(LocalSquad); } return(true); } return(false); }
/// <summary> /// Gets defensive game statistics of a specified NFL team /// </summary> /// <param name="team">Contains specific team abbreviation (i.e. NYG for New York Giants)</param> /// <returns></returns> public List <Defense> GetGameStats() { List <Team> teams = new TeamRequest(new Season(season.year, season.playoffs)).GetTeams(); List <Defense> defenses = new List <Defense>(); foreach (Team team in teams) { Thread.Sleep(10000); string DefGames = "/team_gamelogs.json?team=" + team.abbr; JArray allGames = (JArray)JObject.Parse(Submit(DefGames))["teamgamelogs"]["gamelogs"]; Team currentTeam = team; Game currentGame; DefenseStats currentStats; DefenseGameStats currentGameStats; Defense currentDefense = new Defense(currentTeam.abbr, new List <DefenseGameStats>()); foreach (JToken game in allGames) { currentGame = new Game((string)game["game"]["id"]); currentStats = new DefenseStats(); currentStats.pa = (string)game["stats"]["PointsAgainst"]["#text"]; currentStats.sck = (string)game["stats"]["Sacks"]["#text"]; currentStats.fum = (string)game["stats"]["FumForced"]["#text"]; currentStats.intc = (string)game["stats"]["Interceptions"]["#text"]; currentStats.intTd = (string)game["stats"]["IntTD"]["#text"]; currentStats.fumTd = (string)game["stats"]["FumTD"]["#text"]; currentStats.sfty = (string)game["stats"]["Safeties"]["#text"]; currentStats.krTd = (string)game["stats"]["KrTD"]["#text"]; currentStats.prTd = (string)game["stats"]["PrTD"]["#text"]; currentStats.fgBlk = (string)game["stats"]["FgBlk"]["#text"]; currentStats.xpBlk = (string)game["stats"]["XpBlk"]["#text"]; currentGameStats = new DefenseGameStats(currentGame, currentStats); currentDefense.gameLogs.Add(currentGameStats); } defenses.Add(currentDefense); } Thread.Sleep(10000); return(defenses); }
public void ArmorCanLimitTheMaxDexterityBonus() { var bag = new ComponentContainer(); var inventory = new Inventory(); bag.Add(inventory); var abilities = new AbilityScores(); abilities.SetScore(AbilityScoreTypes.Dexterity, 18); bag.Add(abilities); bag.Add(new SizeStats()); var def = new DefenseStats(); def.Initialize(bag); var armor = new Armor(); armor.MaximumDexterityBonus = 1; inventory.EquipItem(armor); Assert.Equal(def.MaxDexterityBonus.TotalValue, 1); Assert.Equal(def.ArmorClass.TotalValue, 11); }
public void EquippedArmorIncreasesYourDefenseAndYourFlatFootedDefenseButNotTouchDefense() { //TODO: Not sure if inventory is correct, or if inventory items should have modifiers? var inventory = new Inventory(); var def = new DefenseStats( new AbilityScores(), new SizeStats(), inventory ); var startAC = def.ArmorClass(); var startFlat = def.FlatFootedArmorClass(); var startTouch = def.TouchArmorClass(); var armor = new Armor(); armor.ArmorClass = 10; inventory.AddGear(armor); inventory.EquipItem(armor); Assert.AreEqual(10, def.EquippedArmorBonus()); Assert.AreEqual(startAC + 10, def.ArmorClass()); Assert.AreEqual(startFlat + 10, def.FlatFootedArmorClass()); Assert.AreEqual(startTouch, def.TouchArmorClass()); }
//randomized constructor public Character(string name, string tileMoniker, TeamType team, Vector2 startPos) { _myTeam = team; _myClassName = "Default"; _myName = name + tileMoniker; _myTileInfo = tileMoniker; _myHealth = UnityEngine.Random.Range(50, 201); _myMaxHealth = _myHealth; _myMana = UnityEngine.Random.Range(50, 201); _myMaxMana = _myMana; int _myStrength = UnityEngine.Random.Range(5, 10); int _myMagic = UnityEngine.Random.Range(5, 10); int _myAccuracy = UnityEngine.Random.Range(10, 101); int _myCritChance = UnityEngine.Random.Range(10, 101); _myOffense = new AttackStats(_myStrength, _myMagic, _myAccuracy, _myCritChance); int _baseDef = UnityEngine.Random.Range(10, 11); int _physRes = UnityEngine.Random.Range(-100, 101); int _fireRes = UnityEngine.Random.Range(-100, 101); int _iceRes = UnityEngine.Random.Range(-100, 101); int _thunderRes = UnityEngine.Random.Range(-100, 101); int _lightRes = UnityEngine.Random.Range(-100, 101); int _darkRes = UnityEngine.Random.Range(-100, 101); _myDefenses = new DefenseStats(_baseDef, _physRes, _fireRes, _iceRes, _thunderRes, _lightRes, _darkRes); Weapons newWeapon = (Weapons)UnityEngine.Random.Range(0, (int)Weapons.GAUNTLET + 1); switch (newWeapon) { case Weapons.SWORD: _myWeapon = new Sword(); break; case Weapons.SPEAR: _myWeapon = new Spear(); break; case Weapons.AXE: _myWeapon = new Axe(); break; case Weapons.BOW: _myWeapon = new Bow(); break; case Weapons.STAFF: _myWeapon = new Staff(); break; case Weapons.GAUNTLET: _myWeapon = new Gauntlets(); break; default: break; } _mySpeed = UnityEngine.Random.Range(1, 101); _myMovement = UnityEngine.Random.Range(1, 3); _gridPos = startPos; _dead = false; }
public Warrior(string name, string tileMoniker, TeamType team, Vector2 startPos) : base(name, tileMoniker, team, startPos) { _myTeam = team; _myClassName = "Warrior"; _mySprite = Resources.Load <Sprite>("UI/CharacterInfo/Sprites/" + _myClassName); _myName = name + tileMoniker; _myTileInfo = tileMoniker; _myHealth = Random.Range(50, 201); _myMaxHealth = _myHealth; _myMana = 100; _myMaxMana = 100; int _myStrength = Random.Range(5, 20); int _myMagic = Random.Range(5, 20); int _myAccuracy = Random.Range(10, 101); int _myCritChance = Random.Range(10, 101); _myOffense = new AttackStats(_myStrength, _myMagic, _myAccuracy, _myCritChance); int _baseDef = Random.Range(10, 51); int _physRes = Random.Range(-100, 101); int _fireRes = Random.Range(-100, 101); int _iceRes = Random.Range(-100, 101); int _thunderRes = Random.Range(-100, 101); int _lightRes = Random.Range(-100, 101); int _darkRes = Random.Range(-100, 101); _myDefenses = new DefenseStats(_baseDef, _physRes, _fireRes, _iceRes, _thunderRes, _lightRes, _darkRes); Weapons newWeapon = (Weapons)Random.Range(0, (int)Weapons.GAUNTLET + 1); switch (newWeapon) { case Weapons.SWORD: _myWeapon = new Sword(); break; case Weapons.SPEAR: _myWeapon = new Spear(); break; case Weapons.AXE: _myWeapon = new Axe(); break; case Weapons.BOW: _myWeapon = new Bow(); break; case Weapons.STAFF: _myWeapon = new Staff(); break; case Weapons.GAUNTLET: _myWeapon = new Gauntlets(); break; default: break; } _mySpeed = Random.Range(1, 101); _myMovement = 2; _currMovement = _myMovement; _gridPos = startPos; _dead = false; }