public WeaponAttack(OffenseStats offense, CharacterSize size, IWeaponAttackStatistics weapon) { this.offenseAbilities = offense; this.size = size; this.Weapon = weapon; this.Name = weapon.Name; this.Range = weapon.Range; this.DamageType = weapon.DamageType.ToString(); this.CriticalThreat = weapon.CriticalThreat; this.CriticalModifier = new BasicStat(string.Format("{0} Critical Modifier", weapon.Name), weapon.CriticalModifier); this.attackBonus = new BasicStat(string.Format("{0} Attack Bonus", weapon.Name), weapon.AttackModifier); this.attackBonus.AddModifier(new WeaponProficiencyAttackModifier(this.offenseAbilities, this.Weapon)); this.attackBonus.AddModifiers(MultipleAttackBonusModifier.GetConditionalMultipleAttackModifiers()); this.DamageModifier = new BasicStat(string.Format("{0} Damage Modifier", weapon.Name), 0); foreach (var weaponModifier in offense.WeaponModifiers) { if (weaponModifier.WeaponQualifies(weapon)) { weaponModifier.ApplyModifier(this); } } }
public void Initialize(ComponentContainer components) { this.offense = components.Get <OffenseStats>(); this.sorcererLevels = components.Get <ClassLevel>(); this.charisma = components.Get <AbilityScores>().GetAbility(AbilityScoreTypes.Charisma); this.DamageModifier.AddModifier(new DelegateStatModifier(this.DamageModifier.Name, "bonus", () => { return(this.sorcererLevels.Level / 2); })); }
public void Initialize(ComponentContainer components) { this.offense = components.Get <OffenseStats>(); this.charisma = components.Get <AbilityScores>().GetAbility(AbilityScoreTypes.Charisma); this.sorcererLevel = components.Get <ClassLevel>(); this.CriticalModifier = new BasicStat("Heavenly Fire Critical Modifier", 2); }
public RangeAttack(OffenseStats offenseAbilities, CharacterSize size, IWeapon weapon) : base(offenseAbilities, size, weapon) { AttackBonus.AddModifier(new StatisticStatModifier("Range Attack Bonus", offenseAbilities.RangeAttackBonus)); this.AttackType = AttackTypes.Ranged; }
public ActionResult DeleteConfirmed(int id) { OffenseStats offenseStats = db.Offense.Find(id); db.Offense.Remove(offenseStats); db.SaveChanges(); return(RedirectToAction("Index")); }
public WeaponProficiencyAttackModifier(OffenseStats offenseAbilities, IWeaponAttackStatistics weapon) : base(weapon.Name + " Proficiency Modifier", "proficiency penalty") { this.offenseAbilities = offenseAbilities; this.weapon = weapon; this.Calculation = () => { return(this.offenseAbilities.IsProficient(weapon) ? 0 : -4); }; }
public MeleeAttack(OffenseStats offenseAbilities, AbilityScore strength, CharacterSize size, IWeaponAttackStatistics weapon) : base(offenseAbilities, size, weapon) { this.strength = strength; AttackBonus.AddModifier(new StatisticStatModifier("Melee Attack Bonus", offenseAbilities.MeleeAttackBonus)); DamageModifier.AddModifier(this.strength.UniversalStatModifier); this.AttackType = AttackTypes.Melee; }
public void SetUp() { var abilities = new AbilityScores(); abilities.SetScore(AbilityScoreTypes.Strength, 16); abilities.SetScore(AbilityScoreTypes.Dexterity, 16); var size = new SizeStats(CharacterSize.Small, 1, 1); inventory = new Inventory(); smallStats = new OffenseStats(abilities, size, inventory); }
public ActionResult Edit([Bind(Include = "Key,Player,TotalPlateAppearances,OfficialAtBats,TotalHits,BA,SLG,TotalBases,OBP,BOBP,SBP,HRR,SOR,OCR,RunsCreated")] OffenseStats offenseStats) { if (ModelState.IsValid) { db.Entry(offenseStats).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Player = new SelectList(db.Players, "PlayerID", "FirstName", offenseStats.Player); return(View(offenseStats)); }
// GET: OffenseStats/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OffenseStats offenseStats = db.Offense.Find(id); if (offenseStats == null) { return(HttpNotFound()); } return(View(offenseStats)); }
public OffenseStatsTests() { character = CharacterTestTemplates.AverageBob(); var abilities = character.Get <AbilityScores>(); abilities.SetScore(AbilityScoreTypes.Strength, 16); abilities.SetScore(AbilityScoreTypes.Dexterity, 14); var size = character.Get <SizeStats>(); size.SetSize(CharacterSize.Small, 1, 1); inventory = character.Get <Inventory>(); smallStats = character.Get <OffenseStats>(); meleeAttackBonus = character.Get <MeleeAttackBonus>(); rangeAttackBonus = character.Get <RangeAttackBonus>(); }
public ActionResult Create([Bind(Include = "Game,PlayerID,CoachID,PlateAppearances,Singles,Doubles,Triples,HRs,Walks,HBP,Scrifices,OnByFeildersChoice,TotalBases,OnByInterference,DroppedThirdStrike,StolenBases,StolenBaseAttempts,SO,OtherBattingOuts,RBIs,RunsScored")] SubmitOffense subOffense, OffenseStats offenseStats, TotalOffense totalOff) { if (ModelState.IsValid) { string user = User.Identity.GetUserId(); var coachRow = from row in db.Coaches where row.UserId == user select row; var coachRowResult = coachRow.FirstOrDefault(); subOffense.CoachID = coachRowResult.CoachID; TotalOffensesController total = new TotalOffensesController(); MorphingTables morph = new MorphingTables(); OffenseStatsController off = new OffenseStatsController(); db.SubmitOffenses.Add(subOffense); db.SaveChanges(); foreach (var item in db.GameOffenses) { if (item.PlayerID == subOffense.PlayerID) { total.Edit(subOffense.PlayerID, subOffense.CoachID, subOffense.PlateAppearances, subOffense.Singles, subOffense.Doubles, subOffense.Triples, subOffense.HRs, subOffense.Walks, subOffense.HBP, subOffense.Scrifices, subOffense.OnByFeildersChoice, subOffense.TotalBases, subOffense.OnByInterference, subOffense.DroppedThirdStrike, subOffense.StolenBases, subOffense.StolenBaseAttempts, subOffense.SO, subOffense.OtherBattingOuts, subOffense.RBIs, subOffense.RunsScored); return(RedirectToAction("Home", "Coaches")); } } total.Create(subOffense.PlayerID, subOffense.CoachID, subOffense.PlateAppearances, subOffense.Singles, subOffense.Doubles, subOffense.Triples, subOffense.HRs, subOffense.Walks, subOffense.HBP, subOffense.Scrifices, subOffense.OnByFeildersChoice, subOffense.TotalBases, subOffense.OnByInterference, subOffense.DroppedThirdStrike, subOffense.StolenBases, subOffense.StolenBaseAttempts, subOffense.SO, subOffense.OtherBattingOuts, subOffense.RBIs, subOffense.RunsScored, totalOff); off.Create(totalOff.PlayerID, totalOff.CoachID, totalOff.PlateAppearances, totalOff.Singles, totalOff.Doubles, totalOff.Triples, totalOff.HRs, totalOff.Walks, totalOff.HBP, totalOff.Scrifices, totalOff.OnByFeildersChoice, totalOff.TotalBases, totalOff.OnByInterference, totalOff.DroppedThirdStrike, totalOff.StolenBases, totalOff.StolenBaseAttempts, totalOff.SO, totalOff.OtherBattingOuts, totalOff.RBIs, totalOff.RunsScored); return(RedirectToAction("Home", "Coaches")); } ViewBag.PlayerID = new SelectList(db.Players, "PlayerID", "FirstName", subOffense.PlayerID); return(View(subOffense)); }